@treeseed/dsh-chapters 0.1.2 → 0.1.4
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.
- package/README.md +49 -221
- package/cordis.patch.yml +13 -1
- package/docs/development.md +18 -10
- package/docs/verify.md +2 -2
- package/lib/artifact-query.d.ts +9 -0
- package/lib/artifact-query.js +37 -0
- package/lib/artifact-query.js.map +1 -1
- package/lib/engine.js +39 -16
- package/lib/engine.js.map +1 -1
- package/lib/render.js +37 -0
- package/lib/render.js.map +1 -1
- package/lib/sync.js +35 -12
- package/lib/sync.js.map +1 -1
- package/lib/tools.js +4 -4
- package/lib/tools.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,231 +1,59 @@
|
|
|
1
1
|
# dsh-chapters
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
**Long memory for local AI: a [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
4
|
+
plugin that archives agent conversations as verbatim chapters, continues sessions from a Table of
|
|
5
|
+
Contents at zero inference-token cost, and turns that archive into a shared, searchable knowledge
|
|
6
|
+
pool.** Published on npm as [`@treeseed/dsh-chapters`](https://www.npmjs.com/package/@treeseed/dsh-chapters);
|
|
7
|
+
source at [treeseed-ai/dsh-chapters](https://github.com/treeseed-ai/dsh-chapters).
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
archive. The model reloads any chapter on demand with the ordinary `read` tool. The original
|
|
10
|
-
conversation is never rewritten, its prompt cache stays intact, and the index costs **zero model
|
|
11
|
-
tokens** — chapters are written from the session log (a file copy), not summarized by an LLM.
|
|
9
|
+
> **All documentation lives on the documentation site — this README is a doorway, not a duplicate.**
|
|
10
|
+
> ### 📖 https://treeseed-ai.github.io/dsh-chapters/
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
or a **TreeDX** service — and every linked workspace gets a two-layer derived index, topic
|
|
15
|
-
vocabulary, cross-machine search (`chapters_search`), and a per-machine rules ledger.
|
|
12
|
+
## Install (the whole setup)
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
The two things that actually hurt on long sessions, especially with local models and slow prefill:
|
|
22
|
-
|
|
23
|
-
1. **Lossy memory.** A compaction summary drops the exact flag, the line number, the error text —
|
|
24
|
-
and leaves the model no handle to go get them back.
|
|
25
|
-
2. **The summarization tax.** Producing a summary prefills the whole history into one auxiliary
|
|
26
|
-
call — minutes of wall-clock on local hardware, *again every time the window fills*.
|
|
27
|
-
|
|
28
|
-
dsh-chapters removes the summarization step from the critical path entirely. Measured on a
|
|
29
|
-
32K-capped model: ~102 tokens of index where the equivalent transcript ran ~2,476, and zero
|
|
30
|
-
inference spent producing it.
|
|
31
|
-
|
|
32
|
-
**Be clear about what this does not buy you:** it is not cheaper caching. The continuation session
|
|
33
|
-
pays one cold prefill (system prompt + TOC + handoff note), the same cost class a post-compaction
|
|
34
|
-
request pays. What you gain instead is *verbatim* archive (a reload returns real text, not a
|
|
35
|
-
paraphrase), an *untouched* parent session that keeps its cache and stays usable, reversibility
|
|
36
|
-
(abandon the child, keep working in the parent), and branchable history.
|
|
37
|
-
|
|
38
|
-
**This is not a fork.** DSH's native fork copies the parent's log into the child; this plugin does
|
|
39
|
-
the opposite — it creates an *unseeded* session that cites an archive. The whole design discipline
|
|
40
|
-
traces back to that distinction.
|
|
41
|
-
|
|
42
|
-
## Architecture
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
agent turn ──► chapters_segment ──► chapter ranges (the model picks ranges; never writes bodies)
|
|
46
|
-
│
|
|
47
|
-
chapters_continue(title, handoffNote, chapters[])
|
|
48
|
-
│
|
|
49
|
-
┌─────────────────────────────────┼──────────────────────────────┐
|
|
50
|
-
▼ ▼ ▼
|
|
51
|
-
render bodies from log defer oversized tool results preflight the budget
|
|
52
|
-
(verbatim, per range) to content-addressed TOC + note vs remainder
|
|
53
|
-
artifacts/ files │ │
|
|
54
|
-
└─────────────► chapter .md files ◄───────────────────────────────┘
|
|
55
|
-
│ refuse loudly if over budget
|
|
56
|
-
▼
|
|
57
|
-
new session seeded with ONE message: the cumulative Table of Contents
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The four rules the design never breaks:
|
|
61
|
-
|
|
62
|
-
- **Never rewrite the durable session log.** Append-only; nothing is edited or deleted, ever.
|
|
63
|
-
- **Never seed a continuation from the parent's events.** The child starts from one synthetic TOC
|
|
64
|
-
notice; history grows by citation, never by copying.
|
|
65
|
-
- **Never contribute to the shared system prompt.** Per-continuation notices only — enabling the
|
|
66
|
-
plugin changes what *your sessions* can do, not what every other session in the profile sees.
|
|
67
|
-
- **Never let the model author chapter bodies.** The model chooses ranges; the plugin renders the
|
|
68
|
-
text from the log. Model-typed "lossless" is the failure mode this design exists to avoid.
|
|
69
|
-
|
|
70
|
-
Supporting machinery, each with a chapter in [docs/architecture.md](docs/architecture.md):
|
|
71
|
-
|
|
72
|
-
- **Oversized tool results** (file reads, command output) are deferred to a content-addressed
|
|
73
|
-
`artifacts/` store and referenced from the chapter — the model can still pull them back via the
|
|
74
|
-
`chapters_artifact` tool (toc / search / read modes). Hence the honest guarantee: **every byte
|
|
75
|
-
remains retrievable**, not "every byte is in the chapter".
|
|
76
|
-
- **Continuation budget, not a handoff cap:** TOC + note must fit a share of the window *remaining
|
|
77
|
-
after the header*; over budget the plugin **refuses with the numbers** — it never clips a handoff
|
|
78
|
-
note.
|
|
79
|
-
- **Ancestry is a DAG, flattened for the model:** the child's notice lists every chapter on the
|
|
80
|
-
ancestor path chronologically, with explicit back-links. Reading order is causal order; the model
|
|
81
|
-
never traverses a graph.
|
|
82
|
-
- **The compaction seam:** when the `chapters` agent preset is mounted, in-place compaction (manual
|
|
83
|
-
`/compact` and automatic pressure) runs through the plugin's deterministic engine — the same
|
|
84
|
-
log-only, zero-summarization discipline inside a session rather than across sessions.
|
|
85
|
-
- **Enrichment (P2)**: after pushes, an idle/deferred ladder annotates archived chapters (topics,
|
|
86
|
-
summaries) — with validation before commit and a body-hash guard making enrichment the *only*
|
|
87
|
-
sanctioned mutation of a chapter file, and even that provenance-chained.
|
|
88
|
-
- **Rules (P3)**: a write-once ledger of proposed project rules; approval is a **per-machine
|
|
89
|
-
curation fact** (never a shared-file rewrite), and the active core rules ride verbatim into every
|
|
90
|
-
continuation notice within a budget that refuses rather than clips.
|
|
91
|
-
|
|
92
|
-
Storage map: chapter bodies and artifacts live **in the workspace** under `.dsh-chapters/<root>/…`
|
|
93
|
-
(so the `read` tool reaches them); ancestry, numbering and hashes live in the harness's durable
|
|
94
|
-
storage domain (`dsh_chapters`); your upstream credentials live under the **DSH home** with 0600
|
|
95
|
-
permissions — never inside the project directory, never committed, never pushed.
|
|
96
|
-
|
|
97
|
-
## Installation (users)
|
|
98
|
-
|
|
99
|
-
Node ≥ 24 and a DSH host you install plugins into. From npm:
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
dsh plugin add @treeseed/dsh-chapters
|
|
14
|
+
```bash
|
|
15
|
+
dsh plugin --profile web add @treeseed/dsh-chapters # install into your harness profile
|
|
16
|
+
dsh plugin --profile web update @treeseed/dsh-chapters # keep current — restart `dsh web` after
|
|
103
17
|
```
|
|
104
18
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **Registers the model tools** (`chapters_segment`, `chapters_continue`, `chapters_fork`,
|
|
109
|
-
`chapters_search`, `chapters_artifact`, `chapters_rule_propose`) — available to agents.
|
|
110
|
-
- **Registers the composer commands** listed below — available to you.
|
|
111
|
-
- **Adds a "Fork with chapters" action** to every assistant message in the web UI.
|
|
112
|
-
- **Installs the `chapters` agent preset** into your DSH home at boot (`.agent-presets/`;
|
|
113
|
-
write-once — your edits are never clobbered). Pick it in the agent-preset menu to get the
|
|
114
|
-
chapter-form compaction engine; the plugin's own `fallbackPreset` covers children it creates.
|
|
19
|
+
`--profile <name>` is required on every `dsh plugin` command (`web` = the browser harness profile).
|
|
20
|
+
After restart you have the fork button, six agent tools, four `/chapters-*` commands — and the
|
|
21
|
+
optional `chapters` preset that routes `/compact` through the zero-token engine.
|
|
115
22
|
|
|
116
|
-
|
|
117
|
-
comment header of the shipped `cordis.patch.yml`** (`node_modules/@treeseed/dsh-chapters/cordis.patch.yml`)
|
|
118
|
-
— it mirrors the live config schema, which is enforced. The knobs users reach for most:
|
|
23
|
+
## Find the right page for your question
|
|
119
24
|
|
|
120
|
-
|
|
|
25
|
+
| You want to… | Go to |
|
|
121
26
|
|---|---|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
## Backend providers
|
|
156
|
-
|
|
157
|
-
Transport is a **provider seam** (design record: [docs/knowledge-repo.md](docs/knowledge-repo.md) §15;
|
|
158
|
-
contract: [docs/provider.md](docs/provider.md)): six verbs — clone/pull/push/commit/list/fetch — and
|
|
159
|
-
two shipped backends. Search, rules and the index all read the materialized **mirror**; they are
|
|
160
|
-
identical under either provider.
|
|
161
|
-
|
|
162
|
-
| | **`git` (default)** | **`treedx`** |
|
|
163
|
-
|---|---|---|
|
|
164
|
-
| Address form | `https://…/pool.git` (+ token) or a local path | `treedx+<url>/<repo>` (+ bearer token) |
|
|
165
|
-
| Transport | git smart-HTTP via isomorphic-git; plain repositories, browsable with any git client | TreeDX service API: workspace → overlay writes → commit, lease-managed |
|
|
166
|
-
| Credentials | per-project token in the DSH home (0600); local paths need none | bearer token, same home treatment |
|
|
167
|
-
| Contention | push rejected → ff-pull retry → divergence routes through **rebuild-from-the-store** | lease contention maps onto the same rejected→pull→diverged ladder |
|
|
168
|
-
| Mirror memory | cloned mirror directory under the workspace store | `.treedx-state.json` remembers the served head |
|
|
169
|
-
| Layout on the wire | identical: `chapters/`, `artifacts/`, `rules/`, derived `index/`, `collections/`, `topics/vocabulary.json` | identical (the service stores the same tree) |
|
|
170
|
-
|
|
171
|
-
Shared honesty rules both backends implement (measured, pinned by tests): every sync-path failure
|
|
172
|
-
**degrades to `local-only` with the reason**, never a silent loss — the mirror stays current and the
|
|
173
|
-
push lands when the remote returns; an unreachable-vs-auth-rejected distinction survives into the
|
|
174
|
-
status; divergence resolves by rebuilding from the store (the store is the truth, transport is
|
|
175
|
-
expendable); corpus listings page to the end. `kind` defaults to `git` for every record written
|
|
176
|
-
before providers existed — upgrading is zero migration.
|
|
177
|
-
|
|
178
|
-
## Development process
|
|
179
|
-
|
|
180
|
-
Everything runs from a clone with plain **npm** (this is a single package, not a monorepo):
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
npm ci
|
|
184
|
-
npm run typecheck && npm run build
|
|
185
|
-
npm test # unit + integration
|
|
186
|
-
npm run coverage:ci # c8 gate: ≥85% statements/branches/functions/lines
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
The browser acceptance suite runs against **model tapes** — recorded LLM exchanges replayed by a
|
|
190
|
-
local proxy, so it needs no model, no key and no GPU, and passes or fails *loudly* on a miss:
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
npm ci --prefix dev/dsh-host-lock # the pinned, hermetic DSH host for e2e boots
|
|
194
|
-
export PATH="$PWD/dev/dsh-host-lock/node_modules/.bin:$PATH"
|
|
195
|
-
npm run test:e2e:replay # all seven segments, ~6 min
|
|
196
|
-
bash scripts/bootstrap-dev-profile.sh --home .dshdev-local # scratch dev home, built via npm
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Tapes live in `tests/fixtures/model-tape/<project>/`; `E2E_MODEL=record` distills them against a
|
|
200
|
-
local llama.cpp endpoint (dev-only — CI never touches the model). When **product prompts change**
|
|
201
|
-
(persona, tool descriptions, notice text, thresholds) re-record the affected projects; documentation
|
|
202
|
-
edits are free. Agent-facing rules (the four invariants, the tape discipline, the coverage ledgers)
|
|
203
|
-
live in [AGENTS.md](AGENTS.md); the workflow loop in [docs/development.md](docs/development.md);
|
|
204
|
-
verification checklists in [docs/verify.md](docs/verify.md). Hosted CI
|
|
205
|
-
(`.github/workflows/ci.yml`) runs the gate plus the full tape-replay chain on every push;
|
|
206
|
-
releases publish automatically from a bare-semver tag via **npm trusted publishing (OIDC)** with
|
|
207
|
-
provenance attestations — no deploy secrets.
|
|
208
|
-
|
|
209
|
-
## Contributing
|
|
210
|
-
|
|
211
|
-
- **Start with an issue** for anything that changes behavior; the design record in
|
|
212
|
-
`docs/knowledge-repo.md` explains *why* things are shaped as they are, and amendments are human
|
|
213
|
-
decisions recorded in git.
|
|
214
|
-
- **Keep the four invariants inviolable** (never rewrite the log; never seed from the parent's
|
|
215
|
-
events; never touch the shared system prompt; never let the model author bodies). A PR that
|
|
216
|
-
trades one of these for convenience will be closed, not merged.
|
|
217
|
-
- **CI defines "done"**: deterministic suite green, coverage gate green, and — if your change moves
|
|
218
|
-
a model-visible prompt — the tape-replay chain re-recorded and green. Refuse-with-numbers beats
|
|
219
|
-
silent fallback everywhere in this codebase; follow that doctrine in new code too.
|
|
220
|
-
- **Test what you touch, and say how**: measured claims (this README's numbers are measured),
|
|
221
|
-
cited failure modes, no speculative generality.
|
|
222
|
-
- **Never commit credentials** or machine paths into fixtures; tokens belong to the DSH home only.
|
|
223
|
-
- Releases are maintainer-driven: bump `version`, land to `main`, push the tag — CI publishes.
|
|
224
|
-
|
|
225
|
-
License: see [LICENSE](LICENSE) (Copyright 2026 Fractal Synapse Labs).
|
|
226
|
-
|
|
227
|
-
> **On the name.** The package ships as `@treeseed/dsh-chapters` (npm scope `treeseed`; the GitHub
|
|
228
|
-
> org is `treeseed-ai`). Earlier candidates — `dsh-chapter-fork`, anything with "compact" — were
|
|
229
|
-
> rejected because they claimed something false: in DSH, *fork* means copying the parent's history,
|
|
230
|
-
> the one operation this plugin must never perform. The name names the artifact instead. Reasoning:
|
|
231
|
-
> [docs/architecture.md § Naming](docs/architecture.md#naming).
|
|
27
|
+
| understand what this is / why (the ten benefits) | [Home → “What it gives you”](https://treeseed-ai.github.io/dsh-chapters/) |
|
|
28
|
+
| install, upgrade, uninstall, verify provenance | [§23 Install, upgrade, provenance](https://treeseed-ai.github.io/dsh-chapters/operations/install/) |
|
|
29
|
+
| run your first compaction/continuation | [§1 Quickstart](https://treeseed-ai.github.io/dsh-chapters/start/quickstart/) → [§2 Your first continuation](https://treeseed-ai.github.io/dsh-chapters/start/first-continuation/) |
|
|
30
|
+
| link a shared knowledge pool (git or TreeDX) | [§3 Link a knowledge pool](https://treeseed-ai.github.io/dsh-chapters/start/link-pool/) · [§10 The pool](https://treeseed-ai.github.io/dsh-chapters/knowledge/pool/) |
|
|
31
|
+
| run any command — exact syntax, scope, outputs | [§15 Commands](https://treeseed-ai.github.io/dsh-chapters/reference/commands/) |
|
|
32
|
+
| know what the agent-facing tools do | [§16 Agent tools](https://treeseed-ai.github.io/dsh-chapters/reference/tools/) |
|
|
33
|
+
| tune a threshold, budget, or trigger | [§17 Configuration](https://treeseed-ai.github.io/dsh-chapters/reference/configuration/) |
|
|
34
|
+
| understand *why not summaries* / the economics | [§5 Why not summaries?](https://treeseed-ai.github.io/dsh-chapters/concepts/why-not-summaries/) |
|
|
35
|
+
| read the design rules the system won't break | [§6 The four invariants](https://treeseed-ai.github.io/dsh-chapters/concepts/invariants/) |
|
|
36
|
+
| the theory behind retrieval-over-compression (RLM) | [§8 Recursive context theory](https://treeseed-ai.github.io/dsh-chapters/concepts/recursive-context/) |
|
|
37
|
+
| propose/approve rules for agents | [§13 Rules & governance](https://treeseed-ai.github.io/dsh-chapters/knowledge/rules/) |
|
|
38
|
+
| debug something (“seems broken, is it?”) | [§4 FAQ & troubleshooting](https://treeseed-ai.github.io/dsh-chapters/start/faq/) |
|
|
39
|
+
| prompt-cache / llama.cpp behavior | [§21 Cache behavior on llama.cpp](https://treeseed-ai.github.io/dsh-chapters/evidence/llamacpp-cache/) |
|
|
40
|
+
| see measured results (production run + benchmarks) | [§19 Benchmarks](https://treeseed-ai.github.io/dsh-chapters/evidence/benchmarks/) · [§20 Field study](https://treeseed-ai.github.io/dsh-chapters/evidence/field-study/) |
|
|
41
|
+
| compare with other memory approaches | [§22 The alternatives, compared](https://treeseed-ai.github.io/dsh-chapters/evidence/comparison/) |
|
|
42
|
+
| check security/privacy boundaries | [§27 Security & privacy](https://treeseed-ai.github.io/dsh-chapters/operations/security/) |
|
|
43
|
+
| release history & known-fixed incidents | [§26 Changelog](https://treeseed-ai.github.io/dsh-chapters/operations/changelog/) |
|
|
44
|
+
| **develop the plugin itself** | [§24 Developing](https://treeseed-ai.github.io/dsh-chapters/operations/development/) → the engineering specs below |
|
|
45
|
+
|
|
46
|
+
## Developing / contributing
|
|
47
|
+
|
|
48
|
+
The site's Part VI covers the daily loop; the repository itself holds the engineering truth for agents:
|
|
49
|
+
|
|
50
|
+
- **[`AGENTS.md`](AGENTS.md)** — working spec for AI agents developing this repo (invariants, budget, hard rules)
|
|
51
|
+
- **[`docs/`](docs/)** — deep specs: `contract.md` (host API facts), `architecture.md` (mechanics), `development.md` (build/test loop + tape system), `verify.md` (every claim's procedure), `knowledge-repo.md` (design record), `host-compaction-seam.md`, `provider.md`
|
|
52
|
+
- **benchmarks**: `npm run bench` — three arms, local model, never CI ([protocol](benchmarks/README.md))
|
|
53
|
+
|
|
54
|
+
Feature requests and bugs: [open an issue](https://github.com/treeseed-ai/dsh-chapters/issues) —
|
|
55
|
+
measured reports get measured answers.
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
Apache-2.0 — see [LICENSE](LICENSE). Your conversations, chapters, and knowledge pools stay yours.
|
package/cordis.patch.yml
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
# plugin's composition patch, applied when a profile adds the plugin. The YAML
|
|
3
3
|
# below the comment block is functional; everything in this comment is the
|
|
4
4
|
# complete configuration reference (kept in sync with src/index.ts and
|
|
5
|
-
# src/engine.ts — verified 2026-
|
|
5
|
+
# src/engine.ts — verified 2026-10-01 against both schemas, including the
|
|
6
|
+
# 2026-09-21 transport keys). The site's §17 (Configuration) is the readable
|
|
7
|
+
# authority; this header mirrors it.
|
|
6
8
|
# Scratch-profile install: DSH_HOME=$PWD/.dshdev dsh plugin --profile web add "link:$(pwd)"
|
|
7
9
|
#
|
|
8
10
|
# Two planes, two surfaces:
|
|
@@ -73,6 +75,16 @@
|
|
|
73
75
|
# # THIS machine (approval = per-machine
|
|
74
76
|
# # curation fact, record §15)
|
|
75
77
|
#
|
|
78
|
+
# # ---- transport (2026-09-21 provider-seam amendment) -------------------
|
|
79
|
+
# knowledgeProvider: 'auto' # 'auto' | 'git' | 'treedx'; 'auto' dispatches
|
|
80
|
+
# # on the remote scheme (treedx+ → TreeDX),
|
|
81
|
+
# # an explicit value must match the scheme or
|
|
82
|
+
# # the link refuses — never a silent fallback
|
|
83
|
+
# treedxFetchTimeoutMs: 15000 # TreeDX HTTP timeout per call
|
|
84
|
+
# treedxWorkspaceTtlSeconds: 900 # TreeDX workspace lease TTL
|
|
85
|
+
# treedxLeaseRetries: 3 # pull-retry budget when the lease is held
|
|
86
|
+
# treedxLeaseRetryDelayMs: 1000 # delay between lease retries
|
|
87
|
+
#
|
|
76
88
|
# Realm-row-only keys (in the preset's engine row, not this patch):
|
|
77
89
|
# thresholdRatio, retainRatio, retainTokens, maxTokens, compactionRetries,
|
|
78
90
|
# maxOverflowRetries, auto, summarizationProvider/summarizationModel (legacy
|
package/docs/development.md
CHANGED
|
@@ -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 (suite/heavy/arrival); 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`,
|
|
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) |
|
|
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
|
|
@@ -82,14 +82,14 @@ activation, `fork-button.spec.ts` proves the click end-to-end on durable + visib
|
|
|
82
82
|
heavy specs pin their claims to DURABLE facts (own-log turn/end, registry chapters, coverage) —
|
|
83
83
|
never to model verbosity. ACCEPTANCE DEFAULTS TO THE TAPE (`test:e2e:replay`, model turns served
|
|
84
84
|
from `tests/fixtures/model-tape/<project>` in seconds — explore: 14.7 s replayed vs 1.7 min live); the live
|
|
85
|
-
chain remains the distiller (`test:e2e:record`) and the ultimate witness.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
chain remains the distiller (`test:e2e:record`) and the ultimate witness. AGENTS-BLIND
|
|
86
|
+
masking (user decision 2026-09-20, reaffirmed 2026-10-01 with no exceptions): the tapes
|
|
87
|
+
stand in for ANOTHER project — a workspace docs edit (AGENTS.md, skill catalogs) NEVER
|
|
88
|
+
requires a re-record. The delimiter mask strips injected doc blocks from matching on both
|
|
89
|
+
sides, and a compaction summary that paraphrases doc prose (observed 2026-09-23 in
|
|
90
|
+
`heavy`/`fanout`) rides the tape as recorded model output — replay-side requests never
|
|
91
|
+
regenerate it, so committed tapes stay green across doc edits. Never gate a doc edit on
|
|
92
|
+
a distillation.
|
|
93
93
|
|
|
94
94
|
Re-record discipline (learned the hard way 2026-09-22/23):
|
|
95
95
|
- **A tape records the CONTEXT it was distilled in.** A spec replayed in a different
|
|
@@ -97,6 +97,14 @@ Re-record discipline (learned the hard way 2026-09-22/23):
|
|
|
97
97
|
injected presence and misses. Re-record the whole project, not a single spec, when specs
|
|
98
98
|
share a boot — and never run two GPU-consuming suites concurrently (RR2=137 + timeout
|
|
99
99
|
cascades: a fanout that passes alone failed at 1.1 h while a heal chain shared the server).
|
|
100
|
+
**Home freshness is part of the context** (measured 2026-09-29): the host injects
|
|
101
|
+
skill-catalog-changed and runtime-context snapshot notices on the FIRST boot against a
|
|
102
|
+
fresh/absent throwaway home. Distilling against a stale home produced a tape without those
|
|
103
|
+
messages that a pristine replay then demanded — structural message-count divergence, which
|
|
104
|
+
no content mask can bridge. Discipline: `rm -rf var/e2e-home-<port>` before RECORD and
|
|
105
|
+
before the verifying REPLAY, so both sides saw the same boot world. Hosted CI is inherently
|
|
106
|
+
pristine: a locally-distilled tape that passes only on an accumulated home is a red flag,
|
|
107
|
+
not a pass.
|
|
100
108
|
- **Ports are parameterized end to end**: the model proxy derives `E2E_PROXY_PORT = boot port
|
|
101
109
|
+ 1000` (a hard-coded 41799 turned one killed run's orphan into EADDRINUSE for every later
|
|
102
110
|
boot), and `boot.ts` fails FAST with a named-port message when the boot port is already
|
package/docs/verify.md
CHANGED
|
@@ -127,7 +127,7 @@ 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 @
|
|
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 |
|
|
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
133
|
## The Cache Metric, Before You Trust a Number
|
|
@@ -157,7 +157,7 @@ that still need a running chapter engine:
|
|
|
157
157
|
| E1 | Zero-inference summarization | the `compaction/summary` event carries **no `usage` field** and no provider call appears in the round (proved with a stub at r12/r13; must re-prove with the real TOC `summarize()`) |
|
|
158
158
|
| E2 | Archive honesty after automatic compaction | every `shadowedSeq` of a landed compaction resolves (via durable log + `sourceEventSeqs`) into a written chapter file whose hash matches the registry |
|
|
159
159
|
| E3 | Header cache across a compaction — **CLOSED by r23 (measured, per-machine)** | cloud: `cacheReadTokens` held at **7,424 on both post-replacement turns** while uncached refill fell 13,658 → ~7,000. Local llama.cpp (r28-era probes): reuses NOTHING across a head replacement (0 cached) but steady-state turns cost only the new content. **Never quote one machine's number for the other.** |
|
|
160
|
-
| E2E-TAPE | Acceptance without the GPU | `test:e2e:replay` serves every model turn from `var/model-tape/<project>` (isolated per boot) (proxy smoke: exact + prefix hit, loud 503 miss with journal). Usage fields ride the tape, so the token meter and compaction thresholds fire at identical steps under replay. Tapes are committed test DATA under `tests/fixtures/model-tape/` (the rest of `var/` stays ignored) — CI replays them via `scripts/ci-replay.sh` with no local model; regenerate via `test:e2e:record` (local GPU) when PRODUCT prompts change. The local model remains the distiller and ultimate witness. STATUS 2026-09-23: pipeline current (escape/whitespace classes, volatile rules incl. HOSTPORT-BLIND + derived-count collapses for `(N est tokens)` and host-injected char counts, tool bytes matched out);
|
|
160
|
+
| E2E-TAPE | Acceptance without the GPU | `test:e2e:replay` serves every model turn from `var/model-tape/<project>` (isolated per boot) (proxy smoke: exact + prefix hit, loud 503 miss with journal). Usage fields ride the tape, so the token meter and compaction thresholds fire at identical steps under replay. Tapes are committed test DATA under `tests/fixtures/model-tape/` (the rest of `var/` stays ignored) — CI replays them via `scripts/ci-replay.sh` with no local model; regenerate via `test:e2e:record` (local GPU) when PRODUCT prompts change. The local model remains the distiller and ultimate witness. STATUS 2026-09-23: pipeline current (escape/whitespace classes, volatile rules incl. HOSTPORT-BLIND + derived-count collapses for `(N est tokens)` and host-injected char counts, tool bytes matched out); SEVEN-project replay chain (suite, fanout, heavy, arrival, enrich, rules, fork). Doc edits are ALWAYS free (user decision 2026-10-01, no exceptions): the tapes stand in for ANOTHER project — injected doc bytes are masked from matching, and compaction summaries that paraphrase doc prose ride the tape as recorded model output, so no doc edit ever requires a re-record. The e2e is the integration witness that the deterministic layers cannot replace — it found two real product bugs (the enrich body-hash anchor mismatch and the missing host-plane route) that had been invisible behind the host logger |
|
|
161
161
|
| E9 | P2 enrichment + vocabulary, two-machine grade | `node --test tests/integration/two-machine-enrich.test.ts` + `--project=enrich` tape replay | **green 2026-09-20** — enriched frontmatter/provenance cross the pool byte-exact; B honors A’s aliases and dedupes its own vocab pass; caught+fixed r37 (modifications invisible to commits). Four-project replay chain green, 0 misses |
|
|
162
162
|
| CACHE | **Cache hit rates rise over time; nothing poisons the prefix silently** | Three nets, all born of the 2026-09-25 machine deep-dive (user report: "hit rates FALL over time"). The decoded truth — timeline first, because the first attribution got it wrong twice: a parent session's provider cacheRead rode 11,386→29,656 (hit .997) for seven warm requests, then COLLAPSED to a pinned 9,613 at request seq 78 — BEFORE any compaction event (those land at seq 105). Cause: KV-CAPACITY EVICTION — parent + three fan-out children + a live agent session sharing one 65,536-token llama.cpp pool (total_slots 1 per /props); prefix lookup kept doing exactly its job, returning the shared 9,613-token header for every divergent chain. The engine's pressure compaction then fired CORRECTLY at the meter's number (~66,700 ≥ 0.9×64,000) — the meter is provider baseline + 4-chars/token estimate of content added since the last request, so its trigger point is invisible in provider usage numbers (29,656 looked early; it was not). After the children quiesced the parent RE-WARMED (req 121: read 21,969, hit .97). **Deterministic net 1**: `tape-prefix-stability.test.ts` — every mid-chain tape request must extend its predecessor byte-for-byte (only the two documented replacement points may break a chain); message mutation mid-session — the general cache-poison class — fails this ledger with the offending entry; all seven projects pass. **Deterministic net 2**: `context-hygiene.test.ts` — no context-window literal may ship in src/ or presets/, no preset may pin a window key: the threshold math (floor(configured window × ratio)) can only follow adapter config. **Physical net** (opt-in, live): `npm run test:e2e:cache` serial — asserts the warm curve (no collapse <50% of best cacheRead, ≥50% of prompt growth landing cached, final hit ≥0.90, no compaction in-window; full ledger on failure; first run: 0%→99.7% monotonic). `E2E_CACHE_CONCURRENCY=N` adds N-1 live tenant chains firing per round — VALIDATED at CONCUR=3 (17.6 min): the probe chain still finished hit 0.997 with zero tenant errors, while the interleaved tenants showed the textbook capacity signature the user's log had (cacheRead pinned at 9,617, hit ~0.50 when their turns alternated on the single slot, recovering to 0.998 the moment they got two contiguous turns). Proves the collapse is capacity/interleaving, not the plugin: the same server, same slot, a chain left alone still warms to .997; pass measures this server holding N warm chains, pinned-header/queue-starvation measures the capacity cliff; run it while your own agent sessions are few, and read the ledger SHAPE (collapse-and-stay vs flat-pin vs dip-and-recover) before believing any single attribution | Host-capacity epilogue (2026-09-26, measured on the dev box): single-slot llama.cpp pins interleaved chains to the shared-prefix LCP (9,617 tokens in every experiment); unified KV (--kv-unified, auto slots) crashed b10920 on hybrid-GDN models (Qwen3-Next class; llama.cpp #23210/#21401) — RETESTED WINNING on b11176 (2026-09-27): contention probe CONCUR=3 passed, every chain at 0.997-0.998 with tails restoring one turn after a collision, zero crashes; keep auto slots (1), never force N_PARALLEL>1, re-run scripts/prefix-swap-test.mjs + the contention probe after any image upgrade — one trap measured: LLAMA_ARG_CTX_CHECKPOINTS=0 looks like a saving (upstream invalidates them for the recurrent layers) but on b10920 it deletes ALL cross-request prefix reuse (cached_tokens flat 0); keep the default 32 |
|
|
163
163
|
| E2E | The fork BUTTON, browser journey | **green (2026-09-19, 7 specs / three projects — suite@0.75-of-32K + heavy@0.5-floor-off + arrival@0.9-floor-500 — on port-keyed throwaway homes)**: specs CREATE their sessions through the UI ('New session' + one real Local-model turn; turn-complete = the session's OWN `turn/end` in its own log — the global registry count false-passed twice and was retired). Fixture-free by design after the R29-era rows aged out of the 90-session sidebar. The suite also caught the 'Internal Testing Notice' focus trap and the re-link origin bug (see FINDINGS). |
|
package/lib/artifact-query.d.ts
CHANGED
|
@@ -51,3 +51,12 @@ export declare function loadArtifact(absPath: string): {
|
|
|
51
51
|
bytes: number;
|
|
52
52
|
lines: number;
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Store-first, mirror-second resolution (measured 2026-09-28, treeseed pool
|
|
56
|
+
* audit): chapters cite 'artifacts/aa/<sha>.txt' — on another machine the blob
|
|
57
|
+
* lives in the knowledge MIRROR (artifacts/<projectKey>/aa/<sha>.txt, one dir
|
|
58
|
+
* per linked project), not the local store. Returns the absolute path of the
|
|
59
|
+
* first existing match, or null. Containment holds on BOTH roots; '..' can
|
|
60
|
+
* never escape.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveArtifactWithMirror(storeDir: string, ref: string, mirrorDir: string): string | null;
|
package/lib/artifact-query.js
CHANGED
|
@@ -127,4 +127,41 @@ export function loadArtifact(absPath) {
|
|
|
127
127
|
const st = fs.statSync(absPath);
|
|
128
128
|
return { text: fs.readFileSync(absPath, 'utf8'), bytes: st.size, lines: 0 };
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Store-first, mirror-second resolution (measured 2026-09-28, treeseed pool
|
|
132
|
+
* audit): chapters cite 'artifacts/aa/<sha>.txt' — on another machine the blob
|
|
133
|
+
* lives in the knowledge MIRROR (artifacts/<projectKey>/aa/<sha>.txt, one dir
|
|
134
|
+
* per linked project), not the local store. Returns the absolute path of the
|
|
135
|
+
* first existing match, or null. Containment holds on BOTH roots; '..' can
|
|
136
|
+
* never escape.
|
|
137
|
+
*/
|
|
138
|
+
export function resolveArtifactWithMirror(storeDir, ref, mirrorDir) {
|
|
139
|
+
const primary = resolveArtifactPath(storeDir, ref); // still throws on escapes
|
|
140
|
+
if (fs.existsSync(primary))
|
|
141
|
+
return primary;
|
|
142
|
+
const clean = ref.trim();
|
|
143
|
+
// tail = the aa/<sha>.txt portion under artifacts/, whatever the ref form
|
|
144
|
+
const tail = /^[0-9a-f]{64}$/.test(clean)
|
|
145
|
+
? path.join(clean.slice(0, 2), `${clean}.txt`)
|
|
146
|
+
: (() => {
|
|
147
|
+
const m = clean.replace(/^\.\//, '').match(/artifacts[/\\](.+\.txt)$/);
|
|
148
|
+
return m?.[1] ?? null;
|
|
149
|
+
})();
|
|
150
|
+
if (tail === null || tail.split(/[\\/]/).includes('..'))
|
|
151
|
+
return null;
|
|
152
|
+
const artRoot = path.join(mirrorDir, 'artifacts');
|
|
153
|
+
if (!fs.existsSync(artRoot))
|
|
154
|
+
return null;
|
|
155
|
+
for (const key of fs.readdirSync(artRoot, { withFileTypes: true })) {
|
|
156
|
+
if (!key.isDirectory())
|
|
157
|
+
continue;
|
|
158
|
+
const cand = path.join(artRoot, key.name, tail);
|
|
159
|
+
const root = path.resolve(artRoot);
|
|
160
|
+
if (path.resolve(cand) !== root && !path.resolve(cand).startsWith(root + path.sep))
|
|
161
|
+
continue;
|
|
162
|
+
if (fs.existsSync(cand))
|
|
163
|
+
return cand;
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
130
167
|
//# sourceMappingURL=artifact-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-query.js","sourceRoot":"","sources":["../src/artifact-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAI5B,yFAAyF;AACzF,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,GAAW;IAC/D,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IACxB,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;Q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A;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAClC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;YAAE,SAAQ;QAC5F,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAA;IACtC,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/lib/engine.js
CHANGED
|
@@ -433,16 +433,32 @@ export class ChaptersCompactionEngine extends BasicCompactionEngine {
|
|
|
433
433
|
&& typeof cfg.summarizationModel === 'string' && cfg.summarizationModel !== '')
|
|
434
434
|
? { provider: cfg.summarizationProvider, model: cfg.summarizationModel } : null;
|
|
435
435
|
const route = legacy ?? (shared !== null && shared.provider !== '' && shared.model !== '' ? shared : this.lastRoute);
|
|
436
|
-
if (route === null)
|
|
436
|
+
if (route === null) {
|
|
437
|
+
// Loud, not silent: an empty plot section is a legitimate outcome, but
|
|
438
|
+
// SILENTLY skipping is how the treeseed run's early child checkpoints
|
|
439
|
+
// lost their plots without a trace (2026-09-27 audit).
|
|
440
|
+
this.#diagnostic('dsh-chapters: plot elicitation skipped — no route resolved (lastRoute unset, no aux route)');
|
|
437
441
|
return null;
|
|
438
|
-
|
|
442
|
+
}
|
|
443
|
+
// 600, not 220: reasoning tokens count against the budget on reasoning
|
|
444
|
+
// models (measured: the elicit prompt alone used 155 of 220 with a SHORT
|
|
445
|
+
// excerpt — real 8K-char excerpts invite more thinking and starved the
|
|
446
|
+
// content to nothing). Malformed replies are now logged with a snippet.
|
|
447
|
+
const text = await this.#auxComplete(instruction, route, 600, signal, session.id);
|
|
439
448
|
const at = text.indexOf('PLOT:');
|
|
440
|
-
if (at === -1)
|
|
449
|
+
if (at === -1) {
|
|
450
|
+
this.#diagnostic(`dsh-chapters: plot elicitation reply carried no PLOT line (${text.length} chars): ${JSON.stringify(text.slice(0, 80))}`);
|
|
441
451
|
return null;
|
|
452
|
+
}
|
|
442
453
|
const para = text.slice(at + 5).split(/\n\s*\n/)[0].trim();
|
|
443
|
-
|
|
454
|
+
if (para.length === 0) {
|
|
455
|
+
this.#diagnostic('dsh-chapters: plot elicitation reply had an empty PLOT line');
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
return para.slice(0, 900);
|
|
444
459
|
}
|
|
445
|
-
catch {
|
|
460
|
+
catch (error) {
|
|
461
|
+
this.#diagnostic(`dsh-chapters: plot elicitation failed (${String(error?.message ?? error).slice(0, 120)}) — continuing without a plot`);
|
|
446
462
|
return null;
|
|
447
463
|
}
|
|
448
464
|
}
|
|
@@ -509,18 +525,25 @@ export class ChaptersCompactionEngine extends BasicCompactionEngine {
|
|
|
509
525
|
await this.#finalizeAllOutstanding(session);
|
|
510
526
|
}
|
|
511
527
|
catch (error) {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
528
|
+
this.#diagnostic(`dsh-chapters: chapter finalization deferred (session ${session.id}): ${String(error?.stack ?? error)}`);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* The operator-visible warn channel (r19: headless profiles route ctx.logger
|
|
533
|
+
* where nobody can see it; measured again 2026-09-27: even the in-process
|
|
534
|
+
* logger surface is unassertable on this node build). Warn + mirror to the
|
|
535
|
+
* DSH_CHAPTERS_ENGINE_ERRORS append file when opted in — diagnostics seam,
|
|
536
|
+
* not a tunable. Any degradation that leaves the user wondering "did the
|
|
537
|
+
* feature run?" belongs here.
|
|
538
|
+
*/
|
|
539
|
+
#diagnostic(message) {
|
|
540
|
+
this.ctx.logger?.warn?.(message);
|
|
541
|
+
const sink = process.env.DSH_CHAPTERS_ENGINE_ERRORS;
|
|
542
|
+
if (sink !== undefined) {
|
|
543
|
+
try {
|
|
544
|
+
appendFileSync(sink, `[${new Date().toISOString()}] ${message}\n`);
|
|
523
545
|
}
|
|
546
|
+
catch { /* diagnostics must never mask the real failure */ }
|
|
524
547
|
}
|
|
525
548
|
}
|
|
526
549
|
/** Every provider-tagged summary without a finalized manifest, oldest first. */
|