counterparts 0.3.7 → 0.3.9
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/CHANGELOG.md +272 -0
- package/docs/module-map.md +17 -5
- package/package.json +3 -1
- package/src/adapters/claude-code/CONTRACT.md +113 -65
- package/src/adapters/claude-code/INTERFACE-GAPS.md +20 -16
- package/src/adapters/claude-code/NOTES.md +150 -0
- package/src/adapters/claude-code/bin/hook.ts +96 -34
- package/src/adapters/claude-code/bin/nightly.ts +21 -2
- package/src/adapters/claude-code/bin/runner.ts +58 -47
- package/src/adapters/claude-code/child.ts +203 -0
- package/src/adapters/claude-code/doctor.ts +360 -71
- package/src/adapters/claude-code/embed-client.ts +1 -1
- package/src/adapters/claude-code/envelope.ts +38 -0
- package/src/adapters/claude-code/hooks.ts +258 -1358
- package/src/adapters/claude-code/index.ts +12 -25
- package/src/adapters/claude-code/night-run.ts +27 -14
- package/src/adapters/cli/CONTRACT.md +28 -1
- package/src/adapters/cli/commands.ts +385 -11
- package/src/adapters/cli/coverage.ts +114 -0
- package/src/adapters/cli/desktop.ts +181 -0
- package/src/adapters/cli/dream-core.ts +11 -0
- package/src/adapters/cli/help.ts +14 -0
- package/src/adapters/cli/install.ts +16 -10
- package/src/adapters/cli/mechanisms.ts +23 -6
- package/src/adapters/cli/report.ts +2 -0
- package/src/adapters/cli/self-page.ts +4 -4
- package/src/adapters/cli/settle.ts +63 -0
- package/src/adapters/cli/uninstall.ts +1 -1
- package/src/adapters/{claude-code/config.ts → config.ts} +92 -73
- package/src/adapters/dashboard/registries.ts +29 -1
- package/src/adapters/dashboard/web/README.md +41 -11
- package/src/adapters/dashboard/web/actions.ts +4 -0
- package/src/adapters/dashboard/web/flow.ts +12 -0
- package/src/adapters/dashboard/web/lanes.ts +11 -0
- package/src/adapters/dashboard/web/mechanisms/dreaming/panel.js +2 -1
- package/src/adapters/dashboard/web/mechanisms/emotional/panel.js +2 -2
- package/src/adapters/dashboard/web/mechanisms/episodic-semantic/panel.js +2 -1
- package/src/adapters/dashboard/web/mechanisms/index.js +2 -0
- package/src/adapters/dashboard/web/mechanisms/interference/index.js +8 -4
- package/src/adapters/dashboard/web/mechanisms/interference/panel.js +13 -0
- package/src/adapters/dashboard/web/mechanisms/prospective/panel.js +2 -1
- package/src/adapters/dashboard/web/narrate.ts +62 -4
- package/src/adapters/dashboard/web/pages/health/sections/cycle.js +2 -4
- package/src/adapters/dashboard/web/pages/memories/fold.js +6 -1
- package/src/adapters/dashboard/web/pages/memories/index.js +6 -1
- package/src/adapters/dashboard/web/pages/memories/memories.css +43 -26
- package/src/adapters/dashboard/web/pages/memories/row.js +52 -15
- package/src/adapters/dashboard/web/pages/memories/sections/hold.js +112 -24
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +3 -3
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +75 -15
- package/src/adapters/dashboard/web/pages/memories/state.js +3 -2
- package/src/adapters/dashboard/web/pages/self/sections/dreams.js +2 -2
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +7 -11
- package/src/adapters/dashboard/web/pages/self/sections/page.js +47 -17
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +16 -5
- package/src/adapters/dashboard/web/shared/dates.js +55 -0
- package/src/adapters/dashboard/web/shared/memory-marks.css +1 -0
- package/src/adapters/dashboard/web/shared/memory-marks.js +23 -12
- package/src/adapters/dashboard/web/shared/memory-modal.js +15 -11
- package/src/adapters/dashboard/web/shared/widgets/feel-radar.js +8 -5
- package/src/adapters/dashboard/web/views/archive-words.ts +36 -22
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +39 -0
- package/src/adapters/dashboard/web/views/mechanisms.ts +9 -1
- package/src/adapters/dashboard/web/views/mind.ts +57 -17
- package/src/adapters/dashboard/web/views/search.ts +170 -58
- package/src/adapters/expansions.ts +4 -3
- package/src/adapters/fired.ts +33 -5
- package/src/adapters/hosts.ts +185 -0
- package/src/adapters/lifecycle.ts +1616 -0
- package/src/adapters/log/CONTRACT.md +70 -0
- package/src/adapters/log/INTERFACE-GAPS.md +15 -0
- package/src/adapters/log/NOTES.md +49 -0
- package/src/adapters/log/index.ts +420 -0
- package/src/adapters/mcp/CONTRACT.md +97 -9
- package/src/adapters/mcp/INTERFACE-GAPS.md +25 -10
- package/src/adapters/mcp/NOTES.md +143 -11
- package/src/adapters/mcp/bin/serve.ts +109 -4
- package/src/adapters/mcp/deliberate.ts +95 -6
- package/src/adapters/mcp/index.ts +26 -4
- package/src/adapters/mcp/server.ts +817 -110
- package/src/adapters/mcp/tools.ts +175 -22
- package/src/adapters/mcp/write-up.ts +76 -20
- package/src/adapters/mechanism-evidence.ts +28 -9
- package/src/adapters/scopes.ts +9 -1
- package/src/adapters/sessions.ts +458 -184
- package/src/adapters/snapshots.ts +1 -1
- package/src/adapters/{claude-code/spawn.ts → spawn.ts} +13 -3
- package/src/core/associate/pending.ts +1 -1
- package/src/core/contradictions.ts +607 -0
- package/src/core/counterpart.ts +285 -26
- package/src/core/coverage/CONTRACT.md +77 -0
- package/src/core/coverage/INTERFACE-GAPS.md +46 -0
- package/src/core/coverage/NOTES.md +100 -0
- package/src/core/coverage/index.ts +660 -0
- package/src/core/coverage/tunables.ts +29 -0
- package/src/core/dream/CONTRACT.md +14 -8
- package/src/core/dream/INTERFACE-GAPS.md +6 -0
- package/src/core/dream/NOTES.md +27 -0
- package/src/core/dream/index.ts +90 -29
- package/src/core/dream/mind.ts +14 -13
- package/src/core/dream/reflect.ts +29 -0
- package/src/core/dream/tunables.ts +3 -0
- package/src/core/feelings-wheel.ts +2 -0
- package/src/core/handoff/CONTRACT.md +8 -2
- package/src/core/handoff/NOTES.md +2 -0
- package/src/core/handoff/index.ts +100 -14
- package/src/core/leaving.ts +77 -0
- package/src/core/physics/CONTRACT.md +23 -1
- package/src/core/physics/NOTES.md +10 -0
- package/src/core/physics/index.ts +78 -1
- package/src/core/prospective/CONTRACT.md +4 -1
- package/src/core/prospective/NOTES.md +16 -1
- package/src/core/prospective/index.ts +21 -2
- package/src/core/recall/CONTRACT.md +49 -0
- package/src/core/recall/INTERFACE-GAPS.md +7 -0
- package/src/core/recall/NOTES.md +105 -0
- package/src/core/recall/activate.ts +250 -17
- package/src/core/recall/feeling-ask.ts +216 -0
- package/src/core/recall/gate.ts +15 -3
- package/src/core/recall/index.ts +94 -3
- package/src/core/recall/render.ts +15 -3
- package/src/core/recall/standing.ts +124 -0
- package/src/core/recall/tunables.ts +16 -0
- package/src/core/remember/CONTRACT.md +8 -8
- package/src/core/remember/NOTES.md +41 -0
- package/src/core/remember/index.ts +2 -5
- package/src/core/remember/owes.ts +80 -217
- package/src/core/remember/proposals.ts +31 -2
- package/src/core/revision.ts +60 -3
- package/src/core/schemas/CONTRACT.md +6 -3
- package/src/core/schemas/NOTES.md +15 -0
- package/src/core/self/CONTRACT.md +28 -13
- package/src/core/self/NOTES.md +96 -0
- package/src/core/self/behind.ts +89 -0
- package/src/core/self/briefing.ts +136 -5
- package/src/core/self/episodes.ts +43 -48
- package/src/core/self/identity.ts +42 -6
- package/src/core/self/index.ts +39 -2
- package/src/core/self/writer.ts +26 -26
- package/src/core/sleep/cycle.ts +8 -0
- package/src/core/store/CONTRACT.md +12 -0
- package/src/core/store/NOTES.md +52 -0
- package/src/core/store/cache.ts +1 -1
- package/src/core/store/errors.ts +6 -0
- package/src/core/store/index.ts +364 -0
- package/src/core/store/operational.ts +248 -3
- package/src/core/store/owner-op-seam.ts +65 -1
- package/src/core/time.ts +60 -3
- package/src/core/types.ts +25 -0
- package/src/adapters/claude-code/page-writer.ts +0 -516
|
@@ -10,6 +10,24 @@ same composer, minus the prospective lane and minus anything protected or confid
|
|
|
10
10
|
and this adapter's interpret client put that prompt on the wire until 2026-09-24 (see
|
|
11
11
|
§1a: the sweep no longer interprets here).
|
|
12
12
|
|
|
13
|
+
**Where the parts live (2026-09-30, the host seam).** What a session is to this memory
|
|
14
|
+
whatever the host — the wake's composition and the registry's expectation of it, plain
|
|
15
|
+
reminders, recall for a turn and its row, the boundary (capture, the retroactive-capture
|
|
16
|
+
seal, credit, the orphan tail), the ask's *pacing*, the next-session write-up pointer,
|
|
17
|
+
every registry write, and the worker spawn with its counters — is the shared leaf
|
|
18
|
+
`adapters/lifecycle.ts`: the `HostLifecycle` interface and its one implementation,
|
|
19
|
+
`Lifecycle`. `ClaudeCodeAdapter` **extends** it, so each hook body calls those methods
|
|
20
|
+
where it called its own, in the same order, with the same rows. What stays here is this
|
|
21
|
+
host's: the five event names and their dispatch (`hooks.ts`), the payload translation, the
|
|
22
|
+
JSON envelope and the room it measures (`bin/hook.ts`, `envelope.ts`), the transcript
|
|
23
|
+
reader and the wake-arrival check against it (`transcript.ts`), the Stop ask's words
|
|
24
|
+
(`stopAsk`, `STOP_HUMAN_LINE`), the first-launch question, the parallel run's primacy, the
|
|
25
|
+
update and doctor notices, the dream line and the headless nightly run. The configuration
|
|
26
|
+
(`AdapterConfig`, `loadConfig`) and the worker spawn (`planSpawn`, `spawnDetached`) moved to
|
|
27
|
+
the shared leaves `adapters/config.ts` and `adapters/spawn.ts` the same day; `index.ts`
|
|
28
|
+
still re-exports them. Every registry record the lifecycle writes carries `host:
|
|
29
|
+
"claude-code"` (`sessions.ts#hostOf` reads an absent one the same way).
|
|
30
|
+
|
|
13
31
|
## 1a. Keyless (owner, 2026-09-24)
|
|
14
32
|
|
|
15
33
|
The package reads no API key and calls no model API of its own. Removed that day: the
|
|
@@ -112,16 +130,19 @@ credential — belongs here, discovered at runtime, never assumed by the core.
|
|
|
112
130
|
v1's own assignment file and lets the delivering hooks speak only when that file names the
|
|
113
131
|
slot v2 occupies; it **fails toward mute** where v1 fails toward inject, so the joint
|
|
114
132
|
failure state is v1-only rather than two voices or none. Absent flag ⇒ v2 delivers, which
|
|
115
|
-
is the ordinary build. The flag, the resolver, and the two durable events
|
|
116
|
-
PROMOTE** — they are scaffolding for a comparison, not a feature.
|
|
133
|
+
is the ordinary build. The flag, the resolver, and the two durable events were meant to be
|
|
134
|
+
**retired at PROMOTE** — they are scaffolding for a comparison, not a feature. The parallel
|
|
135
|
+
run ended on 2026-09-21 and nothing retired them: they are **still wired**
|
|
136
|
+
(`hooks.ts#deliveryVerdict`, config `parallel`), and inert on every install that does not
|
|
137
|
+
set the flag. Removing them is a separate change.
|
|
117
138
|
- **The 9,000-byte wake budget is not a constant here or anywhere.** The adapter
|
|
118
139
|
**discovers or asserts** its host's injection ceiling and reports it as a capability;
|
|
119
140
|
the core composes to whatever it is told (scar §2.18). v1's number was 90% of one host's
|
|
120
141
|
cliff, encoded as though it were physiology.
|
|
121
|
-
- **Multi-file API-key rotation and per-key cursor bookkeeping are dropped
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
142
|
+
- **Multi-file API-key rotation and per-key cursor bookkeeping are dropped** — and since
|
|
143
|
+
2026-09-24 there are no keys at all (§1a), so there is nothing to rotate and no credential
|
|
144
|
+
source to configure. (Until then credentials came from one configured source the package
|
|
145
|
+
owned, never an inherited shell environment — scar §2.18.)
|
|
125
146
|
- **Model-seat pins are dropped.** **PROPOSED** — owner call at check-in. Constitution
|
|
126
147
|
line 2 says which seat runs which job is a design choice, never doctrine, and the model
|
|
127
148
|
lineup will have moved. What is **kept** is the bake-off *method* (earned-mechanism #20:
|
|
@@ -193,9 +214,12 @@ row, saying which source answered, existed until the keys were removed — §1a.
|
|
|
193
214
|
checkable values**, never assumed; exceeding one is an event, not silent degradation
|
|
194
215
|
(scar §2.18).
|
|
195
216
|
5. **[M] The spawner pins the child's environment last**, so no caller can leak a run into
|
|
196
|
-
the wrong store (scar §2.13).
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
the wrong store (scar §2.13). (`adapters/spawn.ts` since 2026-09-30, shared so another
|
|
218
|
+
host's adapter can start the same worker.)
|
|
219
|
+
6. ~~**[M] A long call proves it survives this host's ceilings, once, in this host**~~ —
|
|
220
|
+
**moot since 2026-09-24 (§1a).** The package makes no model call of its own, so there is
|
|
221
|
+
no long call to prove; the headless nightly run is `claude -p` — the host's own call,
|
|
222
|
+
under its own watchdog (`night-run.ts`), not one this adapter streams.
|
|
199
223
|
7. **[M] Under observer, the boundary appends no span, resolves no references, spawns no
|
|
200
224
|
worker, and asks for no episode** — and logs that it stood down (scar E7, §2.4).
|
|
201
225
|
8. **[M] The read cursor is per-session and advances only after a successful append**, and
|
|
@@ -422,7 +446,10 @@ row, saying which source answered, existed until the keys were removed — §1a.
|
|
|
422
446
|
smuggled past the limit. `SessionRecord.askedScope` is what makes "once" true
|
|
423
447
|
across a resume or a compaction. The WORDING is advisory; that an unset directory
|
|
424
448
|
raises the question exactly once and that any recorded mode ends it are the
|
|
425
|
-
mechanized parts.
|
|
449
|
+
mechanized parts. Not asked at all in a Claude Desktop Code-tab "No folder"
|
|
450
|
+
scratch workspace (`hosts.ts#isDesktopScratchWorkspace`, 2026-09-30): Desktop
|
|
451
|
+
deletes that directory with the session, and an answer recorded for it would
|
|
452
|
+
outlive the folder it names (event `adapter.scope.ask.skipped`, `scratch-workspace`).
|
|
426
453
|
|
|
427
454
|
22. **[M] TURNING A DIRECTORY BACK ON NEVER REACHES BACK.** A session that lived
|
|
428
455
|
under `off` or `paused` left no session record and no span cursor, because the
|
|
@@ -594,31 +621,23 @@ The MCP server labels a `self_page` write `by: "writer"` when the write NAMES a
|
|
|
594
621
|
that holds that open claim (`self/writer.ts#nightClaimFor`) — not the session the server is
|
|
595
622
|
bound to, so the owner's own page edit in the run's session stays an ordinary amendment;
|
|
596
623
|
and when the run moves past the writer without a write, its next phase answers the night
|
|
597
|
-
`nothing-to-say`. The
|
|
598
|
-
|
|
599
|
-
**
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
as a pinned DATE (`COUNTERPARTS_PAGE_WRITER`), because a windowless child's session id is
|
|
609
|
-
minted by the host after the launcher is gone. **The child's stdout is never parsed into a
|
|
610
|
-
verdict**: what the run did is read from the page's version chain and from the row the tool
|
|
611
|
-
left, and the exit code decides only between "nothing to say" and "could not run". The
|
|
612
|
-
child is told nothing on its prompts (`HookInput.pageWriter`): no dream line, no reminders.
|
|
624
|
+
`nothing-to-say`. The retired ask's registry mark is still read. The wake's `injection`, `bytes` and `sentinel` are untouched by any of it.
|
|
625
|
+
|
|
626
|
+
**Host mode is removed (2026-09-29).** The windowless `claude -p` the boundary's worker
|
|
627
|
+
started for the writer alone (`pageWriter.mode: host`, off by default since the nightly run)
|
|
628
|
+
is gone, with its `COUNTERPARTS_PAGE_WRITER` environment pin, `HookInput.pageWriter` and the
|
|
629
|
+
worker's fifth step. A configuration that still names it loads: `pageWriter.mode: "host"`,
|
|
630
|
+
`pageWriter.timeoutMs` and `pageWriter.command` are ignored and named on doctor's "Old
|
|
631
|
+
settings" line, and the mode reads as `session`. A stored row written with `mode: "host"`
|
|
632
|
+
stays as written and reads as `session`. What the headless nightly run shared with it —
|
|
633
|
+
the pure plan / starter shape, the prompt on STDIN, the SIGTERM → SIGKILL → stop-waiting
|
|
634
|
+
watchdog — is `child.ts` now, unchanged.
|
|
613
635
|
|
|
614
636
|
(Retired with the SessionStart ask, 2026-09-28: the measured-not-predicted sizing against the
|
|
615
637
|
host's ceiling, the durable `skipped` deferral rows, and the first-launch question's
|
|
616
638
|
once-per-night patience. `skipped` rows written before still read as they always did.)
|
|
617
639
|
|
|
618
|
-
**[M]
|
|
619
|
-
the same `finally` as the snapshot, so a day whose sweep broke is still a day that gets
|
|
620
|
-
written about; it never throws; and a failure never fails a wake, a boundary or a session.
|
|
621
|
-
Doctor's `Page writer` line is GREEN when it has never run on a store with no yesterday,
|
|
640
|
+
**[M] Doctor's line.** The `Page writer` line is GREEN when it has never run on a store with no yesterday,
|
|
622
641
|
GREEN on a night that had nothing to say, GREEN when it is off (a deliberate choice; this
|
|
623
642
|
page used to say amber while a page stands, which the code has not done since the S2 review
|
|
624
643
|
— the words follow the code as of 2026-09-28), AMBER on a failure, a refusal, an unreadable
|
|
@@ -626,19 +645,6 @@ page used to say amber while a page stands, which the code has not done since th
|
|
|
626
645
|
without it, and never RED. A night owed because no run started (fewer than three new
|
|
627
646
|
memories, dreaming off or declined) is green: the writer runs inside the nightly run now.
|
|
628
647
|
|
|
629
|
-
**[M] The child gets the day on STDIN and a stance this package chose.** The instruction is
|
|
630
|
-
not in `argv`, where `ps` shows it to every process on the machine, and
|
|
631
|
-
`COUNTERPARTS_OBSERVER` is deleted from the child's environment beside the two session
|
|
632
|
-
variables: a shell that exported it would hand the child an observer store whose
|
|
633
|
-
`self_page` refuses, and the night would then read `nothing-to-say` — fail-closed, but a
|
|
634
|
-
silently wrong answer. A child that ignores SIGTERM is escalated to SIGKILL on its process
|
|
635
|
-
group and then given up on, so the worker cannot be held past its own watchdog.
|
|
636
|
-
|
|
637
|
-
**UNVERIFIED, and named rather than claimed:** no build has started a real `claude -p`.
|
|
638
|
-
Everything above about host mode is proved against a stub executable. What a real machine
|
|
639
|
-
has to answer is keychain access from a background process (`claude setup-token` is the
|
|
640
|
-
documented route, spec §16), which is why `session` is the default.
|
|
641
|
-
|
|
642
648
|
### The headless nightly run (2026-09-29 — working defaults, held lightly)
|
|
643
649
|
|
|
644
650
|
**[M] With the setting `auto` the hook starts the nightly run itself; nothing in the working
|
|
@@ -668,7 +674,7 @@ deny beats the user's own allow rules; `ToolSearch` stays, for hosts that defer
|
|
|
668
674
|
install registers it (`nightMcpConfig`); `--max-turns` (`NIGHT_MAX_TURNS` 60,
|
|
669
675
|
`dreaming.maxTurns`); `--model` only when `dreaming.model` is set. It starts in a NEUTRAL
|
|
670
676
|
directory — the store's own — so no project's CLAUDE.md, hooks or MCP servers load. The
|
|
671
|
-
parent's stance,
|
|
677
|
+
parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are removed;
|
|
672
678
|
this package's values are written last.
|
|
673
679
|
|
|
674
680
|
**[M] Session binding: the run is attributed to the session that started it.** The launch
|
|
@@ -700,24 +706,48 @@ meaning changed, so a store with `auto` written explicitly is reset on the first
|
|
|
700
706
|
this version, recorded (`dream.ask`, `by: upgrade`), and the owner is told once in the
|
|
701
707
|
terminal; "dream on your own" sets it again. Any setting chosen on this version is kept.
|
|
702
708
|
|
|
709
|
+
### One size budget per hook envelope (2026-09-29 — a working default)
|
|
710
|
+
|
|
711
|
+
**[M] Everything one SessionStart or one UserPromptSubmit prints is measured against one
|
|
712
|
+
budget**, the host's cap (`TUNABLES.HOST_OUTPUT_CHARS`, 10,000, counted in bytes; the JSON
|
|
713
|
+
form `ENVELOPE_CHARS`, 9,500), and a crowded envelope gives way in a stated order, first to
|
|
714
|
+
last. Each part that gives way is DEFERRED, never cut, and never spent on a line the session
|
|
715
|
+
did not get.
|
|
716
|
+
- **SessionStart:** the owner's notices (dropped before the JSON envelope passes 9,500) →
|
|
717
|
+
the write-up pointer → the first-launch question (measured against this budget, no
|
|
718
|
+
longer the reported injection budget) → plain reminders due today (they wait for the
|
|
719
|
+
first prompt, unclaimed) → the wake, which is never cut at delivery: it was composed to
|
|
720
|
+
its own budget at the boundary, trimming hints → craft → threads → horizon → identity.
|
|
721
|
+
A reminder reaches the person only in the JSON form, so when one is due and it fits
|
|
722
|
+
beside the wake in that form, the two asks are measured against THAT form (escaped,
|
|
723
|
+
under 9,500) and it is they that give way (review of #285, S2). A wake too full for the
|
|
724
|
+
reminder even alone sends the reminder to the first prompt and the asks use the plain
|
|
725
|
+
room. What gave way is recorded where it happened: each ask's deferral, and the
|
|
726
|
+
delivery for reminders, the dream offer and the update notice
|
|
727
|
+
(`adapter.envelope.gave-way`).
|
|
728
|
+
- **UserPromptSubmit:** the update notice → the turn's recall, sized to what the lines
|
|
729
|
+
below leave (`hooks.ts#recallRoom`, measured in the envelope's own form — every part
|
|
730
|
+
but recall's own escaping, which is a named reserve), trimming itself to that → the dream's lines (a
|
|
731
|
+
hand-back, a carried share, a raise line, the day's offer), reserved because they are
|
|
732
|
+
claimed when composed → plain reminders and the clock line, last.
|
|
733
|
+
- **The plain-stdout fallback is checked:** past the cap, `bin/hook.ts#hostDelivery` says
|
|
734
|
+
so (`overCap`) and the hook records `adapter.envelope.overcap` and prints it on stderr.
|
|
735
|
+
It is a tripwire, not a cut — by then the asks are marked; the budget above is what
|
|
736
|
+
keeps it from firing. On a normal day nothing here changes what is printed.
|
|
737
|
+
|
|
703
738
|
### The next-session write-up (C2, 2026-09-23 — true for now)
|
|
704
739
|
|
|
705
740
|
**[M] A session that ended owing a write-up is written up by the next session that starts
|
|
706
|
-
in its project.** "Owes" is
|
|
741
|
+
in its project.** "Owes" is `core/coverage/`'s rule since 2026-09-30 (read through `remember/owes.ts#planRetention`; before it, B3's predicate `owesWriteUp`, read across
|
|
707
742
|
every scope through `adapters/sessions.ts#writeUpPlan`, the retention pass's own sources),
|
|
708
|
-
narrowed by one shared eligibility (`sessions.ts#waitingForWriteUp`) that the
|
|
709
|
-
door and doctor all read:
|
|
710
|
-
- **
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
terminal nobody has closed (MAJOR 3). **Known, and accepted as the default:** words it
|
|
717
|
-
captured AFTER that answer, at a later Stop that asked nothing, wait with it — invisible
|
|
718
|
-
to the pointer and to doctor's count — until the registry forgets the record, up to a
|
|
719
|
-
week after its last write; then it is pointed at and the fetch carries them
|
|
720
|
-
(INTERFACE-GAPS §17);
|
|
743
|
+
narrowed by one shared eligibility (`sessions.ts#waitingForWriteUp`, `pointable`) that the
|
|
744
|
+
pointer, the door and doctor all read:
|
|
745
|
+
- **not at work** replaced "ended" on 2026-09-30: a session owes once it has ended (a
|
|
746
|
+
registry end or a `session-end` boundary) OR has captured nothing since the date changed.
|
|
747
|
+
There is no silence window any more (the 12-hour `WRITE_UP_SILENCE_MS` and the
|
|
748
|
+
open-and-answered exception of PR #192's MAJOR 3 are gone with the asked / answered
|
|
749
|
+
predicate they guarded): a session open overnight owes the next date, and one at work
|
|
750
|
+
today is `live-session` to the door;
|
|
721
751
|
- with the API sweep on, a crashed session whose words the sweep will still read is the
|
|
722
752
|
sweep's (`sweepOwns`); one whose only words left are in quarantine is not (MAJOR 5);
|
|
723
753
|
- **in its project** means the session holds words filed under this project's scope. A
|
|
@@ -727,6 +757,23 @@ door and doctor all read:
|
|
|
727
757
|
Sessions never pointed at go first, then the least recently pointed at or fetched, oldest
|
|
728
758
|
first among equals, so one session nobody writes up cannot stand in front of the rest.
|
|
729
759
|
|
|
760
|
+
**[M] A short session owes a SHORT write-up (2026-09-29, a working default).** A session
|
|
761
|
+
under the first-ask threshold — never asked — that left text, was not written up and gave
|
|
762
|
+
no answer owed a one-line write-up (#285's `owesShortWriteUp`; since 2026-09-30 a small owed stretch, `coverage/`'s `small`). Same pointer,
|
|
763
|
+
same door, one plain sentence more (`WRITE_UP_SHORT_LINE`: one line is enough, or
|
|
764
|
+
`memories: []`). Full write-ups first, STORE-WIDE (review of #285, S1): a short one is
|
|
765
|
+
offered only when no full debt anywhere in the store is waiting and not yet pointed at
|
|
766
|
+
today, because the day's allowance is one count for the store. It is offered only for a
|
|
767
|
+
session the host's registry knows (one our hooks saw start), so the unbound MCP server's
|
|
768
|
+
shared `mcp` id is passed by, and only for a person's interactive conversation: a session
|
|
769
|
+
whose host entrypoint (`CLAUDE_CODE_ENTRYPOINT`, kept on the registry record) says
|
|
770
|
+
`claude -p`, the Agent SDK, `mcp` or a GitHub action owes no short write-up (N2). It is
|
|
771
|
+
not a retention debt (text ages out with its week; a written-up one keeps it up to 7 days
|
|
772
|
+
after the write-up, like a full debt) and not in doctor's awaiting count. The headless
|
|
773
|
+
nightly run's child and an observer capture nothing, so they owe nothing. When a pointer
|
|
774
|
+
defers for room, its record names what else rode beside the wake, and doctor's advice
|
|
775
|
+
names that rather than the wake's budget (M3).
|
|
776
|
+
|
|
730
777
|
**[M] SessionStart carries a POINTER, not the words** (owner's choice of 2026-09-23,
|
|
731
778
|
INTERFACE-GAPS §15 option (b)). In `HookResult.ask`, after whichever other ask took the
|
|
732
779
|
field, it says how many sessions here are waiting, the oldest one's date, size and "part k
|
|
@@ -735,7 +782,7 @@ of N", and the call that fetches it, naming the ended session once and this sess
|
|
|
735
782
|
MCP door (`mcp/CONTRACT` guarantee 16), at most `WRITE_UP_PART_BYTES` (~24 KB) per
|
|
736
783
|
session, because an MCP result is not under the host's 10,000-character cap on a hook's
|
|
737
784
|
output and the wake is. The pointer is measured against that cap as PLAIN stdout
|
|
738
|
-
(`
|
|
785
|
+
(`HOST_OUTPUT_CHARS` = 10,000; bytes ≥ characters): with no owner notice
|
|
739
786
|
`bin/hook.ts#hostDelivery` prints plain text, and with one it drops the notice before it
|
|
740
787
|
lets the JSON envelope pass `ENVELOPE_MAX_CHARS`. It is NOT held to the reported budget,
|
|
741
788
|
which is what the wake is composed to; a 9,038-byte wake leaves room (tested with host
|
|
@@ -761,13 +808,14 @@ the sweep no interpreter; its gate row says `not-opted-in` and `runner.done` say
|
|
|
761
808
|
next-session`. A crashed session is pointed at like any other. An old `crashWriteUp` value
|
|
762
809
|
is ignored and named in `retired`.
|
|
763
810
|
|
|
764
|
-
**[M] Doctor: `Crash write-up`, and the `Sweep` line.** `Crash write-up`: `next session`
|
|
811
|
+
**[M] Doctor: `Write-ups` (was `Crash write-up`, same key), and the `Sweep` line.** Since 2026-09-30 `Write-ups` reads the coverage ledger — yesterday's state, amber on a stretch owed from yesterday or earlier, the week's lapses (`core/coverage/NOTES.md` §8). Before it, `Crash write-up`: `next session`
|
|
765
812
|
green; amber when a session is finished in one project and waiting on words it left in
|
|
766
813
|
another, naming that project (re-review m-C); amber when the newest pointer outcome is a
|
|
767
814
|
DEFERRAL and sessions are waiting — saying the wake was too full, by how many bytes, and to lower
|
|
768
815
|
`injectionBudgetBytes` by that much (never "open a session", which would defer again);
|
|
769
|
-
|
|
770
|
-
|
|
816
|
+
and (until 2026-09-30, when the `Write-ups` rule above replaced it) amber when a session had
|
|
817
|
+
waited past a 3-day `WRITE_UP_WAIT_DAYS`. Counted with the pointer's own eligibility: a small
|
|
818
|
+
debt the pointer never offers (not a person's session) is named apart, as left to lapse. Never red; not in the session-start reading. `Sweep`: `not-opted-in` —
|
|
771
819
|
and an older build's `no-credential` — is green `next session`.
|
|
772
820
|
|
|
773
821
|
## 6. Scars honored
|
|
@@ -782,9 +830,9 @@ charter).
|
|
|
782
830
|
|
|
783
831
|
## 7. Open questions
|
|
784
832
|
|
|
785
|
-
1.
|
|
786
|
-
|
|
787
|
-
|
|
833
|
+
1. ~~**Does the host offer an in-the-moment jot channel at all?**~~ **ANSWERED.** Not
|
|
834
|
+
through a hook: the jot channel is the MCP adapter's `note` tool (`mcp/CONTRACT.md`),
|
|
835
|
+
which the model calls mid-session; no hook calls `submitJot`.
|
|
788
836
|
2. **What is the honest bound on the orphanable tail** — the stretch after the last
|
|
789
837
|
session-ending event nobody can ask about — in this host specifically? v1 bounded it by
|
|
790
838
|
its re-ask threshold and logged it, which is the right shape; the number is host-local.
|
|
@@ -99,9 +99,11 @@ entrance and prove the gate battery covers each (encode's caller-side half)."
|
|
|
99
99
|
| `sweepFallback` → apply | `bridge.gateSweepChunk()` (CHUNK level) | `counterpart.ts` `applySweep()` |
|
|
100
100
|
|
|
101
101
|
**Not yet covered, and named so it is not mistaken for covered:** anything an
|
|
102
|
-
adapter other than this one adds. `mcp/`, `cli/` and `dashboard/`
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
adapter other than this one adds. `mcp/`, `cli/` and `dashboard/` exist now, and
|
|
103
|
+
reach the core through the same `Counterpart` entrances above (the MCP tools
|
|
104
|
+
through `submitSessionEnd`, `submitJot` and `appendEpisode`); an entrance one of
|
|
105
|
+
them adds is the thing to extend this table with, and the totality test in
|
|
106
|
+
`test/claude-code.test.ts` is the shape to copy.
|
|
105
107
|
|
|
106
108
|
## 5. `kind` defaults in two places (SEAMS queued item 9, still open)
|
|
107
109
|
|
|
@@ -177,11 +179,9 @@ into the wrapper.
|
|
|
177
179
|
|
|
178
180
|
## Host-side gaps — this adapter's own open questions (CONTRACT §7)
|
|
179
181
|
|
|
180
|
-
1. **Is there a jot channel in this host
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
likely home (`mcp/CONTRACT.md`: note, recall, status). Cost to the turn:
|
|
184
|
-
unmeasured.
|
|
182
|
+
1. **Is there a jot channel in this host? — CLOSED.** Yes, and not through a
|
|
183
|
+
hook: the MCP adapter's `note` tool is the jot channel (`mcp/CONTRACT.md`),
|
|
184
|
+
which the model calls mid-session. No hook calls `submitJot`.
|
|
185
185
|
2. **The orphanable tail is measured, not bounded by anything host-specific.**
|
|
186
186
|
`noteOrphanTail` runs on `session-end` and `pre-compact`, and its bound is
|
|
187
187
|
`self/`'s re-ask thresholds — a memory number, not a host one. The host-local
|
|
@@ -195,11 +195,10 @@ into the wrapper.
|
|
|
195
195
|
primary path in fact: it ran after every Stop, and on 2026-09-04 one evening's
|
|
196
196
|
sweeps billed 13 chunks and minted 61 memories beside 34 authored ones.
|
|
197
197
|
`pre-compact` is still wired and still captures; it is not by itself a crash.
|
|
198
|
-
4. **Long-call survival
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
test here is entitled to make.
|
|
198
|
+
4. **Long-call survival — MOOT since 2026-09-24 (keyless, CONTRACT §1a).** The
|
|
199
|
+
package makes no model call of its own, so there is no long call to prove and
|
|
200
|
+
no credential to prove it with (CONTRACT §5 G6 is struck).
|
|
201
|
+
`socketLifetimeMs` is still a reported capability with no reporter.
|
|
203
202
|
5. **`executionCeilingMs` has no consumer.** It is reported and checkable; no
|
|
204
203
|
code compares against it yet, because every foreground path is an appender and
|
|
205
204
|
the heavy work is already detached. When something in the foreground can grow,
|
|
@@ -606,9 +605,14 @@ That is a different mechanism, not a wider parameter, and it is not built.
|
|
|
606
605
|
fourth severity is the honest shape, and it touches the report, the JSON, the
|
|
607
606
|
dashboard and every caller that partitions on three.
|
|
608
607
|
|
|
609
|
-
## 12. Nobody has run a windowless host session, and this adapter cannot prove one from inside the suite (2026-09-20, S2)
|
|
608
|
+
## 12. Nobody has run a windowless host session, and this adapter cannot prove one from inside the suite (2026-09-20, S2) — CLOSED 2026-09-29: host mode removed
|
|
610
609
|
|
|
611
|
-
|
|
610
|
+
**Closed by removal.** The page writer's host mode was removed on 2026-09-29 (the nightly
|
|
611
|
+
run carries the writer). The questions below now belong to the headless nightly run, which
|
|
612
|
+
starts a windowless `claude -p` of its own (`night-run.ts`, the "Unproven until a real run"
|
|
613
|
+
list in NOTES 2026-09-29); they are kept as they were written.
|
|
614
|
+
|
|
615
|
+
Host mode was the owner's pick for the nightly page writer, and every part of it that is
|
|
612
616
|
this package's — the plan, the argument and environment shape, the watchdog, the claim, how
|
|
613
617
|
the outcome is read back — is under test against a stub executable. Three things are not,
|
|
614
618
|
and cannot be without a real machine and a real login:
|
|
@@ -638,7 +642,7 @@ known to work.
|
|
|
638
642
|
|
|
639
643
|
**Closed for the mechanism by #189 (roadmap B3, the owner's ruling of 2026-09-23).** The
|
|
640
644
|
writer's night is now decided on the machine's LOCAL calendar — `core/self/calendar.ts`
|
|
641
|
-
and `self/writer.ts#pageWriterNight`, one function shared by `Self`,
|
|
645
|
+
and `self/writer.ts#pageWriterNight`, one function shared by `Self`, the nightly run and
|
|
642
646
|
doctor's Page writer line — so from US Pacific the night rolls over at local midnight,
|
|
643
647
|
not at 5 p.m. East of UTC the night waits for its UTC date to close
|
|
644
648
|
(`pageWriterAbout`: `min(local yesterday, UTC yesterday)`), because of what remains below.
|
|
@@ -1730,3 +1730,153 @@ Working defaults, held lightly (dream NOTES has the why).
|
|
|
1730
1730
|
- **Still open:** the dashboard's vocabulary does not name `dream.night` or the two latch
|
|
1731
1731
|
events yet (every reader guards unknown names). The host-mode page writer's child has the
|
|
1732
1732
|
same exposure finding 3 describes and is not locked down here.
|
|
1733
|
+
|
|
1734
|
+
## 2026-09-29 — doctor's Contradictions and Upgrade to v10 lines
|
|
1735
|
+
|
|
1736
|
+
`contradictionFindings`: green, always printed — over the last 7 lived days, how many
|
|
1737
|
+
pairs a dream flagged, how many settled and how (changed, corrected, open) and by whom
|
|
1738
|
+
(sessions, dreams, reflections, the page writer, the owner), how many undone; standing
|
|
1739
|
+
now, how many open and how many unsettled with both memories live (pointing at
|
|
1740
|
+
`counterparts settle`). `upgradeV10Findings`: what the v10 carry found (flags, pairs,
|
|
1741
|
+
already raised, still standing); silent on a store born at v10. Both are read-only table
|
|
1742
|
+
and meta reads. The awake raise line (`dreams.raiseLines`) now names the pair's id and
|
|
1743
|
+
the `note` settle.
|
|
1744
|
+
|
|
1745
|
+
After the review of #284: the Contradictions line counts a pair recorded while pressure
|
|
1746
|
+
builds on a core memory (`source` pressure) as flagged, beside a dream's flags.
|
|
1747
|
+
|
|
1748
|
+
## 2026-09-29 — cleanup batch: host mode out, one envelope budget, short write-ups
|
|
1749
|
+
|
|
1750
|
+
Working defaults, held lightly.
|
|
1751
|
+
|
|
1752
|
+
- **Host mode removed.** `page-writer.ts` is gone; what the headless nightly run shared
|
|
1753
|
+
with it (the plan / starter shape, `startChild`, the kill and reap graces, the host
|
|
1754
|
+
command, the permission mode) moved unchanged to `child.ts`, with its own test
|
|
1755
|
+
(`test/child.test.ts`, the SIGTERM-ignoring stub included). Also gone: the worker's step
|
|
1756
|
+
5 and its `configPath` / `startPageWriter` inputs, `COUNTERPARTS_PAGE_WRITER` (the
|
|
1757
|
+
MCP door no longer reads it, the night child no longer scrubs it), `HookInput.pageWriter`,
|
|
1758
|
+
`PAGE_WRITER_MS`, and doctor's host-mode fix text. Old configurations load:
|
|
1759
|
+
`pageWriter.mode: "host"`, `pageWriter.timeoutMs` and `pageWriter.command` go to the
|
|
1760
|
+
old-settings line (`retired`), never also to the block's `ignored`, and the mode reads
|
|
1761
|
+
`session`. The dashboard's why-map still carries the `host-mode` / `not-host-mode`
|
|
1762
|
+
labels; nothing produces them now (a dashboard follow-up).
|
|
1763
|
+
- **One size budget per envelope.** The order, first to go → last: SessionStart —
|
|
1764
|
+
notices → write-up pointer → first-launch question → plain reminders (to the first
|
|
1765
|
+
prompt, unclaimed) → the wake (never cut here). UserPromptSubmit — update notice → the
|
|
1766
|
+
turn's recall (`recallRoom`: the configured budget, or less when the clock, plain lines,
|
|
1767
|
+
dream lines and person lines leave less; the JSON envelope's 9,500 when a person-facing
|
|
1768
|
+
line rides the prompt) → the dream's lines → plain reminders and the clock. The audit's
|
|
1769
|
+
"`nowLine` and plain reminders aren't reserved" was already untrue at SessionStart (`sent`
|
|
1770
|
+
counted them since #271); what changed there is that the first-launch question is now
|
|
1771
|
+
measured against the host's cap, like the pointer, instead of the reported injection
|
|
1772
|
+
budget — a second ceiling. The dream's lines are reserved, not shed, because they are
|
|
1773
|
+
claimed when composed (a hand-back, a carried share, a raise line); shedding them after
|
|
1774
|
+
the claim would lose them. `adapter.envelope.gave-way` names what gave way.
|
|
1775
|
+
- **The fallback is a tripwire.** `hostDelivery`'s plain form is now measured against
|
|
1776
|
+
`HOST_OUTPUT_CHARS`; past it the delivery carries `overCap`, the hook records
|
|
1777
|
+
`adapter.envelope.overcap` and prints it on stderr. It does not cut: by then the asks are
|
|
1778
|
+
marked, and the pure function cannot tell a wake from an ask. What can still reach it
|
|
1779
|
+
is a wake composed past the cap by a misconfigured budget.
|
|
1780
|
+
- **Short write-ups.** The pointer offers a session under the first-ask threshold a
|
|
1781
|
+
one-line write-up (`WRITE_UP_SHORT_LINE`). Order: a full debt not yet pointed at today,
|
|
1782
|
+
then short ones, then a full one already pointed at today — a plain "full before short"
|
|
1783
|
+
would let one unwritten full session hold every short one back for ever. A short debt is
|
|
1784
|
+
offered only for a session the registry knows, so the unbound MCP server's shared `mcp`
|
|
1785
|
+
id is passed by; it is not in doctor's awaiting count (it ages out in a week, and
|
|
1786
|
+
`WRITE_UP_WAIT_DAYS` is 3, so counting it would turn doctor amber for a debt that clears
|
|
1787
|
+
itself).
|
|
1788
|
+
- **Unproven:** how often short pointers fire on the owner's machine (every quick session,
|
|
1789
|
+
including any `claude` sessions other tools start in a project with hooks on, now owes
|
|
1790
|
+
one line); whether one-line answers are worth the pointer's room.
|
|
1791
|
+
|
|
1792
|
+
## 2026-09-29, later — the fix round after the review of #285
|
|
1793
|
+
|
|
1794
|
+
(`docs/adversarial-review-pr285-2026-09-29.md`; the probes are regression tests now.)
|
|
1795
|
+
|
|
1796
|
+
- **S1, the short write-up waits for the whole store.** The allowance is one count for the
|
|
1797
|
+
store, so a short debt is offered only when no full debt in ANY project is waiting and
|
|
1798
|
+
not yet pointed at today (`owedWriteUps`' `fullFirst`). Named cost: a full debt in a
|
|
1799
|
+
project nobody reopens holds every short one back; doctor turns amber on it after
|
|
1800
|
+
`WRITE_UP_WAIT_DAYS`, and the short ones age out with their week, as before.
|
|
1801
|
+
- **S2, the SessionStart order is real now.** A reminder reaches the person only in the
|
|
1802
|
+
JSON form, so when one is due and fits beside the wake in that form, the question and the
|
|
1803
|
+
pointer are measured against it (`EnvelopeRoom`, `envelope.ts` — the one envelope shape
|
|
1804
|
+
both `hooks.ts` and `bin/hook.ts` use). Measured: on a 9,000-byte wake of ordinary
|
|
1805
|
+
lines the JSON form of the wake and one reminder is already past 9,500, so on the
|
|
1806
|
+
owner's near-full wake a reminder cannot be shown at SessionStart whatever the asks do;
|
|
1807
|
+
it moves to the first prompt, which was already the behaviour, and the asks use the plain
|
|
1808
|
+
room. The ordering shows on a smaller wake (tested by walking wake sizes through the real
|
|
1809
|
+
`deliverTurn`). `adapter.envelope.gave-way` is now recorded where the giving way
|
|
1810
|
+
happens: each ask's deferral (`question`, `pointer`) and the delivery (`plain`, `dream`,
|
|
1811
|
+
`update-notice`, through the `noteGaveWay` door). The adapter no longer guesses it.
|
|
1812
|
+
- **M2, recall's room is measured.** In the JSON form, `recallRoom` measures the escaped
|
|
1813
|
+
envelope of the clock, the context and the person's lines, keys included. The one
|
|
1814
|
+
estimate left is recall's own escaping (`ENVELOPE_ESCAPE_RESERVE`, 200): its text does
|
|
1815
|
+
not exist when its budget is set, and composing twice would spend its fires twice. Plain
|
|
1816
|
+
stdout reserves nothing.
|
|
1817
|
+
- **M3, doctor names the cause.** A deferred pointer's record carries `beside` (the
|
|
1818
|
+
question, the reminders) and `limit`; doctor says "the wake and the first-launch question
|
|
1819
|
+
left …" and advises lowering `injectionBudgetBytes` only if it keeps happening.
|
|
1820
|
+
- **N2, entrypoints.** Read from the 2.1.285 host binary (strings, not docs): the host sets
|
|
1821
|
+
`CLAUDE_CODE_ENTRYPOINT` at startup — `cli` for a terminal session, `sdk-cli` when the
|
|
1822
|
+
start is non-interactive (`-p`/`--print`, `--init-only`, `--sdk-url`, or stdout not a
|
|
1823
|
+
TTY), `sdk-ts` / `sdk-py` from the Agent SDK, `mcp` for `claude mcp serve`,
|
|
1824
|
+
`claude-code-github-action` under `CLAUDE_CODE_ACTION`; an inherited `cli` becomes
|
|
1825
|
+
`sdk-cli` for a non-interactive start. This session's own Bash environment carries
|
|
1826
|
+
`CLAUDE_CODE_ENTRYPOINT=cli`, so the host exports it to children. What is NOT verified:
|
|
1827
|
+
a hook process's environment on a real `claude -p` run (running one here would fire the
|
|
1828
|
+
owner's live hooks). The hook records the value on the session's registry record; a
|
|
1829
|
+
short debt whose entrypoint is one of the five non-interactive names is not offered.
|
|
1830
|
+
Unknown or absent reads as a person's. A long `claude -p` session still owes a full
|
|
1831
|
+
write-up; only the short offer is skipped.
|
|
1832
|
+
- **N1** (the first-launch question can now fit beside a full wake): kept as built, on
|
|
1833
|
+
Mike's word — once per session in each unscoped directory until he answers there, the
|
|
1834
|
+
original G41 design.
|
|
1835
|
+
|
|
1836
|
+
## 2026-09-30 — the wake keeps up (self NOTES §30)
|
|
1837
|
+
|
|
1838
|
+
- **The worker** calls `Counterpart.refreshWake({ at: today })` after its cycle (step 3a in
|
|
1839
|
+
`bin/runner.ts`), in its own try: nothing marked, nothing rendered; a failure is a
|
|
1840
|
+
`runner.failed` row with `step: "wake"` and the mark stays. The re-fired Stop after a
|
|
1841
|
+
session answers the ask still spawns a worker (`stop()`: `askAtStop` is skipped, the
|
|
1842
|
+
spawn is not), which is what catches a write-up; tested.
|
|
1843
|
+
- **The nightly process** refreshes with `trigger: "run-end"` after the child returns,
|
|
1844
|
+
whatever the run's state, in the `finally` of the store read in `runNight`, before the
|
|
1845
|
+
run's row is written. `openNightCounterpart` already carried the host's budget; a config
|
|
1846
|
+
without one refuses the render, as `rebrief` does. The child is quiet, so no turn-end of
|
|
1847
|
+
its own follows the page it wrote — the run's end is the trigger that matters under
|
|
1848
|
+
`auto`, where the day's first worker renders before the writer writes (tested with a
|
|
1849
|
+
`start` that runs the worker first).
|
|
1850
|
+
- **Delivery.** The delivery check compares each session's wake with the sentinel recorded
|
|
1851
|
+
at ITS start, so a session that woke before a rebuild still reads `delivered` (tested).
|
|
1852
|
+
|
|
1853
|
+
## 2026-09-30 — the host seam (PR A of the host groundwork)
|
|
1854
|
+
|
|
1855
|
+
- **What moved.** The host-neutral half of `ClaudeCodeAdapter` is `adapters/lifecycle.ts`:
|
|
1856
|
+
the `HostLifecycle` interface and its implementation `Lifecycle` — `composeWake` (the
|
|
1857
|
+
wake plus the registry's sentinel), `plainFor` / `claimPlain` / `nowLine`, `recallTurn`
|
|
1858
|
+
(recall plus the `recall.delivered` row), `captureBoundary` (capture, the seal, credit,
|
|
1859
|
+
the `adapter.boundary` row), `noteTail`, `paceAsk` (the pacer and the `adapter.ask` row;
|
|
1860
|
+
the words stay here in `stopAsk`), `deliverWriteUpAsk`, `noteSession`, `spawnWorker` and
|
|
1861
|
+
its counters. `config.ts` and `spawn.ts` became the shared leaves `adapters/config.ts`
|
|
1862
|
+
and `adapters/spawn.ts`. The bodies moved verbatim; only their `this.` receiver changed.
|
|
1863
|
+
- **Extends, not holds.** `ClaudeCodeAdapter extends Lifecycle`. Two tests reach into the
|
|
1864
|
+
adapter by name (`envelope-budget.test.ts` stubs `a.dreamLines`, `write-up.test.ts`
|
|
1865
|
+
binds `a.deliverWriteUpAsk`); a held lifecycle would have made both stubs inert, and a
|
|
1866
|
+
refactor that has to change a test to pass is not a proof of no change.
|
|
1867
|
+
- **What stayed.** The re-fired Stop is refused in `askAtStop` before the pacer is asked
|
|
1868
|
+
(it was the first line of the old `askAtStop`'s try; same effect). The first-launch
|
|
1869
|
+
question, the wake-arrival check, the dream line and the headless nightly run, the
|
|
1870
|
+
update and doctor notices, primacy and every envelope measurement are still here —
|
|
1871
|
+
they are Claude Code's, or not yet needed by a second host.
|
|
1872
|
+
- **On disk.** Every registry record the lifecycle writes now carries `host:
|
|
1873
|
+
"claude-code"`; a record without one reads the same (`sessions.ts#hostOf`). That is the
|
|
1874
|
+
only on-disk change. A neutral config name (`counterparts.json`, read first when present)
|
|
1875
|
+
was built and taken back out before merge: the default path's identity checks
|
|
1876
|
+
(`throwawayDefaultRefusal`, `isNamed`, the console's `=== defaultConfigPath` tests)
|
|
1877
|
+
assume one fixed default, and a default that depends on which files exist let a named
|
|
1878
|
+
config slip past them. Nothing needs the new name yet; the config stays `claude-code.json`.
|
|
1879
|
+
- **Left for the Desktop work (PR B).** The worker script (`bin/runner.ts`) and the
|
|
1880
|
+
nightly run's planner still live here; a host that starts either from the MCP server
|
|
1881
|
+
needs their paths, not an import. `deliverWriteUpAsk`'s default limit is still this
|
|
1882
|
+
host's `HOST_OUTPUT_CHARS`; a tool result has no such cap and should pass its own.
|