counterparts 0.3.45 → 0.3.46
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 +85 -0
- package/CONSTITUTION.md +6 -4
- package/README.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/docs/manual.md +123 -0
- package/docs/module-map.md +2 -1
- package/package.json +2 -1
- package/src/adapters/claude-code/NOTES.md +2 -1
- package/src/adapters/claude-code/doctor.ts +21 -7
- package/src/adapters/claude-code/night-catch-up.ts +2 -0
- package/src/adapters/claude-code/transcript.ts +60 -6
- package/src/adapters/cli/commands-install.ts +9 -4
- package/src/adapters/cli/commands-readings.ts +10 -2
- package/src/adapters/cli/commands.ts +3 -2
- package/src/adapters/cli/help.ts +2 -1
- package/src/adapters/cli/uninstall.ts +21 -4
- package/src/adapters/dashboard/web/pages/memories/index.js +4 -2
- package/src/adapters/dashboard/web/views/memories.ts +8 -2
- package/src/adapters/dashboard/web/views/overview.ts +14 -3
- package/src/adapters/dashboard/web/views/today.ts +3 -1
- package/src/adapters/hosts.ts +26 -4
- package/src/adapters/lifecycle.ts +9 -2
- package/src/adapters/mcp/NOTES.md +43 -0
- package/src/adapters/mcp/facts.ts +23 -6
- package/src/adapters/mcp/manual.ts +145 -0
- package/src/adapters/mcp/meaning.ts +7 -2
- package/src/adapters/mcp/server-self-tools.ts +7 -2
- package/src/adapters/mcp/server-words.ts +3 -3
- package/src/adapters/mcp/server.ts +71 -15
- package/src/adapters/mcp/tools.ts +75 -13
- package/src/adapters/mcp/write-up.ts +3 -1
- package/src/adapters/plugin-run.sh +32 -8
- package/src/adapters/remote/http.ts +6 -1
- package/src/adapters/sessions.ts +14 -0
- package/src/adapters/update-check.ts +1 -1
- package/src/core/counterpart-wake-news.ts +230 -0
- package/src/core/counterpart-wake-shape.ts +95 -17
- package/src/core/counterpart.ts +21 -1
- package/src/core/dream/NOTES.md +9 -0
- package/src/core/dream/index.ts +4 -0
- package/src/core/dream/reflect.ts +4 -2
- package/src/core/onboarding.ts +43 -13
- package/src/core/recall/CONTRACT.md +1 -1
- package/src/core/recall/INTERFACE-GAPS.md +1 -1
- package/src/core/recall/NOTES.md +110 -0
- package/src/core/recall/activate.ts +28 -5
- package/src/core/recall/gate.ts +63 -12
- package/src/core/recall/habituation.ts +15 -2
- package/src/core/recall/index.ts +10 -2
- package/src/core/recall/session.ts +9 -3
- package/src/core/recall/tunables.ts +8 -2
- package/src/core/remember/CONTRACT.md +5 -0
- package/src/core/remember/spans.ts +12 -1
- package/src/core/schemas/index.ts +2 -2
- package/src/core/self/CONTRACT.md +1 -1
- package/src/core/self/NOTES.md +54 -0
- package/src/core/self/briefing-delivery.ts +16 -4
- package/src/core/self/identity.ts +4 -0
- package/src/core/self/index.ts +4 -1
- package/src/core/self/journal-file.ts +2 -1
- package/src/core/self/tunables.ts +34 -2
- package/src/core/self/writer.ts +9 -2
- package/src/core/sleep/CONTRACT.md +4 -2
- package/src/core/sleep/consolidate.ts +8 -0
- package/src/core/sleep/cycle.ts +20 -0
- package/src/core/sleep/types.ts +7 -0
- package/src/core/store/CONTRACT.md +1 -1
- package/src/core/store/NOTES.md +9 -1
- package/src/core/store/index.ts +27 -4
- package/src/core/store/reads-memories.ts +44 -1
- package/src/core/store/shapes.ts +10 -0
- package/src/core/store/tag-reads.ts +3 -0
- package/src/core/told.ts +249 -0
- package/src/core/types.ts +5 -0
- package/tools/install-loop/run.sh +21 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.46 — 2026-11-03
|
|
4
|
+
|
|
5
|
+
**New stores get starter memories and the new wake layout; existing stores barely change.** A store `counterparts install` (or `start-fresh`, or hosted signup) creates begins with eleven starter notes, "told, not lived", counted apart from your own memories, and its sessions start in the wake's shape, which now opens with what happened since the last night, steps an old handoff down to one line, drops empty sections and settles dated things that already happened. A store that already exists gets no starter notes and keeps its wake-shape setting; where the shape is on (`counterparts wake-shape on`), its wake gains those same changes, and on any store a reminder that a newer done memory says already happened is no longer told as due. Also: write-ups leave out permission prompts and refused tool calls, the first meeting asks easier questions, a manual ships with every install (`recall` the handle `manual`), a memory called noise twice stays quieter for 14 lived days rather than 7, and the plugin downloads its program once. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.45 needs no store restore: `counterparts disconnect`, 0.3.45's install, then `counterparts connect`.
|
|
6
|
+
|
|
7
|
+
- **A memory two sessions called noise now stays quieter for two weeks, not one.** Rated 0 in two sessions within 14 lived
|
|
8
|
+
days (it was 7), it faces the same raised bar until those ratings age out or a later 2 or 3 clears it. A turn that
|
|
9
|
+
reaches it strongly still shows it. Right after installing, the longer window starts counting at the next rating.
|
|
10
|
+
`recall.HABITUATION_WINDOW_DAYS` back to 7 undoes it.
|
|
11
|
+
- **The plugin downloads its program once on Ubuntu 26.04.** On a computer with no Bun or Node,
|
|
12
|
+
the hook and the memory server starting together could both download the program (about
|
|
13
|
+
56 MB), because that Ubuntu's `mkdir` can tell two processes they each made the same
|
|
14
|
+
directory. The launcher now takes its lock with the shell itself. The same double download
|
|
15
|
+
could follow a download that died, on any system, and now doesn't. Nothing unchecked ever
|
|
16
|
+
ran: each download was checked and moved into place in one step. And on a Mac whose `sh`
|
|
17
|
+
is zsh, a first start now downloads the program at all: it used to say "getting ready"
|
|
18
|
+
and never start.
|
|
19
|
+
- **Hosted: Litestream's own log lines reach the server's log.** A backup that fails to sync (a refused upload, an
|
|
20
|
+
R2 permission error, a rejected encryption key) now says so in the log, and a redeploy's log shows Litestream's
|
|
21
|
+
final sync finishing. Before, those lines were dropped and only the process being up was visible.
|
|
22
|
+
- **Hosted: the restore drill is in the repository, and the KEK check is by fingerprint.** `hosted/drill/drill.sh`
|
|
23
|
+
restores production's deployed image from a drill bucket on R2 with a throwaway key, and writes its results outside
|
|
24
|
+
the repository. The offline copies of the key are now checked by a short fingerprint against Railway's, so the real
|
|
25
|
+
key no longer goes into a drill. The runbook says what to do when a restore refuses a mistyped key.
|
|
26
|
+
- **Recall's per-conversation bookkeeping no longer piles up.** The record of what each
|
|
27
|
+
conversation was already shown (so nothing repeats) is now cleared once a conversation
|
|
28
|
+
has gone unused for the retention window, 90 days of use by default, in the nightly run
|
|
29
|
+
beside the old-version cleanup. A conversation used inside the window keeps all of it.
|
|
30
|
+
- **A new store starts with eleven starter memories, "told, not lived".** `counterparts install` (and
|
|
31
|
+
`start-fresh`) and hosted signup plant a short set about how this memory works and how to use it well, in each
|
|
32
|
+
surface's own words, marked with the source `told` and the set's version in the store's meta. They start weak,
|
|
33
|
+
fade unless used, and can be corrected or removed like any memory. Recall fills its footnotes with every lived
|
|
34
|
+
memory first and never shows a starter one loud; the deliberate `recall` ranks one below a lived match of
|
|
35
|
+
comparable score. The night, the wake, the core, beliefs and cards never read them. An upgraded store never gets
|
|
36
|
+
them. No store-format change.
|
|
37
|
+
`status`, doctor and the dashboard count them apart ("0 memories · 11 starter notes"), and `uninstall` says how
|
|
38
|
+
many of the memories it counts are starter notes. `init` still makes a bare store; the harness `week` starts with
|
|
39
|
+
the set unless given `--no-told`.
|
|
40
|
+
- **Nightly write-ups leave out permission prompts and refused tool calls.** When you decline a
|
|
41
|
+
permission prompt, the host's "interrupted for tool use" line no longer reaches the write-up
|
|
42
|
+
of that conversation, and whoever writes a session up (the nightly catch-up, or the next
|
|
43
|
+
session pointed at it) is told that permission prompts, refused tool calls and the
|
|
44
|
+
memory system's own notices aren't things that happened between you, unless you talked
|
|
45
|
+
about them. A night had saved "declined permission to mark a note delivered" as a memory.
|
|
46
|
+
- **The first meeting asks four questions now, and easier ones.** After your week, it asks "What are you working
|
|
47
|
+
on right now?", then what you've been into lately that has nothing to do with work, then a good Saturday. "What do
|
|
48
|
+
you love most about what you do?" is gone, and so is "What got you started building things?". A meeting already
|
|
49
|
+
under way when you update finishes as it started: the answers it gives under the old questions are still kept.
|
|
50
|
+
- **Starter memories no longer push out a lived memory.** On a new store, a seed that shared a word with the question
|
|
51
|
+
set the deliberate `recall`'s "weak match" bar, and a lived memory found by meaning alone fell under it ("which
|
|
52
|
+
coffee maker do we own?" lost the note about the espresso machine). Facts mode now lists every lived match before
|
|
53
|
+
any starter one, and judges a lived match only against lived ones. The turn's footnotes read their floors from the
|
|
54
|
+
lived memories too, so eleven starter notes no longer double the bar a young store's memories must clear (a
|
|
55
|
+
starter memory still faces the stricter whole-store bar, so a loosely matched seed is not footnoted on a turn nothing lived answers). The
|
|
56
|
+
single-binary check now runs on every pull request that touches `src/`.
|
|
57
|
+
- **The counterpart has a manual.** `docs/manual.md` says how Counterparts works and how to
|
|
58
|
+
use it: the everyday phrases, folders, nights and dreams, seeing and changing what's kept,
|
|
59
|
+
export, backup and uninstall, checking health, and how hosted differs. It ships with every
|
|
60
|
+
install, so it matches the version you run and works offline. Your counterpart opens it
|
|
61
|
+
with `recall`'s handle `manual` (a list of sections), and `manual <section>` opens one.
|
|
62
|
+
- **The wake knows yesterday's news.** In the wake's shape (on for new installs, below), a session start opens, after
|
|
63
|
+
the page, with "Since the last night:": up to three of the strongest things about you, or about the two of you, saved since the last
|
|
64
|
+
night ran, from any folder that's on. Something said in another folder this morning (a launch, good news from the vet)
|
|
65
|
+
no longer waits a night to reach the next session. Nothing new, no section.
|
|
66
|
+
- **An old handoff stops leading the wake** (the wake's shape, as the next one). Half a day after a folder's last handoff, once another session has worked
|
|
67
|
+
there and left something, the handoff shows as one line with its age and how many sessions came since, after what they
|
|
68
|
+
did, instead of whole and first for days. A quick check-in that saved nothing, or a session still open beside yours,
|
|
69
|
+
leaves it whole.
|
|
70
|
+
- **No empty sections in the wake.** "Nothing open.", "Nothing dated." and "Open here now: no other session." are gone,
|
|
71
|
+
with their headings: a section with nothing in it isn't printed.
|
|
72
|
+
- **Something that already happened stops being "due today".** When a newer memory marked done says a dated thing
|
|
73
|
+
happened (the shop launched a day early), its reminder isn't told and it leaves Coming up. Only on or after its day,
|
|
74
|
+
and only by a memory from the day before it or later, so last week's vet visit never settles this week's.
|
|
75
|
+
- **A new install starts with the wake's shape on.** The top-down wake (where this folder stands, elsewhere, coming up,
|
|
76
|
+
still open, yesterday, last night, each said once) is now how a new store's sessions start. A store that already existed
|
|
77
|
+
keeps its setting (`counterparts wake-shape on|off|default`).
|
|
78
|
+
- **Help no longer says export is encrypted by default.** It never was: export refuses until you pass
|
|
79
|
+
`--passphrase` (encrypted) or `--plaintext` (said on purpose). `counterparts --help`, `counterparts export --help`,
|
|
80
|
+
the README and the quickstart now say so.
|
|
81
|
+
- **On claude.ai, the `scope` tool speaks of one memory, not folders.** Its description, its read and the refusal
|
|
82
|
+
while memory is off or paused say one account is one memory, to pause, turn off and turn back on; they no longer
|
|
83
|
+
show the server's file path or a `counterparts scope` command nobody on claude.ai can run. Claude Code's and
|
|
84
|
+
Claude Desktop's words are unchanged.
|
|
85
|
+
- **A new store's starter note on using memory well points to the manual** (`recall` the handle "manual"). Stores
|
|
86
|
+
that already exist keep their notes as they are.
|
|
87
|
+
|
|
3
88
|
## 0.3.45 — 2026-11-01
|
|
4
89
|
|
|
5
90
|
Nearly nothing you'd notice changes. **One thing happens at once: the first pass after upgrading deletes the raw copies of notes saved with no session or with `counterparts note` that are already past their age (3 days once the memory has landed, 14 whatever). Memories aren't touched, and raw text deleted this way doesn't come back, even if you go back to 0.3.44.** Learned cue words skip path fragments and acknowledgements. A memory that couldn't be saved can be sent again. A laptop's sleep no longer stops the night's work, and a headless session leaves the night to the next one a person starts. No store-format change (store v15, cache v7), no migration. Nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.44 needs no store restore: `counterparts disconnect`, 0.3.44's install, then `counterparts connect`.
|
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-11-02 (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, open to discussion
|
|
6
6
|
at any time and revisable without ceremony. Changing THIS page is deliberate and rare._
|
|
@@ -30,9 +30,11 @@ at any time and revisable without ceremony. Changing THIS page is deliberate and
|
|
|
30
30
|
|
|
31
31
|
**Properties — what must stay true**
|
|
32
32
|
|
|
33
|
-
6. **The owner owns the data.** Local
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
6. **The owner owns the data.** Local is always available, and the owner can always take
|
|
34
|
+
their memory home. Memories are written as prose and kept in open, portable formats (a
|
|
35
|
+
database file or readable files), and the owner can read their own memories wherever
|
|
36
|
+
they live. Data leaves the machine only by the owner's explicit choice, never
|
|
37
|
+
silently. _(Amended 2026-11-02.)_
|
|
36
38
|
7. **Memory changes like human memory.** Revision, fading, and forgetting are the
|
|
37
39
|
system working. Revisions keep their history; nothing bulk-wipes silently; backups
|
|
38
40
|
catch catastrophe. No ceremony beyond that.
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Once installed it runs on its own. A few commands are worth knowing:
|
|
|
80
80
|
counterparts dashboard # look at the memory in your browser
|
|
81
81
|
counterparts ask "..." # ask the memory a question
|
|
82
82
|
counterparts scope . --off # don't remember this directory
|
|
83
|
-
counterparts export # a copy of everything
|
|
83
|
+
counterparts export # a copy of everything; --passphrase encrypts it
|
|
84
84
|
counterparts --help # the rest
|
|
85
85
|
```
|
|
86
86
|
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -92,7 +92,7 @@ counterparts ask "..." # ask the memory a question
|
|
|
92
92
|
counterparts status # how much it holds
|
|
93
93
|
counterparts self-page # who it thinks it is, and who you are
|
|
94
94
|
counterparts remove # delete one memory for good
|
|
95
|
-
counterparts export # a copy of everything
|
|
95
|
+
counterparts export # a copy of everything; --passphrase encrypts it
|
|
96
96
|
counterparts --help # everything else
|
|
97
97
|
```
|
|
98
98
|
|
package/docs/manual.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# The Counterparts manual
|
|
2
|
+
|
|
3
|
+
How this memory works and how to use it: the phrases, the switches, the commands, and what to do when something seems off. It is written for the counterpart first (that's you, if you opened it through `recall`), and a person can read it too.
|
|
4
|
+
|
|
5
|
+
Some things differ by where the memory lives. **[local]** means a memory on the person's own computer, used from Claude Code or Claude Desktop. **[hosted]** means Counterparts Online, used from claude.ai, or from Claude Code when there's no local install. Where neither mark appears, it holds for both. "Since 0.3.x" says when something arrived, where that matters. This file ships with the code, so it describes the version that's installed.
|
|
6
|
+
|
|
7
|
+
## What Counterparts is
|
|
8
|
+
|
|
9
|
+
Counterparts is a memory for an AI: the counterpart keeps what something meant and how it went, in its own words, not a transcript.
|
|
10
|
+
|
|
11
|
+
- It writes its own memories: in the moment with the `remember` tool, and at the end of a stretch of work with `session_end` and `chapter`.
|
|
12
|
+
- What isn't used fades, on purpose, so what matters stays easy to find. A faded memory can still turn up when it's searched for, until it is let go.
|
|
13
|
+
- Each session opens with a wake: who I am (the self page), where the work stands, what's coming up and still open, how yesterday went.
|
|
14
|
+
- In Claude Code, related memories come up as footnotes as the conversation goes. `recall` is the deliberate look, everywhere.
|
|
15
|
+
- It's theirs to see, export and delete. [local] It is one SQLite file on their computer, and Counterparts sends nothing about them anywhere (the details are on counterparts.ai/privacy). [hosted] It lives on Counterparts' server, one store per account; backups that leave the server are encrypted with a key for their account.
|
|
16
|
+
- A new memory may start with a few starter notes, titled "Told: …". They were given, not lived: they start weak, come after lived memories that match as well, are never part of the self, and can be corrected or let go like any memory.
|
|
17
|
+
|
|
18
|
+
## Everyday phrases
|
|
19
|
+
|
|
20
|
+
These are things a person can say. Offer one when it fits; don't list them all.
|
|
21
|
+
|
|
22
|
+
- "Where did we leave off?" brings back the last session here. A short facts question like that reads that session first.
|
|
23
|
+
- "Remember this" saves it now, with the `remember` tool.
|
|
24
|
+
- "How did X go?" or "what do you remember about Y?" asks the memory, not just this chat: `recall` with `mode: "facts"` for what happened, `mode: "meaning"` for how it went and what it adds up to.
|
|
25
|
+
- "Remind me Thursday to …" is saved with the date in `eventDate` and `remind: "plain"`, so it is said plainly on that day, or, if that day is missed, the next time you talk within the week after. Without `remind: "plain"`, a dated memory is quiet: in Claude Code it may come up as a footnote around the date.
|
|
26
|
+
- "That's wrong" corrects a memory: write the right version with `updates` naming the old one and `how: "corrected"`. The wrong one leaves recall and stays readable by its id.
|
|
27
|
+
- "What's still open?" lists the threads the wake carries: the handle `still open`.
|
|
28
|
+
- "What's coming up?" lists what's due: the handle `coming up`.
|
|
29
|
+
- "Not here", "just read" or "pause this" sets the scope (see Folders).
|
|
30
|
+
- "No dreams", or "dream", sets or starts the night (see Nights and dreams).
|
|
31
|
+
- "Let's meet" starts the first meeting, if it hasn't happened: the `meet` tool.
|
|
32
|
+
|
|
33
|
+
## Folders
|
|
34
|
+
|
|
35
|
+
[local] Memory is set per folder: on, observer (reads only), off, or paused, and the person can ask which this folder is.
|
|
36
|
+
|
|
37
|
+
- The `scope` tool reads the setting for this folder with no `mode`, and sets it with `mode` `on`, `observer`, `off`, `pause` or `resume`. Set it when the person says so, not on a guess.
|
|
38
|
+
- Off: the hooks write nothing and read nothing here, and every tool but `scope` refuses. Paused is off until they say to resume; it has no timer. `resume` goes back to what it was before, or on.
|
|
39
|
+
- A setting covers the folder and everything under it; the nearest setting wins. Nothing set means on.
|
|
40
|
+
- From a terminal: `counterparts scope .` shows this folder's setting, and `counterparts scope . --off` (or `--pause`, `--resume`, `--on`) sets it. `counterparts scope --list` prints every setting.
|
|
41
|
+
- The `scope` tool's `updates` turns the update reminder off when they say stop reminding them about updates.
|
|
42
|
+
|
|
43
|
+
[hosted] One account is one memory, with no folders. The `scope` tool pauses it or turns it off, for every claude.ai chat, and back on. Paused lasts until they say to resume (`mode: "resume"`).
|
|
44
|
+
|
|
45
|
+
## Remembering well
|
|
46
|
+
|
|
47
|
+
These make the memory work better.
|
|
48
|
+
|
|
49
|
+
- Save while it's fresh: when something matters, `remember` it then, one idea per call, in your own words. Keep the exact words when the words matter.
|
|
50
|
+
- A date to come back to goes in `eventDate`, not just the text, or it never comes back. Four shapes: a day "2026-10-15", a month "2026-10", a range "2026-10-20..2026-10-31", or a year. Add `recurring` for a date that repeats.
|
|
51
|
+
- Something open: `unresolved: true`, with `settlesWhen` naming what would settle it. It stays on the still-open list, and the night can close it once a memory shows it happened.
|
|
52
|
+
- When a memory turns out wrong: `updates` with its id and `how: "corrected"`. When it was true then and has changed: `how: "changed"` (the default), and the old one is shown as earlier. A real disagreement: `how: "open"`, and both stay.
|
|
53
|
+
- Before saying "I don't remember", ask `recall` once, and try other words before saying it's gone.
|
|
54
|
+
- [local] At the end of a session in Claude Code, the Stop ask asks for the write-up: memories through `session_end`, and the session's own account through `chapter`. Write it honestly, including what didn't go well.
|
|
55
|
+
- [hosted] Nothing tells this memory when a chat ends, so `remember` as things come up, and write a `chapter` when the chat is wrapping up.
|
|
56
|
+
|
|
57
|
+
## Nights and dreams
|
|
58
|
+
|
|
59
|
+
After a day of use, a night pass sorts that day: day's end, then a dream, then a reflection.
|
|
60
|
+
|
|
61
|
+
- Day's end writes the day's summary and brings the self page's day-to-day sections up to date. The dream replays what was lived beside what it resembles: it can merge near-copies, link what belongs together, note a pattern, flag a contradiction. The reflection is awake: it can rewrite the page's Core from the memories it cites and leave a short morning share.
|
|
62
|
+
- A dream is kept in its own journal, marked as a dream, never as something that happened. Tell it as a dream.
|
|
63
|
+
- The setting is `auto`, `ask` or `off`: the `dream` tool's `setting` phase, when they say "no dreams" (off) or choose one.
|
|
64
|
+
- [local] On `auto` (a new install's default), the next day's first Claude Code session starts the night in the background, as a separate claude -p run, and says so in one line. On `ask`, that session asks first. `counterparts dream --setting off` (or `ask`, `auto`) sets it from a terminal.
|
|
65
|
+
- [local] `counterparts night` lists recent nights, and `counterparts night last` shows last night's dream and reflection (since 0.3.28). `counterparts dream --undo <id>` reverses one dream as a whole.
|
|
66
|
+
- [local] `counterparts catch-up` writes up, now, sessions that ended without a write-up. The night does it too.
|
|
67
|
+
- [hosted] Nothing runs the night by itself. It runs when the person's nightly routine (a scheduled run they set up in Claude) calls the `dream` tool, or when they say "dream" in a chat.
|
|
68
|
+
- Either surface: the handle `last dream` (or `last night`) reads the newest dream whole, and the reflection after it.
|
|
69
|
+
|
|
70
|
+
## Seeing and changing what's kept
|
|
71
|
+
|
|
72
|
+
The person can see all of it, correct any of it, and remove it.
|
|
73
|
+
|
|
74
|
+
- Ask the memory: `recall` with a question and a mode, or a memory's id or exact title as `handle` to read it whole. [local] From a terminal: `counterparts ask "…"`.
|
|
75
|
+
- The self page, the "Who I am" the wake opens with: the `self_page` tool reads it, and writes it whole when something about you will still be true next month. [local] `counterparts self-page` shows it, and `counterparts self-page --versions` lists earlier versions.
|
|
76
|
+
- [local] `counterparts dashboard` opens the dashboard in a browser: the memories, the self page and the memory's health.
|
|
77
|
+
- Correct a memory with `remember`, `updates` and `how: "corrected"` (see Remembering well).
|
|
78
|
+
- [local] `counterparts remove <id>` shows what would go; with `--confirm` it asks them to type the id back, then deletes that memory for good. It needs a terminal, and it is the person's to run.
|
|
79
|
+
- [local] `counterparts delete conversation-text`, `counterparts delete backups` or `counterparts delete activity-log` deletes one kind of data and nothing else (since 0.3.21).
|
|
80
|
+
- [local] `counterparts settle` lists memories that disagree and how each pair was settled; `counterparts core` lists what became part of who I am, and `counterparts core --demote <id>` sends one back.
|
|
81
|
+
- [hosted] One memory can't be removed; a correction takes it out of what comes up.
|
|
82
|
+
|
|
83
|
+
## Export, backup, uninstall
|
|
84
|
+
|
|
85
|
+
The memory is the person's to keep or take with them.
|
|
86
|
+
|
|
87
|
+
- [local] `counterparts export --out <dir> --passphrase <secret>` makes an encrypted copy they can take anywhere. Export refuses without `--passphrase`, or `--plaintext` said on purpose. `--markdown` writes a readable tree instead.
|
|
88
|
+
- [local] `counterparts backup --out <dir>` saves a snapshot to a folder. A daily snapshot is also kept automatically.
|
|
89
|
+
- [local] `counterparts uninstall` disconnects Claude Code and keeps the memory unless they say otherwise; `--keep-memories` keeps it without asking.
|
|
90
|
+
- [local] `counterparts start-fresh` sets this memory aside and starts a blank one; `counterparts start-fresh --undo` brings it back. Nothing is deleted.
|
|
91
|
+
- [local] `counterparts rollback` puts the memory back as it was before an upgrade (since 0.3.17).
|
|
92
|
+
- [hosted] The account page's "Download my memory" gives the whole memory as one SQLite file, readable by any SQLite tool. "Delete my account" locks it at once and erases the memory, its backups and its key after 24 hours, unless they sign in and keep it; "Delete everything now" erases at once.
|
|
93
|
+
|
|
94
|
+
## Checking that it works
|
|
95
|
+
|
|
96
|
+
If something seems off (no wake, no footnotes, a night that didn't run), check before guessing.
|
|
97
|
+
|
|
98
|
+
- The `status` tool gives the census: how much is held, of what kinds, how much has left. Ask it when the person asks "what's your status?".
|
|
99
|
+
- [local] `counterparts doctor` checks everything and says what to fix. Show its lines as they are. `counterparts status` counts memories and recent activity; `counterparts log` shows today's events in order; `counterparts mechanisms` shows which parts of memory have been working.
|
|
100
|
+
- [local] After an update, start a new Claude Code session so the new version's tools load. To update: `npm install -g counterparts@latest` (or `bun add -g counterparts@latest`), or for the plugin, /plugin → Marketplaces → counterparts → Update marketplace.
|
|
101
|
+
- [local] A plugin install has no counterparts command in the terminal: the person uses /counterparts:doctor, /counterparts:dashboard and /counterparts:uninstall instead.
|
|
102
|
+
- [local] `counterparts install --host claude-desktop` connects Claude Desktop's chat to the same memory. Desktop's chat has no hooks: the `wake` tool starts each chat, there are no footnotes, and the write-up is asked on a tool result once a chat has gone on a while.
|
|
103
|
+
- [hosted] The account page lists the connected AIs, with when each was last used, and disconnects one.
|
|
104
|
+
- A tool that refuses says why and what to do. Pass that on in plain words, don't retry blindly.
|
|
105
|
+
|
|
106
|
+
## Hosted
|
|
107
|
+
|
|
108
|
+
[hosted] Counterparts Online is the same memory, run on Counterparts' server, used from claude.ai.
|
|
109
|
+
|
|
110
|
+
- It's connected in claude.ai as a custom connector, from the setup page the person was given. In a new chat, the `wake` tool starts the conversation.
|
|
111
|
+
- Sign-in is by an emailed link. The account page has the connected AIs, the time zone (the memory's day turns over at their midnight), "Download my memory", and delete.
|
|
112
|
+
- There are no hooks: the `wake` tool starts each chat, and nothing asks for a write-up at the end. There are no terminal commands and no dashboard.
|
|
113
|
+
- One account is one memory, with no folders: the `scope` tool pauses it or turns it off.
|
|
114
|
+
- Nights run from the person's own routine or when they say "dream".
|
|
115
|
+
- One memory can't be removed.
|
|
116
|
+
- Limits in the beta: about 120 calls a minute and 1,500 an hour; a store of up to 1 GiB. Over a limit, the tool says so; nothing is lost.
|
|
117
|
+
- A hosted memory and a local one are separate. [local] `counterparts connect` keeps the hosted connector out of Claude Code, so one session never sees two memories.
|
|
118
|
+
|
|
119
|
+
## What's new
|
|
120
|
+
|
|
121
|
+
What changed in each version is in CHANGELOG.md, which ships with the package and is on GitHub.
|
|
122
|
+
|
|
123
|
+
- [hosted] Updates arrive when Counterparts Online is deployed; there is nothing to install.
|
package/docs/module-map.md
CHANGED
|
@@ -31,6 +31,7 @@ code and the `NOTES.md` / `INTERFACE-GAPS.md` next to it.*
|
|
|
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
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.** |
|
|
34
|
+
| *(`told.ts`)* | — (what a newborn is told) | The starter memories (S1): eleven ordinary memories a NEW store begins with (`install`, `start-fresh`, hosted signup; never an upgrade), source `told`, in each surface's words, the set's version in `meta`. Weak at birth, lived-first in recall (`recall/gate.ts`, `mcp/facts.ts`), and kept out of the night, the wake, the core, beliefs and cards. **Added 2026-11-03.** |
|
|
34
35
|
| *(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`. |
|
|
35
36
|
|
|
36
37
|
**Third open question (check-in): the `remember`/`encode` boundary.** With the
|
|
@@ -42,7 +43,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
|
|
|
42
43
|
| adapter | job |
|
|
43
44
|
|---|---|
|
|
44
45
|
| `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. |
|
|
45
|
-
| `mcp/` | Deliberate tools, ten: remember, recall, status — plus the Stop ask's two return channels, `session_end` (memories, and the next-session write-up's door) and `chapter` (the episode's own journal, **added 2026-09-04**, because the ask named a door no adapter had built) — `scope` (this directory's setting, **2026-09-15**), `self_page` (the page the wake opens with, **2026-09-18**), `dream`, the dreamer's phases (**added 2026-09-26**), and `reflect`, the waking self's (**added 2026-09-27**), and `meet`, the first meeting (**2026-10-11**, `core/onboarding.ts`). A result's words about the host come from `hosts.ts`. For a Claude Desktop client (by its name at `initialize`, **2026-09-30**) an eleventh, `wake` — Desktop's session start, since it has no hooks — plus per-call binding to the most recent live Desktop session, the write-up ask on a tool result, and a "Start with Counterparts" prompt; a Claude Code client sees none of it. `recall` (**2026-10-03**) answers a question in the mode it names — facts (`facts.ts`, with `recall/time-ask.ts`) or meaning (`meaning.ts`) — and an address (`ids`, `handle`, `epi_…#N`) in `deliberate.ts`. |
|
|
46
|
+
| `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`. The handle `manual` (**2026-11-03**, H1, `manual.ts`) opens `docs/manual.md`, the installed version's manual: its section index, or one section. |
|
|
46
47
|
| `cli/` | `counterparts` command — the full list is `COMMANDS` in `cli/commands.ts`: status, install, connect / disconnect (the host's two files), `install --host claude-desktop` (Desktop's config entry, **2026-09-30**), uninstall, start-fresh, init, owner operations (note, ask, export, backup, remove, verify, repairs, rebrief), the readings (doctor, mechanisms, log, coverage, version, help), scope, self-page, dream, core, settle, and dashboard. |
|
|
47
48
|
| `dashboard/` | The owner's window (constitution line 16): brain-view, revision stories, band/protected lists. Observer-mode by construction; minimal version ships DURING the parallel run. **Added 2026-08-25 (owner elevation).** |
|
|
48
49
|
| `remote/` | The memory server as a web connector (**2026-10-26**, the claude.ai trial): `http.ts` serves the same `McpServer` as MCP over HTTP (plain JSON, no SSE), bound to 127.0.0.1 and answering only under a per-run 192-bit secret path, one message at a time; `call-log.ts` keeps one id-only line per call; `bin/serve-http.ts` refuses a store or configuration nobody named and the owner's live stores. Its host is claude.ai's (`claude-ai:`), set at launch. No sign-in yet (its CONTRACT). |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "counterparts",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.46",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Memory that turns AI tools into counterparts - a local-first, human-memory-modeled memory layer for AI.",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"files": [
|
|
56
56
|
"src/",
|
|
57
57
|
"docs/QUICKSTART.md",
|
|
58
|
+
"docs/manual.md",
|
|
58
59
|
"docs/ELI5.md",
|
|
59
60
|
"docs/module-map.md",
|
|
60
61
|
"tools/install-loop/",
|
|
@@ -1126,7 +1126,8 @@ no content was copied. `parseTranscript` reads only entries with a `message.role
|
|
|
1126
1126
|
| the compaction summary | `isCompactSummary: true`, `isVisibleInTranscriptOnly` | `This session is being continued…` | `injected` (was `conversation`) |
|
|
1127
1127
|
| slash-command echo, `!`-command | no metadata | `<command-name>`, `<local-command-stdout>`, `<bash-input>`, `<bash-stdout>` | unchanged text rule; `<bash-stdout>`/`<bash-stderr>` now `injected` |
|
|
1128
1128
|
| an interrupt | `interruptedMessageId`, no origin | `[Request interrupted by user]` | `injected` |
|
|
1129
|
-
|
|
|
1129
|
+
| a declined permission prompt (measured 2026-11-03: after the rejected `tool_result`, its own entry) | no metadata | exactly `[Request interrupted by user for tool use]` | `plumbing` since 2026-11-03 (WP1; was `injected`, and reached the night's write-up) |
|
|
1130
|
+
| hook output (`UserPromptSubmit hook success`, `hook_additional_context`, `hook_system_message`) | `type: "attachment"`, **no role** | — | never a turn (unchanged); should a build write it as user text, bare or in a system reminder, `plumbing` since 2026-11-03 (was `injected`) |
|
|
1130
1131
|
| **a prompt typed while the model works** (review M3: 76 seen) | `type: "attachment"`, `attachment.type: "queued_command"`, `commandMode: "prompt"`, `origin.kind: "human"` | — | `conversation` since 2026-09-24 — see "Prompts typed mid-turn" below (was never a turn) |
|
|
1131
1132
|
| an API error written as the assistant | `isApiErrorMessage: true`, `model: "<synthetic>"` | `API Error: …` | `injected` (was `conversation`) |
|
|
1132
1133
|
|
|
@@ -168,6 +168,7 @@ import { owedFolders, readOwed, crashWriteUpFindings, nightHeldFindings, overdue
|
|
|
168
168
|
import type { OwedSource, OwedReading } from "./doctor-write-ups.js";
|
|
169
169
|
import { worstFirst } from "./doctor-report.js";
|
|
170
170
|
import { feedbackLoopFindings } from "./doctor-feedback.js";
|
|
171
|
+
import { starterNotes } from "../../core/told.js";
|
|
171
172
|
|
|
172
173
|
// What moved to the doctor-*.ts parts, re-exported so every import of this file still resolves.
|
|
173
174
|
export { SEVERITIES } from "./doctor-finding.js";
|
|
@@ -502,7 +503,8 @@ function configFindings(input: DoctorInput): Finding[] {
|
|
|
502
503
|
: finding("store", "green", MEMORY_TITLE, memoryDetail(input, held), "", {
|
|
503
504
|
dir: input.dir,
|
|
504
505
|
exists: true,
|
|
505
|
-
memories: held,
|
|
506
|
+
memories: held === null ? null : held.lived,
|
|
507
|
+
starterNotes: held === null ? null : held.told,
|
|
506
508
|
}),
|
|
507
509
|
);
|
|
508
510
|
return out;
|
|
@@ -595,7 +597,8 @@ function configFindings(input: DoctorInput): Finding[] {
|
|
|
595
597
|
finding("store", "green", MEMORY_TITLE, memoryDetail(input, held), "", {
|
|
596
598
|
dir: input.dir,
|
|
597
599
|
exists: true,
|
|
598
|
-
memories: held,
|
|
600
|
+
memories: held === null ? null : held.lived,
|
|
601
|
+
starterNotes: held === null ? null : held.told,
|
|
599
602
|
}),
|
|
600
603
|
);
|
|
601
604
|
}
|
|
@@ -628,9 +631,11 @@ const MEMORY_TITLE = "Memory";
|
|
|
628
631
|
* row: this line is built on the hook's hot path too, and a census that opened
|
|
629
632
|
* every row would put the whole store between a session and its first word.
|
|
630
633
|
*/
|
|
631
|
-
|
|
634
|
+
/** Live memory rows, the starter memories counted apart (S1): `{ lived, told }`. */
|
|
635
|
+
function memoryCount(store: Store): { lived: number; told: number } | null {
|
|
632
636
|
try {
|
|
633
|
-
|
|
637
|
+
const told = store.liveToldCount();
|
|
638
|
+
return { lived: store.countMemories({ type: "memory", archived: false }) - told, told };
|
|
634
639
|
} catch {
|
|
635
640
|
// A store that will not answer still has a path worth printing, and the
|
|
636
641
|
// `Store open` line is where an unreadable store is graded.
|
|
@@ -647,8 +652,12 @@ function memoryCount(store: Store): number | null {
|
|
|
647
652
|
* `--json` still carry it, and a store that will NOT open prints its own line
|
|
648
653
|
* with the code and the repair.
|
|
649
654
|
*/
|
|
650
|
-
function memoryDetail(input: DoctorInput, n: number | null): string {
|
|
651
|
-
|
|
655
|
+
function memoryDetail(input: DoctorInput, n: { lived: number; told: number } | null): string {
|
|
656
|
+
// The lived memories are the number; the starter notes are said apart (ROADMAP, 11-03).
|
|
657
|
+
const held =
|
|
658
|
+
n === null
|
|
659
|
+
? ""
|
|
660
|
+
: ` — ${String(n.lived)} ${n.lived === 1 ? "memory" : "memories"}${n.told === 0 ? "" : ` · ${starterNotes(n.told)}`}`;
|
|
652
661
|
const opens = input.open?.ok === true ? ", opens fine" : "";
|
|
653
662
|
return `${tilde(input.dir)}${held}${opens}`;
|
|
654
663
|
}
|
|
@@ -2009,7 +2018,12 @@ function vectorFindings(input: DoctorInput, store: Store): Finding[] {
|
|
|
2009
2018
|
// session. A store that has lived one and still has a shortfall keeps the
|
|
2010
2019
|
// amber below.
|
|
2011
2020
|
if (unembedded > 0 && !livedABoundary(store)) {
|
|
2012
|
-
|
|
2021
|
+
// The starter notes said apart (S1): a new store's 11 are not memories anybody made.
|
|
2022
|
+
const toldIds = new Set(store.toldIds());
|
|
2023
|
+
const toldWaiting = toldIds.size === 0 ? 0 : store.missingVectors(unembedded).filter((id) => toldIds.has(id)).length;
|
|
2024
|
+
const lived = unembedded - toldWaiting;
|
|
2025
|
+
const livedSaid = lived === 1 ? "1 memory" : `${lived} memories`;
|
|
2026
|
+
const memories = toldWaiting === 0 ? livedSaid : lived === 0 ? starterNotes(toldWaiting) : `${livedSaid} · ${starterNotes(toldWaiting)}`;
|
|
2013
2027
|
return [finding("vectors", "green", "Vectors", `${memories} not searchable by meaning yet — this builds after your first session`, "", data)];
|
|
2014
2028
|
}
|
|
2015
2029
|
if (unembedded > 0) {
|
|
@@ -69,6 +69,7 @@ import {
|
|
|
69
69
|
NIGHT_RUNNER_PREFIX,
|
|
70
70
|
WRITE_UP_CLAIM_MS,
|
|
71
71
|
WRITE_UP_PART_BYTES,
|
|
72
|
+
WRITE_UP_PLUMBING_RULE,
|
|
72
73
|
claimedByOther,
|
|
73
74
|
firstUnwrittenPart,
|
|
74
75
|
grantWriteUps,
|
|
@@ -460,6 +461,7 @@ export function catchUpPrompt(plan: CatchUpPlan): string {
|
|
|
460
461
|
"1. Call session_end with writeUp: <its id> and no memories. It returns one part of that conversation.",
|
|
461
462
|
"2. Call session_end with writeUp: <its id>, part: <that part>, memories: [...] — what caught your attention in it, one idea each, in your own words. Do not write again what is marked as already written up. If nothing that is not marked so is worth keeping, send memories: [] with nothing: \"<one line: why>\"; an empty answer without that line is refused while the part holds words not yet written up.",
|
|
462
463
|
"3. Fetch again for its next part, until the answer is \"written-up\" or the door says this run's allowance for it is spent. Then the next session.",
|
|
464
|
+
WRITE_UP_PLUMBING_RULE,
|
|
463
465
|
"",
|
|
464
466
|
"Sessions:",
|
|
465
467
|
...plan.subjects.map(
|
|
@@ -58,6 +58,14 @@
|
|
|
58
58
|
* visible. A `Stop hook feedback:` block carrying a v1 marker is still
|
|
59
59
|
* `foreign` — foreign is checked first, so the canary's agreement holds.
|
|
60
60
|
*
|
|
61
|
+
* **PLUMBING NEVER ENTERS** (2026-11-03, WP1). The host's own line after a
|
|
62
|
+
* declined permission prompt (`[Request interrupted by user for tool use]`)
|
|
63
|
+
* and a hook's output written as user text are the machinery, not anything
|
|
64
|
+
* the person or the counterpart said; kept as `injected`, the first reached
|
|
65
|
+
* the night's write-up beside the person's words. They are tagged `plumbing`
|
|
66
|
+
* (`PLUMBING_FRAMES`) and `enters()` refuses them, counted. What either of
|
|
67
|
+
* them SAID about a prompt or a refusal stays conversation.
|
|
68
|
+
*
|
|
61
69
|
* **B1 — pacing counts what the PERSON typed, decided from the entry's own
|
|
62
70
|
* metadata first** (2026-09-23; since 2026-09-24 the assistant's replies add
|
|
63
71
|
* bytes but never turns — `hooks.ts#substanceOf`). A subagent's hand-back
|
|
@@ -126,11 +134,14 @@ const INJECTED =
|
|
|
126
134
|
* - `Another Claude session sent a message:` — how 2.1.28x delivers a
|
|
127
135
|
* subagent's hand-back (the `<agent-message …>` wrapper follows it);
|
|
128
136
|
* - `[Subagent hand-back]` — the same hand-back's own opening line;
|
|
129
|
-
* - `[Request interrupted by user…]` — the host's marker for an interrupt
|
|
137
|
+
* - `[Request interrupted by user…]` — the host's marker for an interrupt
|
|
138
|
+
* (but not the one after a declined permission prompt: `PLUMBING_FRAMES`);
|
|
130
139
|
* - `<Event> hook success:` / `… hook additional context:` / `… hook system
|
|
131
|
-
* message:` — how the host
|
|
132
|
-
*
|
|
133
|
-
*
|
|
140
|
+
* message:` written BARE — how the host renders hook output, should a build
|
|
141
|
+
* write it as user text. Kept as `injected`, not `plumbing`: one bare line
|
|
142
|
+
* cannot be told from a person on an older build (no metadata) asking about
|
|
143
|
+
* their hook ("Stop hook success: why does this keep showing?"), and losing
|
|
144
|
+
* their words is worse than keeping the machinery (review of #731).
|
|
134
145
|
* `hook error` is deliberately NOT here: it is what a person types when
|
|
135
146
|
* their own hook breaks.
|
|
136
147
|
*
|
|
@@ -145,6 +156,38 @@ const HOST_FRAMES: readonly RegExp[] = [
|
|
|
145
156
|
/^[A-Z][A-Za-z]+ hook (?:success|additional context|system message):/,
|
|
146
157
|
];
|
|
147
158
|
|
|
159
|
+
/**
|
|
160
|
+
* PLUMBING FRAMES (2026-11-03, WP1): host frames that carry the machinery, not
|
|
161
|
+
* the conversation, and so enter nothing (`plumbing`, refused and counted).
|
|
162
|
+
* Same anchoring and the same reach as `HOST_FRAMES` (user-role, never the
|
|
163
|
+
* person's own typed entry), checked first:
|
|
164
|
+
*
|
|
165
|
+
* - `[Request interrupted by user for tool use]`, the WHOLE block — what the
|
|
166
|
+
* host writes, as its own user-role entry with no metadata, after the
|
|
167
|
+
* person declines a permission prompt (measured 11-03 on the owner's
|
|
168
|
+
* transcripts: the rejected `tool_result` comes first and is already a
|
|
169
|
+
* blind spot). Kept as `injected` until then, it reached the night's
|
|
170
|
+
* write-up as part of what the person said. A plain interrupt is still a
|
|
171
|
+
* host frame: the person stopping a reply is something they did;
|
|
172
|
+
* - a system reminder holding ONLY a hook's output (`<Event> hook success:`
|
|
173
|
+
* / `… additional context:` / `… system message:`), the WHOLE block, one
|
|
174
|
+
* reminder and nothing after it — how the host hands hook output to the
|
|
175
|
+
* model (`OWN_ASK`'s shapes). In the file these are `attachment` entries,
|
|
176
|
+
* which carry no role and never reach this reader; the anchor is here in
|
|
177
|
+
* case a build ever writes one as user text. Some OTHER hook's output was
|
|
178
|
+
* `injected`, kept, until then. Anything the person wrote after the
|
|
179
|
+
* reminder keeps the block out of here (review of #731), and the bare
|
|
180
|
+
* form stays a `HOST_FRAMES` entry, kept.
|
|
181
|
+
*
|
|
182
|
+
* What the person or the counterpart SAYS about a refusal or a prompt ("why
|
|
183
|
+
* do you keep asking me to allow that?") is conversation; that is the
|
|
184
|
+
* write-up's prompt to weigh (`sessions.ts#WRITE_UP_PLUMBING_RULE`), not this file's.
|
|
185
|
+
*/
|
|
186
|
+
const PLUMBING_FRAMES: readonly RegExp[] = [
|
|
187
|
+
/^\[Request interrupted by user for tool use\]\s*$/,
|
|
188
|
+
/^<system-reminder>\s*[A-Z][A-Za-z]+ hook (?:success|additional context|system message):(?:(?!<\/system-reminder>)[\s\S])*<\/system-reminder>\s*$/,
|
|
189
|
+
];
|
|
190
|
+
|
|
148
191
|
/**
|
|
149
192
|
* The host's blocking-Stop channel, which returns a hook's own stderr to the
|
|
150
193
|
* model as user-role text. Anchored: a block that merely MENTIONS the phrase
|
|
@@ -265,7 +308,13 @@ export function classifyBlock(text: string): TurnSource {
|
|
|
265
308
|
/** True when a user-role block with no metadata opens with a host frame. */
|
|
266
309
|
function hostFramed(text: string): boolean {
|
|
267
310
|
const probe = text.trimStart();
|
|
268
|
-
return HOST_FRAMES.some((frame) => frame.test(probe));
|
|
311
|
+
return plumbingFramed(text) || HOST_FRAMES.some((frame) => frame.test(probe));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** True when a user-role block opens with a plumbing frame (`PLUMBING_FRAMES`). */
|
|
315
|
+
function plumbingFramed(text: string): boolean {
|
|
316
|
+
const probe = text.trimStart();
|
|
317
|
+
return PLUMBING_FRAMES.some((frame) => frame.test(probe));
|
|
269
318
|
}
|
|
270
319
|
|
|
271
320
|
/**
|
|
@@ -539,7 +588,10 @@ export function parseTranscript(raw: string): TranscriptRead {
|
|
|
539
588
|
// The host's own lines keep only what is refused (and so counted); their
|
|
540
589
|
// text enters no turn (`hostRecord`).
|
|
541
590
|
const all = blocksOf(content, role, author);
|
|
542
|
-
|
|
591
|
+
// Plumbing on such a line enters no turn either (2026-11-03): it was
|
|
592
|
+
// `injected` and dropped here before, and the turn list a live session's
|
|
593
|
+
// cursor indexes must not grow across an upgrade.
|
|
594
|
+
const pieces = role === "user" && hostRecord(entry) ? all.filter((p) => p.source !== "injected" && p.source !== "plumbing") : all;
|
|
543
595
|
// A twin, if the host ever writes one, is the person's NEXT sent entry: the
|
|
544
596
|
// same words, marked queued. Anything else the person sends closes the
|
|
545
597
|
// window. Assistant lines do not: the turn goes on after the attachment.
|
|
@@ -634,6 +686,7 @@ function pieceOf(text: string, role: "user" | "assistant", author: EntryAuthor):
|
|
|
634
686
|
if (role !== "user") return { text, source: author === "host" ? "injected" : source };
|
|
635
687
|
if (author === "host") {
|
|
636
688
|
if (OWN_ASK.test(text.trimStart())) return { text, source: "ritual" };
|
|
689
|
+
if (plumbingFramed(text)) return { text, source: "plumbing" };
|
|
637
690
|
// Kept in capture — a hand-back or a notification is real experience — and
|
|
638
691
|
// out of pacing, because nobody in this session typed it. The peer rewrite
|
|
639
692
|
// still applies, so a wrapper is labelled rather than read as the owner.
|
|
@@ -654,6 +707,7 @@ function pieceOf(text: string, role: "user" | "assistant", author: EntryAuthor):
|
|
|
654
707
|
// a bare opener may be the person quoting it), then master's rule, plus the
|
|
655
708
|
// anchored host frames.
|
|
656
709
|
if (OWN_ASK_FRAMED.test(text.trimStart())) return { text, source: "ritual" };
|
|
710
|
+
if (plumbingFramed(text)) return { text, source: "plumbing" };
|
|
657
711
|
if (source === "conversation" && hostFramed(text)) return { text, source: "injected" };
|
|
658
712
|
const attributed = attributePeers(text);
|
|
659
713
|
if (attributed.peers === 0) return { text, source };
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
} from "./install.js";
|
|
36
36
|
import type { InstallLayout, ParkedSighting } from "./install.js";
|
|
37
37
|
import { NEW_INSTALL_DREAMING_LINE, beginNewInstall } from "../../core/onboarding.js";
|
|
38
|
+
import { plantTold } from "../../core/told.js";
|
|
38
39
|
// The console's shared manners (2026-09-21): is there a person here, ask them,
|
|
39
40
|
// and say one marked line back.
|
|
40
41
|
import { isPromptAborted, ui, ask } from "./ui.js";
|
|
@@ -253,6 +254,10 @@ export function installCommand(
|
|
|
253
254
|
if (!existed) {
|
|
254
255
|
try {
|
|
255
256
|
beginNewInstall(store, { dreaming: opts.newInstall !== "start-fresh" });
|
|
257
|
+
// THE STARTER MEMORIES (S1, `core/told.ts`): told, not lived, planted
|
|
258
|
+
// only here, in a store this call created — `start-fresh`'s blank store
|
|
259
|
+
// included, since it is a new store with a new counterpart in it.
|
|
260
|
+
plantTold(store, "local");
|
|
256
261
|
} catch (err) {
|
|
257
262
|
store.close();
|
|
258
263
|
io.err(prefixedRefusal(describeDirRefusal(err, layout.store)));
|
|
@@ -266,7 +271,7 @@ export function installCommand(
|
|
|
266
271
|
// `Counterpart.open`, so the core appeared only when a session first fired.
|
|
267
272
|
// Two things were wrong with that. §3 says "It seeds the identity core" of a
|
|
268
273
|
// command that had not yet; and `init --name` DID seed it immediately, so the
|
|
269
|
-
// two commands
|
|
274
|
+
// two commands (then called interchangeable) produced different cores
|
|
270
275
|
// (found 2026-09-04, when a captured recall reproduced one row higher than
|
|
271
276
|
// the page said). Same door as `init`: `Counterpart.open`'s own option, which
|
|
272
277
|
// is an ENSURE, so the hook's later call finds it and mints nothing.
|
|
@@ -346,9 +351,9 @@ export function installCommand(
|
|
|
346
351
|
} else {
|
|
347
352
|
say(` ${config.what} ${config.path}`);
|
|
348
353
|
}
|
|
349
|
-
// The SAME sentence `init` prints, because the two
|
|
350
|
-
//
|
|
351
|
-
//
|
|
354
|
+
// The SAME sentence `init` prints, because the two seed the core the same
|
|
355
|
+
// way. They are not interchangeable since S1 (ROADMAP, 11-03): "init makes a
|
|
356
|
+
// bare store, with no starter notes; install sets up yours."
|
|
352
357
|
// The conversation (`installInteractive`) has already said this, one step up, in
|
|
353
358
|
// the person's own answer; saying it twice is the wall of text the owner named.
|
|
354
359
|
if (seeded && opts.nameAlreadySaid !== true) {
|
|
@@ -86,6 +86,7 @@ import {
|
|
|
86
86
|
} from "./commands-shared.js";
|
|
87
87
|
import type { Io, Parsed } from "./commands-shared.js";
|
|
88
88
|
import { STORE_STARTED_KEY, STORE_PREVIOUS_PARKED_KEY } from "./commands-start-fresh.js";
|
|
89
|
+
import { isTold, starterNotes } from "../../core/told.js";
|
|
89
90
|
|
|
90
91
|
// ── status ──────────────────────────────────────────────────────────────────
|
|
91
92
|
|
|
@@ -547,6 +548,8 @@ export function statusCommand(
|
|
|
547
548
|
// against the preface's 121, the difference being exactly the 13 entities
|
|
548
549
|
// and 9 beliefs. Both numbers were right; one of the labels was not.
|
|
549
550
|
let memories = 0;
|
|
551
|
+
/** Starter memories (S1, `core/told.ts`), counted apart from the lived ones. */
|
|
552
|
+
let told = 0;
|
|
550
553
|
let addedToday = 0;
|
|
551
554
|
let schemas = 0;
|
|
552
555
|
let journal = 0;
|
|
@@ -578,7 +581,11 @@ export function statusCommand(
|
|
|
578
581
|
continue;
|
|
579
582
|
}
|
|
580
583
|
if (row.type === "schema") schemas += 1;
|
|
581
|
-
else
|
|
584
|
+
else if (isTold(row)) {
|
|
585
|
+
// Told, not lived (S1): said apart, and never "new today".
|
|
586
|
+
told += 1;
|
|
587
|
+
continue;
|
|
588
|
+
} else memories += 1;
|
|
582
589
|
// THE SAME POPULATION, so the two numbers on the page cannot disagree.
|
|
583
590
|
// `countMemories({ learnedOnFrom })` would have been one query and a
|
|
584
591
|
// different census: it counts removed and superseded rows, and reported
|
|
@@ -653,6 +660,7 @@ export function statusCommand(
|
|
|
653
660
|
// a surface that will disagree with the briefing the model reads.
|
|
654
661
|
say(
|
|
655
662
|
`Memories: ${memories}` +
|
|
663
|
+
(told === 0 ? "" : ` · ${starterNotes(told)}`) +
|
|
656
664
|
` Beliefs and entities: ${schemas}` +
|
|
657
665
|
` Journal: ${journal} ${journal === 1 ? "episode" : "episodes"}` +
|
|
658
666
|
` Archived: ${archived} Superseded: ${superseded}`,
|
|
@@ -732,7 +740,7 @@ export function statusCommand(
|
|
|
732
740
|
{
|
|
733
741
|
title: "Memory",
|
|
734
742
|
rows: [
|
|
735
|
-
{ label: "Memories", value: String(memories) },
|
|
743
|
+
{ label: "Memories", value: told === 0 ? String(memories) : `${memories} · ${starterNotes(told)}` },
|
|
736
744
|
{ label: "Beliefs and entities", value: String(schemas) },
|
|
737
745
|
{ label: "Journal", value: `${journal} ${journal === 1 ? "episode" : "episodes"}` },
|
|
738
746
|
{ label: "Archived", value: String(archived) },
|