counterparts 0.3.17 → 0.3.18
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 +288 -0
- package/CONSTITUTION.md +7 -7
- package/docs/QUICKSTART.md +15 -3
- package/docs/module-map.md +3 -2
- package/package.json +1 -1
- package/src/adapters/claude-code/CONTRACT.md +65 -17
- package/src/adapters/claude-code/NOTES.md +35 -0
- package/src/adapters/claude-code/bin/hook.ts +5 -0
- package/src/adapters/claude-code/bin/nightly.ts +2 -0
- package/src/adapters/claude-code/bin/runner.ts +2 -0
- package/src/adapters/claude-code/claim.ts +36 -14
- package/src/adapters/claude-code/doctor.ts +108 -25
- package/src/adapters/claude-code/embed-client.ts +15 -2
- package/src/adapters/claude-code/hooks.ts +207 -11
- package/src/adapters/claude-code/index.ts +6 -2
- package/src/adapters/claude-code/night-catch-up.ts +367 -124
- package/src/adapters/claude-code/night-run.ts +322 -74
- package/src/adapters/cli/CONTRACT.md +8 -1
- package/src/adapters/cli/NOTES.md +34 -0
- package/src/adapters/cli/catch-up.ts +118 -0
- package/src/adapters/cli/commands.ts +177 -33
- package/src/adapters/cli/coverage.ts +14 -3
- package/src/adapters/cli/dream-core.ts +4 -4
- package/src/adapters/cli/help.ts +15 -1
- package/src/adapters/cli/mechanisms.ts +14 -2
- package/src/adapters/cli/settle.ts +16 -4
- package/src/adapters/cli/uninstall.ts +530 -58
- package/src/adapters/config.ts +45 -14
- package/src/adapters/dashboard/registries.ts +7 -3
- package/src/adapters/dashboard/web/flow.ts +1 -0
- package/src/adapters/dashboard/web/lanes.ts +2 -0
- package/src/adapters/dashboard/web/mechanisms/prospective/index.js +3 -2
- package/src/adapters/dashboard/web/mechanisms/prospective/panel.js +2 -1
- package/src/adapters/dashboard/web/narrate.ts +16 -2
- package/src/adapters/dashboard/web/server.ts +4 -0
- package/src/adapters/dashboard/web/views/archive-words.ts +1 -1
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +25 -4
- package/src/adapters/dashboard/web/views/mechanisms.ts +16 -1
- package/src/adapters/empty-bunfig.toml +13 -2
- package/src/adapters/fired.ts +5 -3
- package/src/adapters/host-wiring.ts +7 -0
- package/src/adapters/lifecycle.ts +133 -7
- package/src/adapters/mcp/CONTRACT.md +40 -6
- package/src/adapters/mcp/INTERFACE-GAPS.md +1 -1
- package/src/adapters/mcp/NOTES.md +1 -1
- package/src/adapters/mcp/bin/serve.ts +4 -1
- package/src/adapters/mcp/facts.ts +125 -12
- package/src/adapters/mcp/index.ts +1 -0
- package/src/adapters/mcp/server.ts +388 -35
- package/src/adapters/mcp/tools.ts +147 -57
- package/src/adapters/mcp/write-up.ts +3 -3
- package/src/adapters/mechanism-evidence.ts +53 -4
- package/src/adapters/plugin-run.sh +14 -2
- package/src/adapters/plugin.ts +24 -1
- package/src/adapters/runtime.ts +5 -2
- package/src/adapters/sessions.ts +3 -3
- package/src/adapters/spawn.ts +16 -0
- package/src/core/associate/CONTRACT.md +13 -4
- package/src/core/associate/NOTES.md +102 -0
- package/src/core/associate/at-write.ts +65 -0
- package/src/core/associate/contiguity.ts +3 -2
- package/src/core/associate/index.ts +64 -12
- package/src/core/associate/tunables.ts +42 -7
- package/src/core/counterpart.ts +497 -53
- package/src/core/coverage/INTERFACE-GAPS.md +8 -7
- package/src/core/dream/CONTRACT.md +43 -7
- package/src/core/dream/NOTES.md +27 -0
- package/src/core/dream/index.ts +323 -26
- package/src/core/dream/mind.ts +62 -9
- package/src/core/dream/reflect.ts +19 -11
- package/src/core/dream/tunables.ts +13 -0
- package/src/core/handoff/CONTRACT.md +27 -0
- package/src/core/handoff/INTERFACE-GAPS.md +18 -0
- package/src/core/handoff/NOTES.md +32 -0
- package/src/core/handoff/last-exchange.ts +389 -0
- package/src/core/leaving.ts +1 -1
- package/src/core/mint.ts +12 -1
- package/src/core/onboarding.ts +509 -0
- package/src/core/physics/CONTRACT.md +19 -2
- package/src/core/physics/index.ts +5 -1
- package/src/core/prospective/CONTRACT.md +29 -8
- package/src/core/prospective/INTERFACE-GAPS.md +1 -1
- package/src/core/prospective/NOTES.md +46 -3
- package/src/core/prospective/index.ts +133 -108
- package/src/core/recall/CONTRACT.md +15 -0
- package/src/core/recall/activate.ts +28 -0
- package/src/core/recall/gate.ts +19 -1
- package/src/core/recall/index.ts +61 -5
- package/src/core/recall/session.ts +5 -0
- package/src/core/recall/standing.ts +89 -4
- package/src/core/{contradictions.ts → reconsolidation.ts} +560 -31
- package/src/core/remember/updates.ts +11 -0
- package/src/core/revision.ts +10 -5
- package/src/core/schemas/CONTRACT.md +3 -2
- package/src/core/schemas/NOTES.md +33 -1
- package/src/core/self/briefing.ts +5 -2
- package/src/core/self/episodes.ts +2 -1
- package/src/core/sleep/decay.ts +4 -0
- package/src/core/store/NOTES.md +1 -1
- package/src/core/store/index.ts +308 -12
- package/src/core/store/operational.ts +86 -27
- package/src/core/types.ts +19 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,293 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.18 — 2026-10-11
|
|
4
|
+
|
|
5
|
+
A new install now starts with a first meeting: in its first session Counterparts offers,
|
|
6
|
+
once, to take about five minutes to get to know each other (where memory is on, what you're
|
|
7
|
+
working on, how you like to be talked to), and keeps each answer as an ordinary memory; the
|
|
8
|
+
plugin's sidebar opens that conversation itself, and dreaming is on for new installs. The
|
|
9
|
+
plugin is ready for Anthropic's plugin directory: Bun no longer fetches anything on its own,
|
|
10
|
+
`/counterparts:dashboard`, `/counterparts:meet` and `/counterparts:uninstall` work without a
|
|
11
|
+
`counterparts` command, and doctor's fixes fit how you installed. Older memories with no
|
|
12
|
+
salience of their own now read at today's default for what they are about, so memories about
|
|
13
|
+
you or the two of us written before your 0.3.17 upgrade come back into reach. The nightly run writes up every
|
|
14
|
+
session still owed (`counterparts catch-up` does it on demand) and reflects in a session of
|
|
15
|
+
its own, a memory that replaces another comes up in its place, and `counterparts uninstall`
|
|
16
|
+
offers to delete your memory, at a terminal, behind a typed phrase. **Nothing to run after
|
|
17
|
+
upgrading from 0.3.17**: the hooks, the memory server's registration and Claude Desktop's
|
|
18
|
+
entry are the same as 0.3.17's, and an existing memory keeps its dreaming setting and is
|
|
19
|
+
never offered the first meeting. **No store-format change** (still v13, and the search cache
|
|
20
|
+
v6): nothing is copied or upgraded, and 0.3.17 opens the same store. To go back to 0.3.17,
|
|
21
|
+
don't run `counterparts rollback`: it undoes a format upgrade, and within 14 days of 0.3.17's
|
|
22
|
+
it would offer to put back the copy taken before it, without everything remembered since.
|
|
23
|
+
Run `counterparts disconnect`, reinstall 0.3.17, then `counterparts connect`.
|
|
24
|
+
|
|
25
|
+
The first meeting (#419, #416, #424, #426, #393).
|
|
26
|
+
|
|
27
|
+
- **A first meeting, on every install.** A new install's first session offers, once and
|
|
28
|
+
at the end of a reply, to take about five minutes to get to know each other: where memory
|
|
29
|
+
is on (every folder, or just this one, unless a folder was already set), what you're working on, something you've loved,
|
|
30
|
+
how you like to be talked to (straight to it, think it through with me, friendly and easy,
|
|
31
|
+
or like a character you name) and a few more, each one skippable. Each answer is kept as
|
|
32
|
+
an ordinary memory marked as from onboarding, a style becomes a few preferences that keep
|
|
33
|
+
honest pushback, and the next session may bring one of them back on its own. "Later"
|
|
34
|
+
offers it again another day (the offer comes on three days at most); Claude's new `meet` tool starts it any time. A memory that
|
|
35
|
+
already existed is never offered it.
|
|
36
|
+
- **The sidebar starts the first meeting.** In the first session after an install, Claude
|
|
37
|
+
speaks first ("Counterparts is installed. Say hello and introduce yourself.", shown as sent
|
|
38
|
+
by the plugin), once per install, never in a `-p` run, in a folder that is paused or off,
|
|
39
|
+
or after you've typed. If you put the meeting off, a **Meet your counterpart** row at the
|
|
40
|
+
top of the sidebar starts it when you're ready.
|
|
41
|
+
- **`/counterparts:meet` starts the first meeting any time.** For a plugin install, the short getting-to-know-you conversation can be started with this command as well as with the sidebar's "Meet your counterpart" button, so someone in the quiet view, or past the first days' offers, still has a way in. It asks the memory server's `meet` tool for the meeting and runs nothing else.
|
|
42
|
+
- **Dreaming is on for new installs.** Once a day the first session starts a short
|
|
43
|
+
background run that goes over what was saved, and the install, the plugin's first-run line
|
|
44
|
+
and `counterparts doctor` say so and how to turn it off ("no dreams", or
|
|
45
|
+
`counterparts dream --setting off`). An existing memory keeps its setting.
|
|
46
|
+
- **`counterparts start-fresh` begins with a first meeting**, and `--undo` brings back the
|
|
47
|
+
parked memory as it was.
|
|
48
|
+
- **A new person's first day gets written up even with only a few memories.** With dreaming
|
|
49
|
+
on its own, the nightly run used to start only when there was enough new to dream on, so
|
|
50
|
+
someone who skipped the first meeting and saved one or two memories got no run on day 2,
|
|
51
|
+
and their first day's conversations were never written up. Now the run also starts when
|
|
52
|
+
sessions from an earlier day still owe a write-up: it writes them up quietly in the
|
|
53
|
+
background and skips the dream, and `counterparts doctor` says "the catch-up alone" rather
|
|
54
|
+
than a failed dream. Dreaming `ask` and `off` work as before.
|
|
55
|
+
- **A new install's doctor has no puzzling amber before the first session.** The Vectors line
|
|
56
|
+
read amber, about embedding "per boundary", until the first session ended. Before then it
|
|
57
|
+
is green and says the search by meaning builds after your first session; on a store that
|
|
58
|
+
has had sessions, a real shortfall is still amber.
|
|
59
|
+
|
|
60
|
+
The plugin, ready for Anthropic's directory (#396, #394, #399, #416).
|
|
61
|
+
|
|
62
|
+
- **Bun no longer fetches the embedding table on its own.** When a plugin install's
|
|
63
|
+
packages didn't install (the package manager its lockfile names wasn't on the PATH,
|
|
64
|
+
Claude Code's 60-second limit, offline), Bun used to download the table from the npm registry the first time it was
|
|
65
|
+
needed, at whatever version was newest, without saying so. Now nothing is fetched: recall
|
|
66
|
+
matches on words, and `/counterparts:doctor` says the table is missing. npm and Bun
|
|
67
|
+
installs of the package are unaffected.
|
|
68
|
+
- **Doctor's fixes fit how you installed.** When the model table is missing or damaged, or
|
|
69
|
+
the search cache came from a newer build, doctor used to say `bun add -g …` even on a
|
|
70
|
+
Claude Code plugin install, which may have no bun at all. A plugin install now gets
|
|
71
|
+
`/plugin → Installed → counterparts → Update now` (or uninstall and install it again); the npm install keeps
|
|
72
|
+
its `bun add -g` command; and where doctor can't tell which it is, it names both.
|
|
73
|
+
- **Plugin installs can start the dashboard: `/counterparts:dashboard`.** A plugin install
|
|
74
|
+
has no `counterparts` command, so the sidebar's "start it with `counterparts dashboard`"
|
|
75
|
+
couldn't work there. The new command starts the same dashboard from the plugin, in the
|
|
76
|
+
background, until the session ends. With the dashboard down, the sidebar names the way
|
|
77
|
+
that works for your install: `counterparts dashboard` for the npm install,
|
|
78
|
+
`/counterparts:dashboard` for the plugin.
|
|
79
|
+
- **The sidebar finds a dashboard on another port.** When `COUNTERPARTS_DASHBOARD_PORT` is
|
|
80
|
+
set, the sidebar reads and links to that port, as the dashboard itself does, instead of
|
|
81
|
+
assuming 4747.
|
|
82
|
+
- **The sidebar's Counterparts switch has three positions: on · paused · off.** Paused and
|
|
83
|
+
off each ask first and hold for every session in that folder; on resumes a pause at once,
|
|
84
|
+
and turns a folder you set off back on after one confirmation ("Nothing from while it was
|
|
85
|
+
off was kept."). It stays as careful as before: a state it couldn't read is never shown
|
|
86
|
+
as on, and it changes only a folder with a setting of its own. A folder that is off or
|
|
87
|
+
paused because a folder above it is, it explains, naming that folder, and leaves alone.
|
|
88
|
+
- **The "Claude memory" switch is hidden unless you ask for it.** It turns Claude Code's
|
|
89
|
+
own memory (MEMORY.md) on and off, which most people don't need beside Counterparts. If
|
|
90
|
+
you had already turned Claude Code's memory off, you keep the switch. To show it anyway,
|
|
91
|
+
start Claude Code with `COUNTERPARTS_SIDEBAR_CC_MEMORY=1` in the environment (for
|
|
92
|
+
example `export COUNTERPARTS_SIDEBAR_CC_MEMORY=1` in your shell profile). What it does
|
|
93
|
+
when shown is unchanged.
|
|
94
|
+
|
|
95
|
+
Uninstalling (#414, #421, #425).
|
|
96
|
+
|
|
97
|
+
- **`counterparts uninstall` asks whether to delete your memory too.** Once Claude Code is
|
|
98
|
+
disconnected, at a terminal, it lists every path that would go (the store, its snapshots,
|
|
99
|
+
the configuration) with its size, says what it leaves (Claude Code's own files), and asks
|
|
100
|
+
"Also delete all memories and related data? This can't be undone. [y/N]". Enter keeps your
|
|
101
|
+
memory. A yes asks you to type `DELETE MEMORIES` before anything is deleted. It isn't asked
|
|
102
|
+
from a pipe, with `--yes`, or with the new `--keep-memories`, and isn't offered while a
|
|
103
|
+
Claude Code session, the dashboard or the worker has the memory open.
|
|
104
|
+
- **`--delete-memories` also waits for open sessions.** It now refuses while a Claude Code
|
|
105
|
+
session's hooks ran on the store in the last ten minutes, or a memory server is recorded
|
|
106
|
+
as running on it, not only while one shows up in the process list.
|
|
107
|
+
- **`counterparts uninstall --json`, for the plugin's own command.** On its own it prints
|
|
108
|
+
the plan as one JSON object and changes nothing: what a delete would remove and leave, the
|
|
109
|
+
count, and whether it can go ahead now. With `--keep-memories` it uninstalls and keeps your
|
|
110
|
+
memory. It never deletes: that is always typed by you, at a terminal.
|
|
111
|
+
- **Uninstall's last lines fit a plugin install.** Run through the plugin, they name the
|
|
112
|
+
plugin's own command line and Claude Code's `/plugin` to remove it, not `bun remove -g`.
|
|
113
|
+
- **`/counterparts:uninstall`, for a plugin install.** It shows what an uninstall would do,
|
|
114
|
+
then asks whether to keep your memories or delete them too. Keep disconnects Counterparts
|
|
115
|
+
and leaves your memories where they are; then you remove the plugin from `/plugin`. Delete
|
|
116
|
+
runs nothing: it has you disable the plugin first (so it doesn't set itself up again when
|
|
117
|
+
Claude Code next opens), then gives you the one command to type in a terminal with Claude
|
|
118
|
+
Code closed, where you confirm the delete yourself. Claude can't delete your memories from inside a session.
|
|
119
|
+
- **Uninstalling with the plugin no longer leaves an empty memory folder behind.** After
|
|
120
|
+
`uninstall` deletes or sets aside your memories, a plugin install is now told to remove the
|
|
121
|
+
plugin right there in the terminal (`claude plugin uninstall …`), before opening Claude Code
|
|
122
|
+
again. Opening Claude Code first let the still-enabled plugin set Counterparts up again, with
|
|
123
|
+
a new, empty memory folder that stayed after the plugin was gone. If you have both the npm
|
|
124
|
+
install and the plugin, it now names the plugin too.
|
|
125
|
+
|
|
126
|
+
Writing up what was said, at night (#401, #407, #413).
|
|
127
|
+
|
|
128
|
+
- **The nightly run catches up on everything owed.** Sessions that ended before they were
|
|
129
|
+
written up used to wait for a new session in the same folder, or for the nightly run,
|
|
130
|
+
which took at most four of them a night. The nightly run now writes up all of them,
|
|
131
|
+
oldest first, in short batches, with a ceiling of 100 parts and an hour a night against
|
|
132
|
+
runaway cost. What it leaves stays owed for the next night.
|
|
133
|
+
- **The nightly run's catch-up stops at 100 parts.** A typical morning owes 20 to 40 parts
|
|
134
|
+
and clears in one night; a heavy day takes two, and what the night leaves stays owed for
|
|
135
|
+
the next one. `counterparts catch-up`, which you run on purpose, still takes up to 400
|
|
136
|
+
parts. Both still stop at an hour.
|
|
137
|
+
- **`counterparts catch-up` does it now.** It writes up every ended session that is still
|
|
138
|
+
owed, through the same windowless `claude -p` the nightly run uses, while your other
|
|
139
|
+
sessions stay open. It prints each batch, then how many sessions it caught up and how many
|
|
140
|
+
sessions and parts are left. It uses your Claude subscription like any session.
|
|
141
|
+
- **New sessions no longer write up other sessions at the start.** With dreaming on `auto`,
|
|
142
|
+
a new session isn't pointed at an older session's words any more; the nightly run and the
|
|
143
|
+
command do that work. Your sessions' own write-ups are unchanged. With dreaming on `ask` or
|
|
144
|
+
`off`, no nightly run happens, so the pointer stays.
|
|
145
|
+
- **Doctor says how far a catch-up got.** Its Catch-up line (it was Write-ups) and its
|
|
146
|
+
Nightly run line count the parts written and the parts still owed. On 10-11, "wrote up 0 of
|
|
147
|
+
1" was shown for a night that wrote 5 of a session's 17 parts. When the night has caught
|
|
148
|
+
up, the next session is told in one line.
|
|
149
|
+
- **A nightly run cut off by an update says so.** If an install migrates the store while the
|
|
150
|
+
nightly run is going, the run is recorded as unreadable after an update mid-run. It used
|
|
151
|
+
to say the run had used none of its tools.
|
|
152
|
+
- **The nightly reflection starts with a fresh mind.** The background run now runs in two
|
|
153
|
+
parts, one after the other: the page writer and the dream, then the reflection in a
|
|
154
|
+
session of its own, which reads tonight's dream from memory instead of carrying the whole
|
|
155
|
+
dream in its context, so a night needs far less room at its peak. If the dream fails or
|
|
156
|
+
has nothing to do, the reflection still runs on the last few days. `counterparts dream
|
|
157
|
+
--list` and doctor say which parts ran, as before.
|
|
158
|
+
|
|
159
|
+
What a memory is about, and how long it lasts (#395, #398, #400, #403).
|
|
160
|
+
|
|
161
|
+
- **Older memories read at today's defaults, the same as new ones.** A memory written before
|
|
162
|
+
the upgrade with no salience of its own was given the old flat default, so a memory about
|
|
163
|
+
you or us from the last few days faded within days, while the same memory written today
|
|
164
|
+
starts higher and lasts weeks. It now reads at today's default for what it is about, higher
|
|
165
|
+
or lower: about you or us 0.40, a finished piece of work 0.20. A salience someone actually
|
|
166
|
+
set still reads as it did. Nothing is rewritten; `counterparts claims-era` and doctor's "Old
|
|
167
|
+
claims" line say how many read lower and how many higher, and `--off` reads every one as
|
|
168
|
+
stored again.
|
|
169
|
+
- **A merged memory keeps what it was about.** When a dream merges near-copies, the merged
|
|
170
|
+
memory now takes what its strongest original was about, and a memory about you, us or me is
|
|
171
|
+
never turned into a work one by merging it with one. It also fades the way its originals did:
|
|
172
|
+
a memory written before the upgrade is still read at today's default after a merge, instead
|
|
173
|
+
of starting over at the claim the old build gave it. `counterparts claims-era --off` reads it
|
|
174
|
+
as stored, the same as the rest.
|
|
175
|
+
- **A revised memory keeps what it was about.** When you revise a memory (`updates`) without
|
|
176
|
+
saying what the new one is about, it now takes the mark of the memory it revises, and counts
|
|
177
|
+
for as much: a memory about you or the two of us, revised without restating `about`, stays
|
|
178
|
+
yours and keeps its higher starting weight instead of dropping to the unmarked one. Saying
|
|
179
|
+
`about` on the revision still wins.
|
|
180
|
+
- **A dream's pattern keeps what it is about.** A pattern a dream draws from memories about you
|
|
181
|
+
or the two of us is now marked so, like the memories it came from, instead of coming out
|
|
182
|
+
unmarked and counted as one folder's project work. It still starts low and rises only by
|
|
183
|
+
coming back in your sessions.
|
|
184
|
+
|
|
185
|
+
What replaces what (#420, #408, #422).
|
|
186
|
+
|
|
187
|
+
- **A newer version of something is noticed without being named.** When a memory you write reads
|
|
188
|
+
as the newer state of a recent one (the same release, a plan now done, the latest count), the
|
|
189
|
+
older is marked as possibly out of date and faded a little, and the write says so; settle it
|
|
190
|
+
then, or the night's dream confirms it or says they are two different things. Dated reminders,
|
|
191
|
+
readings and core memories are never proposed.
|
|
192
|
+
- **What holds now comes up in place of what it replaced.** When recall reaches a memory a later
|
|
193
|
+
one changed, it shows the later one, which names the earlier; the two no longer show side by
|
|
194
|
+
side with the old one first.
|
|
195
|
+
- **A memory a later one changed is marked wherever it is listed.** When you write a memory,
|
|
196
|
+
the close existing memories it comes back with no longer show an older version by its bare
|
|
197
|
+
title: it reads `earlier (now mem_…)`, naming the one that holds now, or is left off when
|
|
198
|
+
that one is already in view. Dreams and reflections see the same mark, and a reminder a
|
|
199
|
+
later memory replaced no longer shows on the dream's "coming up".
|
|
200
|
+
- **"Earlier (now …)" names the latest version.** When a memory was changed and then
|
|
201
|
+
changed again, recall's label points at the newest one, not the one in between, and a
|
|
202
|
+
memory a later settle put back in place no longer reads as earlier.
|
|
203
|
+
- **Facts answers name the memory that holds now.** When a facts-mode `recall` shows an
|
|
204
|
+
earlier version on its own, its "earlier — now …" line names the end of the chain (on
|
|
205
|
+
A, then B, then C, it says C), the same memory recall's other labels and a write's
|
|
206
|
+
neighbours name. An earlier version that a newer settle re-affirmed reads as current.
|
|
207
|
+
- **Updating a removed memory no longer fails the write.** A `remember` whose `updates`
|
|
208
|
+
named a memory you had removed used to fail outright, and the new memory was lost with
|
|
209
|
+
it. Now the new memory is stored on its own, unlinked, and the reply says the memory it
|
|
210
|
+
named was removed. It is never attached to a similar memory in the removed one's place.
|
|
211
|
+
- **A memory's weight follows how it was last felt.** A later feeling recorded about a memory
|
|
212
|
+
(awake, in a dream or in a reflection) is what its weight reads now, so a hurt that has been
|
|
213
|
+
talked through can soften; the first feeling stays on record. Settling over a felt memory asks
|
|
214
|
+
how it sits now.
|
|
215
|
+
- **Fewer wrong settles.** A reading is no longer faded by a fact that shares its topic (the two
|
|
216
|
+
are kept side by side), a reminder still to come can't be settled over without the newer memory
|
|
217
|
+
carrying it, and the check on a write's `updates` now measures how close is close in your own
|
|
218
|
+
store. A settle closes the other open questions about the memory it moves, and a question left
|
|
219
|
+
open for a week is asked again once.
|
|
220
|
+
|
|
221
|
+
Reminders (#393, #411).
|
|
222
|
+
|
|
223
|
+
- **A plain reminder keeps its place under "Arriving:".** The wake lists two arriving items,
|
|
224
|
+
and two quiet ones due sooner could take both lines from a reminder you asked to be told
|
|
225
|
+
about. Arriving now lists plain reminders first, then the nearest dates; whatever doesn't
|
|
226
|
+
fit is still named in the "more arriving" line.
|
|
227
|
+
- **A reminder whose day you missed is still said, once.** If a reminder marked plain falls on
|
|
228
|
+
a day you don't open a session (or no session that day had room for it), the next session
|
|
229
|
+
within the week after says it once, with the day it was for: "This was for Mon 12 Oct 2026:
|
|
230
|
+
pay your taxes". It is never said twice, and never after that week.
|
|
231
|
+
- **A reminder you've dealt with stops coming back.** When a session says it drew on a dated
|
|
232
|
+
memory (`drewOn`), that memory stops coming back as a footnote for that date. A reminder
|
|
233
|
+
marked plain is still said on its day.
|
|
234
|
+
- **The dashboard shows repeating dates.** The Mechanisms panel's "waiting" list now includes
|
|
235
|
+
birthdays and other repeating dates, at their next occurrence ("every May 14").
|
|
236
|
+
|
|
237
|
+
Association (#423).
|
|
238
|
+
|
|
239
|
+
- **What you drew on together is linked.** The memories one `drewOn` names together each get a
|
|
240
|
+
link to the others, as strong as two memories opened in the same reply.
|
|
241
|
+
- **A note is faintly linked to what was in mind.** A memory noted mid-conversation gets a faint
|
|
242
|
+
link to the memories recall showed on that same turn. Memories written up at a session's end
|
|
243
|
+
don't, since what was on screen then isn't what each of them was about. The link fades in about
|
|
244
|
+
a month unless using them together strengthens it, and it never pushes out a link use made.
|
|
245
|
+
- **Dreams lay faint trails.** When a dream opens, each new memory it is shown is faintly linked
|
|
246
|
+
to the older memories shown beside it. No model call; it is not one of the dream's changes, so
|
|
247
|
+
undoing a dream leaves it.
|
|
248
|
+
- **Fewer dead links.** Links to a chapter copy that regrew, or to the originals a dream merged,
|
|
249
|
+
are cleared once they've been handed on; undoing a dream's merge hands them back. Memories that
|
|
250
|
+
faded keep their links, so one that comes back keeps them too. Temporal neighbours link one
|
|
251
|
+
step apart now, not two.
|
|
252
|
+
- **Association says what it did.** The dashboard counts links laid, not rows rewritten, and a
|
|
253
|
+
second number: memories a link brought to mind. Once a store has a couple of weeks behind it,
|
|
254
|
+
Association shows amber when links were laid but none brought anything to mind that week; a new
|
|
255
|
+
store shows it waiting instead.
|
|
256
|
+
|
|
257
|
+
The wake, recall and chapters (#392, #405, #404, #409, #415).
|
|
258
|
+
|
|
259
|
+
- **"Last said here."** A new session in a folder now gets one line pointing at the last
|
|
260
|
+
exchange there: when, which session, and the first few words of the last message that
|
|
261
|
+
session got, such as `Last said here, 18:42 (session 3fa9c1d2): "ok now let's fix the reserve…" —
|
|
262
|
+
recall "last exchange"`. It comes from the most recent other session in the same folder,
|
|
263
|
+
within about a day, and never from another folder. Asking `recall` for the handle
|
|
264
|
+
`last exchange` returns both messages, the last message there and the assistant's last reply,
|
|
265
|
+
with their times, each cut at a sentence. The end-of-session ask and its answer, text the host
|
|
266
|
+
added (reminders, task notifications, subagent reports, skills, slash commands) and tool-only
|
|
267
|
+
turns are skipped; text the host adds with no mark of its own (a coordinator's message) can
|
|
268
|
+
still read as a message, so neither the line nor the handle says who sent it. It is read only
|
|
269
|
+
from what Counterparts already captured in that
|
|
270
|
+
folder, and never stored, and only in your own sessions: an observer folder, or a
|
|
271
|
+
session that is not yours, gets no line and no answer. A session that was killed after you typed and before it
|
|
272
|
+
finished replying is named by the last exchange it did finish. The line sits beside "Last
|
|
273
|
+
here" and the handoffs, and is the first of them to give way. Dated items and the page
|
|
274
|
+
always come first.
|
|
275
|
+
- **Recall shows the order of things said on the same day.** When two or more facts in one
|
|
276
|
+
answer happened on the same day and were learned on the same day, each says the time it was
|
|
277
|
+
learned (`learned 05-25 09:52`), so two updates from one day no longer read as a tie. A lone
|
|
278
|
+
result, or results on different days, look as before.
|
|
279
|
+
- **Chapters ask for the day's details.** A chapter is now asked to be a diary of what happened, in order and in detail: what was said, what was decided and why, what went wrong, with a list or a pasted text kept word for word when it matters, and without what the repo or the logs already hold. The lessons and patterns go to the nightly reflection, which now says so.
|
|
280
|
+
- **A list or table you care about is kept word for word in the memory.** When a list, a table or a
|
|
281
|
+
pasted text matters in its specifics, the assistant is now asked to keep it whole in the memory's
|
|
282
|
+
own words rather than summarize it, with what it is, whose and when in the title and first line
|
|
283
|
+
so it can be found. Asking for facts says when a memory holds one ("a list, 100 items; read whole
|
|
284
|
+
by id"). A trial, to be looked at again after a few days.
|
|
285
|
+
- **Less room spent on tools and resumes.** The memory tools' descriptions are shorter
|
|
286
|
+
(`session_end` about 21 KB to 15.5 KB as loaded, `remember` 19.6 to 16.2) and keep every
|
|
287
|
+
rule that changes a call. A session you resume the same day gets one line pointing at the
|
|
288
|
+
wake already above it, instead of a second wake of up to about 9 KB; after a compaction,
|
|
289
|
+
on a later day, after `/clear` or in a fork, the full wake comes as before.
|
|
290
|
+
|
|
3
291
|
## 0.3.17 — 2026-10-11
|
|
4
292
|
|
|
5
293
|
The plugin's sidebar shows what memory is doing in 35 columns: what came to mind for your
|
package/CONSTITUTION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The Counterparts Constitution
|
|
2
2
|
|
|
3
|
-
_Ratified by the owner 2026-08-25; last amended 2026-
|
|
3
|
+
_Ratified by the owner 2026-08-25; last amended 2026-10-11 (this file's git history is
|
|
4
4
|
the amendment log). This is the ONE page with standing authority — everything else,
|
|
5
5
|
including owner answers given during the build, is a working default, revisable without
|
|
6
6
|
ceremony when it fights this page. Changing THIS page is deliberate and rare._
|
|
@@ -12,10 +12,11 @@ ceremony when it fights this page. Changing THIS page is deliberate and rare._
|
|
|
12
12
|
transcripts; the signal is in the structure of experience — what recurred, what
|
|
13
13
|
carried feeling, what got revised, what connects. Simple rules from human memory,
|
|
14
14
|
compounding.
|
|
15
|
-
2. **Interpret
|
|
15
|
+
2. **Interpret; keep the specifics that matter.** Store what happened and what was
|
|
16
|
+
learned, in your own words; keep the specifics worth having back — the list, the
|
|
17
|
+
table, the number, the exact words — as they were, where exactness matters. Encoding
|
|
16
18
|
sits as close to the lived experience as the host allows — in author, in time, in
|
|
17
|
-
context. How interpretation happens — who, when, which seat — is a design choice
|
|
18
|
-
never doctrine.
|
|
19
|
+
context. How interpretation happens — who, when, which seat — is a design choice.
|
|
19
20
|
3. **Forgetting is part of learning.** Forget the trials, keep the lesson. Decay and
|
|
20
21
|
consolidation are features, never apologized for.
|
|
21
22
|
4. **The self is first-class.** Identity, episodes, a persistent "who am I becoming" —
|
|
@@ -35,9 +36,8 @@ ceremony when it fights this page. Changing THIS page is deliberate and rare._
|
|
|
35
36
|
7. **Memory changes like human memory.** Revision, fading, and forgetting are the
|
|
36
37
|
system working. Revisions keep their history; nothing bulk-wipes silently; backups
|
|
37
38
|
catch catastrophe. No ceremony beyond that.
|
|
38
|
-
8. **
|
|
39
|
-
|
|
40
|
-
interface.
|
|
39
|
+
8. **Memory forms as you go.** You remember what catches your attention, in the moment,
|
|
40
|
+
the way people do.
|
|
41
41
|
9. **One memory, many fidelities.** Gist governs salience and forgetting; verbatim
|
|
42
42
|
survives where exactness matters. Biology's rules without biology's limits.
|
|
43
43
|
10. **Simplicity is a feature.** One brain function per self-contained module. A
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -175,13 +175,25 @@ counterparts uninstall
|
|
|
175
175
|
bun remove -g counterparts
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
`uninstall` disconnects Claude Code
|
|
179
|
-
happens to the memory:
|
|
178
|
+
`uninstall` disconnects Claude Code, then asks whether to delete your memory too:
|
|
180
179
|
|
|
180
|
+
```
|
|
181
|
+
Also delete all memories and related data? This can't be undone. [y/N]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Above the question it lists every path that would go (the store, its snapshots, the
|
|
185
|
+
configuration, the `~/.counterparts` folder) with its size, and what it leaves alone
|
|
186
|
+
(Claude Code's own files). Enter keeps your memory. A yes asks you to type `DELETE MEMORIES`
|
|
187
|
+
before anything is deleted. It doesn't ask while a Claude Code session, the dashboard or the
|
|
188
|
+
worker has the memory open: close them and run it again.
|
|
189
|
+
|
|
190
|
+
Options:
|
|
191
|
+
|
|
192
|
+
- `--keep-memories` keeps your memory without asking.
|
|
181
193
|
- `--park` renames `~/.counterparts` aside. `counterparts install` offers to bring it back.
|
|
182
194
|
- `--delete-memories` deletes it, after asking you to type `DELETE MEMORIES`.
|
|
183
195
|
|
|
184
|
-
|
|
196
|
+
Each shows your memory's size first. Part of that can be a database log that shrinks on its
|
|
185
197
|
own; nothing is lost when it does.
|
|
186
198
|
|
|
187
199
|
To disconnect Claude Code without uninstalling, run `counterparts disconnect`.
|
package/docs/module-map.md
CHANGED
|
@@ -26,10 +26,11 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
|
|
|
26
26
|
| `sleep/` | systems consolidation | Pure math on a cycle: decay tick (active-day clock), floor-pruning (real forgetting), the core's two lanes (at most three a night), re-render of the wake briefing. Zero standing model calls. |
|
|
27
27
|
| `dream/` | sleep replay + REM | Dreaming: once a day, if the owner says yes, a background agent (the same model) replays what was lived since the last dream beside what it resembles — merges, links, replays, a pattern, a flagged contradiction, a softened feeling, a core nomination — each recorded for undo, with a dream journal kept apart from lived memory. The module holds the bookkeeping and the rules; the dreamer is the model. **Added 2026-09-26.** Since 2026-09-27 it also holds REFLECTION (`reflect.ts`), the waking self: usually right after a dream, lived, with its own record — an entry, the self page rewritten from the core, a morning share, feelings recorded later, and what a memory is about. |
|
|
28
28
|
| `fit/` | working memory's pointers | Fitting what a mechanism has into the room it has: a line for everything, the whole text for the most important, ids and a named lookup for the rest, a count of what waits. Plus `lineOf`, `derivedFrom`, parts, and the lookup ledger that measures whether receivers use the lookup. First users: the dream and the reflection. **Added 2026-09-28 (build B).** |
|
|
29
|
-
| *(`
|
|
29
|
+
| *(`reconsolidation.ts`)* | reconsolidation + interference | Two memories that disagree: flagged (a dream, today), noticed at write time (the nearest few live memories come back with a stored one), and SETTLED — `changed` (both true at their time: one strength cut, labelled earlier), `corrected` (archived, readable by id), or `open` (both kept, shown together) — by a new memory's `updates` + `how`, a `remember` settle, a dream or reflection with a plain reason, or the owner's `counterparts settle`. Every settle is on a trail (who, how, why, when) and can be undone. A file beside `revision.ts`, whose ordinary-memory arm it is; its tables are the store's (schema v10), its labels recall's (`recall/standing.ts`). **Added 2026-09-29** as `contradictions.ts`; **renamed 2026-10-11** (Group 2: noticing and updating are one process; the tables keep their names). |
|
|
30
30
|
| *(`time.ts`)* | — (a clock, not a memory) | The one module that converts: a moment (UTC ms from `store.now()`) to a person's local date or clock line, "today" in a zone, and calendar dates as said (day, month, year, range). A file, not a module; a test keeps hand-built dates out of `src/`. **Added 2026-09-25 (`docs/time.md`).** |
|
|
31
31
|
| *(`feelings-wheel.ts`)* | — (a vocabulary) | The feelings wheel as a typed list: seven cores (happy, warm, calm, curious, sad, uneasy, angry), the groups and their words, default valence and intensity on every entry, blends, aliases, and the rule that re-filed the first wheel's feelings (v11). Read by `store/` to validate the `feelings` table. **Added 2026-09-25; v2 2026-09-30.** |
|
|
32
32
|
| *(`leaving.ts`)* | — (a table) | What counts as having left: every `archived_reason` the code writes, filed `replaced` (a live row carries it — a revision, a merge, a rebuilt journal copy), `let-go` or `removed`. The `status` census and the dashboard's archive words both read it, so they agree. **Added 2026-09-30.** |
|
|
33
|
+
| *(`onboarding.ts`)* | — (getting to know someone) | The first meeting, for every install path: its state in `meta` (`not_started` only on a store `install` made; absent reads `done`), the script the `meet` tool returns, the fixed style bundles (preferences about the owner, each keeping honest pushback), the wake's offer line and marker, and the second session's one memory. A new install's dreaming `auto` is written here too. **Added 2026-10-11.** |
|
|
33
34
|
| *(observer)* | — (instrument stance) | **RESOLVED (owner, 2026-08-25): a MODE, not a module** — one predicate threaded through the core API, checked at the store seam. Spec moved to `docs/observer-mode.md`. |
|
|
34
35
|
|
|
35
36
|
**Third open question (check-in): the `remember`/`encode` boundary.** With the
|
|
@@ -41,7 +42,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
|
|
|
41
42
|
| adapter | job |
|
|
42
43
|
|---|---|
|
|
43
44
|
| `claude-code/` | Hooks: Claude Code's five events driving the host lifecycle (`lifecycle.ts`, below) — its payload translation, JSON envelope and the room it measures, transcript reader and wake-arrival check, the Stop ask's words, the first-launch question, the update and doctor notices, the dream line, and the headless nightly run (`night-run.ts`, `claude -p`, **2026-09-29**), which reads its child's transcript for the host's cut (**2026-10-09**). The launch adapter. |
|
|
44
|
-
| `mcp/` | Deliberate tools,
|
|
45
|
+
| `mcp/` | Deliberate tools, ten: remember, recall, status — plus the Stop ask's two return channels, `session_end` (memories, and the next-session write-up's door) and `chapter` (the episode's own journal, **added 2026-09-04**, because the ask named a door no adapter had built) — `scope` (this directory's setting, **2026-09-15**), `self_page` (the page the wake opens with, **2026-09-18**), `dream`, the dreamer's phases (**added 2026-09-26**), and `reflect`, the waking self's (**added 2026-09-27**), and `meet`, the first meeting (**2026-10-11**, `core/onboarding.ts`). A result's words about the host come from `hosts.ts`. For a Claude Desktop client (by its name at `initialize`, **2026-09-30**) an eleventh, `wake` — Desktop's session start, since it has no hooks — plus per-call binding to the most recent live Desktop session, the write-up ask on a tool result, and a "Start with Counterparts" prompt; a Claude Code client sees none of it. `recall` (**2026-10-03**) answers a question in the mode it names — facts (`facts.ts`, with `recall/time-ask.ts`) or meaning (`meaning.ts`) — and an address (`ids`, `handle`, `epi_…#N`) in `deliberate.ts`. |
|
|
45
46
|
| `cli/` | `counterparts` command — the full list is `COMMANDS` in `cli/commands.ts`: status, install, connect / disconnect (the host's two files), `install --host claude-desktop` (Desktop's config entry, **2026-09-30**), uninstall, start-fresh, init, owner operations (note, ask, export, backup, remove, verify, repairs, rebrief), the readings (doctor, mechanisms, log, coverage, version, help), scope, self-page, dream, core, settle, and dashboard. |
|
|
46
47
|
| `dashboard/` | The owner's window (constitution line 16): brain-view, revision stories, band/protected lists. Observer-mode by construction; minimal version ships DURING the parallel run. **Added 2026-08-25 (owner elevation).** |
|
|
47
48
|
| `sessions.ts` | Not an adapter — a leaf both may import: the live-session registry a host's hooks write (`<dataDir>/sessions/`) and its tools read, so a tool launched without a session can bind to one that is real, live and in its project. Adapters stay leaves; this is the sibling they share instead of importing each other. **Added 2026-09-04**, because this host's MCP servers are launched from a static config and cannot be told which session they serve. Since **2026-09-30** Claude Desktop's MCP server writes its own records here (its `wake`), refreshed per call, and a runner's record can list the ended sessions a launcher granted it to write up (`mayWriteUp`). |
|
package/package.json
CHANGED
|
@@ -407,6 +407,19 @@ row, saying which source answered, existed until the keys were removed — §1a.
|
|
|
407
407
|
with no room, waits a prompt. Reads only; nothing under observer or for the
|
|
408
408
|
nightly run.
|
|
409
409
|
|
|
410
|
+
**AND A RESUME TODAY IS HANDED ONE LINE, NOT A SECOND WAKE (2026-10-11, the
|
|
411
|
+
context-trims lane, lightly held).** The host replays a resumed session's
|
|
412
|
+
transcript, the first wake in it, so SessionStart with `source: "resume"` — for a
|
|
413
|
+
session whose record holds a printed wake's sentinel and started on today's date —
|
|
414
|
+
hands the clock, `RESUME_WAKE_LINE` ("the wake it was handed when it started (above)
|
|
415
|
+
still holds"), and the "Since you started" line with its once-an-hour gate waived,
|
|
416
|
+
plus the reminders and asks that ride beside any wake (`ClaudeCodeAdapter#resumesToday`,
|
|
417
|
+
`#resumeWake`). ~140–440 bytes where the wake is up to ~9 KB. No wake is composed, so
|
|
418
|
+
the delivery check still tests the expectation the first wake left, and the
|
|
419
|
+
`adapter.wake.injected` row says `resumed`. A resume on a later day, a compaction
|
|
420
|
+
(which summarizes the first wake away), `clear`, `fork`, and a session with no record
|
|
421
|
+
are handed the full wake.
|
|
422
|
+
|
|
410
423
|
19. **[M] A directory set `off` gets NO OUTPUT AND NO WRITE — because nothing is
|
|
411
424
|
constructed.** The scope registry (`adapters/scopes.ts`,
|
|
412
425
|
`<config dir>/scopes.json`, longest-prefix, added 2026-09-10 for owner asks
|
|
@@ -771,9 +784,15 @@ session launches anything.** On the first prompt of a calendar day that is due
|
|
|
771
784
|
`bin/nightly.ts` DETACHED (`night-run.ts#planNightRunner`, `spawn.ts#spawnDetached`) and
|
|
772
785
|
records the run `started`, with its watchdog. That process composes the launch prompt from
|
|
773
786
|
the store, starts `claude -p` with it on STDIN (`planNightChild`), waits under the run's own
|
|
774
|
-
watchdog (`dreaming.timeoutMs`, default `NIGHT_RUN_MS` 20 minutes) and records the end.
|
|
775
|
-
|
|
776
|
-
|
|
787
|
+
watchdog (`dreaming.timeoutMs`, default `NIGHT_RUN_MS` 20 minutes) and records the end.
|
|
788
|
+
**A whole night is two children (2026-10-11):** the page writer and the dream first
|
|
789
|
+
(`reflect` denied it; its MCP server told `COUNTERPARTS_NIGHT_CHILD=dream`, so the journal
|
|
790
|
+
hands back), then the reflection with a fresh context, on tonight's dream by id — or, when
|
|
791
|
+
no dream was journaled, on the last few days. Each has the watchdog and the turn ceiling;
|
|
792
|
+
the row carries both and lists the children (`NightRun.children`: exit, time, or why the
|
|
793
|
+
reflection's was not started — `quick-exit`, `reflected-today`, `unread`). The reflection
|
|
794
|
+
alone is one child. The outcome is read from the exits and the store, never from the
|
|
795
|
+
children's output (the host's cut, below, is read from the host's own transcript of each):
|
|
777
796
|
|
|
778
797
|
- `done`: the dream and the reflection ran (the reflection, for a reflection-alone run);
|
|
779
798
|
- `partial`: some of the run's parts ran and not all, whatever the exit, with the parts on
|
|
@@ -828,26 +847,55 @@ child's own session (`--session-id`, host-minted before 2026-10-09) is QUIET (`H
|
|
|
828
847
|
lines, plain reminders, Stop ask, write-up pointer or first-launch question. It still wakes
|
|
829
848
|
with the ordinary wake.
|
|
830
849
|
|
|
831
|
-
**[M] The
|
|
850
|
+
**[M] The catch-up runs first, and takes everything owed (2026-10-01, wake build 3; unbounded 2026-10-11 — held lightly).** A `night`
|
|
832
851
|
run (never a reflection-alone one) writes up owed stretches, in ANY directory, before it
|
|
833
852
|
composes its launch prompt (`night-catch-up.ts#runCatchUp`): every session that owes a
|
|
834
|
-
write-up a person's conversation left (`sessions.ts#pointable`), oldest stretch first,
|
|
835
|
-
|
|
836
|
-
the first part always)
|
|
853
|
+
write-up a person's conversation left (`sessions.ts#pointable`), oldest stretch first, in
|
|
854
|
+
BATCHES — each a fresh child, so no context grows with the morning — of at most
|
|
855
|
+
`NIGHT_WRITE_UP_BYTES` (192 KB, whole parts; the first part always) and
|
|
856
|
+
`NIGHT_WRITE_UP_BATCH_PARTS` (16). There is no session bound. The run stops when nothing is
|
|
857
|
+
owed, when a child ends short, at the sanity ceiling — `NIGHT_WRITE_UP_PARTS` for the night
|
|
858
|
+
(100 parts, about 3× the measured nightly baseline in new-work tokens, so a heavy day owed in
|
|
859
|
+
full, about 200 parts, takes two nights), `CATCH_UP_COMMAND_PARTS` for the command (400, about
|
|
860
|
+
11×; Mike, 2026-10-11, lightly held) — or before a child could outlast `NIGHT_WRITE_UP_TOTAL_MS` (an hour). Each batch's
|
|
861
|
+
runner is a session id of its own, `writeup-<run>` then `writeup-<run>-2`, …: the
|
|
837
862
|
launcher writes the grant on the runner's record (`grantWriteUps`) and claims every subject
|
|
838
|
-
(`WriteUpProgress.claim`, with `upTo` the last part allowed
|
|
863
|
+
(`WriteUpProgress.claim`, with `upTo` the last part allowed that batch) before a SECOND
|
|
839
864
|
`claude -p` starts, pinned to that runner, locked down like the first but with
|
|
840
|
-
`--allowedTools` exactly `mcp__counterparts__session_end`, `NIGHT_WRITE_UP_MAX_TURNS` (
|
|
865
|
+
`--allowedTools` exactly `mcp__counterparts__session_end`, `NIGHT_WRITE_UP_MAX_TURNS` (48)
|
|
841
866
|
and its own watchdog `NIGHT_WRITE_UP_MS` (10 minutes). When it ends, whatever became of it,
|
|
842
867
|
the claims are let go, the grant withdrawn and the runner's record ended; one durable row
|
|
843
|
-
(`adapter.night.writeup`: granted, written, parts, left owed
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
868
|
+
for the whole run (`adapter.night.writeup`: granted, written, parts, left owed AND the parts
|
|
869
|
+
they still owe, over the ceiling, busy elsewhere, batches, what stopped it, state) and a
|
|
870
|
+
process-log line record it, and doctor's Nightly run and Catch-up lines read it through one
|
|
871
|
+
renderer (`catchUpWords`). Nothing owed: no child, no row. The hook's `started` row carries
|
|
872
|
+
the catch-up's whole watchdog from the start (`nightRowTimeoutMs`), so a long catch-up is
|
|
873
|
+
not read as lost. A clean exit that stopped short of
|
|
847
874
|
its allowance — some granted session neither written up nor brought to its `upTo` part —
|
|
848
|
-
is recorded `partial`, not `done` (a usage limit exits 0 too; its output is not read)
|
|
849
|
-
|
|
850
|
-
next run's start (`endStaleRunners`).
|
|
875
|
+
is recorded `partial`, not `done` (a usage limit exits 0 too; its output is not read), and
|
|
876
|
+
starts no further batch. A runner record a killed process left open is ended at the
|
|
877
|
+
next run's start (`endStaleRunners`). `counterparts catch-up` runs the same launcher in the
|
|
878
|
+
foreground (`cli/catch-up.ts`, run ids `cup_…`), its runners filed under the store's own
|
|
879
|
+
directory. Under dreaming `auto` the SessionStart write-up pointer is retired
|
|
880
|
+
(`lifecycle.ts#writeUpPointerRetired`); under `ask` or `off` no night runs and the pointer
|
|
881
|
+
stays.
|
|
882
|
+
|
|
883
|
+
**[M] The night also starts when write-ups are owed (2026-10-11).** Under `auto`, a prompt
|
|
884
|
+
whose dream is not due for `too-little-new` or `first-day` — the day unclaimed, no run under
|
|
885
|
+
way (`Dreams#catchUpOffer`) — starts the night anyway when sessions from an earlier calendar
|
|
886
|
+
day owe a write-up (`night-catch-up.ts#owedBefore`: the catch-up's own `catchUpOwing`, whose
|
|
887
|
+
last activity was before today; a real zero is remembered for the rest of the day,
|
|
888
|
+
`NOTHING_OWED_BEFORE_KEY`, so the read is once a day, not per prompt). It claims the day through the same `dream_asks` latch, so
|
|
889
|
+
racing sessions start one run; it says nothing to the model or the terminal and hands
|
|
890
|
+
nothing back. `NIGHT_KIND_ENV` carries `catch-up:<reason>`; the run does its catch-up, then
|
|
891
|
+
records `done` with the dream's and the reflection's children `skipped: <reason>` and
|
|
892
|
+
refreshes the wake — or the catch-up's own `could-not-start` / `timed-out` / `failed`, with
|
|
893
|
+
`detail: catch-up`. A watched or unwatched session may start it (no line is held); a night
|
|
894
|
+
child's prompt and an observer never do; `ask` and `off` never do.
|
|
895
|
+
|
|
896
|
+
**[M] A store that will not open once the child ended is said (2026-10-11).** The run is
|
|
897
|
+
recorded `failed`, reason `unread`, with the store's code (`SCHEMA_AHEAD` when an install
|
|
898
|
+
migrated the store mid-run) — never `nothing-ran` from the exit alone.
|
|
851
899
|
|
|
852
900
|
**[M] The person sees it, and a run that cannot do its job falls back to asking.** The prompt
|
|
853
901
|
hook's `systemMessage` carries "dreaming in the background (a few minutes). Say "no dreams"
|
|
@@ -975,7 +1023,7 @@ the sweep no interpreter; its gate row says `not-opted-in` and `runner.done` say
|
|
|
975
1023
|
next-session`. A crashed session is pointed at like any other. An old `crashWriteUp` value
|
|
976
1024
|
is ignored and named in `retired`.
|
|
977
1025
|
|
|
978
|
-
**[M] Doctor: `
|
|
1026
|
+
**[M] Doctor: `Catch-up` (was `Write-ups`, and before that `Crash write-up`; same key), and the `Sweep` line.** Since 2026-09-30 the line reads the coverage ledger — yesterday's state, amber on a stretch owed from yesterday or earlier, the week's lapses (`core/coverage/NOTES.md` §8). Before it, `Crash write-up`: `next session`
|
|
979
1027
|
green; amber when a session is finished in one project and waiting on words it left in
|
|
980
1028
|
another, naming that project (re-review m-C); amber when the newest pointer outcome is a
|
|
981
1029
|
DEFERRAL and sessions are waiting — saying the wake was too full, by how many bytes, and to lower
|
|
@@ -2475,3 +2475,38 @@ Plain reminders were checked and nothing changed here: the line is said beside t
|
|
|
2475
2475
|
carries it, and waits for the first prompt when there is no room — never dropped. What rode
|
|
2476
2476
|
inside the wake was the same memory's Arriving line, which now leads the lane and outranks
|
|
2477
2477
|
the self page's borrowing.
|
|
2478
|
+
|
|
2479
|
+
## 2026-10-11 — the catch-up takes everything owed; two weak spots read off the live log
|
|
2480
|
+
|
|
2481
|
+
**"Wrote up 0 of 1 session" was the bound and the words, not a lost write-up.** The night of
|
|
2482
|
+
10-11 granted one session (e92c5180, 17 parts). `planCatchUp` fit whole ~17–22 KB parts under
|
|
2483
|
+
the 96 KB bound (`upTo` 5), the child wrote parts 1–5, and the door refused part 6
|
|
2484
|
+
`allowance-spent`, as designed. `measure()` counts a session `written` only once its last part
|
|
2485
|
+
is, so the row said `written: 0, parts: 5`, and doctor's Write-ups line printed "wrote up 0 of 1"
|
|
2486
|
+
without the parts. The next run did 6–9 the same way. Now: batches until nothing is owed, the
|
|
2487
|
+
row carries `partsLeft`, and one renderer (`catchUpWords`) is used everywhere.
|
|
2488
|
+
|
|
2489
|
+
**The stray `;exit` could not have killed the night run, and did not.** The hook starts
|
|
2490
|
+
`bin/nightly.ts` with `spawnDetached` (`detached: true`, `stdio: "ignore"`, `unref`), which is
|
|
2491
|
+
`setsid()`: measured under bun on macOS, the child is a session leader (`ps -j`: own PGID, STAT
|
|
2492
|
+
`Ss`, no terminal), so a closing terminal's SIGHUP and a kill of the launching session's group
|
|
2493
|
+
do not reach it, and once the hook exits it belongs to launchd. The `claude -p` children are
|
|
2494
|
+
`detached` too. The log agrees: `nrn_88bd91bd0ac9` wrote its own `process.end` 150 s in, code 0
|
|
2495
|
+
— a killed process writes nothing. Its `nothing-ran` is what `runNight` says for a child that
|
|
2496
|
+
exited 0 having begun no dream, reflection or page-writer row. That fits Mike's 0.3.17-dev
|
|
2497
|
+
install at 13:25:54: its migration put the store at a version this build is behind, after which
|
|
2498
|
+
the child's MCP server (`schemaGate`, read on every call) refuses everything `schema-ahead`, and
|
|
2499
|
+
this process's own reads after the child throw `SCHEMA_AHEAD` — so `began` stayed false whatever
|
|
2500
|
+
the child did before 13:25:54. Two lines of the log say that is what happened: the run ended
|
|
2501
|
+
with no `dream.night` row from the nightly process (08:16's run has one just before its
|
|
2502
|
+
`process.end`), so its record could not be written; and at 14:16 the next prompt started a
|
|
2503
|
+
headless run instead of asking, which the gate does for a lost `started` row only when a dream
|
|
2504
|
+
or reflection began after it started (`Dreams#fellBack`). So the first child had begun its
|
|
2505
|
+
dream before the migration, and `nothing-ran` was wrong. Read from the log and the code; the
|
|
2506
|
+
store's dream rows for 10-11 would confirm it. Fixed here: a store that will not open after the child is recorded `failed`,
|
|
2507
|
+
reason `unread`, with its code, not `nothing-ran` (`night-run.ts`).
|
|
2508
|
+
|
|
2509
|
+
**The hidden constraint of an unbounded catch-up.** The hook's `started` row said 20 minutes;
|
|
2510
|
+
`nightRunLost` reads a row past that plus 10 minutes' grace as lost, and the next prompt would
|
|
2511
|
+
have asked to dream while a long catch-up ran. The row now carries the catch-up's hour from the
|
|
2512
|
+
start (`nightRowTimeoutMs`).
|
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
firstRunLine,
|
|
71
71
|
firstRunNoticePath,
|
|
72
72
|
hookGate,
|
|
73
|
+
installRoute,
|
|
73
74
|
pluginOrigin,
|
|
74
75
|
runningAsPlugin,
|
|
75
76
|
takeFirstRunNotice,
|
|
@@ -520,6 +521,8 @@ export function toHookInput(
|
|
|
520
521
|
// nothing (`hooks.ts#askAtStop`).
|
|
521
522
|
...(payload["stop_hook_active"] === true ? { reFired: true } : {}),
|
|
522
523
|
...(typeof payload["prompt"] === "string" ? { prompt: payload["prompt"] } : {}),
|
|
524
|
+
// Why a SessionStart fired (2026-10-11): a resume is handed a short wake.
|
|
525
|
+
...(typeof payload["source"] === "string" && payload["source"].length > 0 ? { source: payload["source"] } : {}),
|
|
523
526
|
// The headless nightly run's child (`night-run.ts` sets this, 2026-09-29):
|
|
524
527
|
// a windowless session our hooks keep QUIET — no capture, no asks.
|
|
525
528
|
...(((opts.env ?? process.env)[NIGHT_RUN_ENV] ?? "").trim().length > 0 ? { nightRun: true } : {}),
|
|
@@ -932,6 +935,8 @@ async function runHook(
|
|
|
932
935
|
// How the first-launch question's console line must read here: the
|
|
933
936
|
// plugin's launcher under the plugin, `--config` for another registry.
|
|
934
937
|
scopeCommand: hookScopeContext(choice.path),
|
|
938
|
+
// How this copy came, for doctor's fix lines in the session notice.
|
|
939
|
+
install: installRoute(process.env),
|
|
935
940
|
// The verdict travels IN: it is a fact about this process's startup, decided before anything opened, and
|
|
936
941
|
// the adapter's jobs with it are to record it and — when it is `unset` — to
|
|
937
942
|
// ask the question once (G41).
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { implicitConfigRefusal, namedConfigRefusal, namedUnreadableRefusal } from "../../config-path.js";
|
|
15
15
|
import { openLog } from "../../log/index.js";
|
|
16
|
+
import { nightChildrenWords } from "../../../core/dream/index.js";
|
|
16
17
|
|
|
17
18
|
import { NIGHT_KIND_ENV, NIGHT_RUN_ENV, openNightCounterpart, readKind, runNight } from "../night-run.js";
|
|
18
19
|
import { isEntryPoint, pinnedScope, pinnedSession, runnerConfig, runnerConfigChoice } from "./runner.js";
|
|
@@ -67,6 +68,7 @@ async function main(): Promise<void> {
|
|
|
67
68
|
detail: out.detail,
|
|
68
69
|
code: out.code,
|
|
69
70
|
parts: (out.parts ?? []).join(","),
|
|
71
|
+
children: nightChildrenWords(out.children ?? []),
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
|
|
@@ -393,6 +393,8 @@ export async function runOnce(input: {
|
|
|
393
393
|
date: today,
|
|
394
394
|
at: today,
|
|
395
395
|
sweep: { skipped: "not-opted-in" },
|
|
396
|
+
// Whose boundary this is, for the `associate.flush` rows (2026-10-11).
|
|
397
|
+
...(input.session === undefined ? {} : { session: input.session }),
|
|
396
398
|
});
|
|
397
399
|
const swept = report.sweeps.reduce((n, s) => n + s.spansSwept, 0);
|
|
398
400
|
const minted = report.sweeps.reduce((n, s) => n + s.proposals, 0);
|