Why AGENTS.md wasn’t enough on multi-file repos — the journey behind SodoNetwork v4.2.0
Hey everyone — Soner here from Istanbul.
Most AI coding tools focus on making models write code faster. I hit a different bottleneck the moment I moved past prototypes into real, multi-file production repos: getting autonomous agents to behave reliably once a session gets long and messy.
At first, I tried solving this with strict rule files (AGENTS.md, SKILL.md) and even stepping up through stronger models during audits. It helped—right up until context compacted or a task spanned multiple files. Three failure modes kept slipping past standard compilers:
- Silent code loss: agents lazily truncating functions (
# ... omitted for brevity ...) or editing files outside the agreed scope while keeping syntax completely valid. - Semantic blind spots: adding a critical state or isolation parameter with a default value, forgetting to pass it at a caller site, and watching both the compiler and the agent’s own test pass—because the model writing the code and the model writing the test shared the exact same blind spot.
- Plan drift: quietly skipping secondary files from an approved plan once the context window grew.
Prompt rules turned out to be soft pointers, not hard boundaries. So I moved the guardrails outside the LLM and built SodoNetwork (pip install sodonetwork)—a zero-dependency deterministic state machine and verification layer (with 13 native MCP tools) that works alongside Cursor, Claude, GitHub Copilot, Gemini, and local models.
Here is how a task actually flows through it in v4.2.0:
- Before edits begin: It locks the approved plan and allowed write targets, taking byte-exact snapshots upfront. If any cross-file link or integrity check fails later, one command rolls every touched file back cleanly.
- Right after edits (<5 ms): Deterministic AST gates check for lazy truncations, destructive file shrinks (>35%), phantom calls, breaking signature drift, dropped defaulted state parameters at caller sites, and asymmetric state updates across sibling methods—before slow build or test pipelines even start.
- Independent review & lean context: To stop the coding model from grading its own homework, it checks every locked plan file and produces a zero-prose evidence brief for a separate, read-only reviewer. It also injects only the regression rules relevant to the touched files (cutting pre-flight context overhead by ~95%) and seals each run in a tamper-evident, hash-chained audit ledger (
prev_hash -> record_hash).
To keep myself honest, I put the test suite out in the open (reproducible via GitHub Actions on Ubuntu and Windows):
- 220 Python stdlib cases:
py_compilesilently passed 180/180 AST-valid truncation/deletion defects; SodoNetwork caught 180/180 (0% false positives). - 32 multi-file TX & rollback scenarios: 32/32 passed (
p50: 0.91 ms). - 21 semantic AST & plan-matrix scenarios (v4.2.0): 21/21 passed (
p50: 1.56 ms,p95: 4.78 ms).
If you want to inspect it or try breaking the benchmark suite:
- PyPI: https://pypi.org/project/sodonetwork/4.2.0/
- Open Benchmarks: https://github.com/sonnerg2-oss/sodonetwork-benchmarks
- Architecture & Portal: https://sodonetwork.com
Curious how other builders here catch silent semantic drift from coding agents across multi-file repos—are you relying on CI and tests alone, or putting guardrails in front of the agent before it finishes?







Comments
0 comments