@fractalsynapse/dsh-chapters 0.2.37 → 0.2.39

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.
@@ -97,6 +97,20 @@ Division of labour:
97
97
  results with `seq`, tool name, and size. The model never guesses at byte counts.
98
98
  - **Default is defer** for anything above `toolResultDeferFloorTokens`; trivial results stay inline without
99
99
  being itemized, so the narrative reads naturally and the exception list stays short.
100
+ - **A span INTERSECTS a signature; it never has to contain it** (#421, measured on the first live
101
+ composed-discussion record 2026-11-19). `composeChapters` used to require a signature's WHOLE seq
102
+ range to sit inside the shadowed span (`inSpan`), but live relief is incremental: every earlier pass
103
+ clips older signatures, and one clipped seq disqualified a finished topic FOREVER — so real multi-pass
104
+ traffic could never leave two whole signatures in one span, and every pass composed exactly one
105
+ chapter while every deterministic row (two complete signatures in one span) stayed green. Now a
106
+ signature whose seqs intersect the span participates with its CLIPPED range
107
+ (`max(first, spanStart)..min(last, spanEnd)`); its already-archived head stays in the earlier
108
+ chapter it belongs to, its remaining bytes get their own title at their own boundary. Unfinished
109
+ content is still never archived — unchanged by construction, because signatures are only stored at
110
+ `turn/end`, so the in-flight turn has none (measured: sig3 appeared in the row only after turn 3
111
+ closed). The compose leg (#420) checks the per-pass truth by SET (rows whose own `shadowedSeqs`
112
+ union-cover the pass's shadowed set) — range containment across rows of DIFFERENT passes was a
113
+ false positive that passed six legacy passes.
100
114
  - **A zero-length tool result defers nothing** (#59). `arrival.ts` has always skipped the empty string;
101
115
  the renderer did not, so every hollow chapter wrote references to `sha256("")` and reported
102
116
  `artifacts: 102` while holding one 0-byte file. An empty result renders `result (seq N, empty)` with
@@ -553,7 +567,9 @@ not inherit it: `create_goal` requires a direct-human turn, and the child's firs
553
567
  `plugin:dsh-chapters`. Before this, the objective stopped driving the work exactly where the plugin's own
554
568
  promise begins, and AGENTS' rule to "carry the authorized outcome" was left to the model's prose.
555
569
 
556
- **The rule now: carry the goal as text, and state aloud that it is not armed.** One selector
570
+ **The rule now (maintainer decision 2026-11-19 applied): carry the goal as text, AND re-arm a live goal
571
+ at birth through the goal SERVICE — explicitly, documented, and configurable** (`goalRearmOnCarry`, default
572
+ on; off restores the notice-only wording). One selector
557
573
  (`foldGoalFromLog`) folds the parent's durable `goal/change` events — operations `create`, `edit`, `pause`,
558
574
  `resume`, `block`, `complete`, `clear`, with `{id, revision, objective, phase, maxGoalRounds, blockedReason}`
559
575
  — and one renderer (`renderGoalCarriage`) emits the child's `## Goal (carried from the parent session)`
@@ -576,13 +592,18 @@ Invariants this respects:
576
592
  - **`phase` is foldable; `activation` is not.** The host keeps armed/disarmed process-local and the plugin
577
593
  reads it from the live service for its own driver decisions, so the notice says who CAN change the driver
578
594
  and never claims what the driver currently IS. Recovering armedness from history would be a guess in a
579
- record's clothing.
580
-
581
- **Deliberately not done, pending a maintainer decision (#349):** the underlying goal *service* has no
582
- direct-human gate, so the plugin could arm a goal on the child unilaterally. Reaching a seam is not having
583
- authority to use it; silently routing around a gate because the tool wrapper is the only thing enforcing it
584
- is the kind of unexamined authority widening this whole release was a study in. If the answer is yes, it
585
- becomes an explicit, documented, configurable step — not a side effect of the birth path.
595
+ record's clothing. THE RE-ARM RESPECTS THIS: the birth step creates a fresh goal (armed by the service's
596
+ own semantics, revision restarts, round counts start on the child) — it never CLAIMS the parent's
597
+ activation, and the notice wording is true whether the step succeeds or is refused.
598
+
599
+ **The decision, recorded (maintainer, 2026-11-19):** the earlier paragraph reserved plugin-authored goal
600
+ creation as a maintainer call; the call is YES, scoped as this section now states — the ONE predicate
601
+ (`goalRearmDecision`) arms exactly ACTIVE, unfinished goals (a paused/blocked goal stays notice-only:
602
+ the human stopped it; a completed/cleared one stays closed), the service is called on the child's live
603
+ handle AFTER a successful birth, and every failure mode is loud: no goals service or a refused create
604
+ lands in the door's warning channel naming `/goal resume` as the human fallback — never a silence, never
605
+ a rollback of the birth. Reaching a seam was not authority to use it; this paragraph is the authority,
606
+ written before the code that cites it.
586
607
 
587
608
  ## Storage
588
609
 
@@ -758,6 +779,14 @@ warned "N event(s) rendered no output", `planSummarize` counted the oversize cha
758
779
  catch built a full diagnostic — and then the value was discarded. So the rule is not "add checks", it is
759
780
  **deliver what the checks already say**:
760
781
 
782
+ - **Client visibility follows the command plane (#372).** The two door buttons are realm-scoped
783
+ affordances, so the client renders them ONLY when the host's own per-session projection
784
+ (`SessionSummary.projectionValues.agentPreset` — the fact the host's preset label reads, measured
785
+ in `dsh-client-ui-agent-preset` client bytes) says the session composes `chapters`. An unreadable
786
+ projection keeps the buttons and the click answers with the preset-specific refusal — fail-open
787
+ visibly, never silently dead. One id source: `CHAPTERS_PRESET_ID` lives in `src/preset-id.ts`
788
+ (client-safe, cordis-free); `src/preset.ts` re-exports it, and the client predicate is
789
+ `doorActionsVisibleFor` — one predicate per decision, per the hard rules.
761
790
  - **The diagnostics sink defaults ON.** `DSH_CHAPTERS_ENGINE_ERRORS` unset now means
762
791
  `<store-root>/diagnostics.log`, not "nowhere". All three SAIP compaction finalization failures left
763
792
  zero trace on disk, and door 5 logged `saved` to a logger nobody reads for three days. The env var
package/docs/backlog.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Open items — 2026-11-17 (host 0.2.0-rc.2)
2
2
 
3
- - **0.2.34 SHIPPED (2026-11-17, main 2eee0b3, tag 0.2.34; tarball + provenance verified — see project-state). Follow-waves for 0.2.35 (2026-11-17 audit):** the composed checkpoint has never been OBSERVED on a live
4
- host — the heavy leg's first sight, tracked as `docs/verify.md` C3, in the same family as #143's
5
- convergence bound. The deprecated live reads (`eventAt`/`snapshotEvents`/`ownEvents` — the host says
3
+ - **0.2.34 SHIPPED (2026-11-17, main 2eee0b3, tag 0.2.34; tarball + provenance verified — see project-state). Follow-waves for 0.2.35 (2026-11-17 audit), C3 RETIRED 2026-11-19:** the composed checkpoint has now
4
+ been OBSERVED on a live host AND pinned as replay corpus — the compose leg (#420, `--project=compose`)
5
+ crosses pressure across two stored signatures and verifies >=2-chapter composition and topic-seam
6
+ alignment from durable bytes, model-free (#421 fixed `inSpan`; full account on the verify row and the
7
+ tape's PROVENANCE). #143's convergence-bound family remains covered by the heavy live row. The deprecated live reads (`eventAt`/`snapshotEvents`/`ownEvents` — the host says
6
8
  "new calls are prohibited") are inventoried by `tests/unit/host-composer-shape.test.ts`; the migration
7
9
  to `deriveMessages`/`requestHeader` (live) and `SessionQuery.readSession` (durable) is the first gate to
8
10
  re-run before any host bump. #397 (`meta.parentSession` for continuation children) awaits a maintainer
package/docs/contract.md CHANGED
@@ -374,9 +374,16 @@ symptom. Recorded here so the omission is closed rather than inherited, and note
374
374
  schemas**.
375
375
 
376
376
  - `isSeeded` means "contains a fork-inherited event prefix"; our one-event synthetic seed is not that.
377
- - `parentSession` is documented as *seed lineage*. Setting it to fake a relationship would be a misuse.
378
- - Therefore **our storage-domain registry is the sole authority on ancestry**, and the web UI's branch
379
- graph will show our child as an unrelated root. A chain/manifest view is this plugin's job.
377
+ - `parentSession` is documented upstream as *seed lineage*. **DSH amendment (maintainer decision
378
+ 2026-11-19, #397): our birth seam sets it to the TRUE parent on every child it creates** —
379
+ `chapters_continue`/`chapters_fork` name the caller session; `chapters-restore` names the TARGET it
380
+ was born from. The relationship is real, so naming it in the kernel header is durable lineage the
381
+ child can read without our registry. The prohibition stands for every other writer: never claim a
382
+ parent that did not birth you.
383
+ - The storage-domain registry REMAINS the ancestry authority for children born before the amendment
384
+ (they carry no header field), and the seventh archive moment reads header-first with registry
385
+ fallback (`shouldForceChildArchive`). A header-parented child may appear differently in the web
386
+ UI's branch graph (host-scope, unmeasured here); the chain/manifest view stays this plugin's job.
380
387
  - The header being composed per request from the preset plus plugin contributions is *why* invariant 3
381
388
  holds, and why cache validity is per-process-generation: a restart or config edit recomposes it for
382
389
  everyone.
@@ -460,6 +460,38 @@ kind that produces a wrong conclusion instead of an error:
460
460
  catch). The bootstrap now seeds `storages/workspace.json` (exact host
461
461
  schema: ISO dates, `updatedAt`, registered path = the checkout) when absent.
462
462
 
463
+ ### The `compose` leg — compaction recorded FROM live discussion, replayed with the corpus (#420, C3's vehicle)
464
+
465
+ No committed leg exercised compaction or TOC verification from the conversation itself: C2's sweep
466
+ found zero `compaction/summary` events in any replayed durable log, and `heavy` (the live-class
467
+ single-turn journey) cannot fire the composer by design — signatures store at `turn/end` and heavy
468
+ compacts mid-turn. The `compose` leg closes the shape gap with the geometry the two old legs each
469
+ lacked: **multi-turn AND pressure-crossing.**
470
+
471
+ The intended observable contract:
472
+
473
+ - Small discussion turns on deliberately DIFFERENT topics, each ending a boundary (signature stored)
474
+ and each carrying a verbatim codeword, then one turn whose READ contract forces a crossing by
475
+ arithmetic (the 600-line tool page cap, same pigeonhole as heavy) — the trigger is 0.7 of the
476
+ pinned 32K window, so turns 1–2 (20-line doc reads) CANNOT cross and the first changelog page
477
+ MUST (0.6 was measured firing relief mid-topic-2, the eager pass clipping the signatures the
478
+ composer needs cold — twice-corrected arithmetic in `tests/e2e/rig-pins.ts`).
479
+ - The verdict is read from DURABLE bytes, not the browser: a `compaction/summary` whose shadowed
480
+ region is covered by **≥2 chapters**, at least one chapter boundary ALIGNED to a topic-transition
481
+ `turn/end` seq, chapter bodies carrying exactly their turn's codewords (bodies are rendered
482
+ verbatim from the log by invariant 4, so mis-splitting is visible mechanically), the coverage
483
+ invariant holding, and the session healthy one small turn later.
484
+ - **The tape is the point — and it is now corpus.** Recorded live on the fixed composer (2026-11-19,
485
+ `1 passed`, composed+aligned from durable bytes) and **replayed model-free green: `1 passed`,
486
+ 48.3 s, zero MISSes** — #141's branch-walk did not bite; the byte-exact tape reproduces the same
487
+ local relief decisions. The leg is a chain member (`test:e2e` + `chain-replay.sh`), the tape is
488
+ tracked with its PROVENANCE, and a future code change that breaks composition turns this leg red in
489
+ seconds — the maintainer's directive, satisfied: code changes do not affect the tape; a code change
490
+ that breaks the composed path affects the verdict.
491
+ - Regime: own boot, own port (rig-pins single authority), translating-proxy recording exactly like
492
+ the #416 recipe (`MODE=record E2E_PROVIDER=harness`), identity guard proving the remote
493
+ lists-and-answers-as-itself before a byte is recorded.
494
+
463
495
  ### Safe default guard
464
496
 
465
497
  Prefix every harness command with `DSH_HOME=$PWD/.dshdev` — or do not type it at all:
@@ -1068,3 +1100,26 @@ artifact never contained the booted home's session logs. `scripts/chain-replay.s
1068
1100
  `session.v4.jsonl.zstd` files and registry into `var/e2e-session-logs/<leg>-<port>` (six files, under 4 MB each) so
1069
1101
  the runner's own history sits next to the tape diffs and the misses. When a miss claims "the conversation had
1070
1102
  already taken a different shape", the answer is in that transcript — read it, don't theorize about it.
1103
+
1104
+ ### The rig-band ephemeral collision (CORRECTED same day — the teardown theory was WRONG)
1105
+
1106
+ `plans` (0.2.37 cut), `enrich` (0.2.38 cut), `fanout` twice (0.2.39 cut): `listen EADDRINUSE` on the
1107
+ leg's own port, boot dying at the 120s readiness ceiling, different leg each time. The first theory
1108
+ here (and in two ship records) said "previous host child outlives its wrapper" — a bind test disproved
1109
+ it on the spot: **`bind(41736)` refused while `ss -tln` and `/proc/net/tcp` showed NO LISTENER** —
1110
+ `lsof` named the holder: an ESTABLISHED outbound socket of the developer's own tooling using the rig
1111
+ port as its EPHEMERAL SOURCE. The machine's `ip_local_port_range` (32768-60999) swallows the entire
1112
+ rig band (41731-41746), so ANY local connection can squat any leg port at any time — which is also why
1113
+ the rerun-gave-green pattern: ephemeral allocation is luck, not drift. Wrong-theory trail kept
1114
+ deliberately: the first guard shipped minutes ago polled CONNECT-REFUSED, the wrong predicate
1115
+ (free-to-connect ≠ free-to-bind); it now asks for a real `listen()` per leg port, holds up to 90s,
1116
+ and fails the leg by name rather than booting into a refusal the ceiling will call a mystery.
1117
+
1118
+ **The real fix, for the maintainer's machine (needs root or a re-distill, so it is recorded not
1119
+ done here):** either reserve the band for the rig — `sysctl net.ipv4.ip_local_reserved_ports=41731-41746`
1120
+ (zero bytes moved, zero tapes touched) — or relocate the band entirely (needs a FULL corpus
1121
+ re-distill, because every tape's regime, homes and header paths are port-keyed; NOT free, not
1122
+ tonight). Until one lands, the honest release sentence stays: first-attempt collisions are named,
1123
+ the recorded rerun is green, and the guard now measures the right thing. The wrong-teardown theory
1124
+ in the 0.2.37/0.2.38 ship records stands corrected here rather than silently rewritten — immutable
1125
+ tags, mutable understanding, one line in the right place.
@@ -1128,3 +1128,83 @@ touches agent-facing prompt bytes (the #417 plugin-side change is sink plumbing
1128
1128
  #372 (unbuilt) · #397 (contract.md § Lineage decision, parked with its one-line change) · #411's
1129
1129
  residual (record-time regeneration pattern) · host option-(d) todo row · five credential-gated
1130
1130
  TreeDX live rows.
1131
+
1132
+
1133
+ **05935a7..74e59fb SHIPPED — 0.2.37, published and registry-proven.** PR #419 merged to main at
1134
+ `74e59fb` with all four CI jobs green at the head (coverage gate, preset-rows probe, env parity,
1135
+ ten-leg acceptance); annotated tag `0.2.37` at the merge commit; release run `44444746764` success.
1136
+ Registry proof: `latest` = **0.2.37**; unpacked tarball answers manifest `0.2.37` AND bundled
1137
+ `PLUGIN_VERSION = '0.2.37'` (the stale-tree class of 0.2.20 stays gated); provenance attestation
1138
+ present (`slsa.dev/provenance/v1`). Candidate evidence unchanged from the record above: 11-leg replay
1139
+ chain green locally at the release head (the one `plans` boot that died on `EADDRINUSE` was a
1140
+ transient port collision, named and re-run green), `corpus:stamp` with `promptAnchor` unchanged.
1141
+
1142
+ ## 2026-11-19 — 0.2.38: compaction composes on real hosts, and the corpus grew eyes (twelve legs)
1143
+
1144
+ **Candidate = staging at `fd7e7e6`.** The range `0.2.37..staging` is exactly the C3 closure, two
1145
+ issues told as one story:
1146
+
1147
+ - **#421** (PR #422): `composeChapters` span participation is INTERSECTION-and-CLIP — the old
1148
+ `inSpan` wholesale-excluded signatures clipped by earlier relief passes, which made multi-chapter
1149
+ composition structurally unreachable under live incremental traffic (measured: six passes, six
1150
+ single chapters, zero reason lines). Semantics written: unfinished means UNSIGNED (signatures
1151
+ exist only at turn/end). Red rows from the first live record's exact payload, committed as fixture;
1152
+ the long-standing completeness row rewritten as a named contract change.
1153
+ - **#420** (PRs #423+#422): the compose leg — doc-grounded discussion, forced crossing after two
1154
+ stored signatures, verdict from durable bytes (per-pass SET truth, topic-seam alignment,
1155
+ coverage, health). Live record five passed it all on the hosted remote; the SAME tape replayed
1156
+ model-free green (48.3s, zero misses — #141 did not bite); it is tracked corpus with PROVENANCE
1157
+ and joins the replay chain. Honest count: `chain-replay.sh` runs TWELVE legs (suite…reload +
1158
+ compose; heavy excluded by class), `test:e2e` names thirteen projects with heavy loud-skipping
1159
+ under replay — the CI job title's \"ten\" predates this and is prose, not a gate. Geometry
1160
+ lessons (0.6→0.7, 40→20 lines, stale-lib build verification) recorded in the leg's own
1161
+ authorities.
1162
+
1163
+ **Ship gate (deterministic class, at the candidate before stamp):** coverage gate + full
1164
+ unit+integration ledger (baseline shape: 5 credential-gated `live:` + 1 todo), the FULL replay chain
1165
+ locally (every leg under its own boot, compose included), then `npm run corpus:stamp` on green —
1166
+ `promptAnchor` must read unchanged (`b40304ee3e35a94f`).
1167
+
1168
+ **Open after this cut:** C3 CLOSED (both classes) — the open list loses its oldest verification
1169
+ debt · #349 remainder (browser rig) · #372 (unbuilt) · #397 (contract.md § Lineage decision) ·
1170
+ #411 residual (record-time regeneration pattern) · host option-(d) todo row · five
1171
+ credential-gated TreeDX live rows.
1172
+
1173
+
1174
+ **fd7e7e6..69729f7 SHIPPED — 0.2.38, published and registry-proven.** PR #424 merged to main at
1175
+ `69729f7`, all four CI jobs green at the head (coverage gate, preset-rows probe, env parity, and the
1176
+ acceptance chain now replaying compose on the runner); annotated tag `0.2.38` at the merge commit;
1177
+ release run `44479863717` success. Registry proof: `latest` = **0.2.38**; unpacked tarball answers
1178
+ manifest `0.2.38` AND bundled `PLUGIN_VERSION = '0.2.38'`; provenance attestation present
1179
+ (`slsa.dev/provenance/v1`). Candidate evidence per the record above: twelve-leg replay chain green
1180
+ locally at the release head (the one `enrich` boot that died on `EADDRINUSE :41734` was the transient
1181
+ teardown race, port verified free, rerun fully green), stamp `lib=a2d63947fa0e8da7` moved only on the
1182
+ version literal with `promptAnchor` unchanged — and the stamp's own first commit message got amended
1183
+ before merge for saying "lib unchanged" when the honest reading is "lib changed ONLY by the version
1184
+ string": the amend is disclosed here because the bytes that moved are exactly what the release
1185
+ verifies.
1186
+
1187
+ C3 is retired. The oldest open verification debt in this file's history became a replay leg.
1188
+
1189
+ ## 2026-11-19 — 0.2.39: the release that carried the objective across
1190
+
1191
+ **Candidate = staging at `70fb605`.** The range `0.2.38..staging` is one arc in three issues: **#397**
1192
+ (durable birth lineage in the kernel header, contract amended first — merged `PR #425`), **#372**
1193
+ (the dock reads the host's preset projection; resolved-foreign hides the realm-scoped buttons, unknown
1194
+ refuses by name — merged `PR #426` after a six-run browser-measurement chain, one wrong premise killed
1195
+ per run), **#349** (the maintainer authority decision implemented: ACTIVE carried goals re-arm at birth
1196
+ through the goal service, one predicate, warning-never-refusal, `goalRearmOnCarry`; five-run live chain
1197
+ including two stale-lib lessons and the cordis inject-gate discovery — merged `PR #427`). C3's
1198
+ successor facts are now regression corpus: the compose leg replays the composed path model-free (0.2.38)
1199
+ and the goal/lineage claims carry live-host witnesses in their legs.
1200
+
1201
+ **Open-list corrections this cut makes:** #411 was already closed at 0.2.36 (its 'residual' line here
1202
+ was stale prose); #349, #372, #397, C3 all now closed/retired. Open after this cut: #349's sibling from
1203
+ #138 (an armed goal has no rest state — unchanged) · #372's host-side sibling: the gateway session-list
1204
+ shape warning (`attach:gatewayList`, pre-existing, non-fatal, observed while measuring) is NOT yet
1205
+ filed — it is recorded here so the next audit does not re-derive it · #349 remainder: none ·
1206
+ #397 remainder: none · host option-(d) todo row · five credential-gated TreeDX live rows.
1207
+
1208
+ **Ship gate at the candidate before stamp:** full unit+integration ledger baseline shape
1209
+ (1,696/1,702 — 5 credential-gated `live:` + 1 todo); typecheck clean; ratchet 58=58; the TWELVE-leg
1210
+ replay chain run locally green at this head; `corpus:stamp` on green with `promptAnchor` unchanged.
package/docs/verify.md CHANGED
@@ -634,4 +634,15 @@ which 483 `test-litter` and 143 `empty-artifact`. Registry backups sit at
634
634
  |---|---|---|---|---|
635
635
  | C1 | `reconstructShadowedSeqs` maps the summarize region against the ACTUAL host surface shape (plain-seq nodes, bound `deriveEventMessage`) | deterministic + pinned-host replay | `tests/unit/host-composer-shape.test.ts` row 1 hands the composer a session built by the INSTALLED `dsh-session` class (`Session.create`, RUN/SKIP-guarded); row 2 pins the host `.d.ts` source text; `tests/unit/engine-core.test.ts` fakes now wear the host shape (unbound `derive` throws); `engine-lifecycle` drives the real `summarize()` over two stored topics and demands a ≥2-chapter manifest + carried plot | **PASS** — red before the fix (proven at the test commit), green after; full deterministic ledger 1,627/1,633 with only the five credential-gated `live:` TreeDX rows non-passing |
636
636
  | C2 | Activating the composed path churns NO committed tape | pinned-host tape replay | Full chain: `E2E_MODEL=replay bash scripts/ci-replay.sh` (11 legs, own boot each); durable-log sweep: all 25 session logs in the run's homes grepped for `compaction/summary` | **PASS** — chain green; **zero** compaction events exist in ANY replayed durable log (the compaction-heavy `heavy` project is the live class, never replayed), so no recorded bytes can depend on the composer; `npm run corpus:check`: corpus matches the build (promptAnchor unchanged); e2e typecheck ratchet 58=58 |
637
- | C3 | A real-host pressure compaction now COMPOSES (multi-chapter checkpoints converging on the 32K window) | live provider | The `heavy` live leg (its bound is #143's open row, and it was already failing its own bound BEFORE this change) | **OPEN — attempted 2026-11-17 from this box, VOIDED before the provider, measured and recorded in #414.** Two runs (real-window and pinned-32K) died at `turn/end: no credential for provider route "local"` — live+harness mode has no route translator (the translator is the tape proxy, and live runs without one), while the session route stays pinned to `local/qwen3.8-flash-next`. Durable logs: zero tool calls, zero compaction events, zero hosted tokens. Worse, tracked-mode live HERE would silently observe the ALIASING 4B box (#406's own class, live edition) — the live class is not merely unavailable here, it is UNTRUSTED here. C3’s later same-day session then reached the provider for real — with #414’s route alignment and the proxy-side URL fix (PR #416), `LEG=heavy MODE=record E2E_PROVIDER=harness` ran the hosted `qwen3.8-flash` through the translating proxy (identity guard-proven, pinned 32K): **the journey PASSED live — 58 compactions, ALL chapters-engine-served (0 foreign), 58 chapter files, 16.2 min, #143’s bound held under composed-era code.** C3’s own claim was still NOT discharged, for a structural reason the run made precise: signatures are stored at `turn/end`, `heavy` is deliberately a SINGLE-turn journey, and the composer cannot fire there by design — all 126 manifests fell to legacy. That exposure found and closed the ledger’s last silent arm: `mapped-region + zero-collections` printed NOTHING for 58 straight falls; it now logs `reason=no-collections` (sink-verified row, #416). The multi-turn candidate `suite` recorded live too: clean (4 passed, 1.8m) but its live trajectory never crossed the trigger — trajectory, not turn count, decides. **C3’s complete precondition is finally known: a live journey BOTH multi-turn AND pressure-crossing** — the distillation box reproducing the recorded suite/heavy trajectories under the composer, or a purpose-built leg (own issue, own tape). What today DID retire, classed live: engine ownership under real traffic (58/58 ours), relief convergence inside #143’s bound, and every fallback now naming itself. |
637
+ | C3 | A real-host pressure compaction now COMPOSES (multi-chapter checkpoints converging on the 32K window) | live provider | The `heavy` live leg (its bound is #143's open row, and it was already failing its own bound BEFORE this change) | **OPEN — attempted 2026-11-17 from this box, VOIDED before the provider, measured and recorded in #414.** Two runs (real-window and pinned-32K) died at `turn/end: no credential for provider route "local"` — live+harness mode has no route translator (the translator is the tape proxy, and live runs without one), while the session route stays pinned to `local/qwen3.8-flash-next`. Durable logs: zero tool calls, zero compaction events, zero hosted tokens. Worse, tracked-mode live HERE would silently observe the ALIASING 4B box (#406's own class, live edition) — the live class is not merely unavailable here, it is UNTRUSTED here. C3’s later same-day session then reached the provider for real — with #414’s route alignment and the proxy-side URL fix (PR #416), `LEG=heavy MODE=record E2E_PROVIDER=harness` ran the hosted `qwen3.8-flash` through the translating proxy (identity guard-proven, pinned 32K): **the journey PASSED live — 58 compactions, ALL chapters-engine-served (0 foreign), 58 chapter files, 16.2 min, #143’s bound held under composed-era code.** C3’s own claim was still NOT discharged, for a structural reason the run made precise: signatures are stored at `turn/end`, `heavy` is deliberately a SINGLE-turn journey, and the composer cannot fire there by design — all 126 manifests fell to legacy. That exposure found and closed the ledger’s last silent arm: `mapped-region + zero-collections` printed NOTHING for 58 straight falls; it now logs `reason=no-collections` (sink-verified row, #416). The multi-turn candidate `suite` recorded live too: clean (4 passed, 1.8m) but its live trajectory never crossed the trigger — trajectory, not turn count, decides. **C3’s complete precondition is finally known: a live journey BOTH multi-turn AND pressure-crossing** — the distillation box reproducing the recorded suite/heavy trajectories under the composer, or a purpose-built leg (own issue, own tape). What today DID retire, classed live: engine ownership under real traffic (58/58 ours), relief convergence inside #143’s bound, and every fallback now naming itself. **2026-11-19: C3's precondition MET — the answer arrived from live bytes.** The compose leg (#420: two doc-discussion topic turns storing signatures, then a forced changelog-page crossing at 0.6 of the pinned 32K) recorded live on the hosted remote: six relief passes, ALL chapters-engine-served, the composer RUNNING (zero reason= lines in sink or server log) — and archiving every pass as ONE chapter. The mechanism is pinned to the line: src/compose.ts inSpan demands WHOLE containment of a signature's seq range in the shadowed span, and live relief is incremental — earlier passes clip older signatures forever (measured: topic-1 sig 0..28 vs span 25..66 excluded wholesale; only topic-2's whole signature survived, so one chapter [25,66] absorbed topic-1's tail bytes). Deterministic rows cannot see this: they store two COMPLETE signatures in one span — the #399 disease one layer deeper. Filed with the full payload as #421 (intersect-and-clip fix, red-from-these-bytes acceptance). **CLOSED 2026-11-19 — PASS, live AND replayed.** #421 landed (intersect-and-clip; the geometry was
638
+ corrected twice more by measurement — the host relieves the moment it can, so 0.6 clipped cold
639
+ stores and 0.7 makes the FIRST crossing a two-whole-signature span — and the stale-`lib` process
640
+ defect surfaced, after which live-class claims verify the BUILT artifact, not just src). The compose
641
+ leg re-recorded live on the hosted remote: `1 passed` (1.8m) with `composedPass=true` (a pass's
642
+ shadowed set covered by two chapter rows, per-pass SET truth) and `aligned=true` (topic-2's chapter
643
+ opens exactly at u2; bodies codeword-clean; the archive titles are the discussion's own sentences) —
644
+ the claim's first live-provider observation, three relief passes, all chapters-engine-served. The
645
+ same tape then replayed MODEL-FREE green: `1 passed` (48.3s), zero MISSes — #141's branch-walk did
646
+ not bite; the byte-exact tape reproduces the local relief decisions. The tape is tracked corpus with
647
+ PROVENANCE (11 entries) and the leg is a chain member: composition is pinned against every future
648
+ code change, verified from the discussion itself — the corpus gap the maintainer named, closed. |
package/lib/client.js CHANGED
@@ -1046,6 +1046,54 @@ window.__ModuleLoader__.load({
1046
1046
  }))));
1047
1047
  }
1048
1048
  // src/client/doors.ts
1049
+ /**
1050
+ * The client door runner: the two deterministic archive doors, executed over
1051
+ * `remote.commands` and followed by a SWITCH to the fresh child.
1052
+ *
1053
+ * ONE runner, two rows. The server side keeps the same discipline — both doors
1054
+ * come from `deterministicCommand(door)` in src/tools.ts, and a unit row pins
1055
+ * that they archive identically. Copy-pasting this body is how the two would
1056
+ * drift apart, so there is exactly one implementation and a table of rows.
1057
+ *
1058
+ * `chapters-continue` ships only as a composer command; without a button here
1059
+ * the child is created correctly and the UI shows nothing, which reads as
1060
+ * "nothing happened". The row is the missing affordance, not new logic.
1061
+ *
1062
+ * React-free on purpose: the primitives package pulls CSS modules the node
1063
+ * test runner cannot load, so the testable half lives here and index.ts is the
1064
+ * thin chrome that renders these rows as buttons (tests/unit/client-doors.test.ts).
1065
+ *
1066
+ * @module dsh-chapters/src/client/doors
1067
+ */
1068
+ /** Structural slice of the aggregated remote service (@deepseek-ai/dsh-api-remotes).
1069
+ * `remote.commands` must ALSO appear in inject — the federation gates each
1070
+ * sub-service individually (the live feedback package declares
1071
+ * remote.messageFeedback beside remote for exactly this reason). */
1072
+ /**
1073
+ * #372 — the host's OWN per-session preset fact. The shape is measured, not invented:
1074
+ * `dsh-client-ui-agent-preset/lib/client.js` resolves its label through
1075
+ * `session?.projectionValues?.agentPreset`, and `dsh-api-session-controller` documents the field as
1076
+ * "current host-computed projection values retained by the object layer". We read the SAME row the
1077
+ * list store already gives us (rosterIds' shape) — no inference, no hardcoded preset name.
1078
+ * null means the fact is NOT READABLE — which is UNKNOWN, never "standard" (#77's roster
1079
+ * discipline applied to the preset: absence invented from unreadability is the same lie).
1080
+ */
1081
+ function presetOfSession(sessions, sessionId) {
1082
+ try {
1083
+ const value = ((sessions?.list?.getSnapshot?.())?.byId?.[sessionId])?.projectionValues?.agentPreset;
1084
+ return typeof value === "string" && value !== "" ? value : null;
1085
+ } catch {
1086
+ return null;
1087
+ }
1088
+ }
1089
+ /**
1090
+ * The ONE visibility predicate for the realm-scoped door rows (#372). Unknown keeps the rows —
1091
+ * the click path answers with the named refusal, so fail-open is never fail-silent; a RESOLVED
1092
+ * foreign preset hides them, because those commands genuinely do not exist in that session.
1093
+ */
1094
+ function doorActionsVisibleFor(preset) {
1095
+ return preset === null || preset === "chapters";
1096
+ }
1049
1097
  const DOOR_ACTIONS = [{
1050
1098
  id: "chapters-fork",
1051
1099
  order: 30,
@@ -1235,11 +1283,18 @@ window.__ModuleLoader__.load({
1235
1283
  ok: false,
1236
1284
  message: "commands remote unavailable"
1237
1285
  };
1286
+ {
1287
+ const preset = presetOfSession(sessions, sessionId);
1288
+ if (preset !== null && !doorActionsVisibleFor(preset)) return {
1289
+ ok: false,
1290
+ message: `Chapters ${door.noun} needs the chapters preset realm — this session composes "${preset}". Switch this session's preset or run the door from a chapters session.`.slice(0, 140)
1291
+ };
1292
+ }
1238
1293
  const line = typeof anchorSeq === "number" && Number.isFinite(anchorSeq) ? `${door.command} ${String(Math.trunc(anchorSeq))}` : door.command;
1239
1294
  const res = await remote.commands.execute(sessionId, line, []);
1240
1295
  if (res.ok !== true) return {
1241
1296
  ok: false,
1242
- message: (res.error?.message ?? `the ${door.noun} call failed`).slice(0, 90)
1297
+ message: (res.error?.message ?? `the ${door.noun} failed — its command lives in the chapters preset realm`).slice(0, 90)
1243
1298
  };
1244
1299
  const result = res.value?.result;
1245
1300
  const text = typeof result?.text === "string" ? result.text : "";
@@ -1396,7 +1451,8 @@ window.__ModuleLoader__.load({
1396
1451
  }
1397
1452
  /** One component body for every door row; only the label and glyph differ. */
1398
1453
  function makeDoorAction(door) {
1399
- return function ChaptersDoorAction({ run }) {
1454
+ return function ChaptersDoorAction({ run, visible }) {
1455
+ if (visible !== void 0 && !visible()) return null;
1400
1456
  const [busy, setBusy] = (0, react.useState)(false);
1401
1457
  const [note, setNote] = (0, react.useState)(null);
1402
1458
  const alive = (0, react.useRef)(true);
@@ -1479,16 +1535,19 @@ window.__ModuleLoader__.load({
1479
1535
  name: "conversation.chat.assistant-actions",
1480
1536
  id: door.id,
1481
1537
  label: door.label,
1482
- inject: (sessionId, owner) => ({ run: async () => {
1483
- let anchor = null;
1484
- const mid = typeof owner?.messageId === "string" ? owner.messageId : "";
1485
- if (mid !== "") try {
1486
- const out = await runCommandText(remote, sessionId, `/chapters-anchor ${mid}`);
1487
- const n = Number.parseInt(out.trim(), 10);
1488
- if (Number.isFinite(n) && n > 0) anchor = n;
1489
- } catch {}
1490
- return run(sessionId, anchor);
1491
- } })
1538
+ inject: (sessionId, owner) => ({
1539
+ visible: () => doorActionsVisibleFor(presetOfSession(sessions, sessionId)),
1540
+ run: async () => {
1541
+ let anchor = null;
1542
+ const mid = typeof owner?.messageId === "string" ? owner.messageId : "";
1543
+ if (mid !== "") try {
1544
+ const out = await runCommandText(remote, sessionId, `/chapters-anchor ${mid}`);
1545
+ const n = Number.parseInt(out.trim(), 10);
1546
+ if (Number.isFinite(n) && n > 0) anchor = n;
1547
+ } catch {}
1548
+ return run(sessionId, anchor);
1549
+ }
1550
+ })
1492
1551
  }, component));
1493
1552
  console.info(`[client:chapters] door factory ran: ${String(effects.length)} register effect(s), types: ${effects.map((e) => typeof e).join(",")}`);
1494
1553
  return effects;