Skip to content

Verifiable Output Framework

Updated

Four-part verification architecture separating generation from independent deterministic and clean-context checking.

A framework for designing agent-built skills, workflows, code audits, and evidence-backed documents that converge without endless audit waves.

How to use this file. It has four parts and three tracks.

PartWhat it isWhere it goes
1. Agent rules
What the agent does
CLAUDE.md or a skill. Load Shared Core plus 1 track (or 1 role block).
2. Harness enforcement
Invariants, checks, and orchestration
Hooks, wrapper scripts, and CI. Never prompt text alone.
3. Operator checklist
Thresholds, calibration, and stopping
You. Never the agent.
4. Evidence
Why each rule exists
Reference only. Do not load into agent context.
TrackUse when building or running
Track A: Evidence-backed documents
Reports, specs, research syntheses, client audits, guides
Track B: Executable workflows and systems
Skills, data pipelines, scrapers, browser automation loops, stateful tools
Track C: Code audits
Security, reliability, and quality reviews that risk endless High/Critical loops

Single-track context and hybrid systems. Load only Part 1 for the active track. Loading all three tracks or Parts 2 to 4 degrades rule-following and raises cost. Split hybrid workflows by stage or subagent so each stage loads only Shared Core plus its 1 active track (for example: collector = Track B, writer = Track A, auditor = Track C), isolating each stage's state and pass cap in its own folder.

Core idea

Errors enter at generation and at every edit. Open-ended audits do not converge for prose, workflows, or code: judges miss real defects, invent false ones, and add regressions with every rewrite. Prevent errors at entry, enforce simple invariants in code outside the agent's write boundary, bound edits by ID, and stop on measured criteria.

Part 1. Agent rules

Paste Shared Core plus one track (or one Track C role block) into CLAUDE.md or a skill. Cut any rule that does not match a failure you have actually seen.

Shared Core (paste with every track)

Shared Core (paste with every track) (markdown)
# Verifiable output core

Why: errors enter at generation and at every edit. Open-ended audits do not
converge, so prevent errors, enforce checks in code, and cap edits.

## Discipline
- Build the smallest version that works. Do not add layers, checks, guards,
  or configuration that were not asked for.
- If evidence, access, or inputs are missing, blocked, or conflicting, write
  "unknown: <what is missing>" and move on. Never fill a gap.
- Never change an answer because it was challenged. Change it only when
  shown evidence or a failing deterministic check.
- Patch by ID (claim, invariant, or finding). Never rewrite surrounding work
  to fix one item.
- Two automated fix passes maximum. If blocking errors remain after Pass 2,
  stop and report them as unresolved.
- Do not edit, weaken, or bypass any pre-existing or locked check, test,
  rubric, scope file, or fixture.
- Report what passed, what is unknown or unresolved, and what was not
  checked.

Track A: Evidence-backed documents

Track A: Evidence-backed documents (markdown)
## Stage order
1. Select verbatim source spans from saved local snapshots before writing.
2. Reason in plain text before converting to strict structure.
3. Write a claim ledger mapped to every brief requirement ID.
4. Write a prose template where every prose unit (body sentence, list item,
   table cell, callout, caption/footnote, or non-template heading) carries a
   valid claim ID/`unknown:` tag or an explicit non-factual/structural tag,
   with value placeholders for code to fill (including every "unknown:"
   disclosure).
5. Hand off both ledger and prose template to harness verification.

## Evidence and writing
- Write each direct claim only from already-selected verbatim spans. Never
  write a claim first and search for support afterward.
- Prefer primary sources over summaries. Use a few strong passages per
  claim; piling on sources lowers accuracy.
- Do not retype ledger values; emit placeholders for code to fill. Compute
  derived figures with code and list their supporting verified claim IDs.
- Mark every deduction (`inference`) with its supporting verified claim IDs.
- Write in short sections from small evidence sets. Error rates climb
  toward the end of long outputs.

## Fixing claims and prose
- Whenever you edit a claim, update dependent inferences and derived claims
  (delete a derived claim only if it is no longer mathematically derivable;
  leave an un-updateable inference for next-pass verification). Whenever you
  delete a claim, update or delete its dependent inferences and derived
  claims.
- Leave any claim, prose unit, or contradiction marked for human review or
  dismissed as a false positive untouched for that flag (edits are allowed
  on the affected layer if another active failure on the same claim or prose
  unit requires modification, or on the claim and its prose if a supporting
  premise is modified or deleted; a ledger-layer lock still allows
  prose-drift edits, and a prose-layer failure never unlocks a locked ledger
  row).
- On missing evidence or a confirmed unsupported claim (`no`), delete the
  claim and its prose tags/placeholders. If a brief requirement becomes
  uncovered, insert and render `"unknown: <what is missing>"`.
- On a failed derived formula with verified premises, repair the formula. On
  a placeholder mismatch or missing `unknown:` disclosure, fix the prose.
- On partial support (`partly`), narrow the claim and prose to match only
  what its sources state. Do not delete on `partly`.
- On prose drift where the ledger claim passed, edit only the prose unit.
  Never alter the valid ledger claim.
- On a confirmed contradiction, qualify date, metric, or scope. If sources
  genuinely conflict, delete the conflicting claims and their prose
  tags/placeholders, and render `"unknown: conflicting sources (<src1>, <src2>)"`.

Track B: Executable workflows and systems

Track B: Executable workflows and systems (markdown)
## Contracts and state
- Define stage input and output schemas before writing code (unless
  operator-provided). Never edit operator-locked files (policy, schemas,
  test doubles, adversarial suites, or
  tool/linter/typecheck/static-analysis/test configs), add local
  tool-config or ignore files, or add inline linter/type/security
  suppressions without approval. During `dry_run` Fix Passes, never edit or
  delete locked initial (`pass 0`) schemas, test doubles, adversarial tests,
  or locked passing Fix Pass 1 additive tests/constraints without approval
  (new additive test or conjunctive constraint files only).
- Persist progress as you go (checkpoints or append-only ledgers) so a
  crash, timeout, or usage-limit stop preserves finished work.
- Make retries idempotent. Handle duplicates, partial writes, truncated
  checkpoints, concurrent workers, and stale locks explicitly.

## Side-effect boundaries
- Separate read-only discovery from external mutations (API writes, emails,
  forms, deploys, deletes).
- Run `dry_run` first against a local stateful test double with external
  network egress blocked (never a print-only or no-op dry run; automated fix
  passes apply only to `dry_run`). `live_pilot` and `full_run` run
  single-pass over frozen code exclusively via the outer operator or CI
  runner. Never toggle live mode yourself.
- Before non-idempotent external writes, record an `in_flight` intent row
  (with an external idempotency key when supported). On any ambiguous write
  outcome (timeout, dropped response, uncertain 5xx) or on resume, reconcile
  or quarantine uncertain `in_flight` rows; for non-idempotent,
  non-queryable sinks (forms, emails), quarantine 100% of uncertain
  `in_flight` rows and never blind-retry in-process or on resume.
- For batch workflows (or when required by policy), isolate per-item
  failures into a dead-letter log and obey abort limits.

## Verification
- Verify real persisted end state (DB rows, files on disk, API state, exact
  counts, and content quality). Exit code 0 or screen text alone is not
  evidence.
- Test at real scale against adversarial inputs: empty, zero, one, max,
  max+1, malformed, duplicate, concurrent, interrupted-then-resumed, and
  truncated checkpoints. Emit a coverage receipt mapping every
  policy-required invariant and adversarial category to an executed test (or
  policy-declared N/A).

Track C: Code audits (Reviewer, read-only)

Track C: Code audits (Reviewer, read-only) (markdown)
## Frozen scope and severity
- Audit only declared target files and requirements in the frozen scope.
- Read boundary context (1-hop callers plus auth, middleware, schema, and
  config files) only to prove or disprove a finding rooted in target files.
  Never open unrelated findings outside target files.
- Use only the frozen severity scale:
  - Critical: reproducible data loss, security/auth bypass, crash, or wrong
    output on valid input.
  - High: reproducible failure on realistic boundary, error, or concurrency
    input.
  - Medium: reproducible degraded behavior, resource leak, or minor spec
    deviation on valid input.
  - Low / Info: speculative issues, style preferences, or unstated
    requirements (report-only, never blocking).

## Tools first and clean pass valid
- Run deterministic tools first (compiler, typecheck, linter, static
  analyzer, test suite) before any LLM review.
- A clean pass (`0 findings`) is valid. On the initial pass (`pass 0`), emit
  a coverage receipt (`finding` or `checked_clean`) for every target file
  and requirement.

## Two-tier proof
- `proved`: a blocking deterministic gate failure (configured required
  compiler, typecheck, linter, static-analyzer, or test failure; on
  partial-repo audits, scoped to target/changed-file checks, target-scoped
  or affected tests, and new regressions vs the initial pre-fix baseline;
  unconditionally auto-blocking regardless of severity rubric, while advisory
  tool warnings stay report-only) or an executed failing repro (auto-blocking
  for configured blocking severities).
- `trace_only` (non-blocking until confirmed): an exact call trace
  (`file:line -> file:line`) or omission note when read-only review cannot
  run a repro. Routes to capped repro-verification or human triage.

## Read-only review and bounded re-check
- Never edit code in review mode.
- After Fix Pass 1 and Fix Pass 2, restrict new findings to changed lines,
  direct callers (in target files or boundary context), and affected tests,
  reading boundary context (auth, middleware, schema, and config files)
  solely to prove or disprove findings rooted in those changed lines.
- Never re-flag closed operator dispositions (`wontfix`, `accepted_risk`,
  `false_positive`, `deferred_design`) without a regression repro that
  passed at closure and fails on changed code (or a newly executed failing
  repro at a blocking severity for previously unproved
  `false_positive`/`deferred_design`).
- Never file unproved style or architectural reversals of a Pass 1 fix.
  Always report reproducible regressions.

Track C: Code audits (Fixer)

Track C: Code audits (Fixer) (markdown)
## Scope and write boundaries
- Fix only harness-confirmed blocking deterministic gate failures and
  repro-proved blocking findings (`Critical` and `High`, plus `Medium` only
  if scope opts in). Leave advisory warnings, `Low`, `Info`, and unverified
  items untouched.
- Never edit harness ledgers, scope files, or read-only boundary context
  (1-hop callers, auth, middleware, schema, and config files outside target
  files). Never add inline linter, typecheck, or security suppressions
  without approval.

## Patch by finding ID
- Fix one finding ID at a time: write a failing repro test in the additive
  repro-test path (skip for deterministic tool-caught items), apply the
  smallest patch inside target files, confirm the test and affected tests
  pass, and make zero opportunistic refactors.
- In Fix Pass 1, edit only target files plus linked additive repro tests.
- In Fix Pass 2, edit only target files tied to still-open blocking
  findings or Pass 1 regressions, plus new or repaired repro tests for
  those items. Never modify locked accepted Pass 1 repro tests.

Part 2. Harness enforcement

Rules in a prompt are requests. Anything that must hold every time belongs in code outside the agent's write boundary. Keep exact schemas and state machines in tested implementation code, not prose; enforce the mechanical invariants below.

Shared invariants (all tracks)

InvariantWhat code enforces
External trust boundary
Locked copies, SHA-256 hashes (pre-existing tests, pre-existing tool/test configs, holdout tests, checker scripts, rubrics, scope files, Track A snapshots; Track B policy, frozen code, schemas, live ledgers, and locked or frozen test doubles, adversarial suites, and passing Fix Pass 1 additive tests or constraints, both operator-provided and agent-authored; Track C locked original and accepted Pass 1 repros), verification logs, and the pass counter live outside the agent's writable workspace.
Artifact hash binding
Every verification log records hashes of the exact artifacts checked (ledger + prose, workflow code + policy + schemas + test doubles + adversarial suite + outputs + live sandbox/credential fingerprint for live phases, or git tree SHA). Promotion rejects stale receipts after any edit.
Bounded fix passes
One 0-indexed loop: initial check (pass 0) -> Fix Pass 1 -> Verification 1 (pass 1) -> Fix Pass 2 -> read-only Final Verification (pass 2). Snapshot pre-pass trees (C0, C1) before Fix Passes. Block Fix Pass 3. Track B live_pilot and full_run run single-pass (pass 0 only) over frozen code.
Two exit gates
Agent-stop gate accepts passed or completed_with_unresolved_errors (preventing deadlock). Promotion / ship gate requires passed on current hashes across all prerequisite phases (except operator sign-off on Track A verified false alarms, Track A approved unknown: disclosures, or Track C closed blocking dispositions, with all other deterministic, integrity, and coverage checks green).
Non-mutating checks
Every mechanical check flags or blocks; checks never silently delete or rewrite agent outputs.

Track-specific invariants

Track A (documents)

  • •Immutable snapshots and verbatim spans: Lock local snapshots (sources/) with URI, status, timestamp, and hash before generation starts. Verify every direct claim's verbatim span against its normalized snapshot so paraphrasing cannot skip checking.
  • •DAG grounding and sandboxed arithmetic: Verify inferences and derived claims form an acyclic DAG rooted in verified direct claims (no cycles or unknown premises). Recompute derived formulas in a whitelisted arithmetic AST (never eval()) with unit compatibility, and check premise-to-text/scope entailment.
  • •Prose integrity, coverage, and unknown: ceiling: Verify template placeholders match the ledger (and structured ledger values/numeric literals render via placeholders rather than retyped literals). Require every prose unit (body sentence, list item, table cell, callout, caption/footnote, or non-template heading) to carry either a valid claim/unknown: tag or an explicit non-factual/structural tag, every unknown: record to render in prose, and every brief requirement to map to a rendered verified claim or rendered unknown: entry. Report unknown: entry count and requirement abstention share (fraction of brief requirements with any mapped unknown: entry, full or partial), and enforce an operator-configured unknown: ceiling (requiring operator sign-off on any unknown: covering a high-stakes requirement or exceeding the brief's threshold). Flag exact-key quantitative contradictions on matching (entity, metric, date, scope); route all non-key-matched and qualitative contradictions (including cross-metric and alias-key numeric conflicts) to the LLM contradiction checker.
  • •Fix-pass edit guard and cascades: Diff Fix Pass edits against C0/C1 across both ledger rows and prose units (claim-linked, unknown:, and non-factual) to block: 1. Touching unflagged passing ledger rows or prose units. 2. Editing human-review or dismissed items solely for a paused or dismissed flag (layer-scoped: ledger-layer locks allow prose-drift edits; prose-layer locks guard only the prose unit). 3. Touching ledger rows flagged only for prose drift. 4. Deleting any claim or replacing it with unknown: unless authorized by a deterministic ledger failure (missing/broken source or span, DAG/grounding cycle or unknown premise, unit mismatch, or exact-key conflicting-source failure), a human-confirmed no or conflicting-source contradiction (or pass 0 high_error_rate_draft at certified <= 1-2% FPR), or mechanical ungrounding from a deleted premise or non-derivable modified-premise derived claim.

Allow edits (and clear affected prior locks and dismissals for re-verification) strictly on the affected layer: a prose-layer or shared-unit failure unlocks only the prose unit (never a locked or passing ledger row), while a ledger-layer failure or modified/deleted premise unlocks both the ledger row and its rendered prose unit. Re-verify dependent claims whenever any premise is modified or deleted.

  • •Separate ledger vs prose checks, carryover, and error-rate human gates: Check ledger claims against sources first, then route every rendered prose unit (claim-linked, unknown:-tagged, and non-factual/structural) to the LLM prose checker against its linked passed ledger claims (0 linked claims for unknown:-only and non-factual units, flagging any factual assertion outside verified claims or the unknown: disclosure) so prose drift never deletes valid claims. On low_error_rate documents, pause all LLM-only flags for human triage before editing or deleting without burning fix passes. On high_error_rate_draft, allow pass 0 -> Fix Pass 1 auto-edits on LLM-only flags while pausing LLM-only deletions (no and conflicting-source deletions) for human confirmation unless clean-item FPR is certified <= 1-2%, then switch all LLM-only flags to human triage starting at pass 1. Carry all layer verdicts across passes (passing, operator false-positive dismissals, and still-open failed or paused-for-human-review verdicts) while layer hashes stay unchanged: ledger verdicts by (claim, premises, snapshot), prose verdicts by (prose unit, linked claims), and contradiction verdicts by all participating claims. Clearing a failed or paused verdict requires an edit that changes its layer hash or an explicit operator dismissal. On pass 1 and pass 2, run deterministic whole-document checks and run LLM checks on every ledger claim, rendered prose unit, and LLM-checked contradiction whose carried verdict is missing or invalidated by a changed layer hash. Run any skipped downstream checks (including deferred LLM-checked contradictions) before shipping.

Track B (workflows and systems)

  • •Schema, test-double, and suppression gates: Validate every stage input and output against stage schemas. Lock artifacts across three boundaries outside the agent workspace: 1. Before generation: capture the pre-generation baseline snapshot and hash-lock operator-provided Track B schemas, test doubles, adversarial suites, policy, pre-existing tests, and pre-existing tool/test configs (blocking unapproved edits across pass 0, 1, and 2). 2. After pass 0 and pass 1: hash-lock agent-authored pass 0 schemas, test doubles, and adversarial tests (keeping locked files byte-immutable during Fix Passes without approval; new additive test or conjunctive constraint files only), then hash-lock passing Fix Pass 1 additive tests and conjunctive constraints before Fix Pass 2. Have the operator review and freeze schemas, agent-authored doubles/tests, and workflow code before live_pilot. 3. Static and diff checks: run typecheck, lint, static analysis, targeted tests, and a baseline diff guard anchored to the pre-generation snapshot rejecting unapproved edits to locked tool/test configs, newly added local tool-config or ignore files (or run tools with harness-pinned configs outside the workspace), unapproved suppressions in newly created files, and newly added unapproved suppressions in modified files across pass 0, 1, and 2.
  • •Network and sandbox isolation: Block external network egress across the entire Track B agent development and dry_run workspace/sandbox (local stateful test double only, protecting unauthenticated web forms). Restrict live network egress exclusively to the outer operator or CI runner's workspace-isolated live_pilot and full_run sandbox holding live credentials outside agent read reach, enforcing phase caps. Hash-bind live_pilot and full_run receipts to the frozen (code, policy, schema, test_doubles, adversarial_suite) bundle plus a secret-free fingerprint of the live sandbox and credential configuration (live_env). Require live_pilot to match passing dry_run receipts for the frozen bundle, and require full_run launch or resume to hold a passing live_pilot receipt for the current (bundle, live_env) hash that postdates any non-transient live failure (live_pilot, abort-limit, or live-invariant failure), allowing direct full_run resume only after an operator-confirmed transient operational interruption on unchanged hashes. Expose only read-only, secret-redacted debugging snapshots.
  • •Shared live idempotency and quarantine: Keep dry_run state isolated (harness dry_run verification runs from clean state into a harness-owned directory), and use one shared outer-runner live ledger and dead-letter log across live_pilot and full_run so full_run never duplicates pilot writes. Require a write-ahead in_flight intent row (with an external idempotency key when supported) before any non-idempotent external write, and reconcile or quarantine uncertain in_flight rows on ambiguous write outcomes or resume, quarantining 100% (never blind-retrying) for non-queryable sinks (forms, emails).
  • •Fresh pilot slices, coverage, and scoped invariants: Require each live_pilot attempt to execute at least 1 fresh unexecuted item excluded from prior live ledger rows, scoping end-state and content/yield checks to the active attempt. Verify a dry_run coverage receipt mapping every policy-required invariant and adversarial edge-case category to at least 1 executed passing test (or policy-declared N/A for simple scripts). Scope policy invariants by phase (dry_run runs fault-injection and adversarial tests; live_pilot checks live-safe invariants plus the frozen bundle's passing dry_run receipts; full_run checks live-safe invariants plus the frozen bundle's passing dry_run receipts and a passing live_pilot receipt for the current (bundle, live_env) hash that postdates any non-transient live failure). Keep heavy batch controls (DLQ, circuit breaker, timeouts, retry/cost caps) optional for simple scripts.

Track C (code audits)

  • •Baseline, full regression, and suppression gate: Require a clean compile/import/collect baseline before snapshotting C0 or starting pass 0 (halt out-of-band as a pre-flight failure for deterministic build repair before entering the audit loop; snapshot C0 and run pass 0 only on a clean baseline). Require green deterministic tools and the full regression suite (or, for partial-repo audits with pre-existing out-of-scope failures in C0, green target/changed-file tool checks and target-scoped/affected tests plus zero new regressions relative to C0 across both repo-wide compile/typecheck/static-analysis tools and the full regression suite). Run deterministic tools, cumulative inline-suppression diff checks against C0, and the full regression suite at every verification pass (pass 0, 1, and 2), blocking open -> fixed while that pass has a regression or unapproved suppression.
  • •Harness-owned logs and coverage: Keep append-only findings and coverage logs outside agent write reach (keyed by audit ID and finding ID). Resolve missing pass 0 file/requirement coverage via at most 1 read-only Reviewer completion retry before escalating.
  • •Authoritative Proof gate: Auto-block unconditionally on blocking deterministic gate failures (configured required compiler, typecheck, linter, static-analyzer, or test failures, excluding pre-existing out-of-scope failures present in C0 on partial-repo audits so only target/changed-file tool checks, target-scoped/affected tests, and new regressions vs C0 auto-block; advisory tool warnings stay report-only) and on harness-executed failing repros (clean compile/import/collect, failing at runtime or assertion) for configured blocking severities (Critical, High, optional Medium). Route trace_only and omission items to 1 capped scratch-runner attempt (or human triage) before Pass 1, Pass 2, and Final Verification terminal status. Persist and hash-lock each confirmed failing repro. Entering the automated Fixer loop requires a blocking deterministic gate failure or a harness-executed failing repro (from the scratch runner or supplied during human triage); human-confirmed blocking items without an executable repro do not enter the Fixer loop and instead block promotion (completed_with_unresolved_errors) for a human-driven fix or disposition.
  • •Fix-guided verification filter: Before closing open -> fixed and locking a Pass 1 repro test, confirm: (1) the locked original repro passes post-fix, (2) the additive repro test passes lint, typecheck, and suppression checks, and (3) the repro test compiles, imports, and collects cleanly and fails at runtime or assertion on the pre-fix baseline (C0 for Pass 1; C1 first for Pass 2, falling back to C0 only if opened at pass 0 and either its locked original repro already passed on C1 or C1 fails clean compile/import/collect), then passes post-fix. Exempt deterministic tool-caught items. At Final Verification (pass 2), re-run both locked accepted Pass 1 repro tests and locked original repros for Pass-1-fixed findings.
  • •Scope and disposition guard: Restrict Pass 1 edits to target files + additive repro tests, and Pass 2 edits to target files tied to open items or Pass 1 changes + new/repaired repro tests (never boundary context). Enforce pass 1 and pass 2 Reviewer scope in code: restrict accepted new findings to changed lines, 1-hop direct callers, and affected tests (rejecting or deferring out-of-diff new findings that are not regressions of Pass 1 or Pass 2 changes), while keeping auth, middleware, schema, and config files readable as read-only boundary context solely to prove or disprove findings rooted in those changed lines. Reopening wontfix, accepted_risk, or previously proved false_positive/deferred_design without operator action requires a regression repro that passed at closure and fails on changed code; reopening previously unproved false_positive/deferred_design without operator action requires a newly executed failing repro at a blocking severity (rejecting trace_only re-flags).

Rules for building these checks

  1. 1Script only what has a mechanical right answer. Existence, identity, schema, hashes, AST arithmetic, and exit state. Do not script fuzzy NER matching over freeform prose; render verified ledger fields instead.
  2. 2Normalize before comparing. Whitespace, unicode, smart quotes, dashes, case, and number formats.
  3. 3Checks flag or block; they never rewrite. A script that auto-edits content is a second unverified generator.
  4. 4Test each check before trusting it. Run it on known-good and known-bad examples.
  5. 5One check per observed failure. No speculative safeguards.
  6. 6Retire noisy or obsolete checks, never working regression guards. Remove a check when false positives stay high, cost exceeds value, or the failure becomes impossible by construction. Keep cheap, zero-false-positive invariants even when they catch 0 errors.
  7. 7You specify which checks exist. The agent implements the smallest version. Left to design the harness, an agent adds layers.

Orchestration and CLI-agnostic enforcement

  • •Enforce outside the prompt. Use harness hooks, wrapper scripts, or CI checks so gates work identically across Claude Code, Codex, OpenCode, Antigravity, and local runs.
  • •Fresh, read-only checker context. Run every LLM checker in a separate subagent or process with read-only tools. Track C Reviewers may read boundary context and use an optional sandboxed scratch runner outside the repo.
  • •Independent model family and juries. Use a different model family than the writer (via a small CLI/API wrapper inside single-vendor CLIs). For high-stakes checks (including Track A high-stakes requirements tagged in the locked brief), use a 3-model jury: minority veto only for low-false-alarm agreeable validators or proof-gated checks, and 2-of-3 majority vote for defect-hunting reviewers. Measure calibration rates on the combined jury decision.
  • •Keep model judgment out of deterministic hooks. A hook that asks another model to decide is not deterministic.

Part 3. Operator checklist

These are your decisions. The agent must not make them or grade itself on them.

Before the first run

  • [ ]Write the acceptance threshold. Track A: target per-claim error rate (zero is unrealistic on long documents) and maximum unknown: requirement abstention share (fraction of brief requirements with any mapped unknown: entry). Track B: required invariants and pilot scale in locked policy. Track C: zero blocking deterministic gate failures and zero proved or human-confirmed Critical or High findings (opt into Medium only if needed).
  • [ ]Freeze scope, sources, policy, pre-existing tests, pre-existing tool/test configs, any operator-provided Track B schemas/test doubles/adversarial suites, and severity rubric outside the agent workspace (and capture the pre-generation baseline snapshot) before generation starts. Tag high-stakes requirements and error-rate mode (low_error_rate vs high_error_rate_draft) in the locked Track A brief.
  • [ ]Pick an independent checker from a different model family (or a calibrated 3-model jury).
  • [ ]Write the rules file by hand. Do not let the agent generate its own instructions.

Calibrate the checker once, then periodically

  • [ ]Full calibration (recurring skills and pipelines): Build a calibration set with at least 20 planted errors and 30 clean items for the <= 10% FPR proof-gated or human-triaged tier (0/30 clean flags gives a 9.5% one-sided 95% upper bound). Certifying <= 1-2% clean-item FPR requires 150 to 300 clean items (~3/n). Measure catch rate and clean-item FPR on the combined checker or jury decision.
  • [ ]Catch-rate floor: Require catch rate >= 80% on narrow atomic checks (end-to-end report judging scores under 55% in benchmarks). If a narrowed check cannot reach 80%, move that error class to deterministic code or human/jury review.
  • [ ]Clean-item FPR vs warning-level FDR: <= 10% clean-item FPR is safe for proof-gated workflows, human-triaged checks where the operator accepts triage noise (prefer <= 1-2% for recurring low-error triage), and rough high_error_rate_draft pass 0 only when deletions require human confirmation or <= 1-2% FPR (switching unconditionally to human triage starting at pass 1). On a 3%-error document at 80% catch rate, 10% clean-item FPR yields an 80% false-discovery rate (4:1 noise), and 1% to 2% clean-item FPR still yields 29% to 45% FDR (<= 10% FDR requires <= 0.27% FPR). Keep warning-level FDR (dismissed flags / total flags) <= 10% after proof-gating. Auto-acting gates on low-error-rate documents must require deterministic proof or human review before editing or deleting on LLM flags.
  • [ ]One-off smoke check: For one-off runs, 5 planted errors + 5 clean items catches gross failure (0/5 caught or 5/5 clean flagged). It is never statistical calibration; pair uncalibrated runs with human output review.
  • [ ]Fix noisy or weak checkers: If false alarms are high, tighten the rubric or demand proof. If catch rate is low, narrow the question or split by error type; do not stack identical reviewers.

Stopping rules after each run

Track A: Evidence-backed documents

  • [ ]Verify 100% of high-stakes claims and high-stakes unknown: entries by hand against local snapshots (executive summary, recommendations, prices, legal or security statements), and review unknown: share against the brief's ceiling.
  • [ ]Verify a random sample of body claims by hand against local snapshots. Never plug raw LLM verdicts or calibration-adjusted estimates into stopping bounds.
  • [ ]Apply consistent one-sided 95% upper bounds:
  • •Large documents (N >> n) with proportional allocation across early and late sections: k = 0, n = 100 -> 3.0% (~3/n); k = 0, n = 300 -> 1.0%; k = 1, n = 100 -> 4.7% (one-sided Clopper-Pearson; fails a 3% target).
  • •Small documents (N <= 300): use finite-population (hypergeometric) bounds.
  • •Late-weighted oversampling: report separate per-stratum one-sided 95% upper bounds (or the conservative weighted sum sum(w_i * U95(k_i, n_i)) where w_i = N_i / N is each stratum's population share). Never apply unweighted pooled 3/n across a non-proportionally stratified sample.
  • [ ]If the sample fails, do not run another audit wave. Classify failures below and fix the producing stage.

Track B: Executable workflows and systems

  • [ ]Pass dry_run and kill/resume checks on a local stateful test double with external network egress blocked before unlocking live credentials.
  • [ ]Review and freeze workflow code, stage schemas, and any agent-authored test doubles or adversarial tests, then run a bounded live_pilot on a fresh unexecuted slice via the outer runner, with pilot caps enforced and shared live state outside agent write reach.
  • [ ]Inspect real persisted end state and content quality scoped to the active attempt (>= 1 executed item), plus verify the frozen bundle's passing dry_run coverage and adversarial receipts.
  • [ ]Promote to full_run or ship only when the Promotion gate emits passed for the active phase and current hashes. After any live failure, inspect secret-redacted logs:
  • •Direct full_run resume over the persistent live ledger (reconciling or quarantining uncertain in_flight rows) is allowed only after an operator-confirmed transient operational interruption (crash, timeout, usage limit) with unchanged frozen bundle hashes and unchanged live sandbox/credential configuration.
  • •Any other live failure (abort-limit or live-invariant failure, sandbox/credential change, live_pilot failure, or bundle edit) requires a fresh-slice live_pilot (and re-passing dry_run whenever bundle hashes changed) before resuming or promoting to full_run.

Track C: Code audits

  • [ ]Confirm deterministic tools, full regression suite (or green target/changed-file checks and target-scoped/affected tests plus zero new regressions vs C0 across repo-wide compile/typecheck/static-analysis tools and the full regression suite on partial-repo audits), inline-suppression checks, pass 0 coverage receipts, and integrity/current-hash Promotion gate status are green.
  • [ ]Treat Low, Info, and unconfirmed trace_only/unverified items as report-only.
  • [ ]Stop after Final Verification (pass 2). Record operator dispositions (wontfix, accepted_risk, false_positive, deferred_design) to ship, or start a human-driven fix or new scoped audit. Never launch an automated Fix Pass 3.

Classify every failure

ClassTrackMeaningFix lives in
Bad evidence
A
Source is wrong, stale, low quality, or misquoted
Snapshot and source-quality gate
Not entailed
A
Claim or prose goes beyond what the source says
Evidence-first rule, checker
Synthesis
A
Deduction unsupported by linked premise claims
Inference marking, DAG check
Number or name drift
A
Value changed between source and output
Ledger template rendering
Omission
A, B, C
Required question, edge case, or file was missed
Coverage receipt check
Fabrication under block
A, B, C
Agent filled a gap when evidence or access failed
"unknown" rule
State or idempotency bug
B
Retry duplicated side effects or crash lost work
Checkpointing, shared live ledger, in_flight quarantine
Silent bad-data yield
B
Schema and count pass on block pages or garbage
Content/yield sanity invariant
Unproved code finding
C
Reviewer claimed Critical/High without executed repro
Authoritative Proof gate, fix-guided test filter
Severity inflation
C
Style or speculative issue labeled Critical/High
Frozen severity rubric, blocking filter
Design ping-pong or boundary miss
C
Pass 2 reverses Pass 1 style or ignores middleware/config
Boundary context, disposition reopening guard
Check tampering or suppression
A, B, C
Agent edited tests/configs or added # noqa/@ts-ignore
External SHA-256 lock, suppression diff check
Fix regression
A, B, C
Repair introduced a new error
Patch by ID, red-then-green test, pass cap
Checker false alarm
A, B, C
Flagged item was actually correct
Checker calibration, warning-level FDR check

One or two classes will dominate. Fix those stages and leave the rest alone.

Diagnosing audits that will not converge

SymptomLikely causeAction
Each pass finds new high-severity issues
Fixes are regenerating content or adding new machinery
Patch by ID, ban opportunistic refactors, cap at 2 fix passes
Prose spec audits keep finding new edge cases
Prose is acting as a formal state-machine spec
Simplify prose to invariants; put exact schemas and state machines in tested code
Code audit keeps finding new Critical/High bugs
Unproved speculation or unanchored severity
Require harness-executed repro or tool failure; freeze rubric; allow 0 findings
pass 1 flags untouched files
Scope is expanding
Lock target files; restrict re-checks to changed lines and 1-hop direct callers
Pass 2 reverses a Pass 1 design choice
Unproved architectural ping-pong
Log style objections as deferred_design; allow only reproducible regressions
Same accepted tradeoff gets flagged again
Reviewer amnesia
Feed prior dispositions; require a pass-at-closure / fail-on-changed-code repro (or operator action) to reopen
Reviewer flags missing auth handled elsewhere
Out-of-diff boundary blindness
Include auth, middleware, schema, and config files in read-only boundary context
Findings disappear when challenged
Checker or writer yields to pushback
Require evidence or a failing deterministic check for every flag and change
Findings differ on identical reruns
Checker noise
Calibrate on >= 20 errors and >= 30 clean items; check warning-level FDR
Links work but claims do not match
Claims written first, cited afterward
Evidence-first generation from verbatim spans in locked snapshots
Errors cluster at the end of sections
Outputs are too long
Shorter sections, smaller evidence sets, stratified sampling
Agent adds complexity when asked for reliability
Agent is designing the harness
You specify, it implements

Part 4. Evidence

What each rule rests on. Much of this is preprints, single studies, or code-review and question-answering benchmarks rather than general systems design. The direction is consistent across sources; treat exact numbers as approximate.

Why audits do not converge

  • •Pass/fail validators wave bad work through. One study measured validators at 96% true-positive rate on good outputs while catching under 25% of bad ones. The authors proposed minority-veto ensembling or calibrated regression to counter agreeableness bias. Beyond Consensus: Mitigating the Agreeableness Bias in LLM Judge Evaluations (arXiv 2510.11822)
  • •Defect-hunting code reviewers flag correct code. Models frequently misclassified compliant code as defective, and prompts demanding explanations and fixes raised the error rate. A Fix-guided Verification Filter (treating the proposed fix as executable counterfactual evidence against tests) caught false positives. Are LLMs Reliable Code Reviewers? (arXiv 2603.00539)
  • •Judges are weak on end-to-end research-agent outputs. With planted failures, the best judges stayed under 55% accuracy, with evidence verification weakest. Time to REFLECT (arXiv 2605.19196)
  • •Automated factuality metrics disagree with each other and misestimate error rates. They also show biases against paraphrasing and distant source spans. Verify with Caution (arXiv 2501.14883)
  • •Expanding scope and cascading edits prevent monotonic convergence. One case study recorded defects per round of 15, 8, 12, 2, 8, 1, 4, 1, 0 across 9 rounds. The authors attributed this to cascading edits and audit-scope expansion, motivating a locked audit protocol. Iterative Audit Convergence in LLM-Managed Multi-Agent Systems (arXiv 2605.12280)

Why evidence comes first

  • •Citations attached after the fact are often unfaithful. Up to 57% lacked citation faithfulness (post-rationalization) in adversarial tests. Correctness is not Faithfulness in RAG Attributions (arXiv 2412.18004)
  • •Selecting spans first, then generating from them, held or improved attribution accuracy and cut human verification time. Attribute First, then Generate (arXiv 2403.17104)
  • •Working links do not mean supported claims. Across 14 benchmarked models, even the strongest frontier models exceeded 94% link validity while 39% to 77% of claims matched their source; support dropped about 42% across two frontier models as tool calls grew from 2 to 150. Cited but Not Verified (arXiv 2605.06635)
  • •Commercial search-augmented LLMs and deep research agents invent citation URLs at 3% to 13% (with deep research agents toward the upper end). Detecting and Correcting Reference Hallucinations (arXiv 2604.03173)
  • •Splitting text into atomic claims creates tension with decontextualization and can change verdicts when inserted context adds extra facts. Separating the claim ledger from prose avoids distorting both. DnDScore (arXiv 2412.13175)

Why writing is staged

  • •Strict format constraints hurt reasoning; looser formats recover it. Let Me Speak Freely? (arXiv 2408.02442)
  • •Unsupported content clusters late in long outputs. Hallucinate at the Last in Long Response Generation (arXiv 2505.15291)
  • •Blocked agents fabricate. Strategic content fabrication was the top failure across about 1,000 deep research reports, near 19% of errors. How Far Are We from Genuinely Useful Deep Research Agents? (arXiv 2512.01948)
  • •Early errors snowball, yet models recognized 67% to 87% of their own mistakes when shown them in a separate session. How Language Model Hallucinations Can Snowball (arXiv 2305.13534)

Why edits are limited

  • •Repeated delegated edits corrupt documents. Frontier models degraded about 25% of content over 20 interactions through sparse but severe errors. LLMs Corrupt Your Documents When You Delegate (arXiv 2604.15597)
  • •Self-correction without outside feedback can lower accuracy. Large Language Models Cannot Self-Correct Reasoning Yet (arXiv 2310.01798)
  • •Challenge alone flips answers. Models changed answers 46% of the time on average when asked "are you sure?", and accuracy fell by 17% on average. The FlipFlop Experiment (arXiv 2311.08596)

Why the checker is independent

  • •Judges favor their own model family even with objective rubrics. Self-Preference Bias in Rubric-Based Evaluation (arXiv 2604.06996)
  • •A panel of smaller models from different families showed less bias at roughly a seventh of the cost, motivating the 3-model jury option for high-stakes checks. Replacing Judges with Juries (arXiv 2404.18796)
  • •Weak writer plus strong checker is a cost-effective pairing. Variation in Verification (arXiv 2509.17995)
  • •Separating generation from evaluation is more tractable than making a generator critical of its own work. Anthropic, Harness design for long-running application development: https://www.anthropic.com/engineering/harness-design-long-running-apps

Why rules stay short and enforcement moves to code

  • •Bloated context files hurt cost and rarely help. LLM-generated rules files reduced task success about 3%, human-written files gained about 4% on average, and both raised inference cost over 20%. Keep agent rules minimal and task-specific. Evaluating AGENTS.md (arXiv 2602.11988)
  • •Instruction-following degrades as instruction count grows. How Many Instructions Can LLMs Follow at Once? (arXiv 2507.11538)
  • •Prompt rules are requests; hooks are enforced. Claude Code best practices: https://code.claude.com/docs/en/best-practices
  • •Agents game checks they can edit. ImpossibleBench: Measuring LLMs' Propensity of Exploiting Test Cases (arXiv 2510.20270)

Why stopping is statistical

  • •Rule of three. Zero events in n trials gives a one-sided 95% upper bound of about 3/n. Use finite-population and exact one-sided binomial bounds when N is small or k > 0. https://en.wikipedia.org/wiki/Rule_of_three_(statistics)
  • •Noisy checks get ignored. Google kept automated review checks only under a 10% effective false-positive rate (warning-level false discovery rate: dismissed warnings divided by total warnings). Sadowski et al., Lessons from Building Static Analysis Tools at Google, CACM 61(4)
  • •100% is the wrong reliability target. Google SRE Workbook, Implementing SLOs: https://sre.google/workbook/implementing-slos/