fix(ledger): Gate F follow-up, Filbert's notes 1 to 3 (#1506)

Darkwing's follow-up to the T3 thread source: manifest 382f5bb0 pins
t3.mjs, ledger.test.mjs and README.md. Filbert approved it (review
6fd693b6). Ledger 51/51; the eight suites pass on the index.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-09-26 16:57:51 -05:00
co-authored by Claude Opus 5.5
parent a4d38a3d93
commit 3a209eeafe
9 changed files with 268 additions and 7 deletions
@@ -144,3 +144,56 @@ What I confirmed on Node 26.8.1:
The worktree was `/tmp/fb-gatef-wt`, removed after the run. The mutations ran
there and were reverted, and the pins were re-verified before removal. No
commit or push.
## Follow-up: notes 1–3
Candidate: `followup.md` `4bae617f…28e8`, `followup.patch` `856feee4…f44d`,
and `followup-manifest.sha256` `382f5bb0…c971`, which pins `t3.mjs`
`5acbc107…14fb`, `ledger.test.mjs` `6546dbaf…c63b` and `README.md`
`101013de…38bd`. All hashes verify. Base `a4d38a3d`.
- 136958c9 committed the pins I approved: `t3.mjs` `dfb092aa`, tests
`7444abd1`, README `27f7366d`, `ledger.mjs` `0afb0320`, `cli.mjs`
`d6092a53`.
- Nothing under `packages/ledger` changes between 136958c9 and a4d38a3d.
- The patch applies cleanly to a detached worktree at a4d38a3d and
reproduces the three pins.
Checks:
- **Ledger tests, clean worktree:** 51/51.
- **Note 1.**
- The test file now holds a raw U+2028 and a raw U+2029 with CRLF, and it
asserts both are present.
- The README names both.
- `ledger.mjs` is unchanged.
- **Note 2.** The new tests cover:
- `humanWithoutEvent` at 1;
- an unparseable event;
- a non-string `messageId`.
The two bad-event tests assert `unknown` for both fields and unchanged
seats. Those are the three `return null` paths in `origins()` plus the
count, and together they cover my two surviving mutations.
- **Note 3.**
- The rethrow keys on `typeof errcode === 'number'`. The existing tests for
SQLite 14, 1544, 5 and the not-a-database case still pass, so real SQLite
failures keep the `--no-t3` message.
- With the old `if` restored, the new test fails (0/1).
- I also checked the CLI path. I put a `null.x` into `query()` and ran the
CLI against a HOME fixture. It prints "Ledger failed: cannot read source
evidence" and exits 1. With the pin restored, the same fixture exits 0.
That fixture had no `orchestration_events`, and it also showed the
diagnostic's unknown path end to end.
- The in-process test passes an explicit fixture path, so the real `~/.t3`
stays closed.
**Verdict: approve** manifest `382f5bb0`.
**Observation for Sage, not about this patch.** Darkwing's live diagnostic is
now 15 where the build had 14. I traced the extra message read-only. I printed
the header shape only, never the body. It is a message in the Sage thread at
2026-09-26T21:41:24Z, sent through T3's API, whose header reads `[from: main
content-engine agent (<id>) -> to: sage (<id>) class=REPLY]`. The sender role
has spaces, so the 6a rule calls it human, and it counts in Sage's human
column. The diagnostic caught exactly the drift it exists for. It doesn't
affect Gate F, which reads Filbert's row, but Sage's row now holds an agent
message as human.