ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

You Can't Prompt Your Way Into System Invariants

Every time someone asks how an agentic system handles invariants, half the replies boil down to "put it in the system prompt" or "add a self-reflection step." That is not an invariant. That is a polite suggestion. Context windows drift, threads compact, and models hallucinate under pressure. If a r

dev.toMontag 19:51 · 23.11.2 Min. Lesezeit
Bild: dev.to

Every time someone asks how an agentic system handles invariants, half the replies boil down to "put it in the system prompt" or "add a self-reflection step."

That is not an invariant. That is a polite suggestion.

Context windows drift, threads compact, and models hallucinate under pressure. If a rule only exists inside an LLM's working memory, it is going to break the moment things get noisy. Invariants belong in the substrate—the storage layer, the AST, and the execution boundary—not in prose.

That is the exact reason I built SignalMesh the way I did. Instead of treating the codebase as a giant text dump that an agent re-reads and guesses over every turn, the mesh charts the project into a local, coordinate-addressable SQLite + FTS5 gridstack and enforces the rules mechanically.

An agent should never be able to silently rewrite history or leak secrets just because it had a bad turn.

Asking an LLM to "make sure you didn't break anything" with recursive grep sweeps is slow, expensive, and unreliable. Structural rules should be deterministic queries against the codebase graph:

# Flag truncating open(..., 'w') calls vs. atomic writes (os.replace / durable_write) python3 signalmesh_gridstack.py audit writes # Compute transitive import closures from shipping entrypoints python3 signalmesh_gridstack.py audit reach main # Surface unimported dead modules ordered by LOC python3 signalmesh_gridstack.py audit orphans # Catch unbounded while True / background runtime loops python3 signalmesh_gridstack.py audit loops Enter fullscreen mode Exit fullscreen mode No guessing, no burning 40k tokens reading files to check if a write is atomic. Either the AST passes the invariant or it doesn't.

Indexing alone isn't enough if coordinates drift or interfaces silently rot. To make the mesh a real enforcement layer, three other invariants have to hold:

If your architecture relies on an agent remembering to follow the rules, you don't have invariants—you have vibes.

Lock history down in the database. Mask secrets before ingestion. Check structural rules with AST audits. Gate contracts and syncs mechanically. Verify the live surface in a real browser. When the mesh enforces the invariants, the agent doesn't have to be trusted—it just has to operate inside the rails.

Quelle: dev.to (dev.to). Original öffnen