counterparts 0.3.11 → 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 (150) hide show
  1. package/CHANGELOG.md +326 -0
  2. package/docs/QUICKSTART.md +5 -0
  3. package/docs/README.md +2 -2
  4. package/docs/module-map.md +3 -3
  5. package/package.json +1 -1
  6. package/src/adapters/claude-code/CONTRACT.md +36 -10
  7. package/src/adapters/claude-code/INTERFACE-GAPS.md +116 -16
  8. package/src/adapters/claude-code/NOTES.md +182 -0
  9. package/src/adapters/claude-code/bin/hook.ts +46 -12
  10. package/src/adapters/claude-code/bin/runner.ts +7 -1
  11. package/src/adapters/claude-code/doctor.ts +632 -18
  12. package/src/adapters/claude-code/hooks.ts +61 -16
  13. package/src/adapters/claude-code/index.ts +11 -0
  14. package/src/adapters/claude-code/night-run.ts +150 -14
  15. package/src/adapters/claude-code/transcript.ts +268 -1
  16. package/src/adapters/cli/CONTRACT.md +5 -0
  17. package/src/adapters/cli/INTERFACE-GAPS.md +8 -4
  18. package/src/adapters/cli/NOTES.md +111 -0
  19. package/src/adapters/cli/commands.ts +134 -92
  20. package/src/adapters/cli/dream-core.ts +57 -42
  21. package/src/adapters/cli/export.ts +320 -21
  22. package/src/adapters/cli/help.ts +2 -1
  23. package/src/adapters/cli/index.ts +1 -0
  24. package/src/adapters/cli/install.ts +39 -7
  25. package/src/adapters/cli/mechanisms.ts +7 -1
  26. package/src/adapters/cli/uninstall.ts +13 -5
  27. package/src/adapters/cli/wire.ts +189 -63
  28. package/src/adapters/config.ts +2 -0
  29. package/src/adapters/dashboard/INTERFACE-GAPS.md +10 -1
  30. package/src/adapters/dashboard/NOTES.md +79 -0
  31. package/src/adapters/dashboard/registries.ts +34 -2
  32. package/src/adapters/dashboard/web/README.md +19 -14
  33. package/src/adapters/dashboard/web/actions.ts +23 -1
  34. package/src/adapters/dashboard/web/flow.ts +14 -0
  35. package/src/adapters/dashboard/web/lanes.ts +10 -0
  36. package/src/adapters/dashboard/web/narrate.ts +88 -2
  37. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +1 -0
  38. package/src/adapters/dashboard/web/pages/health/sections/checks.js +2 -0
  39. package/src/adapters/dashboard/web/pages/health/sections/wake.js +3 -1
  40. package/src/adapters/dashboard/web/pages/memories/memories.css +17 -4
  41. package/src/adapters/dashboard/web/pages/memories/row.js +37 -21
  42. package/src/adapters/dashboard/web/pages/memories/sections/search.js +279 -60
  43. package/src/adapters/dashboard/web/pages/memories/state.js +2 -1
  44. package/src/adapters/dashboard/web/server.ts +0 -5
  45. package/src/adapters/dashboard/web/shared/memory-marks.css +7 -0
  46. package/src/adapters/dashboard/web/shared/memory-marks.js +33 -0
  47. package/src/adapters/dashboard/web/shared/memory-modal.js +5 -3
  48. package/src/adapters/dashboard/web/views/health.ts +21 -3
  49. package/src/adapters/dashboard/web/views/search.ts +4 -45
  50. package/src/adapters/dashboard/web/views.ts +2 -2
  51. package/src/adapters/fired.ts +430 -28
  52. package/src/adapters/host-wiring.ts +300 -0
  53. package/src/adapters/hosts.ts +11 -0
  54. package/src/adapters/lifecycle.ts +42 -2
  55. package/src/adapters/log/index.ts +9 -0
  56. package/src/adapters/mcp/CONTRACT.md +151 -11
  57. package/src/adapters/mcp/INTERFACE-GAPS.md +24 -2
  58. package/src/adapters/mcp/NOTES.md +313 -1
  59. package/src/adapters/mcp/bin/serve.ts +74 -1
  60. package/src/adapters/mcp/deliberate.ts +169 -651
  61. package/src/adapters/mcp/facts.ts +1094 -0
  62. package/src/adapters/mcp/index.ts +25 -7
  63. package/src/adapters/mcp/meaning.ts +1610 -0
  64. package/src/adapters/mcp/server.ts +835 -150
  65. package/src/adapters/mcp/stdio.ts +3 -1
  66. package/src/adapters/mcp/stood-down.ts +51 -0
  67. package/src/adapters/mcp/tools.ts +167 -41
  68. package/src/adapters/plugin-run.sh +133 -0
  69. package/src/adapters/plugin.ts +329 -0
  70. package/src/adapters/sessions.ts +18 -4
  71. package/src/core/associate/CONTRACT.md +2 -1
  72. package/src/core/associate/INTERFACE-GAPS.md +6 -1
  73. package/src/core/associate/NOTES.md +45 -0
  74. package/src/core/briefing.ts +12 -3
  75. package/src/core/contradictions.ts +184 -0
  76. package/src/core/counterpart.ts +797 -51
  77. package/src/core/dream/CONTRACT.md +36 -4
  78. package/src/core/dream/INTERFACE-GAPS.md +29 -6
  79. package/src/core/dream/NOTES.md +107 -0
  80. package/src/core/dream/feeling-weeks.ts +198 -0
  81. package/src/core/dream/index.ts +109 -18
  82. package/src/core/dream/reflect.ts +346 -87
  83. package/src/core/dream/tunables.ts +24 -4
  84. package/src/core/encode/INTERFACE-GAPS.md +3 -1
  85. package/src/core/encode/NOTES.md +7 -0
  86. package/src/core/encode/words.ts +45 -0
  87. package/src/core/fit/INTERFACE-GAPS.md +8 -2
  88. package/src/core/fit/NOTES.md +39 -1
  89. package/src/core/fit/index.ts +40 -0
  90. package/src/core/handoff/CONTRACT.md +37 -2
  91. package/src/core/handoff/INTERFACE-GAPS.md +10 -0
  92. package/src/core/handoff/NOTES.md +72 -0
  93. package/src/core/handoff/index.ts +214 -12
  94. package/src/core/handoff/last-here.ts +6 -4
  95. package/src/core/mint.ts +12 -2
  96. package/src/core/physics/CONTRACT.md +14 -2
  97. package/src/core/physics/NOTES.md +33 -1
  98. package/src/core/physics/index.ts +28 -5
  99. package/src/core/prospective/CONTRACT.md +45 -6
  100. package/src/core/prospective/INTERFACE-GAPS.md +4 -0
  101. package/src/core/prospective/NOTES.md +138 -0
  102. package/src/core/prospective/derive.ts +33 -5
  103. package/src/core/prospective/index.ts +90 -5
  104. package/src/core/prospective/windows.ts +72 -1
  105. package/src/core/recall/CONTRACT.md +31 -12
  106. package/src/core/recall/INTERFACE-GAPS.md +28 -4
  107. package/src/core/recall/NOTES.md +70 -1
  108. package/src/core/recall/feeling-ask.ts +10 -1
  109. package/src/core/recall/index.ts +3 -1
  110. package/src/core/recall/probe.ts +58 -0
  111. package/src/core/recall/session.ts +46 -2
  112. package/src/core/recall/time-ask.ts +487 -0
  113. package/src/core/remember/CONTRACT.md +4 -1
  114. package/src/core/remember/INTERFACE-GAPS.md +9 -1
  115. package/src/core/remember/NOTES.md +8 -0
  116. package/src/core/remember/proposals.ts +47 -5
  117. package/src/core/revision.ts +18 -1
  118. package/src/core/schemas/CONTRACT.md +21 -1
  119. package/src/core/schemas/INTERFACE-GAPS.md +20 -2
  120. package/src/core/schemas/NOTES.md +144 -0
  121. package/src/core/schemas/aliases.ts +55 -5
  122. package/src/core/schemas/index.ts +93 -1
  123. package/src/core/schemas/types.ts +2 -0
  124. package/src/core/self/CONTRACT.md +32 -5
  125. package/src/core/self/INTERFACE-GAPS.md +7 -2
  126. package/src/core/self/NOTES.md +102 -1
  127. package/src/core/self/behind.ts +43 -3
  128. package/src/core/self/briefing.ts +12 -2
  129. package/src/core/self/chapter-address.ts +254 -0
  130. package/src/core/self/episodes.ts +27 -0
  131. package/src/core/self/index.ts +83 -8
  132. package/src/core/self/page.ts +88 -0
  133. package/src/core/self/tunables.ts +5 -0
  134. package/src/core/self/work.ts +35 -2
  135. package/src/core/self/writer.ts +30 -0
  136. package/src/core/sleep/INTERFACE-GAPS.md +22 -3
  137. package/src/core/sleep/NOTES.md +20 -1
  138. package/src/core/sleep/consolidate.ts +59 -7
  139. package/src/core/sleep/index.ts +3 -0
  140. package/src/core/sleep/prune.ts +6 -2
  141. package/src/core/sleep/types.ts +7 -0
  142. package/src/core/store/CONTRACT.md +16 -0
  143. package/src/core/store/NOTES.md +66 -0
  144. package/src/core/store/feelings.ts +14 -1
  145. package/src/core/store/index.ts +483 -16
  146. package/src/core/store/operational.ts +95 -2
  147. package/src/core/store/owner-op-seam.ts +23 -0
  148. package/src/core/time.ts +152 -0
  149. package/tools/install-loop/run.sh +48 -12
  150. package/src/adapters/dashboard/web/pages/memories/fold.js +0 -53
package/CHANGELOG.md CHANGED
@@ -1,5 +1,331 @@
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
+
187
+ ## 0.3.12 — 2026-10-08
188
+
189
+ `recall` now asks which kind of question it is. Facts mode answers with every match,
190
+ counted and paged, each fact saying who said it, when it happened and whether it still
191
+ holds; meaning mode lays out a person's, a project's or a feeling's arc across chapters.
192
+ Memories record when the thing happened, who said it and what kind of thing it is, and
193
+ are linked to the people and projects they name. The nightly run reads its whole bundle
194
+ again (every tool result stays under 40,000 characters), and doctor checks what reached
195
+ the model, not only what ran. **The store's format changes (v11 → v12).** The first
196
+ process that writes to the store after the install copies it to
197
+ `snapshots/<time>-pre-migration-v11-to-v12` and then upgrades it; 0.3.11 cannot open a
198
+ v12 store, so going back to 0.3.11 means putting that copy back, and what was remembered
199
+ since is lost.
200
+
201
+ Deliberate recall: two modes, and what a memory records (#321, #322, #323).
202
+
203
+ - **`recall` asks which kind of question it is.** A question now needs `mode`: `facts` (what
204
+ happened, who said it, when, and whether it still holds) or `meaning` (how something went
205
+ and what it adds up to). There is no default; a question without one is refused with the
206
+ two modes named. `ids` and `handle` are unchanged and take no mode, and `ids` / `handle`
207
+ now also read one chapter by its address, `epi_…#2`. The vivid / quiet / dim tiers are
208
+ gone.
209
+ - **Facts mode answers with every match.** It considers every memory the question's words
210
+ reach, every memory about a person or project it names, and the 100 closest by meaning,
211
+ and ranks them by how strongly and how many ways they matched. The answer opens with a
212
+ count (`12 match · showing 10 · 2 more → page 2`) and pages with `page: 2`. Each fact says
213
+ who said it, what kind of thing it is, when it happened and when it was learned, and whether
214
+ it is current, with earlier versions folded under it. A time in the question ("last week",
215
+ "in September", "around the cut-over", "where did we leave off") keeps only what is inside
216
+ it and counts the rest. Memories that faded from long disuse are listed after the results.
217
+ Quoting the words of a fact it showed you now counts as using that memory, as opening it by
218
+ id does. `counterparts ask` answers in facts mode too; `--full` prints the whole answer.
219
+ - **Meaning mode lays out an arc.** Asked about a person, a project or "us", or about a
220
+ feeling, it shows the chapters that hold the subject in time order, the feelings in each
221
+ with whose they are, earlier readings from dreams and reflections, and what is still open,
222
+ for you to read what it adds up to. Faded means the same in both modes.
223
+ - **Memories record when it happened, who said it, and what kind of thing it is (schema
224
+ v12).** `note`, each `session_end` entry (write-ups included) and a dream's gist take three
225
+ optional fields: `occurredOn` (a day, month, range or year — resolve "last week" to a date
226
+ while you know it), `saidBy` (owner, self, inferred) and `status` (done, planned, proposed,
227
+ asked). One that cannot be read is dropped and said beside the memory, which is stored all
228
+ the same; revising a memory by its id carries them over unless new ones are sent. Facts mode
229
+ reads them (above); old memories say "speaker unknown", and doctor's new `Write fields` line says how
230
+ often each one is filled. The upgrade copies the store first, as every upgrade does; old
231
+ memories keep empty fields.
232
+ - **Memories are linked to the people and projects they name.** Each memory is linked at its
233
+ write to the entity cards its words name, a new card links the memories already naming it,
234
+ and the memories from before the upgrade are linked once at the first open after it. Both
235
+ recall modes read the links; a possessive ("Han's") names the card too.
236
+ - **A chapter has an address.** `epi_…#2` names the second chapter of an episode and resolves
237
+ to its heading, its text, the stretch it wrote up and the memories its session wrote in that
238
+ stretch. Chapters now record the moment they were written. Meaning mode names chapters this
239
+ way, and `recall` with `ids` or `handle` opens one.
240
+
241
+ Follow-ups from 0.3.11 (#318, #319).
242
+
243
+ - **`docs/HANDOFF.md` is no longer in the repository.** The note one session leaves for the
244
+ next is written locally and ignored; its history stays.
245
+ - **The wake is rebuilt after an install.** Until now the first wakes after an upgrade were
246
+ the ones the old version composed, until the next write-up or nightly run, so a question
247
+ the new version closes stayed in "Still open". Now the first turn-end after an install
248
+ re-renders it: the session that was open during the install wakes once more with the old
249
+ wake, and every session after it with the new.
250
+ - **A memory server left open across an install says so.** Every tool result, not only
251
+ Desktop's wake, now carries a line saying Counterparts was updated and how to reconnect,
252
+ because until then the server ignores anything newer, such as a field added to a tool. This
253
+ starts with the servers of this version; one from before it says nothing.
254
+ - **Your own Claude Code sessions are the owner's in the memory tools too.** The hooks already
255
+ were; the memory server was not, so closing an open question from another directory was
256
+ refused while the wake dropped it from "Still open" anyway. Now the server Claude Code starts
257
+ takes the install's `"owner": true`, and so does a Claude Code session from Desktop's Code
258
+ tab: it can close a question opened anywhere, and confidential memories are said in its
259
+ answers. A dream's and a reflection's bundles still leave confidential memories out, on
260
+ every server. A Desktop chat is unchanged, the nightly run keeps its old stance, and
261
+ `COUNTERPARTS_OWNER=0` on the server's launch turns it off. A close that is still refused
262
+ now leaves the question in "Still open". Nothing to reinstall: it takes effect on upgrade,
263
+ once the memory server reconnects.
264
+ - **"Work here" takes turns.** When a directory has more work than the wake shows, the newest
265
+ line stays first and the others rotate from one day to the next, so the older work comes
266
+ round too. A wake that had more work lines than it carried leaves a record, which doctor
267
+ and the dashboard's wake bar read.
268
+ - **Doctor sees what a session start could not carry.** A hook's output past Claude Code's
269
+ 10,000-character cap, a session start over its reported ceiling, a notice dropped to make
270
+ room, a part that waited for room, and a handoff or "Last here" line with no room are now
271
+ recorded and read on the Wake line; the first two turn it amber. The Reflection line says
272
+ how long a share has been waiting to be told.
273
+ - **Claude Desktop: wake first, and Always allow.** A Desktop chat whose tools still asked
274
+ permission never called `wake`, answered "what do you remember about yesterday" from a
275
+ search alone, and called that the full record. The install, the quickstart, the help and
276
+ doctor's Claude Desktop line now say to set the counterparts tools to Always allow; the
277
+ server's instructions and the `wake` tool tell the model to wake first in every new chat
278
+ and never to present a search as the complete record.
279
+ - **Doctor's Spawn line sees a step that failed two days running.** It read only today's
280
+ failures, so "the same step failed today and yesterday" could never be said.
281
+
282
+ The night run's bundles, and what reached the model (#315).
283
+
284
+ - **The nightly run reads its whole bundle again.** Claude Code does not hand a tool result
285
+ over 50,000 characters to the model: it saves it to a file and shows a 2 KB preview, and the
286
+ headless run cannot open the file. On the nights of 10-01 and 10-02 the dream's first part
287
+ and its second, and the reflection's first, went that way, so the dream read about a third
288
+ of what it was given. Every tool result is now kept under 40,000 characters: the dream and
289
+ the reflection come in more, smaller parts, and the page writer's day shrinks to fit beside
290
+ the page. A result that would still be too long is cut there, with a note saying so to the
291
+ model, instead of vanishing.
292
+ - **Doctor checks what reached the model, not only what ran.** A new Tool results line goes
293
+ amber when a result was cut to fit, or when a dream or reflection finished without reading
294
+ a part it was handed. A new Wake line goes amber when a session's wake arrived cut short.
295
+ The Spawn line goes amber when the background worker failed after it last started, or the
296
+ same step failed two days running, and the Self page line says when the wake shows only the
297
+ start of a long page.
298
+
299
+ Feelings, round 3 (#317).
300
+
301
+ - **The nightly reflection sees how feelings ran over the last four weeks.** Its bundle now
302
+ carries a short pattern, a few hundred characters: how many feelings of each kind were
303
+ recorded each week, mine and the owner's apart, what changed over the last two weeks, and
304
+ the memories that pattern rests on, so it can cite them. It is counted from the recorded
305
+ feelings, not from the text. It may say the pattern on the self page in its own words,
306
+ citing those memories.
307
+ - **A memory can be felt again during a session.** When an old memory comes up and feels
308
+ different now, `note` takes `feelingsNow`, with or without text. It records how the memory
309
+ feels now beside the original feeling, which stays, the same way the nightly reflection
310
+ does. It works only on a memory this session was shown, at most once a day per memory. The
311
+ feeling is marked as recorded later, while awake. The core counts it only when it would
312
+ count a feeling a reflection recorded later. Doctor's Reflection line says how many there
313
+ are in all, how many are strong enough for the core's fast lane, and how many are the
314
+ owner's. A memory such a feeling carries to the core is said apart from one a reflection's
315
+ feeling carried ("became core on a feeling recorded looking back in a session"), and the
316
+ morning share names only a reflection's.
317
+ - **The reflection is offered unmarked memories to mark.** A fact written in a project with
318
+ no "about" mark counts as that project's work. So a personal one, like a note about a
319
+ person, showed under "Work here". Each night the reflection is now offered up to five
320
+ memories nobody has marked. Those with a feeling, an entity, or the owner's name come
321
+ first, then the most used, then the oldest. It is asked to mark each as owner, us, work or
322
+ world. A mark the writer set is never offered to be changed.
323
+ - **Fixed: a dream's merge no longer re-dates feelings.** Every feeling a merge carried used
324
+ to be dated to the merge night. Each now keeps the moment it was first recorded, as trait
325
+ nudges already did. A merge no longer sets the next morning's mood either.
326
+ - **Fixed: "fear" in a question now reaches scared and frightened, not only afraid.** A word
327
+ the wheel reads as an alias (fear, thankful, touched) now counts as its wheel word.
328
+
3
329
  ## 0.3.11 — 2026-10-01
4
330
 
5
331
  The nightly run now writes up the sessions that ended before they were written up, in
@@ -34,6 +34,11 @@ nothing leaves it except through Claude Code itself.
34
34
 
35
35
  Your memory lives in `~/.counterparts/`.
36
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
+
37
42
  To set it up from a script, with no questions:
38
43
 
39
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.
@@ -40,8 +40,8 @@ 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. |
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. |
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
+ | `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.11",
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.