TraceTrial-Bench 7-Pillar Harness Reliability & Fail-Closed Stress Specification
1. Executive Summary & Problem Statement#
Contemporary agent benchmarks evaluate model generation in isolation while holding the orchestration harness constant. Trial by Trace (TraceTrial-Bench, arXiv:2610.32285) shows coding agents succeed or collapse across seven pillars: Context, Execution, Governance, Lifecycle, Observability, Tools, and Verification.
In Nomos, prompts remain advisory while the compiled Go substrate remains statutory. A statutory harness rejects execution fail-closed under adversarial mutation, boundary escape attempts, and runtime probe panics:
- Worktree Boundary Escape (Law 3): Git hooks and
nomos hook pre-toolblock writes outsideworktrees/<repo>-<task>/and block commits on trunk. - Statutory Configuration Tampering (Law 4 & Law 7): Task worktrees cannot relax gate thresholds, disable
strict_mode, or disableboundary.enforcerelative to trunknomos.yaml. - Gate Panic Abort (Law 2 & Law 5):
TimedEvaluatecatches gate panics andnomos task syncaborts before merging or writing release receipts.
2. Axiomatic Invariants & Governing Laws#
2.1 Trunk Statutory Baseline Pinning (ThresholdIntegrityGate)#
When nomos verify executes inside an isolated task worktree (ctx.WorktreePath != "" and filepath.Clean(ctx.WorktreePath) != filepath.Clean(ctx.RepoRoot)):
- Substrate Plane Rejection:
PlaneSeparationGaterejects any modification to rootnomos.yamlorintent/files within aSUB-*task (ERR_CROSS_PLANE_MUTATION). - Intent Plane Downgrade Rejection: Inside an
INT-*worktree,ThresholdIntegrityGateloads the canonical trunk configuration fromctx.RepoRoot:- Downgrading
governance.quality_gates.strict_modefromtruetofalsereturnsPassed: false. - Downgrading
governance.boundary.enforcefromtruetofalsereturnsPassed: false. - Lowering
governance.quality_gates.intent_twin_moderank (for example"feat"to"off") returnsPassed: false. - Relaxing statutory ceilings (
max_file_loc > 400,max_func_loc > 60,max_complexity > 15,min_coverage < 55.0) rejects verification.
- Downgrading
- Brownfield Root Compatibility: Evaluating directly on a brownfield root (
ctx.WorktreePath == "") honors the repository owner's trunkstrict_modebaseline.
2.2 Gate Runtime Panic Recovery (TimedEvaluate)#
In substrate/src/nomos/modules/verify/gate.go, TimedEvaluate(g Gate, ctx *VerifyContext) wraps g.Evaluate(ctx) in a defer recover() boundary:
- A runtime panic
rconverts into a typedNomosError(ERR_CORE:"gate <Name> panicked during evaluation (fail-closed abort): <r>"). Pipeline.Executetreats any non-nilerrfromTimedEvaluateas an immediate abort, leaving trunk untouched.
2.3 Native Compiled nomos hook Subcommands & Container Mode (INT-863 / SUB-1546)#
Nomos ships zero-dependency Go subcommands (nomos hook session-start, nomos hook pre-tool, nomos hook post-tool) removing external jq, bash, or python3 requirements:
- Unified JSON Payload Ingestion: Each subcommand parses standard
stdinhook payloads from Claude Code (tool_name,tool_input), Cursor, and Antigravity (toolCall.name,toolCall.args,cwd). - PreToolUse Guards (
nomos hook pre-tool- Law 3 & Law 7):- Unexpanded Variable Guard: Rejects native file-edit tool calls whose target path contains unexpanded
$VAR,${VAR}, or leading~tokens. - Boundary Containment: Standard mode rejects writes outside
/worktrees/,/.tmp/, and/brain/with a HATEOAS remedy (nomos task chore "<title>"). Passing--hermetic-dir <dir>confines writes to<dir>while protecting OS roots (/etc,/usr,/bin,/var,/proc,/sys,/dev,/boot). Passing--container-sandboxpermits container OS paths while blocking verifier and oracle roots (/logs/verifier,/solution,/tests). - Command Safety & Encapsulation Guard: Inspects shell tool invocations (
Bash,bash,run_command,execute_command) and denies:- Wildcard or root recursive deletions (
rm -rf /,rm -rf /*,rm -rf *,rm -rf ~,rm -rf ..). - Quote-aware
go installofnomosornomos-*outside a cleanIDLEprimarymaintrunk, or with@latest/-overlay/-modfile/-Cflags (Law 4). - Direct
sqlite3mutations or queries against.nomosor.dbfiles under Law 1 and the Database Encapsulation Invariant. - Stateful
git stashmutations (allowing read-onlygit stash list/git stash clear). - Tampering with
.git/hooksdefense scripts (rm,unlink,chmod,mv).
- Wildcard or root recursive deletions (
- Unexpanded Variable Guard: Rejects native file-edit tool calls whose target path contains unexpanded
- PostToolUse Channel Purity (
nomos hook post-tool- Law 4):- Silent Non-Edit Channels: Emits
{}immediately forBash,Read, andMCPcalls so native OS errors (EACCES,ENOENT) remain unmasked. - In-Memory Syntax & Radar Verification: Validates edited
.go,.py,.json,.jsonl, and.yamlfiles in memory without writing.tmp/scratch files.
- Silent Non-Edit Channels: Emits
- Additive Hook Chaining & 3-Strike Circuit-Breaker (
INT-868/SUB-1560):- Additive Hook Chaining:
nomos initandnomos hookchain existing.claude/settings.jsonhooks additively instead of shadowing task-localOandTplugins. - 3-Strike Loop Breaker:
nomos hook pre-toolhashes(tool_name, sha256(canonical_args), workspace_mtime_digest). Three identical consecutive calls without aworkspace_mtime_digestmutation trigger a 1-line remediation directive halting the retry loop.
- Additive Hook Chaining:
3. Seven-Pillar Statutory Mapping & Go SSoT Contracts#
| Pillar | Benchmark Dimension | Nomos Enforcement Seam |
|---|---|---|
| 1. Context | Repository-scoped orientation | SynthesizeDynamicHandshake injects scoped wavefronts, directives, and mneme.db patterns. |
| 2. Execution | Hermetic filesystem confinement | nomos hook pre-tool and pre-commit block path escapes. |
| 3. Governance | Rubric immutability and plane separation | PlaneSeparationGate and ThresholdIntegrityGate pin nomos.yaml to trunk. |
| 4. Lifecycle | Crash-safe 2PC state transitions | TimedEvaluate catches panics; nomos task sync aborts cleanly. |
| 5. Observability | Cryptographic provenance and distillation | nomos task sync seals refs/notes/nomos/releases and distills patterns. |
| 6. Tools | Sanctioned wrappers and zero symlinks | nomos hook pre-tool and ZeroFilesystemAliasGate block unsafe calls. |
| 7. Verification | Multi-gate AST shortcut rejection | AntiShimGate, SecretGate, and GateIntegrityProofGate reject shortcuts. |
3.1 Compiled Go SSoT Hardening Contracts (substrate/src/nomos/modules/verify/)#
gate.go and gates_intent.go compile the fail-closed evaluation wrapper and trunk baseline guard:
package verify
// VerifyContext provides contextual metadata for quality gate evaluation.
type VerifyContext struct {
RepoRoot string `json:"repo_root"`
WorktreePath string `json:"worktree_path"`
TaskID string `json:"task_id"`
CommitRange string `json:"commit_range,omitempty"`
Phase string `json:"phase"`
IsBaseline bool `json:"is_baseline"`
AllFiles bool `json:"all_files,omitempty"`
Strict bool `json:"strict,omitempty"`
AdvisoryDebtMode bool `json:"advisory_debt_mode,omitempty"`
}
// Gate defines the interface for an invariant evaluation step.
type Gate interface {
Name() string
Evaluate(ctx *VerifyContext) (*GateResult, error)
}
// TimedEvaluate executes a gate while measuring its elapsed duration in microseconds
// and recovering runtime panics into fail-closed ERR_CORE errors.
func TimedEvaluate(g Gate, ctx *VerifyContext) (res *GateResult, err error)
// ThresholdIntegrityGate verifies gate thresholds are never relaxed (Cell 7.3, Law 7).
type ThresholdIntegrityGate struct{}
func (g *ThresholdIntegrityGate) Evaluate(ctx *VerifyContext) (*GateResult, error)4. Fail-Closed Adversarial Suite Architecture#
The cleanroom suite (substrate/cli/cleanroom_tracetrial_bench_test.go) and unit suite (substrate/src/nomos/modules/verify/tracetrial_hardening_test.go) execute seven end-to-end adversarial pillars (VEC-TTB-01 .. VEC-TTB-07 in Go subtests):
- Pillar 1 - Context Isolation (
VEC-TTB-01): Seeds two repo scopes in Mneme, runsSynthesizeDynamicHandshake, and verifies strict repository isolation plus wavefront orientation. - Pillar 2 - Worktree Escape Containment (
VEC-TTB-02): Runsworktree-guard.shagainst trunk paths,../../trunk.gotraversal, and directmaincommits; verifies non-zero rejection. - Pillar 3 - Governance Config Tampering (
VEC-TTB-03):- Sub-vector 3a: Mutates
nomos.yamlinside aSUB-*worktree; verifiesPlaneSeparationGaterejects the edit. - Sub-vector 3b: Flips
strict_mode: falseandmax_file_loc: 9999inside anINT-*worktree; verifiesThresholdIntegrityGaterejects the downgrade.
- Sub-vector 3a: Mutates
- Pillar 4 - Panic & 2PC Abort (
VEC-TTB-04): Triggers a panicking gate inTimedEvaluateand verifiesnomos task syncleaves trunkHEADandrefs/notes/nomos/releasesuntouched. - Pillar 5 - Receipts & Mneme Provenance (
VEC-TTB-05): Syncs a compliant worktree and verifies both therefs/notes/nomos/releasesSHA-256 receipt andmneme.dbpattern record. - Pillar 6 - Build & Symlink Guards (
VEC-TTB-06): Runsnomos-build-guard.shon a dirty tree and plants a worktree symlink; verifies both reject execution. - Pillar 7 - Anti-Shortcut Verification (
VEC-TTB-07): Injects an empty function stub (func Shortcut() {}) into a worktree; verifiesAntiShimGaterejects the stub.
5. External Containerized Paired Evaluation (v4.1.0, n = 95)#
TraceTrial-Bench (arXiv:2610.32285) separates harness reliability from model capability across 95 containerized tasks (190 paired Docker runs). Both arms run Claude Code v2.1.220 with gemini-2.5-flash-lite (scored by gemini-3.5-flash-lite), comparing stock Control against nomos-claudecode:4.1.0:
Pillar / Cohort (n = 95, 0 errors) |
Control Overall | Nomos v4.1.0 |
Overall Δ | Agent Deliverable Axis (0..100) |
Harness Reliability Axis (0..100) |
|---|---|---|---|---|---|
| Full 95-Task Suite | 44.89 |
48.78 |
+3.89 (+8.7% rel.) |
34.78 → 40.05 (+5.27 / +15.2% rel.) |
55.01 → 57.52 (+2.51) |
C · Context & Continuity (n = 15) |
43.55 |
62.16 |
+18.62 (+42.8% rel.) |
32.59 → 58.12 (+25.52 / +78.3% rel.) |
54.51 → 66.21 (+11.71) |
V · Verification & Batch (n = 1) |
7.14 |
42.86 |
+35.71 |
0.00 → 0.00 (0.00) |
14.29 → 85.71 (+71.43) |
G · Guardrails & Safety (n = 9) |
44.96 |
50.18 |
+5.22 (+11.6% rel.) |
35.46 → 46.73 (+11.27 / +31.8% rel.) |
54.45 → 53.63 (-0.82) |
O · Observability & Audit (n = 7) |
50.48 |
52.16 |
+1.69 |
35.71 → 34.92 (-0.79) |
65.24 → 69.40 (+4.17) |
E · Execution & Recovery (n = 27) |
46.57 |
47.58 |
+1.02 |
42.92 → 45.75 (+2.83) |
50.22 → 49.42 (-0.80) |
T · Tooling & Protocol (n = 17) |
41.76 |
41.61 |
-0.15 |
20.19 → 20.47 (+0.29) |
63.33 → 62.74 (-0.59) |
L · Long-Horizon State (n = 19) |
46.27 |
44.75 |
-1.53 |
39.15 → 36.02 (-3.13) |
53.39 → 53.47 (+0.08) |
5.1 Paired Attribution & Task-Level Highlights (n = 95)#
- Causal Failure Reduction: Reduced
harness_causedfailure attributions from55(Control) to45(-18.2%relative reduction) across 95 tasks. - Head-to-Head Task Record: Achieved
36wins /30ties /29losses overall (24wins /53ties /18losses on the Harness axis). - Largest Single-Task Lifts:
G3-ratefeed-001(10.0→70.0,+60.0),T7-opsplugin-compliance-002(12.2→63.6,+51.4),O2-harness-refusal-notice-001(37.5→87.5,+50.0),C4-resume-fidelity-001(35.0→83.8,+48.8), andC3-certretention-002(22.6→70.2,+47.6).
6. Empirical Engineering Takeaways#
- Majority of Agent Failures Originate in the Harness (
57.9%Baseline): In stockClaude Code,55 / 95failures trace to harness mechanics rather than model intelligence. Deterministic compiled gates lift budget-model deliverable output by+15.2%(+78.3%in Context & Continuity) without changing weights. - Governance Overlays Must Chain Additively (
O+10.39&T+5.92Recovery): CLI--settingsoverrides shadow workspace hooks (-6.51inv4.0.0). Additivenomos hookmerging flips Observability positive (+4.17over stock). - Zero-Noise Channel Purity Beats Verbose Coaching: Synthetic
PostToolUsecoaching prose masked nativeEACCESerrors (-39.3%onG). Emitting{}on allow preserves native error provenance. - Input Hygiene & Loop Breakers Multiply Continuity (
+42.8%onC): Budget models pass unexpanded$WORKSPACE/~paths and repeat broken calls (700+turns). Pre-flight variable guards and 3-strike circuit-breakers prevent context collapse.
7. Table-Driven Verification Vectors#
| Vector ID | Go Test Anchor | Invariant Evaluated | Input Condition | Expected Deterministic Verdict |
|---|---|---|---|---|
TC-TTB-01 |
Pillar1_Context_VEC_TTB_01 |
Pillar 1 Context isolation | Two repo scopes seeded in mneme.db; SynthesizeDynamicHandshake called |
Isolates repository memories and wavefront |
TC-TTB-02 |
Pillar2_Execution_WorktreeEscape_VEC_TTB_02 |
Pillar 2 Worktree escape guard | worktree-guard.sh and pre-tool against trunk and ../../trunk.go |
Rejects non-worktree write and trunk commit |
TC-TTB-03 |
Pillar3_Governance_ConfigTamper_VEC_TTB_03 |
Pillar 3 Config pinning | SUB-* edits nomos.yaml; INT-* flips strict_mode: false |
PlaneSeparationGate and ThresholdIntegrityGate fail |
TC-TTB-04 |
Pillar4_Lifecycle_GateCrashAborts2PC_VEC_TTB_04 |
Pillar 4 Panic & 2PC abort | Panicking gate inside TimedEvaluate during nomos task sync |
Converts panic to ERR_CORE; trunk HEAD untouched |
TC-TTB-05 |
Pillar5_Observability_ReceiptAndMneme_VEC_TTB_05 |
Pillar 5 Receipts & Mneme | Compliant worktree synced via nomos task sync |
Writes refs/notes/nomos/releases receipt and pattern |
TC-TTB-06 |
Pillar6_Tools_ToolchainAndSymlinkGuard_VEC_TTB_06 |
Pillar 6 Build & symlink guard | Dirty-tree nomos install and planted worktree symlink |
Both rejected fail-closed (ZeroFilesystemAliasGate) |
TC-TTB-07 |
Pillar7_Verification_AntiShortcut_VEC_TTB_07 |
Pillar 7 Anti-shortcut AST | Empty stub func Shortcut() {} injected in worktree |
AntiShimGate rejects placeholder implementation |
TC-TTB-08 |
TestGoWorkModuleBoundary |
go.work module boundary |
Multi-module workspace evaluated via GoToolchainGate and BoundaryGate |
Resolves go.work roots without boundary escape |
TC-TTB-09 |
TestLoopBreaker3Strike |
3-strike circuit-breaker | Three identical calls in nomos hook pre-tool with unchanged mtime digest |
Emits 1-line remediation directive and halts loop |
8. Cross-Plane Traceability & DoD Verification#
| Intent Reliability Pillar | Compiled Go SSoT Path | Enforcing 7x3 Matrix Cell |
|---|---|---|
Panic-safe gate wrapper (TimedEvaluate) |
substrate/src/nomos/modules/verify/gate.go |
Cell 2.3 (gate_integrity_proof), Cell 7.2 (unchecked_errors) |
Trunk config pinning (ThresholdIntegrityGate) |
substrate/src/nomos/modules/verify/gates_intent.go |
Cell 7.1 (plane_separation), Cell 7.3 (threshold_integrity) |
Compiled hook guards & loop breaker (nomos hook) |
substrate/cli/cmd_hook.go |
Cell 3.2 (hermetic_worktree), Cell 6.2 (zero_filesystem_alias) |
| Cleanroom & unit adversarial suites | substrate/cli/cleanroom_tracetrial_bench_test.go, substrate/src/nomos/modules/verify/tracetrial_hardening_test.go |
Cell 2.1 (anti_shim), Cell 2.2 (go_toolchain) |
Run nomos verify to execute all 42 Definition of Done quality gates and confirm exit code 0.
Nomos