@treeseed/dsh-chapters 0.2.5 → 0.2.6

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.
@@ -0,0 +1,248 @@
1
+ # The autorun guide — goal-directed sessions that keep themselves moving
2
+
3
+ > Status: draft for the maintainer's process review (#186). Promotion to the documentation site
4
+ > (a numbered section beside §28) happens after that review. Every command verb, config key, and
5
+ > default named here was read out of the shipped source at 0.2.3, not remembered.
6
+
7
+ ## 1. What this system is for
8
+
9
+ A coding agent stops when its turn ends. Everything in this guide exists to close the gap between
10
+ "the work needs forty turns" and "a human is pressing Enter forty times" — without handing the
11
+ machine unchecked authority over the objective:
12
+
13
+ - **The goal** is the standing directive: what done means, and the stopping rules around it. The
14
+ host's goal driver re-prompts the model at every turn boundary until the goal is complete,
15
+ blocked, cleared, or its round budget is spent.
16
+ - **The Suggested Next Step bar** is a second model — the *prompt model*, whose whole job is to
17
+ write the ONE next instruction — consulting the session's live tail and its archived-chapter
18
+ summaries after each completed turn.
19
+ - **Autorun** is the clutch between them: armed, each suggestion runs itself as a human-authored
20
+ turn, so the session keeps working without you. With a goal armed, arming autorun *displaces*
21
+ the goal driver's own continuation — the goal remains the objective, but the suggestion loop
22
+ becomes the engine. Without a goal, autorun simply keeps iterating suggestions.
23
+ - **Chapters** make the loop sustainable: when context pressure arrives, the conversation is
24
+ archived verbatim into chapters and the work continues in a fresh session seeded with nothing
25
+ but a table of contents. A 32K-context model can run a hundred-turn objective because its
26
+ context is renewable.
27
+ - **Enrichment and rule distillation** make the loop *learn*: idle-time model passes annotate the
28
+ archived chapters (title, summary, topics — so retrieval works), and mine them for standing
29
+ orders (rules with an honest warrant: `stated` only when a human literally said it, `inferred`
30
+ when the model judged it useful). Rules then assemble into every future task's context.
31
+
32
+ The two-by-two that orients everything else:
33
+
34
+ | | no autorun | autorun armed |
35
+ |---|---|---|
36
+ | **no goal** | ordinary chat; the bar offers suggestions, you press Run (or ignore them) | the suggestion loop iterates on its own, up to its round budget |
37
+ | **goal armed** | the host's goal driver re-prompts each turn boundary (rounds cascade until complete/blocked/cleared/budget) | the suggestion loop drives instead — the goal driver's continuation is displaced, the goal stays the objective |
38
+
39
+ ## 2. How it works, turn by turn
40
+
41
+ 1. A turn completes. If a prompt model is set, it is asked for the next step: one imperative
42
+ instruction, at most `promptMaxChars` (default **240** today) characters, composed from a
43
+ `promptContextChars` (default **4000**) budget covering the session's chapter summaries, the
44
+ live conversation tail, and the active goal. An over-cap answer is *refused, never truncated* —
45
+ a suggestion you can't see whole is a suggestion you can't judge. As of 0.2.4 (#188, shipped): the suggestion cap defaults to **4096** characters, and both caps
46
+ belong to the model — `/chapters-prompt model <provider/model> [maxChars] [contextChars]` stores
47
+ explicit numbers beside the model, and with no explicit numbers the context budget **derives from
48
+ the model's real window** (`window × promptContextRatio`, default 0.5, at 4 chars/token — a 32K
49
+ model and a 1M model get budgets 30× apart from one rule). The input itself became the session's
50
+ memory: the goal whole, the active plan, the core rules, every chapter on the ancestor path as
51
+ title + detailed summary + every plot line, and the last turn whole — with **zero truncation** as
52
+ an invariant: over budget, the oldest chapter drops (announced) until the history fits, and a
53
+ protected set that cannot fit refuses with the numbers instead of sending a starved input.
54
+ 2. The offer is classified. Plain text = a **worker-step** (autorun may fire it). A `GOAL:`
55
+ prefix = a **goal-edit**: the model is proposing to re-cut the objective itself. Autorun must
56
+ never act on a goal-edit — the host reserves objective changes for direct human turns — so it
57
+ waits in the bar for you to read and Run yourself.
58
+ 3. If autorun is armed and the offer is a worker-step, the loop fires **at most one turn per
59
+ offer**, submitted through the same path as the bar's Run button: a human-authored user turn.
60
+ Fired rounds count against `promptMaxRounds` (default **24** per session); offers nobody armed
61
+ never spend the budget.
62
+ 4. Arming autorun while a goal is active calls the host's goal *disarm* seam: the goal driver
63
+ stops re-injecting its rounds while the goal itself stays durable and unchanged (phase,
64
+ objective, revision all intact). You can see it: the goal bar's `Pause goal` becomes
65
+ `Resume goal`. One engine owns each turn boundary — never two.
66
+ 5. Context pressure arrives eventually; that is the design, not a failure. The host's relief
67
+ compacts the surface, chapters archive the span verbatim (oversized tool results defer to
68
+ content-addressed artifacts), and a continuation opens with the TOC notice as its only seed.
69
+ The goal rides the session tree into the continuation; **autorun does not** — armed state is
70
+ process-local per session and nothing arrives armed after a restart or in a child. Re-arm
71
+ deliberately; a loop that starts turns must never resume itself.
72
+ 6. While the session is idle, enrichment drains its queue in batches (`enrichmentIdleMs`,
73
+ `enrichmentBatchCap`): one structured call per archived chapter asks for
74
+ `{title, summary, topics, rules[]}` as validated JSON — retry once, and on second failure the
75
+ deterministic values stand (a slow or failing model never blocks or blanks a chapter). The
76
+ chapter's body is never touched; annotations land in frontmatter with a `generated:`
77
+ provenance chain.
78
+ 7. Mining rides the same call (or a dedicated one when `rules.model` is set — one extra bounded
79
+ call per chapter, which is exactly what you pay a better model for). Each candidate rule
80
+ carries a `quote`; the quote is checked **verbatim against human bytes only** — a quote found
81
+ in assistant prose is the model restating itself, never evidence you said it. That decides the
82
+ warrant: `basis: stated` (your words are behind it) or `basis: inferred` (the model judged it
83
+ useful and nobody said it). With `rulesAutoActivate` on (the default), mined rules govern the
84
+ session tree on arrival and `revoke` is the undo; with it off, they are held `reviewOnly`
85
+ until this machine approves them.
86
+ 8. Rules close the loop: at the start of every task the model can assemble the standing orders in
87
+ force (`chapters_rules`), and rebuilt heads render the core set — so what the loop learned
88
+ yesterday shapes what the loop suggests tomorrow.
89
+
90
+ ## 3. Before you start
91
+
92
+ 1. **Install/update** the plugin in your harness profile and restart the harness:
93
+ `npm i @treeseed/dsh-chapters@latest` (site §23 covers every path).
94
+ 2. **Optionally link a knowledge pool** so chapters and project rules are shared across machines:
95
+ `/chapters-link <path-or-url>`. Everything in this guide works without it; with it, project
96
+ rules and the archive travel.
97
+ 3. **Pick your models** — this is what `/chapters-models` exists for:
98
+
99
+ ```
100
+ /chapters-models # providers + advertised models as paste-ready ids
101
+ /chapters-models <provider> <model> # one route: context window, reasoning efforts
102
+ ```
103
+
104
+ The footer shows what each of the three settings currently resolves to. Three knobs, three
105
+ different jobs:
106
+
107
+ | setting | command | job | default |
108
+ |---|---|---|---|
109
+ | annotation | `/chapters-enrich model <provider/model|clear>` | summarize archived chapters for retrieval | unset = rides the conversation route |
110
+ | mining | `/chapters-rule model <provider/model|clear>` | distill standing orders — judgment-heavy | unset = rides the annotation call |
111
+ | prompt | `/chapters-prompt model <provider/model>` | **defines the next work**; setting it IS enabling the bar | unset = the feature does not exist |
112
+
113
+ The bar's visibility rule is exactly this setting: with no prompt model, the feature does not
114
+ exist anywhere; the moment one is set, the bar appears docked above the composer (its own dock
115
+ slot, order 30) and lives there per session — `Analyzing…` after each completed turn, then
116
+ `Recommended Next Step`. `/chapters-prompt off` hides it for the session (`on` brings it back),
117
+ and an idle bar stays visible on purpose: "live, nothing to say yet" must not look like
118
+ "disabled".
119
+
120
+ Tuning intuition: annotation is volume work — a cheap, fast model is right. Mining reads
121
+ between the lines for instructions worth keeping — this is where a stronger model earns its
122
+ extra call. The prompt model writes the instruction that *becomes the next turn*; under
123
+ autorun it is effectively the loop's director, so give it the best model you can afford.
124
+ 4. **Decide your review posture.** `rulesAutoActivate: true` (default) means mined rules govern
125
+ on arrival — fast, and `revoke` undoes any mistake per machine. Setting it `false` holds every
126
+ mined rule inert until `/chapters-rule approve <id>` — right for shared pools where a
127
+ mis-generalization would bind teammates. Config keys live on the preset row in your profile's
128
+ `cordis.patch.yml` (site §16).
129
+
130
+ ## 4. The arc: from a need to a completed goal
131
+
132
+ **Phase 1 — Identify the work.** Either bring a decision you made outside the session ("we're
133
+ migrating the auth layer; here's the plan") or think it through with the model by ordinary
134
+ conversation. Either is fine; what matters is that the objective ends up stated in words a
135
+ stranger could judge completion by. When the model needs a decision from you it should ask with
136
+ the question tool — which suspends until you answer — rather than burying a question in prose
137
+ and proceeding on a guess.
138
+
139
+ **Phase 2 — Arm the goal.** Say it plainly: *"Create a goal: <objective>."* The model calls
140
+ `create_goal`; the host's goal bar appears with `Pause goal`. Two numbers matter:
141
+ `max_goal_rounds` caps the automatic continuation rounds (default **256** — a round is itself a
142
+ turn, so rounds cascade until something stops them); ask for a smaller budget when the objective
143
+ is bounded. The goal can be edited, paused, resumed, completed, or marked blocked through the
144
+ model (`update_goal`) — blocked requires the same concrete condition to persist for at least
145
+ three consecutive rounds, so it can't be used to give up early.
146
+
147
+ **Phase 3 — Hand over the wheel.** With the bar's model set (step 3 above), arm the loop:
148
+
149
+ ```
150
+ /chapters-prompt autorun on
151
+ ```
152
+
153
+ The reply tells you which engine you got: with a goal armed it reports the displacement ("the
154
+ goal remains the objective; its own auto-continuation is disarmed, so the suggestion loop
155
+ drives"), and the goal bar flips to `Resume goal`. Autorun needs a prompt model — arming without
156
+ one is refused, loudly.
157
+
158
+ **Phase 4 — The loop.** Now watch it work. The bar is your primary surface here — everything
159
+ per-turn happens on it, and the commands you typed in Phase 3 were configuration, not the
160
+ workflow. After each completed turn the bar shows *Analyzing…* then *Recommended Next Step*;
161
+ expand it to read the offer in full; **Run** submits it as your own turn; **Autorun** arms the
162
+ loop so worker-step offers run themselves; **Off** hides the bar for the session. Armed autorun
163
+ fires worker-steps as human-authored turns; pressure points become checkpoints and continuations;
164
+ idle time annotates and mines. Your role shifts from author to editor — which brings us to the
165
+ situations.
166
+
167
+ **Phase 5 — Steering (everything in between).** See the table in §5. The one rule of thumb:
168
+ **typing anything takes the wheel.** A human turn disarms autorun immediately (the offer stays
169
+ visible, and the reply says why), so interrupting is always safe and never loses the suggestion.
170
+
171
+ **Phase 6 — Completion.** The model marks the goal complete only when the objective is actually
172
+ achieved, with evidence gathered before the claim; you'll get a closing report. Or it marks
173
+ blocked with the concrete persisting condition — and **blocked disarms autorun exactly like
174
+ complete does** (0.2.4, #188: both planes stop together; a loop firing offers at a dead goal
175
+ outlived its purpose). You can end it yourself any time (`/goal clear`, or Pause on the goal
176
+ bar). While a goal is active or paused, the round budget **stands down** — the pursuit is bounded
177
+ by the goal's lifecycle, never cut off by `promptMaxRounds`. With no goal (or after one is
178
+ cleared), an armed loop keeps iterating suggestions within the budget (default 24): open-ended
179
+ iteration is a feature, but know it's there — the last thing you do is usually `autorun off`.
180
+
181
+ **Phase 7 — After.** The work outlives the session: chapters are searchable (`chapters_search`
182
+ for the model, the pool for your team if linked), artifacts remain addressable by hash, and mined
183
+ rules persist — session-tier ones stay machine-local and bind that session tree; promote a good
184
+ one to the shared tier with `/chapters-rule add <category> "<text>"` (a new project-tier rule)
185
+ and `approve` it per machine.
186
+
187
+ ## 5. Situations and possible actions
188
+
189
+ | Situation | What's happening | Action |
190
+ |---|---|---|
191
+ | The suggestion is wrong | the prompt model misread the state | Just type your own instruction — a human turn disarms autorun and the offer stays visible. Or Run a different pace: `autorun off`, steer manually |
192
+ | The suggestion starts with `GOAL:` | the director proposes re-cutting the objective — autorun will never fire these | Read it. If right, press Run yourself (objective changes need a human turn — that's the host's rule, not a limitation of the loop). If wrong, ignore it; the next turn gets a fresh offer |
193
+ | The loop is circling | offers repeat variations; no state changes | `autorun off`, then either re-cut the goal (ask the model to `update_goal` edit) or give one concrete instruction that breaks the cycle |
194
+ | The objective is stale | the work changed shape | Ask the model to edit the goal (a revision bump invalidates outstanding offers — last cycle's directive can't fire against a re-cut objective), or `/goal clear` and create a new one |
195
+ | It won't stop | rounds cascade by design | Three brakes, finest first: `autorun off` (loop), `Pause goal` / ask to pause (driver), round budgets (`promptMaxRounds` 24, `max_goal_rounds` at create) |
196
+ | A mined rule is wrong or over-general | inference happens; that's why the warrant exists | `/chapters-rule list --scope session` → `view <id>` (full text + basis) → `revoke <id>`. Machine-local, one command, file bytes untouched |
197
+ | A mined rule is good and general | worth binding beyond this tree | `/chapters-rule add <category> "<text>"` creates a project-tier proposal; `approve <id>` makes it core on your machine; the pool carries it to teammates |
198
+ | You keep repeating yourself | say it once, durably | Start a line with `ADD RULE: <text>` in your own message — deterministic capture, zero model tokens, active for your session tree, exactly your words |
199
+ | Mined rules worry you | shared pool, high stakes | `rulesAutoActivate: false` in config → REVIEW posture: every mined rule waits inert for `approve`; `/chapters-rule active` shows the posture and what a rebuilt head will render |
200
+ | Annotations are shallow | annotation model too weak, or wrong for the corpus | `/chapters-enrich model <better/id>`; re-run with `/chapters-enrich run` |
201
+ | Mining misses the point | mining rides a cheap annotation call | `/chapters-rule model <stronger/id>` — one extra bounded call per chapter, the intended lever |
202
+ | Enrichment backlog | idle batches haven't drained | `/chapters-enrich report` (status + pending count), `/chapters-enrich run` (drain now) |
203
+ | Session feels long/slow | pressure is normal; relief is automatic | Nothing required — checkpoints and continuations are the design. Optionally `/chapters-save` (archive without a child) or the message doors: **Continue with chapters** (same line of work, fresh context) / **Fork with chapters** (branch an experiment; the parent stays untouched) |
204
+ | The bar is in the way | you want a quiet session | `/chapters-prompt off` hides it; `on` brings it back. Off is per session |
205
+ | Something looks broken | sync, store, or diagnostics | `/chapters-status` (prints the whole diagnostics block in every state); `/chapters-repair` for archive damage (supersedes, never rewrites); `/chapters-rule conflicts` for contradictory standing orders (report-only — it never edits a rule) |
206
+ | Restarted the harness | armed state is process-local by design | The goal persists (durable); autorun does not (nothing arrives armed — a loop that starts turns must never resume itself). Re-arm deliberately |
207
+
208
+ ## 6. Command summary
209
+
210
+ ```
211
+ Discovery /chapters-models [<provider> [<model>]]
212
+ Suggestions /chapters-prompt model <provider/model> | on | off | state | autorun on|off
213
+ /chapters-prompt suggest (compose a fresh offer now — the pull the bar rides)
214
+ /chapters-prompt run (submit the offer on screen — the bar's Run button as a command;
215
+ Enrichment /chapters-enrich run | model <provider/model|clear> | report
216
+ Rules /chapters-rule add <category> <text> | list [--all|--proposed|--category <c>|--scope project|session]
217
+ /chapters-rule view <id> | active | approve <id> | revoke <id> | pin <id> | unpin <id>
218
+ /chapters-rule model [<provider/model|clear>] | conflicts
219
+ Archive & health /chapters-status | /chapters-save | /chapters-repair | /chapters-link
220
+ both are session-scoped: "the offer on screen" is a per-session fact)
221
+ Doors (UI) Continue with chapters · Fork with chapters · the Suggested Next Step bar (expand, Run, Autorun, Off)
222
+ Goals (host) the goal bar (Pause/Resume) · /goal · the model's create_goal / get_goal / update_goal tools
223
+ Marker (chat) ADD RULE: <text> — at the start of a line in your own message
224
+ ```
225
+
226
+ Config keys you're most likely to touch (preset row in `cordis.patch.yml`, site §16):
227
+ `promptMaxRounds` (24), `promptContextChars` (4000), `promptMaxChars` (240), `rulesAutoActivate`
228
+ (true), `rulesEnrichment` (true — mining on/off), `enrichmentEnabled` (true),
229
+ `enrichmentIdleMs` / `enrichmentBatchCap` / `enrichmentMaxTokens`.
230
+
231
+ ## 7. Honest limits (stated, not buried)
232
+
233
+ - **Run submits as-is.** No current host lets a docked plugin write the composer draft, so
234
+ click-to-edit a suggestion before running it is not available — the bar explains this where you'd
235
+ expect editing, and Run submits (#126 tracks the host ask). To change a suggestion: turn autorun
236
+ off and type your own version.
237
+ - **Autorun never fires a `GOAL:` offer** — objective changes are human turns by host design.
238
+ - **Nothing arrives armed.** Autorun is per-session, process-local; restarts and continuations
239
+ start disarmed. The goal is the durable half of the pair.
240
+ - **A blocked or completed goal renders no strip** in the goal bar — if the bar vanished, the goal
241
+ reached a terminal state; `/chapters-prompt state` reports the whole picture (suggestion, model,
242
+ autorun, intent, goal) in one block.
243
+ - **Displacement needs a host seam.** Where `GoalService.disarm` is absent, arming autorun
244
+ degrades safely: the loop yields to the goal driver instead of racing it, and the command's
245
+ reply tells you which behavior you got.
246
+ - **The loop is as good as the prompt model.** Under autorun that model is the director of every
247
+ next step — the single most consequential of the three settings. `/chapters-models <provider>
248
+ <model>` shows its context window before you commit.
@@ -59,7 +59,12 @@ export function goalDirectiveOf(goal) {
59
59
  if (goal === null)
60
60
  return 'No goal is active for this session. Recommend the next step the work itself calls for.';
61
61
  return [
62
- `An ACTIVE GOAL governs this session (revision ${String(goal.revision)}): ${goal.objective.slice(0, 600)}`,
62
+ // #188 invariant: the objective rides WHOLE. The slice(0, 600) that stood here was itself the
63
+ // truncation the contract forbids — real objectives exceed 600 chars (the one this repo's own
64
+ // session ran under was ~1,200), and a director steering against half an objective is the exact
65
+ // hallucination invite zero-truncation exists to forbid. The assembly's budget handles size:
66
+ // the goal block is protected, and a protected set that cannot fit refuses with the numbers.
67
+ `An ACTIVE GOAL governs this session (revision ${String(goal.revision)}): ${goal.objective}`,
63
68
  'The recommended next step MUST advance that goal — a step that merely continues current work does not count.',
64
69
  'If the goal is already accomplished, recommend the step that closes it out (mark it complete) rather than another round.',
65
70
  ].join('\n');
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-state.js","sourceRoot":"","sources":["../src/prompt-state.ts"],"names":[],"mappings":"AAyBA,MAAM,KAAK,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;AAEhF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmC;IAChE,IAAI,OAAO,GAAsB,IAAI,CAAA;IACrC,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,CAAC,IAAI,KAAK,aAAa;YAAE,SAAQ;QACvC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAA;QACvD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;QAC7D,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAAC,OAAO,GAAG,IAAI,CAAC;YAAC,SAAQ;QAAC,CAAC;QAC3G,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAA;QACzD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;Y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,EAAE,IAAI,EAAE,CAAA;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO,CAAA;AAChF,CAAC"}
package/lib/version.d.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  * reader cannot recover later, so it belongs in the bytes. A row in tests asserts this literal equals
7
7
  * `package.json`'s version — the one place a hand-mirrored constant must never be allowed to drift.
8
8
  */
9
- export declare const PLUGIN_VERSION = "0.2.5";
9
+ export declare const PLUGIN_VERSION = "0.2.6";
package/lib/version.js CHANGED
@@ -6,5 +6,5 @@
6
6
  * reader cannot recover later, so it belongs in the bytes. A row in tests asserts this literal equals
7
7
  * `package.json`'s version — the one place a hand-mirrored constant must never be allowed to drift.
8
8
  */
9
- export const PLUGIN_VERSION = '0.2.5';
9
+ export const PLUGIN_VERSION = '0.2.6';
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/dsh-chapters",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "dsh plugin: verbatim chapter archive + zero-token index for small-context models",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",