JCH-AT-001·A DEVELOPMENT PRACTICE BRIEF 2026-08-11
Guardrails · Logging · Scoring · Provenance

The Audit Trail

Guardrails, logging, scoring, and provenance in an agent-driven development workflow — and how to install the same discipline in any harness.

10,661
raw session transcripts retained — 6.2 GB across 156 projects
1,610
sessions archived & full-text searchable — 295,422 messages
45
repos carrying an append-only decision log
323
files carrying machine-authorship provenance tags
ALL COUNTS MEASURED ON THE LIVE SYSTEM · 2026-08-11 · POINT-IN-TIME FIGURES, NOT RUNNING TOTALS
KEYProvenance marks

Tag legend

The provenance marks used throughout the system, as they appear in roadmaps, decision logs, and code.

CLAUDE-ORIGIN Requirement or constraint an agent inferred rather than the owner decided. Greppable at write time; never cited back as binding without re-derivation.
user-ratified The owner decided this, line by line. The only approval class that binds.
user-mentioned The owner said the words once, in passing. Not a requirement on its own.
bulk-approved A "y" / "do it" on a plan ratifies its intent — not every line inside it.
agent-originated An agent authored it. Never rounds up to ratified; silence is not consent.
⛔ BLOCKS The only way parked work may gate other work — and it must quote the owner's own instruction.
▶ RESUME HERE Session hand-off block inside the roadmap itself. Sections are never renumbered, so citations stay stable.
earned 2026-07-25 Date-stamped receipt on a standing rule: how it was earned, often with the triggering incident quoted verbatim.
§ 00Executive summary

Evidence over recollection

AI agents now write most of the code in this workflow. That speed is only safe if every claim about the work can be traced to a record.

Agent-driven development produces a large volume of machine-authored code, requirements, and documentation. Without discipline, three questions become unanswerable: who decided this, when, and on what evidence? The system described here makes those questions cheap to answer. It rests on one principle:

Any claim about the work must be traceable to a transcript line, a ledger row, a decision entry, or a greppable tag. If no record exists, the honest answer is "origin unknown" — never a plausible story.

Four pillars implement the principle:

  • Logging. Every working session is recorded verbatim, archived automatically, and searchable forever.
  • Scoring. Quality-critical work ships only when it measurably beats the best prior version — wins and losses kept in append-only ledgers.
  • Instrumentation. Cost, token, and activity telemetry at the session level; the same observability pattern built into every shipped app.
  • Tagging. Every requirement carries provenance: human-decided user-ratified or machine-inferred CLAUDE-ORIGIN — ratified, or merely proposed.
1 Work happens in recorded sessions Every prompt, model reply, tool call, and result written to a local transcript — in order, verbatim. CAPTURE IS THE DEFAULT, NOT AN OPT-IN 2 Records archived on session end Lifecycle hooks import each transcript into a single searchable archive — even before context compaction. NO HUMAN STEP REQUIRED 3 The archive is queryable A read-only viewer: full-text search, cost analytics, and agent-activity metrics over the whole corpus. READ-ONLY BY DESIGN 4 Decisions, scores & tags annotate it Append-only decision logs, quality ledgers, and provenance tags live in each repo, next to the code. EVIDENCE LIVES WITH THE CODE IT GOVERNS 5 Shipping is gated on the record Release tooling enforces score gates and refuses destructive operations; on any error it stops and reports exactly where the work sits. THE RECORD DECIDES WORK → EVIDENCE → RELEASE If a human has to remember it, it will not happen.
FIG 0-1 · PROCESS CHAIN · CAPTURE IS AUTOMATIC AT EVERY STAGE — NO STAGE CAN EDIT WHAT A PREVIOUS STAGE WROTE
§ 01Pillar 01

Logging

The session record is the court of record. Everything else — git, docs, memory — is secondary evidence.

What it captures

  • Every agent session is written to disk as structured JSONL: each prompt, each model reply, each tool invocation and its result, in order, verbatim. Currently 10,661 transcript files across 156 project directories (6.2 GB).
  • A dedicated archiver (claude-vault, a small Rust CLI) imports transcripts into one SQLite database with full-text search. Today it holds 1,610 sessions and 295,422 messages in a 560 MB file.
  • Archiving is wired into the session lifecycle: hooks fire the import when a session ends and before long conversations are compacted — capture survives even context truncation, with no human step.

How it is read

  • A local web viewer (claude-code-log) provides full-text search across every transcript in every project, with highlighted snippets, newest first.
  • The viewer is deliberately read-only: the audit surface cannot modify the record it audits. A load-bearing invariant, not a convenience.

The rule that makes it matter

Any investigation of why, who, or when starts at the session record — never at documentation. Git history answers only what changed and when.

One claim echoed across three files is one origin, not three confirmations. Repetition is circular authority, not evidence.

Where it lives

~/.claude/projects/<project>/*.jsonlraw transcripts, written by the harness
~/Library/Application Support/claude-vault/vault.dbSQLite + FTS archive
claude-code-loglocal read-only viewer & analytics
§ 02Pillar 02

Scoring

Quality-critical work ships through a ratchet: a scored competition against the best prior version. Ties lose.

How the ratchet works

  • Two independent builds. Two agents implement competing versions in parallel from deliberately divergent starting skeletons.
  • A divergence gate. Candidates that differ only cosmetically are rejected before scoring — the competition must explore real alternatives.
  • A versioned rubric. Each candidate is scored per axis — correctness, architecture, tests, readability, robustness — under a rubric whose version is recorded with the scores.
  • A strict gate. The winner ships only if its total strictly beats the reigning champion. Equal is not better; nothing ships on a tie.
  • Losses are recorded too. Every run is appended to the ledger, win or lose. A failed attempt is audit data, not something to be tidied away.
Candidate A skeleton α Candidate B skeleton β — deliberately divergent divergence gate real alternatives only cosmetic twins → rejected Versioned rubric correctness · architecture · tests · readability · robustness — rubric version recorded total > champion? strictly — ties lose SHIP new champion on the ledger lose / tie ledger row anyway A failed attempt is audit data, not something to be tidied away.
FIG 2-1 · RATCHET PIPELINE · STRICT IMPROVEMENT OR NO SHIP — EVERY RUN BECOMES A LEDGER ROW

The ledgers

38 quality ledgers exist today: per-feature ledgers committed inside each repo, plus a global cross-repo ledger for one competitive page family. Each row records run date, per-axis scores, total, rubric version, and result — so any shipped version can be compared against everything that lost to it.

Right-sized testing

Test suites are generated by one calibrated command rather than ad hoc, so suite size is a deliberate, budgeted choice — not agent enthusiasm. A repo with no tests is a decision on record — not a gap.

Where it lives

<repo>/.claude/ratchet-up/<feature>-ledger.mdper-feature score ledgers
~/Projects/.claude/journey-pages/ledger.mdglobal cross-repo champion ledger
§ 03Pillar 03

Instrumentation

The workflow measures itself at three layers: the session corpus, the harness lifecycle, and every shipped application.

Session-level telemetry

The viewer computes corpus analytics live from the raw logs: agent dispatch counts and fleet hours, token flow, prompt-cache utilization, and spend by day. Spend is estimated at public list prices per token and labeled as an estimate — it tracks billing closely but is never treated as an invoice.

Harness lifecycle hooks

The harness instruments itself through hooks that fire at session start, session end, before context compaction, after file edits, and on prompt submit. The archive import rides the session-end and pre-compaction hooks; policy reminders ride the others.

Instrumentation is enforced by the machinery, not by memory. If a human has to remember it, it will not happen.

The application observability pattern

  • Append-only event log plus a telemetry store (latency, tokens, cost) with audit events for logins and account changes.
  • A no-op-safe emit seam: one emit module is the sole write path, wrapped so observability can never break the request that produced the event.
  • Denormalized actor attribution: identity captured at write time — no join back to user tables that could later rewrite history.
  • Admin-only aggregates with percentiles, and prune-on-read retention.

Ship-time guards

  • The release pipeline refuses destructive git operations (--force, --no-verify, hard resets, forced branch deletion).
  • Secret and oversized-file guards run before anything is staged.
  • One attempt per mutating command — no blind retries. On any error the pipeline stops clean and reports exactly where every piece of work sits.
§ 04Pillar 04

Tagging & provenance

Every requirement answers one question on sight: did a human decide this, or did a machine infer it?

Authorship tags

Any requirement an agent inferred — rather than the owner decided — is tagged CLAUDE-ORIGIN at write time. The tag is greppable; 323 files carry it today. At read time the rule inverts: agent-authored text is never cited back as binding without being re-derived first.

Approval classes

"Go ahead" is not a line-by-line ratification. Only the first class binds; the lower three never round up, and silence is never consent:

user-ratified The owner decided this, on its own terms. Binding.
user-mentioned Said once in passing — a reflex qualifier or a capability-driven wish. One direct question before it becomes load-bearing architecture.
bulk-approved A "y" / "do it" on a plan ratifies its intent — not every line inside it.
agent-originated An agent authored it. Never cited as binding without re-derivation.

Decision logs & the single roadmap

  • 45 repos carry an append-only DECISIONS.md: dated entries superseded by new entries, never rewritten.
  • 48 repos carry a single ROADMAP.md — the sole source of truth for execution. Rival plan documents are folded in and deleted.
  • Parked work is non-blocking by default; it can gate other work only through an explicit ⛔ BLOCKS line quoting the owner's own instruction.
  • Sections are never renumbered, so citations stay stable; sessions hand off through a ▶ RESUME HERE block inside the roadmap itself.

Rules carry their own receipts

Standing rules are date-stamped with how each was earned — earned 2026-07-25 stated 2026-06-26 — often with the incident quoted verbatim. The governance layer obeys the discipline it enforces.

§ 05Replication

Instrumenting another harness

The pillars are portable. In dependency order — each step is useful on its own; together they reproduce the full audit trail.

01Turn on verbatim session captureRetain every prompt, response, and tool call as structured logs. Capture must be the default, not a per-session choice.
02Archive automatically at session endHook the harness lifecycle to import transcripts into an append-only, full-text-searchable store. If a human has to remember it, it will not happen.
03Stand up a read-only viewerSearch, snippets, and analytics over the archive. The audit surface must not be able to edit the record it audits.
04Declare the session record the source of truthWho/why/when questions go to transcripts; version control answers only what/when; docs prove repetition, not origin.
05One roadmap, one decision log per repoA single source-of-truth roadmap; an append-only decision log where entries are superseded, never rewritten.
06Tag machine-inferred requirements at write timeOne greppable marker for anything an agent authored rather than a human decided, and classified approvals — ratified vs. bulk-approved vs. agent-originated.
07Gate quality-critical work on scored ledgersVersioned rubric, strict improvement over the reigning champion, and append-only records of losses as well as wins.
08Build the same discipline into shipped appsAppend-only event logs, a fail-safe emit seam, actor identity captured at write time, cost/latency/token telemetry.
09Label estimates and date-stamp countsComputed spend is an estimate, never an invoice; any quoted number is a point-in-time fact, dated at measurement.
10Guard the ship pipelineRefuse destructive operations, scan for secrets before staging, and on any error stop with an exact statement of where the work is.
§ 06About the numbers

Verification notes

All counts were measured directly on the live system on August 11, 2026: transcript and project counts from the harness log directory; archive totals from the archiver's own statistics command; decision-log, roadmap, ledger, and provenance-tag counts from filesystem searches across the project tree. They are point-in-time figures and will drift upward.

Spend figures are estimates computed at public list prices per token — close to billing, but not authoritative invoices.

Mechanisms in Pillars 02–04 were verified against the harness's own command and skill definitions rather than observed end-to-end in this sitting.

Prepared by Justin Higgins. All tooling named here is local, self-hosted, and read-only against the records it audits.

TitleTHE AUDIT TRAIL — GUARDRAILS IN AN AGENT-DRIVEN DEVELOPMENT WORKFLOW
Prepared byJustin Higgins
Date2026-08-11
RevA
SystemClaude Code harness
Doc no.JCH-AT-001
StatusMEASURED