@treeseed/dsh-chapters 0.1.5 → 0.1.7

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.
@@ -70,7 +70,8 @@ The model supplies ranges; the plugin renders. Within a range:
70
70
  | Event content | Handling |
71
71
  |---|---|
72
72
  | user / assistant text | inline, verbatim, attributed |
73
- | tool **invocation** (name + arguments) | always inline — this is the input side worth re-reading |
73
+ | tool **invocation** (name + arguments) | inline as a bounded head (400 chars) — the "what was attempted" half of the record; above `callArgArtifactTokens` the full arguments are **artifact-backed** like any deferred blob (0 = off by default) |
74
+ | session **plan** (`exit_plan_mode` call + its verdict result) | full text always artifact-backed + a labeled `## Plans in this chapter` block after the transcript (docs/plans-carriage.md) |
74
75
  | tool **result** judged **not worth keeping** | deferred to `artifacts/`, replaced by a reference line |
75
76
  | tool **result** judged worth keeping, ≤ floor | inline, verbatim, no model input needed |
76
77
  | tool **result** judged worth keeping, > floor | inline by model override **and** still written to `artifacts/` |
@@ -94,8 +95,13 @@ Division of labour:
94
95
  - **Model submits exceptions only**: `toolResultOverrides: [{seq, inline}]`. Usually empty or one entry, so
95
96
  the judgment costs almost no output tokens — which is why this is affordable where "the model writes the
96
97
  chapter bodies" was not.
97
- - **Invocations and arguments always stay inline.** Plugin rule, not a choice; it is the "what was
98
- attempted" half of the record and the thing a successor most needs.
98
+ - **Invocations stay inline as a bounded head.** Plugin rule, not a choice; it is the "what was
99
+ attempted" half of the record and the thing a successor most needs. The head is 400 characters, so
100
+ a large argument (`write` carrying a whole file, a plan carrying a whole design) is *also* written to
101
+ `artifacts/` whenever `callArgArtifactTokens` is above zero — the inline text is then a head with a
102
+ resolution, never the only copy. Session plans get this treatment unconditionally and by name: the
103
+ plan's own bytes are always an artifact, cited with its outline and verdict
104
+ (docs/plans-carriage.md § 2/§ 3).
99
105
  - **The artifact is written either way.** Inlining is a convenience copy *alongside* its reference. So a
100
106
  wrong call is a context-economy miss, never data loss — that asymmetry is what makes delegating this
101
107
  judgment to the model safe.
@@ -69,8 +69,8 @@ scripts/bootstrap-dev-profile.sh --with-probe # scripted rounds only (probe se
69
69
  | unit | `npm test` (`tests/unit`) | node --test, no build, no network | pure core: registry, render, archive, notice, engine-core, tools, commands |
70
70
  | integration | (today: probe rounds — see spikes/probe/README pattern) | boots real hosts in scratch homes | host wiring, realm mounts, provider economics |
71
71
  | e2e (tape — the default loop) | `npm run test:e2e:replay` | same boots with `E2E_MODEL=replay`; model turns answered from `tests/fixtures/model-tape/<project>` via the record/replay proxy (`tests/e2e/model-proxy.ts`) — seconds, deterministic |
72
- | e2e (distillation — occasional) | `npm run test:e2e:record` | `E2E_MODEL=record`: forwards every exchange to the real Local model and appends the tape. Run once per scenario; wipe `var/model-tape` first for a clean corpus; tapes are isolated per project (seven: suite/heavy/arrival/fanout/enrich/rules/fork); re-record when scenarios, prompts, or thresholds change. The GPU model is the DISTILLER, never the test oracle (user directive 2026-09-19) |
73
- | e2e | `npm run test:e2e` (`tests/e2e`, SEVEN projects: suite/heavy/arrival/fanout/enrich/rules/fork) | Playwright + workspace-cached chromium vs a throwaway `var/e2e-home-<port>` rebuilt per boot (port-keyed so no boot can stomp another's state) (isolated from live agents — see FINDINGS 2026-09-19) | the browser: identity, fork button + switch, knowledge loop end-to-end, the oversized turn (mid-turn compactions), the subagent fan-out, arrival-time artifacting (low-floor project) |
72
+ | e2e (distillation — occasional) | `npm run test:e2e:record` | `E2E_MODEL=record`: forwards every exchange to the real Local model and appends the tape. Run once per scenario; wipe `var/model-tape` first for a clean corpus; tapes are isolated per project (eight: suite/heavy/arrival/fanout/enrich/rules/fork/plans); re-record when scenarios, prompts, or thresholds change. The GPU model is the DISTILLER, never the test oracle (user directive 2026-09-19) |
73
+ | e2e | `npm run test:e2e` (`tests/e2e`, EIGHT projects: suite/heavy/arrival/fanout/enrich/rules/fork/plans) | Playwright + workspace-cached chromium vs a throwaway `var/e2e-home-<port>` rebuilt per boot (port-keyed so no boot can stomp another's state) (isolated from live agents — see FINDINGS 2026-09-19) | the browser: identity, fork button + switch, knowledge loop end-to-end, the oversized turn (mid-turn compactions), the subagent fan-out, arrival-time artifacting (low-floor project) |
74
74
 
75
75
  The e2e layer exists because client-plane facts were being GUESSED (services, methods, tooltips,
76
76
  switching) and every guess cost the user a browser round-trip. Playwright answers those in seconds
@@ -134,7 +134,7 @@ Re-record discipline (learned the hard way 2026-09-22/23):
134
134
  sweep files rather than by lowering the bar.
135
135
  - `npm run coverage` — the same deterministic suite under node's native
136
136
  `--experimental-test-coverage` (a quick second opinion; no gate).
137
- - `npm run coverage:e2e` — replays the seven browser segments with
137
+ - `npm run coverage:e2e` — replays the eight browser segments with
138
138
  `E2E_COVERAGE=1`, which makes every boot write NODE_V8_COVERAGE profiles
139
139
  under `var/e2e-cov/<port>` (flushed on the boot's clean exit), then runs
140
140
  `scripts/e2e-coverage.mjs` → **c8 with real source maps** (tsconfig
@@ -169,10 +169,15 @@ ship; `0.1.0` itself carries no attestation.
169
169
 
170
170
  - **`ci.yml`** — two jobs. `test`: `npm ci` (all deps public on
171
171
  registry.npmjs.org — **no install secret**), typecheck, build,
172
- `coverage:ci` (the 85/85/85/85 gate). `e2e-replay`: installs the pinned
172
+ `bash scripts/ci-gate.sh` (the 85/85/85/85 gate — since 0.1.6 the gate
173
+ ANNOTATES its own failure: metric lines, the pass/fail tally, up to 24
174
+ failing-test lines and c8's threshold verdicts as `::error::`, because on the
175
+ 0.1.6 tag a red gate left nothing behind but "exit code 1" while every local
176
+ reproduction of the same SHA was green; the summary step now runs
177
+ `if: always()`). `e2e-replay`: installs the pinned
173
178
  host (`npm i -g @deepseek-ai/dsh@0.1.5-rc.1` — the SAME version as the
174
179
  gate line in `scripts/ci-replay.sh`, which fails loudly on mismatch) plus
175
- chromium's apt libs, then `scripts/ci-replay.sh` — seven browser segments
180
+ chromium's apt libs, then `scripts/ci-replay.sh` — eight browser segments
176
181
  served entirely from the committed tapes. **No LLM, no key, no GPU:** in
177
182
  replay mode `localModelUp()` short-circuits to true (specs RUN, they do not
178
183
  skip) and a tape miss is a loud proxy 503, so a scenario that legitimately
@@ -0,0 +1,340 @@
1
+ # Plans in the Archive — design record
2
+
3
+ Written 2026-10-09. **Read before writing code.** Human decisions for this feature are recorded at
4
+ § Decisions Taken and are binding; anything marked *deferred* is a human call, not ours.
5
+
6
+ DSh ships plan mode (`@deepseek-ai/dsh-plan-mode`) and our own preset mounts it
7
+ (`presets/chapters/agent.cordis.yml:109-133`). Today a session plan survives an archive only as the
8
+ first 400 characters of a tool-call line. That is the worst possible outcome for the one artifact in a
9
+ conversation that is *deliberately* decision-complete — and the reason the plugin exists at all: a
10
+ continuation that cannot see the approved plan either re-plans from recall (lossy) or implements
11
+ something nobody approved (worse).
12
+
13
+ ## Facts to re-verify on any DSH upgrade
14
+
15
+ | Fact | Where | Consequence for us |
16
+ |---|---|---|
17
+ | The plan is a **tool-call argument**, field `plan`, type string, required | `dsh-plan-mode/lib/index.js:230-236` | Detection is one predicate: `tool/call && name === 'exit_plan_mode'`. There is no plan document event. |
18
+ | The host validates `/^#\s+\S/` on the plan text | `index.js:256` | We can rely on a leading `#` H1 for the title. |
19
+ | Approval result is the canonical `{ approved: true }` + fixed render text | `index.js:237-251` | Verdict is derivable from the paired result, not from prose. |
20
+ | Rejection = failed call carrying review feedback; dismissal = failed call naming the takeover | `index.js` execute arm + package README § Model Experience | Three distinct non-approval shapes to classify, plus a fourth we must not invent. |
21
+ | State is one log-only whole-value event `plan/mode { active }`, appended at the next **accepted in-turn pre-step** | `index.js:374, 389` | An approved exit may not have its mode event yet at archive time → the *result* is the primary signal, the mode event secondary. |
22
+ | Mode state is recovered by **folding the log** (projection `apply`, `stateVersion: 3`) | `index.js:83-94` | Last logged value wins; we mirror that rule, we do not cache a verdict. |
23
+ | The mode-switch notice rides as `source.kind 'plugin'`, `plugin: 'plan-mode'`, `form: 'notice'` | `index.js:392-410` | Our injection screen already omits it (`src/injections.ts:38-41, 94-102`). Deliberate — see § Non-Goals. |
24
+ | `/plan <message>` steers a real user message, `source.kind 'user'`; bare `/plan`, `/plan off` and their terminal results stay outside model history | `index.js:220` + README § Human Command | The instruction a human typed under plan guidance **is** conversation and is archived verbatim today. Nothing to change. |
25
+ | Freshly created agents begin plan mode **inactive**; `plan/mode` is per-session and not inheritable | README § Known Limitations | A `chapters_continue` / `chapters_fork` child cannot know it was mid-plan unless we carry that text. |
26
+ | `tool/call` data shape is `data.{callId, name, arguments}`, `arguments` an object **or** a JSON string | `src/types.ts:8`, precedent `src/render.ts:253` | The extractor must accept both, exactly as the renderer already does. |
27
+
28
+ ## What the pipeline loses today
29
+
30
+ | Loss | Line | Fix below |
31
+ |---|---|---|
32
+ | Full plan bytes never reach the store (400-char head only) | `src/render.ts:250-257` | § 2 + § 3 |
33
+ | Artifacts are written for `tool/result` payloads only | `src/render.ts:258-277`, `:126-156` | § 3 |
34
+ | `plan/mode` events fall to `default:` → `unrenderedSeqs` (a disclosed hole, no prose) | `src/render.ts:284-285` | § 2 |
35
+ | Nothing in the TOC names a plan or its verdict | `src/continue-core.ts:111-141` | § 4 |
36
+ | `chapters_search` resolves chapters + rules; artifacts travel (`src/sync.ts:160-215`) but are not index entries | `src/search.ts:76, 104-105` | § 8 |
37
+ | A plan in an **open** turn is above the archive ceiling (completed turns only, `src/tools.ts:186-189`) and is never archived | `src/tools.ts:194-198` | § 5 `livePlans` |
38
+
39
+ ## Decisions taken (human, 2026-10-09)
40
+
41
+ 1. **Home for plan bytes: artifact pointer + chapter block.** The verbatim plan goes to the
42
+ content-addressed artifact store; the chapter carries status, outline, a bounded head, and the path.
43
+ *Not* a first-class `kind: plan` corpus document — that stays deferred (§ Deferred), because it
44
+ widens the corpus and needs a `docs/knowledge-repo.md` amendment.
45
+ 2. **Mode carriage: notice-only.** The child is *told* about the active plan. We do not seed a synthetic
46
+ `plan/mode` event into the seed: the seed contract is pinned as one event at `seq 0`
47
+ (AGENTS.md invariant 2, `spikes/probe/FINDINGS.md`), and flipping the child's mode also changes the
48
+ composed `plan:policy` header section. Both belong to a measured spike, not to this feature.
49
+ 3. **Record before code.** This file is the reviewable artifact; implementation starts after it lands.
50
+
51
+ ## Design
52
+
53
+ ### 1. `src/plans.ts` — pure detector (no cordis, no fs, L0-testable)
54
+
55
+ ```ts
56
+ export type PlanStatus = 'approved' | 'rejected' | 'dismissed' | 'pending' | 'superseded' | 'failed'
57
+ export interface PlanDoc {
58
+ seq: number; resultSeq: number | null; callId: string
59
+ title: string; status: PlanStatus; text: string
60
+ sha256: string; bytes: number; estTokens: number
61
+ outline: string[] // H2/H3 headings, in order, verbatim
62
+ artifactPath: string // artifacts/<aa>/<sha>.txt
63
+ archived: boolean // false when seq > archiveCeiling
64
+ }
65
+ export function detectPlans(events, ceiling, opts): { plans: PlanDoc[]; modeActiveAt: (seq: number) => boolean }
66
+ ```
67
+
68
+ *Status-vocabulary amendment (2026-10-09, at implementation).* A fifth class appeared in the host's own
69
+ `execute` arm and is not a human verdict at all: the review could never open (no user-questions channel;
70
+ the plan-mode service reloaded mid-review; the call ran outside plan mode; the markdown had no `#`
71
+ heading). Labelling those `rejected` would credit the user with a decision they never made, so the union
72
+ carries `failed` and prints the host's own text as the verdict line. The four shapes the record named are
73
+ all still there.
74
+
75
+ Rules, each pinned by a unit row:
76
+
77
+ - **Pair by callId** using the existing `sameCall` logic (`src/render.ts:158-164`) — extract it, do not
78
+ duplicate it.
79
+ - **Verdict precedence**: paired `tool/result` first (`{approved:true}` → approved; `isError` +
80
+ "Keep planning" feedback → rejected; failed call naming takeover → dismissed); **no result event →
81
+ `pending`**, which must never be rendered as approval. The `plan/mode` fold is secondary evidence and
82
+ only breaks a tie.
83
+ - **`superseded`**: same H1 title, different sha256, later seq ⇒ newest is operative, earlier ones are
84
+ `superseded`. Deterministic; no model judgement.
85
+ - **Screen the body**: run `stripReminderSpans` over the plan text. A plan is model-authored bytes, but
86
+ an injected span riding inside it is host state (same reasoning as `src/injections.ts:62-70`).
87
+ - **Redaction rides for free**: build the doc through `artifactRef`, so the `render → redact → write`
88
+ chokepoint applies (`src/render.ts:179-182`). Never write an unredacted plan blob.
89
+ - Title = the first heading, H1 preferred; keep the 72-char cap that `deriveIdentity` already uses
90
+ (`src/engine-core.ts:251-262`).
91
+
92
+ ### 2. Chapter body: a labeled section **after** the transcript
93
+
94
+ `renderChapter` appends one block, after the verbatim transcript and before the closing of the body —
95
+ never interleaved, so the transcript stays exactly what the log said:
96
+
97
+ ```
98
+ ## Plans in this chapter
99
+
100
+ ### Plan — "Carry session plans into chapters" — APPROVED (call seq 412, result seq 419)
101
+ - full text: `artifacts/8f/8f3a1c….txt` (18.4 KB ≈ 4.6K tok) — chapters_artifact 'toc' | 'search' | 'read'
102
+ - outline: Goal · Success criteria · Changes by subsystem · Tests · Assumptions · Rollback
103
+ - head (first 900 chars, verbatim): `# Carry session plans into chapters …`
104
+ - mode: plan mode ACTIVE from seq 118 (log event plan/mode, seq 118)
105
+ - superseded by the same-titled plan at seq 455 — that one is operative
106
+ ```
107
+
108
+ Frontmatter gains `plans: [412:approved:8f3a1c9d]` — one `seq:status:sha8` triple per plan — and
109
+ `planMode: active|inactive|unknown`, BOTH emitted only when the chapter really carries a plan or a mode
110
+ flip. *Why the compact triple instead of the nested list this record first specified:* the only reader of
111
+ frontmatter is `indexing.parseFrontmatter`, which understands `key: value` and flat `key: [a, b]`. Nested
112
+ YAML maps parse as nothing at all — an index that looks populated and reads empty, the worst kind of lie
113
+ here. So the machine-readable home for the full facts is the **chapter record** (`ChapterRecord.plans`,
114
+ zod-validated in the registry, `src/store.ts`), which is what the notice builder consumes; the
115
+ frontmatter line is the human-visible claim of the same fact, and the prose lives in the body block.
116
+
117
+ The sha256 anchor convention must hash what `parseChapterFile`
118
+ returns — body **including** the trailing newline (`src/engine-core.ts:297-302`; the T9 lesson: a
119
+ mismatch silently blocked enrichment for an era).
120
+
121
+ `plan/mode` gets an explicit `case` so its handling is *stated* rather than a silent skip: it renders as
122
+ the `mode:` line above and does not enter `unrenderedSeqs`.
123
+
124
+ ### 3. Invocation artifacts, generally (the honest fix for "always inline")
125
+
126
+ Any `tool/call` whose serialized arguments exceed `callArgArtifactTokens` gets the same treatment:
127
+ full blob to the artifact store, bounded head + path inline. Plans are simply the case that earns the
128
+ mechanism. In the same commit, correct `docs/architecture.md:73` and `:97`, which claim invocations and
129
+ arguments "always stay inline" while the code caps at 400 (`src/render.ts:255`). The real rule:
130
+
131
+ > Invocations are always inline; a bounded head is always artifact-backed. Every byte of an
132
+ > invocation and its result remains retrievable.
133
+
134
+ ### 4. The notice: `plansSection`, built exactly like `rulesSection`
135
+
136
+ `assembleNotice` takes an optional `plansSection: string` (`src/continue-core.ts:111-141` precedent).
137
+ Empty or absent ⇒ **zero injected bytes**, which is what keeps this tape-safe (§ Tapes). Placement:
138
+ between the project line and the preamble, so it is above the fold:
139
+
140
+ ```
141
+ ## Plans on this path (3: 1 approved, 1 rejected, 1 pending)
142
+ - ACTIVE PLAN: "Carry session plans into chapters" — APPROVED (ch. 4, seq 412, sha 8f3a1c…, ~4.6K tok)
143
+ full text: .dsh-chapters/artifacts/8f/8f3a1c….txt — read it with chapters_artifact before implementing;
144
+ do NOT re-plan from recall.
145
+ - REJECTED v1 "…" (ch. 4, seq 388) — user feedback is archived in that chapter
146
+ - pending "…" (seq 501) — the review was never answered. NOT approved; do not implement it.
147
+ ```
148
+
149
+ Cost is counted, never exempted: the section is part of `noticeTokens` and flows through the same
150
+ `preflight` (`src/continue-core.ts:146-162`) — `tocTokens + handoffNoteTokens ≤ ratio × (window − header)`.
151
+ Over budget ⇒ refuse with numbers. **Do not "remove the token measurement" for plans.** The measurement
152
+ is the only thing that keeps the refuse-with-numbers rule true; exempting a multi-K-token prose form
153
+ would make the 8K chapter target and the child's cold head meaningless on exactly the 32K hardware this
154
+ project targets. Economy comes from *carriage* (artifact + bounded head), not from blinding the meter.
155
+
156
+ ### 5. `chapters_segment` reports the facts
157
+
158
+ Add to the output (`src/tools.ts:186-205`): `plans: [...]` (every field a model needs to choose ranges,
159
+ minus the text), `modeActive`, and `livePlans` — plans whose `seq > archiveCeiling` (an open turn:
160
+ precisely the mid-review case), explicitly labelled *not archived, parent log only*. Ranges stay the
161
+ model's call and chapter text stays the plugin's (invariant 4); the model never guesses a verdict again.
162
+
163
+ ### 6. Composition and titles
164
+
165
+ - Forced split points: an `exit_plan_mode` call seq is a topic boundary — feed them to
166
+ `composeChapters` (`src/compose.ts:78`) so a plan is never buried mid-chapter.
167
+ - `deriveIdentity` prefers the plan H1 when a span opens with a submission (`src/engine-core.ts:251`);
168
+ `HARNESS_PROSE` (`:248`) stays as-is — a plan is not harness prose.
169
+
170
+ ### 7. Config register (Schemastery `Config`, `src/index.ts:53-110`) — no hardcoded tunables
171
+
172
+ | Key | Default | Meaning |
173
+ |---|---|---|
174
+ | `planInlineChars` | 900 | Verbatim head in the chapter block. The artifact holds the rest. 0 = pointer only. |
175
+ | `callArgArtifactTokens` | **0 (off)** | Above this, a tool-call argument is artifact-backed. |
176
+ | `plansInNotice` | true | Renders zero bytes when the path holds no plans. |
177
+
178
+ *Two amendments, both made by measurement rather than taste.*
179
+
180
+ - **`planModeEvents` was cut.** A `plan/mode` event is either printed in the Plans block or it is a
181
+ silently dropped byte, and silently dropped bytes are the one thing this store does not do. There is no
182
+ honest second value for that knob, so the rule is unconditional: the flip prints, and the folded state
183
+ lands in `planMode:`.
184
+ - **`callArgArtifactTokens` ships at 0, not 600.** Turning it on changes chapter bytes wherever a `write`
185
+ call carried a whole file — and the recorded model tapes are full of such turns (§ Tapes). Plans are
186
+ unaffected: their carriage is unconditional and named. A deployment that wants argument blobs opts in
187
+ deliberately, knowing it owes a re-record.
188
+
189
+ ### 8. Search, and why no new index
190
+
191
+ A plan is discoverable through the **chapter that cites it**: the chapter's `topics` frontmatter is
192
+ already the index unit (`src/indexing.ts:140-152`, `src/search.ts:104`), so `chapters_search` returns
193
+ the chapter, whose body hands over the artifact path, and `chapters_artifact` (toc / search / read) does
194
+ the recursive descent — a Markdown plan has headings, so `action:'toc'` yields a line-numbered map for
195
+ free. **No second index** (hard rule; the TOC is the only index). Making plans corpus documents
196
+ (`kind: plan`, indexed like rules — the `sync.ts:203` "rules are chapters of a different kind, same
197
+ transport" precedent) stays deferred to § Deferred.
198
+
199
+ Registry note: **do not** use `state.plans` — that name is the compaction manifest
200
+ (`src/registry.ts:37`, `src/store.ts:67`). If a cross-session lookup is ever needed, name it
201
+ `submittedPlans`.
202
+
203
+ ## Invariant audit
204
+
205
+ | Invariant | This design |
206
+ |---|---|
207
+ | 1 — never rewrite the durable log | Read-only over the log; artifacts and chapters are appends. Original plan events stay in the parent forever. |
208
+ | 2 — never seed from parent events | Unchanged: still one synthetic notice event at `seq 0` (decision 2 — no `plan/mode` seed). |
209
+ | 3 — never contribute a system-prompt section | The plans section is per-continuation notice text, not a header contribution. We only *read* plan mode's contribution. |
210
+ | 4 — never let the model author chapter bodies | The plan text is copied from the log by the plugin; the model supplies ranges and gets facts back. |
211
+ | Hard rules | No new index; no renumbering (plan blobs are content-addressed, chapters untouched); ranges still validated (`validateRanges`, `src/render.ts:96-123`); never truncate to fit — the head cap is a *display* choice with the full bytes retrievable, and the budget still refuses. |
212
+
213
+ ## Tapes and e2e impact (measured, not assumed)
214
+
215
+ - `grep -rlo "exit_plan_mode\|plan mode\|plan-mode" tests/fixtures/` → **no hits** (2026-10-09). No
216
+ recorded scenario submits a plan, so a conditional plans section renders zero bytes in every replay:
217
+ **no re-record required** for the notice or renderer changes. Re-confirm after implementation — if a
218
+ product prompt *is* edited (personas, tool descriptions, notice text), the rule stands: re-record
219
+ **whole projects**, never one spec of a shared boot.
220
+ - New e2e project `plans` (own boot, own `E2E_PORT`, throwaway home `var/e2e-home-<port>`, one journey =
221
+ one boot — the fork- and fanout-carve-out lesson), recorded once then replayed. Prompts must be
222
+ tool-free **in words the model obeys** (the RR2 OOM lesson). **LANDED 2026-10-10 as the eighth chain
223
+ project** — but NOT from the live model: the box's `:8080` server closed the stream mid-turn
224
+ (`turn/end` `reason {kind:"error", code:"TRANSPORT"}`), so the tape was distilled through the scripted
225
+ upstream `tests/e2e/stub-model.ts` (wire format copied form-for-form from recorded llama.cpp traffic).
226
+ `tests/fixtures/model-tape/plans/PROVENANCE.md` states what that proves (the whole carriage, in a real
227
+ browser, against the real review channel) and what it does not (a model choosing to plan), and carries
228
+ the re-record command that retires the stub.
229
+
230
+ ### What the browser plane corrected (this is why it exists)
231
+
232
+ Every item below was an assumption the deterministic plane had encoded — and the live run said otherwise:
233
+
234
+ - **`planMode:` at a plan's chapter end is `inactive`, not `active`.** Approving a plan EXITS plan mode,
235
+ and the host appends that flip at the next accepted pre-step — inside the same turn, before
236
+ `turn/end`. My expectation said `active`; the archived chapter said `inactive`, and both mode flips
237
+ printed. The fold was right; my belief was wrong.
238
+ - **The toolbar chip is an EXIT control only.** `PlanModeControl` renders when
239
+ `plan.pending ? !plan.active : plan.active` (`dsh-client-ui-plan/lib/client.js:39-41`), so there is no
240
+ "press to turn plan mode ON". Entry is `/plan <message>` in the composer, which appends
241
+ `plan/mode {active:true}` before the turn and steers the text as one real user message. Learning that
242
+ cost one 40-minute timeout on a locator that could never appear.
243
+ - **`text=Approve this plan…` hangs; `getByRole('region', {name: /Approve this plan/})` does not.** The
244
+ question is the review REGION's accessible name, not matchable element text — read off the failure
245
+ snapshot, which is the only honest way to find this out.
246
+ - **A seeded event read out of the session log is JSON-escaped.** `expect(raw).toMatch(/ACTIVE PLAN: "x"/)`
247
+ can pass as a substring and fail as a regex; parse the event and assert on `data.content[0].text`.
248
+ - **`expect.poll(..., {intervals: 3000})` throws a TypeError** — intervals is an array. Trivial, but it
249
+ killed the first two recording runs.
250
+ - **A scripted upstream that string-matches the message array lies confidently.** The stub's first
251
+ `decide()` searched all messages for `exit_plan_mode`/`approved` — both words live in the SYSTEM PROMPT
252
+ (tool catalog + plan policy), so every turn answered as if the review were done and the review card
253
+ never opened. The honest signal is the transcript's SHAPE (`role:'tool'` exists only once a tool ran).
254
+ Pinned by `tests/unit/stub-model.test.ts`, because a stub that answers wrongly records a tape of a
255
+ session that never planned.
256
+ - **Acceptance assertions must be scoped to the session tree the run created.** Scanning the whole store
257
+ lets a previous run's plan satisfy the next run — a green that proves nothing.
258
+ - Coverage: `npm run coverage:ci` gate (≥85 all four) must stay green; `src/plans.ts` is pure and gets a
259
+ full-branch row like the other planners, and the new `render.ts` arms need the success/refusal
260
+ surface covered the way the 2026-09-23 sweep did it.
261
+
262
+ ## Verification rows to add to `docs/verify.md`
263
+
264
+ | # | Claim | Evidence |
265
+ |---|---|---|
266
+ | P1 | Verdict classification is right for all four shapes + superseded | `tests/unit/plans.test.ts` over host-shaped fixtures (mirror the real nesting the way `tests/unit/render.test.ts:18-22` mirrors tool-result shape) |
267
+ | P2 | A plan with no result is `pending`, and `pending` never renders as approval | unit + a notice golden test |
268
+ | P3 | Full plan bytes are retrievable: archive → artifact exists → `chapters_artifact` read returns them byte-identical (modulo redaction) | integration, same style as `corpus-hygiene.test.ts` |
269
+ | P4 | `plan/mode` no longer lands in `unrenderedSeqs`, and no other event type silently vanishes | `tests/unit/render.test.ts` rows (the `mystery/event` row at `:124-129` must stay) |
270
+ | P5 | The plans section is counted by `preflight` and an over-budget archive refuses **with numbers** | unit on `preflight` + integration on `runContinue` |
271
+ | P6 | A plan above the ceiling is reported as `livePlans` and carried, marked not-archived | integration on `chapters_segment` |
272
+ | P7 | Injected spans inside a plan body are screened; a plan quoting `AGENTS.md` in prose survives verbatim | `injections.test.ts` rows (H1 family) |
273
+ | P8 | Zero bytes when the path has no plans (tape neutrality) | notice golden test, both directions |
274
+ | P9 | Both carriage paths agree (continuation AND in-place engine compaction) | `tests/unit/plans-engine.test.ts` |
275
+ | P10 | A chapter's `artifacts/…` citation resolves whether the blob sits at the store root or inside the ancestry tree | `tests/unit/artifact-query.test.ts` + the integration row |
276
+ | P11 | The browser journey, once its tape is recorded | `tests/e2e/plans.spec.ts` (project `plans-dev`, self-skips without the live model) |
277
+
278
+ `docs/verify.md` § Plans Carriage is the ledger; this table is the design's own list of what it claims.
279
+
280
+ ## Landing stages
281
+
282
+ | Stage | Deliverable | Status (2026-10-09) |
283
+ |---|---|---|
284
+ | 0 | This record lands; no code | done — reviewed, decisions 1–3 held |
285
+ | 1 | `src/plans.ts` + `src/log-shape.ts` (the shared pairing readers) + unit rows | done — P1/P2/P7 |
286
+ | 2 | `render.ts` Plans block + frontmatter + invocation artifacts; `docs/architecture.md` wording fix | done — P3/P4/P8 |
287
+ | 3 | `chapters_segment` facts + composer split points + `deriveIdentity` preference | done — P6 |
288
+ | 4 | `plansSection` in `assembleNotice` + wiring + config register | done — P5/P8/P9 |
289
+ | 5 | Site docs (§9 anatomy, §16 tools, §17 configuration, §18 notice) | done in the same release |
290
+ | — | Seven-segment tape replay | green WITHOUT re-recording (2026-10-09, `npm run test:e2e:replay`, EXIT=0) |
291
+ | — | `plans` browser journey | LANDED as the eighth chain project (2026-10-10): `tests/e2e/plans.spec.ts` passes in 13 s against `tests/fixtures/model-tape/plans/`, and the full eight-project chain is `CHAIN_EXIT=0` / 9 tests. Its tape is scripted-upstream distilled — see § Tapes and `PROVENANCE.md` |
292
+ | — | Follow-up, not blocking | re-record the `plans` tape from the live model on the GPU box (command in `PROVENANCE.md`); the carriage evidence does not change, only the claim about model behaviour |
293
+
294
+ Deterministic ledger at landing: **549 unit+integration rows, zero failures** with the TreeDX container
295
+ up (80 of them new, across `plans`, `render-plans`, `continue-plans`, `plans-segmentation`, `plans-tools`,
296
+ `plans-engine`, `log-shape` and the `plans-carriage` integration), `npm run coverage:ci` **98.11 % stmts /
297
+ 86.44 % branch / 93.8 % funcs** — the gate (≥85 on all four) green, branches *up* from the 85.61 % the
298
+ record started at. The seven-segment tape replay then ran against the BUILT artifacts: EXIT=0, 8 tests,
299
+ with no tape re-recorded.
300
+
301
+ ### Two things the implementation found that the record had not predicted
302
+
303
+ - **`renderChapter` cannot pair a verdict inside its own range.** A composed chapter boundary can fall
304
+ between an `exit_plan_mode` call and the `tool/result` that answers it, so a range-local scan printed
305
+ APPROVED plans as PENDING — the exact inversion this feature exists to prevent. The scan therefore runs
306
+ over the whole event list the caller passes (`buildFinalizedChapters` now hands it the full shadowed
307
+ span instead of one chapter's slice) and only the *display* is range-filtered. Pinned by P9.
308
+ - **An ancestor path's plans cannot be ordered by `seq`.** Every session numbers its own events from zero,
309
+ so a root chapter's seq 40 and a child chapter's seq 3 are incomparable numbers, and sorting the notice
310
+ rows by seq would crown the wrong plan as operative — the exact failure mode the block exists to remove.
311
+ The rows therefore travel in **causal order**: the registry walk's root-first chapter sequence, plans
312
+ within a chapter by seq, then the caller's unarchived tail, and `buildPlansSection` prints that order and
313
+ takes the last row as operative without re-sorting. (This is the same flattening rule the chapter list
314
+ already follows — reading order IS causal order — applied to a new record type; pinned by a unit row.)
315
+ - **Deferred artifacts were already unreachable, for every blob, not just plans.** `writeArchive` writes
316
+ to `<storeRoot>/<rootSession>/artifacts/…`, the arrival stubber writes to `<storeRoot>/artifacts/…`, and
317
+ `resolveArtifactWithMirror` looked only at the second place plus the mirror — so a chapter's own
318
+ `artifacts/aa/<sha>.txt` citation, the standard form the body prints, could 404 on the machine that
319
+ wrote it. The resolver now walks the session trees between the store root and the mirror (P10), which
320
+ is what makes "every byte remains retrievable" true rather than intended.
321
+
322
+ ## Deferred (human decisions, not ours)
323
+
324
+ - **`kind: plan` corpus documents** — makes plans first-class, topic-indexed, `chapters_search`-reachable
325
+ like rules; costs a chapter number per plan and is a `docs/knowledge-repo.md` amendment.
326
+ - **Seeding `plan/mode`** so a continuation is genuinely *in* plan mode (needs a probe against the
327
+ seed contract + the header effect, and a policy answer: should children be gated?).
328
+ - **Per-message anchoring** — a plan is the most natural anchor to fork from; `deriveRanges` already
329
+ supports any anchor, the button still forks at conversation end.
330
+ - Whether the `plan-mode` mode-switch *notice* should stay screened out of chapters (decision 2026-09-21
331
+ says injected context is not conversation; a human-initiated mode flip arguably is). Small text, but
332
+ it is the one place the blanket screen drops something a reader might want.
333
+
334
+ ## Proposed AGENTS.md lines (deliberately NOT applied yet — it is the unimplemented-feature rule)
335
+
336
+ ```
337
+ - `docs/plans-carriage.md` — **read before writing code in this area**: how a session plan reaches the
338
+ chapters, the TOC, and the artifact store; and why the token meter is never exempted.
339
+ ```
340
+ plus a find-fast row `plans in chapters / active plan in TOC → docs/plans-carriage.md (+ site §§ notice, archive anatomy)`.
package/docs/verify.md CHANGED
@@ -127,9 +127,31 @@ readability judgment.
127
127
  | T11 | Git-plane auth honesty | a rejected credential (401/403) classifies as `auth`, never `network` — clone/pull/push carry it and the degrade-to-local-only status says `credentials rejected … re-link with /chapters-link`, not the unreachable-ghost (the TreeDX live lesson applied to git) | `git-auth-classification.test.ts` (5) over a REAL smart-HTTP remote with a token gate; classifier unit rows included |
128
128
  | T12 | Corpus listing is complete | `paths/list` paginates (limit 100, base64 offset cursor) — `corpusPaths` follows `nextCursor` to the end; a second machine materializes EVERY file past a page boundary | `treedx-sync.test.ts` pagination row (150 files over the paginating stub); the live container (>100 paths) proves it at the real service |
129
129
  | T13 | The human entry surface | `/chapters-link` all four modes incl. refusals (no-token non-loopback, junk target), `/chapters-status` renders each fact ONCE (a duplicate-`Provider:` line was caught here), `/chapters-enrich` verbs, legacy workspace-token migration to the DSH home (0600, old file deleted) | `link-git-commands.test.ts` (11), `token-migration.test.ts` (4) |
130
- | COV | Both coverage ledgers are statement-grade and run | `npm run coverage:ci` — the GATED deterministic ledger (c8 over all unit+integration, `--check-coverage` at 85% statements/branches/functions/lines; enforced in hosted CI, which is GREEN end to end 2026-09-25) — currently **97.98% stmts / 85.61% branch / 93.62% funcs @ 464 tests, zero skips**. `npm run coverage:e2e` — seven-project replay under E2E_COVERAGE=1; boots run lib/*.js with REAL source maps (tsconfig `sourceMap`) remapped by c8/v8-to-istanbul; first ledger **80% stmts / 62% branches / 74% funcs** — it corrected the earlier line-range estimate honestly (tools.ts 99% lines → 72% statements). The 2026-09-23 audit then closed most of that gap at the DETERMINISTIC plane: the engine's construction/listeners/degraded-summarize/plot-elicit/finalize-guard paths (`engine-lifecycle.test.ts` — real cordis `Context()`, real base engine, injected llm/tokenMeter fakes: engine.ts 40→91% stmts), every tool wrapper's success/refusal/missing-caller surface (`tools-surface` + `tools-branches` + `tools-deep-branches`), the TreeDX error taxonomy via one-shot stub faults (`treedx-provider-branches`) and parser-shape drift via injected `fetchImpl` (`treedx-parser-branches`), the local-path git transport arms (`gitops-branches`), host-command error arms (`host-command-branches`), and the pure planners (vocabulary/enrich/indexing/search/arrival/archive — `rules-vocab-branches`, `enrich-planner-branches`, `indexing-branches`, `notice-search-rules-branches`, `render-archive-ladder-branches`, `pure-branches`). It also caught one REAL bug on the way: `canonicalizeRemote` carried embedded `user:token@` credentials into the project key (pasting a remote with and without creds forked the pool — now stripped, pinned in `pure-branches.test.ts`). Gotchas pinned in the script header: c8 filters include/exclude BEFORE remapping (`--include=src/**` against lib-path profiles zeroes the report). Neither ledger alone is the claim; the e2e one makes index/render-in-browser paths that no deterministic test can see accountable |
130
+ | COV | Both coverage ledgers are statement-grade and run | `npm run coverage:ci` — the GATED deterministic ledger (c8 over all unit+integration, `--check-coverage` at 85% statements/branches/functions/lines; enforced in hosted CI, which is GREEN end to end 2026-09-25) — currently **98.11% stmts / 86.44% branch / 93.8% funcs @ 549 tests, zero skips with the TreeDX container up** (the plans-carriage work added 80 rows and RAISED branch coverage from the 85.61% this row used to quote). `npm run coverage:e2e` — seven-project replay under E2E_COVERAGE=1; boots run lib/*.js with REAL source maps (tsconfig `sourceMap`) remapped by c8/v8-to-istanbul; first ledger **80% stmts / 62% branches / 74% funcs** — it corrected the earlier line-range estimate honestly (tools.ts 99% lines → 72% statements). The 2026-09-23 audit then closed most of that gap at the DETERMINISTIC plane: the engine's construction/listeners/degraded-summarize/plot-elicit/finalize-guard paths (`engine-lifecycle.test.ts` — real cordis `Context()`, real base engine, injected llm/tokenMeter fakes: engine.ts 40→91% stmts), every tool wrapper's success/refusal/missing-caller surface (`tools-surface` + `tools-branches` + `tools-deep-branches`), the TreeDX error taxonomy via one-shot stub faults (`treedx-provider-branches`) and parser-shape drift via injected `fetchImpl` (`treedx-parser-branches`), the local-path git transport arms (`gitops-branches`), host-command error arms (`host-command-branches`), and the pure planners (vocabulary/enrich/indexing/search/arrival/archive — `rules-vocab-branches`, `enrich-planner-branches`, `indexing-branches`, `notice-search-rules-branches`, `render-archive-ladder-branches`, `pure-branches`). It also caught one REAL bug on the way: `canonicalizeRemote` carried embedded `user:token@` credentials into the project key (pasting a remote with and without creds forked the pool — now stripped, pinned in `pure-branches.test.ts`). Gotchas pinned in the script header: c8 filters include/exclude BEFORE remapping (`--include=src/**` against lib-path profiles zeroes the report). Neither ledger alone is the claim; the e2e one makes index/render-in-browser paths that no deterministic test can see accountable |
131
131
  | H1 | Corpus carries no project instructions | host-injected context (instruction files, runtime snapshot, skill catalog, our own TOC notice — event-level AND `<system-reminder>` spans inside human messages) renders as a countable `⟦omitted:host-injected …⟧` marker, never bytes; conversation survives verbatim and byte-identical | unit `injections.test.ts` (15) + `render.test.ts` rows; integration `corpus-hygiene.test.ts` (archive→sync→remote→pull→search sentinel-absence, and legacy-store-publishes-unchanged anti-migration guard); e2e stays AGENTS-BLIND (tape masking) |
132
132
 
133
+
134
+ ## Plans Carriage (docs/plans-carriage.md, implemented 2026-10-09)
135
+
136
+ A session plan is one `tool/call` for `exit_plan_mode` whose `arguments.plan` carries the whole
137
+ markdown, answered by a `tool/result` that carries the human verdict. There is no plan document in
138
+ the log, so EVERY row below is about reading those two events the same way in three places — the
139
+ renderer, the segmentation tool, and the child's notice.
140
+
141
+ | # | Check | Passes when | Evidence |
142
+ |---|---|---|---|
143
+ | P1 | Verdict classification is right for every host shape | approved (`{approved:true}` / the fixed render text), rejected ("keep planning" + feedback), dismissed (takeover text), `failed` (the review never opened: no channel, service reloaded, outside plan mode, no `#` heading), pending (NO result event) — and a `superseded` rule that only fires for a same-title later submission | unit `plans.test.ts` (23) over fixtures copied from `@deepseek-ai/dsh-plan-mode/lib/index.js:230-289`; the pairing primitives are pinned separately in `log-shape.test.ts` (7) |
144
+ | P2 | `pending` is never printable as approval | a plan with no result renders "NO RESULT: the review was never answered"; the notice adds "do NOT implement it", and the word `approved` appears nowhere in that row | unit `plans.test.ts` + `render-plans.test.ts` + `continue-plans.test.ts`; integration notice assertion |
145
+ | P3 | Full plan bytes are retrievable | archive → the artifact file EXISTS on disk → its bytes equal the submitted plan (modulo the § 9 redaction chokepoint) → `chapters_artifact` `toc` lists the plan's own headings with line numbers and `search` reaches a phrase by SHA alone | integration `plans-carriage.test.ts` (4, real `node:fs` + real registry domain); unit `render-plans.test.ts`, `plans-engine.test.ts` (engine path parity: the same block from `buildFinalizedChapter(s)`) |
146
+ | P4 | `plan/mode` is not a silent hole | the event renders as a `mode` line, folds last-value-wins into `planMode:` frontmatter/record, and stays OUT of `unrenderedSeqs` — while an unnamed event type STILL lands there | unit `render-plans.test.ts` + `plans-engine.test.ts`; the pre-existing `render.test.ts` `mystery/event` row is unchanged |
147
+ | P5 | The plans block is MEASURED, never exempted | with the block on, the same archive REFUSES at a budget where the block-off variant passes; refusal carries both numbers | unit `continue-plans.test.ts` (the paired-measurement row); `preflight` untouched (`src/continue-core.ts:147-161`) |
148
+ | P6 | A plan above the ceiling is carried and named | `chapters_segment` returns `livePlans` (seq > `archiveCeiling`) and `modeActive`; the notice prints `NOT ARCHIVED — parent log seq N only`, and promises no artifact for bytes the store does not hold | unit `plans-tools.test.ts` (4) + `continue-plans.test.ts`; integration `plans-carriage.test.ts` (the open-review row) |
149
+ | P7 | Plan bodies obey the injection screen | a `<system-reminder>` span inside a plan is removed (countable marker upstream), while a plan that QUOTES `AGENTS.md` in prose survives verbatim — and credential patterns are redacted in BOTH the printed head and the stored blob | unit `plans.test.ts` + `render-plans.test.ts` (H1 family) |
150
+ | P8 | A plan-less path is byte-identical to pre-feature | no `## Plans in this chapter` block, no `plans:`/`planMode:` frontmatter lines, no `## Plans` in the notice, and `chapters_segment` emits no `planHint` — the whole feature is conditional on there being a plan | unit `render-plans.test.ts`, `continue-plans.test.ts`, `plans-segmentation.test.ts`, `plans-tools.test.ts`; integration `plans-carriage.test.ts` |
151
+ | P9 | Both carriage paths agree | the CONTINUATION path (`chapters_continue`) and the ENGINE path (in-place `summarize`/finalize) render the same block and the same record facts, including a verdict that lands past a composed chapter boundary — which is why `renderChapter` scans the whole event list, not its own range | unit `plans-engine.test.ts` (5) + `render-plans.test.ts`; zod round-trip of `plans`/`planMode` through the registry in `plans-engine.test.ts`, legacy rows gaining nothing |
152
+ | P10 | Artifact citations resolve wherever they were written | a chapter's `artifacts/aa/<sha>.txt` reference resolves whether the blob sits at the STORE ROOT (arrival stubs) or inside the ANCESTRY TREE (`<store>/<root>/artifacts/…`, where `writeArchive` puts deferred results and every plan) — before this fix the second form was unreadable through `chapters_artifact`, which is what "every byte remains retrievable" actually promised | `artifact-query.test.ts` rows + integration `plans-carriage.test.ts` (`resolveArtifactWithMirror` over the real tree) |
153
+ | P11 | The browser plane RUNS in the chain | `/plan <message>` → a real `exit_plan_mode` call → the host's review card opened and answered by a CLICK → fork → the child's ONE seeded event calls the plan out, the chapter carries the block, the artifact holds the plan byte-for-byte, and the folded `planMode:` is `inactive` because approving EXITS plan mode | `tests/e2e/plans.spec.ts` = chain project `plans` (eighth), replayed from `tests/fixtures/model-tape/plans/` in 13 s with no LLM. **Provenance: that tape was distilled from the scripted upstream `tests/e2e/stub-model.ts`, not the live model** (the box's `:8080` dropped the stream mid-journey) — `tests/fixtures/model-tape/plans/PROVENANCE.md` says precisely what it does and does not prove, plus the re-record command that retires the stub. The stub's own turn policy is pinned by `tests/unit/stub-model.test.ts` (4 rows): a stub that answers wrongly records a tape of a session that never planned |
154
+
133
155
  ## The Cache Metric, Before You Trust a Number
134
156
 
135
157
  `usage.inputTokens` is the **uncached delta** and `usage.cacheReadTokens` is the cached prefix, so:
package/lib/archive.d.ts CHANGED
@@ -48,6 +48,15 @@ export interface ChapterRecord {
48
48
  sha256: string;
49
49
  bytes: number;
50
50
  }>;
51
+ /**
52
+ * Plans this chapter carries (docs/plans-carriage.md § 2/§ 8): the durable,
53
+ * machine-readable half of the Plans block. Absent on records written before
54
+ * the feature — the notice reads `undefined` as "no plans here", never as a
55
+ * lie. The full bytes live in the cited artifact; the prose lives in the file.
56
+ */
57
+ plans?: import('./types.ts').PlanFact[] | undefined;
58
+ /** Folded plan-mode state at the chapter's end ('unknown' when the log never said). */
59
+ planMode?: 'active' | 'inactive' | 'unknown' | undefined;
51
60
  }
52
61
  export interface WriteResult {
53
62
  records: ChapterRecord[];
package/lib/archive.js CHANGED
@@ -80,6 +80,11 @@ export async function writeArchive(input) {
80
80
  sha256: bodyHash,
81
81
  estimatedTokens: chapter.stats.estimatedTokens,
82
82
  artifacts: chapter.artifacts.map((a) => ({ path: join(treeDir, a.path), sha256: a.sha256, bytes: a.bytes })),
83
+ // Plans ride along ONLY when the chapter has them: an absent field means
84
+ // "no plans here" for a pre-feature record, and an empty array here would
85
+ // be read as a fact by the notice builder.
86
+ ...(chapter.stats.plans !== undefined && chapter.stats.plans.length > 0 ? { plans: chapter.stats.plans } : {}),
87
+ ...(chapter.stats.planMode !== undefined && chapter.stats.planMode !== 'unknown' ? { planMode: chapter.stats.planMode } : {}),
83
88
  });
84
89
  }
85
90
  return { records, artifactPathsWritten, warnings };
@@ -1 +1 @@
1
- {"version":3,"file":"archive.js","sourceRoot":"","sources":["../src/archive.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAgDpC,uGAAuG;AACvG,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IACpF,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAA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cAAc;QAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAA;IAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAID,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAAa,EAAE,MAAqB;IACtE,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACxC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM;QAAE,OAAO,UAAU,CAAA;IACrD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -149,6 +149,26 @@ export function resolveArtifactWithMirror(storeDir, ref, mirrorDir) {
149
149
  })();
150
150
  if (tail === null || tail.split(/[\\/]/).includes('..'))
151
151
  return null;
152
+ // Session trees FIRST (measured 2026-10-09, plans-carriage): a chapter defers a
153
+ // result — or a plan's full text — to `artifacts/<aa>/<sha>.txt`, and
154
+ // archive.writeArchive writes it under the ANCESTRY TREE directory
155
+ // (<storeRoot>/<rootSession>/artifacts/…), not the store root where arrival
156
+ // stubs live. Before this, every such citation pointed at a path
157
+ // chapters_artifact could not resolve, so 'every byte remains retrievable'
158
+ // held only on the machine and directory layout that happened to match.
159
+ if (fs.existsSync(storeDir)) {
160
+ for (const entry of fs.readdirSync(storeDir, { withFileTypes: true })) {
161
+ if (!entry.isDirectory() || entry.name.startsWith('.'))
162
+ continue;
163
+ const cand = path.join(storeDir, entry.name, 'artifacts', tail);
164
+ const root = path.resolve(storeDir);
165
+ const resolved = path.resolve(cand);
166
+ if (resolved !== root && !resolved.startsWith(root + path.sep))
167
+ continue;
168
+ if (fs.existsSync(cand))
169
+ return cand;
170
+ }
171
+ }
152
172
  const artRoot = path.join(mirrorDir, 'artifacts');
153
173
  if (!fs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