Chapter 2.6 follows chapter 2.5, The guards of the harness, and precedes chapter 2.7, The closeout chain of a batch, within part 2, the harness.

A ledger assigns tokens from a saved transcript to activities and artifacts. Tokens to success provide the cost measure. A handoff note carries the information needed for the next agent. The timing record stores the durations associated with the run.

2.6.1 Ledger categories of the measurement harness

The ledger has eleven categories: ten run categories and one scoring-only category. The ten run categories are sys_prompt, task_brief, code_read, lap_read, code_edit, doc_maintenance, test_exec, search_nav, reasoning_out, and harness_overhead. The scoring-only category is scoring_external.

source: ledger_lib.py lines 55 to 59

The classification uses the tool and the path touched by the agent. Reads of literate artifacts use lap_read, and edits to them use doc_maintenance. Reads of source files use code_read, and edits to them use code_edit. Search commands use search_nav, and test commands use test_exec. Agent output uses reasoning_out. Harness output uses harness_overhead. The system prompt uses sys_prompt, and the task brief uses task_brief. The ledger also records the stable artifact identifier for a touched literate artifact.

2.6.2 Timing record of the measurement harness

timing_lib.py writes the timing record beside the token ledger. It records the agent loop, visible tests, and hidden probes for the worked cell. The worked cell’s timings.jsonl is the saved timing record used for the timing figure. The token ledger is saved as token_ledger.jsonl.

2.6.3 Handoff note of the measurement harness

agent_handoff.schema.json specifies the handoff note. The note records a work summary, changed files and their purposes, public interfaces, identifiers, conventions, data records, a verification walkthrough, changed settings, and unfinished work. The worked cell’s structured handoff record is the saved handoff record. The note gives the next agent or reviewer a precise account of the changed state.

2.6.4 Ledger regeneration and backfilling

ledger_lib.py derives the ledger from the saved transcript. regenerate_token_ledgers.py regenerates token ledgers when a run is repaired. backfill_turn_ledgers.py backfills turn ledgers, and extract_cell_metrics.py extracts cell metrics. These operations read the transcript and write ledger data without changing the transcript, timing record, or handoff note.

2.6.5 Ledger reconciliation warnings of the measurement harness

The reconciliation compares ledger tokens with the totals reported by the command line. ledger_lib.py can write a remainder row when the totals differ. The live summary reports many reconciliation warnings.

2.6.6 Record diagrams of the measurement harness

The token ledger flow shows a saved transcript moving through event parsing and category assignment into token ledger rows, followed by reconciliation with reported totals. The token ledger flow from transcript to reconciled ledger.

Figure timing-record. The worked cell timing record shows the durations of the agent loop, visible tests, and hidden probes as a comparative timing graphic.

%% figure timing-record
flowchart LR
  n1["The worked cell timing record shows the durations of the agent loop<br/>visible tests<br/>hidden probes as a comparative timing graphic"]

source: operations/site-ia/A3-diagram-specification.md The worked cell timing record.

Figure handoff-schema. The handoff schema shows the structured note and its fields for summary, changed files, interfaces, identifiers, conventions, data, verification, settings, and unfinished work.

%% figure handoff-schema
flowchart TB
  subgraph g1[" "]
    n1["The handoff schema shows the structured note and its fields for summary<br/>changed files<br/>interfaces<br/>identifiers"]
  end
  subgraph g2[" "]
    n2["conventions<br/>data<br/>verification<br/>settings"]
  end
  subgraph g3[" "]
    n3["unfinished work"]
  end
  n1 --> n2
  n2 --> n3

source: operations/site-ia/A3-diagram-specification.md The handoff schema.

2.6.7 Future topology ledger entry

A future second agent would have its own agent entry in the ledger beside the first agent entry. Its token use would retain the same category taxonomy and reconciliation process.

Previous: The guards of the harness | Next: The closeout chain of a batch
source: `operations/site-ia/A6-page-briefs.md` section H5