counterparts 0.3.10 → 0.3.12

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +325 -0
  2. package/README.md +9 -3
  3. package/docs/QUICKSTART.md +8 -2
  4. package/docs/README.md +2 -2
  5. package/docs/module-map.md +2 -2
  6. package/package.json +9 -7
  7. package/src/adapters/claude-code/CONTRACT.md +44 -2
  8. package/src/adapters/claude-code/NOTES.md +68 -0
  9. package/src/adapters/claude-code/bin/hook.mjs +8 -0
  10. package/src/adapters/claude-code/bin/hook.ts +40 -14
  11. package/src/adapters/claude-code/bin/nightly.ts +1 -0
  12. package/src/adapters/claude-code/bin/runner.ts +7 -1
  13. package/src/adapters/claude-code/doctor.ts +582 -18
  14. package/src/adapters/claude-code/hooks.ts +156 -20
  15. package/src/adapters/claude-code/night-catch-up.ts +543 -0
  16. package/src/adapters/claude-code/night-run.ts +70 -10
  17. package/src/adapters/claude-code/standdown.ts +10 -1
  18. package/src/adapters/cli/bin/counterparts.mjs +8 -0
  19. package/src/adapters/cli/commands.ts +94 -88
  20. package/src/adapters/cli/desktop.ts +25 -3
  21. package/src/adapters/cli/help.ts +2 -1
  22. package/src/adapters/cli/install.ts +51 -2
  23. package/src/adapters/cli/wire.ts +12 -49
  24. package/src/adapters/config.ts +19 -0
  25. package/src/adapters/dashboard/NOTES.md +36 -0
  26. package/src/adapters/dashboard/bin/dashboard.mjs +8 -0
  27. package/src/adapters/dashboard/bin/dashboard.ts +10 -4
  28. package/src/adapters/dashboard/registries.ts +30 -0
  29. package/src/adapters/dashboard/upgrade.ts +15 -3
  30. package/src/adapters/dashboard/web/flow.ts +12 -0
  31. package/src/adapters/dashboard/web/lanes.ts +8 -0
  32. package/src/adapters/dashboard/web/narrate.ts +86 -2
  33. package/src/adapters/dashboard/web/pages/health/sections/archive.js +22 -10
  34. package/src/adapters/dashboard/web/pages/health/sections/checks.js +39 -2
  35. package/src/adapters/dashboard/web/pages/health/sections/wake.js +43 -4
  36. package/src/adapters/dashboard/web/pages/memories/index.js +1 -1
  37. package/src/adapters/dashboard/web/pages/self/sections/dreams.js +4 -2
  38. package/src/adapters/dashboard/web/pages/self/sections/settling.js +6 -1
  39. package/src/adapters/dashboard/web/pages/self/self.css +1 -0
  40. package/src/adapters/dashboard/web/server.ts +8 -8
  41. package/src/adapters/dashboard/web/views/dreams.ts +20 -1
  42. package/src/adapters/dashboard/web/views/health.ts +182 -25
  43. package/src/adapters/fired.ts +21 -1
  44. package/src/adapters/hosts.ts +54 -1
  45. package/src/adapters/launch.mjs +30 -0
  46. package/src/adapters/lifecycle.ts +93 -11
  47. package/src/adapters/log/index.ts +12 -0
  48. package/src/adapters/mcp/CONTRACT.md +197 -27
  49. package/src/adapters/mcp/NOTES.md +283 -1
  50. package/src/adapters/mcp/bin/serve.mjs +8 -0
  51. package/src/adapters/mcp/bin/serve.ts +46 -2
  52. package/src/adapters/mcp/deliberate.ts +222 -631
  53. package/src/adapters/mcp/facts.ts +1082 -0
  54. package/src/adapters/mcp/index.ts +27 -7
  55. package/src/adapters/mcp/meaning.ts +1415 -0
  56. package/src/adapters/mcp/server.ts +1011 -162
  57. package/src/adapters/mcp/tools.ts +180 -46
  58. package/src/adapters/mcp/write-up.ts +124 -27
  59. package/src/adapters/node-hooks.mjs +108 -0
  60. package/src/adapters/runtime.ts +126 -0
  61. package/src/adapters/sessions.ts +305 -34
  62. package/src/core/briefing.ts +8 -2
  63. package/src/core/counterpart.ts +707 -42
  64. package/src/core/coverage/INTERFACE-GAPS.md +11 -9
  65. package/src/core/dream/CONTRACT.md +37 -3
  66. package/src/core/dream/NOTES.md +86 -0
  67. package/src/core/dream/feeling-weeks.ts +198 -0
  68. package/src/core/dream/index.ts +181 -23
  69. package/src/core/dream/reflect.ts +333 -84
  70. package/src/core/dream/tunables.ts +24 -4
  71. package/src/core/encode/NOTES.md +7 -0
  72. package/src/core/encode/words.ts +45 -0
  73. package/src/core/fit/NOTES.md +36 -1
  74. package/src/core/fit/index.ts +37 -0
  75. package/src/core/handoff/CONTRACT.md +39 -6
  76. package/src/core/handoff/NOTES.md +56 -1
  77. package/src/core/handoff/index.ts +116 -5
  78. package/src/core/handoff/last-here.ts +225 -7
  79. package/src/core/mint.ts +24 -1
  80. package/src/core/physics/CONTRACT.md +3 -1
  81. package/src/core/physics/NOTES.md +3 -1
  82. package/src/core/physics/index.ts +2 -1
  83. package/src/core/recall/CONTRACT.md +49 -18
  84. package/src/core/recall/NOTES.md +124 -7
  85. package/src/core/recall/activate.ts +89 -14
  86. package/src/core/recall/feeling-ask.ts +345 -20
  87. package/src/core/recall/index.ts +3 -1
  88. package/src/core/recall/session.ts +22 -2
  89. package/src/core/recall/time-ask.ts +389 -0
  90. package/src/core/remember/NOTES.md +8 -0
  91. package/src/core/remember/proposals.ts +22 -1
  92. package/src/core/revision.ts +13 -1
  93. package/src/core/schemas/CONTRACT.md +8 -0
  94. package/src/core/schemas/NOTES.md +17 -0
  95. package/src/core/schemas/aliases.ts +55 -5
  96. package/src/core/schemas/index.ts +93 -1
  97. package/src/core/self/CONTRACT.md +53 -5
  98. package/src/core/self/INTERFACE-GAPS.md +5 -0
  99. package/src/core/self/NOTES.md +174 -0
  100. package/src/core/self/behind.ts +43 -3
  101. package/src/core/self/briefing.ts +76 -11
  102. package/src/core/self/chapter-address.ts +254 -0
  103. package/src/core/self/covered.ts +104 -0
  104. package/src/core/self/episodes.ts +38 -1
  105. package/src/core/self/identity.ts +57 -1
  106. package/src/core/self/index.ts +174 -7
  107. package/src/core/self/tunables.ts +25 -3
  108. package/src/core/self/work.ts +242 -0
  109. package/src/core/self/writer.ts +57 -2
  110. package/src/core/sleep/NOTES.md +9 -1
  111. package/src/core/sleep/consolidate.ts +59 -7
  112. package/src/core/sleep/index.ts +3 -0
  113. package/src/core/sleep/types.ts +7 -0
  114. package/src/core/store/CONTRACT.md +16 -0
  115. package/src/core/store/NOTES.md +76 -0
  116. package/src/core/store/db.ts +29 -6
  117. package/src/core/store/feelings.ts +14 -1
  118. package/src/core/store/index.ts +452 -16
  119. package/src/core/store/operational.ts +95 -2
  120. package/src/core/store/owner-op-seam.ts +23 -0
  121. package/src/core/types.ts +21 -0
  122. package/tools/install-loop/run.sh +94 -90
package/CHANGELOG.md CHANGED
@@ -1,5 +1,330 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.12 — 2026-10-08
4
+
5
+ `recall` now asks which kind of question it is. Facts mode answers with every match,
6
+ counted and paged, each fact saying who said it, when it happened and whether it still
7
+ holds; meaning mode lays out a person's, a project's or a feeling's arc across chapters.
8
+ Memories record when the thing happened, who said it and what kind of thing it is, and
9
+ are linked to the people and projects they name. The nightly run reads its whole bundle
10
+ again (every tool result stays under 40,000 characters), and doctor checks what reached
11
+ the model, not only what ran. **The store's format changes (v11 → v12).** The first
12
+ process that writes to the store after the install copies it to
13
+ `snapshots/<time>-pre-migration-v11-to-v12` and then upgrades it; 0.3.11 cannot open a
14
+ v12 store, so going back to 0.3.11 means putting that copy back, and what was remembered
15
+ since is lost.
16
+
17
+ Deliberate recall: two modes, and what a memory records (#321, #322, #323).
18
+
19
+ - **`recall` asks which kind of question it is.** A question now needs `mode`: `facts` (what
20
+ happened, who said it, when, and whether it still holds) or `meaning` (how something went
21
+ and what it adds up to). There is no default; a question without one is refused with the
22
+ two modes named. `ids` and `handle` are unchanged and take no mode, and `ids` / `handle`
23
+ now also read one chapter by its address, `epi_…#2`. The vivid / quiet / dim tiers are
24
+ gone.
25
+ - **Facts mode answers with every match.** It considers every memory the question's words
26
+ reach, every memory about a person or project it names, and the 100 closest by meaning,
27
+ and ranks them by how strongly and how many ways they matched. The answer opens with a
28
+ count (`12 match · showing 10 · 2 more → page 2`) and pages with `page: 2`. Each fact says
29
+ who said it, what kind of thing it is, when it happened and when it was learned, and whether
30
+ it is current, with earlier versions folded under it. A time in the question ("last week",
31
+ "in September", "around the cut-over", "where did we leave off") keeps only what is inside
32
+ it and counts the rest. Memories that faded from long disuse are listed after the results.
33
+ Quoting the words of a fact it showed you now counts as using that memory, as opening it by
34
+ id does. `counterparts ask` answers in facts mode too; `--full` prints the whole answer.
35
+ - **Meaning mode lays out an arc.** Asked about a person, a project or "us", or about a
36
+ feeling, it shows the chapters that hold the subject in time order, the feelings in each
37
+ with whose they are, earlier readings from dreams and reflections, and what is still open,
38
+ for you to read what it adds up to. Faded means the same in both modes.
39
+ - **Memories record when it happened, who said it, and what kind of thing it is (schema
40
+ v12).** `note`, each `session_end` entry (write-ups included) and a dream's gist take three
41
+ optional fields: `occurredOn` (a day, month, range or year — resolve "last week" to a date
42
+ while you know it), `saidBy` (owner, self, inferred) and `status` (done, planned, proposed,
43
+ asked). One that cannot be read is dropped and said beside the memory, which is stored all
44
+ the same; revising a memory by its id carries them over unless new ones are sent. Facts mode
45
+ reads them (above); old memories say "speaker unknown", and doctor's new `Write fields` line says how
46
+ often each one is filled. The upgrade copies the store first, as every upgrade does; old
47
+ memories keep empty fields.
48
+ - **Memories are linked to the people and projects they name.** Each memory is linked at its
49
+ write to the entity cards its words name, a new card links the memories already naming it,
50
+ and the memories from before the upgrade are linked once at the first open after it. Both
51
+ recall modes read the links; a possessive ("Han's") names the card too.
52
+ - **A chapter has an address.** `epi_…#2` names the second chapter of an episode and resolves
53
+ to its heading, its text, the stretch it wrote up and the memories its session wrote in that
54
+ stretch. Chapters now record the moment they were written. Meaning mode names chapters this
55
+ way, and `recall` with `ids` or `handle` opens one.
56
+
57
+ Follow-ups from 0.3.11 (#318, #319).
58
+
59
+ - **`docs/HANDOFF.md` is no longer in the repository.** The note one session leaves for the
60
+ next is written locally and ignored; its history stays.
61
+ - **The wake is rebuilt after an install.** Until now the first wakes after an upgrade were
62
+ the ones the old version composed, until the next write-up or nightly run, so a question
63
+ the new version closes stayed in "Still open". Now the first turn-end after an install
64
+ re-renders it: the session that was open during the install wakes once more with the old
65
+ wake, and every session after it with the new.
66
+ - **A memory server left open across an install says so.** Every tool result, not only
67
+ Desktop's wake, now carries a line saying Counterparts was updated and how to reconnect,
68
+ because until then the server ignores anything newer, such as a field added to a tool. This
69
+ starts with the servers of this version; one from before it says nothing.
70
+ - **Your own Claude Code sessions are the owner's in the memory tools too.** The hooks already
71
+ were; the memory server was not, so closing an open question from another directory was
72
+ refused while the wake dropped it from "Still open" anyway. Now the server Claude Code starts
73
+ takes the install's `"owner": true`, and so does a Claude Code session from Desktop's Code
74
+ tab: it can close a question opened anywhere, and confidential memories are said in its
75
+ answers. A dream's and a reflection's bundles still leave confidential memories out, on
76
+ every server. A Desktop chat is unchanged, the nightly run keeps its old stance, and
77
+ `COUNTERPARTS_OWNER=0` on the server's launch turns it off. A close that is still refused
78
+ now leaves the question in "Still open". Nothing to reinstall: it takes effect on upgrade,
79
+ once the memory server reconnects.
80
+ - **"Work here" takes turns.** When a directory has more work than the wake shows, the newest
81
+ line stays first and the others rotate from one day to the next, so the older work comes
82
+ round too. A wake that had more work lines than it carried leaves a record, which doctor
83
+ and the dashboard's wake bar read.
84
+ - **Doctor sees what a session start could not carry.** A hook's output past Claude Code's
85
+ 10,000-character cap, a session start over its reported ceiling, a notice dropped to make
86
+ room, a part that waited for room, and a handoff or "Last here" line with no room are now
87
+ recorded and read on the Wake line; the first two turn it amber. The Reflection line says
88
+ how long a share has been waiting to be told.
89
+ - **Claude Desktop: wake first, and Always allow.** A Desktop chat whose tools still asked
90
+ permission never called `wake`, answered "what do you remember about yesterday" from a
91
+ search alone, and called that the full record. The install, the quickstart, the help and
92
+ doctor's Claude Desktop line now say to set the counterparts tools to Always allow; the
93
+ server's instructions and the `wake` tool tell the model to wake first in every new chat
94
+ and never to present a search as the complete record.
95
+ - **Doctor's Spawn line sees a step that failed two days running.** It read only today's
96
+ failures, so "the same step failed today and yesterday" could never be said.
97
+
98
+ The night run's bundles, and what reached the model (#315).
99
+
100
+ - **The nightly run reads its whole bundle again.** Claude Code does not hand a tool result
101
+ over 50,000 characters to the model: it saves it to a file and shows a 2 KB preview, and the
102
+ headless run cannot open the file. On the nights of 10-01 and 10-02 the dream's first part
103
+ and its second, and the reflection's first, went that way, so the dream read about a third
104
+ of what it was given. Every tool result is now kept under 40,000 characters: the dream and
105
+ the reflection come in more, smaller parts, and the page writer's day shrinks to fit beside
106
+ the page. A result that would still be too long is cut there, with a note saying so to the
107
+ model, instead of vanishing.
108
+ - **Doctor checks what reached the model, not only what ran.** A new Tool results line goes
109
+ amber when a result was cut to fit, or when a dream or reflection finished without reading
110
+ a part it was handed. A new Wake line goes amber when a session's wake arrived cut short.
111
+ The Spawn line goes amber when the background worker failed after it last started, or the
112
+ same step failed two days running, and the Self page line says when the wake shows only the
113
+ start of a long page.
114
+
115
+ Feelings, round 3 (#317).
116
+
117
+ - **The nightly reflection sees how feelings ran over the last four weeks.** Its bundle now
118
+ carries a short pattern, a few hundred characters: how many feelings of each kind were
119
+ recorded each week, mine and the owner's apart, what changed over the last two weeks, and
120
+ the memories that pattern rests on, so it can cite them. It is counted from the recorded
121
+ feelings, not from the text. It may say the pattern on the self page in its own words,
122
+ citing those memories.
123
+ - **A memory can be felt again during a session.** When an old memory comes up and feels
124
+ different now, `note` takes `feelingsNow`, with or without text. It records how the memory
125
+ feels now beside the original feeling, which stays, the same way the nightly reflection
126
+ does. It works only on a memory this session was shown, at most once a day per memory. The
127
+ feeling is marked as recorded later, while awake. The core counts it only when it would
128
+ count a feeling a reflection recorded later. Doctor's Reflection line says how many there
129
+ are in all, how many are strong enough for the core's fast lane, and how many are the
130
+ owner's. A memory such a feeling carries to the core is said apart from one a reflection's
131
+ feeling carried ("became core on a feeling recorded looking back in a session"), and the
132
+ morning share names only a reflection's.
133
+ - **The reflection is offered unmarked memories to mark.** A fact written in a project with
134
+ no "about" mark counts as that project's work. So a personal one, like a note about a
135
+ person, showed under "Work here". Each night the reflection is now offered up to five
136
+ memories nobody has marked. Those with a feeling, an entity, or the owner's name come
137
+ first, then the most used, then the oldest. It is asked to mark each as owner, us, work or
138
+ world. A mark the writer set is never offered to be changed.
139
+ - **Fixed: a dream's merge no longer re-dates feelings.** Every feeling a merge carried used
140
+ to be dated to the merge night. Each now keeps the moment it was first recorded, as trait
141
+ nudges already did. A merge no longer sets the next morning's mood either.
142
+ - **Fixed: "fear" in a question now reaches scared and frightened, not only afraid.** A word
143
+ the wheel reads as an alias (fear, thankful, touched) now counts as its wheel word.
144
+
145
+ ## 0.3.11 — 2026-10-01
146
+
147
+ The nightly run now writes up the sessions that ended before they were written up, in
148
+ any directory, before it writes the page, and the wake gets a dated "Yesterday" line.
149
+ The wake splits work from personal: "Work here" lists the work done in the directory the
150
+ session opens in, and Nearby keeps what is personal, so a session in one project no
151
+ longer wakes to another project's plumbing. Counterparts runs under Node 22.15 or newer,
152
+ and on Linux. Claude Desktop's Code tab files its memories under its own session again,
153
+ asking by feeling finds more of what was felt, and the wake says when a handoff may be
154
+ out of date. **The store's format does not change** (still v11): nothing is upgraded and
155
+ no pre-migration copy is taken, and 0.3.10 can open a store 0.3.11 has used.
156
+
157
+ The morning catch-up and the "Yesterday" line (#308).
158
+
159
+ - **The nightly run writes up what was left unwritten, in any directory, before it
160
+ writes the page.** Until now a conversation that ended before it was written up waited
161
+ for the next session opened in the same directory, and a project nobody reopened within
162
+ two days of use simply let it lapse. Now, when the day's first prompt starts the
163
+ nightly run (dreaming `auto`), a short `claude -p` of its own goes first: it is allowed
164
+ one tool (`session_end`), and it writes up at most 4 sessions or about 96 KB of their
165
+ words a night, oldest first. What it leaves stays owed, for another night or a session
166
+ in its directory. It costs one more `claude -p` start on a night with something owed,
167
+ and nothing on a night without. That run can only write up: it can't write memories
168
+ of its own, notes, chapters or handoffs. A run that stops early (a usage limit, say)
169
+ is recorded as partial, and one whose process was killed has its permission ended at
170
+ the next run.
171
+ - **A written-up memory belongs to the conversation it came from.** It carries that
172
+ session and its directory, is marked as written up second-hand (and by whom), and its
173
+ "happened" date is the day the conversation was lived. Its "learned" date stays the day
174
+ it was written. The page writer reads it on the day it happened, not the day it was
175
+ written. This is true of the in-session catch-up too.
176
+ - **The writer now sees both sides.** The part handed over carries the session's own
177
+ replies, labelled `[its reply]` and each cut at about 1.5 KB, beside what was said to
178
+ it. A part may hold a little less of what was said than before.
179
+ - **Two writers never write the same stretch.** Whoever fetches a stretch holds it until
180
+ it comes back (at most two hours). The session-start pointer passes over one the
181
+ nightly run holds, and a session that tries to fetch one gets "the nightly run is
182
+ writing that session up now".
183
+ - **A conversation that crashed without an end can be written up from another
184
+ directory.** "Ended" is now read the same way the rest of the write-up rule reads it:
185
+ nothing captured since the date changed. A refusal always says why.
186
+ - **The wake has a "Yesterday" line**: yesterday's chapter titles with their ids, with
187
+ the date in the line ("Yesterday, 09-30: …"), so a wake composed late at night still
188
+ reads right in the morning. It takes its room from the wake's existing budget.
189
+ - **`counterparts doctor`** says what the nightly run's catch-up did (written up, left
190
+ owed) on the Nightly run and Write-ups lines, and counts yesterday's Claude Desktop
191
+ chats as unmeasured rather than lost. `counterparts log` shows an
192
+ `adapter.night.writeup` line for it.
193
+
194
+ The wake: work here, and what is personal (#313).
195
+
196
+ - The wake's craft lane is now the work done in the directory the session opens in: "Work
197
+ here, if it helps:" lists that directory's newest few work memories (marked `work`, or
198
+ unmarked skills and facts written there), each a title, a short excerpt and its id.
199
+ Nearby keeps what is personal, so a session in one project no longer wakes to another
200
+ project's plumbing.
201
+ - The chapter tool takes `about` (me, us, owner, work or world), and the chapter's memory
202
+ copy keeps it. A chapter marked me, us or owner reaches the wake in other directories;
203
+ one marked work stays in its own.
204
+ - `note` and `session_end` entries take `unresolved: true` for an open question or a
205
+ promise still pending; the wake shows those under "Still open:" (at most five). A later
206
+ write that `updates` one with `unresolved: false`, or with `how: "changed"` and the
207
+ answer, closes it.
208
+ - The end-of-session ask (and Desktop's write-up ask) now says to close anything dated or
209
+ open that got done in the session, so a finished follow-up stops coming back.
210
+ - The day's lines (the dream line, the night run's report, plain reminders, the update
211
+ notice) go only to a session someone can see: the terminal or Desktop's Code tab, not
212
+ `claude -p` or the SDK. A headless session can still start the nightly run, and the next
213
+ session you are in says so. The assistant now says the day's dream line itself, once, in
214
+ its first reply; the terminal line is extra.
215
+
216
+ Node and Linux (#312).
217
+
218
+ - **Runs under Node 22.15 or newer, and on Linux.** `npm install -g counterparts` works
219
+ without bun. The setup wires Claude Code to whichever runtime ran it (`bun run …` under
220
+ bun, `node --import …/node-hooks.mjs …` under Node), and `counterparts doctor` has a
221
+ Runtime line naming it and saying whether it is still there. The four commands now
222
+ start under bun when bun is on PATH, else Node. On Linux, `install --host
223
+ claude-desktop` says Claude Desktop is not available there instead of writing a config.
224
+ Tested on Node 22 and 24, macOS and Linux (Debian, arm64); no daily user on Node yet.
225
+
226
+ Continuity, round 2 (#311).
227
+
228
+ - A handoff that may be out of date says so at the wake: "written 09-30 18:45 by session
229
+ a1b2c3d4, before 0.3.10 was installed" when an older release wrote it, or "a newer chapter
230
+ here since" when another session wrote a chapter in that directory after it. The end-of-
231
+ session ask now says any session may retire a handoff here whose work is done.
232
+ - Recalled by its id, a handoff says who wrote it and when, not "an earlier session" and the
233
+ date its row was first made.
234
+ - "Last here" shows the first sentence of the chapter the episode's title was written with
235
+ (and "2 chapters" when there are more), not a later chapter's under the first one's title.
236
+ A question about time in recall does the same (for "yesterday" or "this morning", the first
237
+ chapter written then), and says how many chapters there are.
238
+ - A note written before the memory server knows its session is filed under the session its
239
+ host opened in that directory, when that match is exact. An older such note, written
240
+ inside exactly one session's stretch, says "session a1b2c3d4 (placed by when it was
241
+ written)".
242
+ - Nearby leaves out what the self page already says, a memory a later one has settled
243
+ (changed or corrected), and a memory already under Arriving; and it no longer ends with a
244
+ "(331 more nearby; recall ids…)" line.
245
+ - A chapter about me written in another directory reaches the wake elsewhere, as one line,
246
+ when its memory is marked about me, us or the owner, the directory it came from is on, and
247
+ it is not confidential. A confidential chapter is named in "Last here" to the owner only.
248
+ - A "Last here" line dropped for room now leaves a record, and the dashboard's Health wake
249
+ bar goes amber for it.
250
+ - recall says why `considered` can be above `consideredCap` (links between memories and a
251
+ feeling the question named have their own bounds).
252
+ - With only Claude Desktop, an older store waiting for its upgrade says to open Desktop or
253
+ start a new chat in it, not to quit and reopen it.
254
+
255
+ Claude Desktop's Code tab (#309).
256
+
257
+ - Claude Desktop's Code tab files its memories under its own session again. There, the
258
+ counterparts tools the assistant sees turned out to be Claude Desktop's memory server, not
259
+ the session's own (both are named `counterparts`, and Desktop's wins), so a Code-tab
260
+ session's notes, chapters and write-ups were filed under the most recent Desktop chat, or
261
+ refused. Now the Code tab's wake gives the assistant one line with its session id, and a
262
+ call that passes that id is filed exactly as Claude Code would file it: in that session's
263
+ folder, under that session, with no Desktop write-up reminder added. Only a session Claude
264
+ Code's hooks recorded, and that is still running, is taken this way, and only for that one
265
+ call, so it can't spill into a Desktop chat's next call. A Code-tab call that passes no id
266
+ still lands under the most recent Desktop chat; its result now says which chat, and tells a
267
+ Claude Code session to pass its own id. The `wake` tool's description no longer says it is
268
+ never offered in Claude Code, and doctor's Claude Desktop line says the Code tab's tools
269
+ come from Desktop's server. Terminal sessions are unchanged. Each prompt now also marks
270
+ its session as still running, so a Code-tab session left idle for hours is recognised
271
+ again at its next prompt, and a call whose session id wasn't accepted says why.
272
+
273
+ Recall by feeling, round 2 (#310).
274
+
275
+ - Asking recall by feeling finds more of what was felt. Any feeling word reaches its family on
276
+ the wheel: "when was I afraid", with nothing recorded as afraid, answers with the strongest
277
+ uneasy moments, and a moment recorded as afraid still comes first. Everyday words off the
278
+ wheel ("shame", "dread", "relief"), forms like "happiest" or "sadness", and phrases like
279
+ "caught out" are understood, and so is your name in the possessive ("Mike's feelings"). Asking for the most, the
280
+ strongest, or "ever" ranks by how strongly something was felt at the time, not by how fresh
281
+ it is. Memories that only talk about feelings (notes on the wheel itself, say) no longer
282
+ crowd out the moments that were actually felt.
283
+
284
+ Dashboard Health (#306).
285
+
286
+ - A full wake is the normal state, so the Health wake bar is green for it ("The wake is
287
+ full — normal: …"). It turns amber only when being full cost something (the self page
288
+ cut or left out, a handoff a session start had no room for, the page writer held back
289
+ for room), and the line names the cost.
290
+ - The archive list shows one line per memory: a chapter's copies are one item that says
291
+ how many times, and opens the newest.
292
+ - The folded rows under "all fine" use the same plain words as the main rows ("… —
293
+ harmless; nothing to do") and no longer say "You may remove".
294
+ - The last sleep shown is the last one that did something, not a check that found
295
+ nothing to do. The map's `?` describes the three named rings.
296
+ - The Lookups row is "Looked up in dreams and reflections", in doctor's words. A dream's
297
+ start says how many memories wait for the next night and how many aged out, and a merge
298
+ the dream saw less than whole says so ("seen only as a line").
299
+
300
+ Small fixes (#307).
301
+
302
+ - The wake's "Arriving:" lines say when each thing is due, not only when it was learned:
303
+ `2026-09-27 (due 2026-10-03) · …`.
304
+ - When the console or the dashboard meets a store still waiting for its upgrade, it says who
305
+ will upgrade it in your hosts' words: with only Claude Desktop it no longer tells you to
306
+ wait for a Claude Code session.
307
+ - Whoever rewrites the self page (the page writer, or the nightly reflection) is asked to name
308
+ the model when a claim is about one model, to write dates rather than "tonight" or
309
+ "today" (the page is read on later days), and not to add a revised-on line of its own.
310
+ - Wake labels: the line under the header no longer also starts "Counterparts memory", and it
311
+ says only the listed memories open with a date (the page is dated on its own line); a
312
+ memory whose words already start with its date shows that date once; and the closing
313
+ comment says `page=1` beside `identity=0` when the wake carries the page.
314
+ - The install loop (`tools/install-loop`, in the package) reads what it captured with a
315
+ here-string, so a long output can no longer fail a check that had matched.
316
+
317
+ Not proven here.
318
+
319
+ - No one uses Counterparts on Node daily yet. Linux was tested on arm64 Debian, in a
320
+ container. Dreaming and the nightly run under Node go through the same wiring, but
321
+ were not run, since that needs a real `claude`. Windows was not attempted.
322
+ - The night catch-up was checked in tests and in a throwaway home with a stand-in
323
+ `claude` that drives the memory server as the real one's single tool would, never with
324
+ a real `claude -p` or on a real store.
325
+ - The Code tab's sessions were measured read-only on a real Desktop, and the serving was
326
+ checked in tests, not on a day's real use.
327
+
3
328
  ## 0.3.10 — 2026-09-30
4
329
 
5
330
  Feelings now sit on a new wheel of seven cores — happy, warm, calm, curious, sad,
package/README.md CHANGED
@@ -10,7 +10,8 @@ its memories itself, and they fade and grow the way yours do. It runs today with
10
10
 
11
11
  ## Install
12
12
 
13
- You need [bun](https://bun.sh) 1.3 or newer (`npm install` won't work; it needs bun).
13
+ You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer.
14
+ macOS and Linux.
14
15
 
15
16
  ```
16
17
  curl -fsSL https://bun.sh/install | bash # if you don't have bun
@@ -18,6 +19,9 @@ bun add -g counterparts
18
19
  counterparts
19
20
  ```
20
21
 
22
+ With Node instead: `npm install -g counterparts`, then `counterparts`. Whichever runtime
23
+ runs the setup is the one Claude Code's hooks and memory tools are wired to.
24
+
21
25
  `counterparts` walks you through setup: your name and connecting Claude Code. No API
22
26
  keys. Then restart Claude Code and check it:
23
27
 
@@ -106,8 +110,10 @@ More: [`docs/ELI5.md`](docs/ELI5.md) (the whole system in plain words) and
106
110
 
107
111
  ## Status
108
112
 
109
- Early. It's been the author's daily memory since September 2026. It runs on bun only;
110
- Node is untested. Expect rough edges, and please
113
+ Early. It's been the author's daily memory since September 2026, on bun and macOS; Node
114
+ (22.15+) and Linux pass a smoke test and an install run but have no daily user yet.
115
+ Claude Desktop has no Linux build, so on Linux it is Claude Code only. Expect rough
116
+ edges, and please
111
117
  [open an issue](https://github.com/mlapeter/counterparts/issues) when you hit one.
112
118
 
113
119
  There are no API keys, and nothing leaves your machine except through Claude Code
@@ -2,8 +2,9 @@
2
2
 
3
3
  ## Install
4
4
 
5
- You need [bun](https://bun.sh) 1.3 or newer. Counterparts runs on bun only; Node is
6
- untested.
5
+ You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer,
6
+ on macOS or Linux. With Node, install with `npm install -g counterparts` instead of the
7
+ `bun add` line below; the rest is the same.
7
8
 
8
9
  ```
9
10
  curl -fsSL https://bun.sh/install | bash # if you don't have bun
@@ -33,6 +34,11 @@ nothing leaves it except through Claude Code itself.
33
34
 
34
35
  Your memory lives in `~/.counterparts/`.
35
36
 
37
+ **Claude Desktop** (macOS): `counterparts install --host claude-desktop` connects its chats to
38
+ the same memory. Then, in Claude Desktop, set the counterparts tools to **Always allow**, or a
39
+ chat cannot wake on its own: Desktop asks before each tool, and until it may, the model does
40
+ not call one nobody asked for.
41
+
36
42
  To set it up from a script, with no questions:
37
43
 
38
44
  ```
package/docs/README.md CHANGED
@@ -16,8 +16,8 @@ has it; every other page is a working default or a record of what happened.
16
16
  ## Where the work is going
17
17
 
18
18
  - [`ROADMAP.md`](ROADMAP.md) — the plan for the current round.
19
- - [`HANDOFF.md`](HANDOFF.md) — the note one session leaves for the next. The newest section is
20
- on top; everything below it is history.
19
+ - `HANDOFF.md` — the note one session leaves for the next. It is written locally and is not in
20
+ the repository (ignored since 2026-10-02).
21
21
  - [`IMPROVEMENTS.md`](IMPROVEMENTS.md) — things noticed while living on it, as opposed to
22
22
  building it.
23
23
  - [`new-user-findings.md`](new-user-findings.md) — what the first install from npm was like.
@@ -41,7 +41,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
41
41
  | adapter | job |
42
42
  |---|---|
43
43
  | `claude-code/` | Hooks: Claude Code's five events driving the host lifecycle (`lifecycle.ts`, below) — its payload translation, JSON envelope and the room it measures, transcript reader and wake-arrival check, the Stop ask's words, the first-launch question, the update and doctor notices, the dream line, and the headless nightly run (`night-run.ts`, `claude -p`, **2026-09-29**). The launch adapter. |
44
- | `mcp/` | Deliberate tools, nine: note, recall, status — plus the Stop ask's two return channels, `session_end` (memories, and the next-session write-up's door) and `chapter` (the episode's own journal, **added 2026-09-04**, because the ask named a door no adapter had built) — `scope` (this directory's setting, **2026-09-15**), `self_page` (the page the wake opens with, **2026-09-18**), `dream`, the dreamer's phases (**added 2026-09-26**), and `reflect`, the waking self's (**added 2026-09-27**). A result's words about the host come from `hosts.ts`. For a Claude Desktop client (by its name at `initialize`, **2026-09-30**) a tenth, `wake` — Desktop's session start, since it has no hooks — plus per-call binding to the most recent live Desktop session, the write-up ask on a tool result, and a "Start with Counterparts" prompt; a Claude Code client sees none of it. |
44
+ | `mcp/` | Deliberate tools, nine: note, recall, status — plus the Stop ask's two return channels, `session_end` (memories, and the next-session write-up's door) and `chapter` (the episode's own journal, **added 2026-09-04**, because the ask named a door no adapter had built) — `scope` (this directory's setting, **2026-09-15**), `self_page` (the page the wake opens with, **2026-09-18**), `dream`, the dreamer's phases (**added 2026-09-26**), and `reflect`, the waking self's (**added 2026-09-27**). A result's words about the host come from `hosts.ts`. For a Claude Desktop client (by its name at `initialize`, **2026-09-30**) a tenth, `wake` — Desktop's session start, since it has no hooks — plus per-call binding to the most recent live Desktop session, the write-up ask on a tool result, and a "Start with Counterparts" prompt; a Claude Code client sees none of it. `recall` (**2026-10-03**) answers a question in the mode it names — facts (`facts.ts`, with `recall/time-ask.ts`) or meaning (`meaning.ts`) — and an address (`ids`, `handle`, `epi_…#N`) in `deliberate.ts`. |
45
45
  | `cli/` | `counterparts` command — the full list is `COMMANDS` in `cli/commands.ts`: status, install, connect / disconnect (the host's two files), `install --host claude-desktop` (Desktop's config entry, **2026-09-30**), uninstall, start-fresh, init, owner operations (note, ask, export, backup, remove, verify, repairs, rebrief), the readings (doctor, mechanisms, log, coverage, version, help), scope, self-page, dream, core, settle, and dashboard. |
46
46
  | `dashboard/` | The owner's window (constitution line 16): brain-view, revision stories, band/protected lists. Observer-mode by construction; minimal version ships DURING the parallel run. **Added 2026-08-25 (owner elevation).** |
47
47
  | `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. Since **2026-09-30** Claude Desktop's MCP server writes its own records here (its `wake`), refreshed per call, and a runner's record can list the ended sessions a launcher granted it to write up (`mayWriteUp`). |
@@ -54,7 +54,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
54
54
  | `spawn.ts` | The detached worker's plan and start (`planSpawn`, `spawnDetached`): watchdog checked against the staleness window, environment pinned last. Moved out of `claude-code/` on **2026-09-30** so any host's adapter can start the same worker. |
55
55
  | `fired.ts` | Which mechanisms have fired and which have gone quiet, read only from the store's rows — `counterparts mechanisms`, the dashboard's panel. Each entry names the module that does the work. |
56
56
  | `snapshots.ts` | The daily rotating snapshot and its rotation — the one place this package deletes a copy of the memory, and only what it can prove is a snapshot. |
57
- | `stance-env.ts` | `COUNTERPARTS_OBSERVER` / `COUNTERPARTS_OWNER`, read the way the explicit-dir guard is, each failing toward less power. |
57
+ | `stance-env.ts` | `COUNTERPARTS_OBSERVER` / `COUNTERPARTS_OWNER`, read the way the explicit-dir guard is, each failing toward less power. Unset, the configuration's `owner: true` decides for a server Claude Code starts (`mcp/bin/serve.ts#ownerStance`, 2026-10-02). |
58
58
  | `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. |
59
59
 
60
60
  ## Tools (`tools/`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "license": "MIT",
5
5
  "description": "Memory that turns AI tools into counterparts - a local-first, human-memory-modeled memory layer for AI.",
6
6
  "repository": {
@@ -20,13 +20,14 @@
20
20
  ],
21
21
  "type": "module",
22
22
  "engines": {
23
- "bun": ">=1.3.0"
23
+ "bun": ">=1.3.0",
24
+ "node": ">=22.15.0"
24
25
  },
25
26
  "bin": {
26
- "counterparts": "./src/adapters/cli/bin/counterparts.ts",
27
- "counterparts-hook": "./src/adapters/claude-code/bin/hook.ts",
28
- "counterparts-mcp": "./src/adapters/mcp/bin/serve.ts",
29
- "counterparts-dashboard": "./src/adapters/dashboard/bin/dashboard.ts"
27
+ "counterparts": "./src/adapters/cli/bin/counterparts.mjs",
28
+ "counterparts-hook": "./src/adapters/claude-code/bin/hook.mjs",
29
+ "counterparts-mcp": "./src/adapters/mcp/bin/serve.mjs",
30
+ "counterparts-dashboard": "./src/adapters/dashboard/bin/dashboard.mjs"
30
31
  },
31
32
  "main": "./src/core/counterpart.ts",
32
33
  "types": "./src/core/counterpart.ts",
@@ -64,6 +65,7 @@
64
65
  },
65
66
  "scripts": {
66
67
  "test": "bun test",
67
- "typecheck": "tsc --noEmit"
68
+ "typecheck": "tsc --noEmit",
69
+ "test:node": "node --import ./src/adapters/node-hooks.mjs --test test/node-smoke.ts"
68
70
  }
69
71
  }
@@ -254,8 +254,10 @@ row, saying which source answered, existed until the keys were removed — §1a.
254
254
  later hook process needs: which configuration was read, whether the first-launch
255
255
  question went out, the wake's sentinel and whether its arrival has been checked, the
256
256
  model that last answered — which the `chapter` tool records per chapter), Stop
257
- refreshes the clock — creating the record when it is missing — and SessionEnd closes
258
- it. The writes
257
+ refreshes the clock — creating the record when it is missing — UserPromptSubmit
258
+ refreshes it too but never creates one (2026-10-01: so a session idle past the TTL
259
+ is live again before its model's first call; a missing record stays the off→on
260
+ signal), and SessionEnd closes it. The writes
259
261
  are atomic (temp + rename), tiny, and silent on failure, because a hook may not fail
260
262
  the host (G2) and SessionEnd's hooks share 1.5 s between them. It exists because this
261
263
  host launches its MCP servers from a static configuration and cannot tell them which
@@ -610,6 +612,21 @@ line is claimed once a day across sessions (`dream_asks`), and again only for a
610
612
  behind (a dream begun and quiet for 30 minutes, or — `auto` — a launch no dream followed),
611
613
  at most twice a day.
612
614
 
615
+ **[M] Only a session someone can see claims the day's told lines (2026-10-01, lane 8, a
616
+ working default).** `hooks.ts#isInteractive`: the host's own `CLAUDE_CODE_SESSION_ATTENDED`
617
+ (`1` / `0`) decides when it is set; otherwise a session whose `entrypoint` is one of
618
+ `sessions.ts#NON_INTERACTIVE_ENTRYPOINTS` (`sdk-cli` is `claude -p`; the SDKs; `mcp`; the
619
+ GitHub action) claims none of them — the dream line, a night run's hand-back, a carried
620
+ share, a raised contradiction, plain reminders (at SessionStart and at a prompt), the update
621
+ notice. An unknown or absent value is a person's. It may still START the day's headless run
622
+ (`startUnwatched`); the line it would have been told is held (`Dreams#holdTold`) and the next
623
+ interactive prompt says it while the run is still going, claimed at delivery (`claimHeld`,
624
+ an event latch per run) — once the run has ended its hand-back tells what it did instead. An
625
+ `ask` is left unclaimed for the next interactive session. Every day's line now tells the
626
+ model to say it ONCE, in its first reply, as one plain sentence (`dream/#sayOnce`); the
627
+ terminal line is the extra. Measured that morning: the day's first prompt came from an SDK
628
+ session with no terminal, which started the run (fine) and claimed the line nobody saw.
629
+
613
630
  **[M] The writer moved out of the wake and into the run (2026-09-28).** The SessionStart ask
614
631
  that handed the first session of a day the day just gone (S2's session mode, 2026-09-20) is
615
632
  RETIRED, and with it its deferral (`no-room`), its contest with the first-launch question
@@ -687,6 +704,27 @@ child's own host-minted session is QUIET (`HookInput.nightRun`, from
687
704
  lines, plain reminders, Stop ask, write-up pointer or first-launch question. It still wakes
688
705
  with the ordinary wake.
689
706
 
707
+ **[M] The morning catch-up runs first (2026-10-01, wake build 3 — held lightly).** A `night`
708
+ run (never a reflection-alone one) writes up owed stretches, in ANY directory, before it
709
+ composes its launch prompt (`night-catch-up.ts#runCatchUp`): every session that owes a
710
+ write-up a person's conversation left (`sessions.ts#pointable`), oldest stretch first,
711
+ bounded by `NIGHT_WRITE_UP_SESSIONS` (4) and `NIGHT_WRITE_UP_BYTES` (96 KB, whole parts;
712
+ the first part always). Its runner is a session id of its own, `writeup-<run>`: the
713
+ launcher writes the grant on the runner's record (`grantWriteUps`) and claims every subject
714
+ (`WriteUpProgress.claim`, with `upTo` the last part allowed tonight) before a SECOND
715
+ `claude -p` starts, pinned to that runner, locked down like the first but with
716
+ `--allowedTools` exactly `mcp__counterparts__session_end`, `NIGHT_WRITE_UP_MAX_TURNS` (40)
717
+ and its own watchdog `NIGHT_WRITE_UP_MS` (10 minutes). When it ends, whatever became of it,
718
+ the claims are let go, the grant withdrawn and the runner's record ended; one durable row
719
+ (`adapter.night.writeup`: granted, written, parts, left owed, over the bound, busy elsewhere,
720
+ state) and a process-log line record it, and doctor's Nightly run and Write-ups lines read
721
+ it. Nothing owed: no child, no row. The run's row carries the catch-up's time on its
722
+ watchdog, so a run still going is not read as lost. A clean exit that stopped short of
723
+ its allowance — some granted session neither written up nor brought to its `upTo` part —
724
+ is recorded `partial`, not `done` (a usage limit exits 0 too; its output is not read); a
725
+ bounded night that did every part it was allowed is `done`. A runner record a killed process left open is ended at the
726
+ next run's start (`endStaleRunners`).
727
+
690
728
  **[M] The person sees it, and a run that cannot do its job falls back to asking.** The prompt
691
729
  hook's `systemMessage` carries "dreaming in the background (a few minutes). Say "no dreams"
692
730
  to turn it off." when the envelope has room (the model's line never claims it was shown).
@@ -718,6 +756,10 @@ did not get.
718
756
  longer the reported injection budget) → plain reminders due today (they wait for the
719
757
  first prompt, unclaimed) → the wake, which is never cut at delivery: it was composed to
720
758
  its own budget at the boundary, trimming hints → craft → threads → horizon → identity.
759
+ The clock line rides with the wake — and, in Desktop's Code tab only (entrypoint
760
+ `claude-desktop`, 2026-10-01), one line under it naming the session id to pass as
761
+ `session`, because there the counterparts tools are Desktop's server
762
+ (`hooks.ts#codeTabSessionLine`; mcp CONTRACT G21). A terminal session's wake is unchanged.
721
763
  A reminder reaches the person only in the JSON form, so when one is due and it fits
722
764
  beside the wake in that form, the two asks are measured against THAT form (escaped,
723
765
  under 9,500) and it is they that give way (review of #285, S2). A wake too full for the
@@ -1880,3 +1880,71 @@ Working defaults, held lightly.
1880
1880
  nightly run's planner still live here; a host that starts either from the MCP server
1881
1881
  needs their paths, not an import. `deliverWriteUpAsk`'s default limit is still this
1882
1882
  host's `HOST_OUTPUT_CHARS`; a tool result has no such cap and should pass its own.
1883
+
1884
+ ## 2026-10-01 — the day's lines reach a session someone can see (lane 8, build 4)
1885
+
1886
+ An SDK session (`claude -p`, `entrypoint: sdk-cli`, ~/general) sent the day's first prompt at
1887
+ 09:00: it started the nightly run and claimed the once-a-day line, which nobody saw. Now
1888
+ `isInteractive` gates every told line (dream line, hand-back, carried share, raised
1889
+ contradiction, plain reminders, update notice). A headless session still starts the run
1890
+ (`startUnwatched`) and holds its line (`Dreams#holdTold`); the next interactive prompt says it
1891
+ if the run is still going, claimed at delivery (`claimHeld`, `deliverTurn`'s `held` branch,
1892
+ stripped from the model's context when the claim is lost). The model is told to say the line
1893
+ once in its first reply, one plain sentence. Not gated: the doctor notice (it returns at the
1894
+ next start) and the write-up pointer (a headless session can do a write-up).
1895
+
1896
+ Review of #313: Claude Code exports `CLAUDE_CODE_SESSION_ATTENDED` to the processes it
1897
+ starts. Measured in a terminal session's child: `1`, beside `CLAUDE_CODE_ENTRYPOINT=cli`. Not
1898
+ measured under `claude -p`. When the variable says `1` or `0` it decides `isInteractive`; the
1899
+ entrypoint list is the fallback when it is absent or unreadable (`bin/hook.ts#attendedOf`).
1900
+
1901
+ ## 2026-10-02 — what reached the model, not what ran
1902
+
1903
+ The night of 10-02 the dream read a third of its bundle (Claude Code saved the rest to a file the
1904
+ run cannot open) and every doctor line stayed green: Lookups counts look-ups, Nightly run a run
1905
+ that finished. New lines: **Tool results** (`resultFindings`: amber on any `mcp.result.oversize`
1906
+ row in 14 lived days, or a run that finished without a part its begin promised, from `mcp.part`
1907
+ rows) and **Wake** (`wakeArrivalFindings`: the `adapter.wake.delivered` outcomes nobody read —
1908
+ amber on `truncated` or `mismatch`). The same review: Spawn goes amber on a worker that started
1909
+ and failed today or yesterday (`adapter.runner.failed`, which the counters never graded); Self
1910
+ page says when the wake shows only the page's start; Dreaming reads past a run of undone dreams;
1911
+ Reflection says its mark count is a floor when its read comes back full.
1912
+
1913
+ After the review of #315: Wake goes amber on `truncated` only — `mismatch` is what a session
1914
+ resumed after its record was pruned reads, so it is counted, not graded. Spawn's failure is
1915
+ standing only when the same step failed today and yesterday, or the failure is newer than the
1916
+ newest `adapter.spawn.started` (both latched once a date, so one transient failure clears at the
1917
+ next day's first start). The nightly child pins `MAX_MCP_OUTPUT_TOKENS=25000`.
1918
+
1919
+ ## 2026-10-02 — what a delivery could not carry is durable, and doctor reads it
1920
+
1921
+ #315 listed four warnings that reached only the in-process ring: `adapter.envelope.overcap`
1922
+ (even the plain form past the host's 10,000-character cap), `adapter.notice.dropped`,
1923
+ `adapter.envelope.gave-way` and `adapter.injection.overbudget`. They are durable now
1924
+ (`Lifecycle#noteDeliveryWarning`, names in `counterpart.ts`, registered beside the other
1925
+ durable names and covered by the `wake-injected` mechanism), one row per name, hook, part and
1926
+ session per lived day, so a long session that gives way at every prompt writes one row. The
1927
+ Wake line reads them as clauses, with `handoff.refused` no-room, `handoff.lasthere.noroom` and
1928
+ the "Work here" overflow: amber only for a start over its reported ceiling or a hook past the
1929
+ cap (the host cut or previewed it), counted otherwise, and a line even when no wake was
1930
+ checked on arrival. Also from the list: the Reflection line says how many days ago a share
1931
+ stuck at `carried` was carried, from `share_at`; and the v9 upgrade line's mark read says
1932
+ "at least" when it comes back full.
1933
+
1934
+ Spawn's "same step failed today and yesterday" never fired on a real store: the failures were read
1935
+ with `newestRows`, which stops at the first window holding rows (today's), so yesterday's row was
1936
+ never read; the test passed only because every row sat on one lived day. The failures are now read
1937
+ as one window of the last three lived days, newest first under `RUNNER_FAILED_ROWS`, and the test
1938
+ puts yesterday's row on the previous lived day. One transient failure keeps Spawn amber from the
1939
+ failure until the next `adapter.spawn.started` row — latched once per calendar date, so the first
1940
+ worker start of the next date: at most the rest of that day and the next day's first turn-end.
1941
+
1942
+ ## 2026-10-03 — doctor's `Write fields` line (schema v12)
1943
+
1944
+ Informational and green: of the memories written since the v12 upgrade (or all, on
1945
+ a store born at v12) by a door that takes the writer's three fields — `note`,
1946
+ `session_end`, a dream's gist; not a merge, a chapter copy, the sweep or a reflection's
1947
+ entry — the share that carries each field and all three, and how many subject links there
1948
+ are. Two aggregates, so it runs in the session-start reading too. Silent on a v11 file
1949
+ (the observer floor did not move). It is what the revisit a few days after the upgrade
1950
+ reads before recall starts reading the fields.
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ ':' //; if command -v bun >/dev/null 2>&1; then exec bun "$0" "$@"; elif command -v node >/dev/null 2>&1; then exec node "$0" "$@"; else echo "counterparts: needs Bun 1.3+ or Node 22.15+ on PATH" >&2; exit 127; fi
3
+ // A shell script and an ES module at once: the line above is a no-op string to
4
+ // JavaScript and, to sh, the runtime choice (Bun if it is on PATH, else Node).
5
+ // See `adapters/launch.mjs`.
6
+ import { launch } from "../../launch.mjs";
7
+
8
+ await launch(new URL("./hook.ts", import.meta.url));