counterparts 0.3.18 → 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.
- package/CHANGELOG.md +179 -0
- package/README.md +8 -3
- package/docs/module-map.md +23 -0
- package/package.json +1 -1
- package/src/adapters/claude-code/CONTRACT.md +46 -24
- package/src/adapters/claude-code/INTERFACE-GAPS.md +13 -10
- package/src/adapters/claude-code/NOTES.md +79 -0
- package/src/adapters/claude-code/bin/hook.ts +5 -3
- package/src/adapters/claude-code/bin/runner.ts +11 -7
- package/src/adapters/claude-code/child.ts +44 -4
- package/src/adapters/claude-code/doctor-checkout.ts +335 -0
- package/src/adapters/claude-code/doctor-finding.ts +168 -0
- package/src/adapters/claude-code/doctor-host.ts +400 -0
- package/src/adapters/claude-code/doctor-open.ts +337 -0
- package/src/adapters/claude-code/doctor-report.ts +188 -0
- package/src/adapters/claude-code/doctor-self-page.ts +504 -0
- package/src/adapters/claude-code/doctor-upgrades.ts +238 -0
- package/src/adapters/claude-code/doctor-write-ups.ts +278 -0
- package/src/adapters/claude-code/doctor.ts +182 -2400
- package/src/adapters/claude-code/hooks.ts +95 -92
- package/src/adapters/claude-code/index.ts +0 -6
- package/src/adapters/claude-code/night-catch-up.ts +92 -24
- package/src/adapters/claude-code/night-run.ts +52 -41
- package/src/adapters/claude-code/reowe.ts +239 -0
- package/src/adapters/claude-code/transcript.ts +53 -78
- package/src/adapters/cli/CONTRACT.md +2 -2
- package/src/adapters/cli/INTERFACE-GAPS.md +5 -3
- package/src/adapters/cli/NOTES.md +18 -2
- package/src/adapters/cli/catch-up.ts +79 -1
- package/src/adapters/cli/commands-dashboard.ts +254 -0
- package/src/adapters/cli/commands-install.ts +1406 -0
- package/src/adapters/cli/commands-note.ts +624 -0
- package/src/adapters/cli/commands-readings.ts +985 -0
- package/src/adapters/cli/commands-remove.ts +659 -0
- package/src/adapters/cli/commands-scope.ts +495 -0
- package/src/adapters/cli/commands-self.ts +769 -0
- package/src/adapters/cli/commands-shared.ts +554 -0
- package/src/adapters/cli/commands-start-fresh.ts +1233 -0
- package/src/adapters/cli/commands-verify.ts +1301 -0
- package/src/adapters/cli/commands.ts +219 -8115
- package/src/adapters/cli/coverage.ts +40 -5
- package/src/adapters/cli/dream-core.ts +13 -7
- package/src/adapters/cli/help.ts +14 -13
- package/src/adapters/cli/install.ts +4 -2
- package/src/adapters/cli/mechanisms.ts +5 -3
- package/src/adapters/cli/start-fresh.ts +13 -8
- package/src/adapters/config.ts +38 -30
- package/src/adapters/dashboard/CONTRACT.md +14 -0
- package/src/adapters/dashboard/NOTES.md +16 -1
- package/src/adapters/dashboard/activity.ts +1 -1
- package/src/adapters/dashboard/bin/dashboard.ts +3 -3
- package/src/adapters/dashboard/browse.ts +1 -1
- package/src/adapters/dashboard/identity.ts +1 -1
- package/src/adapters/dashboard/registries.ts +14 -14
- package/src/adapters/dashboard/resolve.ts +1 -1
- package/src/adapters/dashboard/status.ts +5 -2
- package/src/adapters/dashboard/stories.ts +3 -1
- package/src/adapters/dashboard/web/app.html +1 -1
- package/src/adapters/dashboard/web/flow.ts +1 -1
- package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +2 -2
- package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +1 -1
- package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -1
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +2 -2
- package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +3 -3
- package/src/adapters/dashboard/web/mechanisms/salience/panel.js +2 -2
- package/src/adapters/dashboard/web/narrate.ts +21 -17
- package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +1 -1
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +3 -2
- package/src/adapters/dashboard/web/pages/health/sections/cycle.js +5 -5
- package/src/adapters/dashboard/web/pages/health/sections/mechanisms.js +1 -1
- package/src/adapters/dashboard/web/pages/health/sections/wake.js +2 -2
- package/src/adapters/dashboard/web/pages/self/sections/dreams.js +2 -2
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +5 -5
- package/src/adapters/dashboard/web/pages/self/sections/page.js +13 -13
- package/src/adapters/dashboard/web/pages/self/sections/settling.js +15 -4
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +7 -7
- package/src/adapters/dashboard/web/server.ts +9 -1
- package/src/adapters/dashboard/web/shared/event-modal.js +1 -1
- package/src/adapters/dashboard/web/shared/memory-card-words.js +1 -1
- package/src/adapters/dashboard/web/shared/memory-modal.js +5 -5
- package/src/adapters/dashboard/web/views/activity.ts +1 -1
- package/src/adapters/dashboard/web/views/archive-words.ts +2 -1
- package/src/adapters/dashboard/web/views/dreams.ts +11 -3
- package/src/adapters/dashboard/web/views/health.ts +1 -1
- package/src/adapters/dashboard/web/views/mechanisms.ts +7 -6
- package/src/adapters/dashboard/web/views/mind.ts +41 -10
- package/src/adapters/dashboard/web/views/overview.ts +3 -3
- package/src/adapters/expansions.ts +14 -1
- package/src/adapters/lifecycle.ts +36 -9
- package/src/adapters/mcp/CONTRACT.md +5 -5
- package/src/adapters/mcp/NOTES.md +8 -4
- package/src/adapters/mcp/facts.ts +3 -2
- package/src/adapters/mcp/meaning.ts +17 -2
- package/src/adapters/mcp/server-args.ts +522 -0
- package/src/adapters/mcp/server-options.ts +259 -0
- package/src/adapters/mcp/server-self-tools.ts +749 -0
- package/src/adapters/mcp/server-session-end.ts +654 -0
- package/src/adapters/mcp/server-words.ts +226 -0
- package/src/adapters/mcp/server.ts +194 -2247
- package/src/adapters/mcp/tools.ts +52 -8
- package/src/adapters/mcp/write-up.ts +54 -8
- package/src/adapters/mechanism-evidence.ts +21 -5
- package/src/adapters/plugin.ts +13 -8
- package/src/adapters/sessions.ts +54 -8
- package/src/adapters/store-id.ts +58 -0
- package/src/core/associate/index.ts +34 -7
- package/src/core/counterpart-boundary.ts +920 -0
- package/src/core/counterpart-deposit.ts +726 -0
- package/src/core/counterpart-events.ts +968 -0
- package/src/core/counterpart-sweep.ts +884 -0
- package/src/core/counterpart-types.ts +715 -0
- package/src/core/counterpart.ts +370 -3966
- package/src/core/coverage/CONTRACT.md +20 -1
- package/src/core/coverage/NOTES.md +4 -1
- package/src/core/coverage/index.ts +5 -3
- package/src/core/dream/CONTRACT.md +69 -22
- package/src/core/dream/NOTES.md +62 -0
- package/src/core/dream/index.ts +459 -124
- package/src/core/dream/reflect.ts +66 -11
- package/src/core/dream/tunables.ts +43 -11
- package/src/core/fit/index.ts +2 -2
- package/src/core/handoff/CONTRACT.md +1 -1
- package/src/core/handoff/last-here.ts +24 -12
- package/src/core/leaving.ts +3 -1
- package/src/core/mint.ts +5 -0
- package/src/core/onboarding.ts +228 -62
- package/src/core/physics/CONTRACT.md +23 -7
- package/src/core/physics/index.ts +141 -37
- package/src/core/prospective/CONTRACT.md +12 -1
- package/src/core/prospective/index.ts +75 -11
- package/src/core/recall/CONTRACT.md +19 -5
- package/src/core/recall/NOTES.md +1 -1
- package/src/core/recall/activate.ts +22 -0
- package/src/core/recall/index.ts +12 -4
- package/src/core/recall/standing.ts +29 -14
- package/src/core/reconsolidation.ts +653 -63
- package/src/core/remember/CONTRACT.md +3 -1
- package/src/core/remember/INTERFACE-GAPS.md +2 -2
- package/src/core/remember/NOTES.md +17 -0
- package/src/core/remember/proposals.ts +8 -2
- package/src/core/remember/spans.ts +82 -2
- package/src/core/revision.ts +168 -45
- package/src/core/schemas/CONTRACT.md +22 -2
- package/src/core/schemas/NOTES.md +75 -0
- package/src/core/schemas/index.ts +138 -1
- package/src/core/schemas/names.ts +298 -0
- package/src/core/schemas/tunables.ts +18 -0
- package/src/core/schemas/types.ts +25 -0
- package/src/core/self/CONTRACT.md +32 -12
- package/src/core/self/INTERFACE-GAPS.md +1 -1
- package/src/core/self/NOTES.md +8 -2
- package/src/core/self/briefing-delivery.ts +349 -0
- package/src/core/self/briefing-page.ts +315 -0
- package/src/core/self/briefing-room.ts +563 -0
- package/src/core/self/briefing.ts +320 -1129
- package/src/core/self/identity.ts +42 -3
- package/src/core/self/index.ts +87 -24
- package/src/core/self/tunables.ts +8 -0
- package/src/core/sleep/CONTRACT.md +14 -2
- package/src/core/sleep/NOTES.md +26 -1
- package/src/core/sleep/births.ts +74 -0
- package/src/core/sleep/consolidate.ts +254 -26
- package/src/core/sleep/core-standing.ts +155 -0
- package/src/core/sleep/cycle.ts +15 -0
- package/src/core/sleep/index.ts +8 -0
- package/src/core/sleep/tunables.ts +21 -0
- package/src/core/sleep/types.ts +17 -2
- package/src/core/store/NOTES.md +68 -10
- package/src/core/store/db.ts +61 -13
- package/src/core/store/errors.ts +7 -0
- package/src/core/store/index-text.ts +110 -0
- package/src/core/store/index.ts +374 -1541
- package/src/core/store/marks.ts +277 -0
- package/src/core/store/operational.ts +9 -1
- package/src/core/store/owner-op-seam.ts +22 -1
- package/src/core/store/paths.ts +18 -0
- package/src/core/store/pre-migration.ts +17 -2
- package/src/core/store/reads-history.ts +273 -0
- package/src/core/store/reads-marks.ts +165 -0
- package/src/core/store/reads-memories.ts +453 -0
- package/src/core/store/shapes.ts +549 -0
- package/src/adapters/claude-code/primacy.ts +0 -162
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,184 @@
|
|
|
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
|
+
|
|
60
|
+
## 0.3.19 — 2026-10-12
|
|
61
|
+
|
|
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.
|
|
63
|
+
|
|
64
|
+
- **The core can change now.** A core memory used to be write-once in practice: a kept promise could never
|
|
65
|
+
retire the promise. A change you declare at one now counts at full daily weight, so it moves in about three
|
|
66
|
+
days of saying so, and a plan the core held (with a status or a date) leaves it at once when a memory says it
|
|
67
|
+
is done. Either can be undone.
|
|
68
|
+
- **A moved reminder's old memory steps back.** When a reminder moves to a newer memory, the one it left is
|
|
69
|
+
marked as the earlier one and fades, instead of staying as current with its future-tense words. The few
|
|
70
|
+
older ones get the same once.
|
|
71
|
+
- **One record for every "this replaces that".** A dream's merge, a settle, a write that updates a memory, the
|
|
72
|
+
core's slow change and a moved reminder now all leave the same record and the same undo, and a settle over a
|
|
73
|
+
memory with a date still to come carries the reminder to the newer one. A dream's merge keeps its originals
|
|
74
|
+
as faded earlier versions behind the merged memory (hidden from what comes up on its own) until they fade
|
|
75
|
+
out, instead of putting them away, and one original can be brought back on its own. A corrected memory hands
|
|
76
|
+
its links to the one that holds.
|
|
77
|
+
- **"Done" ends a reminder.** A memory that says something is done no longer takes over the reminder of the
|
|
78
|
+
plan it finishes, so it does not remind you on the day of something already done. The dashboard counts what was noticed (merges, newer states found) apart from what
|
|
79
|
+
was declared, so nothing shows under both.
|
|
80
|
+
- **Earlier versions say so in more places.** A "meaning" answer marks an earlier moment with the memory that
|
|
81
|
+
holds now, and a newer memory reached only through a link now stands in for its earlier version instead of
|
|
82
|
+
showing beside it.
|
|
83
|
+
- **Cards for the people and projects you talk about are born at last.** A card used to be
|
|
84
|
+
born only when a memory's title was exactly a name, which almost never happens, so a store
|
|
85
|
+
in daily use for weeks had one card: yours. Now, once a day at the end of a session, the
|
|
86
|
+
names your memories keep saying (in at least 3 memories on at least 2 days) get a card, ten
|
|
87
|
+
a day at most, the most-said first. Capitalized words that are also ordinary words, and days
|
|
88
|
+
and months, don't. A new card links every memory that names it, and a question by that name
|
|
89
|
+
reads those links.
|
|
90
|
+
- **A card no longer shows up as a memory.** A newborn card holds only its name, so it isn't
|
|
91
|
+
shown in a turn's recall or among the results of a question by name; the memories it links
|
|
92
|
+
are.
|
|
93
|
+
- **A card you remove stays removed.** Removing a person's or project's card no longer lets
|
|
94
|
+
the nightly count of names give it a new card from the same memories.
|
|
95
|
+
- **What keeps coming back can become core.** The slow road into the core asked for five separate days of use
|
|
96
|
+
over three weeks, and nothing ever made it. Now it counts a memory together with its earlier and later states:
|
|
97
|
+
used, cited in a reflection, or written about again, on four days, in three sessions, over a week, within the
|
|
98
|
+
last month, as long as the memory itself was used. The newest state is the one that crosses.
|
|
99
|
+
- **The core is about me and us.** A memory about you alone, a fact, or a plan no longer becomes core. The ones
|
|
100
|
+
already there that this moves out are not dropped: they show as "being reconsidered", in the wake's Still open
|
|
101
|
+
list and on the dashboard's Self page, and stay core until one of us decides.
|
|
102
|
+
- **Nothing leaves the core without a decision.** A core memory that stops coming back for 60 lived days is
|
|
103
|
+
reconsidered too, never dropped on its own. You keep one with `counterparts core --reaffirm <id> --reason "…"` or send
|
|
104
|
+
it back with `--demote`. I can do the same, awake (`remember` with `core`) or when I reflect, and a flag lifts
|
|
105
|
+
itself when its reason goes away (say a memory is re-marked as about us).
|
|
106
|
+
- **The night folds what belongs together.** When several memories are parts of one event or one stretch
|
|
107
|
+
of work (a day's merges, a release, one book), the dream can now fold them into one memory that says what
|
|
108
|
+
they add up to. The fold starts as strong as its strongest part, and the parts stay, marked earlier under it,
|
|
109
|
+
at half their strength, so recall leads with the fold and the parts are there when you ask for detail.
|
|
110
|
+
Readings, strongly felt memories about you or someone, and the core are never faded by a fold. At most five folds a night; any past that
|
|
111
|
+
are counted and said in the morning line.
|
|
112
|
+
- **A correction reaches the summary.** When a memory a fold was made from is corrected, the fold is flagged
|
|
113
|
+
beside the correction as possibly out of date, so it gets read again instead of carrying the old claim.
|
|
114
|
+
- **A personal fold can become core the ordinary way.** A fold is about you or about us only when most of its
|
|
115
|
+
parts are. Once folded, what comes back counts toward the slow road into the core: the fold's own uses and
|
|
116
|
+
its parts' later uses, across sessions and days. Its parts' history from before the fold does not.
|
|
117
|
+
- **A newer settle no longer stands an outdated memory back up.** Settling "B replaces A" after "C replaces B"
|
|
118
|
+
used to make B current again over C. Now a settle speaks only about the two memories it names, and B stays
|
|
119
|
+
earlier under C. To make B current again, settle B over C: that reorders the pair.
|
|
120
|
+
- **A catch-up no longer re-reads what a session already wrote up.** A long session that wrote its own
|
|
121
|
+
chapters as it went left parts whose every word was already written up, and a catch-up handed each one to a
|
|
122
|
+
reader anyway, about 24 KB at a time, only for it to answer "nothing new" in two seconds. Those parts are now
|
|
123
|
+
passed over without a reader and cost a batch nothing, and the run's summary says how many there were
|
|
124
|
+
("16 parts written, 11 of them already written up in their own session"). On the first live catch-up's
|
|
125
|
+
biggest session that is one child instead of three, with about the same memories kept.
|
|
126
|
+
- **A catch-up's "nothing worth keeping" says why.** In the nightly run or `counterparts catch-up`, an empty
|
|
127
|
+
answer for a part that holds words not yet written up now needs a one-line reason; without one the part is
|
|
128
|
+
not counted as written, stays owed for the next run, and doctor and `counterparts coverage` say how many
|
|
129
|
+
parts were left unread. A live session's empty answer is unchanged.
|
|
130
|
+
- **`counterparts catch-up --reowe <run>`.** Owes again the parts a named run closed with nothing kept, when
|
|
131
|
+
their words were not yet written up. It prints the plan first, then asks for the run's id typed back
|
|
132
|
+
(`--yes` skips that, `--dry-run` stops at the plan), and refuses by name what it cannot do: a session the
|
|
133
|
+
run went on to write up, parts after them that brought memories back, or words no longer kept. It reads the
|
|
134
|
+
run from the log, which keeps a week.
|
|
135
|
+
- **A note no longer marks the whole session as written up.** A note written mid-session used to count everything
|
|
136
|
+
said before it as written up, so one short note could leave hours of conversation that nothing ever wrote
|
|
137
|
+
down. Now a note covers only the turn it was written in; the rest waits for the session's own write-up, a
|
|
138
|
+
later session, or the night's catch-up, and the end-of-session ask still comes when it is due.
|
|
139
|
+
- **`counterparts coverage` agrees with the catch-up and doctor about who owes.** A small stretch from a session
|
|
140
|
+
that was not a person's (`claude -p`, the Agent SDK) is listed as left to lapse, not as owed, and the line about
|
|
141
|
+
parts a catch-up left unread shows only for today or for the date that run was on.
|
|
142
|
+
- **The night picks what to dream by what it is worth and how close it is to fading.** The dream used to read
|
|
143
|
+
only the newest 2,000 not-yet-dreamed memories and keep each one waiting for at most a week. Now it reads all of
|
|
144
|
+
them and ranks them by value (how much a memory mattered, how strongly it was felt, whether it is dated or on
|
|
145
|
+
my mind) times how weakly it is held on its own forgetting curve. A memory waits as long as it is still within
|
|
146
|
+
reach, however old, and one that fades below reach before a dream gets to it is counted and said, not dropped
|
|
147
|
+
silently. The night's budget is the same as before.
|
|
148
|
+
- **A fold the night had no room for comes back.** When a night has already made its five folds, the parts of
|
|
149
|
+
the next fold are carried to the next night, together and first in line, so it can be made then. Parts a fold
|
|
150
|
+
would not fade (readings, strongly felt memories, dated ones, the core) are not carried.
|
|
151
|
+
- **A reminder due today stays under "Arriving:" all day.** A dated item that had already come up twice in
|
|
152
|
+
conversation in the days before, or had come up once earlier the same day, dropped out of the wake's
|
|
153
|
+
"Arriving:" list, sometimes on the very day it was due. A plain reminder told to the first session of its
|
|
154
|
+
day also dropped out, even when that "session" was an agent's message at midnight that nobody read. Now
|
|
155
|
+
the list keeps a dated item until its day is behind it. How often a reminder is raised mid-conversation is
|
|
156
|
+
unchanged.
|
|
157
|
+
- **"Arriving:" no longer goes silent.** When a long self page left room for no dated line, the wake said
|
|
158
|
+
nothing at all about what was arriving. Now it always gives the one-line count with the ids
|
|
159
|
+
(`Arriving: 7 — no room to list them in this wake`), taking that room from "Work here", the Yesterday
|
|
160
|
+
line's titles and the handoffs. Doctor's Wake line now counts these as renders of the wake, and its advice
|
|
161
|
+
says what actually gives way.
|
|
162
|
+
- **A reminder written without a date now says so.** When a memory reads like a reminder ("remind", "don't forget", "follow up", "check back" beside a date such as "Oct 14", a weekday or "tomorrow") but is stored with no `eventDate`, the `remember` and `session_end` answers carry a one-line `reminderHint`: it will never come back on a date, and revising it with an `eventDate` makes it fire. The date is never guessed from the text and the write is never refused.
|
|
163
|
+
- **Fewer reads of Claude Code's own files.** The nightly run no longer looks through `~/.claude/projects` for
|
|
164
|
+
its own background session's transcript: it reads what that session printed as it ran, and doctor's Tool
|
|
165
|
+
results line says whether that output was read. Claude Code's compaction summaries, skill bodies, hook
|
|
166
|
+
feedback and other lines it writes for itself are no longer kept with a session's words; a message another
|
|
167
|
+
session sent to this one still is.
|
|
168
|
+
- **The wake-arrival check is off by default.** It read the start of the session's transcript only to confirm
|
|
169
|
+
the wake arrived whole. Set `COUNTERPARTS_WAKE_CHECK=1` in Claude Code's environment to turn it back on;
|
|
170
|
+
doctor's Wake line names the setting when no wake was checked.
|
|
171
|
+
- **A reminder is no longer "told" to a message nobody read.** When an agent's hand-back, a task
|
|
172
|
+
notification or another session's message started a turn, a plain reminder due that day was said
|
|
173
|
+
there and counted as told. Now it waits for the next message you type. The same goes for the
|
|
174
|
+
morning's dream line and share.
|
|
175
|
+
- **Dated items due in the next few days come first when a session starts.** At session start, the
|
|
176
|
+
"Arriving:" lines due today through three days ahead are listed first and take room before "Last
|
|
177
|
+
here", "Last said here", "Today, elsewhere" and the older handoffs. The newest handoff always keeps
|
|
178
|
+
its place.
|
|
179
|
+
- **A quiet dated item that already came up leaves after its day.** One that had been raised twice in
|
|
180
|
+
the days before stayed under "Arriving:" for a week as "was due". Now it leaves once its day is past.
|
|
181
|
+
|
|
3
182
|
## 0.3.18 — 2026-10-11
|
|
4
183
|
|
|
5
184
|
A new install now starts with a first meeting: in its first session Counterparts offers,
|
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.**
|
|
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,
|
package/docs/module-map.md
CHANGED
|
@@ -58,6 +58,29 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
|
|
|
58
58
|
| `stance-env.ts` | `COUNTERPARTS_OBSERVER` / `COUNTERPARTS_OWNER`, read the way the explicit-dir guard is, each failing toward less power. Unset, the configuration's `owner: true` decides for a server Claude Code starts (`mcp/bin/serve.ts#ownerStance`, 2026-10-02). |
|
|
59
59
|
| `log/` | A shared leaf with its own CONTRACT: the process log — one line per allowlisted event (failures, stand-downs, turn ends, write-ups, the night, the wake) from the hook, the worker, the nightly run and the MCP server, to `<dataDir>/sessions/log/<date>.log`, ids and codes only, kept 7 days. Read by `counterparts log` and one doctor line. **Added 2026-09-30**: none of the four processes wired its `onEvent`, so ~270 event names died with their process. |
|
|
60
60
|
|
|
61
|
+
**The five largest files, split by concern (2026-10-11)** — moves only, for the plugin
|
|
62
|
+
directory's check on files over 256 KiB. Each file still exports everything it did, so no
|
|
63
|
+
import changed. `core/counterpart.ts` keeps the class; its event names and record builders
|
|
64
|
+
are in `counterpart-events.ts`, its shapes in `counterpart-types.ts`, and the bodies of the
|
|
65
|
+
boundary, the sweep fallback and the deposit in `counterpart-boundary.ts`,
|
|
66
|
+
`counterpart-sweep.ts` and `counterpart-deposit.ts`. `core/store/index.ts` keeps the class
|
|
67
|
+
and every write; `marks.ts`, `shapes.ts` and `index-text.ts` hold its marks, shapes and
|
|
68
|
+
index text, and `reads-memories.ts`, `reads-marks.ts` and `reads-history.ts` the bodies of
|
|
69
|
+
its public reads. `mcp/server.ts` keeps the class; `server-words.ts`, `server-options.ts`
|
|
70
|
+
and `server-args.ts` hold its words, options and argument readers, and
|
|
71
|
+
`server-session-end.ts` and `server-self-tools.ts` the bodies of five of its tools.
|
|
72
|
+
`cli/commands.ts` keeps the dispatcher, the help, and the repair that reads through the
|
|
73
|
+
walk seam (its importers are pinned); each other command family is a `commands-*.ts` file. `claude-code/doctor.ts` keeps `doctorFindings` and about half the checks
|
|
74
|
+
(every one that reads the zone it sets); the finding's shape and the checkout, open, upgrade,
|
|
75
|
+
self-page, host, write-up and report groups are `doctor-*.ts` files. A moved class body is a free function taking the
|
|
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`).
|
|
83
|
+
|
|
61
84
|
## Tools (`tools/`)
|
|
62
85
|
|
|
63
86
|
| tool | job |
|
package/package.json
CHANGED
|
@@ -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
|
|
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`
|
|
@@ -75,7 +75,9 @@ credential — belongs here, discovered at runtime, never assumed by the core.
|
|
|
75
75
|
because only the render was instrumented. SessionStart writes the sentinel it printed
|
|
76
76
|
into the session registry record, and the session's FIRST PROMPT reads the head of the
|
|
77
77
|
host's transcript (or, when the host has not written the file yet, the next prompt or the
|
|
78
|
-
first Stop — 2026-10-08)
|
|
78
|
+
first Stop — 2026-10-08) — **an opt-in diagnostic since 2026-10-12: only when the hooks'
|
|
79
|
+
environment sets `COUNTERPARTS_WAKE_CHECK=1`; off, nothing is read and no row written,
|
|
80
|
+
and doctor's Wake line names the opt-in when it has no rows** — for this package's SessionStart attachment — what the hook printed
|
|
79
81
|
beside what the host recorded as injected — and leaves one `adapter.wake.delivered` row
|
|
80
82
|
saying `delivered`, `truncated`, `mismatch`, `printed-unverified` (this host build
|
|
81
83
|
records no injected copy to check against), `not-found` or `no-wake-expected`, in counts
|
|
@@ -126,20 +128,21 @@ credential — belongs here, discovered at runtime, never assumed by the core.
|
|
|
126
128
|
|
|
127
129
|
- **The A/B day-alternating wake mute is gone** — the *day-alternation*, that is. Computing
|
|
128
130
|
a parity off an anchor date is not a memory property (§1) and no schedule decides who
|
|
129
|
-
speaks here.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
is the ordinary build. The flag, the resolver, and the two durable events were meant to be
|
|
135
|
-
**retired at PROMOTE** — they are scaffolding for a comparison, not a feature. The parallel
|
|
136
|
-
run ended on 2026-09-21 and nothing retired them: they are **still wired**
|
|
137
|
-
(`hooks.ts#deliveryVerdict`, config `parallel`), and inert on every install that does not
|
|
138
|
-
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.
|
|
139
136
|
- **The 9,000-byte wake budget is not a constant here or anywhere.** The adapter
|
|
140
137
|
**discovers or asserts** its host's injection ceiling and reports it as a capability;
|
|
141
138
|
the core composes to whatever it is told (scar §2.18). v1's number was 90% of one host's
|
|
142
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.
|
|
143
146
|
- **Multi-file API-key rotation and per-key cursor bookkeeping are dropped** — and since
|
|
144
147
|
2026-09-24 there are no keys at all (§1a), so there is nothing to rotate and no credential
|
|
145
148
|
source to configure. (Until then credentials came from one configured source the package
|
|
@@ -189,7 +192,13 @@ owner's (measured 2026-09-04, `fix/transcript-peer-speakers`):
|
|
|
189
192
|
2026-09-23; shapes measured on 2.1.28x, table in `NOTES.md`): `origin.kind: "human"` is the
|
|
190
193
|
person — typed, queued, or pasted; `isMeta`, `isCompactSummary`, and any other
|
|
191
194
|
`origin.kind` (`peer` for a subagent's hand-back, `task-notification`) are the host, and
|
|
192
|
-
are `injected` — kept in capture, out of pacing.
|
|
195
|
+
are `injected` — kept in capture, out of pacing. **Except the host's own lines
|
|
196
|
+
(2026-10-12, `transcript.ts#hostRecord`, held lightly):** a compaction summary and every
|
|
197
|
+
`isMeta` line but a peer's message (hook feedback, `/context` output, image captions, skill
|
|
198
|
+
bodies, the idle notice) enter no turn at all — they are Claude Code's bookkeeping and its
|
|
199
|
+
conversation summaries, not the conversation, and a summary repeats turns already
|
|
200
|
+
captured. What they would have been refused as (`foreign`, `ritual`, `dream`) is still
|
|
201
|
+
read and counted. The new text markers (anchored at the
|
|
193
202
|
start of the block) decide only for a USER-role entry that carries no metadata; the
|
|
194
203
|
assistant's text is never reclassified by a marker, and `classifyBlock` — the rule both
|
|
195
204
|
roles share — is unchanged. The two refusals (`foreign`, `ritual`) come before the
|
|
@@ -591,7 +600,7 @@ row, saying which source answered, existed until the keys were removed — §1a.
|
|
|
591
600
|
`assertSafeDataDir` and writes tmp-then-rename, `sessions.ts`'s own rule for
|
|
592
601
|
the same directory.
|
|
593
602
|
`counterparts doctor` reads the same open with the same predicates
|
|
594
|
-
(`doctor.ts#readCounterpartOpen`) — RED for a store that will not open, AMBER
|
|
603
|
+
(`doctor-open.ts#readCounterpartOpen`) — RED for a store that will not open, AMBER
|
|
595
604
|
for one that was busy or that only an owner may initialize — so the terminal
|
|
596
605
|
and the console cannot disagree about what happened.
|
|
597
606
|
|
|
@@ -811,17 +820,22 @@ deny beats the user's own allow rules; `ToolSearch` stays, for hosts that defer
|
|
|
811
820
|
`--strict-mcp-config` with an `--mcp-config` naming only the counterparts server, as the
|
|
812
821
|
install registers it (`nightMcpConfig`); `--max-turns` (`NIGHT_MAX_TURNS` 60,
|
|
813
822
|
`dreaming.maxTurns`); `--model` only when `dreaming.model` is set; `--session-id` a fresh
|
|
814
|
-
UUID the waiting process chose (2026-10-09),
|
|
823
|
+
UUID the waiting process chose (2026-10-09), which keeps the children apart; and
|
|
824
|
+
`--output-format stream-json --verbose` (2026-10-12; `-p` refuses `stream-json` without
|
|
825
|
+
`--verbose`, measured on 2.1.296), its STDOUT kept in memory to 64 MiB
|
|
826
|
+
(`child.ts#OUTPUT_MAX_BYTES`) and read once for the host's cut. The catch-up child's
|
|
827
|
+
output is ignored. It
|
|
815
828
|
starts in a NEUTRAL directory — the store's own — so no project's CLAUDE.md, hooks or MCP
|
|
816
829
|
servers load. The parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are
|
|
817
830
|
removed; this package's values are written last.
|
|
818
831
|
|
|
819
|
-
**[M] The run reads its child's
|
|
820
|
-
lightly).** Once the child exits, the waiting process
|
|
821
|
-
|
|
822
|
-
`
|
|
823
|
-
|
|
824
|
-
|
|
832
|
+
**[M] The run reads its child's own output for the host's cut (2026-10-09, U14 item 3; from
|
|
833
|
+
the output since 2026-10-12 — held lightly).** Once the child exits, the waiting process
|
|
834
|
+
reads the `assistant` and `user` lines of its `stream-json` output
|
|
835
|
+
(`night-run.ts#readNightSpills`) for results of ours — `mcp__counterparts__*` — that the
|
|
836
|
+
host replaced with its marker (`transcript.ts#parseToolSpills`). Nothing under the host's
|
|
837
|
+
directory is listed or read: until 2026-10-12 the run found the child's transcript under
|
|
838
|
+
`~/.claude/projects` by its session id, and that lookup is gone. The markers: `<persisted-output>` "Output too large (…)" or
|
|
825
839
|
"Output exceeded the … persist limit", `<truncated-output>`, "Error: result (…) exceeds
|
|
826
840
|
maximum allowed tokens", or the "[OUTPUT TRUNCATED - exceeded … token limit]" trailer — as
|
|
827
841
|
read from Claude Code 2.1.295. Matched where the host puts each one, at the start or the very
|
|
@@ -831,7 +845,8 @@ writes the swap as a `content-replacement` line of its own, the result's line le
|
|
|
831
845
|
those lines are read too, shaped `turn-budget` (review of #330). Each cut result is one durable `mcp.result.spilled` row (run, tool, phase, shape, the
|
|
832
846
|
size the host said; never the saved file's path); the run's row carries `transcript` (`read`
|
|
833
847
|
| `absent` | `unreadable`) and, when read, `spills`. Doctor's Tool results line goes amber on
|
|
834
|
-
any row in its window and says in green whether the last night's
|
|
848
|
+
any row in its window and says in green whether the last night's output was read (the row's
|
|
849
|
+
field keeps its name, `transcript`); the
|
|
835
850
|
morning hand-back adds a plain line (`Dreams.nightSpillLine`), even for a run that journaled
|
|
836
851
|
nothing. The catch-up child is not read. A host that refuses the flag
|
|
837
852
|
(a quick non-zero exit, no transcript under the name, nothing begun in the store) costs the
|
|
@@ -874,7 +889,14 @@ not read as lost. A clean exit that stopped short of
|
|
|
874
889
|
its allowance — some granted session neither written up nor brought to its `upTo` part —
|
|
875
890
|
is recorded `partial`, not `done` (a usage limit exits 0 too; its output is not read), and
|
|
876
891
|
starts no further batch. A runner record a killed process left open is ended at the
|
|
877
|
-
next run's start (`endStaleRunners`).
|
|
892
|
+
next run's start (`endStaleRunners`). A part whose every word is already written up (the
|
|
893
|
+
session's own chapters or notes claimed them) is passed over by the door and costs a batch
|
|
894
|
+
nothing — never the last part (`sessions.ts#firstUnwrittenPart`, 2026-10-11) — and the row
|
|
895
|
+
counts those (`passed`). A catch-up's `[]` for a part with unwritten words needs a one-line
|
|
896
|
+
`nothing` reason or is refused, and the part stays owed; the row counts parts a child was
|
|
897
|
+
handed and did not bring back (`unread`). `counterparts catch-up --reowe <run>`
|
|
898
|
+
(`reowe.ts`) owes again what a run closed empty while its words were unwritten, moving only
|
|
899
|
+
the progress counter, and refuses by name what that cannot do. `counterparts catch-up` runs the same launcher in the
|
|
878
900
|
foreground (`cli/catch-up.ts`, run ids `cup_…`), its runners filed under the store's own
|
|
879
901
|
directory. Under dreaming `auto` the SessionStart write-up pointer is retired
|
|
880
902
|
(`lifecycle.ts#writeUpPointerRetired`); under `ask` or `off` no night runs and the pointer
|
|
@@ -1030,7 +1052,7 @@ DEFERRAL and sessions are waiting — saying the wake was too full, by how many
|
|
|
1030
1052
|
`injectionBudgetBytes` by that much (never "open a session", which would defer again);
|
|
1031
1053
|
and (until 2026-09-30, when the `Write-ups` rule above replaced it) amber when a session had
|
|
1032
1054
|
waited past a 3-day `WRITE_UP_WAIT_DAYS`. Counted with the pointer's own eligibility: a small
|
|
1033
|
-
debt the pointer never offers (not a person's session) is named apart, as left to lapse. Never red; not in the session-start reading. `Sweep`: `not-opted-in` —
|
|
1055
|
+
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` —
|
|
1034
1056
|
and an older build's `no-credential` — is green `next session`.
|
|
1035
1057
|
|
|
1036
1058
|
## 6. Scars honored
|
|
@@ -578,7 +578,7 @@ That is a different mechanism, not a wider parameter, and it is not built.
|
|
|
578
578
|
live; the workaround is exact, not approximate, and the cost is up to five
|
|
579
579
|
queries on a 150 ms hot path. *(Noted 2026-10-09: the store side is built,
|
|
580
580
|
`order: "desc"`, 2026-09-24 (cli §10); doctor keeps its ladder on purpose, as
|
|
581
|
-
`doctor.ts#WINDOWS` says.)*
|
|
581
|
+
`doctor-finding.ts#WINDOWS` says.)*
|
|
582
582
|
2. **`adapter.checkout` is a durable name in `core/counterpart.ts`.** The third
|
|
583
583
|
time the core has learned a string for an adapter's sake, and for the same
|
|
584
584
|
narrow reason the spawn names did: `dashboard/registries.ts` derives
|
|
@@ -885,15 +885,18 @@ one; closing such a session by hand needs a console command that marks `by: "own
|
|
|
885
885
|
|
|
886
886
|
## 18. The host's cut is read only for the nightly run, and only as the host writes it today (2026-10-09, U14 item 3)
|
|
887
887
|
|
|
888
|
-
The nightly run reads its child's
|
|
889
|
-
(`night-run.ts#readNightSpills`, `transcript.ts#
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
888
|
+
The nightly run reads its child's own `stream-json` output for the host's marker on our
|
|
889
|
+
results (`night-run.ts#readNightSpills`, `transcript.ts#parseToolSpills`; until 2026-10-12 it
|
|
890
|
+
read the child's transcript under `~/.claude/projects`). Three things it owes:
|
|
891
|
+
|
|
892
|
+
1. **Unmeasured on a real machine.** That a cut result reaches the `stream-json` output in
|
|
893
|
+
the shape the transcript records it — the preview in the `tool_result`, as the model saw
|
|
894
|
+
it — and that the per-turn budget's `content-replacement` swap is said there at all. The
|
|
895
|
+
message lines were seen on 2.1.296 to carry the transcript's block shapes; a spill was
|
|
896
|
+
not. If the swap is transcript-only, `turn-budget` cuts go unseen (a missed spill, never
|
|
897
|
+
a false one). Check doctor's Tool results line after the first night on a build with
|
|
898
|
+
this. A host that refuses the arguments outright is retried once without them (review of
|
|
899
|
+
#330), so the night itself is not lost to this check.
|
|
897
900
|
2. **The markers are the host's wording.** Read from 2.1.295's code; a host that rewords
|
|
898
901
|
them makes the check go quiet (a missed spill), never noisy. A new marker shape is one
|
|
899
902
|
regex in `transcript.ts`.
|
|
@@ -2510,3 +2510,82 @@ reason `unread`, with its code, not `nothing-ran` (`night-run.ts`).
|
|
|
2510
2510
|
`nightRunLost` reads a row past that plus 10 minutes' grace as lost, and the next prompt would
|
|
2511
2511
|
have asked to dream while a long catch-up ran. The row now carries the catch-up's hour from the
|
|
2512
2512
|
start (`nightRowTimeoutMs`).
|
|
2513
|
+
|
|
2514
|
+
## 2026-10-11 — the first live `counterparts catch-up`: sixteen empty parts, read back
|
|
2515
|
+
|
|
2516
|
+
**It looked like skimming and was not.** Run `cup_463025455d83` closed 16 of its 24 parts with
|
|
2517
|
+
`[]`, about 2–3 s from fetch to answer (e92c5180 parts 10–15, 0464c1d3 parts 2–11). The parts
|
|
2518
|
+
the three children were actually served (their transcripts) show every entry of those 16 marked
|
|
2519
|
+
`[already written up]`: 14 were claimed by the sessions' own half-hourly chapters, 2 by one
|
|
2520
|
+
mid-session note. The prompt says not to write marked words again; the reader didn't. Fetch to
|
|
2521
|
+
answer measures output, not reading: the parts with unwritten words took 16–25 s each and kept
|
|
2522
|
+
5–10 memories. So the cause was the door serving parts with nothing to write, and the batch
|
|
2523
|
+
allowance counting them (one batch's whole allowance, and most of another's, went on them).
|
|
2524
|
+
|
|
2525
|
+
**Fixed.** `writeUpPartsDated` counts each part's `unwritten` bytes; the door passes such parts
|
|
2526
|
+
over on a fetch, never the last (`firstUnwrittenPart`), and `planCatchUp` starts each batch at
|
|
2527
|
+
the first part the door will serve, charging passed-over parts nothing. The row carries
|
|
2528
|
+
`passed` and `unread`. Replayed on a copy of the preserved spans with 0464c1d3 alone and a real
|
|
2529
|
+
child: one batch, parts 1–11 passed over in one fetch, parts 12–16 read in 108 s, 37 memories
|
|
2530
|
+
(the live run: three children, 0 for parts 2–11, 35 for 12–16).
|
|
2531
|
+
|
|
2532
|
+
**The guard.** On the granted path a `[]` for a part with unwritten words needs a one-line
|
|
2533
|
+
`nothing` reason, or it is refused `reason-required` and the part stays owed. No timer, no
|
|
2534
|
+
run-of-empties rule: both would have re-owed the sixteen right answers forever.
|
|
2535
|
+
|
|
2536
|
+
**`--reowe <run>`** reads the run's `mcp.write_up` rows from the log (a week) and the coverage
|
|
2537
|
+
ledger as it stood when the run began. On a copy of the post-run spans with the run's log lines
|
|
2538
|
+
it says, for both sessions, "nothing to re-owe". It moves only the progress counter; a session
|
|
2539
|
+
the run went on to mark is refused `needs-retraction` (see the decisions fragment).
|
|
2540
|
+
|
|
2541
|
+
**Not changed, flagged.** A jot claims every unwritten word its session said before it
|
|
2542
|
+
(`submitJot` → the default `cover`): one short note covered e92c5180's evening, about
|
|
2543
|
+
2.5 hours and 48 KB, whose other substance no chapter or memory of that session holds.
|
|
2544
|
+
|
|
2545
|
+
## 2026-10-12 — three reads of Claude Code's files trimmed (directory review, 1D/1F)
|
|
2546
|
+
|
|
2547
|
+
**The nightly run reads its child's output, not its transcript.** `claude -p --output-format
|
|
2548
|
+
stream-json` is refused without `--verbose` on 2.1.296 ("requires --verbose"), so both go on the
|
|
2549
|
+
run's children; the catch-up child's output stays ignored. Its `assistant` and `user` lines carry
|
|
2550
|
+
the transcript's block shapes, so `parseToolSpills` reads them unchanged. Not seen: a real spill in
|
|
2551
|
+
the stream, and whether the per-turn budget's `content-replacement` swap is written there at all
|
|
2552
|
+
(INTERFACE-GAPS §18). With STDOUT piped, `close` waits for every holder of the pipe, so the
|
|
2553
|
+
starter ends on `exit` plus `REAP_GRACE_MS` when it captures. The output also carries other hooks'
|
|
2554
|
+
`hook_response` lines; only the counts leave `readNightSpills`.
|
|
2555
|
+
|
|
2556
|
+
**Claude Code's own lines are not kept** (`hostRecord`): the compaction summary and `isMeta` lines
|
|
2557
|
+
other than a peer's message. One expectation moved with it: a slice holding a compaction summary
|
|
2558
|
+
and then typed words used to "say less" in the last exchange; with the summary gone, the typed
|
|
2559
|
+
words are said.
|
|
2560
|
+
|
|
2561
|
+
**The wake-arrival check is opt-in** (`COUNTERPARTS_WAKE_CHECK=1`). Off, `checkWakeArrival` returns
|
|
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:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
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
|
}
|