counterparts 0.3.37 → 0.3.39

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 (129) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/README.md +2 -1
  3. package/docs/QUICKSTART.md +14 -8
  4. package/docs/module-map.md +4 -2
  5. package/package.json +9 -1
  6. package/src/adapters/claude-code/CONTRACT.md +26 -4
  7. package/src/adapters/claude-code/NOTES.md +116 -0
  8. package/src/adapters/claude-code/bin/hook.ts +70 -6
  9. package/src/adapters/claude-code/bin/nightly.ts +2 -0
  10. package/src/adapters/claude-code/bin/runner.ts +64 -2
  11. package/src/adapters/claude-code/child-error.ts +211 -0
  12. package/src/adapters/claude-code/child.ts +29 -10
  13. package/src/adapters/claude-code/doctor-checkout.ts +4 -2
  14. package/src/adapters/claude-code/doctor-host.ts +31 -0
  15. package/src/adapters/claude-code/doctor-meaning.ts +200 -0
  16. package/src/adapters/claude-code/doctor-modes.ts +115 -0
  17. package/src/adapters/claude-code/doctor-open.ts +12 -2
  18. package/src/adapters/claude-code/doctor-self-page.ts +2 -0
  19. package/src/adapters/claude-code/doctor-write-ups.ts +84 -19
  20. package/src/adapters/claude-code/doctor.ts +199 -23
  21. package/src/adapters/claude-code/hooks.ts +162 -11
  22. package/src/adapters/claude-code/index.ts +15 -0
  23. package/src/adapters/claude-code/night-catch-up.ts +25 -5
  24. package/src/adapters/claude-code/night-run.ts +86 -11
  25. package/src/adapters/claude-code/stale-windows.ts +160 -0
  26. package/src/adapters/claude-code/standdown.ts +70 -3
  27. package/src/adapters/cli/INTERFACE-GAPS.md +14 -0
  28. package/src/adapters/cli/NOTES.md +25 -0
  29. package/src/adapters/cli/bin/counterparts.ts +4 -2
  30. package/src/adapters/cli/commands-dashboard.ts +8 -5
  31. package/src/adapters/cli/commands-install.ts +12 -14
  32. package/src/adapters/cli/commands.ts +5 -2
  33. package/src/adapters/cli/coverage.ts +28 -6
  34. package/src/adapters/cli/help.ts +6 -1
  35. package/src/adapters/cli/index.ts +2 -0
  36. package/src/adapters/cli/install.ts +24 -1
  37. package/src/adapters/cli/mechanisms.ts +31 -8
  38. package/src/adapters/cli/rollback.ts +3 -3
  39. package/src/adapters/cli/snapshot.ts +4 -4
  40. package/src/adapters/cli/ui.ts +10 -0
  41. package/src/adapters/cli/uninstall.ts +16 -74
  42. package/src/adapters/cli/wire.ts +227 -33
  43. package/src/adapters/config.ts +23 -0
  44. package/src/adapters/dashboard/bin/dashboard.ts +2 -0
  45. package/src/adapters/dashboard/registries.ts +1 -1
  46. package/src/adapters/dashboard/web/mechanisms/index.js +2 -0
  47. package/src/adapters/dashboard/web/mechanisms/schema/index.js +9 -6
  48. package/src/adapters/dashboard/web/mechanisms/schema/panel.js +14 -0
  49. package/src/adapters/dashboard/web/narrate.ts +10 -3
  50. package/src/adapters/dashboard/web/views/mechanism-panel.ts +44 -0
  51. package/src/adapters/dashboard/web/views/mechanisms.ts +13 -1
  52. package/src/adapters/expansions.ts +4 -3
  53. package/src/adapters/fired.ts +29 -0
  54. package/src/adapters/host-wiring.ts +56 -1
  55. package/src/adapters/hosts.ts +51 -0
  56. package/src/adapters/lifecycle.ts +4 -2
  57. package/src/adapters/mcp/CONTRACT.md +26 -3
  58. package/src/adapters/mcp/INTERFACE-GAPS.md +11 -0
  59. package/src/adapters/mcp/NOTES.md +149 -0
  60. package/src/adapters/mcp/bin/serve.ts +83 -4
  61. package/src/adapters/mcp/chat-wake.ts +111 -0
  62. package/src/adapters/mcp/deliberate.ts +5 -2
  63. package/src/adapters/mcp/index.ts +3 -1
  64. package/src/adapters/mcp/nights.ts +434 -9
  65. package/src/adapters/mcp/protocol.ts +11 -2
  66. package/src/adapters/mcp/server-args.ts +6 -0
  67. package/src/adapters/mcp/server-options.ts +19 -2
  68. package/src/adapters/mcp/server-self-tools.ts +23 -8
  69. package/src/adapters/mcp/server-session-end.ts +5 -3
  70. package/src/adapters/mcp/server-words.ts +218 -4
  71. package/src/adapters/mcp/server.ts +524 -56
  72. package/src/adapters/mcp/tools.ts +266 -12
  73. package/src/adapters/mechanism-evidence.ts +90 -15
  74. package/src/adapters/owned-names.ts +105 -0
  75. package/src/adapters/plugin.ts +34 -7
  76. package/src/adapters/private-base.ts +175 -0
  77. package/src/adapters/private-umask.ts +71 -0
  78. package/src/adapters/remote/CONTRACT.md +75 -0
  79. package/src/adapters/remote/INTERFACE-GAPS.md +20 -0
  80. package/src/adapters/remote/NOTES.md +80 -0
  81. package/src/adapters/remote/bin/serve-http.ts +258 -0
  82. package/src/adapters/remote/call-log.ts +206 -0
  83. package/src/adapters/remote/http.ts +500 -0
  84. package/src/adapters/sessions.ts +121 -7
  85. package/src/adapters/snapshots.ts +3 -3
  86. package/src/adapters/spawn.ts +13 -6
  87. package/src/adapters/update-check.ts +870 -0
  88. package/src/adapters/update-words.ts +230 -0
  89. package/src/core/counterpart-deposit.ts +35 -2
  90. package/src/core/counterpart-sweep.ts +7 -1
  91. package/src/core/counterpart-types.ts +7 -0
  92. package/src/core/counterpart.ts +185 -23
  93. package/src/core/coverage/CONTRACT.md +12 -5
  94. package/src/core/coverage/NOTES.md +40 -1
  95. package/src/core/coverage/index.ts +73 -14
  96. package/src/core/coverage/tunables.ts +15 -1
  97. package/src/core/dream/CONTRACT.md +47 -9
  98. package/src/core/dream/NOTES.md +115 -0
  99. package/src/core/dream/index.ts +51 -6
  100. package/src/core/dream/recalled.ts +90 -0
  101. package/src/core/dream/reflect.ts +156 -25
  102. package/src/core/dream/tunables.ts +61 -0
  103. package/src/core/handoff/CONTRACT.md +8 -1
  104. package/src/core/handoff/NOTES.md +52 -0
  105. package/src/core/handoff/last-here.ts +52 -0
  106. package/src/core/mint.ts +8 -1
  107. package/src/core/onboarding.ts +35 -8
  108. package/src/core/recall/CONTRACT.md +11 -0
  109. package/src/core/reconsolidation.ts +2 -1
  110. package/src/core/remember/CONTRACT.md +2 -1
  111. package/src/core/remember/owes.ts +7 -1
  112. package/src/core/remember/proposals.ts +41 -1
  113. package/src/core/schemas/CONTRACT.md +4 -2
  114. package/src/core/self/INTERFACE-GAPS.md +20 -0
  115. package/src/core/self/briefing.ts +37 -1
  116. package/src/core/self/identity.ts +54 -4
  117. package/src/core/self/index.ts +69 -4
  118. package/src/core/self/work.ts +20 -0
  119. package/src/core/self/writer.ts +15 -1
  120. package/src/core/store/CONTRACT.md +28 -2
  121. package/src/core/store/NOTES.md +97 -2
  122. package/src/core/store/db.ts +24 -1
  123. package/src/core/store/index.ts +28 -2
  124. package/src/core/store/operational.ts +37 -1
  125. package/src/core/store/pre-migration.ts +6 -2
  126. package/src/core/store/private.ts +319 -0
  127. package/src/core/store/shapes.ts +6 -0
  128. package/src/core/types.ts +28 -0
  129. package/tools/install-loop/run.sh +3 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,193 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.39 — 2026-10-28
4
+
5
+ Counterparts now tells you when an update is out: once a day it asks the npm registry for the newest version number (nothing about you or your memory goes with it), and when you're a few releases behind, or a release is worth taking, your Claude says so once, with the steps for how you installed. **To turn it off,** tell your Claude to stop reminding you about updates, or set `"updateCheck": false` in `~/.counterparts/claude-code.json`, or `COUNTERPARTS_UPDATE_CHECK=off`; it never runs under Claude Code's `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. A store now keeps its id after its first week (the session-start cleanup no longer deletes its handle salt). When `claude` isn't on PATH, the `claude mcp add …` line to paste sits on one line of its own. No store-format change (store v15, cache v7), and nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.38 needs no store restore: `counterparts disconnect`, 0.3.38's install, then `counterparts connect`.
6
+
7
+ - **Counterparts now tells you when an update is out.** Once a day, it asks the npm registry
8
+ (`registry.npmjs.org`) for the newest version number. The request carries no memory, no
9
+ conversation, no identifier, not even which version you have; because it's daily, npm
10
+ can see your computer's network address and that Counterparts checked that day. When
11
+ you're a few releases behind, or a release is worth taking, your Claude mentions it once,
12
+ with the steps for how you installed. **To turn it off, tell your Claude to stop
13
+ reminding you about updates, or set `"updateCheck": false` in
14
+ `~/.counterparts/claude-code.json` (or `COUNTERPARTS_UPDATE_CHECK=off`).** It doesn't
15
+ run under Claude Code's `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`; a copy that checks
16
+ nothing says once, after 30 days, that a newer one may be out. `counterparts doctor` has
17
+ an Updates line.
18
+ - **Plugin users are offered Claude Code's own auto-update, once.** /plugin → Marketplaces →
19
+ counterparts → Enable auto-update keeps Counterparts current without asking.
20
+ - **The plugin's update step is now Update marketplace.** Fix lines say /plugin →
21
+ Marketplaces → counterparts → Update marketplace, which refreshes the listing before it
22
+ updates, instead of Installed → Update now.
23
+ - **npm lines say `@latest`.** Doctor's and the wake's npm steps, and the install lines in the README,
24
+ QUICKSTART and docs, say `npm install -g counterparts@latest`: on Node 20 the bare form quietly
25
+ installs 0.3.10. After the bun installer, the docs say to open a new terminal.
26
+ - **A store keeps its id after its first week.** The session-start cleanup removed the store's handle salt
27
+ (`sessions/expansions.salt`) seven days after it was made, so the next session made a new one: the store's id
28
+ changed (the sidebar compares it) and earlier handle lookups no longer matched. The salt is now kept however old
29
+ it is. A store that already lost its salt has nothing to recover: the one it made since is kept from now on, and
30
+ handle lookups only last a day anyway.
31
+ - When `claude` isn't on PATH, setup and connect print the `claude mcp add …` line to paste on one line of its own, never wrapped, so pasting it works on a narrow terminal (it's the same line doctor prints). The `claude mcp remove …` line disconnect prints in the same case is on its own line too.
32
+
33
+ ## 0.3.38 — 2026-10-28
34
+
35
+ Dreams can be found: ask about a dream, or about something only a dream held, and recall shows it labelled `[dream]`, told as dreamed and never as lived; `recall "last dream"` reads the newest one whole. An open item can say what would settle it ("settles when …"), and the night closes a few when that plainly happened. The wake says so when search by meaning is switched on but can't run, with the fix for how you installed, and an open window that meets a memory another window's newer Counterparts upgraded says whether to reload or update. A nightly run that fails now records what Claude Code said, so the next failure can be read. Short check-ins are written up by the next night, and "Last here" names the newest session. **Privacy:** your store is now readable by your account alone (folders 700, files 600, tightened the first time this version writes to it), and `counterparts connect` adds one `deniedMcpServers` entry to `~/.claude/settings.json` so Claude Code never loads Counterparts Online beside this install. **Run `counterparts connect` once after upgrading from npm** to add that entry: until then doctor's new Online line reads amber. No store-format change (store v15, cache v7). Going back to 0.3.37 needs no store restore: `counterparts disconnect`, 0.3.37's install, then `counterparts connect`. Restart the dashboard and every Claude Code session afterwards so the long-running memory server and dashboard load the new version.
36
+
37
+ - **Still open lists this folder's threads first.** A session's "Still open" leads with the
38
+ open threads written in its folder (and the folders joined to it as one project), then the
39
+ personal ones (about me, us or the owner) from anywhere. Another folder's work stays in that
40
+ folder, as "Work here" does, and the "N more open" line counts only what could show here.
41
+ The `still open` recall handle lists by the same rule. A thread with no folder recorded is
42
+ shown with the personal ones.
43
+ - **Short sessions are written up too.** A session that ends without leaving a record of its
44
+ own (no answer to the end-of-session ask, no chapter, no write-up) is now owed a write-up
45
+ whatever its size, so a quick check-in is remembered by the next night instead of being let
46
+ go. Notes saved in the moment still count as written, but they are not the session's record.
47
+ The 15-minute floor still applies to a closing line after a session's own record.
48
+ - **A night runs for check-ins.** When the dream has too little new to work on, each session
49
+ owed a write-up counts as one new memory, because the night writes it up first; with three,
50
+ the night runs whole instead of its catch-up alone — and dreams only if the catch-up did
51
+ write them up; when it could not, the night stays the catch-up alone.
52
+ - **"Last here" names the newest session.** When the folder's newest session wrote no chapter,
53
+ the wake's "Last here" names it, with its newest memory (or "not written up yet"), and the
54
+ older chapter after it, instead of the older chapter as if nothing had happened since.
55
+ - **"Last here" quotes the session's own words, and passes over runs nobody attended.** It no
56
+ longer quotes what the night filed under a session (a dream's gist or merge, a reflection's
57
+ entry) as if the session had said it: the quote is the session's own note, its write-up, or
58
+ "not written up yet". A `claude -p` or Agent SDK run is passed over for the person's own
59
+ session, and a session with no chapter now gets its room in the wake too.
60
+ - **Doctor no longer goes amber every morning for short check-ins.** Yesterday's sessions are
61
+ owed until that night's catch-up, which runs at the day's first prompt, so a doctor read before
62
+ it was amber every morning. Its Catch-up line is now amber only when a session is overdue: a
63
+ catch-up ran on a later day and left it owed, or two days of use passed with no catch-up since.
64
+ The sessions left to lapse are now named for what they are: short headless runs (`claude -p`,
65
+ the Agent SDK), and short sessions with no session record.
66
+ - **The memory server speaks MCP 2025-11-25 when a client asks for it.** claude.ai's connector and Claude
67
+ Desktop's chat ask for it, and now get it back instead of being answered in 2025-06-18. Nothing a
68
+ client sees changes beyond the version: that revision's additions are optional, and this server
69
+ uses none of them. A client asking for a version the server doesn't know still gets 2025-06-18.
70
+ - **Under Node, a deleted row's words no longer linger in the database file.** Node's built-in
71
+ SQLite leaves `secure_delete` off, so a deleted or rewritten row stayed in the file's free space
72
+ until the page was reused. The store now sets it to FAST on every open, as it already was under
73
+ Bun.
74
+ - **A nightly run that fails now says why.** When a background child of the nightly run exits
75
+ with an error, the run's record, `counterparts doctor` and `dream --show` carry one short
76
+ line of what Claude Code said (for example "Not logged in · Please run /login"), with
77
+ anything that looks like a key or token blanked out. Before, it said only "claude exited
78
+ with an error (exit 1)". A run that stopped because Claude Code was signed out, such as
79
+ after switching accounts mid-run, now says so plainly, and the next session offers to dream
80
+ there.
81
+ - **`counterparts connect` keeps Counterparts Online out of Claude Code.** Claude Code loads
82
+ your claude.ai connectors into every session, so with both this install and the hosted
83
+ connector you would get two memories over two stores. `connect` (and so `install`) now adds
84
+ one entry, `{ "serverUrl": "https://app.counterparts.ai/*" }`, to `deniedMcpServers` in
85
+ `~/.claude/settings.json`, with the same backup and leaving everything else as it is;
86
+ `disconnect` takes out exactly that entry. `doctor` has an Online line; an install from
87
+ before this version reads amber there until you run `counterparts connect` once.
88
+ - **Your memory is private to your account on this computer.** The store, its snapshots and
89
+ everything Counterparts writes under `~/.counterparts` are now readable by you alone
90
+ (folders 700, files 600; they were 755 and 644). An existing store is tightened the first
91
+ time this version writes to it; a drive that doesn't keep permissions (exFAT, some network
92
+ drives) is left as it is and still opens. `doctor` has a Privacy line that says when the
93
+ store is readable by other accounts, with the two commands that close it.
94
+ - **`backup --out` and `export` write private copies** (the database `600` in a `700`
95
+ folder) wherever you point them. A store you share with a group on purpose is made
96
+ private again the next time Counterparts writes to it; there is no switch for that yet.
97
+ - **A `snapshots.dir` you pointed somewhere of your own stays yours.** Only the snapshots in
98
+ it (the dated copies and the copies taken before an upgrade) are made private; the folder
99
+ itself is closed only when it holds nothing but snapshots, and never when it is your home
100
+ folder or above it. Everything else in it keeps its permissions.
101
+ - **`uninstall --delete-memories` now deletes a store `rollback` set aside, and says so.** A
102
+ `rollback-aside-…` folder beside your store is a whole earlier copy of your memory; it used
103
+ to be left behind. The plan names it as memory on its own line and counts it ("That is 2
104
+ memory stores: yours, and 1 …") before you type the confirmation.
105
+ - **`uninstall --delete-memories` never takes a `snapshots.dir` you chose.** A snapshots
106
+ folder your configuration points at, even one inside the same folder as the
107
+ configuration, is now listed under what is left alone instead of among what is deleted.
108
+ - **`doctor`'s Privacy line is right about setgid folders and the snapshot mirror.** A store
109
+ folder carrying a setgid or sticky bit (on Linux, a folder made inside a setgid one inherits
110
+ it) is never changed by a session, so the line now gives the one command to run by hand
111
+ (`chmod go-rwx …`, which keeps the bit) instead of saying the next session will do it. With a
112
+ `snapshots.mirror` configured, the line says the mirror is not checked.
113
+ - **Installing through a `~/.counterparts` link to a folder that is not there yet** now says so
114
+ and how to fix it (make the folder, or remove the link), instead of a bare `ENOENT`.
115
+ - **Dreams can be remembered by what they were about.** Asking about something a recent dream
116
+ was about ("keys", "locked doors") brings that dream up as one line after the answer, even
117
+ when the question never says "dream": one at most, and only when its meaning is close.
118
+ Asking about a dream ("did you dream about the greenhouse?") finds it by its words or
119
+ meaning, however old, and shows it first with a few lines of it. Either way it is labelled
120
+ `[dream]` with its date and id, and said to be dreamed, not lived, so it is told as a dream
121
+ and never as something that happened. "When did you last dream?" always names the newest
122
+ one, including one from earlier the same day.
123
+ - **Dreams fade unless they are talked about.** A recent dream comes up beside other
124
+ questions only for a day or so, unless it is read, asked about by what it was about, or
125
+ told; each day it is, it stays longer. It is never deleted: asking about dreams, "last
126
+ dream" and its id still find it.
127
+ - **Dreams follow the folder setting for where they ran.** A dream that ran in a folder set
128
+ off or paused is not shown in another folder's answers or as its "last dream". The rule
129
+ is about where the dream ran, not what it is about.
130
+ - **`recall "last dream"` reads the newest dream whole.** The handle `last dream` (or `last
131
+ night`, any case) returns the newest dream in full, its title, whole journal and what it did,
132
+ with the reflection after it and its share; nothing is credited or marked told. A dream's or
133
+ a reflection's id given alone as a handle reads whole too.
134
+ - **Dreaming off stops a dream on every host.** With dreaming set off, `dream` refuses to
135
+ launch, and refuses its writer and begin steps called without a launch, in Claude Code, the
136
+ Code tab and Desktop chat alike; a run already under way finishes. Desktop chat's dream and
137
+ reflect words say to follow the prompt in the chat itself, with no background agent.
138
+ - **Your counterpart tells you when search by meaning can't run.** When it's switched on but
139
+ its files didn't install or won't load, the session's wake carries one line for the assistant
140
+ to pass on: what's off, that memories are still found by their words, and the fix for how you
141
+ installed (for the plugin, `/plugin` → Installed → counterparts → Update now; for npm,
142
+ installing Counterparts again). If it keeps failing for another reason, it says so once a day
143
+ and points at doctor. Nothing is said when it's healthy or when you switched it off.
144
+ - **The fix for missing meaning files now works for npm installs.** Doctor and `install` used to
145
+ say `bun add -g counterparts-model-potion`, which Counterparts doesn't look for; they now say to
146
+ install Counterparts again (`npm install -g counterparts` under Node, `bun add -g counterparts`
147
+ under Bun).
148
+ - **An open item can say what would settle it.** Beside `unresolved: true`, `remember` and
149
+ `session_end` entries take an optional `settlesWhen`, a short phrase like "the landlord
150
+ replies". "Still open", in the wake and in `recall "still open"`, shows it after the
151
+ item ("… · settles when the landlord replies"; the wake cuts a long one at about
152
+ 80 characters). From the day after it was written, the nightly reflection is shown open items
153
+ that name one, and closes at most three a night when a memory plainly shows that thing
154
+ happened, with a why and the way back; when the memory it points to is missing, is the item
155
+ itself or is older than it, the morning share says so. Items without one behave exactly as
156
+ before. `status` counts open items that name one, that have only a date, and that have
157
+ neither.
158
+ - **An open window that meets a memory a newer Counterparts upgraded says what to do.** For the plugin, it used to say
159
+ "Run /mcp and Reconnect", which restarts the same old version. Now it says to run `/reload-plugins` (with `--force`
160
+ if it warns about the cache), or start a new session (first, in Claude Desktop's Code tab), when Claude Code already
161
+ has the newer version, and to update the plugin first when it doesn't. The npm install keeps "/mcp and Reconnect".
162
+ - **The hook in that window says the same, and tells the assistant too.** The red "memory is OFF … Run: counterparts
163
+ doctor" line now names the step for how you installed (plugin installs have no `counterparts` command; an npm
164
+ install is told to update itself), and the assistant gets a line so it doesn't act as if it remembers. Doctor's
165
+ Store open line gives the same step.
166
+ - **After an upgrade, the next session you start names the windows that still run the old version.** Once, with the
167
+ step for each (reload, or `/mcp` and Reconnect for npm); Claude Desktop's wake says it too.
168
+ - **"Counterparts was updated" names the right step for plugin users.** The once-a-session line after an update said
169
+ "Run /mcp and Reconnect" to everyone; a plugin window is now told to run `/reload-plugins` or start a new session.
170
+ - **The end-of-session ask invites a `settlesWhen` beside an open item.** When the assistant marks something still
171
+ open, the ask now suggests naming what would close it, if it can, so more open items reach the nightly check that
172
+ closes them.
173
+ - **An old window's "memory is OFF" line and doctor no longer say reload when a reload wouldn't help.** When the
174
+ plugin version Claude Code records is newer than the window but older than the version that upgraded the memory,
175
+ they now say to update first, as the memory tools already did.
176
+ - **Claude Desktop chat brings up the night's share.** A chat's wake never carried the
177
+ morning share a reflection left, so on a store used from Desktop chat alone it stayed
178
+ unsaid. The next chat's wake now carries it, once, right after its session line. Claude
179
+ Code's terminals wait for the reflecting session to end, as before.
180
+ - **"Today, elsewhere" dates an open folder by its open session.** A folder whose session from
181
+ yesterday ended this morning beside a new one read "open since" yesterday's start; it now
182
+ reads the open session's own start, and "quiet since" measures that session's silence.
183
+ - **The night no longer turns a missing record into "I didn't".** The dream and the page's
184
+ writers are told that finding no record of something is not a memory that it didn't happen,
185
+ so the page says it doesn't know instead. Guidance only: nothing checks a sentence.
186
+ - **`counterparts mechanisms` and the dashboard show Schemas as built.** The row said nothing
187
+ forms beliefs yet; it now counts the beliefs the nights formed, the ones adopted from a dream,
188
+ and the memories filed for and against them, and the dashboard's Schemas panel shows the
189
+ newest beliefs.
190
+
3
191
  ## 0.3.37 — 2026-10-25
4
192
 
5
193
  The wake says what the night did: a "Last night:" line under Yesterday, or, before the day's own nightly run, "The night of Oct 24: …" naming the latest night that finished. "Still open" counts what it leaves out calmly and points at `recall "still open"`, which lists every open item, and a terminal left open for hours reads "quiet since …" instead of "(live)". The Yesterday line can now open with day's end's own summary of yesterday, which in 0.3.36 never showed (a chapter's summary recorded no folder), also when yesterday's work spanned several folders. Ambient recall looks up memories by the meaning of what you just typed, not the exchange before it. **Privacy fixes:** a folder you have turned off no longer shows its chapter summaries ("Might be relevant") or its chapter titles (the Yesterday line) in another folder's session start, whichever way the wake arrives: built at session start, handed over as the last turn-end left it, or read back for a lost session. No store-format change (store v15, cache v7), no wiring change: `counterparts connect` is not needed after upgrading. Going back to 0.3.36 needs no store restore: `counterparts disconnect`, 0.3.36's install, then `counterparts connect`. Restart the dashboard and every Claude Code session afterwards so the long-running memory server and dashboard load the new version.
package/README.md CHANGED
@@ -15,11 +15,12 @@ macOS and Linux; Windows not yet supported.
15
15
 
16
16
  ```
17
17
  curl -fsSL https://bun.sh/install | bash # if you don't have bun
18
+ # then open a new terminal
18
19
  bun add -g counterparts
19
20
  counterparts
20
21
  ```
21
22
 
22
- With Node instead: `npm install -g counterparts`, then `counterparts`. Whichever runtime
23
+ With Node instead: `npm install -g counterparts@latest`, then `counterparts`. Whichever runtime
23
24
  runs the setup is the one Claude Code's hooks and memory tools are wired to.
24
25
 
25
26
  `counterparts` walks you through setup: your name and connecting Claude Code. No API
@@ -3,11 +3,12 @@
3
3
  ## Install
4
4
 
5
5
  You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer,
6
- on macOS or Linux. With Node, install with `npm install -g counterparts` instead of the
6
+ on macOS or Linux. With Node, install with `npm install -g counterparts@latest` instead of the
7
7
  `bun add` line below; the rest is the same.
8
8
 
9
9
  ```
10
10
  curl -fsSL https://bun.sh/install | bash # if you don't have bun
11
+ # then open a new terminal
11
12
  bun add -g counterparts
12
13
  counterparts --version
13
14
  ```
@@ -26,8 +27,9 @@ thing and is safe to run again. It asks two things, and you can skip either of t
26
27
 
27
28
  - **Your name**, so the memory knows what to call you.
28
29
  - **Whether to connect Claude Code.** This adds five hooks to `~/.claude/settings.json`
29
- (it keeps a backup first) and registers the memory tools. Hooks from other tools are
30
- left alone.
30
+ (it keeps a backup first), registers the memory tools, and adds one `deniedMcpServers`
31
+ entry so the Counterparts Online connector never loads into Claude Code as a second memory.
32
+ Hooks and settings from other tools are left alone.
31
33
 
32
34
  There are no API keys. Search by meaning is turned on for you and runs on your machine;
33
35
  nothing leaves it except through Claude Code itself.
@@ -107,16 +109,20 @@ bun add -g counterparts@latest
107
109
  Your memory isn't changed by an upgrade. Open sessions keep running the old version until
108
110
  they restart.
109
111
 
110
- Coming from 0.3.13 or earlier, or from 0.3.14 with Claude Desktop connected, run this
111
- once after upgrading. If you connected Claude Desktop, quit it first:
112
+ Coming from 0.3.37 or earlier, run this once after upgrading. If you connected Claude
113
+ Desktop, quit it first:
112
114
 
113
115
  ```
114
116
  counterparts connect
115
117
  ```
116
118
 
117
- It rewrites the hooks, the memory server's registration and Claude Desktop's entry so
118
- that Bun no longer reads a project's `.env` or `bunfig.toml` into them. Until then
119
- `counterparts doctor`'s Runtime line is amber. Desktop rewrites its own config file while
119
+ It adds one entry to `deniedMcpServers` in `~/.claude/settings.json`, so a claude.ai
120
+ connector to Counterparts Online is never loaded into Claude Code as a second memory
121
+ beside this one, leaving everything else in the file as it is. Until then `counterparts
122
+ doctor`'s Online line is amber. Coming from 0.3.13 or earlier, or from 0.3.14 with Claude
123
+ Desktop connected, it also rewrites the hooks, the memory server's registration and Claude
124
+ Desktop's entry so that Bun no longer reads a project's `.env` or `bunfig.toml` into them;
125
+ until then the Runtime line is amber too. Desktop rewrites its own config file while
120
126
  it's open, so `connect` leaves Desktop's entry alone while Desktop runs, and says so.
121
127
 
122
128
  If you set it up before search by meaning was built in, it turns on by itself after the
@@ -24,7 +24,7 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
24
24
  | `handoff/` | working context for a place | The per-directory handoff: where the work here stands, written as a field on the end-of-session ask, shown as a two-line pointer at the next wake in that directory, expiring in lived days. **Never a memory** — out of recall, out of credit, out of consolidation, out of identity. **Added 2026-09-20 (E1, spec §6.4 / §15 item 6).** |
25
25
  | `coverage/` | rehearsal debt | What is not written up yet, read in one place: per session, the unwritten stretch since its last claim in `coverage.jsonl`. The pacer's third ask (pieces and time), the one rule for what a session owes (retention, the next-session write-up), lapse after fourteen days of use (two until 2026-10-10), the handoff pointer's "how current", and one row per stretch per state. Changes nothing about how pieces are claimed. **Added 2026-09-30.** |
26
26
  | `sleep/` | systems consolidation | Pure math on a cycle: decay tick (active-day clock), floor-pruning (real forgetting), the core's two lanes (at most three a night), re-render of the wake briefing. Zero standing model calls. |
27
- | `dream/` | sleep replay + REM | Dreaming: once a day, if the owner says yes, a background agent (the same model) replays what was lived since the last dream beside what it resembles — merges, links, replays, a pattern, a flagged contradiction, a softened feeling, a core nomination — each recorded for undo, with a dream journal kept apart from lived memory. The module holds the bookkeeping and the rules; the dreamer is the model. **Added 2026-09-26.** Since 2026-09-27 it also holds REFLECTION (`reflect.ts`), the waking self: usually right after a dream, lived, with its own record — an entry, the self page rewritten from the core, a morning share, feelings recorded later, and what a memory is about. |
27
+ | `dream/` | sleep replay + REM | Dreaming: once a day, if the owner says yes, a background agent (the same model) replays what was lived since the last dream beside what it resembles — merges, links, replays, a pattern, a flagged contradiction, a softened feeling, a core nomination — each recorded for undo, with a dream journal kept apart from lived memory — never a memory row, but since 2026-10-27 (D1) recalled by what it was about, labelled `[dream]`; an ordinary question stops reaching it unless it is recalled or retold (`recalled.ts`). The module holds the bookkeeping and the rules; the dreamer is the model. **Added 2026-09-26.** Since 2026-09-27 it also holds REFLECTION (`reflect.ts`), the waking self: usually right after a dream, lived, with its own record — an entry, the self page rewritten from the core, a morning share, feelings recorded later, and what a memory is about. |
28
28
  | `fit/` | working memory's pointers | Fitting what a mechanism has into the room it has: a line for everything, the whole text for the most important, ids and a named lookup for the rest, a count of what waits. Plus `lineOf`, `derivedFrom`, parts, and the lookup ledger that measures whether receivers use the lookup. First users: the dream and the reflection. **Added 2026-09-28 (build B).** |
29
29
  | *(`reconsolidation.ts`)* | reconsolidation + interference | Two memories that disagree: flagged (a dream, today), noticed at write time (the nearest few live memories come back with a stored one), and SETTLED — `changed` (both true at their time: one strength cut, labelled earlier), `corrected` (archived, readable by id), or `open` (both kept, shown together) — by a new memory's `updates` + `how`, a `remember` settle, a dream or reflection with a plain reason, or the owner's `counterparts settle`. Every settle is on a trail (who, how, why, when) and can be undone. A file beside `revision.ts`, whose ordinary-memory arm it is; its tables are the store's (schema v10), its labels recall's (`recall/standing.ts`). **Added 2026-09-29** as `contradictions.ts`; **renamed 2026-10-11** (Group 2: noticing and updating are one process; the tables keep their names). |
30
30
  | *(`time.ts`)* | — (a clock, not a memory) | The one module that converts: a moment (UTC ms from `store.now()`) to a person's local date or clock line, "today" in a zone, and calendar dates as said (day, month, year, range). A file, not a module; a test keeps hand-built dates out of `src/`. **Added 2026-09-25 (`docs/time.md`).** |
@@ -45,11 +45,13 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
45
45
  | `mcp/` | Deliberate tools, ten: remember, 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**), and `meet`, the first meeting (**2026-10-11**, `core/onboarding.ts`). A result's words about the host come from `hosts.ts`. For a Claude Desktop client (by its name at `initialize`, **2026-09-30**) an eleventh, `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`. |
46
46
  | `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. |
47
47
  | `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).** |
48
+ | `remote/` | The memory server as a web connector (**2026-10-26**, the claude.ai trial): `http.ts` serves the same `McpServer` as MCP over HTTP (plain JSON, no SSE), bound to 127.0.0.1 and answering only under a per-run 192-bit secret path, one message at a time; `call-log.ts` keeps one id-only line per call; `bin/serve-http.ts` refuses a store or configuration nobody named and the owner's live stores. Its host is claude.ai's (`claude-ai:`), set at launch. No sign-in yet (its CONTRACT). |
48
49
  | `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`). |
49
50
  | `expansions.ts` | The same shape, for the other direction: the handle-resolution log the MCP `recall` tool writes (`<dataDir>/sessions/expansions.jsonl` — a per-store SALTED hash of the handle (G58), the id it reached or `null` for a refusal, a timestamp, the project) and the boundary's credit pass reads, so an expansion by TITLE credits the memory it actually reached, and a refusal shadows it. **Added 2026-09-15** (LAUNCH-STATUS G50): `recall/reference.ts` credits literal `mem_…` addresses and resolves nothing, so until this the most deliberate act a session had — naming a memory and reading it — earned no credit at all. |
50
51
  | `scopes.ts` | The third shared leaf: the per-directory scope registry (`scopes.json` BESIDE the config, never inside the store, because the hook decides `off` before anything opens) — `on` / `observer` / `off` / `paused`, longest prefix wins, absent-or-unreadable meaning `unset` meaning on. Written by the `counterparts scope` console and the MCP `scope` tool, read by every hook. **Added 2026-09-15** (PR #92, G19): the hooks are registered globally, so until this the only way to say *not here* was a second config file and two environment variables. |
51
52
  | `lifecycle.ts` | The host seam (**2026-09-30**): `HostLifecycle`, the interface a host adapter drives, and `Lifecycle`, its one implementation — what a session is to this memory whatever the host: the wake's composition and the registry's expectation of it, plain reminders, recall for a turn, the boundary (capture, the retroactive-capture seal, credit, the orphan tail), the ask's pacing (not its words), the next-session write-up pointer, every registry write, and the worker spawn with its counters. `claude-code/`'s `ClaudeCodeAdapter` extends it. Imports no adapter. |
52
- | `hosts.ts` | Which host a session lives in (`claude-code` is the default, and what a registry record with no `host` reads as) and the few sentences that depend on it — how to reconnect after an update, what switching the scope does — plus Claude Desktop's: the host name, its pseudo-scope `claude-desktop:` (a name, never resolved as a path), which MCP clients are Desktop, and the Code tab's scratch workspaces. **Added 2026-09-30.** |
53
+ | `hosts.ts` | Which host a session lives in (`claude-code` is the default, and what a registry record with no `host` reads as) and the few sentences that depend on it — how to reconnect after an update, what switching the scope does — plus Claude Desktop's: the host name, its pseudo-scope `claude-desktop:` (a name, never resolved as a path), which MCP clients are Desktop, and the Code tab's scratch workspaces. **Added 2026-09-30.** Since **2026-10-26** a second hookless chat host, claude.ai over the web (`claude-ai`, place `claude-ai:`), chosen by the launch and never by the client's name. |
54
+ | `update-words.ts` | How to get a newer Counterparts into a window, by install route: the plugin's update and the npm command (moved from `claude-code/doctor-meaning.ts`, which re-exports them), `/reload-plugins` and its limits, and what an older copy says when it meets a memory a newer one upgraded — reload when Claude Code records a newer plugin, update otherwise, Reconnect for an npm server. Shared by the MCP server's refusal, the hook's stand-down and doctor, which may not import each other. **Added 2026-10-27 (U1a).** |
53
55
  | `config.ts` | The host configuration's shape and reader (`AdapterConfig`, `loadConfig`, `TUNABLES`, capabilities) — read by the hooks, the worker, the console and the MCP server. Moved out of `claude-code/` on **2026-09-30**. |
54
56
  | `config-path.ts` | Where every entry point looks for that configuration: `--config`, else `COUNTERPARTS_CONFIG`, else `~/.counterparts/claude-code.json`; a named configuration that cannot be honoured refuses rather than falling back. |
55
57
  | `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. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.37",
3
+ "version": "0.3.39",
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": {
@@ -23,6 +23,14 @@
23
23
  "bun": ">=1.3.0",
24
24
  "node": ">=22.15.0"
25
25
  },
26
+ "counterparts": {
27
+ "updates": {
28
+ "tellBelow": null,
29
+ "urgentBelow": null,
30
+ "tellBehind": 3,
31
+ "plugin": true
32
+ }
33
+ },
26
34
  "bin": {
27
35
  "counterparts": "./src/adapters/cli/bin/counterparts.mjs",
28
36
  "counterparts-hook": "./src/adapters/claude-code/bin/hook.mjs",
@@ -830,9 +830,31 @@ children's output (the host's cut, below, is read from the host's own transcript
830
830
  finished) and the exit as its reason;
831
831
  - `failed` or `timed-out`: nothing finished;
832
832
  - `could-not-start`: `no-claude`, `spawn-failed`, `quick-exit` (non-zero inside
833
- `NIGHT_QUICK_EXIT_MS` with nothing begun), `nothing-ran` (a clean exit that began no dream
833
+ `NIGHT_QUICK_EXIT_MS` of the failing child's own start, with nothing begun), `signed-out`
834
+ (2026-10-27: a failed child said the host had lost its sign-in — a 401, "not logged in",
835
+ an invalid key, an expired OAuth token), `nothing-ran` (a clean exit that began no dream
834
836
  and no reflection), `refused`, or `runner` (the detached process could not be started).
835
837
 
838
+ **[M] A failed child says why (2026-10-27, R4; `child-error.ts`).** For a child that exits
839
+ non-zero, one line of what the host said goes on the row's `detail` (`exit`, `quick-exit`,
840
+ `signed-out`, and `partial` by `exit`), on that child's line (`NightChildRun.detail`), on the
841
+ `dream.night` event (`detail`, `childDetails`), and on the write-up row (`detail`; the night
842
+ row's is `catch-up: <line>`). Where it comes from, when the child's output is kept: a result
843
+ that is the host's API error (`terminal_reason: "api_error"`, an `api_error_status`, or
844
+ `subtype: "success"` with `is_error`) gives its reason, status and text; any other error result
845
+ gives only its subtype and status, with the STDERR line beside them — its text may be the
846
+ model's. Else the STDERR line: the last that reads as an error (`error|denied|invalid|failed|
847
+ not logged`), else the last (every child pipes STDERR now; its last `STDERR_TAIL_BYTES` kept).
848
+ At most 300 characters, one line, ANSI and OSC sequences out, home paths as `~`, and scrubbed
849
+ by shape before it is stored or logged (`child-error.ts#scrubSecrets`): `Authorization` with
850
+ its scheme and value, all of a `Cookie:`, the word after `Bearer`, the value after a credential
851
+ label (`…token`, `…key`, `api key`, `secret`, `password`, `pw`, …) bare, JSON or quoted with `:`
852
+ or `=` — and with only a space when the value has a digit or is 16+ long — the prefixes `sk-`,
853
+ `ghp_`/`github_pat_`, `xox?-`, `AKIA`, and any run of 20+ key-ish characters with a digit in it
854
+ become `[redacted]`. `signed-out` is read only from the host's own words (an API-error result,
855
+ a 401 status, or the STDERR line), never a bare "401" or "OAuth", and only when the run began
856
+ nothing. No flag is added to the child, and nothing is retried.
857
+
836
858
  **[M] The child is locked down (owner decision B).** `--permission-mode default`;
837
859
  `--allowedTools` exactly `mcp__counterparts__dream`, `…reflect`, `…self_page`, `…recall`;
838
860
  `--disallowedTools` the built-ins that run commands or code, read, search or write files,
@@ -1082,14 +1104,14 @@ the sweep no interpreter; its gate row says `not-opted-in` and `runner.done` say
1082
1104
  next-session`. A crashed session is pointed at like any other. An old `crashWriteUp` value
1083
1105
  is ignored and named in `retired`.
1084
1106
 
1085
- **[M] Doctor: `Catch-up` (was `Write-ups`, and before that `Crash write-up`; same key), and the `Sweep` line.** Since 2026-09-30 the line reads the coverage ledger — yesterday's state, amber on a stretch owed from yesterday or earlier, the week's lapses (`core/coverage/NOTES.md` §8). Before it, `Crash write-up`: `next session`
1107
+ **[M] Doctor: `Catch-up` (was `Write-ups`, and before that `Crash write-up`; same key), and the `Sweep` line.** Since 2026-09-30 the line reads the coverage ledger — yesterday's state, amber on an OVERDUE stretch (since S2c, 2026-10-26: a catch-up ran on a later date and left it owed, or two days of use with no catch-up since; until then any stretch from yesterday or earlier), the week's lapses (`core/coverage/NOTES.md` §8). Before it, `Crash write-up`: `next session`
1086
1108
  green; amber when a session is finished in one project and waiting on words it left in
1087
1109
  another, naming that project (re-review m-C); amber when the newest pointer outcome is a
1088
1110
  DEFERRAL and sessions are waiting — saying the wake was too full, by how many bytes, and to lower
1089
1111
  `injectionBudgetBytes` by that much (never "open a session", which would defer again);
1090
1112
  and (until 2026-09-30, when the `Write-ups` rule above replaced it) amber when a session had
1091
- waited past a 3-day `WRITE_UP_WAIT_DAYS`. Counted with the pointer's own eligibility: a small
1092
- debt the pointer never offers (not known as a person's session) is named apart, as left to lapse. Never red; not in the session-start reading. `Sweep`: `not-opted-in` —
1113
+ waited past a 3-day `WRITE_UP_WAIT_DAYS`. Counted with the pointer's own eligibility: a
1114
+ debt the pointer never offers (short, and headless or with no session record — counted by reason since S2c) is named apart, as left to lapse. Never red; not in the session-start reading. `Sweep`: `not-opted-in` —
1093
1115
  and an older build's `no-credential` — is green `next session`.
1094
1116
 
1095
1117
  ## 6. Scars honored
@@ -2707,3 +2707,119 @@ running both, found confusing. The npm install now leaves `npm-live.json` beside
2707
2707
  in a night child; the check above left them out), and whether `--system-prompt` changes
2708
2708
  what of the user's CLAUDE.md reaches the child. A model night after release, or the
2709
2709
  coordinator's `childUsage` per child, says.
2710
+
2711
+ ## 2026-10-27 — a failed night child says why (R4)
2712
+
2713
+ Night run nrn_8f332b7d176d (10-27, 2.1.311) ended "claude exited with an error (exit 1)":
2714
+ the catch-up did one batch in 55 s and exited 1; writer, dream and tags each exited 1 in
2715
+ ~3 s with 0 tokens. Nothing of what the host said was kept, so the cause was unrecoverable.
2716
+ It was a lost sign-in: the owner switched Claude Code accounts mid-run.
2717
+
2718
+ - **Measured on 2.1.311 with no sign-in** (an empty `CLAUDE_CONFIG_DIR`, so no hooks and no
2719
+ login): `claude -p` exits 1 and writes `Not logged in · Please run /login` to STDOUT — under
2720
+ `stream-json` an `init` line, a synthetic assistant message, and a `result` line with
2721
+ `is_error: true`, `subtype: "success"`, `terminal_reason: "api_error"`,
2722
+ `api_error_status: null` and all-zero usage (so the row reads 0 tokens rather than none).
2723
+ STDERR is empty. An unknown flag goes to STDERR (`error: unknown option '--x'`), STDOUT
2724
+ empty. So `subtype` is not the test of an error; `is_error` is.
2725
+ - **The catch-up child reads only its STDERR**: its output is text, not kept (it is prose),
2726
+ and the brief adds no flag. A sign-in lost during a write-up therefore leaves the write-up
2727
+ row's `detail` empty; the night's own row gets the line from the dream's child, which keeps
2728
+ its `stream-json`. If a write-up's reason is ever needed alone, keeping its text STDOUT's
2729
+ last line on a non-zero exit is the smallest step (open).
2730
+ - **Quick by the child's own time.** The run's quick-exit test counted from the run's start,
2731
+ catch-up included: a 55-second catch-up made three 3-second exits read `exit`, not
2732
+ `quick-exit` (the reflection, judged on the dream child's own time, was skipped as quick).
2733
+ It now uses the failing child's own `ms`.
2734
+ - **STDERR is piped for every child**, so the exit-then-grace end (once only for children
2735
+ whose STDOUT was kept) now holds for all: a helper holding the pipe cannot hold the run.
2736
+ - **Review of #656 narrowed both readings.** A result's text is read only when it is the
2737
+ host's API error. `max_turns` and `error_during_execution` results can carry the model's
2738
+ words (memory text), so for those only the subtype and status are kept. `signed-out` is
2739
+ read only from the host's own words: no bare "401" ("retry after 401 seconds") and no
2740
+ bare "OAuth" ("the OAuth flow"). It is also gated on nothing having begun, because
2741
+ `fellBack` asks on any `could-not-start`, and a dream that began is resumed instead. The
2742
+ scrub gained JSON, quoted and space-separated labels, Basic auth, whole cookies, `pw=`
2743
+ and the digitless prefixed keys (`ghp_`, `xox?-`, `AKIA`). STDERR prefers its last
2744
+ error-shaped line. OSC sequences are stripped, and home paths become `~`.
2745
+
2746
+ ## 2026-10-27 — the wake says so when search by meaning can't run (W1)
2747
+
2748
+ A plugin install ran for days with no meaning weights (`NO_WEIGHTS`): the plugin's dependency
2749
+ step had not run, nothing self-heals (Bun auto-install is off on purpose), and only doctor's
2750
+ amber line said so. Now `doctor-meaning.ts#wakeMeaningLine` gives the session-start wake one
2751
+ line for the model to tell its person, under the clock beside the Code tab's line (outside the
2752
+ wake block, so the sentinel's byte count is untouched). Desktop's `wake` carries the same line
2753
+ in its notice slot (`mcp/bin/serve.ts#desktopWakeNotice`).
2754
+
2755
+ - **Configured on and can't run, nothing else, and only to a person.** Off by choice, an
2756
+ observer, a resume's short wake, and any start `watchedAtStart` refuses (the headless night,
2757
+ `claude -p`/SDK, a compaction) say nothing; Desktop's `wake` with `night: true` neither.
2758
+ - **`missing`**: this process finds no whole table (both files). The hook's environment is the
2759
+ worker's, so this is the look the worker makes, and it fires before any boundary too (a fresh
2760
+ plugin install's first wake). A worker row that still says `NO_WEIGHTS`/`MISSING_FILE` while
2761
+ the table is whole now reads as restored: silent until the next row.
2762
+ - **`unloadable`**: the newest row's refusal is any other code; it stands until the next row.
2763
+ - **`stopped`**: `adapter.runner.failed` with `step: "vectors"` on two separate dates, with no
2764
+ backfill row since the earlier one. One failure is not enough (review of #664): the runner
2765
+ latches one row per step per date, and its `vectors` step covers the lagged cue as well as
2766
+ the backfill, so a single throw is one bad boundary. Said at most once a day
2767
+ (`adapter.meaning.stopped.told`, the date; an unattended start does not spend it).
2768
+ `missing`/`unloadable` are said every wake until fixed: the person is the fix.
2769
+ - **A backfill "stuck at 0" was dropped** (review of #664). The static table blames every miss on
2770
+ the memory (`vectors.ts`, `isStatic`) and sets it aside on its third (`EMBED_SKIP_AFTER`), so
2771
+ `remaining` falls — `test/wake-meaning-off.test.ts` runs three real backfills to show it. What
2772
+ can stay flat is the store refusing vectors (`refused:` codes; doctor's held / cache-ahead
2773
+ lines) or counter writes lost to a lock: neither is a person's fix, and both are doctor's.
2774
+ - **One route rule.** `byRoute`, `PLUGIN_UPDATE`, `PLUGIN_TABLE_UPDATE`, `npmTableCommand` and
2775
+ `tableOnDisk` moved here from `doctor.ts`; doctor's fix lines and `install`'s hint use them
2776
+ too. The npm route reinstalls Counterparts with the runtime it runs on (`npm install -g
2777
+ counterparts` under Node, `bun add -g counterparts` under Bun): the table is its own
2778
+ dependency, and a separate global `counterparts-model-potion` is not where
2779
+ `resolveStaticWeights` looks. The table is "found" only with both files, as the loader needs.
2780
+ `stopped` points at doctor (`/counterparts:doctor`, or `counterparts doctor` in a terminal).
2781
+ - **Not covered**: `held` and `cache-ahead` (the store withdrawing the channel) stay doctor's.
2782
+
2783
+ ## 2026-10-28 — the daily update check and its lines (U1b)
2784
+
2785
+ The design is `~/counterparts-notes/2026-10-27-briefs/U1-design-note.md` rev 2; the code is
2786
+ `../update-check.ts` (a leaf: the worker, this hook, Desktop's server and the MCP `scope` tool
2787
+ all use it).
2788
+ - **The request lives in the worker**, as step 6 after `counterpart.close()`, beside the
2789
+ sidebar's file. "Stop" is read from the store before the close. No hook ever makes it.
2790
+ - **A timer of its own, not `AbortSignal.timeout`.** Under Node that timer is unref'd, so a
2791
+ request holding nothing else open let the loop drain before the limit fired (the node smoke
2792
+ test caught it). `setTimeout` + `AbortController`, cleared in `finally`.
2793
+ - **"Stop reminding me" is the whole switch, not a mute** (builder's call on Mike's Q4). The
2794
+ /privacy draft says "tell your Claude to stop checking for updates", so it stops the request
2795
+ too. It is `scope`'s `updates: "off"`, one store meta key (`adapter.update.check`), so the
2796
+ worker, every wake and doctor see it wherever they run; no process rewrites
2797
+ `claude-code.json` (a bad write there is observer, memory off).
2798
+ - **Differs from the note:** a person who said no (config key, telling their Claude, the env
2799
+ switch) gets no age line either. The note kept it for the off switch; Mike's Q4 ("stop
2800
+ reminding me") wins. Only Claude Code's no-traffic switch, the directory flavor and a check
2801
+ failing for 14 days get it.
2802
+ - **"Not on the meeting day"** is the day the meeting was last offered
2803
+ (`lastOffer(store)?.on === today`). Not "while the meeting is pending" (review of #672):
2804
+ `offered`/`later` outlive the offer days, so a person who put the meeting off never heard of
2805
+ an update, urgent included. A wake that makes the offer (or a re-offer) counts too
2806
+ (`offerDue`, re-check of #672): the offer is recorded only after the wake is built, so a fresh
2807
+ install's first wake otherwise carried "Enable auto-update" beside the meeting.
2808
+ - **An urgent day is the urgent line's alone**: a second window that day gets no tell/behind.
2809
+ - **Review of #672, the rest.** At most one request a day, failures included (a failed day tries
2810
+ again the next; doctor's amber counts failed days in a row, from the third). A U1 line is
2811
+ composed only where it fits: the wake, the lines above it and itself `UPDATE_ROOM_MARGIN`
2812
+ (600 bytes) under the host's ceiling; otherwise it is not claimed and the next wake says it.
2813
+ The urgent line's days spent, the release is told once more as an ordinary line. Desktop's
2814
+ long-running server says no update line while the package on disk differs from what it
2815
+ loaded. The worker reads "stop" fail-closed. The age line is said once per copy, softly.
2816
+ - **`counterparts start-fresh` does not carry the "stop"** (`adapter.update.check` is store meta,
2817
+ and start-fresh carries no store meta across). After start-fresh,
2818
+ a person who had said stop says it again, or sets `"updateCheck": false`.
2819
+ - **Once-ness** is one meta key (`adapter.update.told`) claimed with `updateMeta`, as the
2820
+ older-windows line is; the worker's try latches are files under `updates/` beside the
2821
+ configuration (it has no store open by then).
2822
+ - **Unverified:** Update marketplace vs Update now (no throwaway-home run yet); whether
2823
+ `known_marketplaces.json` carries `autoUpdate` at the default; which marketplace the
2824
+ directory listing lands in (`claude-community` and `@synced` are both handled off the copy's
2825
+ own path).