Code that depends on unwritten invariants the agent must reconstruct from context; bugs that violate the invariant surface far from the source.
Invariants live in code as runtime checks; the agent reads the assertion as a typed constraint that downstream code can take as a precondition without re-deriving it from caller context.
Before the refactoring
// rate must be positiveconst tax = base * rate;
After the refactoring
if (rate <= 0) throw new Error('rate must be positive');const tax = base * rate;
The agent must reconstruct invariants from surrounding code; bugs surface far from the source and tracing them costs reasoning hops.
Assertions used as control flow couple production behavior to debug-mode invariants; the agent that conflates the two ships a flow-dependent change disguised as documentation.
Invariants fail loudly at the source; the agent's debugging traces are short; assumptions become enforceable contracts.
Coupling production behavior to assertion presence/absence — the agent reads them as documentation but the runtime depends on them firing or not.