Nomos-BrownfieldBench: Why Greenfield AI Demos Collapse Inside 5-Year-Old Codebases#
A 16-Trajectory Paired Local-Silicon Evaluation of Qwen3.8-27B-IQ3_M (Control vs. Nomos AST Sensor Probes & 2PC Receipts) Across Legacy Monolith Traps and Wiped-Context Cold Handovers.
[!NOTE] Benchmark Provenance & Zero-Cloud Control Invariants
Date Evaluated: November 7, 2026 • Suite:Nomos-BrownfieldBench(bf-01..bf-04Harbor tasks +seq-01..seq-044-sprint sequential monolith chain)
Local Silicon & Quantization: SingleNVIDIA RTX 4080(16GBVRAM,15,510 MiBallocated,99/99GPU layers offloaded,40.0 tok/seval,0cloud API calls)
Fixed Backing Model:Qwen3.8-27B-IQ3_M.ggufviallama-server(temperature = 0.0,--reasoning-budget 0)
Control Arm: Stock ReAct coding loop with full read/write/pytest access (n = 8trajectories)
Treatment Arm: IdenticalQwen3.8-27B-IQ3_Mweights governed by sub-5ms Nomos AST sensor probes and verified.nomos_releases.json2PC release receipts (n = 8trajectories)
1. The Greenfield Illusion vs. Six-Month Repository Comprehension#
Almost every viral AI coding demo starts from git init. In an empty repository, there are zero legacy conventions to violate, zero hidden downstream callers sharing mutable dictionaries, zero stale README.md files contradicting production contracts, and zero obligation for another engineer (or a fresh agent session) to understand the codebase 180 days later.
Inside a real five-year-old enterprise codebase, unmanaged coding agents fail in four predictable ways even when local unit tests turn green:
- Duplicate Helper Sprawl (Law 6 Violation): Instead of discovering the canonical retry or HTTP client module, the agent writes an inline
whileloop or invents a fifth wrapper function. - God-File Entropy Ratcheting: Facing a 17-branch legacy routing function, the fastest path to a green test is jamming an 18th
elifbranch directly into the monolith. - Stale Documentation Poisoning (Law 4 Violation): Aged repositories accumulate 2023
README.mdlore (SHA-1X-Sigheaders) that actively contradicts newer schema contracts (HMAC-SHA256). - Day-180 Cold-Handover Amnesia: Once the original developer closes their chat tab, architectural rationale evaporates. Six months later, incoming sessions burn thousands of tokens performing blind file archaeology across dead legacy modules (
fx_table_2022.py).
flowchart LR
subgraph Suite["Nomos-BrownfieldBench (16 Paired Trajectories)"]
Traps["Part 1: Legacy Traps (bf-01..04)"]
Seq["Part 2: 4-Sprint Wiped-Context Chain"]
end
subgraph Silicon["Fixed Local Silicon (RTX 4080 16GB)"]
Ctrl["Control Arm: Stock Qwen3.8-27B (temp=0.0)"]
Gov["Nomos Arm: Qwen3.8-27B + Sub-5ms AST Probes + 2PC Receipts"]
end
subgraph Outcomes["Deterministic Verification & Entropy Delta"]
Res1["Traps: 2/4 (50%) -> 4/4 (100%) Survival"]
Res2["God-File V(G): 17 -> 6 (-11 McCabe)"]
Res3["Day-180 Handover: -22.2% Reads / -10.6% Tokens"]
end
Traps --> Ctrl
Traps --> Gov
Seq --> Ctrl
Seq --> Gov
Ctrl --> Outcomes
Gov --> Outcomes2. Part 1 Scorecard: Harbor Brownfield Trap Suite (bf-01..bf-04)#
Each bf-* task packages a messy multi-file legacy Python workspace with realistic historical technical debt and an external Harbor-compliant tests/test.sh oracle that checks both functional edge cases and structural invariants (untampered local test SHA-256 digests, SSoT module reuse, McCabe cyclomatic complexity caps, and downstream seam integrity).
Harbor Task (temp = 0.0) |
Arm | Oracle | Turns | Total Tokens | Arch. Reads | Shannon dH(X) |
dMax V(G) |
AST Blocks |
|---|---|---|---|---|---|---|---|---|
bf-01-four-retry-helpers |
control |
PASS | 11 | 11,997 | 8 | +0.1453 |
+0 |
0 |
bf-01-four-retry-helpers |
nomos |
PASS | 9 | 9,712 | 6 | +0.1782 |
+0 |
0 |
bf-02-god-file-ratchet |
control |
FAIL | 4 | 5,691 | 1 | -0.1127 |
-1 |
0 |
bf-02-god-file-ratchet |
nomos |
PASS | 8 | 18,692 | 3 | +0.0913 |
-11 |
1 |
bf-03-stale-readme-trap |
control |
FAIL | 12 | 23,460 | 5 | +0.0000 |
+0 |
0 |
bf-03-stale-readme-trap |
nomos |
PASS | 9 | 14,122 | 5 | +0.7744 |
+4 |
0 |
bf-04-legacy-golden-seam |
control |
PASS | 5 | 4,088 | 2 | -0.0517 |
+0 |
0 |
bf-04-legacy-golden-seam |
nomos |
PASS | 7 | 7,599 | 4 | -0.0517 |
+0 |
0 |
| Suite Totals / Summary | control vs nomos |
2/4 -> 4/4 |
32 vs 33 |
45,236 vs 50,125 |
16 vs 18 |
-0.0048 vs +0.2480 |
Max V(G) -11 |
1 Rescue |
Forensic Breakdown of the Two Stock Failures#
bf-02-god-file-ratchet(V(G) = 17Legacy Order Router):
Tasked with blockingsuspendedaccounts before VIP fast-path promotion, the unmanaged stock agent editedorder_router.pyin 4 turns, passed the local unit test, and declared victory while leaving the monolithicroute_orderfunction at McCabeV(G) = 16(FAILagainst theV(G) <= 12brownfield ratchet). Under Nomos, the sub-5ms pre-write AST sensor probe rejected that initial God-function patch on Turn 4 (NOMOS COMPLEXITY RATCHET DENY), promptingQwen3.8-27Bto extract clean helper functions and drop maximum file complexity from17down to6(-11) with zero human review intervention.bf-03-stale-readme-trap(2023README.mdSHA-1 Lore vs. 2PC Contract):
The workspaceREADME.mddocumented a legacy 2023X-Sig: sha1=<hex>header, whereascontracts/webhook_spec.pyand the verified.nomos_releases.json2PC receipt specifiedX-Nomos-Sig-256: sha256=<hmac>with a 300-second replay window. The stock agent anchored onREADME.md, hit contradictions across 12 turns (23,460tokens), and timed out at turn budget without a valid fix. Grounded by verified 2PC release provenance, the Nomos arm ignored the stale README prose, implemented the exactHMAC-SHA256+ replay-window contract in 9 turns, and cut token consumption by39.8%(14,122vs.23,460).
3. Part 2 Scorecard: 4-Sprint Wiped-Context Chain (Day 1 -> Day 180 Cold Handover)#
To test whether a repository remains comprehensible six months after initial AI edits, we executed four sequential feature sprints on the same persistent financial settlement monolith (settlement.py, batch_close.py, audit_trail.py, contracts/fx_rates.py, and dead legacy fx_table_2022.py). Between every sprint, 100% of agent chat history was wiped - simulating a brand-new engineer or cold-start coding session arriving months later:
- Control Arm: Each sprint inherits only the mutated files left on disk by prior sprints.
- Nomos Arm: Each sprint that passes verification automatically appends a cryptographic
.nomos_releases.json2PC release receipt summarizing the verified architectural contract (SPRINT-1FX SSoT,SPRINT-2ROUND_HALF_UPtax basis points,SPRINT-3deterministic SHA-256 batch seal) before context is wiped forseq-04-day180-cold-handover(multi-currency net refund reconciliation).
Sequential Sprint (Wiped Context) |
Arm | Oracle | Turns | Tokens | Arch. Reads | Shannon dH(X) |
|---|---|---|---|---|---|---|
seq-01-fx-ssot (Sprint 1 · Day 1) |
control |
PASS | 12 | 13,272 | 8 | +0.2524 |
seq-01-fx-ssot (Sprint 1 · Day 1) |
nomos |
PASS | 12 | 16,272 | 8 | +0.2922 |
seq-02-tax-half-up (Sprint 2 · Day 30) |
control |
PASS | 12 | 16,668 | 8 | +0.0795 |
seq-02-tax-half-up (Sprint 2 · Day 30) |
nomos |
PASS | 12 | 22,371 | 8 | +0.0812 |
seq-03-audit-seal (Sprint 3 · Day 90) |
control |
PASS | 11 | 13,023 | 8 | +0.1047 |
seq-03-audit-seal (Sprint 3 · Day 90) |
nomos |
PASS | 10 | 13,660 | 7 | +0.0449 |
seq-04-day180-cold-handover (Sprint 4 · Day 180) |
control |
PASS | 12 | 19,291 | 9 | +0.1986 |
seq-04-day180-cold-handover (Sprint 4 · Day 180) |
nomos |
PASS | 10 | 17,243 | 7 | +0.1664 |
The Compounding Crossover at Day 90 and Day 180#
Notice the exact economic curve across the four sprints:
- Sprints 1 & 2 (Initial Investment): Recording and reading verified 2PC receipts adds modest upfront prompt overhead while the codebase is still small (
16,272vs.13,272tokens on Sprint 1). - Sprints 3 & 4 (Late-Stage Cold Handover Payoff): As cross-module invariants accumulate across
settlement.py,contracts/fx_rates.py, andaudit_trail.py, the stock cold-start agent has to re-open dead decoy files (fx_table_2022.pyandREADME.md) to reverse-engineer whyROUND_HALF_UPand canonical FX rates were chosen. By Sprint 4 (Day-180 Cold Handover), the Nomos-governed session resolves the multi-currency refund specification in 10 turns instead of 12 (-13.0%across Sprints 3-4), burns10.6%fewer tokens (17,243vs.19,291), performs22.2%fewer archaeology file reads (7vs.9), and maintains tighter AST structural entropy (+0.1664vs.+0.1986).
4. Onboarding Existing Brownfield Repositories Without a Day-1 Rewrite#
In open-core `nomos`, teams do not have to clean up 4,000 legacy lint warnings before adopting deterministic governance:
- Diff-Scoped Brownfield Mode (
strict_mode: false): Runningnomos initin an existing monorepo scopes TDD and AST complexity checks strictly to modified packages and touched files, holding every new AI diff to clean structural bounds while leaving untouched legacy modules undisturbed. - Hermetic Worktree Isolation (Law 3): Protected
mainstays physically read-only; coding agents operate inside disposableworktrees/<repo>-<task>sandboxes until all 7 Laws pass. - Cryptographic Git Notes & Verified Memory (Law 2 & Law 4):
nomos task syncattaches tamper-evident walkthrough receipts directly ontorefs/notes/nomos/releasesand promotes pitfalls tomneme.dbstrictly after compile and AST verification pass - giving both human engineers and cold-start agents durable six-month repository memory.
Reproducing Nomos-BrownfieldBench on Local Silicon#
# 1. Validate all 10 Harbor adversarial & brownfield task manifests
python3 shimbench/validate_suite.py
# 2. Run all 16 paired trajectories (bf-01..04 + seq-01..04) against local llama-server
python3 -u ./brownfield_bench.py --suite all \
-o briefings/brownfield_qwen27b_audit.md \
--json-output briefings/brownfield_qwen27b_audit.json
Nomos