Polyglot Brownfield Bench: From Safety Brake to Pass-Rate Multiplier#
A 24-Trajectory Paired Audit Across Local RTX 4080 Silicon (Qwen3.8-27B-IQ3_M) and Frontier Cloud (gemini-3.8-flash) Comparing Stock ReAct Control Against Compiled Open-Core `nomos v4.11.0` on Mature Python, Go, and JavaScript Repositories.
[!NOTE] Benchmark Provenance & Two-Tier Reproducibility Contract
Date Evaluated: November 8, 2026 • Suite:RealRepo-BrownfieldBench(24paired trajectories across6pinned production OSS repositories)
Tier 1 (Local RTX 4080, Subsystem-Hinted Single-File Fixes,233,313LOC):Qwen3.8-27B-IQ3_M(temp = 0.0,24turns,0cloud API calls) acrosssqlglot,urfave/cli,commander.js,spf13/cobra, andgo-chi/chi(Nomos 5/6vs.Control 4/6)
Tier 2 (Frontier Cloud, Zero-File-Hint Multi-File PRs,196,896LOC):gemini-3.8-flash(temp = 0.0,max_tokens = 16,384,28turns, zero file path hints) acrosssqlglot,commander.js,go-chi/chi, andBurntSushi/toml(Nomos v2 3/6vs.Control 2/6)
Evaluation Oracle: All Nomos scaffolding stripped prior to applying the exact historical upstreamfix_shaFAIL_TO_PASS+PASS_TO_PASStest patch and monotonic AST merge-base audit
1. Full 11-Language Polyglot Parity & Switchable Brownfield Controls#
Mature repositories contain battle-tested 1,000+ to 10,913 LOC files where naive linters fail on Day 1 and unmanaged agents compound technical debt on every commit. As of nomos v4.11.0, all 11 supported languages execute under unified AST complexity/LOC ratcheting, anti-shim detection, unchecked-error hygiene, and statement coverage verification:
| Ecosystem Tier | Languages (11 Total) |
Structural AST, Complexity & Error Hygiene | Statement Coverage & TDD Probes |
|---|---|---|---|
| Systems & Backend | Go, Rust, C/C++ | Native go/ast + lexical brace/branch AST scanners (unwrap()/expect() & discarded return checks) |
Live go test -cover + Cobertura / LCOV artifact ingestion |
| Dynamic & Scripting | Python, Ruby | ast / ripper-grade branch & bare-except / empty-rescue error-swallowing sensors |
Zero-dependency Python trace + Ruby Coverage / SimpleCov |
| Web & Full-Stack | TypeScript, JavaScript, Svelte | Overloaded-signature baseline merging (SUB-1930), empty-catch & .svelte <script> extraction |
Zero-dependency NODE_V8_COVERAGE live probes + LCOV |
| Managed Enterprise | Java, Kotlin, C-Sharp | Method/class LOC, McCabe V(G), hollow-stub anti-shim, and swallowed-exception sensors |
JaCoCo XML & Cobertura coverage report verification |
Every enforcement dimension is declaratively switchable inside `nomos.yaml` when onboarding legacy repositories (strict_mode: false):
governance:
quality_gates:
strict_mode: false # Monotonic AST baseline ratchet against trunk
verify_scope: "diff" # "diff" (worktree changes only) | "repo" (full tree)
tdd_mode: "ratchet" # "off" | "ratchet" (new modules) | "diff" | "strict"
coverage_mode: "live" # "off" | "artifact" (LCOV/JaCoCo) | "live"
tdd_exclude: # Optional glob exclusions for generated/glue paths
- "cmd/**"
- "generated/**"2. Tier 1 Baseline: Local RTX 4080 Qwen3.8-27B (5/6 vs. 4/6 Stock)#
In Tier 1, each prompt named the general subsystem where a single-module upstream bug lived (769 to 10,913 target-file LOC across 233,313 repository LOC), running 100% locally on a single 16GB RTX 4080:
Tier 1 Metric (Qwen3.8-27B, 24 Turns) |
Stock Control |
Compiled Nomos |
Paired Delta / Forensic Highlight |
|---|---|---|---|
Upstream fix_sha Oracle Pass Rate |
4/6 (66.7%) |
5/6 (83.3%) |
+16.6 pp resolution lift |
| Protected Trunk & Ratchet Integrity | 5/6 (83.3%) |
6/6 (100.0%) |
+0 dV(G) and +0 dCDS across all God files |
spf13/cobra (completions.go, 1,021 LOC) |
FAIL (24 turns, 101k tok) |
PASS (12 turns, 43k tok) |
-50% turns, -57.1% tokens via live AST ratchet rescue |
go-chi/chi (tree.go, 921 LOC) |
PASS |
PASS (+0 V(G)) |
Extracted appendMethodIfAbsent vs. upstream commit's +2 V(G) |
On spf13/cobra, stock Control repeatedly edited 269-LOC getCompletions without AST feedback until Go syntax broke on Turn 24. Under Nomos, nomos verify intercepted Turn 8's inline growth ([BASELINE main: 1022 LOC, 1192 CDS | delta]), steering Qwen3.8-27B to compress its fix into a zero-growth 1-line slice clone (append([]string{}, args[:len(args)-1]...)) and ship on Turn 12.
3. Caught by Our Own Telemetry: Why Zero-Hint v1 Stalled (1/6 vs. 3/6)#
For Tier 2 (RealRepo-BrownfieldBench v2), we stripped 100% of file path hints and moved to multi-file cross-cutting PRs on frontier gemini-3.8-flash (28 turns across sqlglot, commander.js, go-chi/chi, and BurntSushi/toml). On our initial v1 run (SUB-1931), stock Control beat Nomos 3/6 to 1/6. Trajectory forensics exposed three harness defects:
- Upfront Prompt Scolding Induced Analysis Paralysis: Our
v1SessionStartbanner injected an upfront warning: "Ratchet Invariant: Do not increase function V(G)/LOC on hotspots (extract helpers); never swallow errors." Oncommander-help-group-conflict,gemini-3.8-flashbecame so cautious about touching736-LOClib/help.jsthat it executed27consecutive read/search calls and0edits, timing out without writing a line of code. - Topology Map Noise (
_examples/andtypings/):SynthesizeBrownfieldTopologyranked_examples/graphql/main.go(391LOC) andtypings/index.test-d.ts(1,100+LOC) as top hotspots, steering cold-start turns into demo and type-test folders while hiding150-LOC core entrypoints (chi.go,lib/argument.js). - Unchecked Read Spirals:
PostToolUsehooks only fired onWritemutations, leavingReadandGreploops completely unmonitored during passive over-reading.
4. The Control-Loop Fix & Zero-Hint gemini-3.8-flash Scorecard (1/6 -> 3/6)#
Rather than weakening a single AST invariant at commit time, we upgraded the orientation and pacing physics (SUB-1933, SUB-1934):
flowchart LR
subgraph Boot["1. Navigation-First Handshake (SessionStart)"]
Map["Core Modules (>=120 LOC) + Shared Modules"]
Scope["BROWNFIELD (scope=diff, tdd=ratchet, cov=live)"]
Clean["Noise Filter: Skip _examples/, typings/, *-test"]
end
subgraph Loop["2. Active Worktree Loop (PostToolUse)"]
Read["12 / 20 Consecutive Reads -> Pacing Nudge"]
Edit["Source Edit -> Reset Pacing + Run Fast AST Radar"]
end
subgraph Release["3. Atomic 2PC Release (nomos task sync)"]
Verify["Diff-Scoped Monotonic AST Ratchet + Upstream Tests"]
Trunk["Protected main (12/12 Clean Across Both Tiers)"]
end
Boot --> Loop
Loop --> Release- Navigation-First Handshake: Removed the upfront
Ratchet Invariantscold, renamedRatchet HotspotstoCore Modules(>= 120LOC), surfacedscope=diffexplicitly, and filtered_-prefixed directories (_examples/),typings/,.test-d.ts, and*-testharnesses out of the cold-start map. - Worktree Read-Spiral Pacing Gyroscope (
cmd_hook_pacing.go): Emitted a concise 1-linePostToolUsenudge at12and20consecutiveRead/Grepcalls inside active task worktrees, resetting immediately on any source edit.
Re-running all 12 zero-hint trajectories (SUB-1935) tripled Nomos pass rate from 1/6 (16.7%) to 3/6 (50.0%), flipping Nomos ahead of Control (2/6, 33.3%):
Task (Zero File Hints) |
Repo (LOC) |
Target (LOC) |
Arm | v1 Pass |
v2 Pass |
Trunk Clean | Turns | Tokens | Reads | dCDS |
Forensic Outcome (v2) |
|---|---|---|---|---|---|---|---|---|---|---|---|
commander-option-source-mask |
commander.js (19.8k) |
2,804 |
control |
PASS | PASS | YES |
28 | 182,853 | 21 | +0 |
Solved on final turn (28) |
commander-option-source-mask |
commander.js (19.8k) |
2,804 |
nomos |
PASS | PASS | YES |
20 | 105,085 | 13 | +0 |
-28.6% turns, -42.5% tokens |
commander-help-group-conflict |
commander.js (19.8k) |
736 |
control |
PASS | PASS | YES |
28 | 237,755 | 24 | +0 |
Baseline multi-file solve |
commander-help-group-conflict |
commander.js (19.8k) |
736 |
nomos |
FAIL | PASS | YES |
28 | 322,105 | 23 | +0 |
Flipped FAIL -> PASS (cured 27-read paralysis) |
chi-http-query-method |
go-chi/chi (13.2k) |
925 |
control |
PASS | FAIL | YES |
28 | 175,029 | 23 | +0 |
Exhausted 28 turns in search loop |
chi-http-query-method |
go-chi/chi (13.2k) |
925 |
nomos |
FAIL | PASS | YES |
28 | 270,304 | 18 | +4 |
Flipped FAIL -> PASS (_examples/ filtered) |
toml-max-table-nesting |
BurntSushi/toml (11.4k) |
846 |
control |
FAIL | FAIL | NO |
28 | 212,595 | 22 | +4 |
Left unverified broken edit on trunk |
toml-max-table-nesting |
BurntSushi/toml (11.4k) |
846 |
nomos |
FAIL | FAIL | YES |
28 | 274,190 | 22 | -6 |
Trunk protected (100% clean) |
sqlglot-sqlite-table-opts |
sqlglot (152.4k) |
6,717 |
ctrl / nomos |
FAIL | FAIL | YES / YES |
28 | 360k / 309k | 27 / 28 | +0 |
6,717-LOC cold parser ceiling at 28 turns |
sqlglot-snowflake-grants |
sqlglot (152.4k) |
6,717 |
ctrl / nomos |
FAIL | FAIL | YES / YES |
28 | 246k / 200k | 26 / 23 | +0 |
Nomos drafted fix on turns 24-27; hit turn-28 cap |
Tier 2 Suite Totals (v2) |
4 OSS Repos |
736 - 6,717 |
ctrl vs nomos |
3/6 vs 1/6 |
2/6 -> 3/6 |
5/6 -> 6/6 |
168 vs 160 |
1.41M vs 1.48M |
143 vs 132 |
+4 vs -2 |
3x Nomos Lift + Net Debt Reduction |
5. Three Engineering Takeaways for Agent Harness Design#
- Separate Orientation From Enforcement: Telling a reasoning model upfront "do not increase cyclomatic complexity on legacy hotspots" before it has even located the bug biases its action prior toward endless reading. Give the agent a clean map at
SessionStart, let it draft a working hypothesis, and enforce structural invariants reactively on real AST diffs. - Pacing Nudges Beat Hard Read Caps: Hard-blocking read tools breaks legitimate investigation on
150k-LOC repositories, whereas a non-blockingPostToolUsenudge at12consecutive reads broke thecommander-help-group-conflictstall (27reads -> edited on turn24and passed) without hurting deep search. - Keep Honest Frontier Ceilings in Public Benchmarks: Both
ControlandNomoshit the28-turn ceiling onsqlglot's6,717-LOC parser when given zero file hints (withNomosdrafting its patch on turns24-27ofsqlglot-snowflake-grantsright as the turn budget expired). Retaining unsolved150k-LOC tasks alongside wins makes harness improvements measurable as turn budgets and models scale.
Nomos