The Brilliant Employee
The Brilliant Employee · 08

The Ledger: one line per task, forever

Every finished task appends a line to a file the model never writes to itself. Without it, an improvement claim is a memory of feeling faster.

AuthorSagnik Mitra
Published2026-08-04
Reading timeabout 3 min
Deck11 slides
Download PDF

What is inside

  1. The whole system is one file
  2. What should an AI agent's task log record?
  3. One real line
  4. The two verdicts
  5. The confession fields
  6. What one line buys
  7. How every number here was derived

Every finished task appends at least one line to a file the model never writes to itself, recording what was decided, what ran, and how it ended. Without that record an improvement claim is a memory of feeling faster. With it, a claim is checkable by someone who was not there. The record is what makes the difference between good and lucky visible.

Key facts. One append-only line per finished task since 27 June. Rows carry up to 33 fields.

Last updated:

01The whole system is one file

Every task my automation system finishes appends at least one JSON line to a dated file under ~/.sgnk/traces/. He does not write it himself; a hook in the harness does, and nothing he can say or do revises it afterwards. That file is the Ledger, the part of this workplace that remembers. As of 4 August it is 39 daily files old, one per day since June 27, with no missing dates.

Next to it sits a written rule: the phrase self-improving is banned in this workspace until somebody proves that file is actually being read. This post is the file's side of the story. One real line, pulled from last night, dissected field by field.

02What should an AI agent's task log record?

Written rule #31 in the standing rulebook says every task emits ONE per-task trace line, carrying a correlation_id and an accepted field, mapped to standard telemetry attribute names. Not just the big orchestrated runs. Not just the tasks that went well. Every task, including the embarrassing ones, which are the point.

You can rent the model. You cannot rent the part that tells you it was wrong.

The reasoning is blunt: no evaluation loop, no drift check, no preference signal has any data without it. And the append-only part matters more than the complete part. A worker who grades his own homework will also, given the chance, tidy his own transcript. So the transcript is written by the workplace, not the worker.

03One real line

Here is a row from the small hours of 3 August, redacted only where it names the session. A generate-shaped task at 00:12 UTC, sized to the cheap tier, run single-shot: timestamp, correlation_id SESSION:16, gate_tier floor, decided_model sonnet, decision_real_n 0, decision_mode advisory, model claude-opus-5, input_tokens 838575, cache_read_tokens 838573, fresh_input_tokens 2, output_tokens 9896, latency_ms 191000, assertion_pass true, assertion_source machine-gate, accepted false.

The full row carries 33 keys. Three of them are worth the whole post.

if [ -s "$TRACE_FILE" ]; then
printf '\n%s' "$_ROW" >> "$TRACE_FILE"
else
printf '%s' "$_ROW" >> "$TRACE_FILE"
fi
Plain words: THE LEDGER. ~/.sgnk/traces/YYYY-MM-DD.jsonl. One file per day, at least one JSON line per task, written by the harness, never by the worker. A human verdict arrives later as a second line on the same correlation id.
If the record can be edited by the thing being measured, it is not a record.

04The two verdicts

First pair: assertion_pass and accepted. The Judge, the machine check that grades the work, passed this task cleanly, 1 of 1 assertions, source machine-gate. Three keys later, accepted says false. The verifier said yes. I said no. Both verdicts sit on the same line, joined forever by the correlation_id.

That disagreement is the most valuable data the system produces. Ten rows where the Judge and I agree teach almost nothing. One row where the machine passes work I reject is a direct measurement of how miscalibrated the grader is, and you can only collect it if both verdicts are written to the same place at the same time. The cost numbers ride along for free: 838,575 input tokens of which 838,573 came from cache, two fresh tokens, 9,896 out, 191 seconds of work.

~/.sgnk/traces/2026-08-03.jsonl (one row, redacted)
{"timestamp":"2026-08-03T00:12:32Z","correlation_id":"SESSION:16",
"skill":"unknown","gate_tier":"floor","gate_orchestrate":"single",
"decided_model":"sonnet","decision_real_n":0,"decision_mode":"advisory",
"task_shape":"generate","model":"claude-opus-5","tier":"opus",
"input_tokens":838575,"fresh_input_tokens":2,"cache_read_tokens":838573,
"output_tokens":9896,"latency_ms":191000,"cwd":"~/GitHub/m2web-redesign",
"assertion_pass":true,"failure_mode":null,"learning_mode":"on_policy",
"accepted":false,"assertion_n":1,"assertion_source":"machine-gate"}
Everything above is one task's complete paper trail, written the moment it finished.

05The confession fields

Second pair: decided_model and decision_mode. The Gambler, the part that recommends which model gets each job, recommended the cheap model. The model field says the expensive one ran anyway, because decision_mode is advisory: the pick gets logged, not enforced. And decision_real_n says 0, meaning the recommendation had zero real observations behind it.

So the line confesses, on the system's behalf, that the learning loop is not closed. My routing brain writes its homework down and does not yet read it. This is exactly why written rule #32 exists: self-improving is forbidden as a claim unless an eval loop is running and feeding routing. A grades folder that exists but sits empty does not count. The ban has not been lifted, and the row itself is the evidence for why.

ROUTING FIELDS
correlation_id
SESSION:16 . the join key every downstream loop keys on
gate_tier
floor . the Gate, the part that sizes the job, sent this to the cheap tier
decided_model
sonnet . the Gambler, the part that recommends the model, recommended cheap
decision_mode
advisory . the pick was logged, not enforced. The big model ran anyway
decision_real_n
0 . real observations behind that recommendation: none
Log the recommendation AND the outcome. The delta between them is the signal.

06What one line buys

Every loop I actually want needs this substrate and nothing fancier. Calibrating the Judge needs machine grades joined to human verdicts. Routing by track record needs a track record. Drift detection needs dated rows to baseline against. All of it keys on the correlation_id in a one-line-per-task file the worker cannot touch.

It costs one line per task, which makes it the cheapest component in the whole workplace, and the most binding. Everything I am allowed to claim about this system in public is bounded by what this file can prove. It currently proves that the system remembers everything and has learned a little. When that second half changes, the file will say so before I do.

Measurement before improvement. The order is not negotiable.

07How every number here was derived

Both source files are append-only, so re-running these will give larger denominators than the ones quoted.

# the ledger: one dated file per day since 2026-06-27, no gaps
ls ~/.sgnk/traces/*.jsonl | wc -l
# -> 39. The glob does not recurse; find returns 41 because
#    traces/steps/ holds two step-level files. One file per
#    day on which the ledger was written.

# the dissected row: machine pass + human reject on the same line
jq -c 'select(.assertion_pass==true and .accepted==false)' ~/.sgnk/traces/2026-08-03.jsonl | head -1

# count the keys on that row
jq 'select(.assertion_pass==true and .accepted==false) | keys | length' ~/.sgnk/traces/2026-08-03.jsonl
# -> 33

# latency: 191000 ms / 1000 = 191 s = 3 min 11 s
echo '191000/1000' | bc

# the ban, verbatim, in the standing rulebook (Learned Rules #31 and #32)
grep -in 'self-improving' ~/.claude/CLAUDE.md
All episodes