tldr-experts 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +792 -0
  2. package/README.md +19 -5
  3. package/dist/hooks/answer-capture.js +136 -12
  4. package/dist/hooks/budget-gate.js +9 -9
  5. package/dist/hooks/{chunk-889tybxc.js → chunk-17gv74sr.js} +3 -3
  6. package/dist/hooks/{chunk-3w55tp71.js → chunk-5k4dggq0.js} +51 -17
  7. package/dist/hooks/{chunk-14zn51kh.js → chunk-7eqhfddw.js} +28 -569
  8. package/dist/hooks/{chunk-nadqsr3w.js → chunk-97ncnegd.js} +1 -1
  9. package/dist/hooks/{chunk-a6rpj2cp.js → chunk-9w64mxdh.js} +345 -22
  10. package/dist/hooks/{chunk-a5dq2dcp.js → chunk-dhbxzjfs.js} +2 -4
  11. package/dist/hooks/{chunk-hcrbr430.js → chunk-g4db8rbs.js} +2 -30
  12. package/dist/hooks/chunk-h7151g8w.js +803 -0
  13. package/dist/hooks/{chunk-5556vjt5.js → chunk-ka6bkb64.js} +1 -1
  14. package/dist/hooks/chunk-rrkdfk7s.js +30 -0
  15. package/dist/hooks/{chunk-qw73rdbr.js → chunk-v4ay50nq.js} +1 -1
  16. package/dist/hooks/{chunk-v1c1hpb8.js → chunk-vrhczzxs.js} +1 -1
  17. package/dist/hooks/{chunk-bvm6vjrt.js → chunk-x6n8b5fp.js} +1 -1
  18. package/dist/hooks/claim-sources.js +8 -10
  19. package/dist/hooks/dod-gate.js +7 -7
  20. package/dist/hooks/no-reask.js +8 -9
  21. package/dist/hooks/session-start.js +23 -18
  22. package/dist/hooks/statusline.js +10 -10
  23. package/dist/tldrx.js +2539 -1006
  24. package/env.yml +9 -2
  25. package/package.json +1 -1
  26. package/plugin/.claude-plugin/plugin.json +1 -1
  27. package/plugin/skills/tldrx/SKILL.md +8 -1
  28. package/templates/questions.md +8 -0
  29. package/dist/hooks/chunk-q8d3sff9.js +0 -220
  30. package/dist/hooks/chunk-sae7sqty.js +0 -206
package/CHANGELOG.md CHANGED
@@ -1,5 +1,797 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 — 2026-09-02
4
+
5
+ ### Added
6
+
7
+ - **A gate record now says which entity evaluated it and under whose authority (#122).**
8
+ Measured 2026-09-02 on run `260902-discovery-pipeline-map`:
9
+ `{"type":"gate.approved","actor":"alanmartinez","payload":{"by":"alanmartinez","note":"agent-gate: evidence=sign by alanmartinez, …"}}`
10
+ — a gate an AGENT evaluated and signed, under authority the owner delegated once at
11
+ `run new --gates what:agent`. Nobody named `alanmartinez` looked at that stage. `by:` is a
12
+ name and never a kind, the agent signs under the operator account it is running as, and six
13
+ months later that record reads as "Alan personally reviewed this". The only trace of the
14
+ delegation was the prose inside `note:` — which nothing parses and any hand-typed
15
+ `--note "agent-gate: …"` can forge.
16
+ - Two additive blocks on `run.yml`'s gate mapping and on the `gate.approved` payload:
17
+ `executed_by: {type: human|agent|auto, id?}` and
18
+ `authority: {type: direct|delegated, policy, authorized_by, source}`. Between them they
19
+ answer the four questions an audit asks — who authorized the decision authority, which
20
+ entity evaluated THIS gate, whether it was a person / an agent / the facilitator, and
21
+ under which policy.
22
+ - **The executor's kind is read off how the gate is being closed, never off the policy.**
23
+ A person may always `approve` an `agent`-gated stage with no flag; that is a human acting
24
+ directly, whatever the stage was set up to allow, and it is recorded as one.
25
+ - **Derived, never guessed.** The policy is the run's own frozen `gates_policy`. The
26
+ authorizer is the actor of the `gate.policy_changed` that last moved that stage's policy,
27
+ or — when nothing moved it — the actor of `run.created`, who froze it at `run new`, and
28
+ `source` names which. When the log says neither, `authorized_by` is `null` and `source` is
29
+ `unrecorded`: the absence is said out loud rather than filled in with a plausible name,
30
+ and the validator refuses a record where those two do not travel together.
31
+ - **`by:` is untouched**, and so is `gate.evidence`. `by` is what the note said, and the
32
+ note is the agent's own claim about itself; rewriting it would be inventing a second one.
33
+ `gate.evidence` says what was checked — not who checked it under whose authority — and
34
+ its `role:` is a job an agent gave itself, not an identity the framework measured.
35
+ - **Old records read exactly as they did.** A gate written before these keys has neither,
36
+ validates, loads, and emits byte-for-byte; every reader falls back to `by`, and so does a
37
+ person who signed as themselves — for them the name is the whole truth. Pinned by test in
38
+ `test/gate-authority.test.ts`.
39
+ - `tldrx run status`, `tldrx replay` and the dashboard render a delegated signature as
40
+ `agent alanmartinez (delegated by alanmartinez, policy: agent)` — one shared renderer,
41
+ `describeGateSignature`, so the three cannot disagree. The dashboard carries its own
42
+ closure-free copy (`dashSignature`) because everything serialised to the browser may close
43
+ over nothing, and the two are asserted to agree case for case, exactly as `dashEscape` is
44
+ against `escapeHtml`. `DASHBOARD_MODEL_VERSION` stays at **3**: additions never bump it.
45
+ - A revoked gate DROPS both. `by: null` says nobody signed it, and an executor left beside
46
+ that would be two contradicting claims about one fact.
47
+
48
+ - **`tldrx run status` prints a stage's duration and says when a gate was signed with
49
+ words (#120).** `run.yml` has recorded `started_at`, `ended_at` and `gate.note` on every
50
+ stage since `run new` wrote the first one. #118 put all three on the dashboard's
51
+ `StageRowModel` and drew them; `runStatus.ts` built its own record from the same file and
52
+ was not touched, so the page and the CLI disagreed about what is knowable from one file —
53
+ a reader watching a stage that had been running for hours saw no sign of it in the
54
+ terminal. Each gate row (one per stage) now ends with a compact duration and a `✎` on a
55
+ signed note, and `--verbose` adds the two instants behind a duration, the sentence behind
56
+ an absent one, and the note itself.
57
+ - **One subtraction, not two.** `dashDuration` / `dashDurationAbsence` moved out of
58
+ `dashboard/render.ts` into `core/run/duration.ts`, a leaf that imports nothing and that
59
+ both surfaces read — rather than a second implementation of the same arithmetic. They
60
+ keep their `dash` names because `clientRenderer()` serialises the DEFINITION name into
61
+ the page, so a rename would be a `ReferenceError` on the live dashboard rather than a
62
+ build error; both are still closure-free and still serialised.
63
+ - **Still no stored duration, and still no synthesised zero.** A stage with a `started_at`
64
+ and no `ended_at` reads `not ended`, one with the reverse reads `no start`, and two
65
+ timestamps that do not yield a gap read `bad timestamps`. A stage with NEITHER end says
66
+ nothing on the line — it has no clock to account for and its status column already says
67
+ `pending`; printing "not timed" on every row of a fresh run is noise, not honesty, and
68
+ `--verbose` still names that case in full. `note: ""` is not a signature: it reads as
69
+ `null`, is never marked and is never quoted.
70
+ - **`--json` is additive.** `started_at`, `ended_at` and `note` are appended to each gate
71
+ row; every top-level key keeps its position, so a consumer reading `run`, `waiting.kind`
72
+ or `gates[i].by` is untouched. A new test pins the row's key order the way
73
+ `SINGLE_RUN_KEYS` pins the top level's.
74
+
75
+ - **The docs site's demo dashboard now shows the story grid and the Waves view with
76
+ something in them (#119).** `gen-demo.ts` composed its workspace from two fixtures,
77
+ neither of which had ever reached the Plan phase, so `loadPlan` returned null for all
78
+ eight runs and every plan-shaped rendering on the public page drew its EMPTY state: the
79
+ Waves view said "No waves in this workspace", the story grid drew nothing at all, and
80
+ Plan & build said the Plan phase had written no stories. A demo of a dashboard that
81
+ cannot show two of its own views is a demo of the wrong thing.
82
+ - A **third** synthetic fixture — `test/fixtures/plan/workspace`, one run at Build with
83
+ six stories over two waves, two epics on two repos, a fix round on S2 and two review
84
+ retries on S5 — added to `DEMO_SOURCES` beside the other two. Third rather than an
85
+ edit, because a `03-plan/` dropped into a chain run would move that run's
86
+ `stagesTotal`, `stagesDone` and `percent` (numbers `dashboard-deps.test.ts` reads),
87
+ and `dashboard.test.ts` asserts — correctly — that the views fixture's one run carries
88
+ `plan: null`. Both existing fixtures stay byte-identical.
89
+ - Synthetic like everything else on that page: it lives under `test/fixtures/`, so
90
+ `assertSynthetic` is what permits it to be read at all, and the demo stays
91
+ deterministic (fixed clock, invented root, no machine path).
92
+ - Measured over the composed workspace: 9 runs, 2 experts, 0 unreadable files, 0 skipped
93
+ events, 6 stories across 2 waves, and `run.build` non-null for the first time.
94
+
95
+ - **A stage now carries when it started, when it ended and what its gate said (#118).**
96
+ `run.yml` has recorded `started_at`, `ended_at` and `gate.note` on every stage since
97
+ `run new` wrote the first one, and `StageRowModel` carried none of the three — so the
98
+ phase timeline (#107) printed neither a duration nor a signature and had to carry a
99
+ paragraph explaining why. Three additive fields, read off the same `run.yml` object the
100
+ row was already built from. `DASHBOARD_MODEL_VERSION` stays at **3**: additions never
101
+ bump it, and no existing field reads differently than it did at v3.
102
+ - **No duration is stored.** A duration is a subtraction, it exists only when both ends
103
+ do, and a model field would have to pick a number for the case where one end is
104
+ missing — `0` is a measurement of zero, and inventing one is exactly the class of
105
+ confident-wrong figure this redesign exists to stop. `dashDuration` does the
106
+ subtraction where it is drawn, and a stage that recorded neither end gets a sentence
107
+ naming *which* end is missing rather than a blank cell reading as "it took no time".
108
+ - **An empty note is an absent one.** `note: ""` is what `run new` writes on a gate
109
+ nobody has signed. It reaches the model as `null` and is not quoted at a reader as if
110
+ it were a signature.
111
+ - The timeline draws the duration beside the cost on each stage's summary row and quotes
112
+ the gate's own words inside its drawer — the two of #107's four asks that could not be
113
+ met before.
114
+ - **`tldrx dashboard --serve` pushes only when the page would actually change, and ages
115
+ itself when it would not (#108).** The live server already watched the tree and pushed a
116
+ `reload` per debounced burst; three things were missing, and each one is a different way
117
+ for a live page to lie.
118
+ - **A push per burst is not a push per change.** Every write under `.tldrx/` or
119
+ `tldrx-work/` pushed, including writes to files the model does not read — `--static`
120
+ writes into `.tldrx/cache/`, inside the watched tree, so exporting a page while serving
121
+ one made the served page redraw because it had been photographed. The trigger is still
122
+ the file event; the DECISION is now a rebuild of the model compared against the one the
123
+ page is showing, on a fixed clock so ages do not make every rebuild differ. A digest of
124
+ "the files that matter" was rejected on purpose: that list drifts the moment the model
125
+ reads one more thing, and its failure mode — a dashboard that quietly stops updating —
126
+ is exactly what the comparison cannot do.
127
+ - **Silence is a state the files cannot announce.** Ages, and the `quiet` mark #107 puts
128
+ on half an hour of nothing, are computed against a `now`. With only file-triggered
129
+ pushes a stalled run keeps saying "2m ago" until somebody writes a file: the one state
130
+ worth seeing is the one state the page could not reach. A new `age` event carries a
131
+ timestamp every 25 s, whatever the disk is doing, and doubles as the stream's
132
+ keep-alive — a tick that says something, at the cost of the comment that said nothing.
133
+ - **The ledger is read forward.** `events.jsonl` is append-only, so
134
+ `src/core/dashboard/tail.ts` keeps a byte offset per run and reads only what arrived —
135
+ holding back a line whose newline has not landed, starting over if a ledger shrinks
136
+ under it, and dropping a run's offset when the run goes. That is what lets a `reload`
137
+ carry `{at, appended, runs, added, removed}` and say *three events landed on this run*
138
+ rather than only *something changed*.
139
+ - **`--serve` is a flag now**, and `--serve --static` is a refusal (exit 2) rather than a
140
+ silent pick of one. Serving is still the default.
141
+ - **`listRuns` no longer throws while the disk is being written to.** An entry removed
142
+ between the `readdir` and its `stat`, and a `tldrx-work` that is not a directory, both
143
+ escaped `buildModel` — measured, both reproduced. A live reader asks that question
144
+ while a wave is writing.
145
+ - The live page keeps the reader's FOCUS across a repaint (scroll and open panels were
146
+ already kept), because only a live page redraws when nobody asked, and #107's j/k
147
+ navigation loses its place otherwise. That code is in `liveScript()` alone: the static
148
+ export is byte-identical to what it was before this landed, and a test pins the hash.
149
+
150
+ - **An answer that overtakes an earlier phase's document now says so on that document
151
+ (#104).** A phase document is a point-in-time snapshot, and an owner answer recorded
152
+ three phases later can flip a design it still asserts. Measured twice on
153
+ `260830-ordering-inventory`: `03-plan/stories/S4.md` promised a `[Theory]` proving an
154
+ inert stock-effect default after F021 established Restock for 5 of 64 pairs and the
155
+ shipped test was a different one; `02-how/design.md` and its handoff said "no
156
+ order_number column is created" after F022 ordered one. Both flips were recorded — in
157
+ `questions.md`, in `facts.yml`, in `retro.md` — and neither was in the file a reader
158
+ opens. The audit's conclusion, "read `04-build/` rather than `03-plan/` for what
159
+ actually shipped", was tribal knowledge nothing on the page taught.
160
+ - **The question already names the document.** §2.7 requires `Why asked:` to end with a
161
+ `[src: …]` token proving the gap is real, and a question raised in Build about a plan
162
+ claim cites that plan claim — that is what the citation is for. So the affected set is
163
+ derived from data the grammar already makes mandatory: every `file` ref pointing at a
164
+ `.md` in an EARLIER phase of the run. No new schema, no new habit. A citation into the
165
+ question's own phase is not a supersession — that is an author reading their own
166
+ half-written page — and an optional `affects:` metadata key names documents explicitly
167
+ for when the honest citation is a source file rather than a document.
168
+ - **A marker, not a reconciliation.** One HTML comment carrying the fact id and one
169
+ blockquote line pointing at `questions.md` and `facts.yml`. Rewriting the stale
170
+ sentence would mean knowing which sentence, and guessing that is how a framework
171
+ starts inventing content. The issue asked for an honest marker; full reconciliation is
172
+ explicitly not required.
173
+ - **Three properties it had to have, each pinned by a test.** Append-only
174
+ (`appendFileSync`; the RED test asserts the phase's own bytes are still the file's
175
+ prefix). Idempotent per fact — the comment carries the id, so the `answer-capture`
176
+ hook firing twice on one edit stamps once, while a *different* fact stacks under the
177
+ first. And invisible to the checks that guard the document: the stamp is deliberately
178
+ not a list item and carries no `[src: …]`, because a bullet appended to a `handoff.md`
179
+ would land inside a §2.8 section where every item must be sourced, and `claim-sources`
180
+ would refuse the very document this makes honest. A stamped handoff validates with the
181
+ same `bulletCount` and the same verdict as before.
182
+ - Both recording paths stamp: a first answer and `tldrx answer … --supersede`. Each
183
+ stamped document appends a `doc.superseded` event (new, closed-set §2.9 type) carrying
184
+ the run-relative path, the fact, the question and whether the document was `cited` or
185
+ named in `affects`; `tldrx replay` renders it. A stamp that cannot be written never
186
+ fails the answer — the decision is recorded and the failure goes to the log as `error`.
187
+ - **The dashboard opens on a "Now" strip, and it says what it does not know (#107).** The
188
+ render half of the owner-approved redesign, on top of the model #103 shipped. The runs
189
+ view now leads with one card per **live** run — every run that is neither `done` nor
190
+ `cancelled`, so a run nobody has started and a run nothing can move are both on it, with
191
+ the ones that raise an ask sorted to the front. Each card carries the phase dots, the
192
+ status, the ask in the page's own words with the command that closes it, the spend, and
193
+ how long it has been quiet. It **replaces** the alert stack rather than sitting beside it:
194
+ it is a superset — the same `dashPending` ask, the same `alert__kind` badge, the same
195
+ sentence — over more runs.
196
+ - **A lower bound never gets a bar.** A progress bar is a claim about a denominator, and
197
+ it is honest only when the number over it is the whole of what was spent. On the run
198
+ #103 audited, 30 of 34 turns put nothing in the meter and not one declared a token, so
199
+ `$14.60 of $62.00` under a quarter-full bar was a confident wrong number drawn in the
200
+ one shape a reader cannot argue with. The bar is now reserved for `spend.basis ===
201
+ "measured"`; every other basis gets the metered figure, a **lower bound** mark carrying
202
+ `spend.reason` in its tooltip, and the count of costless turns out of the total — so the
203
+ size of the gap is a number and not an adjective. Host tokens are printed beside the
204
+ dollars and never added to them.
205
+ - **"Quiet" is 30 minutes, and it is the RENDER's threshold.** The model reports
206
+ `ageSeconds` unclamped and bakes in none, which is right — a workspace where a stage
207
+ takes forty minutes and one where it takes forty seconds cannot share a constant. So the
208
+ page picks, in one comparison, in one place, and says so on the reference page. An
209
+ `mtime` reading prints **touched** rather than "last event" (the file was written, which
210
+ is not the run moving) and a ledger dated after the read is named as two clocks
211
+ disagreeing rather than laundered into "0m ago".
212
+ - **The dots are the phases the run's own file declares.** `run new` writes the whole
213
+ workflow up front (`buildPhases`), so a `feature` run really does draw five, what →
214
+ watch, from the moment it exists — and a `docs` run draws what a `docs` run has. Nothing
215
+ is padded to five for the shape of it.
216
+ - **Three drill-ins on the run detail, and each one names what it cannot show (#107).** A
217
+ **phase timeline** — a lane per phase with its cost, each stage a `<details>` opening onto
218
+ the gate, its policy, its signer and an agent signature's evidence, with the execution-path
219
+ table moved inside a closed panel rather than drawn twice. A **story grid** — one status
220
+ cell per story, forty of them legible without scrolling, each opening onto the plan file's
221
+ fields, the attempt the ledger last recorded, the free review retries and every reopen. An
222
+ **event stream** — the three timestamped kinds the model carries (operator notes,
223
+ `budget.blocked`, `story.reopened`) in one time order, filterable by kind with the same
224
+ button vocabulary the runs list uses. Reading a note next to the refusal two minutes before
225
+ it is how a person works out why somebody rebased a branch by hand.
226
+ - The absences are printed where the numbers would be. A stage's `started_at`, its
227
+ `ended_at` and a gate's free-text `note` are in `run.yml` and on no field of the
228
+ dashboard model, so the timeline reports no duration and quotes no signature. A story's
229
+ build log and its fix list are files the Build writes and the page does not read. The
230
+ stream says out loud that it is not the ledger — `tldrx replay <run>` is. A blank cell
231
+ reads as "nothing happened", and that is the failure mode this whole redesign is about.
232
+ - **A Waves view (#107).** The plan as bars: a row per wave, a bar per story in it, fix
233
+ rounds and free review retries marked on the bar. Gantt-lite and deliberately not a Gantt —
234
+ the axis is the WAVE, because that is the only ordering the files actually assert;
235
+ `StoryModel` carries no start and no end, and an invented x-axis would read as measured. A
236
+ story the plan schedules into no wave gets its own row rather than being dropped.
237
+ - **Craft: keyboard reach, tabular money, still one file.** <kbd>j</kbd>/<kbd>k</kbd> move
238
+ between cards and rows, <kbd>enter</kbd> opens the focused one, <kbd>/</kbd> jumps to the
239
+ filters — printed under the filter row, because an undiscoverable shortcut is not a
240
+ feature, and bound only to keys no browser or screen reader already owns. Money and token
241
+ counts are tabular, so a column of cards reads as a column of numbers. The two marks that
242
+ say "this figure is not what it looks like" — `lower bound` and `quiet` — are words, not
243
+ colours, so they survive a greyscale print and a reader who cannot tell amber from citron.
244
+ Both themes still come from `prefers-color-scheme`, the export is still one self-contained
245
+ file with no network reference of any kind, and there is still no framework: vanilla, CSS
246
+ grid, and `<details>`.
247
+ - `DASHBOARD_MODEL_VERSION` does not move. Nothing here reads a file, adds a field or
248
+ changes what one means — it is the drawing half, and the model it draws is #103's
249
+ unchanged.
250
+
251
+ - **The docs site now SHOWS the dashboard instead of describing it (#106).** A new
252
+ [Live demo](https://ederwii.github.io/tldr-experts/demo) page in both languages frames a
253
+ real `tldrx dashboard --static` export — eight runs, two experts, gates, questions,
254
+ dollars — rendered at build time by `docs-site/scripts/gen-demo.ts` and served from
255
+ `/dashboard-demo/index.html`. It is the shipped `buildModel` and the shipped
256
+ `renderDashboard`, not a screenshot: change the renderer and the page on the website
257
+ changes on the next deploy, which the workflow's `paths` filter now guarantees by
258
+ redeploying on any change under `src/core/dashboard/` or the two fixtures behind it.
259
+ - **The data is synthetic, and that is enforced rather than promised.** The generator
260
+ composes its workspace from `test/fixtures/views/` (one detailed run — handoff, open
261
+ questions, budget ledger, events, two trained experts) and `test/fixtures/chain/` (seven
262
+ more, carrying every status a reader should learn to recognise and the dependency edges
263
+ between them). `assertSynthetic()` resolves every source path and refuses anything
264
+ outside `test/fixtures/` — including the framework's own checkout, which IS a tldrx
265
+ workspace and is where a careless default would land. The page is public and permanent;
266
+ a real run read here would publish a client's domain, and it would look like it worked.
267
+ - **Two things the first build got wrong, both caught by the tests that were written
268
+ first.** `model.root` is DRAWN on the page, so the export carried the build machine's
269
+ temp directory (`/var/folders/…/tldrx-demo-AUfHya/`) into a public document and changed
270
+ on every build; the demo now renders with the root it is about, and a test asserts no
271
+ path from the building machine appears anywhere on the page. And `public/demo/` collided
272
+ with `docs-site/demo.md` — `cleanUrls` builds that as `demo.html`, so a site holding both
273
+ asks GitHub Pages to guess what `/demo` means. The export moved to `/dashboard-demo/`.
274
+ - **One banner, and it is additive by construction.** A reader arriving from a search
275
+ result has none of the page's framing, so the export carries one line saying the numbers
276
+ are invented. Strip it and the bytes are identical to what the CLI writes — asserted, so
277
+ the demo cannot drift into being a mock-up of the command instead of a run of it. It
278
+ links nowhere: the export fetches nothing, and that is the property that lets it sit on a
279
+ static site at all.
280
+ - The docs workflow now installs the ROOT dependencies too. Module resolution for the
281
+ dashboard's `yaml` import walks up from `src/`, where `docs-site/node_modules` is not on
282
+ the path — without that step bun quietly auto-installs the package at build time, which
283
+ is an undeclared network fetch. Measured 2026-09-02: `import "yaml"` from `src/` fails
284
+ outright once the root `node_modules` is gone.
285
+
286
+ - **The run headline shows BOTH economies, or says why it cannot (#103).** A cold
287
+ adversarial audit of a real host-attended run (`260830-ordering-inventory`,
288
+ aparece-v2, 2026-09-02) found every ledger surface reconciling to a perfect 0.00 delta
289
+ at **$14.60** — `run.yml` `spent_usd`, the `events.jsonl` sum, the stage sums, the task
290
+ sums and the `budget.yml` phase sums — over 34 turns of which **4** carried money. The
291
+ run's own watch gate note puts the real figure at "about 81 dollars". The framework was
292
+ not mis-metering; the front page was lying by omission, and the auditor's verdict line
293
+ was "they should re-derive the cost". This is that re-derivation, as a REPORTING change
294
+ and not a metering one.
295
+ - `Run.spend` carries the metered dollars, the turns the meter could not see, and what
296
+ was declared about them. **Both spellings of "this turn cost nothing" are counted**:
297
+ the `cost_usd: null` + `metered: false` one the model already knew (14 of that run's
298
+ turns), and the flat `cost_usd: 0.00` written by an executor turn a host session drove
299
+ (16 more), which reads as a measurement of zero and is not one. `unmeteredTasks` keeps
300
+ its exact old meaning and `zeroCostTasks` is a second count beside it — a file that
301
+ says `0.00` is not re-labelled, it is counted.
302
+ - **What is not in the files is named `absent`, never guessed.** `spend.basis` is one of
303
+ `measured` / `declared` / `partial` / `absent`, and `spend.reason` says which in a
304
+ sentence carrying the CLI's own words ("the metered total is a LOWER BOUND, not a
305
+ total"), so the page and `tldrx budget show` cannot word the same fact two ways. No
306
+ price table is consulted, no token is converted to a dollar, and no estimate is
307
+ synthesised from stage prices or turn counts. The audited run is the `absent` case:
308
+ all 920,641 of its declared tokens sit on turns that ALSO carried dollars, so they
309
+ describe none of the 30 turns that carried none.
310
+ - The run detail's `spent` row now names the whole gap. It used to read "+ 14 unmetered
311
+ turns (in-session)" beside $14.60 — 14 of the 30 turns that put nothing in the meter.
312
+ - **A run says when it last moved (`lastEventAt`, `lastEventFrom`, `ageSeconds`).** The
313
+ `ts` of the last line of `events.jsonl`, falling back to the file's mtime when nothing
314
+ in it parses — and `lastEventFrom` NAMES which of the two, because an mtime is the
315
+ weaker fact: the file was touched, which is not the same as the run moving. `ageSeconds`
316
+ is a measurement with no threshold in it; nothing in the model decides what "stale"
317
+ means. It is not clamped either, so a ledger written after `now` reports a negative age
318
+ rather than a comfortable zero. The mtime is carried on `LoadedRun` by the reader that
319
+ already opens the path, so the ledger is still read exactly once per run.
320
+ - **`Run.nextAction` — who is waited on right now, where, and what closes it.** `waiting`
321
+ answers that as prose, and a card that wanted the command in a button had to regex the
322
+ sentence. This is the same answer pre-split, and **nothing in it is a second
323
+ derivation**: `kind` and `message` are `waiting`'s verbatim, `command` and
324
+ `alternatives` are the backticked spans read OUT OF that message, and `waitingOn`
325
+ applies `isMovable` — the framework's own definition of "a human could move it right
326
+ now" — in the same precedence `dashPending` already uses. `unknown` is the honest fifth
327
+ value: a `blocked` run with no sibling named has a `run.yml` recording no cursor, and
328
+ the model will not guess who fixes that.
329
+
330
+ `DASHBOARD_MODEL_VERSION` stays at **3**. Five additions, nothing removed, and no existing
331
+ field reads differently: `spentUsd` is still the same `run.yml` key holding the same
332
+ number, and has meant "METERED dollars, a lower bound when `unmeteredTasks > 0`" since v3.
333
+ A consumer that read it as a total was wrong before this wave and is wrong by exactly the
334
+ same amount after it; what changed is that the page now says how big the bound is.
335
+
336
+ - **`scripts/merge-wave.sh` now gates the documentation site too (#114).** The wave ran
337
+ typecheck, `bun test`, `build` and the runtime-seam grep, pushed, and left the site to
338
+ `.github/workflows/docs.yml` — *after* the merge. That is a build with two failure modes
339
+ the test suite cannot see: `ignoreDeadLinks: false` in `docs-site/.vitepress/config.mts`
340
+ is deliberate, so a page somebody moved breaks it, and `docs-site/package.json` runs
341
+ `gen-changelog.ts` and `gen-demo.ts` before VitePress, either of which can throw on input
342
+ no test feeds it. Both used to land on `main` GREEN and go red as a failed **deploy** —
343
+ `main` broken and the published site stale, the worst of both. `bun run docs:build` is now
344
+ the fifth gate, on the same tree as the other four, and a red one is `docs=1` in the FAIL
345
+ line and nothing pushed.
346
+ - **It blocks, and the cost is why that was affordable.** Measured 2026-09-02 on this
347
+ repo, warm: 4 s wall — VitePress 2.91 s plus a `bun install --frozen-lockfile` in
348
+ `docs-site/` that installs 126 cached packages in 165 ms — against a wave whose
349
+ `bun test` alone is ~440 s. `git status --porcelain` is empty before AND after it, so
350
+ the new gate cannot leave dirt that fails the NEXT wave's dirty-tree guard: everything
351
+ it writes (`.vitepress/dist/`, `.vitepress/cache/`, `reference/changelog.md`,
352
+ `public/`) was already ignored.
353
+
354
+ - **A surprised merge-wave assertion now prints the logs the script kept (#115, instrumentation
355
+ only — the flake is NOT fixed).** CI run 33653699970 (`b64950d`) caught one failure in 3161:
356
+ run A of the #44 concurrency test exiting 2 — *merge conflict* — in a sandbox whose only
357
+ merge adds a file nothing else touches. It could not be diagnosed, because merge-wave keeps
358
+ a red run's logs on purpose and `afterEach` deletes the sandbox they live in first. The
359
+ concurrency tests now assert through `expectExit`, which on any unexpected code raises the
360
+ exit, stdout, stderr **and every file in the `mw-<pid>` directory the script kept**,
361
+ `merge.log` first — the artifact #115 asked for. The next occurrence arrives explained.
362
+ - **What the search ruled out, so nobody repeats it.** Measured 2026-09-02 on macOS,
363
+ git 2.50.1: a truncated or empty `reference-transaction` hook does NOT fail a ref update
364
+ (both exit 0), and 800 real commits against 4000 concurrent `merge-guard.sh --install`
365
+ rewrites produced 0 failures — so the non-atomic hook install is not the cause. No test
366
+ in the suite sets `MW_LOCK_*`, so cross-file env contamination is not either. The one
367
+ mechanism that reproduces exit 2 exactly is the guard REFUSING (`fatal: ref updates
368
+ aborted by hook` → merge-wave's conflict branch), which needs the lock to carry a live
369
+ owner and a token that is not the merging run's. 40 runs of `test/merge-wave.test.ts`
370
+ four-way concurrent under 20 CPU spinners did not produce it.
371
+
372
+ - **A drift guard over the public surfaces (#121).** `test/public-surface-consistency.test.ts`
373
+ fails when the README, the docs site (both locales), `env.yml` and `package.json` stop
374
+ agreeing with each other. It reads files off disk, spawns nothing and touches no network,
375
+ and every failure names the file and line to go fix. It checks that no page states the
376
+ current version as a literal (it must be interpolated), that every release-shaped literal
377
+ left in the prose is a version we deliberately cite as history, that the README release
378
+ table leads with `package.json`'s version, that the docs config derives the version rather
379
+ than hardcoding it, that `env.yml` does not require Bun, that no quickstart tells a reader
380
+ they need Bun to run tldrx, and that no surface carries a claim we have retired.
381
+ - Red-first, against the tree as it stood: 6 of 10 assertions failed, one per real defect.
382
+ - `scripts/release-check.sh` already compared `package.json`, `plugin.json`, `CHANGELOG.md`
383
+ and the README table — but only at release time, when the drift has already shipped. This
384
+ runs on every PR through `ci.yml`.
385
+
386
+ ### Changed
387
+
388
+ - The staleness field is spelled `lastEventFrom`, not `lastEventSource`. The model is
389
+ embedded in the static page verbatim, and one of this repo's oldest guards is that the
390
+ exported page contains no `EventSource` — a static export must make no network call. A
391
+ field named `lastEventSource` puts that substring in every page and makes a JSON key
392
+ indistinguishable from the live-reload script the guard exists to catch. The guard is
393
+ right; the name was wrong.
394
+
395
+ ### Fixed
396
+
397
+ - **`validateEnv` now enforces the two `env.yml` rules §2.10 designed, and §2.10 stops
398
+ designing the third (#126).** The spec stated four validation rules as fact; the schema
399
+ enforced none. #125 removed one with its field and reworded the rest into "designed and not
400
+ yet enforced" — honest, and it settled nothing.
401
+ - **Ids are unique across `tools`**, and the message says what a duplicate costs rather
402
+ than that it is untidy: `runDoctor` iterates `tools` and probes each entry, so a repeated
403
+ id ran the same `check` twice and printed two rows for one tool. Reported at
404
+ `tools[i].id`, naming where the id was first declared. A non-string id gets its type
405
+ error and no uniqueness complaint on top of it.
406
+ - **At most 64 tools**, `MAX_ENV_TOOLS`, interpolated into the message rather than typed
407
+ into it (gh #38). Nothing bounded the file before; `env.yml` declares 7.
408
+ - **The metacharacter rule is DELETED from the spec, not implemented.** "`check` free of
409
+ `; && | > \`" was not a missing check but a disagreement about what `check` is:
410
+ `ToolChecker.check` runs `runtime.spawn("sh", ["-c", tool.check])`, so every `check` in
411
+ every manifest that ever shipped has been executed BY a shell, and §2.10's own
412
+ `[assumption]` depends on it — `check: "test -n \"$VAR\""` is nothing without a shell to
413
+ expand `$VAR`. Enforcing it would have been a behaviour change that broke the manifest's
414
+ idiom in order to defend an owner against a file they wrote, committed and reviewed like
415
+ code, running on their own machine as themselves. §2.10 now says what `check` is instead,
416
+ and `test/env-validation.test.ts` pins that a metacharacter-bearing `check` validates AND
417
+ that the runtime really shells out — measured through `ToolChecker`, not read off the
418
+ source. The `result:` / `checked_at` prose is untouched: still designed, still not built,
419
+ still says so.
420
+
421
+ - **The status line's gate counter is `machine:N`, and counts every gate a machine closed
422
+ (#127).** `runSnapshot` computed it with `gate.by === "auto"` — the selector #124 had just
423
+ removed from `tldrx status` — so an agent-signed gate was invisible on the one line an
424
+ operator actually watches. Measured on the #122 fixture after `runNext` closed an `agent`
425
+ gate: `gate.by=alanmartinez executed_by={"type":"agent","id":"alanmartinez"}` and
426
+ `autoGates=0`. A run whose only closed gate was signed by an agent showed no segment at all.
427
+ - **The label moved with the selector.** Widening the count and keeping `auto:` would have
428
+ replaced one untrue number with an untrue name: `auto` is a specific actor in this system
429
+ (`AUTO_GATE_ACTOR`), not a synonym for "the machine", and reusing it for the superset is
430
+ the exact ambiguity that hid the agent case the first time. `machine` is the word
431
+ `tldrx status` already uses one screen away — "N gate(s) closed by a machine, not by a
432
+ person" — so the glance and the report are now in one vocabulary.
433
+ - **One selector, in one place.** `closedByMachine` moved out of `status/runItems.ts` into
434
+ `core/run/gateAuthority.ts`, beside `describeGateSignature`, and both surfaces read it.
435
+ The report and the line answer the same question about the same field, and had already
436
+ drifted once: #124 fixed one copy, and #127 was the other copy, still saying `auto`.
437
+ - **The tolerant reader still claims nothing it cannot see.** It does not parse gates, its
438
+ `0` means "cannot see", and it renders as no segment — never as "no machine signed
439
+ anything". Pinned.
440
+ - Three rendered assertions changed, each because the rendering did:
441
+ `test/attended.test.ts` (`0/2 att auto:2 stale:1` → `machine:2`) and two in
442
+ `test/revoke.test.ts`. `test/statusline.test.ts` never asserted the segment.
443
+
444
+ - **`docs/spec.md` §2.10 documented an `env.yml` field that does not exist, and two values
445
+ that were stale (#125).** The example carried `version_re: "([0-9]+\\.[0-9]+\\.[0-9]+)"` on
446
+ both of its tools. There is no such field: `src/core/schemas/env.ts` requires
447
+ `["id", "required", "check", "install"]` and knows `min_version`, and extraction is
448
+ `extractVersion` in `src/core/doctor/version.ts` — "the first dotted numeric run in
449
+ stdout+stderr", one extractor for every tool, exactly as `env.yml`'s own header comment
450
+ has always said. It was designed and then dropped, and the spec kept teaching it. Nothing
451
+ reads `docs/spec.md` at runtime, so the cost was paid by a contributor who copied the
452
+ example; the two stale values were `min_version: "1.1.0"` for Bun (the manifest has said
453
+ `1.3.0` since native `Bun.YAML`) and `required: true` for Bun, which `ab90a71` (#121) had
454
+ just disproved — the published package runs on Node alone.
455
+ - Two more defects the sweep turned up in the same twenty lines, both measured: the
456
+ example's top-level `checked_at:` and its per-tool `result: {found, version, ok, checked_at}`
457
+ are written by nothing. `runDoctor` builds a `DoctorReport` and returns it, and
458
+ `ENV_MANIFEST_PATH` has exactly two readers and no writer. That design is kept and now
459
+ says so in prose ("designed, not built") instead of being shown as a file `doctor`
460
+ produces. `Required in v0: git, bun, claude` became the measured set — `node`, `git`,
461
+ `claude` required; `bun`, `python3`, `graphify`, `gh` optional.
462
+ - **The example is now asserted rather than proofread**, which is the part that stops it
463
+ happening a fourth time on the same line. Three assertions in
464
+ `test/public-surface-consistency.test.ts` (#121's drift guard, extended): it must satisfy
465
+ the same `validateEnv` `loadEnvManifest` runs on the real file; it may use no key the real
466
+ `env.yml` does not use; and it must carry the real manifest's own `required`, `check` and
467
+ `min_version` for every tool it names. `purpose` is deliberately not compared — an
468
+ illustration is allowed to abbreviate it, and to be an excerpt of two tools out of seven.
469
+ RED first, against the unedited spec: the field rule named all five invented keys and the
470
+ value rule named both stale values.
471
+ - The §2.10 Validation paragraph claimed four rules `validateEnv` does not implement. Three
472
+ are now marked as designed and not yet enforced rather than stated as fact; the fourth
473
+ (`check` free of shell metacharacters) is filed separately, because `ToolChecker` runs
474
+ `sh -c <check>` and honouring the rule would be a change of behaviour, not a check to add.
475
+
476
+ - **A revoked gate no longer records what its withdrawn signature rested on (#123).**
477
+ `revoke` reset an approved gate to `pending` and nulled `by` and `at`, but spread
478
+ `gate.evidence` straight through, so the same mapping said *nobody has signed this gate*
479
+ (`status: pending`, `by: null`) and *here is what the signature rested on*
480
+ (`evidence: {path: …, verdict: sign, sampled: 7, of: 34}`). Both cannot be true, and
481
+ `tldrx replay` — which renders the evidence block off `run.yml`, not off the events — drew
482
+ the counts of a withdrawn signature under a gate whose own closing section said
483
+ `Pending gate: alpha is waiting for tldrx approve`. #122 had already cleared `executed_by`
484
+ and `authority` on a revoke for exactly this reason and deliberately left this one call
485
+ open.
486
+ - **Everything that described the signature now leaves the mapping together**: `by`, `at`,
487
+ `executed_by`, `authority` and `evidence`. A revoked gate is back to the five keys a
488
+ pending gate has always had, byte for byte.
489
+ - **Moved, not destroyed.** `run.yml` is STATE — the resume point, read as a description of
490
+ how things are now. `events.jsonl` is HISTORY — append-only, read as a description of what
491
+ happened. The contradiction was a state contradiction, so the pointer leaves the gate; and
492
+ because an audit framework does not delete history, the withdrawn `evidence` block is
493
+ written onto the `gate.revoked` event, beside the `signed_by`/`signed_at` it already
494
+ carried and the envelope's own actor and timestamp — who took it back, and when. The
495
+ committed note never moves from `<phase>/gate-evidence/<stage>.md`, and `tldrx reject`
496
+ now says so on the way out rather than leaving an operator to guess that a cleared
497
+ pointer was not a deleted file.
498
+ - A `revoked:` trail kept ON the gate was the alternative. It was refused because it grows:
499
+ a gate may be approved, revoked, re-approved and revoked again, so the state file would
500
+ accumulate a list of withdrawn signatures — which is what the append-only log is for —
501
+ and every reader would have to learn a "withdrawn" mode for a block whose only truthful
502
+ reading in `run.yml` is "current".
503
+ - **`gate.revoked` is narrated by `tldrx replay` for the first time.** It was in the event
504
+ set and in no narrative: `bullet()` had no case for it, so it fell to `default: return
505
+ null` and a replay of a run whose approval had been taken back showed the approval and
506
+ nothing after it. Evidence moved somewhere no reader looks is evidence deleted, so that
507
+ line is part of this fix — it names both parties, the stale count, what the signature had
508
+ rested on and that the note is still on disk.
509
+ - `evidence` is written on the event **only when there was one**, so every `gate.revoked`
510
+ for a human or auto gate is shape-identical to the ones written before this. Old records
511
+ are untouched in both directions: an approved gate carrying `evidence` and none of #122's
512
+ blocks validates, loads and emits byte-for-byte, and revoking one clears its evidence by
513
+ the same single rule. Pinned in `test/revoke-evidence.test.ts`.
514
+
515
+ - **`tldrx status` now reports an AGENT-signed gate as machine-signed (#124).**
516
+ `machineSignedDetails` is the report whose whole job is naming the gates a machine closed,
517
+ so a person can take one back, and its selector was `gate.by === "auto"`. That catches every
518
+ facilitator-closed gate and no agent-closed one: an `agent` gate records the evidence note's
519
+ `by:`, which is the OPERATOR account the agent was running as — a person's name. Measured on
520
+ run `260902-discovery-pipeline-map` (the record in #122) that gate reads `by: alanmartinez`,
521
+ so the report counted it as human-signed and never offered the revoke. That is the inverse of
522
+ what the report is for, on the one closure kind where the recorded name is not the entity
523
+ that did the checking.
524
+ - The selector is now `gate.executed_by.type !== "human"`, with `by === "auto"` kept as the
525
+ **union member** rather than replaced: a gate signed before #122 has no `executed_by`, and
526
+ there the old heuristic is the only signal there is. It asks `!== "human"` rather than
527
+ naming `agent` and `auto`, because listing the machines by name is exactly how the `agent`
528
+ case went missing the first time.
529
+ - **The wording changed with it.** "N gate(s) signed `by: auto`, not by a person" was true of
530
+ the facilitator and false of an agent gate, where the record *does* carry a person's name.
531
+ The line now reads `N gate(s) closed by a machine, not by a person — <phase>/<stage> signed
532
+ by <signature>, …`, rendering each signature through `describeGateSignature` — the one
533
+ renderer `run status`, `replay` and the dashboard already share, so a fourth reading of one
534
+ fact cannot drift from the other three, and a record with no `executed_by` still prints the
535
+ bare `by` it always printed. A second line, present only when an agent gate is among them,
536
+ says that an `agent` gate is signed under the operator account the agent ran as, so the
537
+ name on it is not the entity that did the checking.
538
+ - **The executor's kind, never the policy.** A person approving an `agent`-gated stage with
539
+ no flag is a human acting directly and is still not reported. Pinned, with the legacy
540
+ fallback and the negative cases, in `test/machine-signed-gates.test.ts`.
541
+ - The statusline's counter was the same selector on a second surface, and was left alone
542
+ here because it is a different label. Filed as #127, and fixed below: it is `machine:N`
543
+ now, off this same `closedByMachine`.
544
+
545
+ - **The merge-wave suite no longer plants its #95 fixture at a machine-global path (#113).**
546
+ `b8d1fcb` gave each invocation a private `$TMPDIR`, so a run's own log root stopped being
547
+ a shared namespace — and the fixture that plants a *foreign* wave's kept log kept writing
548
+ to the constant `mw-999999` in the machine's tmpdir. Every concurrent copy of
549
+ `test/merge-wave.test.ts` planted that one directory and, in its `finally`, deleted it, so
550
+ the first process to finish removed the directory its siblings were still about to assert
551
+ on. Measured 2026-09-02 at `965eb54`, four concurrent runs of that file: **9 failures in
552
+ 12** targeted runs and **5 in 8** whole-file runs, every one of them
553
+ `expect(existsSync(foreign)).toBe(true)` receiving false. After the fix, on the same box
554
+ and the same load: **0 in 12** and **0 in 8**.
555
+ - The plant is still `mw-<pid>`, still directly in the shared tmpdir — both load-bearing,
556
+ because a regression to the pre-#95 machine-global scan has to keep finding it — but the
557
+ pid is now derived from the planting process's own, in `test/fixtures/foreignWaveLog.ts`.
558
+ It is a fixture module rather than an inline helper so the guard can be a two-PROCESS
559
+ measurement: a child imports the same function and prints the path it would choose, and
560
+ the test asserts the two differ. A test that asks one process whether its own name is
561
+ unique can only ever say yes.
562
+
563
+ - **`merge-wave.sh` no longer executes a file anything can rewrite underneath it (#117).**
564
+ Bash reads a script incrementally and seeks back into it for each next command; it does
565
+ not snapshot. `git merge --no-ff` sits about a third of the way through `merge-wave.sh`,
566
+ and everything that makes a wave honest lives after that byte — the four gates, the
567
+ `HEAD moved` assertion, the fast-forward check, the push, and the summary line. Measured
568
+ on `GNU bash 3.2.57(1)-release (arm64-apple-darwin25)`: a ~24 KB script rewritten IN PLACE
569
+ while it slept printed its head, lost its tail, and **exited 0**. Silently stopping early
570
+ and reporting success is exactly the failure this script exists to prevent, aimed at
571
+ itself. Reproduced as a wave: with the typecheck gate truncating `scripts/merge-wave.sh`,
572
+ the run merged, ran ONE of three gates, pushed nothing, printed nothing, and exited 0.
573
+ - **The script now re-execs itself from a private snapshot before it does anything.**
574
+ `exec` keeps the pid, so a caller's timeout, `kill`, `$$`, the lock's owner line and
575
+ `$LOGS` all still name the same process; the copy lives in this run's own `$TMPDIR`
576
+ under an `mw-*` name, so #95's leak assertions double as its cleanup check. The
577
+ re-entry flag is an ARGV sentinel rather than an environment variable on purpose: the
578
+ `bun test` gate runs this repo's own merge-wave suite, which spawns the script again,
579
+ and an exported flag would have let an outer wave switch off the inner ones' protection.
580
+ - **Why the live merges of #113/#114 survived, and why that is not a defence.** `git
581
+ merge` unlinks and recreates a changed file rather than truncating it — measured on git
582
+ 2.50.1, a merge that shrank a tracked file moved it from inode `192824934` to
583
+ `192824958` — so the running shell kept reading the ORIGINAL bytes off the now-unlinked
584
+ inode. That is how merge `481540d` printed `typecheck/build/seam clean` while
585
+ `git show 481540d:scripts/merge-wave.sh` already ended in `typecheck/build/docs/seam
586
+ clean`: two versions, both intact, in the same second. The merge path was safe only for
587
+ as long as git keeps replacing rather than truncating — an implementation detail of
588
+ somebody else's program, load-bearing for this script's honesty, and nothing here would
589
+ have noticed it changing.
590
+
591
+ - **An interrupted merge wave no longer leaves an ungated commit on `main` for the next
592
+ sibling to push under its own gate result (#116).** Measured live 2026-09-02 while merging
593
+ #109/#110 in the shared checkout: the caller's own 10-minute timeout sent `SIGTERM` at
594
+ minute 10 of an ~8-minute gate run. The `TERM` trap handed back the lock and the marker
595
+ and touched nothing else, so `main` sat for ~15 minutes on a merge commit that no gate
596
+ ever finished and no lock, marker or log advertised — `git status` clean, `.git/merge-wave.lock`
597
+ gone, no `merge-wave.sh` running. All three existing defences are silent on it by
598
+ construction: the lock had been released, the tree was clean, and
599
+ `git merge-base --is-ancestor origin/main HEAD` PASSES for the next wave, because
600
+ origin/main genuinely is an ancestor of the orphan. So the sibling merged on top, gated
601
+ the pair, and published both under one summary line naming only itself. Nobody lied; the
602
+ gate record was simply attached to the wrong tree — the mirror image of the #44 race, and
603
+ about the run that is *dead* rather than the one still alive.
604
+ - **The wave now owns its merge commit until the push.** `merge-wave.sh` records `main`'s
605
+ sha before `git merge --no-ff`, and `unwind` puts it back on every path that does not
606
+ publish: the `INT`/`TERM` traps, a red gate, a failed push. Deliberately narrow on three
607
+ counts — it undoes only the sha *this* run created, only while that sha is still `HEAD`
608
+ (so a third party's commit landing on top, the exit-5 case, is left for a human instead
609
+ of being discarded), and only before `PUSHED=1`. It also runs *before* the lock is
610
+ released, while this invocation still matches the lock token, so the #89 ref guard waves
611
+ it through rather than vetoing the repair.
612
+ - **A red gate rewinds too.** It used to report "main left at merge commit `<sha>`", which
613
+ is the same landmine by another route: the branch still holds every byte of the work and
614
+ the merge is one command away, while the kept log directory is the real inspection
615
+ surface. The summary line now names the sha it rewound off `main`.
616
+ - **And a wave refuses to start on a `main` that is ahead of origin/main — exit 8, naming
617
+ the commits.** `SIGKILL` and a power cut run no trap at all, so the unwind alone cannot
618
+ close the hole. `HEAD`, not `refs/heads/main`, because `HEAD` is what gets merged into
619
+ and what `HEAD:main` pushes; behind or diverged is still the fast-forward check's job at
620
+ the push. Six tests in `test/merge-wave.test.ts` pin it, including the end-to-end repro:
621
+ a wave killed mid-gate, then a sibling wave whose `origin/main` must not contain the
622
+ dead run's commit.
623
+
624
+ - **A docs-scope story bundle is no longer handed to a developer with nothing to write, no
625
+ requirements it can open, and its core acceptance criterion deleted (#111).**
626
+ All three were repaired BY HAND by the unattended driver of `260902-discovery-pipeline-map`
627
+ on 2026-09-02, and all three reproduce from one fixture: a real `run new --scope docs
628
+ --seed <root document>` where the seed is the run's source of truth, lives at the workspace
629
+ root, and the story's repo is a sibling directory.
630
+ - **`touches` was empty.** It was built from what `01-what/handoff.md` CITES with a repo
631
+ prefix, and that could only ever find files already on disk — so a run whose whole output
632
+ is a document nobody has written yet got `touches: []`, while the developer prompt tells
633
+ the sub-agent that a change outside `touches` is a plan deviation. The story was forbidden
634
+ to do the one thing it existed for. `touches` now also carries the documents the run's own
635
+ brief NAMES — `## Decisions` and `01-what/success-metrics.md` — including a path with no
636
+ file behind it yet, which `prompts.ts` has always rendered as "(does not exist yet — this
637
+ story creates it)". Two ways in and no third: the repo has the file, or the path has a
638
+ directory and the repo has that directory; a bare dotted word in prose (`Node.js`) is
639
+ refused. Every addition is written into `notes:`, and a `touches` that is still empty now
640
+ says so in `notes:` instead of leaving it to a comment on an empty list.
641
+ - **The seed documents were unreachable from the story worktree.** They live at the
642
+ workspace root, are never copied, and need not be inside the story's repo — so the
643
+ handoff's `[src: seeds/….md:5]` resolved to nothing from the worktree and the driver
644
+ rewrote every read to an absolute path. The bundle now CARRIES them: `inputs:` lists the
645
+ run's `--seed` documents (read from `run.yml`'s first stage, where `run new` declares
646
+ them) and the developer prompt inlines their content, resolved through the same
647
+ `resolveDeclared` two-base rule the What stage's own inputs use. Bounded at 64 KB per
648
+ bundle — the same budget the story's touched files spend — and anything that does not fit
649
+ is named in `notes:` rather than dropped in silence.
650
+ - **The acceptance filter deleted the story's core criterion for naming a question id.**
651
+ "All four seed questions (Q1–Q4) have a dedicated section in
652
+ `docs/discovery-pipeline-map.md`" was dropped on the `a question id` signal, leaving the
653
+ story with the "(no `## Decisions` bullet …)" placeholder as its whole Done-when list.
654
+ Naming a question is how a document ABOUT the questions is specified. A bullet that names
655
+ a PRODUCT document now survives every signal — which is what the code comment above that
656
+ list has claimed since it was written, and was not true. Two narrower repairs came with
657
+ it: `questions.md` is matched at a path boundary, so `seeds/pipeline-questions.md` — a
658
+ document the TEAM wrote — is no longer read as the What stage's own output (it had
659
+ emptied `goal:` on the same run); and every signal is now tested against the bullet's
660
+ PROSE, not its `[src: …]` token, because a citation says where a claim was checked and not
661
+ what it is about. New `withoutSrcToken` lives in `text/srcToken.ts`, the one file that may
662
+ hold the grammar (#80).
663
+
664
+ - **A closed run no longer sets up the operator's next `git pull` to be refused (#102).**
665
+ Measured on aparece-v2, run `260830-ordering-inventory`, 2026-09-02: the run closed at
666
+ `14:14:00Z`; ninety-two seconds later a commit on `epic/ordering-inventory` carried a
667
+ snapshot of the whole live `tldrx-work/<run>/` tree plus `.tldrx/memory/facts.yml`; PR #10
668
+ merged it; the operator's `git pull` was refused over 5 modified and ~40 untracked paths,
669
+ and the recovery was a rebase.
670
+ - **The cause was a gap, not a bad line of code.** tldrx has never had a code path that
671
+ commits `tldrx-work/` to an epic — story commits have excluded the state dirs since
672
+ `stateDirPrefixes` landed, and the offending commit was authored by the operator's agent
673
+ after the close. What the framework did have was a hole: in a `root_is_repo` workspace it
674
+ writes `run.yml`, `events.jsonl`, `budget.yml` and every phase document straight into the
675
+ operator's WORKING TREE and left them uncommitted for the length of the run, said nothing
676
+ about them at close, and offered no verb for "the run is over, commit its docs". So an
677
+ agent invented one, and half the time invented it onto the epic.
678
+ - **The close now commits that state itself.** `closeRun` — one home for the policy, the
679
+ same three callers `closeRunWorktrees` had (`tldrx next`, `tldrx approve`, `tldrx run
680
+ cancel`) — commits `tldrx-work/<run>/` and `.tldrx/memory/` in the workspace checkout, on
681
+ the branch that checkout is on, and prints one line saying where they went. New
682
+ `commitPathsOnly` is the inverse of `commitAll`: `git commit -- <pathspec>`, so a
683
+ `README.md` the operator had STAGED is still staged and still uncommitted afterwards.
684
+ Two paths refuse rather than guess — a checkout sitting on the run's own epic branch
685
+ (`on-epic`) and a detached HEAD — and both report instead of failing the close. It never
686
+ pushes; spec §5 is unchanged.
687
+ - **`tldrx ship` refuses an epic that carries the framework's own state**, names the paths,
688
+ and prints the two-command repair (`git checkout <base> -- tldrx-work .tldrx` then a
689
+ commit — a forward commit, never a rebase). This is the last point tldrx holds the wheel
690
+ before a PR, and the diff is three-dot so a trunk that gained run state after the epic was
691
+ cut does not read as the epic carrying it. A `git diff` that fails answers "nothing here":
692
+ a probe that could not tell must never turn into a refusal.
693
+ - **Every `*.bak` tldrx writes is gitignored, at any depth.** `tldrx-work/*/*.bak` reached
694
+ one level and missed `tldrx-work/<run>/04-build/preflight.yml.bak`, which
695
+ `git check-ignore` matched against the block's own `!tldrx-work/**` re-include — measured,
696
+ and it was swept into the aparece-v2 rescue commit. Now `tldrx-work/**/*.bak` and
697
+ `.tldrx/**/*.bak`. Existing workspaces pick the block up on the next `tldrx init` (it is a
698
+ marked block, so re-running it is idempotent); until then the close excludes `*.bak` from
699
+ its own pathspec, so the one write path that could have committed them does not.
700
+ - **A 1M-context model is no longer sized at 200k because of how its name was spelled
701
+ (#112).** Measured at `d1d9c3f`: `priceFor("claude-sonnet-4-5-20250929[1m]")` returned the
702
+ `sonnet` row and `contextTokensFor` therefore answered **200,000, not 1,000,000**. The
703
+ cause was that `[1m]` was carried inside a row's id, so `name.includes("sonnet[1m]")`
704
+ could only ever match the bare alias — and the suite could not see it, because the one pin
705
+ that existed (`priceFor("opus[1m]")`) used exactly that convenient spelling while the
706
+ repo's own fixtures use the dated form (`claude-fable-5[1m]`). It fed `run estimate` and
707
+ the context ledger, which decides when a stage is near its window.
708
+ - **`[1m]` is now matched as a MARKER on a name, separately from the family**, so
709
+ `sonnet[1m]` and `claude-sonnet-4-5-20250929[1m]` land on the same row. A `[1m]` row is
710
+ offered only to a name that carries the marker, so a dated spelling WITHOUT it is not
711
+ promoted: `claude-opus-4-5-20251101` still resolves to `opus`/200k.
712
+ - **A family the table prices answers for its own windows.** haiku has no `[1m]` row
713
+ because there is no 1M haiku, and its 200k is the one MEASURED number in the file — a
714
+ marker does not overrule it, so `claude-haiku-4-5-20251001[1m]` stays 200k.
715
+ - **A family the table does NOT price gets the window its name declares.**
716
+ `contextTokensFor("claude-fable-5[1m]")` is 1,000,000 rather than a silent 200k default.
717
+ No fable price row was invented: `priceFor` still returns null for it, so nothing quotes
718
+ a price for a model this table cannot price — only the sizing changed.
719
+ - No USD figure moved. The `[1m]` rows already priced identically to their 200k siblings;
720
+ this was never a billing bug, and `tldrx cost` reads `total_cost_usd` off the CLI.
721
+ - **A stage with nothing to ask can close its own auto gate again (#109).** `questionsCondition`
722
+ read zero parsed question blocks as one thing when it is really three. *Unreadable* — the
723
+ 2026-08-29 failure, where a stage wrote `### Q1 — …` from the old template and four questions
724
+ were swallowed — is still refused, by id. *Missing* — a `questions.md` the stage declared as an
725
+ output and never wrote — is still refused, and now says so in its own words
726
+ (`questions.md is a declared output of this stage and was never written — an absent file is not
727
+ an answer`) instead of sending the reader to a template for a file that does not exist.
728
+ *Present, readable, and raising nothing* — the GOOD case — now SATISFIES the condition. Measured
729
+ live 2026-09-02 on run `260902-discovery-pipeline-map`: every clean stage was paying for the
730
+ 2026-08-29 bug, because the state an auto gate exists to close over was indistinguishable from
731
+ the state it exists to refuse.
732
+ - **`absent:` has ONE semantic, and both checkers share it (#110, absorbing #105).** Two live
733
+ failures in the same week, in opposite directions, out of the same resolution: `claim-sources`
734
+ PASSED `- none [src: absent:04-build/log]` over a directory holding seven files, while the auto
735
+ gate REFUSED `absent:.tldrx/memory/facts.yml` — "I searched, there is no recorded fact", which is
736
+ the spec's own spelling of an empty section. Both were `unverified`, which one checker read as
737
+ "fine" and the other as "stop".
738
+ - **`absent:<path>` now resolves against the same bases a `file` src does** (workspace root, run
739
+ directory, named repo, epic worktrees), and accepts `repo:path`. That is the mechanism behind
740
+ #105: it used to try the workspace root and nothing else, so a run-relative
741
+ `absent:04-build/log` never even saw the directory it named and reported an absence it had
742
+ never looked for.
743
+ - **A fourth outcome, `noted`.** No such path, an empty file, an empty directory ⇒ `ok`, the
744
+ absence is literal. The path exists with content and no needle ⇒ `noted`: legal, never fatal,
745
+ never blocking — and never silent. It is counted and named BY PATH in the `claim-sources`
746
+ detail (`unchecked absence: 2 (04-build/log, .tldrx/memory/facts.yml)`) and therefore in the
747
+ auto-gate note, so the two can no longer disagree about the same file.
748
+ - **`absent:<path>#<needle>` makes an absence checkable.** Say what you searched for and the
749
+ checker searches for it: not found is a *verified* `ok`, found is a REFUSAL that names the line
750
+ (`` `30 days` IS at docs/retention.md:3 — that is a presence, not an absence ``). It is the
751
+ upgrade path out of `noted`, and the first form in which an absence over a file with content is
752
+ ever actually checked.
753
+
754
+ - **The docs site advertised a version we had already shipped past (#121).** The hero said
755
+ 0.4.0 in four places — `index.md`, `guides/faq.md` and both Spanish mirrors — while npm
756
+ served 0.5.0. Hand-bumping it would have bought one release; the number is now read at
757
+ build time instead, by `docs-site/version.ts`, from `package.json` (the field npm
758
+ publishes) and the README release table (the row `release-check.sh` already refuses to
759
+ release without). `config.mts` hands both to the pages through `themeConfig`, on the root
760
+ and on each locale, and the pages interpolate. `version.ts` throws rather than guesses: a
761
+ docs build that cannot tell which version it is describing fails, instead of quietly
762
+ publishing `undefined`. The "0.4.0 was the first beta" sentences stay — that is history,
763
+ and it is still true — but they now read as history.
764
+
765
+ - **Three surfaces disagreed about whether Bun is needed to run tldrx (#121).** `env.yml`
766
+ declared `bun` `required: true`, and `DoctorReport.healthy` is "no required tool is
767
+ missing", so `tldrx doctor` exited 1 on machines where tldrx was installed and working.
768
+ The docs site's quickstart said you need "Node 20 **and** Bun 1.3"; the README and
769
+ `docs/guide/01-quick-start.md` said an installed tldrx needs only Node. The README was
770
+ right, and the code says so: `node dist/tldrx.js --version` prints the version and exits 0
771
+ with no Bun involved, because `src/core/runtime/index.ts` picks its implementation off
772
+ `typeof Bun` at import time and `nodeRuntime.ts` is complete — `bun build --target=node`
773
+ inlines the `yaml` package, so a published install resolves zero runtime dependencies.
774
+ - `bun` is now `required: false` in `env.yml`, still declared and still carrying its 1.3.0
775
+ floor, with the measurement recorded beside the flag. It remains genuinely required to
776
+ build the bundle, to run the test suite, and to run the hooks straight from a clone
777
+ (`plugin/hooks/hooks.json` spawns `bun`); an `install --claude` wiring goes through
778
+ `tldrx hook <name>`, which is the Node bundle.
779
+ - Every surface now separates *running the published package* from *building and
780
+ contributing*, in the same words: both quickstarts, the README, `01-quick-start.md` and
781
+ `09-troubleshooting.md`.
782
+
783
+ - **The landing page claimed an absolute the implementation cannot guarantee (#121).** It
784
+ told readers that because the files are the state, nothing could get out of step with
785
+ anything — in the same week that #116 and #117 shipped precisely because state can. It now
786
+ says what is defensible and still worth saying: the canonical state is on disk,
787
+ inspectable, diffable, committable, recoverable. Mirrored in Spanish.
788
+
789
+ - **Provider wording tightened to what we can show (#121).** "Tool-agnostic" was an
790
+ unqualified claim about software with one working runner. The README and `docs/concept.md`
791
+ now say the workflow and the persisted state format are provider-independent, and that the
792
+ automated runner currently supports Claude Code. The docs site made no stronger claim; it
793
+ was swept and needed no change.
794
+
3
795
  ## 0.5.0 — 2026-09-02
4
796
 
5
797
  ### Added