counterparts 0.3.12 → 0.3.13

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 (116) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/docs/module-map.md +1 -1
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/CONTRACT.md +36 -10
  5. package/src/adapters/claude-code/INTERFACE-GAPS.md +116 -16
  6. package/src/adapters/claude-code/NOTES.md +131 -0
  7. package/src/adapters/claude-code/bin/hook.ts +35 -2
  8. package/src/adapters/claude-code/doctor.ts +155 -21
  9. package/src/adapters/claude-code/hooks.ts +49 -7
  10. package/src/adapters/claude-code/index.ts +11 -0
  11. package/src/adapters/claude-code/night-run.ts +133 -12
  12. package/src/adapters/claude-code/transcript.ts +268 -1
  13. package/src/adapters/cli/CONTRACT.md +5 -0
  14. package/src/adapters/cli/INTERFACE-GAPS.md +8 -4
  15. package/src/adapters/cli/NOTES.md +111 -0
  16. package/src/adapters/cli/commands.ts +65 -14
  17. package/src/adapters/cli/dream-core.ts +57 -42
  18. package/src/adapters/cli/export.ts +320 -21
  19. package/src/adapters/cli/index.ts +1 -0
  20. package/src/adapters/cli/install.ts +39 -7
  21. package/src/adapters/cli/mechanisms.ts +7 -1
  22. package/src/adapters/cli/uninstall.ts +13 -5
  23. package/src/adapters/cli/wire.ts +189 -63
  24. package/src/adapters/dashboard/INTERFACE-GAPS.md +10 -1
  25. package/src/adapters/dashboard/NOTES.md +79 -0
  26. package/src/adapters/dashboard/registries.ts +10 -2
  27. package/src/adapters/dashboard/web/README.md +19 -14
  28. package/src/adapters/dashboard/web/actions.ts +23 -1
  29. package/src/adapters/dashboard/web/flow.ts +4 -1
  30. package/src/adapters/dashboard/web/lanes.ts +3 -0
  31. package/src/adapters/dashboard/web/narrate.ts +30 -2
  32. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +1 -0
  33. package/src/adapters/dashboard/web/pages/memories/memories.css +17 -4
  34. package/src/adapters/dashboard/web/pages/memories/row.js +37 -21
  35. package/src/adapters/dashboard/web/pages/memories/sections/search.js +279 -60
  36. package/src/adapters/dashboard/web/pages/memories/state.js +2 -1
  37. package/src/adapters/dashboard/web/server.ts +0 -5
  38. package/src/adapters/dashboard/web/shared/memory-marks.css +7 -0
  39. package/src/adapters/dashboard/web/shared/memory-marks.js +33 -0
  40. package/src/adapters/dashboard/web/shared/memory-modal.js +5 -3
  41. package/src/adapters/dashboard/web/views/health.ts +1 -1
  42. package/src/adapters/dashboard/web/views/search.ts +4 -45
  43. package/src/adapters/dashboard/web/views.ts +2 -2
  44. package/src/adapters/fired.ts +410 -25
  45. package/src/adapters/host-wiring.ts +300 -0
  46. package/src/adapters/lifecycle.ts +14 -0
  47. package/src/adapters/log/index.ts +2 -0
  48. package/src/adapters/mcp/CONTRACT.md +33 -3
  49. package/src/adapters/mcp/INTERFACE-GAPS.md +24 -2
  50. package/src/adapters/mcp/NOTES.md +136 -0
  51. package/src/adapters/mcp/bin/serve.ts +30 -0
  52. package/src/adapters/mcp/facts.ts +13 -1
  53. package/src/adapters/mcp/meaning.ts +208 -13
  54. package/src/adapters/mcp/server.ts +87 -15
  55. package/src/adapters/mcp/stdio.ts +3 -1
  56. package/src/adapters/mcp/stood-down.ts +51 -0
  57. package/src/adapters/mcp/tools.ts +27 -7
  58. package/src/adapters/plugin-run.sh +133 -0
  59. package/src/adapters/plugin.ts +329 -0
  60. package/src/core/associate/CONTRACT.md +2 -1
  61. package/src/core/associate/INTERFACE-GAPS.md +6 -1
  62. package/src/core/associate/NOTES.md +45 -0
  63. package/src/core/briefing.ts +12 -3
  64. package/src/core/contradictions.ts +184 -0
  65. package/src/core/counterpart.ts +451 -18
  66. package/src/core/dream/CONTRACT.md +5 -2
  67. package/src/core/dream/INTERFACE-GAPS.md +29 -6
  68. package/src/core/dream/NOTES.md +21 -0
  69. package/src/core/dream/index.ts +33 -1
  70. package/src/core/dream/reflect.ts +20 -5
  71. package/src/core/encode/INTERFACE-GAPS.md +3 -1
  72. package/src/core/fit/INTERFACE-GAPS.md +8 -2
  73. package/src/core/fit/NOTES.md +5 -2
  74. package/src/core/fit/index.ts +4 -1
  75. package/src/core/handoff/CONTRACT.md +37 -2
  76. package/src/core/handoff/INTERFACE-GAPS.md +10 -0
  77. package/src/core/handoff/NOTES.md +66 -0
  78. package/src/core/handoff/index.ts +214 -12
  79. package/src/core/mint.ts +8 -2
  80. package/src/core/physics/CONTRACT.md +11 -1
  81. package/src/core/physics/NOTES.md +30 -0
  82. package/src/core/physics/index.ts +26 -4
  83. package/src/core/prospective/CONTRACT.md +45 -6
  84. package/src/core/prospective/INTERFACE-GAPS.md +4 -0
  85. package/src/core/prospective/NOTES.md +138 -0
  86. package/src/core/prospective/derive.ts +33 -5
  87. package/src/core/prospective/index.ts +90 -5
  88. package/src/core/prospective/windows.ts +72 -1
  89. package/src/core/recall/CONTRACT.md +6 -2
  90. package/src/core/recall/INTERFACE-GAPS.md +28 -4
  91. package/src/core/recall/NOTES.md +57 -1
  92. package/src/core/recall/probe.ts +58 -0
  93. package/src/core/recall/session.ts +27 -3
  94. package/src/core/recall/time-ask.ts +116 -18
  95. package/src/core/remember/CONTRACT.md +4 -1
  96. package/src/core/remember/INTERFACE-GAPS.md +9 -1
  97. package/src/core/remember/proposals.ts +38 -5
  98. package/src/core/revision.ts +5 -0
  99. package/src/core/schemas/CONTRACT.md +13 -1
  100. package/src/core/schemas/INTERFACE-GAPS.md +20 -2
  101. package/src/core/schemas/NOTES.md +127 -0
  102. package/src/core/schemas/types.ts +2 -0
  103. package/src/core/self/CONTRACT.md +15 -4
  104. package/src/core/self/INTERFACE-GAPS.md +7 -2
  105. package/src/core/self/NOTES.md +49 -0
  106. package/src/core/self/briefing.ts +12 -2
  107. package/src/core/self/index.ts +82 -8
  108. package/src/core/self/page.ts +88 -0
  109. package/src/core/sleep/INTERFACE-GAPS.md +22 -3
  110. package/src/core/sleep/NOTES.md +11 -0
  111. package/src/core/sleep/prune.ts +6 -2
  112. package/src/core/store/NOTES.md +14 -0
  113. package/src/core/store/index.ts +107 -0
  114. package/src/core/time.ts +152 -0
  115. package/tools/install-loop/run.sh +48 -12
  116. package/src/adapters/dashboard/web/pages/memories/fold.js +0 -53
package/CHANGELOG.md CHANGED
@@ -1,5 +1,189 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.13 — 2026-10-09
4
+
5
+ A dated memory can now repeat (daily, weekly, monthly or yearly), and a reminder that
6
+ repeats stays alive by coming round. A memory that says it corrects an unrelated one is held
7
+ instead of fading it. Facts recall reads "last Saturday" and "before 7/22" as meant, meaning
8
+ recall answers about the person you asked about, and the dashboard's Ask speaks both modes.
9
+ Doctor stops raising false alarms: the Fired line knows mechanisms that only wait or run
10
+ once, the Wake line no longer counts unchecked wakes as lost, and the nightly run now reads
11
+ its own transcript for Claude Code's cut. Counterparts can also be installed as a Claude Code
12
+ plugin. **No change to the store's format (still v12):** going back to 0.3.12 is a plain
13
+ reinstall, and there a repeating date reads as a one-off date that has passed.
14
+
15
+ Dates that repeat, and corrections that are held (#339, #340, #341).
16
+
17
+ - **Dates can repeat.** A dated memory can now say `recurring`: `daily`, `weekly`,
18
+ `monthly` or `yearly`, counted from its date. A birthday saved as 1990-05-14 with
19
+ `yearly` comes back every May 14 — a plain one is said on the day each year, once, and
20
+ a quiet one can surface around it each year, at most twice. The wake's Arriving line
21
+ and recall's open items show it beside the date: "due 2026-10-12, every Monday" (a
22
+ daily one takes no Arriving line; it's every day, not arriving). Monthly on the 29th,
23
+ 30th or 31st falls on the last day of a shorter month, and yearly on February 29 falls
24
+ on February 28 in other years. Only a single day can repeat (not a month or a range);
25
+ every other week and "the first Monday" aren't supported. Revising the memory keeps
26
+ the repeat unless you say otherwise, and never repeats a reminder already given that
27
+ day. No change to the store's format.
28
+ - **A repeating reminder is no longer lost between its dates.** Each time a repeat
29
+ comes due and is actually said or surfaced counts as a use of the memory, once per
30
+ date, the way going over something keeps it fresh. A daily pill reminder or a weekly
31
+ one now stays as strong as it was. A yearly one is used only once a year, which isn't
32
+ enough to stay above the floor, so the nightly cleanup no longer lets go of a memory
33
+ whose date still repeats (it is listed as `recurring` beside `protected` when that is
34
+ what kept it). It may still fade in between, as before, but a reminder that still
35
+ repeats comes round on its date even when it has faded: a quiet yearly one is still
36
+ surfaced, and a plain one is still said. One-off dates are unchanged, and a reminder
37
+ whose repeat you drop fades and is cleaned up like any other memory.
38
+ - **A memory can no longer fade or retire an unrelated one by mistake.** When a new memory
39
+ says it changes or corrects an older one (`updates` with `how: changed` or `corrected`),
40
+ Counterparts now checks the two are about the same thing first: by meaning, through the
41
+ local embeddings, or by shared words when there are none. If they look unrelated, the
42
+ new memory is stored but the old one is left as it was and the two are not linked. The
43
+ reply shows the old memory's title and text and asks the model to settle it itself with
44
+ `note` if it really meant the correction. In a benchmark with a smaller model, about two
45
+ thirds of these pointers named the wrong memory (one about a mole removal retired a
46
+ passport name change); on Opus they were right. Closing an open thread, moving or
47
+ dropping a reminder's date, and changing a status still go straight through, however
48
+ short the note. A write-up or the nightly catch-up has nobody to read the reply, so
49
+ there the old memory simply stays. Each hold is recorded; the dashboard's flow shows
50
+ them.
51
+
52
+ Recall and the dashboard's Ask (#329, #333, #334, #335, #338).
53
+
54
+ - **Facts recall reads "last Saturday" and "before 7/22" the way you mean them.** "Last
55
+ Saturday" (any weekday, or "this past Saturday") was read as no time at all; it is now
56
+ the most recent Saturday before today, so asked on a Saturday it is the one a week ago.
57
+ "Before 7/22" kept only 07-22 itself; now it keeps every day before it, "after 7/22"
58
+ every day after it, and "until 7/22" or "by 7/22" every day through it; when the date
59
+ names something on that day ("before the 7/22 flight"), that day stays in. "Since 7/22" is
60
+ unchanged: from that day to today. The same goes for `2023-07-22`, `7/22`, "July 22" and
61
+ `7/22/2023`, and a year written with the date (`7/22/2023`, "July 22, 2023") is now the
62
+ year used; it was ignored before. "This Saturday" and "on Saturday" are still not read,
63
+ since either can mean the coming one.
64
+ - **Recall by meaning answers about the person you asked about.** A question naming two
65
+ people, or you and someone else, was answered about whichever had more memories, which
66
+ is usually you: "what has Ilya been to Mike" through the `recall` tool came back as
67
+ Mike's story, with Ilya listed underneath. It now goes by how the question is worded and
68
+ the order of the names ("what has Ilya been to Mike" is Ilya's; "how has Ilya changed
69
+ since Nkechi arrived" is Ilya's). When two are asked about alike ("tell me about Ilya and
70
+ Nkechi") it follows the first and says so. And "what have I been like" or "how have I
71
+ changed", asked by meaning on the dashboard, finds your own card again.
72
+ - **The dashboard's Ask reads 0.3.12's answers.** After recall took a mode, the Memories
73
+ page kept reading the old answer, so most dates, the "strong match" words and the "from
74
+ chapter" links vanished, and "by meaning" got a facts answer. The switch beside the box
75
+ now has three ways: **by word** (as you type, as before), **facts** (every memory that
76
+ answers the question, counted and paged, each saying who said it, when it happened or was
77
+ learned, and what it was before it changed) and **by meaning** (the chapters that hold a
78
+ person, a project or a feeling, in time order, with their moments and whose feelings
79
+ they were). The match-strength words are gone, as recall has none now.
80
+ - **`counterparts ask --mode meaning`** answers in meaning mode, as the `recall` tool's
81
+ `mode: "meaning"` does; facts stays the default. `--page` pages either.
82
+ - **A memory id written inside a memory's words is a link.** On the Memories page,
83
+ "(mem_cb6eea7a6b9f)" shows as "memory ↗" and opens that memory; a chapter's address
84
+ opens its journal.
85
+ - **A chapter's memory keeps its links when the chapter grows.** Each journal chapter is
86
+ also kept as an ordinary memory, and when the chapter grows that memory is rebuilt and
87
+ the old one archived. The links the old one had learned (to what was written beside it,
88
+ what was used with it, what a dream tied it to) stayed on the archived row, where they do
89
+ nothing: about a quarter of the links in one real store. The rebuilt memory now inherits
90
+ them, the way a dream's merged memory inherits its originals'. Links already left behind
91
+ are carried over once, the first time the store is opened after the update.
92
+ - **Recall now records what it showed that no reply used.** At the end of each answer, the
93
+ credit check now also notes which of the memories recall showed since the last check the
94
+ reply neither opened nor quoted, by kind of showing (shown in full, a footnote, a pointer
95
+ reached through links). Each showing is counted once. `counterparts probe-oq4` prints the
96
+ resulting hit rate. This only measures: nothing is strengthened, weakened or ranked
97
+ differently because of it.
98
+ - **A memory's card in the dashboard says the day it was written on your calendar.** "Written
99
+ …" used the UTC date, so in Denver anything written in the evening showed the next day, and
100
+ east of UTC anything written early in the morning showed the day before. It now uses this
101
+ computer's date, the same day as the card's "recorded" line.
102
+
103
+ Doctor, and the nightly run (#325, #330, #337).
104
+
105
+ - **Doctor's Fired line no longer turns amber over a mechanism that simply had nothing to
106
+ do.** Some mechanisms fire only when something happens: a reminder falls due, you erase,
107
+ export or un-merge a memory, or something fails. One, the check after the v8 upgrade,
108
+ runs only once. `counterparts mechanisms --all` now lists the first kind as **waiting**
109
+ and a one-time job that ran as **done**, instead of "gone quiet" or "never fired", and
110
+ doctor counts them the same way. One silence is still a fault: a reminder you marked
111
+ plain that fell due on a day you used Claude Code and was not said. That turns the line
112
+ amber, and the short `counterparts mechanisms` view says so on its Prospective line.
113
+ - **Doctor's Wake line no longer reports wakes as lost that were never checked.** Since
114
+ about 09-25 Claude Code writes a session's transcript only after the first prompt, which
115
+ is when the check read it, so nearly every session said its wake was "not found in the
116
+ transcript". The check now waits: if the file is not there yet it reads again at the next
117
+ prompt or when the first answer ends. Rows already in the store from before say "not
118
+ checked (no transcript to read)" and are left out of "N of M arrived whole", and the
119
+ dashboard no longer shows them in orange. A transcript still missing when the first answer
120
+ ends, or one that could not be read, is named on its own.
121
+ - **The nightly run notices if Claude Code cut what it was handed.** Counterparts keeps every
122
+ tool result under 40,000 characters, under Claude Code's limit of 50,000 — but Claude Code
123
+ can lower that limit on its own, and a result past it reaches the model as a short preview.
124
+ After each nightly run, Counterparts now reads that run's own transcript for Claude Code's
125
+ marker on its tool results. If it finds one, doctor's Tool results line turns amber and
126
+ says which result and how large, and the next morning your session tells you plainly that
127
+ last night's run read only part of what it was handed. Memories that merely quote the
128
+ marker are not counted. Doctor's green line also says whether the last night's transcript
129
+ was found and read.
130
+ - **A reflection handed its bundle in parts is told, first thing, to read every part before
131
+ it writes.** One finished without its second part during the 0.3.12 release check.
132
+ - **Doctor's Reflection line counts "returns this week" from your local midnight**, not
133
+ UTC's. West of UTC it counted returns from the evening before the week; far to the east
134
+ it missed the first hours of the week.
135
+ - **With `CLAUDE_CONFIG_DIR` set, `connect`, `install` and doctor use the settings file
136
+ Claude Code actually reads**, `$CLAUDE_CONFIG_DIR/settings.json`. They used
137
+ `$CLAUDE_CONFIG_DIR/.claude/settings.json`, which Claude Code never opens, so the hooks
138
+ never ran while doctor, reading the same file, said they were connected. `install` also
139
+ now recognises Claude Code from that directory. Nothing changes if you don't set the
140
+ variable. If you do and ran `connect` before, run it again; the stray
141
+ `.claude/settings.json` inside that directory can be deleted.
142
+
143
+ The wake, export and connect (#331, #332).
144
+
145
+ - **A plan changed after a handoff is shown with it.** When a session left a handoff and
146
+ later wrote a note or a `session_end` memory that changed the plan (status `planned`,
147
+ `proposed` or `asked`, or marked `unresolved`), the next session in that directory saw
148
+ only the handoff. The handoff now has a "Since this handoff:" line under it naming up to
149
+ three such memories by title and id, newest first, from any session working in that
150
+ directory, including the one that wrote the handoff. Memories written in the same answer
151
+ as the handoff are left out, and a memory named there is not repeated in "Work here"; an
152
+ open question the wake already lists under "Still open:" is left to that list. When the
153
+ wake has no room for the line, the handoff is shown as before.
154
+ - **The self page no longer prints "Last revised" twice.** A page that carried its own
155
+ "(Last revised …)" line showed it under the wake's own date line. The wake now leaves the
156
+ page's line out, and so does writing the page, so a stored page loses it the next time it
157
+ is revised. Only a line that is a date goes: prose, a list entry, a quote, a code block or
158
+ a page's own history that begins with the same words stays.
159
+ - **`counterparts export --markdown` now includes your dreams and reflections.** Each dream
160
+ is a file under `dreams/`, by date: its journal and every change it made, undone ones
161
+ marked. Each reflection is a file under `reflections/`: what it was asked, what it wrote,
162
+ and its morning share and whether it was told. The README at the top of the export
163
+ counts both. A dream or reflection that touched a memory you have since marked
164
+ confidential is left out unless you pass `--include-confidential`, and the export says
165
+ how many.
166
+ - **`connect` no longer calls every running memory server "the previous version".** It used
167
+ to count every one on the machine as out of date, including your own sessions on the
168
+ version you just installed and the session you typed the command into. Now it checks the
169
+ version each server recorded. It says how many still run an older version (and which),
170
+ how many already run this one, and how many it can't place, for example a server for
171
+ another store. When it can tell, it names the session you ran it from.
172
+
173
+ The Claude Code plugin (#328).
174
+
175
+ - **Counterparts can be installed as a Claude Code plugin.** `/plugin marketplace add
176
+ mlapeter/counterparts`, then `/plugin install counterparts@counterparts`. The first session
177
+ sets up the memory in `~/.counterparts`, where the npm install keeps it, with no terminal
178
+ step and no edit to `settings.json`; `/counterparts:doctor` runs doctor. It needs Bun 1.3+
179
+ or Node 22.15+ on the computer. The marketplace names this release's tag, so a plugin
180
+ install only ever gets a released version. If the npm install's hooks or server are wired
181
+ too, the plugin stands down and says so once: `counterparts disconnect` moves you to the
182
+ plugin, `counterparts install` moves you back, and the memories are the same either way.
183
+ Doctor recognises the plugin. The plugin's tools are named
184
+ `mcp__plugin_counterparts_counterparts__…`, so a permission rule written for
185
+ `mcp__counterparts__…` doesn't match them. Nothing changes for an npm install.
186
+
3
187
  ## 0.3.12 — 2026-10-08
4
188
 
5
189
  `recall` now asks which kind of question it is. Facts mode answers with every match,
@@ -40,7 +40,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
40
40
 
41
41
  | adapter | job |
42
42
  |---|---|
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. |
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**), which reads its child's transcript for the host's cut (**2026-10-09**). The launch adapter. |
44
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).** |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
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": {
@@ -74,7 +74,8 @@ credential — belongs here, discovered at runtime, never assumed by the core.
74
74
  the only thing that can report *arrival*, and v1 shipped eleven days of truncated wakes
75
75
  because only the render was instrumented. SessionStart writes the sentinel it printed
76
76
  into the session registry record, and the session's FIRST PROMPT reads the head of the
77
- host's transcript for this package's SessionStart attachment — what the hook printed
77
+ host's transcript (or, when the host has not written the file yet, the next prompt or the
78
+ first Stop — 2026-10-08) for this package's SessionStart attachment — what the hook printed
78
79
  beside what the host recorded as injected — and leaves one `adapter.wake.delivered` row
79
80
  saying `delivered`, `truncated`, `mismatch`, `printed-unverified` (this host build
80
81
  records no injected copy to check against), `not-found` or `no-wake-expected`, in counts
@@ -194,9 +195,11 @@ assistant's text is never reclassified by a marker, and `classifyBlock` — the
194
195
  roles share — is unchanged. The two refusals (`foreign`, `ritual`) come before the
195
196
  metadata, so hook feedback on an `isMeta` entry is still refused, not merely unpaced. An
196
197
  assistant line the host synthesised (`isApiErrorMessage`, `model: "<synthetic>"`) is
197
- `injected` as well; the assistant's real replies pace, as they always have. **Known gap**
198
- (`INTERFACE-GAPS.md` §14): a prompt the person types while the model is working is
199
- written as an `attachment` (`queued_command`), which this reader does not read.
198
+ `injected` as well; the assistant's real replies pace, as they always have. A prompt the
199
+ person types while the model is working is written as an `attachment` (`queued_command`);
200
+ since 2026-09-24 (#213) this reader reads it as a typed turn where it stands
201
+ (`INTERFACE-GAPS.md` §14, which keeps one ask open: a capture cursor that survives
202
+ inserted turns).
200
203
  **Outputs** — an injected context block or the empty string; appended spans; the
201
204
  end-of-session ask; a detached worker spawn; capability reports (injection ceiling,
202
205
  execution ceiling, socket lifetime); delivery and stand-down telemetry. (A `credential`
@@ -671,7 +674,8 @@ session launches anything.** On the first prompt of a calendar day that is due
671
674
  records the run `started`, with its watchdog. That process composes the launch prompt from
672
675
  the store, starts `claude -p` with it on STDIN (`planNightChild`), waits under the run's own
673
676
  watchdog (`dreaming.timeoutMs`, default `NIGHT_RUN_MS` 20 minutes) and records the end. The
674
- outcome is read from the exit and the store, never from the child's output:
677
+ outcome is read from the exit and the store, never from the child's output (the host's cut,
678
+ below, is read from the host's own transcript of it):
675
679
 
676
680
  - `done`: the dream and the reflection ran (the reflection, for a reflection-alone run);
677
681
  - `partial`: some of the run's parts ran and not all, whatever the exit, with the parts on
@@ -689,17 +693,39 @@ reach the network, start agents or workflows, or schedule work (`NIGHT_DENIED_TO
689
693
  deny beats the user's own allow rules; `ToolSearch` stays, for hosts that defer MCP tools);
690
694
  `--strict-mcp-config` with an `--mcp-config` naming only the counterparts server, as the
691
695
  install registers it (`nightMcpConfig`); `--max-turns` (`NIGHT_MAX_TURNS` 60,
692
- `dreaming.maxTurns`); `--model` only when `dreaming.model` is set. It starts in a NEUTRAL
693
- directory — the store's own — so no project's CLAUDE.md, hooks or MCP servers load. The
694
- parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are removed;
695
- this package's values are written last.
696
+ `dreaming.maxTurns`); `--model` only when `dreaming.model` is set; `--session-id` a fresh
697
+ UUID the waiting process chose (2026-10-09), so it can find the child's transcript. It
698
+ starts in a NEUTRAL directory — the store's own — so no project's CLAUDE.md, hooks or MCP
699
+ servers load. The parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are
700
+ removed; this package's values are written last.
701
+
702
+ **[M] The run reads its child's transcript for the host's cut (2026-10-09, U14 item 3 — held
703
+ lightly).** Once the child exits, the waiting process finds its transcript by that session
704
+ id (`transcript.ts#hostTranscriptPath`: `CLAUDE_CONFIG_DIR` or `~/.claude`, then
705
+ `projects/<the store's directory, spelled>/<id>.jsonl`, failing that the same name in any
706
+ project directory) and reads it for results of ours — `mcp__counterparts__*` — that the host
707
+ replaced with its marker (`readToolSpills`): `<persisted-output>` "Output too large (…)" or
708
+ "Output exceeded the … persist limit", `<truncated-output>`, "Error: result (…) exceeds
709
+ maximum allowed tokens", or the "[OUTPUT TRUNCATED - exceeded … token limit]" trailer — as
710
+ read from Claude Code 2.1.295. Matched where the host puts each one, at the start or the very
711
+ end of a `tool_result`, never as a substring: a memory quoting the marker sits inside our
712
+ JSON. The host's budget for all the results of one turn swaps a result at request time and
713
+ writes the swap as a `content-replacement` line of its own, the result's line left whole —
714
+ those lines are read too, shaped `turn-budget` (review of #330). Each cut result is one durable `mcp.result.spilled` row (run, tool, phase, shape, the
715
+ size the host said; never the saved file's path); the run's row carries `transcript` (`read`
716
+ | `absent` | `unreadable`) and, when read, `spills`. Doctor's Tool results line goes amber on
717
+ any row in its window and says in green whether the last night's transcript was read; the
718
+ morning hand-back adds a plain line (`Dreams.nightSpillLine`), even for a run that journaled
719
+ nothing. The catch-up child is not read. A host that refuses the flag
720
+ (a quick non-zero exit, no transcript under the name, nothing begun in the store) costs the
721
+ night nothing: the child is started once more without it, and the row says `absent`.
696
722
 
697
723
  **[M] Session binding: the run is attributed to the session that started it.** The launch
698
724
  prompt names that session's id, and the id and its directory are PINNED
699
725
  (`COUNTERPARTS_SESSION`, `COUNTERPARTS_SCOPE`) on the child's environment and on its MCP
700
726
  server's, so the server is launched bound to it — never lazy-bound through the registry,
701
727
  whose liveness check refuses a session left open overnight (review of #282, finding 1). The
702
- child's own host-minted session is QUIET (`HookInput.nightRun`, from
728
+ child's own session (`--session-id`, host-minted before 2026-10-09) is QUIET (`HookInput.nightRun`, from
703
729
  `COUNTERPARTS_NIGHT_RUN`): its hooks capture nothing (so it owes no write-up) and give no dream
704
730
  lines, plain reminders, Stop ask, write-up pointer or first-launch question. It still wakes
705
731
  with the ordinary wake.
@@ -29,7 +29,12 @@ root is doing exactly what the seam suite does.
29
29
  path say what it is. One-line union change in `remember/proposals.ts`, plus the
30
30
  places that switch on it (none today).
31
31
 
32
- ## 2. `Store.open({ dir })` does not run its own path guard — FOUND LIVE
32
+ ## 2. `Store.open({ dir })` does not run its own path guard — FOUND LIVE — CLOSED 2026-08-25 (noted 2026-10-09)
33
+
34
+ **The honest fix below is in the code:** `Store`'s constructor runs
35
+ `this.dir = assertSafeDataDir(opts.dir ?? dataDir())` on every path (`store/index.ts`),
36
+ from `0361e4f`, the commit that filed this section ("two wounds closed at the root").
37
+ The text below is the gap as filed.
33
38
 
34
39
  **What happened.** `dataDir()` calls `assertSafeDataDir()`, so the
35
40
  environment-resolved path is guarded. An EXPLICIT `dir` goes straight into the
@@ -63,7 +68,11 @@ writes under a live store, deletions included. Removing a stray directory from a
63
68
  live store is an operator action, not an agent one; that is the design, and the
64
69
  guard above is what stops the next one being created.
65
70
 
66
- ## 3. `self.appendChapter` has no gate — FOUND BY THE CALLER-UNIVERSALITY TEST
71
+ ## 3. `self.appendChapter` has no gate — FOUND BY THE CALLER-UNIVERSALITY TEST — CLOSED 2026-08-25 (noted 2026-10-09)
72
+
73
+ **The honest fix below is in the code:** `Self#appendChapter` runs its injected gate,
74
+ writes the gate's text and refuses with `self.episode.chapter.refused`
75
+ (`self/index.ts`), from the same commit, `0361e4f`. The text below is the gap as filed.
67
76
 
68
77
  **What happened.** `SelfOptions.gate` is consulted by `ingestEpisode` and by
69
78
  nothing else. `appendChapter` writes the chapter straight into the episode's
@@ -113,7 +122,7 @@ door. The fallback door reaches `encode/` through `gateSweepChunk`, which needs
113
122
  (`DEFAULT_KIND`). Two spellings of one rule. The fix queued item 9 already
114
123
  names — move the default behind the gate verdict — closes both.
115
124
 
116
- ## 7. The Stop ask has no RETURN CHANNEL in this host's hooks
125
+ ## 7. The Stop ask has no RETURN CHANNEL in this host's hooks — CLOSED 2026-09-04
117
126
 
118
127
  **What exists.** `stop()` raises `stopAsk(sessionId, chapter)` when `self/`'s pacer says a
119
128
  chapter is due; the coverage read from `SpanBuffer.coverageReport` rides along as a
@@ -436,7 +445,8 @@ the end of the transcript it can see WITHOUT appending any of it
436
445
  thing that writes a cursor, and it writes one as part of depositing.
437
446
 
438
447
  **What the adapter does instead, and why it is a workaround rather than a
439
- design.** `hooks.ts#sealJoinedLate` calls `captureSpans` with `turns.length`
448
+ design.** `hooks.ts#sealJoinedLate` (in `adapters/lifecycle.ts` since #292, 2026-09-30)
449
+ calls `captureSpans` with `turns.length`
440
450
  PLACEHOLDER turns whose `source` is `tool`. `enters()` refuses that source, so
441
451
  `SpanBuffer.captureInner` takes its ALL_EXCLUDED arm — "nothing conversational
442
452
  happened: still advance, or the same tool output is re-scanned forever" — which
@@ -529,6 +539,9 @@ That is a different mechanism, not a wider parameter, and it is not built.
529
539
  and two clocks in one store is a scar this repo already has a name for. The
530
540
  fix, if the mid-evening reset is ever felt, is one per-owner zone read
531
541
  wherever a day is decided — `self/INTERFACE-GAPS` carries the decision.
542
+ *(CLOSED 2026-09-23 by #189, noted 2026-10-09: the cap counts by
543
+ `Self#calendarToday`, the person's local day; and since #231 (2026-09-25)
544
+ `Store#today` and the dates stamped beside it are local too.)*
532
545
  4. **The two poisoned titles are not repaired.** The embedder no longer chokes on
533
546
  them and the backfill no longer stalls behind them, but the two memories on the
534
547
  owner's store still hold a lone surrogate in their payload JSON,
@@ -563,7 +576,9 @@ That is a different mechanism, not a wider parameter, and it is not built.
563
576
  costs a ladder of lived-day windows instead of one query. Filed in full as
564
577
  `cli/INTERFACE-GAPS` §10, where the console's other asks against `store/`
565
578
  live; the workaround is exact, not approximate, and the cost is up to five
566
- queries on a 150 ms hot path.
579
+ queries on a 150 ms hot path. *(Noted 2026-10-09: the store side is built,
580
+ `order: "desc"`, 2026-09-24 (cli §10); doctor keeps its ladder on purpose, as
581
+ `doctor.ts#WINDOWS` says.)*
567
582
  2. **`adapter.checkout` is a durable name in `core/counterpart.ts`.** The third
568
583
  time the core has learned a string for an adapter's sake, and for the same
569
584
  narrow reason the spawn names did: `dashboard/registries.ts` derives
@@ -597,7 +612,10 @@ That is a different mechanism, not a wider parameter, and it is not built.
597
612
  All that is left behind is an `adapter.notice.dropped` ring row, and a ring row
598
613
  dies with the process. Closing it properly means either a durable row (a write
599
614
  on the wake's path, which §5 G2 argues against) or a second channel that is
600
- not the wake's — neither was taken here.
615
+ not the wake's — neither was taken here. *(The record half CLOSED 2026-10-02 by
616
+ #318 (`8916e8c`), noted 2026-10-09: `adapter.notice.dropped` is a durable row,
617
+ one per hook, part and session a lived day, and doctor's Wake line reads it. The
618
+ terminal still says nothing on the day it happens.)*
601
619
  7. **Three findings cannot say "I do not know" — they say green.** `Severity` is
602
620
  red / amber / green, so the unknown-newest-row reading (`undetermined`) is
603
621
  reported as GREEN with a sentence that explains it is not a grade. Right for
@@ -675,7 +693,18 @@ for: a per-owner zone read wherever a day is decided — one clock, moved once
675
693
  second clock bolted onto this mechanism. Until then it belongs on the findings list for the
676
694
  first blank-store trial, where it is a thing to notice rather than a thing to fix.
677
695
 
678
- ## 14. A prompt typed while the model is working never reaches the transcript reader (2026-09-23, B1 review M3)
696
+ ## 14. A prompt typed while the model is working never reaches the transcript reader (2026-09-23, B1 review M3) — CLOSED for the reader 2026-09-24 by #213 (noted 2026-10-09)
697
+
698
+ **Closed for the reader by #213** (`0df2efe`, merged 2026-09-24, in 0.3.1). `transcript.ts`
699
+ reads a `queued_command` attachment the person typed (`commandMode: "prompt"`,
700
+ `origin.kind: "human"`) as a typed turn where it stands (`queuedPromptOf`); every other
701
+ attachment is still skipped. The dedupe was measured before it was written: of 33 queued
702
+ prompts on the owner's machine none was written again as a user entry, so a
703
+ `promptSource: "queued"` user entry with the same words is skipped defensively (NOTES,
704
+ "Prompts typed mid-turn"; `test/queued-prompts.test.ts`). **Still open: ask (1).** The
705
+ capture cursor is still an index into the turn list, so a session open across a deploy
706
+ that changes what counts as a turn re-captures its last few turns once (NOTES, "Deploy
707
+ note"). The text below is the gap as filed.
679
708
 
680
709
  **Pre-existing; found by the adversarial review of PR #186, measured on the owner's
681
710
  machine (shapes only).** When the person types while the model is still working, Claude
@@ -741,14 +770,53 @@ can push the envelope past `ENVELOPE_MAX_CHARS` and the doctor notice is the par
741
770
  notice is dropped with or without it. Bounded: at most two starts a day carry a pointer,
742
771
  and the notice returns at the next start.
743
772
 
744
- **Residual cost (PR #192 review, n1):** the eligibility plan (`writeUpPlan`: every
745
- scope's span files and up to 90 days of `adapter.ask` rows) runs at EVERY session start
746
- whose allowance is not spent — and when nothing is owed, the allowance is never spent.
747
- Measured by the review on 400 held sessions (1.6 MB of spans, 20k ask rows): ~43 ms per
748
- start, 2 ms with the allowance spent. Acceptable now; it scales with the store. The cheap
749
- fix, not built: skip the scan when nothing has changed since the last plan (a meta stamp
750
- of the newest boundary/write-up/answer time the plan saw, compared before scanning), and
751
- treat a plan that found nothing owed as spending the day's check.
773
+ **Residual cost (PR #192 review, n1):** the eligibility plan (`writeUpPlan`) runs at EVERY
774
+ session start whose allowance is not spent — and when nothing is owed, the allowance is
775
+ never spent. Measured by the review on 400 held sessions (1.6 MB of spans, 20k ask rows):
776
+ ~43 ms per start, 2 ms with the allowance spent.
777
+
778
+ **Re-measured 2026-10-09, and the skip looked at and not built.** Since 2026-09-30 the
779
+ plan is `core/coverage/`'s ledger over every scope's span files plus one registry read per
780
+ session holding text; the `adapter.ask` rows are no longer read. On a synthetic store of
781
+ 400 held sessions in 20 projects (1.9 MB of conversation, nothing owed), one plan per
782
+ fresh process as a hook runs it: ~31 ms, which is ~32 of the ~37 ms `sessionStart` body
783
+ there. At 100 sessions it is ~10 ms. Where the time goes: the ledger takes ~23 ms of it
784
+ (~5,000 `localDate` calls, one per piece and one per Stop boundary, ~9 ms; the span files
785
+ ~7 ms; 400 registry reads ~4 ms), and `planRetention` reads most of the same files a second
786
+ time (~5 ms). Retention deletes held text a week after a session ends, so the cost grows
787
+ with a week's use, not with the store's age.
788
+
789
+ - **A stamp of everything the plan reads** (date, zone, version, and a stat of every file
790
+ under `spans/` and `sessions/`, ~2.5 ms) would be safe, and it would almost never fire.
791
+ Every start writes its own registry record before the plan runs (`noteSession("start")`,
792
+ in Claude Code and in the Desktop wake). Every Stop, in any session, appends to the buffer
793
+ and rewrites that session's record. It fires only when two starts come with no turn
794
+ anywhere between them.
795
+ - **A stamp that fires** has to know what can make a debt appear. Under today's rule only
796
+ two things can: a session ending (a `session-end` boundary or a registry end) and the
797
+ date changing. A capture is stamped `now`, and that makes its session `active`. So the
798
+ design would be: every session end writes a fresh random token to meta, in
799
+ `captureBoundary` before the boundary itself (a hook that fails part-way then errs
800
+ toward a rescan). It is a token and not a counter, so two ends cannot write the same
801
+ value. A plan that found nothing owed and no progress entries stamps
802
+ `{date, zone, version, token}`, and a start skips when all four match. The costs: the
803
+ common flow (end one session, open the next) always rescans, and must, because that is
804
+ when a crashed or unanswered session gets pointed at. So it saves the ~30 ms only on starts
805
+ with no end since the last plan, such as a second terminal or a compaction. It is also a
806
+ second statement of `coverage/`'s rule, kept outside `coverage/`. If "active" ever stops
807
+ meaning "captured today", or something other than an end uncovers pieces (a retention
808
+ strike that fails part-way, a restored snapshot, a mark taken back), the stamp hides a
809
+ debt until the next date. Then the first start and the nightly run both plan in full, so
810
+ nothing waits more than a day. But the pointer it skipped is the one right after the crash.
811
+ - **What would make the plan cheaper for every caller** (the pointer, doctor, the night
812
+ run, the door), with nothing to invalidate: a cheaper `localDate` in the ledger, and one
813
+ read of the span files per plan instead of two. A memo by 15-minute bucket measured
814
+ ~31 → ~24 ms; every zone offset in use today is a multiple of 15 minutes. That memo
815
+ belongs to `core/time.ts`, it is date-sensitive, and it is its own change. The single
816
+ read (~5 ms) is `remember/`'s to offer.
817
+ - **"Treat a plan that found nothing owed as spending the day's check"** (the suggestion
818
+ this section first carried): no. A session that ends later that day without an answer
819
+ would not be pointed at until tomorrow, and that is the case the pointer exists for.
752
820
 
753
821
  ## 16. For C3: the opt-in is `crashWriteUp: "api"` (2026-09-23, C2) — CLOSED 2026-09-24 by removal
754
822
 
@@ -762,7 +830,21 @@ and the key (`config.ts#apiSweepOn`). Doctor's two lines — `Crash write-up` an
762
830
  are C2's and already read the knob (`not-opted-in` on the gate row, core's second skip
763
831
  reason); nothing there is owed to C3.
764
832
 
765
- ## 17. An open-and-answered session's later words wait up to a week (2026-09-23, C2 re-review m-E)
833
+ ## 17. An open-and-answered session's later words wait up to a week (2026-09-23, C2 re-review m-E) — CLOSED 2026-09-30 by #289 (noted 2026-10-09)
834
+
835
+ **Closed by #289** (`fc665c2`, merged 2026-09-30, in 0.3.8), by replacing the rule rather
836
+ than adding the ask below. `sessions.ts#openAndAnswered` is gone, with the asked /
837
+ answered predicate it guarded; what a session owes is `core/coverage/`'s ledger. An
838
+ answer claims only the pieces said before it, so words captured after it are an unwritten
839
+ stretch, and that stretch is owed once the session is not `active` (it ended, or it has
840
+ captured nothing since the date changed) and has not lapsed. So the case below is
841
+ pointed at from the next date, not after a week (CONTRACT, "A session that ended owing a
842
+ write-up"). The ask to `remember/` (its INTERFACE-GAPS §16) went with it. **The owner's
843
+ hand, last paragraph, is unchanged in one part:** there is still no console command that
844
+ marks a session written up `by: "owner"`. A stretch left in a directory nobody reopens no
845
+ longer waits on one, though: the nightly run's catch-up writes up any project's, and what
846
+ it leaves lapses after three days of use (coverage INTERFACE-GAPS §3). The text below is
847
+ the gap as filed.
766
848
 
767
849
  **What happens.** A session answers its Stop ask (memories, a chapter, a handoff, or
768
850
  "nothing new"), then captures more words at a later Stop that asks nothing, then goes
@@ -793,3 +875,21 @@ words the session left in another (`written-up-here`) owes until a session opens
793
875
  Doctor's `Crash write-up` line names that project. A directory set `off` never opens
794
876
  one; closing such a session by hand needs a console command that marks `by: "owner"`
795
877
  (`WRITE_UP_BY` has the word; nothing may import the seam to use it) — filed, not built.
878
+
879
+ ## 18. The host's cut is read only for the nightly run, and only as the host writes it today (2026-10-09, U14 item 3)
880
+
881
+ The nightly run reads its child's transcript for the host's marker on our results
882
+ (`night-run.ts#readNightSpills`, `transcript.ts#readToolSpills`). Three things it owes:
883
+
884
+ 1. **Unmeasured on a real machine.** That `claude -p` honours `--session-id`, and that the
885
+ transcript lands under `projects/` where the lookup asks. Both were read from the host's
886
+ code (2.1.295), not seen. If either fails, the run's row says `transcript: "absent"` and
887
+ doctor's green line says the night was not checked — check that line after the first
888
+ night on a build with this. A host that refuses the flag outright is retried once without
889
+ it (review of #330), so the night itself is not lost to this check.
890
+ 2. **The markers are the host's wording.** Read from 2.1.295's code; a host that rewords
891
+ them makes the check go quiet (a missed spill), never noisy. A new marker shape is one
892
+ regex in `transcript.ts`.
893
+ 3. **Not read:** the morning catch-up's child (its write-up parts are far under any line)
894
+ and ordinary sessions. A cut in a session someone watches is in front of them; one in a
895
+ session nobody watches (a GitHub action) is not seen by anything.