A small worked example of how I get coding agents to build Petri nets that are valid and that say what I mean. The toolchain is Velocitron, my 0.1.0 alpha library for typed colored Petri nets.
The net: two workers share one lock. Whoever takes it gets a 30-second lease. A holder that finishes inside its lease commits and gives the lock back. A holder that stalls past its lease loses the lock and goes back in line.
When an agent draws a diagram or writes prose, the feedback it gets is opinion. When it writes .petrinet source, the feedback comes from a parser, a validator and a prover: an error code, a line and column, and the exact gate or count that failed. That feedback is local (it points at an arc), exact (token.now = 31, binding.working_a[0].expiresAt = 30) and machine-readable (exit codes, --json). An agent can act on it without me, and it can't talk its way past it.