messageKind knew only the tmux preamble, so a prompt opening with the T3 header [from: role (id) -> to: role (id)] counted as human in Table 2. The first line now matches either form; anything short of the full header stays human. Filbert approved R1 against the frozen hashes. Proof: packages/ledger/tests/ledger.test.mjs, 22/22; against HEAD's ledger.mjs it fails exactly the two new tests. No suite runs it. Eight suites green on the staged tree. The fix changes zero current counts: no Pi log under .pi/state contains a T3 header, and the ledger does not read T3 transcripts. Gate F waits on a T3 thread source. Co-Authored-By: Claude Opus 5.5 <[email protected]>
78 lines
3.6 KiB
Markdown
78 lines
3.6 KiB
Markdown
# Ledger: T3 header counts as agent (#1506), R1 candidate
|
|
|
|
Sage assigned this on 2026-09-26 after commit A (af4203ca). Filbert reviews.
|
|
Not committed.
|
|
|
|
## Defect
|
|
|
|
`messageKind` in `packages/ledger/src/ledger.mjs` knew only the tmux preamble
|
|
`[host:session -> host:session]`. A prompt that opens with the T3 header
|
|
`[from: sage (1ef1e4f8-…) -> to: filbert (9cb9731e-…) class=actionable]`
|
|
counted as human, so Table 2's Human column and the human-per-closed ratio
|
|
rise once seats talk over T3. DEFERRED Open entry "Ledger counts T3 agent
|
|
messages as human".
|
|
|
|
## Change
|
|
|
|
- `messageKind` also matches the T3 header on the first line. The sender is the
|
|
`from:` role. `control-board` is board, any other role is agent. Anything short
|
|
of the full header stays human. That includes the header on a later line, a
|
|
leading space, a missing thread id, `class=` with capitals, `]` followed by a
|
|
non-space, and `From:` capitalized. The tmux branch is unchanged.
|
|
- Two tests: a Table 2 fixture with two headered prompts and one plain prompt
|
|
for seat `bob`, expecting agent 2 and human 1. Also a direct classification table.
|
|
- README counting rule names both forms.
|
|
|
|
## Evidence
|
|
|
|
- `node --test --test-reporter=tap packages/ledger/tests/`: 22/22 on the
|
|
working tree.
|
|
- The same test file against HEAD's `ledger.mjs` (full `git archive HEAD` tree):
|
|
20/22. The two failures are the two new tests, so they catch the defect.
|
|
An earlier archive of `packages/ledger` alone also failed three gitea-helper
|
|
tests. Those tests need `scripts/gitea-api.sh`, which the partial archive left out.
|
|
- Suites on the working tree: config 24, task 90, foundation 43, conductor 17,
|
|
release 14, auth 15, discord 63. None of them runs the ledger tests.
|
|
|
|
## Frozen files
|
|
|
|
`r1-manifest.sha256` holds the three file hashes; `r1.patch` is `git diff
|
|
packages/ledger` at freeze time.
|
|
|
|
## Known limit, not fixed here
|
|
|
|
The fix changes zero current counts. Table 2 reads only
|
|
`.pi/state/<seat>/sessions/*.jsonl`, and no file there contains a T3 header
|
|
for any seat. Filbert checked this in R1:
|
|
- `grep -rF '[from: ' .pi/state/*/sessions/` finds nothing.
|
|
- The candidate `messageKind` gives Dewey 52 agent, 7 board and 9 human, and
|
|
Sage 193 agent and 72 human. That covers every user message in Pi logs
|
|
modified since 2026-09-20. Every non-human first line is the tmux form.
|
|
- Filbert's three T3 messages to Dewey on 2026-09-26 are not in
|
|
`.pi/state/dewey`.
|
|
|
|
Dewey's and Sage's Pi logs are current, but they only carry tmux traffic. T3
|
|
traffic goes to the harness transcripts: Claude under `~/.claude/projects`,
|
|
Codex under `~/.codex/sessions`. The ledger reads neither, so a T3-routed
|
|
prompt to any seat counts nowhere, as agent or as human. The Human column
|
|
can't see T3 traffic at all. For Darkwing and Filbert, whose newest Pi logs
|
|
end 2026-09-14, and for Rocko, who has no Pi sessions directory, zero means an
|
|
empty source, not zero human prompts. The fix is correct for a source that
|
|
carries T3 headers. Sage asked for a brief on a read-only T3 thread source;
|
|
Gate F waits on it.
|
|
|
|
Filbert also found two misclassifications in older logs. Neither is touched
|
|
here:
|
|
- `[rev-code-02 -> dragon-lin:sage class=actionable]` has no host on the
|
|
sender, so it counts as human.
|
|
- One Dewey prompt opens with a quote character before the tmux preamble, so
|
|
it counts as human.
|
|
|
|
## Review
|
|
|
|
Filbert, R1, 2026-09-26: approved the three frozen files. He verified the
|
|
manifest and patch, got 22/22 on the tree and 20/22 against HEAD's source, and
|
|
matched the regex to `docs/guides/T3-AGENT-COMMS.md`. He accepts the body on
|
|
the header's line, which the tmux branch also allows. He corrected the
|
|
known-limit text above.
|