counterparts 0.3.6 → 0.3.8
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 +258 -0
- package/docs/module-map.md +5 -1
- package/package.json +1 -1
- package/src/adapters/claude-code/CONTRACT.md +138 -55
- package/src/adapters/claude-code/INTERFACE-GAPS.md +8 -3
- package/src/adapters/claude-code/NOTES.md +190 -0
- package/src/adapters/claude-code/bin/hook.ts +155 -33
- package/src/adapters/claude-code/bin/nightly.ts +95 -0
- package/src/adapters/claude-code/bin/runner.ts +55 -44
- package/src/adapters/claude-code/child.ts +203 -0
- package/src/adapters/claude-code/config.ts +146 -69
- package/src/adapters/claude-code/doctor.ts +556 -70
- package/src/adapters/claude-code/envelope.ts +38 -0
- package/src/adapters/claude-code/hooks.ts +455 -59
- package/src/adapters/claude-code/index.ts +25 -18
- package/src/adapters/claude-code/night-run.ts +515 -0
- package/src/adapters/cli/CONTRACT.md +9 -0
- package/src/adapters/cli/commands.ts +286 -6
- package/src/adapters/cli/coverage.ts +100 -0
- package/src/adapters/cli/dream-core.ts +36 -6
- package/src/adapters/cli/help.ts +6 -0
- package/src/adapters/cli/mechanisms.ts +23 -6
- package/src/adapters/cli/self-page.ts +4 -4
- package/src/adapters/cli/settle.ts +63 -0
- package/src/adapters/dashboard/registries.ts +29 -1
- package/src/adapters/dashboard/web/README.md +84 -39
- package/src/adapters/dashboard/web/app.html +0 -3
- 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/health.css +2 -0
- package/src/adapters/dashboard/web/pages/health/sections/cycle.js +2 -4
- package/src/adapters/dashboard/web/pages/health/sections/mechanisms.js +9 -0
- package/src/adapters/dashboard/web/pages/home/home.css +7 -4
- package/src/adapters/dashboard/web/pages/home/index.js +4 -3
- package/src/adapters/dashboard/web/pages/home/sections/feel.js +9 -19
- package/src/adapters/dashboard/web/pages/home/sections/map.js +6 -5
- package/src/adapters/dashboard/web/pages/memories/index.js +35 -19
- package/src/adapters/dashboard/web/pages/memories/memories.css +72 -65
- package/src/adapters/dashboard/web/pages/memories/row.js +75 -25
- package/src/adapters/dashboard/web/pages/memories/sections/feel.js +13 -173
- package/src/adapters/dashboard/web/pages/memories/sections/hold.js +122 -36
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +70 -36
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +147 -90
- package/src/adapters/dashboard/web/pages/memories/sections/tools.js +5 -4
- package/src/adapters/dashboard/web/pages/memories/state.js +12 -5
- package/src/adapters/dashboard/web/pages/self/index.js +2 -0
- 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/map.js +417 -116
- 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/pages/self/self.css +23 -20
- package/src/adapters/dashboard/web/shared/dates.js +55 -0
- package/src/adapters/dashboard/web/shared/memory-marks.css +2 -4
- package/src/adapters/dashboard/web/shared/memory-marks.js +24 -27
- package/src/adapters/dashboard/web/shared/memory-modal.js +58 -33
- package/src/adapters/dashboard/web/shared/modal.css +5 -0
- package/src/adapters/dashboard/web/shared/voice.js +18 -0
- package/src/adapters/dashboard/web/shared/widgets/feel-radar.js +140 -0
- package/src/adapters/dashboard/web/views/archive-words.ts +1 -1
- 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/memories.ts +98 -7
- package/src/adapters/dashboard/web/views/memory-words.ts +29 -1
- package/src/adapters/dashboard/web/views/memory.ts +3 -2
- package/src/adapters/dashboard/web/views/mind.ts +57 -17
- package/src/adapters/dashboard/web/views/search.ts +170 -58
- package/src/adapters/fired.ts +29 -1
- 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 +11 -0
- package/src/adapters/mcp/INTERFACE-GAPS.md +8 -0
- package/src/adapters/mcp/NOTES.md +63 -0
- package/src/adapters/mcp/bin/serve.ts +23 -1
- package/src/adapters/mcp/deliberate.ts +119 -7
- package/src/adapters/mcp/index.ts +7 -2
- package/src/adapters/mcp/server.ts +296 -60
- package/src/adapters/mcp/tools.ts +116 -23
- package/src/adapters/mcp/write-up.ts +5 -9
- package/src/adapters/mechanism-evidence.ts +28 -9
- package/src/adapters/sessions.ts +158 -172
- package/src/core/associate/CONTRACT.md +33 -4
- package/src/core/associate/INTERFACE-GAPS.md +70 -0
- package/src/core/associate/NOTES.md +220 -1
- package/src/core/associate/buffer.ts +12 -9
- package/src/core/associate/contiguity.ts +81 -0
- package/src/core/associate/edges.ts +117 -6
- package/src/core/associate/index.ts +224 -7
- package/src/core/associate/pending.ts +7 -3
- package/src/core/associate/spread.ts +154 -69
- package/src/core/associate/tunables.ts +75 -5
- package/src/core/contradictions.ts +607 -0
- package/src/core/counterpart.ts +671 -34
- 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 +93 -21
- package/src/core/dream/INTERFACE-GAPS.md +6 -0
- package/src/core/dream/NOTES.md +94 -2
- package/src/core/dream/index.ts +1402 -236
- package/src/core/dream/mind.ts +123 -41
- package/src/core/dream/reflect.ts +321 -96
- package/src/core/dream/slices.ts +217 -0
- package/src/core/dream/tunables.ts +75 -12
- package/src/core/fit/CONTRACT.md +80 -0
- package/src/core/fit/INTERFACE-GAPS.md +16 -0
- package/src/core/fit/NOTES.md +37 -0
- package/src/core/fit/index.ts +499 -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/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 +23 -2
- package/src/core/recall/INTERFACE-GAPS.md +17 -0
- package/src/core/recall/NOTES.md +87 -0
- package/src/core/recall/activate.ts +320 -62
- package/src/core/recall/gate.ts +73 -4
- package/src/core/recall/index.ts +65 -10
- package/src/core/recall/render.ts +26 -3
- package/src/core/recall/session.ts +8 -0
- package/src/core/recall/standing.ts +124 -0
- package/src/core/recall/tunables.ts +30 -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/retrieval.ts +15 -6
- 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 +86 -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 +20 -2
- package/src/core/self/writer.ts +26 -26
- package/src/core/sleep/NOTES.md +11 -0
- package/src/core/sleep/decay.ts +16 -1
- package/src/core/sleep/prune.ts +16 -1
- package/src/core/store/CONTRACT.md +12 -0
- package/src/core/store/NOTES.md +52 -0
- package/src/core/store/errors.ts +6 -0
- package/src/core/store/index.ts +465 -2
- 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 -482
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,263 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.8 — 2026-09-30
|
|
4
|
+
|
|
5
|
+
When two memories disagree, Claude can now say how: the fact changed, the old one was
|
|
6
|
+
wrong, or it's still open, with a trail and an undo. What hasn't been written up is
|
|
7
|
+
counted in one place, and a debt lapses after a few days of use instead of waiting
|
|
8
|
+
forever. The wake keeps up with the day, a process log records what the hooks, the
|
|
9
|
+
worker, the nightly run and the memory server did, and the dashboard takes the 09-30
|
|
10
|
+
feedback. **The store's format changes (v9 → v10).**
|
|
11
|
+
|
|
12
|
+
**The format change, and why every session must be closed.** The first Claude Code
|
|
13
|
+
session after installing copies the store (as every upgrade since 0.3.1 has) and
|
|
14
|
+
upgrades it: two new tables for contradictions and their trail, and one new column on
|
|
15
|
+
every memory (`fade`, 1 unless a memory was settled as changed). Every contradiction a
|
|
16
|
+
dream flagged and nobody settled is carried onto the new table, with its "already
|
|
17
|
+
raised" mark. Nothing else changes, and all memories come through. Until that first
|
|
18
|
+
session, `counterparts doctor` and the dashboard can't read the store yet (a v9 store is
|
|
19
|
+
older than they read) and say so; the next session's hook does the upgrade. **Close
|
|
20
|
+
every Claude Code session before installing.** A v10 store can't be opened by 0.3.7:
|
|
21
|
+
anything of 0.3.7's that opens it afterwards refuses at once (`SCHEMA_AHEAD`), and its
|
|
22
|
+
hooks stand down. But a session that was already open when you installed keeps its own
|
|
23
|
+
memory server, still running 0.3.7's code with the store already open, and that open was
|
|
24
|
+
the one place the check ran. Its memory tools re-read the format on every call and
|
|
25
|
+
refuse ("Counterparts was updated and this server is still running the old version, so
|
|
26
|
+
this tool did nothing. Run /mcp and Reconnect to load it."), so in a session opened
|
|
27
|
+
before the install, don't rely on the memory tools: quit it and start a new one, or run
|
|
28
|
+
`/mcp` → Reconnect. The hooks are fresh processes at every event, so they run the new
|
|
29
|
+
code at once and are fine. To go back to 0.3.7 you reinstall it and put back the copy
|
|
30
|
+
the upgrade took; anything remembered since is lost.
|
|
31
|
+
|
|
32
|
+
Contradictions.
|
|
33
|
+
|
|
34
|
+
- **Three ways a disagreement is settled, each with its own outcome.** When Claude
|
|
35
|
+
writes a memory that `updates` an older one, it says `how` (`changed` is the default):
|
|
36
|
+
- **changed** — true then, not now. The older memory takes one strength cut (half) and
|
|
37
|
+
stays recallable, labelled `Earlier (now [id])`. A later use resets its fading as
|
|
38
|
+
always but doesn't lift the cut.
|
|
39
|
+
- **corrected** — the older one was wrong. It is put away (archived): it leaves recall
|
|
40
|
+
and stays readable by its own id, `Corrected by [id]`. Nothing is deleted.
|
|
41
|
+
- **open** — both stand, and recall shows each with `(disagrees with [id])`.
|
|
42
|
+
- Beliefs, the core, current-state and protected memories keep their own paths; a `how`
|
|
43
|
+
sent at one of those is not applied, and the answer says which path ran.
|
|
44
|
+
- **Claude notices at write time.** A `note` or `session_end` memory comes back with up to
|
|
45
|
+
three of its nearest live memories and one line inviting a settle, if one of them
|
|
46
|
+
disagrees. No model call.
|
|
47
|
+
- **Settling a pair that already exists**, from anywhere: `note` with `settle` (no new
|
|
48
|
+
memory needed), the dream's new `settle` action (a reason is required), the
|
|
49
|
+
reflection's `settle` phase (only on memories it was shown), and yours:
|
|
50
|
+
**`counterparts settle`** lists what's unsettled and what was settled lately, settles
|
|
51
|
+
one (`--pair … --holds … --how … --why "…"`), or undoes one (`--undo`). Settling an
|
|
52
|
+
existing pair rewrites no memory.
|
|
53
|
+
- **Every settle and every undo leaves a trail row**: who (a session, a dream, the
|
|
54
|
+
reflection, you), how, why, which memories, and when. An undo puts back exactly what
|
|
55
|
+
the settle did: the strength, the archive, the flags it closed. Removing the memory
|
|
56
|
+
that settled a pair puts the other one back.
|
|
57
|
+
- **Unsettled pairs are labelled.** The older memory of a pair nobody has settled reads
|
|
58
|
+
`Unsettled — may be out of date, see [id]`, in recall and in the wake's lanes. Dream
|
|
59
|
+
flags are raised once awake, as before, now naming the pair and the `note` settle.
|
|
60
|
+
- **A replaced memory is readable by its own id**, with `replaced by [id]`; `counterparts
|
|
61
|
+
ask` prints a memory's standing above its words.
|
|
62
|
+
- Doctor has a **Contradictions** line (the last 7 days: flagged, settled by kind and by
|
|
63
|
+
whom, undone, still open or unsettled) and an **Upgrade to v10** line.
|
|
64
|
+
`counterparts mechanisms` counts reconsolidation as built and interference as partly
|
|
65
|
+
built.
|
|
66
|
+
|
|
67
|
+
What is written up, and what is owed.
|
|
68
|
+
|
|
69
|
+
- **One place says what hasn't been written up yet.** A piece of conversation counts as
|
|
70
|
+
written up only when something claims it: a memory from it, a write-up answered
|
|
71
|
+
"nothing new" (`memories: []`), or a chapter. A handoff alone doesn't. Each claim is
|
|
72
|
+
for the project it was made in.
|
|
73
|
+
- **One rule for what a session owes**: at least 3 unwritten pieces spanning 15 minutes
|
|
74
|
+
or more, in a session that has ended or captured nothing since the date changed. It
|
|
75
|
+
replaces the old asked/answered rule and the 12-hour silence window. Short sessions
|
|
76
|
+
(1–2 pieces, or 3 or more inside 15 minutes) owe nothing. A small debt (under 6 pieces)
|
|
77
|
+
gets the same pointer with one more sentence: "It was a short session: one line is
|
|
78
|
+
enough, or memories: [] if nothing in it is worth keeping." The next session's pointer
|
|
79
|
+
and caps are unchanged: two pointers a day across the store, this project only.
|
|
80
|
+
- **A debt lapses instead of waiting forever.** An owed stretch has two more days of use
|
|
81
|
+
(days with a turn end) after the day of its latest piece; at the first turn end of the
|
|
82
|
+
third, it lapses. Nothing is deleted: the session stops owing, and its text goes on the
|
|
83
|
+
ordinary 7-day retention. On a store with old unwritten stretches, the first pass
|
|
84
|
+
lapses them, one record each.
|
|
85
|
+
- **The in-session ask has a third reason**: three pieces not yet written up, half an
|
|
86
|
+
hour after the later of the first of them and the last ask (`due-unwritten`). The
|
|
87
|
+
day's cap on asks is unchanged, and an unanswered ask isn't repeated without new
|
|
88
|
+
pieces.
|
|
89
|
+
- **The handoff pointer says how current it is**: `Where I left off in this directory
|
|
90
|
+
(written 09-29 12:47): …`, and when work here ran after it, `(written 09-29 12:47; work
|
|
91
|
+
here 13:02–15:41 since, not yet written up)` or `…, written up since`. The excerpt is
|
|
92
|
+
the first real sentence, without a leading list marker.
|
|
93
|
+
- **`counterparts coverage [--date YYYY-MM-DD]`** says, in plain words, what was written
|
|
94
|
+
up and what is not yet, for a day. Doctor's **Crash write-up** line is now **Write-ups**:
|
|
95
|
+
yesterday's state, amber when a stretch the pointer can offer is still owed from
|
|
96
|
+
yesterday or earlier, small debts it never offers named apart as "left to lapse", and
|
|
97
|
+
the week's lapses. The 3-day wait is gone.
|
|
98
|
+
|
|
99
|
+
The wake.
|
|
100
|
+
|
|
101
|
+
- **The wake keeps up with the day.** It used to be written once, at the day's first
|
|
102
|
+
turn end, so a self page written later, a write-up that landed, or the nightly run's
|
|
103
|
+
page reached no session until the next day. Now each of those marks the wake behind,
|
|
104
|
+
and the next turn end re-renders it; the nightly run re-renders it when it finishes.
|
|
105
|
+
Re-renders on the same day are stable: the same Nearby memories, the identity lane
|
|
106
|
+
rotating once a day.
|
|
107
|
+
- **The wake says what it trimmed.** A lane that lost memories to its cap or to the size
|
|
108
|
+
budget gets one quiet line, like `(3 more still open; recall ids: mem_…, mem_…, mem_…)`,
|
|
109
|
+
up to five ids that recall reads whole. Most wakes will carry a "(N more nearby…)"
|
|
110
|
+
line.
|
|
111
|
+
- **A plain reminder, once told, leaves "Arriving"** for the rest of its grace week.
|
|
112
|
+
Recall still finds it.
|
|
113
|
+
- **One size budget per hook message** (10,000 bytes; 9,500 for the JSON form). When a
|
|
114
|
+
session start or a prompt is crowded, parts give way in a stated order and wait for a
|
|
115
|
+
later turn; nothing is cut, and nothing is marked told that wasn't shown. The
|
|
116
|
+
first-launch question is now measured against this budget, so it can fit beside a full
|
|
117
|
+
wake.
|
|
118
|
+
|
|
119
|
+
The log.
|
|
120
|
+
|
|
121
|
+
- **A process log**: one line per event from the hooks, the turn-end worker, the nightly
|
|
122
|
+
run and the memory server, in `sessions/log/<date>.log` inside the store (kept 7
|
|
123
|
+
days). Ids, counts and codes, no conversation text. **`counterparts log [--date
|
|
124
|
+
YYYY-MM-DD]`** prints a day, oldest first. Doctor has a green **Log** line (where it
|
|
125
|
+
is, how many days it holds, today's failures).
|
|
126
|
+
- Two failures now leave a durable record: capture failing to write, and a write-up
|
|
127
|
+
failing.
|
|
128
|
+
|
|
129
|
+
Cleanup.
|
|
130
|
+
|
|
131
|
+
- **The page writer's host mode is removed** (the windowless `claude -p` the worker
|
|
132
|
+
started for the self page alone, off by default since the nightly run). A config that
|
|
133
|
+
still says `pageWriter.mode: "host"` loads, reads as `session`, and doctor's "Old
|
|
134
|
+
settings" line names what it ignores.
|
|
135
|
+
|
|
136
|
+
The dashboard.
|
|
137
|
+
|
|
138
|
+
- **Dates** in one style ("Sep 30th", with the year when it isn't this year). **Self**:
|
|
139
|
+
the day-by-day note reads as a sentence, and Arriving items are titles that open the
|
|
140
|
+
memory. **Memories**: a "by word | by meaning" switch beside the search box, matched
|
|
141
|
+
words highlighted, close matches for typos, readable line lengths, and a row no longer
|
|
142
|
+
repeats its own date. **Feelings**: "disgust" reads "dislike". **How well I remember**:
|
|
143
|
+
one square per memory, scaling as memories grow.
|
|
144
|
+
|
|
145
|
+
## 0.3.7 — 2026-09-29
|
|
146
|
+
|
|
147
|
+
Dreaming asks where you can see it, and "on its own" now means a separate background
|
|
148
|
+
session the hook starts itself. Memory also fits more into a night, reads long
|
|
149
|
+
memories whole, and lets links bring a memory to mind. **The store's format does not
|
|
150
|
+
change** (it stays v9), so nothing is copied or upgraded. Close every session before
|
|
151
|
+
installing anyway: the hooks switch to the new code at once, while a session left open
|
|
152
|
+
keeps the old memory server. Run `/mcp` → Reconnect in any you missed.
|
|
153
|
+
|
|
154
|
+
Dreaming.
|
|
155
|
+
|
|
156
|
+
- **The day's question shows in your terminal.** On the first prompt of a new day, with
|
|
157
|
+
memories waiting to be dreamed, you see: `Counterparts: I haven't dreamed since …
|
|
158
|
+
(N new memories). Say "dream" to start, or "dream on your own" to let me do it each
|
|
159
|
+
day.` Claude doesn't ask it again; it waits for your word.
|
|
160
|
+
- **`ask` is the default now** (it was `auto`). Say "dream" and the run starts in a
|
|
161
|
+
background agent, as before.
|
|
162
|
+
- **"Dream on your own" means a headless nightly run.** With the setting `auto`, the
|
|
163
|
+
first prompt of the day starts the run itself, in a separate, windowless `claude`
|
|
164
|
+
session, and tells you: `Counterparts: dreaming in the background (a few minutes).
|
|
165
|
+
Say "no dreams" to turn it off.` Nothing is asked of the session you're in. That
|
|
166
|
+
session is locked down: it can use only the counterparts memory tools (dream,
|
|
167
|
+
reflect, self page, recall), Claude Code's own tools that run commands, read or
|
|
168
|
+
write files, reach the network or start agents are turned off, it loads only the
|
|
169
|
+
counterparts MCP server, it starts in a neutral folder (the store's own, so no
|
|
170
|
+
project's instructions or hooks load), and it has a turn limit and a 20-minute
|
|
171
|
+
watchdog.
|
|
172
|
+
- **Every run leaves one record**: done, partial (with the parts that ran: writer,
|
|
173
|
+
dream, reflection), failed, timed out, or could not start, with the reason. What the
|
|
174
|
+
run did is told on the next prompt, in any session, once. `counterparts dream` and
|
|
175
|
+
doctor's new **Nightly run** line show the latest run.
|
|
176
|
+
- **If the run can't start, it asks instead**, with the reason in one line: `I
|
|
177
|
+
couldn't start dreaming on my own: the claude command was not found. Say "dream" to
|
|
178
|
+
do it here.` The next day tries on its own again.
|
|
179
|
+
- **If you had set `auto` yourself before this version, it is set back to `ask`
|
|
180
|
+
once**, and you're told once, in the terminal. `auto` used to mean "Claude starts a
|
|
181
|
+
background agent in your session"; it now means a separate session, so it's yours to
|
|
182
|
+
choose again ("dream on your own"). A store that never chose a setting simply gets
|
|
183
|
+
the new default, `ask`.
|
|
184
|
+
- **"No dreams" takes effect from the next run**; a run already under way finishes,
|
|
185
|
+
and it says so.
|
|
186
|
+
- The run's words say "while I slept" and "since you last slept", not "last night":
|
|
187
|
+
it runs at the day's first session, usually the morning.
|
|
188
|
+
- **The reflection leans toward rewriting the page** each day, unless there's really
|
|
189
|
+
nothing new; it's told when the page writer already revised it earlier in the run,
|
|
190
|
+
and that every version is kept.
|
|
191
|
+
- **Fixed before release:** since 0.3.6, on the development branch, the dream and
|
|
192
|
+
the reflection were shown only the counts of what they were handed, not the
|
|
193
|
+
memories themselves. They see the memories again. (0.3.6 as published was not
|
|
194
|
+
affected.)
|
|
195
|
+
|
|
196
|
+
Fitting more into a night.
|
|
197
|
+
|
|
198
|
+
- **New memories wait their turn instead of being dropped.** Memories not yet dreamed
|
|
199
|
+
form a queue, ranked by how much they matter, not by how new they are. What fits in
|
|
200
|
+
tonight's room is dreamed; the rest wait for the next night, and the dream says how
|
|
201
|
+
many ("12 new memories wait for the next night"). A memory still not dreamed after
|
|
202
|
+
seven days of use ages out, counted.
|
|
203
|
+
- **Detail by importance.** Every memory the dream is shown gets a line (what it is,
|
|
204
|
+
its date, its strongest feeling, why it's here); the most important come whole.
|
|
205
|
+
The reflection now sees the whole core and every memory from the last few days.
|
|
206
|
+
- **Journals as chapters.** A long journal is sent a chapter at a time, only the
|
|
207
|
+
chapters added since the last dream, and entries that didn't fit are carried to the
|
|
208
|
+
next night. Before, a grown journal was re-sent from chapter 1 and the newest
|
|
209
|
+
chapters were the ones cut.
|
|
210
|
+
- **Long answers come in parts** ("part 1 of 3") rather than cut.
|
|
211
|
+
- **Recall by id reads up to 10 memories at once, each whole**, in parts when it is
|
|
212
|
+
long, so a dream merge, a journal or a long episode can be read through the memory
|
|
213
|
+
tool. Ids past the room wait, named, with the call that fetches them.
|
|
214
|
+
- **Doctor's new Lookups line** says how often the dream and the reflection looked up
|
|
215
|
+
a memory they were shown only in part.
|
|
216
|
+
- `note`, `session_end` and `chapter` ask Claude for a one-line title.
|
|
217
|
+
- **Nightly upkeep resumes where it stopped.** Pruning and fading pick up after the
|
|
218
|
+
last memory they looked at, instead of the same random slice each night.
|
|
219
|
+
- **Open things are found by state**, not among the newest few: a contradiction a
|
|
220
|
+
dream flagged many nights ago is still raised, and a morning share not yet told is
|
|
221
|
+
still carried. A flagged contradiction that keeps coming up is shown less each
|
|
222
|
+
time, until one of its memories is used again.
|
|
223
|
+
|
|
224
|
+
Links between memories.
|
|
225
|
+
|
|
226
|
+
- **Links can bring a memory to mind.** When the memories a prompt calls up are
|
|
227
|
+
strongly linked to another one that shares none of its words, that one may be shown
|
|
228
|
+
quietly, at the end, marked `Linked:` (at most two). Doctor's **Association** line
|
|
229
|
+
says how many were shown and how many Claude then opened.
|
|
230
|
+
- **Memories written close together in a session are linked**, lightly, when the
|
|
231
|
+
session ends: each to the next one or two. Links still fade unless use strengthens
|
|
232
|
+
them. What the nightly run writes is left out.
|
|
233
|
+
- **Steadier links.** A new link starts faint and a link's strength no longer depends
|
|
234
|
+
on how many others its memory has. Links a dream or a summary proposes are added
|
|
235
|
+
only where there's room; they never push out a link learned from use. Spreading
|
|
236
|
+
goes strongest-first and stops when what it carries gets faint. Dead links are
|
|
237
|
+
swept.
|
|
238
|
+
- Four fixes: a dream re-linking two memories no longer brought back a link's old
|
|
239
|
+
strength; a memory used twice in one day still links with what it was used with;
|
|
240
|
+
a link could no longer push a memory the prompt found strongly down the list; and
|
|
241
|
+
importance is weighed before the list is cut, not after.
|
|
242
|
+
|
|
243
|
+
The dashboard.
|
|
244
|
+
|
|
245
|
+
- **Memories, round 4, so it reads for anyone.** One search box, "Find a memory"
|
|
246
|
+
(type to find by words, Enter to ask by meaning; the answers replace the list).
|
|
247
|
+
**How well I remember** (renamed, journal counted as its own part). Two rows of
|
|
248
|
+
filters: kinds (about myself, people, things, skills, places, facts, journal, core)
|
|
249
|
+
and the six feelings, with "kept · put away · both" beside them. Every row the same
|
|
250
|
+
brightness; "fading" only where it is. The card is trimmed to the text, the
|
|
251
|
+
feelings chart, one sentence on how well it's remembered and when it would be put
|
|
252
|
+
away, why it mattered, and when it was written; the rest is under "details".
|
|
253
|
+
"Archived" reads "put away". **"+ Add a memory"**. The "Reading here changes
|
|
254
|
+
nothing" badge is gone from every page. Home and Memories share one feelings
|
|
255
|
+
chart.
|
|
256
|
+
- **The Self map reads at a glance** (on Home and Self): its rings are named on the
|
|
257
|
+
map ("who I am", "almost there", "about me and us"), the core and almost-there
|
|
258
|
+
memories carry short names, and links show only when you hover or tap a dot. On
|
|
259
|
+
Home, the brain is back on the right, beside Today.
|
|
260
|
+
|
|
3
261
|
## 0.3.6 — 2026-09-28
|
|
4
262
|
|
|
5
263
|
The nightly run: once a day, Claude writes its page, dreams and reflects in one
|
package/docs/module-map.md
CHANGED
|
@@ -15,15 +15,18 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
|
|
|
15
15
|
| `encode/` | attention + amygdala tagging | What gets in: gates (secrets, precision), salience tagged at write time, novelty as prediction error. |
|
|
16
16
|
| `remember/` | hippocampal encoding | The authorship contract: the experiencer's end-of-session dump (content, salience tags, `updates:` marks), in-the-moment jots, crash-fallback ingestion. |
|
|
17
17
|
| `store/` | the substrate | Two boxes since the floor (schema v6, 2026-09-20): one small canonical transactional SQLite (`counterparts.sqlite` — the memories' words, their archived versions, and every structured field), one rebuildable cache (embeddings/FTS, never backed up). The third box — one markdown file per memory — is gone. Markdown is an export (`render.ts`), plus a derived, write-only file copy of the journal under `journal/` — classified in the layout, deliberately NOT in the backup set, regenerated from its rows if deleted. |
|
|
18
|
-
| `recall/` | retrieval + priming | Cues → activation → surfacing gate → bounded injection; footnote tier; reinforcement on real use. |
|
|
18
|
+
| `recall/` | retrieval + priming | Cues → activation → surfacing gate → bounded injection; footnote tier; reinforcement on real use. Since 2026-09-29 a memory's standing in a contradiction is a label in front of it (earlier, unsettled, corrected) or after it (disagrees with). |
|
|
19
19
|
| `embed/` | — (a gist, not a reading) | Text in, vector out, on this machine, for nothing: the static embedding table (`static.ts`, potion-base-8M) that gives recall's semantic channel a source with no key. Zero code dependencies; its weights ship as the data-only package `counterparts-model-potion`, the one runtime dependency. The only embedder since 2026-09-24, when the paid Voyage seat was removed. **Added 2026-09-23 (roadmap C1).** |
|
|
20
20
|
| `associate/` | Hebbian linking | Co-activation strengthens links; spreading activation at recall. **RESOLVED (owner, 2026-08-25): stays a module** — edge-level arithmetic keeps `physics/` one page; Hebbian plasticity/contiguity is its own mechanism in the field guide. |
|
|
21
21
|
| `schemas/` | semantic memory | Entities and beliefs; birth by mention, death by decay; strength-weighted revision with row history. |
|
|
22
22
|
| `self/` | autobiographical self | Identity documents, episodes, the wake briefing (v0's briefing, grown up). Governed: frozen self-reinforcement rules. |
|
|
23
23
|
| `prospective/` | prospective memory | Future intentions, cued by time or context; fire / suppress / reference telemetry. |
|
|
24
24
|
| `handoff/` | working context for a place | The per-directory handoff: where the work here stands, written as a field on the end-of-session ask, shown as a two-line pointer at the next wake in that directory, expiring in lived days. **Never a memory** — out of recall, out of credit, out of consolidation, out of identity. **Added 2026-09-20 (E1, spec §6.4 / §15 item 6).** |
|
|
25
|
+
| `coverage/` | rehearsal debt | What is not written up yet, read in one place: per session, the unwritten stretch since its last claim in `coverage.jsonl`. The pacer's third ask (pieces and time), the one rule for what a session owes (retention, the next-session write-up), lapse after two days of use, the handoff pointer's "how current", and one row per stretch per state. Changes nothing about how pieces are claimed. **Added 2026-09-30.** |
|
|
25
26
|
| `sleep/` | systems consolidation | Pure math on a cycle: decay tick (active-day clock), floor-pruning (real forgetting), the core's two lanes (at most three a night), re-render of the wake briefing. Zero standing model calls. |
|
|
26
27
|
| `dream/` | sleep replay + REM | Dreaming: once a day, if the owner says yes, a background agent (the same model) replays what was lived since the last dream beside what it resembles — merges, links, replays, a pattern, a flagged contradiction, a softened feeling, a core nomination — each recorded for undo, with a dream journal kept apart from lived memory. The module holds the bookkeeping and the rules; the dreamer is the model. **Added 2026-09-26.** Since 2026-09-27 it also holds REFLECTION (`reflect.ts`), the waking self: usually right after a dream, lived, with its own record — an entry, the self page rewritten from the core, a morning share, feelings recorded later, and what a memory is about. |
|
|
28
|
+
| `fit/` | working memory's pointers | Fitting what a mechanism has into the room it has: a line for everything, the whole text for the most important, ids and a named lookup for the rest, a count of what waits. Plus `lineOf`, `derivedFrom`, parts, and the lookup ledger that measures whether receivers use the lookup. First users: the dream and the reflection. **Added 2026-09-28 (build B).** |
|
|
29
|
+
| *(`contradictions.ts`)* | reconsolidation + interference | Two memories that disagree: flagged (a dream, today), noticed at write time (the nearest few live memories come back with a stored one), and SETTLED — `changed` (both true at their time: one strength cut, labelled earlier), `corrected` (archived, readable by id), or `open` (both kept, shown together) — by a new memory's `updates` + `how`, a `note` settle, a dream or reflection with a plain reason, or the owner's `counterparts settle`. Every settle is on a trail (who, how, why, when) and can be undone. A file beside `revision.ts`, whose ordinary-memory arm it is; its tables are the store's (schema v10), its labels recall's (`recall/standing.ts`). **Added 2026-09-29.** |
|
|
27
30
|
| *(`time.ts`)* | — (a clock, not a memory) | The one module that converts: a moment (UTC ms from `store.now()`) to a person's local date or clock line, "today" in a zone, and calendar dates as said (day, month, year, range). A file, not a module; a test keeps hand-built dates out of `src/`. **Added 2026-09-25 (`docs/time.md`).** |
|
|
28
31
|
| *(`feelings-wheel.ts`)* | — (a vocabulary) | The feelings wheel as a typed list: six cores, the middle and outer rings, valence, and the key scheme (`<core>.<word>` only for a word printed under two cores). Read by `store/` to validate the `feelings` table. **Added 2026-09-25.** |
|
|
29
32
|
| *(observer)* | — (instrument stance) | **RESOLVED (owner, 2026-08-25): a MODE, not a module** — one predicate threaded through the core API, checked at the store seam. Spec moved to `docs/observer-mode.md`. |
|
|
@@ -43,6 +46,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
|
|
|
43
46
|
| `sessions.ts` | Not an adapter — a leaf both may import: the live-session registry a host's hooks write (`<dataDir>/sessions/`) and its tools read, so a tool launched without a session can bind to one that is real, live and in its project. Adapters stay leaves; this is the sibling they share instead of importing each other. **Added 2026-09-04**, because this host's MCP servers are launched from a static config and cannot be told which session they serve. |
|
|
44
47
|
| `expansions.ts` | The same shape, for the other direction: the handle-resolution log the MCP `recall` tool writes (`<dataDir>/sessions/expansions.jsonl` — a per-store SALTED hash of the handle (G58), the id it reached or `null` for a refusal, a timestamp, the project) and the boundary's credit pass reads, so an expansion by TITLE credits the memory it actually reached, and a refusal shadows it. **Added 2026-09-15** (LAUNCH-STATUS G50): `recall/reference.ts` credits literal `mem_…` addresses and resolves nothing, so until this the most deliberate act a session had — naming a memory and reading it — earned no credit at all. |
|
|
45
48
|
| `scopes.ts` | The third shared leaf: the per-directory scope registry (`scopes.json` BESIDE the config, never inside the store, because the hook decides `off` before anything opens) — `on` / `observer` / `off` / `paused`, longest prefix wins, absent-or-unreadable meaning `unset` meaning on. Written by the `counterparts scope` console and the MCP `scope` tool, read by every hook. **Added 2026-09-15** (PR #92, G19): the hooks are registered globally, so until this the only way to say *not here* was a second config file and two environment variables. |
|
|
49
|
+
| `log/` | A shared leaf with its own CONTRACT: the process log — one line per allowlisted event (failures, stand-downs, turn ends, write-ups, the night, the wake) from the hook, the worker, the nightly run and the MCP server, to `<dataDir>/sessions/log/<date>.log`, ids and codes only, kept 7 days. Read by `counterparts log` and one doctor line. **Added 2026-09-30**: none of the four processes wired its `onEvent`, so ~270 event names died with their process. |
|
|
46
50
|
|
|
47
51
|
## Tools (`tools/`)
|
|
48
52
|
|
package/package.json
CHANGED
|
@@ -567,16 +567,17 @@ row, saying which source answered, existed until the keys were removed — §1a.
|
|
|
567
567
|
|
|
568
568
|
**[M] Once per local calendar day, the first session's line starts the nightly run.** On the
|
|
569
569
|
first prompt of a calendar day (`hooks.ts#dreamLines`, UserPromptSubmit), when at least three
|
|
570
|
-
memories are new since the last dream, the
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
memories are new since the last dream, the run starts — since 2026-09-29 either on the
|
|
571
|
+
person's "dream" (the model calls the dream tool's `launch` and hands the prompt to ONE
|
|
572
|
+
background agent) or, with `auto`, headless, started by the hook itself (next section). The
|
|
573
573
|
run is, in order (`DREAM_TUNABLES.NIGHT_ORDER`, the owner's call): the page writer, the dream,
|
|
574
574
|
the reflection — the writer first so it reads yesterday before any merge archives an
|
|
575
575
|
original, survives a session cut off mid-run, and the dream and the reflection see the fresh
|
|
576
576
|
page.
|
|
577
577
|
Fewer than three new: nothing runs, and they carry over (new = since the last dream). The
|
|
578
|
-
owner's setting decides the line — `
|
|
579
|
-
|
|
578
|
+
owner's setting decides the line — `ask` (the default since 2026-09-29) shows the PERSON
|
|
579
|
+
the question in the terminal and waits for "dream", `auto` starts the run HEADLESS (below),
|
|
580
|
+
`off` says nothing — kept in the store's meta, set by the dream
|
|
580
581
|
tool's `setting` phase ("no dreams") or `counterparts dream --setting`, shown by doctor. The
|
|
581
582
|
line is claimed once a day across sessions (`dream_asks`), and again only for a run left
|
|
582
583
|
behind (a dream begun and quiet for 30 minutes, or — `auto` — a launch no dream followed),
|
|
@@ -593,31 +594,23 @@ The MCP server labels a `self_page` write `by: "writer"` when the write NAMES a
|
|
|
593
594
|
that holds that open claim (`self/writer.ts#nightClaimFor`) — not the session the server is
|
|
594
595
|
bound to, so the owner's own page edit in the run's session stays an ordinary amendment;
|
|
595
596
|
and when the run moves past the writer without a write, its next phase answers the night
|
|
596
|
-
`nothing-to-say`. The
|
|
597
|
-
|
|
598
|
-
**
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
as a pinned DATE (`COUNTERPARTS_PAGE_WRITER`), because a windowless child's session id is
|
|
608
|
-
minted by the host after the launcher is gone. **The child's stdout is never parsed into a
|
|
609
|
-
verdict**: what the run did is read from the page's version chain and from the row the tool
|
|
610
|
-
left, and the exit code decides only between "nothing to say" and "could not run". The
|
|
611
|
-
child is told nothing on its prompts (`HookInput.pageWriter`): no dream line, no reminders.
|
|
597
|
+
`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.
|
|
598
|
+
|
|
599
|
+
**Host mode is removed (2026-09-29).** The windowless `claude -p` the boundary's worker
|
|
600
|
+
started for the writer alone (`pageWriter.mode: host`, off by default since the nightly run)
|
|
601
|
+
is gone, with its `COUNTERPARTS_PAGE_WRITER` environment pin, `HookInput.pageWriter` and the
|
|
602
|
+
worker's fifth step. A configuration that still names it loads: `pageWriter.mode: "host"`,
|
|
603
|
+
`pageWriter.timeoutMs` and `pageWriter.command` are ignored and named on doctor's "Old
|
|
604
|
+
settings" line, and the mode reads as `session`. A stored row written with `mode: "host"`
|
|
605
|
+
stays as written and reads as `session`. What the headless nightly run shared with it —
|
|
606
|
+
the pure plan / starter shape, the prompt on STDIN, the SIGTERM → SIGKILL → stop-waiting
|
|
607
|
+
watchdog — is `child.ts` now, unchanged.
|
|
612
608
|
|
|
613
609
|
(Retired with the SessionStart ask, 2026-09-28: the measured-not-predicted sizing against the
|
|
614
610
|
host's ceiling, the durable `skipped` deferral rows, and the first-launch question's
|
|
615
611
|
once-per-night patience. `skipped` rows written before still read as they always did.)
|
|
616
612
|
|
|
617
|
-
**[M]
|
|
618
|
-
the same `finally` as the snapshot, so a day whose sweep broke is still a day that gets
|
|
619
|
-
written about; it never throws; and a failure never fails a wake, a boundary or a session.
|
|
620
|
-
Doctor's `Page writer` line is GREEN when it has never run on a store with no yesterday,
|
|
613
|
+
**[M] Doctor's line.** The `Page writer` line is GREEN when it has never run on a store with no yesterday,
|
|
621
614
|
GREEN on a night that had nothing to say, GREEN when it is off (a deliberate choice; this
|
|
622
615
|
page used to say amber while a page stands, which the code has not done since the S2 review
|
|
623
616
|
— the words follow the code as of 2026-09-28), AMBER on a failure, a refusal, an unreadable
|
|
@@ -625,37 +618,109 @@ page used to say amber while a page stands, which the code has not done since th
|
|
|
625
618
|
without it, and never RED. A night owed because no run started (fewer than three new
|
|
626
619
|
memories, dreaming off or declined) is green: the writer runs inside the nightly run now.
|
|
627
620
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
`
|
|
631
|
-
|
|
632
|
-
`
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
621
|
+
### The headless nightly run (2026-09-29 — working defaults, held lightly)
|
|
622
|
+
|
|
623
|
+
**[M] With the setting `auto` the hook starts the nightly run itself; nothing in the working
|
|
624
|
+
session launches anything.** On the first prompt of a calendar day that is due
|
|
625
|
+
(`hooks.ts#dreamLines` → `startNightRun`), the hook claims the day, starts
|
|
626
|
+
`bin/nightly.ts` DETACHED (`night-run.ts#planNightRunner`, `spawn.ts#spawnDetached`) and
|
|
627
|
+
records the run `started`, with its watchdog. That process composes the launch prompt from
|
|
628
|
+
the store, starts `claude -p` with it on STDIN (`planNightChild`), waits under the run's own
|
|
629
|
+
watchdog (`dreaming.timeoutMs`, default `NIGHT_RUN_MS` 20 minutes) and records the end. The
|
|
630
|
+
outcome is read from the exit and the store, never from the child's output:
|
|
631
|
+
|
|
632
|
+
- `done`: the dream and the reflection ran (the reflection, for a reflection-alone run);
|
|
633
|
+
- `partial`: some of the run's parts ran and not all, whatever the exit, with the parts on
|
|
634
|
+
the row (`writer` when its phase was reached and recorded, `dream` journaled, `reflection`
|
|
635
|
+
finished) and the exit as its reason;
|
|
636
|
+
- `failed` or `timed-out`: nothing finished;
|
|
637
|
+
- `could-not-start`: `no-claude`, `spawn-failed`, `quick-exit` (non-zero inside
|
|
638
|
+
`NIGHT_QUICK_EXIT_MS` with nothing begun), `nothing-ran` (a clean exit that began no dream
|
|
639
|
+
and no reflection), `refused`, or `runner` (the detached process could not be started).
|
|
640
|
+
|
|
641
|
+
**[M] The child is locked down (owner decision B).** `--permission-mode default`;
|
|
642
|
+
`--allowedTools` exactly `mcp__counterparts__dream`, `…reflect`, `…self_page`, `…recall`;
|
|
643
|
+
`--disallowedTools` the built-ins that run commands or code, read, search or write files,
|
|
644
|
+
reach the network, start agents or workflows, or schedule work (`NIGHT_DENIED_TOOLS` — a
|
|
645
|
+
deny beats the user's own allow rules; `ToolSearch` stays, for hosts that defer MCP tools);
|
|
646
|
+
`--strict-mcp-config` with an `--mcp-config` naming only the counterparts server, as the
|
|
647
|
+
install registers it (`nightMcpConfig`); `--max-turns` (`NIGHT_MAX_TURNS` 60,
|
|
648
|
+
`dreaming.maxTurns`); `--model` only when `dreaming.model` is set. It starts in a NEUTRAL
|
|
649
|
+
directory — the store's own — so no project's CLAUDE.md, hooks or MCP servers load. The
|
|
650
|
+
parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are removed;
|
|
651
|
+
this package's values are written last.
|
|
652
|
+
|
|
653
|
+
**[M] Session binding: the run is attributed to the session that started it.** The launch
|
|
654
|
+
prompt names that session's id, and the id and its directory are PINNED
|
|
655
|
+
(`COUNTERPARTS_SESSION`, `COUNTERPARTS_SCOPE`) on the child's environment and on its MCP
|
|
656
|
+
server's, so the server is launched bound to it — never lazy-bound through the registry,
|
|
657
|
+
whose liveness check refuses a session left open overnight (review of #282, finding 1). The
|
|
658
|
+
child's own host-minted session is QUIET (`HookInput.nightRun`, from
|
|
659
|
+
`COUNTERPARTS_NIGHT_RUN`): its hooks capture nothing (so it owes no write-up) and give no dream
|
|
660
|
+
lines, plain reminders, Stop ask, write-up pointer or first-launch question. It still wakes
|
|
661
|
+
with the ordinary wake.
|
|
662
|
+
|
|
663
|
+
**[M] The person sees it, and a run that cannot do its job falls back to asking.** The prompt
|
|
664
|
+
hook's `systemMessage` carries "dreaming in the background (a few minutes). Say "no dreams"
|
|
665
|
+
to turn it off." when the envelope has room (the model's line never claims it was shown).
|
|
666
|
+
A run that could not start, or timed out / failed / never reported (a `started` row past its
|
|
667
|
+
watchdog plus `NIGHT_LOST_GRACE_MS`) having begun nothing, makes the next offer — the same
|
|
668
|
+
prompt, or the next — an ASK with the reason ("I couldn't start dreaming on my own: …"),
|
|
669
|
+
recorded `offered` after `could-not-start` and not counted as a relaunch. A run still inside
|
|
670
|
+
its watchdog is `dreaming-now`: no second run starts beside it. "No dreams" does not stop a
|
|
671
|
+
run in flight; it takes effect from the next run and says so (owner decision D). A run that
|
|
672
|
+
ended hands back its dream's line (a partial says so; a reflection-alone run hands back its
|
|
673
|
+
share only) at the next prompt anywhere, once (owner decision C). Doctor's Nightly run line
|
|
674
|
+
reads the record; amber only while `auto` and the latest run did not finish. Observer:
|
|
675
|
+
nothing starts. Proved against a stub executable only.
|
|
676
|
+
|
|
677
|
+
**[M] `auto` from before this version is set back to `ask` once (owner decision A).** Its
|
|
678
|
+
meaning changed, so a store with `auto` written explicitly is reset on the first prompt on
|
|
679
|
+
this version, recorded (`dream.ask`, `by: upgrade`), and the owner is told once in the
|
|
680
|
+
terminal; "dream on your own" sets it again. Any setting chosen on this version is kept.
|
|
681
|
+
|
|
682
|
+
### One size budget per hook envelope (2026-09-29 — a working default)
|
|
683
|
+
|
|
684
|
+
**[M] Everything one SessionStart or one UserPromptSubmit prints is measured against one
|
|
685
|
+
budget**, the host's cap (`TUNABLES.HOST_OUTPUT_CHARS`, 10,000, counted in bytes; the JSON
|
|
686
|
+
form `ENVELOPE_CHARS`, 9,500), and a crowded envelope gives way in a stated order, first to
|
|
687
|
+
last. Each part that gives way is DEFERRED, never cut, and never spent on a line the session
|
|
688
|
+
did not get.
|
|
689
|
+
- **SessionStart:** the owner's notices (dropped before the JSON envelope passes 9,500) →
|
|
690
|
+
the write-up pointer → the first-launch question (measured against this budget, no
|
|
691
|
+
longer the reported injection budget) → plain reminders due today (they wait for the
|
|
692
|
+
first prompt, unclaimed) → the wake, which is never cut at delivery: it was composed to
|
|
693
|
+
its own budget at the boundary, trimming hints → craft → threads → horizon → identity.
|
|
694
|
+
A reminder reaches the person only in the JSON form, so when one is due and it fits
|
|
695
|
+
beside the wake in that form, the two asks are measured against THAT form (escaped,
|
|
696
|
+
under 9,500) and it is they that give way (review of #285, S2). A wake too full for the
|
|
697
|
+
reminder even alone sends the reminder to the first prompt and the asks use the plain
|
|
698
|
+
room. What gave way is recorded where it happened: each ask's deferral, and the
|
|
699
|
+
delivery for reminders, the dream offer and the update notice
|
|
700
|
+
(`adapter.envelope.gave-way`).
|
|
701
|
+
- **UserPromptSubmit:** the update notice → the turn's recall, sized to what the lines
|
|
702
|
+
below leave (`hooks.ts#recallRoom`, measured in the envelope's own form — every part
|
|
703
|
+
but recall's own escaping, which is a named reserve), trimming itself to that → the dream's lines (a
|
|
704
|
+
hand-back, a carried share, a raise line, the day's offer), reserved because they are
|
|
705
|
+
claimed when composed → plain reminders and the clock line, last.
|
|
706
|
+
- **The plain-stdout fallback is checked:** past the cap, `bin/hook.ts#hostDelivery` says
|
|
707
|
+
so (`overCap`) and the hook records `adapter.envelope.overcap` and prints it on stderr.
|
|
708
|
+
It is a tripwire, not a cut — by then the asks are marked; the budget above is what
|
|
709
|
+
keeps it from firing. On a normal day nothing here changes what is printed.
|
|
640
710
|
|
|
641
711
|
### The next-session write-up (C2, 2026-09-23 — true for now)
|
|
642
712
|
|
|
643
713
|
**[M] A session that ended owing a write-up is written up by the next session that starts
|
|
644
|
-
in its project.** "Owes" is
|
|
714
|
+
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
|
|
645
715
|
every scope through `adapters/sessions.ts#writeUpPlan`, the retention pass's own sources),
|
|
646
|
-
narrowed by one shared eligibility (`sessions.ts#waitingForWriteUp`) that the
|
|
647
|
-
door and doctor all read:
|
|
648
|
-
- **
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
terminal nobody has closed (MAJOR 3). **Known, and accepted as the default:** words it
|
|
655
|
-
captured AFTER that answer, at a later Stop that asked nothing, wait with it — invisible
|
|
656
|
-
to the pointer and to doctor's count — until the registry forgets the record, up to a
|
|
657
|
-
week after its last write; then it is pointed at and the fetch carries them
|
|
658
|
-
(INTERFACE-GAPS §17);
|
|
716
|
+
narrowed by one shared eligibility (`sessions.ts#waitingForWriteUp`, `pointable`) that the
|
|
717
|
+
pointer, the door and doctor all read:
|
|
718
|
+
- **not at work** replaced "ended" on 2026-09-30: a session owes once it has ended (a
|
|
719
|
+
registry end or a `session-end` boundary) OR has captured nothing since the date changed.
|
|
720
|
+
There is no silence window any more (the 12-hour `WRITE_UP_SILENCE_MS` and the
|
|
721
|
+
open-and-answered exception of PR #192's MAJOR 3 are gone with the asked / answered
|
|
722
|
+
predicate they guarded): a session open overnight owes the next date, and one at work
|
|
723
|
+
today is `live-session` to the door;
|
|
659
724
|
- with the API sweep on, a crashed session whose words the sweep will still read is the
|
|
660
725
|
sweep's (`sweepOwns`); one whose only words left are in quarantine is not (MAJOR 5);
|
|
661
726
|
- **in its project** means the session holds words filed under this project's scope. A
|
|
@@ -665,6 +730,23 @@ door and doctor all read:
|
|
|
665
730
|
Sessions never pointed at go first, then the least recently pointed at or fetched, oldest
|
|
666
731
|
first among equals, so one session nobody writes up cannot stand in front of the rest.
|
|
667
732
|
|
|
733
|
+
**[M] A short session owes a SHORT write-up (2026-09-29, a working default).** A session
|
|
734
|
+
under the first-ask threshold — never asked — that left text, was not written up and gave
|
|
735
|
+
no answer owed a one-line write-up (#285's `owesShortWriteUp`; since 2026-09-30 a small owed stretch, `coverage/`'s `small`). Same pointer,
|
|
736
|
+
same door, one plain sentence more (`WRITE_UP_SHORT_LINE`: one line is enough, or
|
|
737
|
+
`memories: []`). Full write-ups first, STORE-WIDE (review of #285, S1): a short one is
|
|
738
|
+
offered only when no full debt anywhere in the store is waiting and not yet pointed at
|
|
739
|
+
today, because the day's allowance is one count for the store. It is offered only for a
|
|
740
|
+
session the host's registry knows (one our hooks saw start), so the unbound MCP server's
|
|
741
|
+
shared `mcp` id is passed by, and only for a person's interactive conversation: a session
|
|
742
|
+
whose host entrypoint (`CLAUDE_CODE_ENTRYPOINT`, kept on the registry record) says
|
|
743
|
+
`claude -p`, the Agent SDK, `mcp` or a GitHub action owes no short write-up (N2). It is
|
|
744
|
+
not a retention debt (text ages out with its week; a written-up one keeps it up to 7 days
|
|
745
|
+
after the write-up, like a full debt) and not in doctor's awaiting count. The headless
|
|
746
|
+
nightly run's child and an observer capture nothing, so they owe nothing. When a pointer
|
|
747
|
+
defers for room, its record names what else rode beside the wake, and doctor's advice
|
|
748
|
+
names that rather than the wake's budget (M3).
|
|
749
|
+
|
|
668
750
|
**[M] SessionStart carries a POINTER, not the words** (owner's choice of 2026-09-23,
|
|
669
751
|
INTERFACE-GAPS §15 option (b)). In `HookResult.ask`, after whichever other ask took the
|
|
670
752
|
field, it says how many sessions here are waiting, the oldest one's date, size and "part k
|
|
@@ -673,7 +755,7 @@ of N", and the call that fetches it, naming the ended session once and this sess
|
|
|
673
755
|
MCP door (`mcp/CONTRACT` guarantee 16), at most `WRITE_UP_PART_BYTES` (~24 KB) per
|
|
674
756
|
session, because an MCP result is not under the host's 10,000-character cap on a hook's
|
|
675
757
|
output and the wake is. The pointer is measured against that cap as PLAIN stdout
|
|
676
|
-
(`
|
|
758
|
+
(`HOST_OUTPUT_CHARS` = 10,000; bytes ≥ characters): with no owner notice
|
|
677
759
|
`bin/hook.ts#hostDelivery` prints plain text, and with one it drops the notice before it
|
|
678
760
|
lets the JSON envelope pass `ENVELOPE_MAX_CHARS`. It is NOT held to the reported budget,
|
|
679
761
|
which is what the wake is composed to; a 9,038-byte wake leaves room (tested with host
|
|
@@ -699,13 +781,14 @@ the sweep no interpreter; its gate row says `not-opted-in` and `runner.done` say
|
|
|
699
781
|
next-session`. A crashed session is pointed at like any other. An old `crashWriteUp` value
|
|
700
782
|
is ignored and named in `retired`.
|
|
701
783
|
|
|
702
|
-
**[M] Doctor: `Crash write-up`, and the `Sweep` line.** `Crash write-up`: `next session`
|
|
784
|
+
**[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`
|
|
703
785
|
green; amber when a session is finished in one project and waiting on words it left in
|
|
704
786
|
another, naming that project (re-review m-C); amber when the newest pointer outcome is a
|
|
705
787
|
DEFERRAL and sessions are waiting — saying the wake was too full, by how many bytes, and to lower
|
|
706
788
|
`injectionBudgetBytes` by that much (never "open a session", which would defer again);
|
|
707
|
-
|
|
708
|
-
|
|
789
|
+
and (until 2026-09-30, when the `Write-ups` rule above replaced it) amber when a session had
|
|
790
|
+
waited past a 3-day `WRITE_UP_WAIT_DAYS`. Counted with the pointer's own eligibility: a small
|
|
791
|
+
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` —
|
|
709
792
|
and an older build's `no-credential` — is green `next session`.
|
|
710
793
|
|
|
711
794
|
## 6. Scars honored
|
|
@@ -606,9 +606,14 @@ That is a different mechanism, not a wider parameter, and it is not built.
|
|
|
606
606
|
fourth severity is the honest shape, and it touches the report, the JSON, the
|
|
607
607
|
dashboard and every caller that partitions on three.
|
|
608
608
|
|
|
609
|
-
## 12. Nobody has run a windowless host session, and this adapter cannot prove one from inside the suite (2026-09-20, S2)
|
|
609
|
+
## 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
610
|
|
|
611
|
-
|
|
611
|
+
**Closed by removal.** The page writer's host mode was removed on 2026-09-29 (the nightly
|
|
612
|
+
run carries the writer). The questions below now belong to the headless nightly run, which
|
|
613
|
+
starts a windowless `claude -p` of its own (`night-run.ts`, the "Unproven until a real run"
|
|
614
|
+
list in NOTES 2026-09-29); they are kept as they were written.
|
|
615
|
+
|
|
616
|
+
Host mode was the owner's pick for the nightly page writer, and every part of it that is
|
|
612
617
|
this package's — the plan, the argument and environment shape, the watchdog, the claim, how
|
|
613
618
|
the outcome is read back — is under test against a stub executable. Three things are not,
|
|
614
619
|
and cannot be without a real machine and a real login:
|
|
@@ -638,7 +643,7 @@ known to work.
|
|
|
638
643
|
|
|
639
644
|
**Closed for the mechanism by #189 (roadmap B3, the owner's ruling of 2026-09-23).** The
|
|
640
645
|
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`,
|
|
646
|
+
and `self/writer.ts#pageWriterNight`, one function shared by `Self`, the nightly run and
|
|
642
647
|
doctor's Page writer line — so from US Pacific the night rolls over at local midnight,
|
|
643
648
|
not at 5 p.m. East of UTC the night waits for its UTC date to close
|
|
644
649
|
(`pageWriterAbout`: `min(local yesterday, UTC yesterday)`), because of what remains below.
|