counterparts 0.3.19 → 0.3.20

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 (86) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +8 -3
  3. package/docs/module-map.md +6 -0
  4. package/package.json +1 -1
  5. package/src/adapters/claude-code/CONTRACT.md +12 -11
  6. package/src/adapters/claude-code/NOTES.md +29 -0
  7. package/src/adapters/claude-code/bin/hook.ts +5 -3
  8. package/src/adapters/claude-code/bin/runner.ts +11 -7
  9. package/src/adapters/claude-code/doctor.ts +99 -19
  10. package/src/adapters/claude-code/hooks.ts +70 -86
  11. package/src/adapters/claude-code/index.ts +0 -3
  12. package/src/adapters/cli/NOTES.md +8 -0
  13. package/src/adapters/cli/commands-install.ts +29 -10
  14. package/src/adapters/cli/commands-readings.ts +4 -2
  15. package/src/adapters/cli/commands-scope.ts +25 -4
  16. package/src/adapters/cli/commands-self.ts +4 -1
  17. package/src/adapters/cli/commands-start-fresh.ts +1 -1
  18. package/src/adapters/cli/help.ts +5 -7
  19. package/src/adapters/cli/install.ts +4 -2
  20. package/src/adapters/cli/mechanisms.ts +2 -2
  21. package/src/adapters/config.ts +38 -30
  22. package/src/adapters/dashboard/CONTRACT.md +14 -0
  23. package/src/adapters/dashboard/NOTES.md +15 -0
  24. package/src/adapters/dashboard/activity.ts +1 -1
  25. package/src/adapters/dashboard/bin/dashboard.ts +3 -3
  26. package/src/adapters/dashboard/browse.ts +1 -1
  27. package/src/adapters/dashboard/identity.ts +1 -1
  28. package/src/adapters/dashboard/registries.ts +14 -14
  29. package/src/adapters/dashboard/resolve.ts +1 -1
  30. package/src/adapters/dashboard/status.ts +5 -2
  31. package/src/adapters/dashboard/web/app.html +1 -1
  32. package/src/adapters/dashboard/web/flow.ts +1 -1
  33. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +2 -2
  34. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +1 -1
  35. package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -1
  36. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +2 -2
  37. package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +3 -3
  38. package/src/adapters/dashboard/web/mechanisms/salience/panel.js +2 -2
  39. package/src/adapters/dashboard/web/narrate.ts +11 -11
  40. package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +1 -1
  41. package/src/adapters/dashboard/web/pages/health/sections/checks.js +3 -2
  42. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +5 -5
  43. package/src/adapters/dashboard/web/pages/health/sections/mechanisms.js +1 -1
  44. package/src/adapters/dashboard/web/pages/health/sections/wake.js +2 -2
  45. package/src/adapters/dashboard/web/pages/self/sections/dreams.js +2 -2
  46. package/src/adapters/dashboard/web/pages/self/sections/journal.js +5 -5
  47. package/src/adapters/dashboard/web/pages/self/sections/page.js +13 -13
  48. package/src/adapters/dashboard/web/pages/self/sections/settling.js +1 -1
  49. package/src/adapters/dashboard/web/pages/self/sections/wake.js +7 -7
  50. package/src/adapters/dashboard/web/server.ts +9 -1
  51. package/src/adapters/dashboard/web/shared/event-modal.js +1 -1
  52. package/src/adapters/dashboard/web/shared/memory-card-words.js +1 -1
  53. package/src/adapters/dashboard/web/shared/memory-modal.js +5 -5
  54. package/src/adapters/dashboard/web/views/activity.ts +1 -1
  55. package/src/adapters/dashboard/web/views/dreams.ts +1 -1
  56. package/src/adapters/dashboard/web/views/health.ts +1 -1
  57. package/src/adapters/dashboard/web/views/mechanisms.ts +6 -6
  58. package/src/adapters/dashboard/web/views/mind.ts +21 -9
  59. package/src/adapters/dashboard/web/views/overview.ts +3 -3
  60. package/src/adapters/expansions.ts +14 -1
  61. package/src/adapters/lifecycle.ts +25 -4
  62. package/src/adapters/mcp/CONTRACT.md +1 -1
  63. package/src/adapters/mcp/server-self-tools.ts +25 -1
  64. package/src/adapters/mcp/server-words.ts +3 -2
  65. package/src/adapters/mcp/server.ts +45 -9
  66. package/src/adapters/mcp/tools.ts +4 -3
  67. package/src/adapters/plugin.ts +13 -8
  68. package/src/adapters/store-id.ts +58 -0
  69. package/src/core/counterpart-boundary.ts +9 -0
  70. package/src/core/counterpart.ts +19 -6
  71. package/src/core/dream/CONTRACT.md +8 -0
  72. package/src/core/dream/index.ts +15 -2
  73. package/src/core/handoff/last-here.ts +24 -12
  74. package/src/core/onboarding.ts +228 -62
  75. package/src/core/prospective/CONTRACT.md +4 -1
  76. package/src/core/prospective/index.ts +23 -5
  77. package/src/core/reconsolidation.ts +1 -1
  78. package/src/core/self/CONTRACT.md +25 -9
  79. package/src/core/self/NOTES.md +6 -0
  80. package/src/core/self/briefing-delivery.ts +349 -0
  81. package/src/core/self/briefing-page.ts +315 -0
  82. package/src/core/self/briefing-room.ts +563 -0
  83. package/src/core/self/briefing.ts +304 -1156
  84. package/src/core/self/index.ts +28 -6
  85. package/src/core/store/NOTES.md +6 -5
  86. package/src/adapters/claude-code/primacy.ts +0 -162
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.20 — 2026-10-12
4
+
5
+ New installs from the plugin now remember from the second day. (Plugin first runs and scripted `install --yes` had never set a size limit for the wake, so every session opened on "No briefing has been composed yet"; earlier plugin installs had the same gap, and they are fixed automatically, with no action and no change to your configuration file; the first session after upgrading may still open on that line, and the wake is composed when that session ends.) The first meeting is the heart of this release. A new install now opens with a short, easy conversation where Claude introduces itself, asks one question at a time (all fine to pass), writes up what it learned right there, and ends with "What would you like to work on today?". Nothing interrupts it: no dream starts and the end-of-turn write-up waits, so the first dream comes the next day. Everyday words replace the internal ones: session starts say "Coming up:" and "Might be relevant:", dates read "Oct 11", and the dashboard uses the same words. A brand-new install's first `counterparts doctor` shows no ambers, a plugin install gets a one-line welcome, and the README is honest about what recall by meaning can and cannot find. The sidebar gains onboarding, a small fox, a second theme and the dashboard's store id; its Claude Code memory switch is gone, and the dead read of an A/B file in the home directory is removed. Reminders are no longer spent on a compaction nobody reads, and the wake never drops a section without saying so. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.19, and `counterparts connect` is not needed.
6
+
7
+ - **The sidebar's first-meeting prompt reads like a sentence.** The line Claude Code shows when the plugin asks Claude to say hello is now "Counterparts is installed. Claude would like to introduce itself."
8
+ - **The sidebar's quiet line reads as one phrase.** A fresh save shows as `Stored "title" — ` and as much of what was written as the width allows, cut at a word, instead of `stored: ` before a title that has its own prefix.
9
+ - **On the classic screen the sidebar's line suggests `/tui fullscreen`.** Where the pane cannot dock, the dim line under the prompt now says that `/tui fullscreen` shows the memory sidebar; nothing about the setting is changed for you.
10
+ - **The first meeting is no longer interrupted.** While you and Claude are getting to know each other, no dream starts and the end-of-turn write-up waits. When the meeting finishes, Claude writes it up right there and tells you in a few lines what it will remember. The first dream comes on your next day, not the first one.
11
+ - **The opening asks once.** Claude introduces itself in one line and asks whether you have five minutes in the question dialog only, not in the text as well.
12
+ - **Easier questions.** The meeting now asks about the highlight of your week, what you're enjoying working on, what you love about what you do, a good Saturday, and what got you started. One question at a time, at most one follow-up, and "pass" is always fine. It never asks your pronouns. Until you say them, Claude writes about you by name or as "they", in memories, chapters and dreams.
13
+ - **The meeting ends with what to do next.** It ends with "What would you like to work on today?" rather than a list of facts. Where your memory lives, what is kept and how to uninstall are given word for word when you ask.
14
+ - **Plugin installs are told what to say, not what to type.** The first-run line says to say "no dreams" and no longer gives a `counterparts` command. A dream's summary now says to say "undo that dream", and Claude can undo it through its own tools.
15
+ - **The README and the plugin's page say what recall by meaning can and can't find.** The
16
+ small on-device model finds close paraphrases ("my doctor" finds a note about a
17
+ physician), but not a description that never names the thing ("a pet that purrs" for a
18
+ note about your cat). Exact words are strongest, and a short memory matches better than
19
+ one padded with names and details.
20
+ - **A brand-new install's first `counterparts doctor` no longer goes amber while the first night run is still working.** On the first day your memory lives past midnight, the Sweep, Sleep, Backfill and Snapshots lines now say in green that the first night run starts today and writes them when it finishes; they turn amber only once a whole earlier day has passed with nothing written.
21
+ - **A reminder isn't spent on a session nobody reads.** When Claude compacts a long conversation (or a subagent compacts its own), a reminder due today is no longer said there and marked as told. It waits for the next message you type. The nightly dream run is also no longer handed the day's reminders as quiet hints, so it can't use up the nudges meant for your day.
22
+ - **Nothing in the wake disappears without a word.** When the wake is short of room, a section that
23
+ can't fit all its items now always keeps a line saying how many more there are and the ids to open
24
+ them, like a table of contents. Before, that line went in last and only when room was left over, so
25
+ a whole section ("Still open" or "Arriving:") could vanish with no sign. A section that still lists
26
+ something keeps its count right under it. Sections that list nothing fold into one line when they
27
+ must: "More than this wake lists: 3 still open (recall ids: …); 2 on how I work (recall ids: …)". A
28
+ plain reminder due today is still said in full.
29
+ - **"Nearby" says how many it left out, when there's room.** The hints the wake picked and then had no
30
+ room for are counted with their ids, in room nothing else wants. They never push out "Last here" or
31
+ another section's items. The rest of the store is still not counted: recall finds it by asking.
32
+ - **Doctor tells a step-down from a drop.** A section shown by count is the wake doing its job. A
33
+ memory the wake picked and then left out of every line turns the Wake line red, as a bug to report.
34
+ - **The sidebar has a second look.** `/counterparts theme cozy` turns the pane warm (dark walnut, parchment text, leaf green and pumpkin) in every session; `/counterparts theme tron` brings back the black, cyan and amber it has always had, which stays the default.
35
+ - **The sidebar's button for a put-off first meeting says what it starts.** It reads "Start the 5-minute intro" (was "Meet your counterpart").
36
+ - **The sidebar no longer sounds broken when there is nothing to show.** With the dashboard closed, Mechanisms today says "Counts appear once the dashboard is open (/counterparts:dashboard)", the same for every install; with nothing new yet, the quiet line under the prompt reads "Watching quietly · nothing new yet".
37
+ - **Plainer first-week wording.** The privacy answer, the first-meeting style notes, the daily tidy-up line, the day-one health check, `counterparts --help` and the README now say things in everyday words. The style notes use your name (or "They") instead of "the owner", and the privacy answer spells out exactly how long session text is kept.
38
+ - **Dates read like dates.** The "Yesterday" and "Last here" lines at the start of a session say "Oct 11" instead of "10-11", say "2 sessions in other projects" instead of "chapters from 2 sessions in other directories", and no longer count chapters.
39
+ - **A friendlier first day.** Before a first page and identity exist, the assistant says "We've only just met" and "Still forming: I write this page after a few sessions". The session-start headings "Arriving:" and "Nearby, if it helps:" are now "Coming up:" and "Might be relevant:".
40
+ - **README.** Says the "who I am, who you are" opening arrives after the first few sessions, and that Windows is not yet supported.
41
+ - **The dashboard uses the same words as the session start.** Where the dashboard said "Arriving" and "memories nearby", it now says "Coming up" and "Might be relevant", the headings a session opens with. "Lived day 12" is now "day 12 of use", as the health check says it, and "the owner" is "you". Places your sessions ran are "projects", not "directories".
42
+ - **Clearer count lines at the session start.** When there's no room to list everything, the count line now says "3 more coming up" or "2 more might be relevant" rather than "arriving" or "nearby".
43
+ - **Status shows a readable date.** The opening line of `counterparts dashboard status` says "I have had 19 days of use — the latest Oct 11" in place of "I have lived 19 days — the last of them 2026-10-11".
44
+ - **Claude's first hello says the memory grows with you.** The first meeting's introduction now ends "so I can carry what matters from one session to the next, and grow along with you." When the sidebar's "Meet your new counterpart." starts the meeting, Claude reads it as the meeting and opens with that introduction.
45
+ - **A one-line welcome.** A new plugin install's first session now says "Counterparts is set up: a memory that stays on this computer, in ~/.counterparts. (Daily tidy-up, called dreaming, is on; say "no dreams" to turn it off.)" instead of three lines.
46
+ - **The dashboard says which memory it shows.** `GET /api/whoami` returns a short store id and the version, and `/api/onboarding` carries the same id. Each session start names the same id for the sidebar, so with two memories on one computer the sidebar can tell whether the dashboard on its port is the right one. The id never contains the folder's path.
47
+ - **A small fox now lives at the top of the sidebar.** Most of the time it sits still. Every so often it blinks, glances around, flicks an ear or swishes its tail, and after a few quiet minutes it curls up for a nap until your next message. It also shows what your memory is doing: it perks up with a spark when something comes to mind, writes on a notepad when a memory is saved, waves during your first meeting, and sleeps with a dream beside it while a dream runs.
48
+ - **The fox is drawn as finely as your terminal allows.** You get a full picture in kitty and Ghostty, fine block characters in iTerm2, WezTerm and VS Code, and half-blocks everywhere else. In the desktop app it is a drawing. `/counterparts avatar detail auto|images|fine|basic` picks one yourself, and `/counterparts avatar brain|animal|off` switches between the fox, the brain and no avatar. If you chose the brain before, you keep it.
49
+ - **"Start the 5-minute intro" starts the intro in any session.** The button now runs `/counterparts:meet`, so Claude knows what you asked for, even in a session days after you put the meeting off.
50
+ - **The sidebar starts the dashboard for you.** When the dashboard isn't running, the Mechanisms section says "Start the dashboard to see stats here", and clicking it runs `/counterparts:dashboard`.
51
+ - **The sidebar never shows another memory's numbers.** If the dashboard on your machine belongs to a different memory store (a trial store, say), the sidebar shows "This dashboard belongs to another memory." in place of its counts.
52
+ - **The sidebar's search box is hidden for now.** In some terminals it couldn't be clicked into. It will come back once that is fixed. Ask Claude to recall things in the meantime.
53
+ - **The sidebar no longer offers to turn off Claude Code's own memory.** The opt-in "Claude memory" switch is gone, along with the `COUNTERPARTS_SIDEBAR_CC_MEMORY` setting that showed it. If you had turned Claude Code's memory off with it, your MEMORY.md files and Claude Code's memory instructions come back from your next session.
54
+ - **Counterparts no longer reads a file outside its own directories.** The parallel run's
55
+ switch, which could read an A/B assignment file in your home directory when a `parallel`
56
+ setting was turned on, is gone; a configuration that still has a `parallel` key keeps
57
+ working and the key is ignored.
58
+ - **New installs from the plugin now remember from the next session on.** An install made by the plugin's first run, or by `counterparts install` from a script, never set a size limit for the wake. With no limit, the briefing was never composed, so every session opened with "No briefing has been composed yet" even after days of use. Your memories were still saved, and recall still found them. Every Claude Code install now sets the same 9,000-byte limit the terminal install always set. An install made before this, without the setting, now uses 9,000 too, without any action from you; your configuration file is not changed. The first session after upgrading may still open on that line: the wake is composed when that session ends. `counterparts doctor`'s Config line says which limit is in use and whether it is the default.
59
+
3
60
  ## 0.3.19 — 2026-10-12
4
61
 
5
62
  Reminders now arrive. A reminder due today stays under "Arriving:" in the wake all day, the near ones come first when a session starts, a reminder is no longer counted as told to a message nobody typed (an agent's hand-back or a task notification), and a memory that reads like a reminder but has no date now says so. Counterparts also reads far less of Claude Code's own files: the nightly run no longer scans `~/.claude/projects`, and the wake-arrival check is off unless you ask for it, which is what the plugin directory asked for. Underneath: the core can change (a kept promise can retire, a declared change moves it in about three days), the night folds memories that belong together and writes up everything it was owed, cards for people and projects are born at last, and the biggest source files are split so the plugin bundle fits the directory's file limit. No store-format change (store v13, cache v6), so there is no migration, and nothing to run after upgrading from 0.3.18.
package/README.md CHANGED
@@ -11,7 +11,7 @@ its memories itself, and they fade and grow the way yours do. It runs today with
11
11
  ## Install
12
12
 
13
13
  You need [bun](https://bun.sh) 1.3 or newer, or [Node](https://nodejs.org) 22.15 or newer.
14
- macOS and Linux.
14
+ 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
@@ -40,8 +40,8 @@ to be deleted. The full walkthrough is in [`docs/QUICKSTART.md`](docs/QUICKSTART
40
40
  learned, in its own words. Notes, not transcripts.
41
41
  - **It forgets on purpose.** Memories fade unless they come up again. What matters
42
42
  sticks; the rest lets go.
43
- - **It knows who it has been.** Every session opens with a short "who I am, who you are,
44
- where we left off" that it wrote itself.
43
+ - **It knows who it has been.** After the first few sessions, every session opens with a short "who I am, who you
44
+ are, where we left off" that it wrote itself.
45
45
  - **It keeps a journal.** Each session becomes a chapter in a first-person account of
46
46
  your time together.
47
47
  - **It changes its mind slowly.** What it believes about you shifts only under real
@@ -120,6 +120,11 @@ There are no API keys, and nothing leaves your machine except through Claude Cod
120
120
  itself. Search by meaning runs on a small model on your machine, and a session that ends
121
121
  before it's written up is written up by the next session in that project.
122
122
 
123
+ That small model finds close paraphrases ("my doctor" finds a note about a physician), but
124
+ not a description that never names the thing: "a pet that purrs" won't find a note about
125
+ your cat. Exact words are strongest, and a short memory matches better than one padded with
126
+ names and details.
127
+
123
128
  ## Background
124
129
 
125
130
  Counterparts is the third version of a memory project. The earlier ones (claude-engram,
@@ -74,6 +74,12 @@ walk seam (its importers are pinned); each other command family is a `commands-*
74
74
  (every one that reads the zone it sets); the finding's shape and the checkout, open, upgrade,
75
75
  self-page, host, write-up and report groups are `doctor-*.ts` files. A moved class body is a free function taking the
76
76
  instance, behind a one-line delegate on the class (`docs/decisions.d/refactor-file-split.md`).
77
+ `self/briefing.ts` (split 2026-10-12, moves only, past ~100 KB) keeps the lanes, the
78
+ composition and `render`; `briefing-room.ts` holds the room machinery `render` calls
79
+ (`takeRoom`, the rescues, `tellLost`), `briefing-page.ts` the page's block and ladder and
80
+ the room it is sized to, and `briefing-delivery.ts` the sentinel reader, the preface and
81
+ the splices. `briefing.ts` re-exports every public name, so no import changed; the parts'
82
+ importers are pinned (`split-parts.test.ts`).
77
83
 
78
84
  ## Tools (`tools/`)
79
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
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": {
@@ -21,7 +21,7 @@ where it called its own, in the same order, with the same rows. What stays here
21
21
  host's: the five event names and their dispatch (`hooks.ts`), the payload translation, the
22
22
  JSON envelope and the room it measures (`bin/hook.ts`, `envelope.ts`), the transcript
23
23
  reader and the wake-arrival check against it (`transcript.ts`), the Stop ask's words
24
- (`stopAsk`, `STOP_HUMAN_LINE`), the first-launch question, the parallel run's primacy, the
24
+ (`stopAsk`, `STOP_HUMAN_LINE`), the first-launch question, the
25
25
  update and doctor notices, the dream line and the headless nightly run. The configuration
26
26
  (`AdapterConfig`, `loadConfig`) and the worker spawn (`planSpawn`, `spawnDetached`) moved to
27
27
  the shared leaves `adapters/config.ts` and `adapters/spawn.ts` the same day; `index.ts`
@@ -128,20 +128,21 @@ credential — belongs here, discovered at runtime, never assumed by the core.
128
128
 
129
129
  - **The A/B day-alternating wake mute is gone** — the *day-alternation*, that is. Computing
130
130
  a parity off an anchor date is not a memory property (§1) and no schedule decides who
131
- speaks here. What survives is smaller and temporary: for the **parallel run** beside v1,
132
- a **primacy resolver** (`primacy.ts`) behind the `parallel.enabled` config flag. It reads
133
- v1's own assignment file and lets the delivering hooks speak only when that file names the
134
- slot v2 occupies; it **fails toward mute** where v1 fails toward inject, so the joint
135
- failure state is v1-only rather than two voices or none. Absent flag ⇒ v2 delivers, which
136
- is the ordinary build. The flag, the resolver, and the two durable events were meant to be
137
- **retired at PROMOTE** — they are scaffolding for a comparison, not a feature. The parallel
138
- run ended on 2026-09-21 and nothing retired them: they are **still wired**
139
- (`hooks.ts#deliveryVerdict`, config `parallel`), and inert on every install that does not
140
- set the flag. Removing them is a separate change.
131
+ speaks here. The parallel run beside v1 had a smaller, temporary successor — a primacy
132
+ resolver (`primacy.ts`) behind a `parallel.enabled` config flag that read v1's assignment
133
+ file from the home directory. **Removed 2026-10-12, the parallel run ended 2026-09-21.** A
134
+ configuration that still carries `parallel` is ignored, never refused. The resolver lives
135
+ on only in the maintainer instrument `tools/parallel/primacy.ts`, which is not shipped.
141
136
  - **The 9,000-byte wake budget is not a constant here or anywhere.** The adapter
142
137
  **discovers or asserts** its host's injection ceiling and reports it as a capability;
143
138
  the core composes to whatever it is told (scar §2.18). v1's number was 90% of one host's
144
139
  cliff, encoded as though it were physiology.
140
+ The core still has no default. The adapter's own is `config.ts#CLAUDE_CODE_BUDGET_BYTES`
141
+ (9,000, this host's measured number): every Claude Code install writes it into a new
142
+ configuration, and the hooks, the worker and the night run fill it in for a file with no
143
+ key (`withBudgetDefault`, 2026-10-12), reported as defaulted, never as reported. Claude
144
+ Desktop's server takes no default itself, but the worker it starts is this runner, so a
145
+ keyless store it shares is rendered at 9,000 as well.
145
146
  - **Multi-file API-key rotation and per-key cursor bookkeeping are dropped** — and since
146
147
  2026-09-24 there are no keys at all (§1a), so there is nothing to rotate and no credential
147
148
  source to configure. (Until then credentials came from one configured source the package
@@ -2560,3 +2560,32 @@ words are said.
2560
2560
 
2561
2561
  **The wake-arrival check is opt-in** (`COUNTERPARTS_WAKE_CHECK=1`). Off, `checkWakeArrival` returns
2562
2562
  before the registry read; doctor's Wake line, with no arrival rows, names the opt-in.
2563
+
2564
+ ## 2026-10-12 — who was told at 00:19: the night run's children were not
2565
+
2566
+ The 0.3.19 release check reported a fresh SessionStart at 00:19 telling a plain reminder, and the night
2567
+ run's own `claude -p` children were the suspects. Read from the host's transcripts (no store opened):
2568
+
2569
+ - The sessions that started at 00:19:49 and 00:22:17 local on 10-12 were under
2570
+ `~/.claude/projects/<the store directory's slug>/`, cwd the store, entrypoint `sdk-cli`. These were the
2571
+ dream child and the reflection child. Neither holds a plain-reminder line or a `systemMessage`.
2572
+ - A `claude -p` probe on 2.1.296 (user hooks off, empty strict MCP config, the parent's `ATTENDED=1`) printed
2573
+ `CLAUDE_CODE_ENTRYPOINT=sdk-cli`, `CLAUDE_CODE_SESSION_ATTENDED=0`, `COUNTERPARTS_NIGHT_RUN=<run>`. The host
2574
+ resets both of its own flags for a child, and the run's marker passes through.
2575
+ - The one reminder injected at 00:19 was a `UserPromptSubmit` (00:19:49.18) in the coordinator's open `cli`
2576
+ session, on an "Another Claude session sent a message: … [Subagent hand-back]" turn. Its system message also
2577
+ carried the dream and share lines, and it started the night run (first child +0.6 s). That was on 0.3.18,
2578
+ before #445's `startedByHost`.
2579
+ - What was still open: a `SessionStart:compact` inside an Agent-tool subagent (10-10, `cli`) was handed a full
2580
+ wake, and the night child's prompt recall handed the day's reminders as "Quietly available" lines and spent their
2581
+ fires. Both are closed by `watchedAtStart` and `noCues` (docs/decisions.d/fix-start-told-unwatched-1012.md).
2582
+
2583
+ ## 2026-10-12 — the primacy read removed
2584
+
2585
+ Removed 2026-10-12, the parallel run ended 2026-09-21. `primacy.ts` read v1's A/B assignment file in the home directory
2586
+ behind `parallel.enabled`, which install never set; a plugin-directory pre-flight flagged it as a read
2587
+ outside the disclosed files. The hooks no longer ask who delivers, `loadConfig` no longer reads
2588
+ `parallel` (an old key, in any shape, is ignored rather than taking the config to observer), and the
2589
+ resolver moved to `tools/parallel/primacy.ts` for the instrument that still reads old run directories.
2590
+ The `adapter.primacy.*` event names stay in core and the dashboard so a store's old rows still read.
2591
+ Earlier entries above that mention primacy describe the code as it was then.
@@ -43,7 +43,7 @@ import { canonicalScope, isEntrypoint, readSession } from "../../sessions.js";
43
43
  import { openLog } from "../../log/index.js";
44
44
  import type { LogEvent, ProcessLog } from "../../log/index.js";
45
45
  import { resolveZone, todayIn } from "../../../core/time.js";
46
- import { TUNABLES, loadConfig, withEmbedderDefault } from "../../config.js";
46
+ import { TUNABLES, loadConfig, withBudgetDefault, withEmbedderDefault } from "../../config.js";
47
47
  import type { AdapterConfig } from "../../config.js";
48
48
  import { HOOKS, openAdapter } from "../index.js";
49
49
  import { STOP_HUMAN_LINE, plainLine, withoutDream, withoutDreamNote, withoutPlain } from "../hooks.js";
@@ -200,9 +200,11 @@ export function hostConfig(
200
200
  // stood down because we did not" — the difference matters only for a config
201
201
  // somebody NAMED (`namedUnreadableRefusal`).
202
202
  // THE EMBEDDER DEFAULT (config.ts#resolveEmbedder): an absent block is the
203
- // local table.
203
+ // local table. THE CEILING DEFAULT (`config.ts#withBudgetDefault`): a file
204
+ // with no `injectionBudgetBytes` wakes under Claude Code's 9,000 rather than
205
+ // on the bootstrap line for good.
204
206
  return {
205
- config: withEmbedderDefault({ ...loaded, dataDir: loaded.dataDir ?? dataDir() }),
207
+ config: withBudgetDefault(withEmbedderDefault({ ...loaded, dataDir: loaded.dataDir ?? dataDir() })),
206
208
  reason: load.reason,
207
209
  };
208
210
  }
@@ -92,7 +92,7 @@ import {
92
92
  } from "../../config-path.js";
93
93
  import type { ConfigChoice } from "../../config-path.js";
94
94
 
95
- import { loadConfig, withEmbedderDefault } from "../../config.js";
95
+ import { loadConfig, withBudgetDefault, withEmbedderDefault } from "../../config.js";
96
96
  import type { AdapterConfig } from "../../config.js";
97
97
  import { openEmbedder } from "../index.js";
98
98
  import type { LiveEmbedder } from "../embed-client.js";
@@ -574,13 +574,17 @@ export function runnerConfig(
574
574
  const loaded = loadConfig(raw);
575
575
  const pinned = pinnedDataDir(env);
576
576
  // THE EMBEDDER DEFAULT (config.ts#resolveEmbedder), the same rule the hook
577
- // applies, so the worker backfills with the table the hooks embed with.
577
+ // applies, so the worker backfills with the table the hooks embed with. And
578
+ // the hook's ceiling default (`config.ts#withBudgetDefault`), so the worker
579
+ // and the night run render the wake the session start reads.
578
580
  return {
579
- config: withEmbedderDefault({
580
- ...loaded.config,
581
- // The PIN wins. The spawner wrote it last precisely so nothing else can.
582
- dataDir: pinned ?? loaded.config.dataDir ?? dataDir(),
583
- }),
581
+ config: withBudgetDefault(
582
+ withEmbedderDefault({
583
+ ...loaded.config,
584
+ // The PIN wins. The spawner wrote it last precisely so nothing else can.
585
+ dataDir: pinned ?? loaded.config.dataDir ?? dataDir(),
586
+ }),
587
+ ),
584
588
  reason: loaded.reason,
585
589
  };
586
590
  }
@@ -386,6 +386,21 @@ function unreadableClause(keys: readonly string[] | undefined): string {
386
386
  }
387
387
 
388
388
  /** The config file itself: the one the hooks read, and whether it was readable. */
389
+ /**
390
+ * WHICH WAKE CEILING IS IN FORCE (2026-10-12). A configuration with no
391
+ * `injectionBudgetBytes` wakes under Claude Code's default
392
+ * (`config.ts#withBudgetDefault`) — the plugin's first run and scripted
393
+ * installs wrote none before 0.3.20 — and the line says which, so "the file
394
+ * says 9000" and "nothing said, 9000 was used" read differently.
395
+ */
396
+ function ceilingClause(config: AdapterConfig): string {
397
+ const bytes = config.injectionBudgetBytes;
398
+ if (bytes === undefined) return "; no wake ceiling, so no wake is composed";
399
+ return config.injectionBudgetDefaulted === true
400
+ ? `; wake ceiling ${String(bytes)} bytes, Claude Code's default (the file sets no injectionBudgetBytes)`
401
+ : `; wake ceiling ${String(bytes)} bytes`;
402
+ }
403
+
389
404
  function configFindings(input: DoctorInput): Finding[] {
390
405
  const out: Finding[] = [];
391
406
  const reason = input.configReason;
@@ -452,9 +467,15 @@ function configFindings(input: DoctorInput): Finding[] {
452
467
  "config",
453
468
  "green",
454
469
  "Config",
455
- `${input.configPath} — read; dataDir ${input.config.dataDir ?? "(unset: the default store)"}`,
470
+ `${input.configPath} — read; dataDir ${input.config.dataDir ?? "(unset: the default store)"}${ceilingClause(input.config)}`,
456
471
  "",
457
- { path: input.configPath, reason: reason ?? "read-by-caller", dataDir: input.config.dataDir ?? null },
472
+ {
473
+ path: input.configPath,
474
+ reason: reason ?? "read-by-caller",
475
+ dataDir: input.config.dataDir ?? null,
476
+ ceiling: input.config.injectionBudgetBytes ?? null,
477
+ ceilingDefaulted: input.config.injectionBudgetDefaulted === true,
478
+ },
458
479
  ),
459
480
  );
460
481
  // SETTINGS THIS BUILD NO LONGER READS (keyless, 2026-09-24) — a quiet note,
@@ -933,13 +954,13 @@ function clockFindings(input: DoctorInput, store: Store): Finding[] {
933
954
  // the clock, so the comparison is not made and the line says why.
934
955
  if (read.unknown) {
935
956
  const facts =
936
- `lived day ${livedDay}, lastActiveDate ${lastActive ?? "(unset)"}, today ${input.today} ${zoneNote(input)} — ` +
957
+ `day ${livedDay} of use, lastActiveDate ${lastActive ?? "(unset)"}, today ${input.today} ${zoneNote(input)} — ` +
937
958
  undetermined(BOUNDARY_EVENT);
938
959
  return [finding("clock", "green", "Clock", facts, "", data)];
939
960
  }
940
961
  const facts =
941
- `lived day ${livedDay}, lastActiveDate ${lastActive ?? "(unset)"}, ` +
942
- `newest boundary ${boundary ?? "(none)"}, today ${input.today} ${zoneNote(input)}`;
962
+ `day ${livedDay} of use, lastActiveDate ${lastActive ?? "(unset)"}, ` +
963
+ `last session end ${boundary ?? "(none)"}, today ${input.today} ${zoneNote(input)}`;
943
964
  if (boundary !== null && (lastActive === null || lastActive < boundary)) {
944
965
  return [
945
966
  finding(
@@ -955,6 +976,28 @@ function clockFindings(input: DoctorInput, store: Store): Finding[] {
955
976
  return [finding("clock", "green", "Clock", facts, "", data)];
956
977
  }
957
978
 
979
+ /**
980
+ * HAS THE WORKER HAD A WHOLE DAY? The first boundary a store reaches (its first
981
+ * session after midnight) starts the first night run, which writes its rows when
982
+ * it FINISHES, minutes later. A doctor run in that window is not a fault: absent
983
+ * rows are evidence of trouble only once a boundary from an earlier day exists.
984
+ * "never" = no boundary yet; "today" = the newest is today's and the run is owed
985
+ * its time; "earlier" = a worker has had its chance.
986
+ */
987
+ function boundaryAge(store: Store, today: string): "never" | "today" | "earlier" {
988
+ // ALL boundary rows, not the newest: every active day writes one, so the newest
989
+ // is today's on any day the store has been used, however long it has lived.
990
+ const rows = store.eventLog({ name: BOUNDARY_EVENT, limit: 4000 });
991
+ if (rows.length === 0) return "never";
992
+ if (rows.length >= 4000) return "earlier"; // certainly lived
993
+ return rows.some((r) => {
994
+ const d = rowDate(r);
995
+ return d !== null && d < today;
996
+ })
997
+ ? "earlier"
998
+ : "today";
999
+ }
1000
+
958
1001
  /** The newest row of each family the background half leaves behind. */
959
1002
  function rowFindings(input: DoctorInput, store: Store): Finding[] {
960
1003
  const livedDay = store.livedDay();
@@ -968,13 +1011,21 @@ function rowFindings(input: DoctorInput, store: Store): Finding[] {
968
1011
  */
969
1012
  // `unknown` means the store holds MORE than `NEWEST_LIMIT` boundary rows, so
970
1013
  // it has certainly lived — the one thing this flag needs to know.
971
- const boundaries = newestRows(store, BOUNDARY_EVENT, 1, livedDay);
972
- const lived = boundaries.unknown || boundaries.rows.length > 0;
973
- /** The "no row yet" finding: amber once the store has lived, green before. */
1014
+ const age = boundaryAge(store, input.today);
1015
+ /** The "no row yet" finding: amber once a worker has had a whole day, green before. */
974
1016
  const absent = (key: string, title: string, what: string, fix: string): Finding =>
975
- lived
1017
+ age === "earlier"
976
1018
  ? finding(key, "amber", title, what, fix, { rows: 0 })
977
- : finding(key, "green", title, `${what} — and no boundary has been reached here yet`, "", { rows: 0 });
1019
+ : finding(
1020
+ key,
1021
+ "green",
1022
+ title,
1023
+ age === "today"
1024
+ ? `${what} — the first night run starts today and writes this when it finishes`
1025
+ : `${what} — and no session has ended here yet`,
1026
+ "",
1027
+ { rows: 0 },
1028
+ );
978
1029
  /** The "we could not read the newest one" finding: neutral, never a grade. */
979
1030
  const unread = (key: string, title: string, name: string): Finding =>
980
1031
  finding(key, "green", title, undetermined(name), "", { unknown: true });
@@ -1561,8 +1612,7 @@ function firedFindings(input: DoctorInput, store: Store): Finding[] {
1561
1612
  "fired",
1562
1613
  "green",
1563
1614
  "Fired",
1564
- `this store is on lived day ${String(report.livedDay)} — too new to grade; nothing has fired ` +
1565
- `because nothing has happened yet` +
1615
+ `Too new to judge yet: nothing has run because you've only just started` +
1566
1616
  (c.blocked === 0 ? "" : `, though ${String(c.blocked)} was already stopped by something`),
1567
1617
  c.blocked === 0 ? "" : "Run: counterparts mechanisms --all — the blocked rows say by what.",
1568
1618
  data,
@@ -2538,12 +2588,18 @@ export function wakeArrivalFindings(store: Store): Finding[] {
2538
2588
  lastHereNoRoom: room.lastHereNoRoom,
2539
2589
  workNoRoom: room.workNoRoom,
2540
2590
  datedUnlisted: room.datedUnlisted,
2591
+ steppedDown: room.steppedDown,
2592
+ untold: room.untold,
2541
2593
  floor,
2542
2594
  };
2543
2595
  const head =
2544
2596
  expected <= 0
2545
2597
  ? `${window} — no wake checked on arrival (an opt-in check: COUNTERPARTS_WAKE_CHECK=1 in Claude Code's environment)`
2546
2598
  : `${window} — ${String(whole)} of ${String(expected)} ${expected === 1 ? "wake" : "wakes"} arrived whole`;
2599
+ // A LANE LEFT WITHOUT A WORD (2026-10-12) is a bug, not a full wake: red.
2600
+ if (room.red !== null) {
2601
+ return [finding("wake", "red", "Wake", `${head}${rest}`, room.red, data)];
2602
+ }
2547
2603
  if (cut === 0 && room.amber !== null) {
2548
2604
  return [
2549
2605
  finding(
@@ -2582,8 +2638,17 @@ interface WakeRoom {
2582
2638
  readonly lastHereNoRoom: number;
2583
2639
  readonly workNoRoom: number;
2584
2640
  /** Wake renders that left a dated item ("Arriving:") unlisted for want of
2585
- * room (2026-10-10) — amber. */
2641
+ * room (2026-10-10) — amber. Counted, since 2026-10-12, not gone. */
2586
2642
  readonly datedUnlisted: number;
2643
+ /** Wake renders that said some lane by count rather than in full — a
2644
+ * step-down (a lane's cap, the identity share, the trim), never a fault
2645
+ * (2026-10-12). */
2646
+ readonly steppedDown: number;
2647
+ /** Wake renders that left an id unsaid — in no line, not even a count — a
2648
+ * silent drop: red (2026-10-12). */
2649
+ readonly untold: number;
2650
+ /** The red's remedy, or null when nothing here is red. */
2651
+ readonly red: string | null;
2587
2652
  /** The clauses, each led by "; ", or "". */
2588
2653
  readonly clauses: string;
2589
2654
  /** The amber's remedy, or null when nothing here is amber. */
@@ -2615,9 +2680,17 @@ function wakeRoom(store: Store, since: number): WakeRoom {
2615
2680
  // row says "Arriving:" lost an element for want of room
2616
2681
  // (`self/briefing.ts#ROOM_ORDER`) — by its uncapped per-lane count, or, on
2617
2682
  // a row from before that count, by its trimmed list.
2618
- const datedRows = read(SELF_BRIEFING_EVENT).filter((r) => datedUnlisted(payloadOf(r)) > 0);
2683
+ const briefings = read(SELF_BRIEFING_EVENT);
2684
+ const datedRows = briefings.filter((r) => datedUnlisted(payloadOf(r)) > 0);
2619
2685
  const datedUnlistedRenders = datedRows.length;
2620
2686
  const datedNewest = rowDate(datedRows[0]);
2687
+ // STEP-DOWNS AND SILENT DROPS (2026-10-12, `self/briefing.ts#tellLost`): a
2688
+ // lane said by count is the wake doing its job; an id no line names is not.
2689
+ // "Nearby" left uncounted by rank (`quiet`) is a step-down too.
2690
+ const steppedDown = briefings.filter((r) => (num(payloadOf(r), "counted") ?? 0) + (num(payloadOf(r), "quiet") ?? 0) > 0).length;
2691
+ const untoldRows = briefings.filter((r) => (num(payloadOf(r), "untold") ?? 0) > 0);
2692
+ const untold = untoldRows.length;
2693
+ const untoldNewest = rowDate(untoldRows[0]);
2621
2694
  const parts = Object.entries(gaveWay)
2622
2695
  .sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : 1))
2623
2696
  .map(([part, n]) => `${part} ${String(n)}`);
@@ -2640,7 +2713,10 @@ function wakeRoom(store: Store, since: number): WakeRoom {
2640
2713
  : "") +
2641
2714
  (workNoRoom > 0 ? `; "Work here" lines that did not fit, in ${String(workNoRoom)} ${workNoRoom === 1 ? "directory-day" : "directory-days"}` : "") +
2642
2715
  (datedUnlistedRenders > 0
2643
- ? `; a dated item under "Arriving:" was not listed for want of room in ${String(datedUnlistedRenders)} ${datedUnlistedRenders === 1 ? "render" : "renders"} of the wake${datedNewest === null ? "" : ` (newest ${datedNewest})`}`
2716
+ ? `; a dated item under "Coming up:" was counted, not listed, for want of room in ${String(datedUnlistedRenders)} ${datedUnlistedRenders === 1 ? "render" : "renders"} of the wake${datedNewest === null ? "" : ` (newest ${datedNewest})`}`
2717
+ : "") +
2718
+ (untold > 0
2719
+ ? `; something the wake chose went unsaid — in no line, not even a count — in ${String(untold)} ${untold === 1 ? "render" : "renders"}${untoldNewest === null ? "" : ` (newest ${untoldNewest})`}`
2644
2720
  : "");
2645
2721
  const remedies = [
2646
2722
  ...(datedUnlistedRenders > 0
@@ -2653,8 +2729,12 @@ function wakeRoom(store: Store, since: number): WakeRoom {
2653
2729
  : []),
2654
2730
  ];
2655
2731
  const amber = remedies.length === 0 ? null : remedies.join(" ");
2732
+ const red =
2733
+ untold === 0
2734
+ ? null
2735
+ : "Every lane the wake chose is meant to show whole, shortened, or as a count with its ids, so an id in no line is a bug in Counterparts, or a ceiling too small for the wake's own furniture. Worth reporting with this line; recall still finds the memories.";
2656
2736
  const any = clauses.length > 0;
2657
- return { overBudget, overCap, noticeDropped, gaveWay, handoffNoRoom, lastHereNoRoom, workNoRoom, datedUnlisted: datedUnlistedRenders, clauses, amber, any, floor };
2737
+ return { overBudget, overCap, noticeDropped, gaveWay, handoffNoRoom, lastHereNoRoom, workNoRoom, datedUnlisted: datedUnlistedRenders, steppedDown, untold, red, clauses, amber, any, floor };
2658
2738
  }
2659
2739
 
2660
2740
  /**
@@ -3102,8 +3182,8 @@ function snapshotFindings(input: DoctorInput, store: Store): Finding[] {
3102
3182
  // The same rule the row findings use: an absent copy is only evidence once a
3103
3183
  // boundary has been reached. On a fresh install there has been no worker run
3104
3184
  // to take a first one, and an amber there is decoration.
3105
- const boundaries = newestRows(store, BOUNDARY_EVENT, 1, livedDay);
3106
- const lived = boundaries.unknown || boundaries.rows.length > 0;
3185
+ const age = boundaryAge(store, input.today);
3186
+ const lived = age === "earlier";
3107
3187
  const failed = newestRows(store, SNAPSHOT_FAILED_EVENT, 1, livedDay);
3108
3188
  const failedRow = failed.rows[0];
3109
3189
  const why =
@@ -3124,7 +3204,7 @@ function snapshotFindings(input: DoctorInput, store: Store): Finding[] {
3124
3204
  "snapshot",
3125
3205
  "green",
3126
3206
  "Snapshots",
3127
- `no snapshot yet — and no boundary has been reached here yet${strange}${upgrade}${misread}`,
3207
+ `no snapshot yet — ${age === "today" ? "the first night run starts today and takes one when it finishes" : "and no boundary has been reached here yet"}${strange}${upgrade}${misread}`,
3128
3208
  "",
3129
3209
  { ...held, rows: 0 },
3130
3210
  ),