counterparts 0.3.22 → 0.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/docs/module-map.md +1 -0
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/bin/runner.ts +27 -1
  5. package/src/adapters/claude-code/doctor-host.ts +28 -9
  6. package/src/adapters/claude-code/hooks.ts +8 -1
  7. package/src/adapters/cli/CONTRACT.md +4 -1
  8. package/src/adapters/cli/NOTES.md +8 -0
  9. package/src/adapters/cli/commands-readings.ts +11 -2
  10. package/src/adapters/cli/commands-start-fresh.ts +8 -0
  11. package/src/adapters/cli/desktop.ts +10 -5
  12. package/src/adapters/cli/help.ts +7 -3
  13. package/src/adapters/cli/install.ts +9 -2
  14. package/src/adapters/cli/mechanisms.ts +9 -2
  15. package/src/adapters/cli/removal.ts +7 -0
  16. package/src/adapters/cli/uninstall.ts +74 -7
  17. package/src/adapters/cli/wire.ts +234 -19
  18. package/src/adapters/dashboard/registries.ts +4 -0
  19. package/src/adapters/dashboard/web/README.md +1 -1
  20. package/src/adapters/dashboard/web/actions.ts +6 -4
  21. package/src/adapters/dashboard/web/app.html +3 -0
  22. package/src/adapters/dashboard/web/favicon.svg +1 -0
  23. package/src/adapters/dashboard/web/flow.ts +2 -0
  24. package/src/adapters/dashboard/web/lanes.ts +1 -0
  25. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +8 -5
  26. package/src/adapters/dashboard/web/narrate.ts +72 -13
  27. package/src/adapters/dashboard/web/pages/home/home.css +3 -0
  28. package/src/adapters/dashboard/web/pages/home/sections/brain.js +37 -9
  29. package/src/adapters/dashboard/web/pages/memories/sections/search.js +2 -2
  30. package/src/adapters/dashboard/web/server.ts +49 -27
  31. package/src/adapters/dashboard/web/views/mechanism-panel.ts +52 -8
  32. package/src/adapters/dashboard/web/views/mechanisms.ts +6 -1
  33. package/src/adapters/dashboard/web/views/memories.ts +14 -5
  34. package/src/adapters/dashboard/web/views/memory-words.ts +8 -3
  35. package/src/adapters/dashboard/web/views/memory.ts +12 -5
  36. package/src/adapters/fired.ts +9 -0
  37. package/src/adapters/host-wiring.ts +56 -6
  38. package/src/adapters/mcp/CONTRACT.md +7 -3
  39. package/src/adapters/mcp/bin/serve.ts +33 -0
  40. package/src/adapters/mcp/facts.ts +2 -2
  41. package/src/adapters/mcp/index.ts +1 -0
  42. package/src/adapters/mcp/server-args.ts +13 -1
  43. package/src/adapters/mcp/server-options.ts +7 -0
  44. package/src/adapters/mcp/server-session-end.ts +69 -6
  45. package/src/adapters/mcp/server-words.ts +20 -2
  46. package/src/adapters/mcp/server.ts +77 -4
  47. package/src/adapters/mcp/tools.ts +39 -4
  48. package/src/adapters/mechanism-evidence.ts +136 -8
  49. package/src/adapters/runtime.ts +21 -0
  50. package/src/adapters/sidebar-status.ts +523 -0
  51. package/src/core/counterpart-deposit.ts +134 -3
  52. package/src/core/counterpart-events.ts +15 -0
  53. package/src/core/counterpart-types.ts +24 -0
  54. package/src/core/counterpart.ts +131 -1
  55. package/src/core/physics/CONTRACT.md +33 -5
  56. package/src/core/physics/NOTES.md +49 -0
  57. package/src/core/physics/index.ts +93 -19
  58. package/src/core/prospective/NOTES.md +19 -0
  59. package/src/core/recall/CONTRACT.md +12 -1
  60. package/src/core/recall/NOTES.md +29 -0
  61. package/src/core/recall/index.ts +21 -3
  62. package/src/core/recall/probe.ts +284 -0
  63. package/src/core/recall/rated.ts +196 -0
  64. package/src/core/remember/NOTES.md +10 -0
  65. package/src/core/sleep/CONTRACT.md +2 -1
  66. package/src/core/sleep/decay.ts +54 -3
  67. package/src/core/sleep/index.ts +1 -1
  68. package/src/core/sleep/prune.ts +6 -0
  69. package/src/core/sleep/upgrade.ts +3 -2
  70. package/src/core/store/operational.ts +27 -7
  71. package/src/core/types.ts +6 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.24 — 2026-10-14
4
+
5
+ Forgetting now waits: a memory is put away only after 14 lived days under the floor, not 14 days after it was last used, and a release that changes how strength is read starts that wait fresh for everything it lowered. So nothing is archived for the first 14 lived days after you upgrade to this release; archived memories keep their words and stay readable by id. Old claims the claims era lowers now read at today's default all the way down. At the end-of-session ask Claude now also rates the memories it was shown, 0 to 3; the ratings are only recorded and change nothing yet. The `salience` field tells Claude to leave routine work at the default, a faded match is labelled "faded: weak, below reach", closing a reminder closes every memory it moved through, a revision with no title keeps the old one's, and `recall` takes `query` as another name for `question`. With both the plugin and the npm install, uninstalling the plugin and keeping the memories leaves the npm install's memory server and hooks working. The sidebar counts feelings under Emotion. If `/plugin update counterparts@counterparts` does nothing, run `/plugin marketplace update counterparts`, then `/plugin uninstall counterparts@counterparts` and `/plugin install counterparts@counterparts`. These are Claude Code's own plugin commands, not `/counterparts:uninstall`, and your memories in `~/.counterparts` are untouched. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.23, and `counterparts connect` is not needed. Going back to 0.3.23 gives up the wait: it counts 14 days from last use again.
6
+
7
+ - **A memory leaves only after 14 lived days under the floor.** The floor prune used to count
8
+ its 14 days from a memory's last use, so a memory unused for weeks was archived the first
9
+ night it faded under the floor. Now it waits 14 lived days under the floor first, and a
10
+ build that changes how strength is read never archives anything the night it arrives: the
11
+ wait for everything it lowered starts that night, so a store archives nothing for its
12
+ first 14 lived days on this release, whichever release it upgraded from. Archived memories
13
+ still keep their words and stay readable by id.
14
+ - **Old claims now read at today's default all the way down.** A memory written before the
15
+ claims era whose claim the era lowers now reads at that default as a whole, instead of being
16
+ held up by the relevance and predictive scores written alongside the old claim; a quarter
17
+ of the lowered memories were not lowered at all before. Memories the era raises, and the
18
+ ones it leaves alone (the core, the owner's own, protected, a pending or repeating date),
19
+ read as before. No store-format change.
20
+ - **Claude now scores the memories it was shown.** At the end-of-session ask, Claude rates
21
+ each footnote it was shown since it last wrote, and every memory it says it drew on, from
22
+ 0 (noise) to 3 (changed what it did or said). The scores are only recorded: they change
23
+ nothing about any memory yet. `counterparts probe-oq4` prints them by day and by kind of
24
+ showing, beside what the replies actually used.
25
+ - **Routine work is left at the default salience.** The `salience` field on `remember` and
26
+ `session_end` now tells Claude to leave it unset for a routine work event or an ordinary
27
+ work fact unless it changed something, and to claim 0.4 or more only for what struck it
28
+ or changed how it will work, so weak work memories fade on their own. The owner's
29
+ rulings and corrections still stay high.
30
+ - **A faded match is labelled "faded: weak, below reach".** Asking for facts used to label
31
+ it "not used for a long while", which was false for a memory two days old that simply
32
+ started weak. The dashboard's search says the same. Ranking is unchanged.
33
+ - **Closing a reminder closes all of it.** When a memory says a dated thing is done (its
34
+ date dropped, or `status: done`), every earlier or later memory the same reminder moved
35
+ through loses its date too, so one "done" stops it coming back. Other memories nearby
36
+ that still hold a date are listed in the reply, by id and title, so Claude can close
37
+ them in the same step if they are the same thing; they are never closed for it.
38
+ - **A revision keeps its title.** A memory that revises another (`updates`) and has no title
39
+ of its own now takes the old one's, as it already took what it was about, who said it,
40
+ its status and its date. When it closes something (a dated thing done, or any
41
+ `status: done`), the old title would read as still open, so none is carried and the
42
+ reply asks for a title. A confidential memory's title is never carried.
43
+ - **`recall` takes `query` as another name for `question`.** A recall sent with `query`
44
+ used to be refused for having no question; it is now answered as one. A mode is still
45
+ required.
46
+ - **Uninstalling the plugin no longer takes the npm install's memory server with it.** With
47
+ both installed, the plugin's uninstall (keeping the memories) ran `claude mcp remove
48
+ counterparts -s user`, which removed the server the npm install registered. The plugin
49
+ never registers one there, so it now leaves it alone and says so; `counterparts
50
+ uninstall` still removes its own.
51
+ - **Uninstalling the plugin leaves a working npm install's hooks alone too, and cleans up
52
+ after one that is gone.** With both installed, the plugin's uninstall (keeping the
53
+ memories) took the npm install's wake and recall hooks out of `~/.claude/settings.json`.
54
+ It now removes a Counterparts hook or memory server only when the program it runs is no
55
+ longer there, which is what an npm install removed without `counterparts uninstall`
56
+ leaves behind. Run at a terminal, the plugin's uninstall now asks whether to delete the
57
+ memories before it removes anything of the npm install's, so answering no leaves that
58
+ install working. A hook line written as `~/…counterparts-hook`
59
+ or `$HOME/…` now reads as live, here and in doctor and the plugin's stand-down, as the
60
+ shell that runs it would read it.
61
+ - **The sidebar counts feelings under Emotion.** "Mechanisms today" showed Emotion at 0
62
+ every day, because its only proof was a mood match, and mood matching is off. It now
63
+ counts a memory saved with a feeling and a memory carrying a feeling that came to mind,
64
+ and opening Emotion lists those memories with their feeling words. The dashboard's
65
+ Emotion light reads the same proofs. `sidebar.json` gains a `felt` detail on those rows
66
+ (its version stays 1).
67
+ - The sidebar's footer says "Dash · /counterparts:dashboard", which fits the docked pane
68
+ on one line.
69
+
70
+ ## 0.3.23 — 2026-10-14
71
+
72
+ The plugin's sidebar now shows your memory and does nothing else: it has no buttons and no links, runs no command, calls no tool and makes no network request. Its footer says how to do the rest yourself (`/counterparts:meet`, `/counterparts:dashboard`, say "pause memory here", `/counterparts quiet`). What it shows comes from a small file Counterparts writes for it, `~/.counterparts/sidebar.json`, only while the plugin is installed, so the dashboard no longer has to be running for the sidebar to show anything. The sidebar's brain is gone and the fox stays. The plugin directory's build of the plugin no longer reads Claude Code's user configuration file and leaves out the dashboard's 3D brain; beside an npm install it does not stand down, so keep one or the other. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.22, and `counterparts connect` is not needed.
73
+
74
+ - **The sidebar shows memory and no longer acts.** It has no buttons: the "Start the
75
+ 5-minute intro" row, the desktop's dashboard buttons, the folder switch (on, paused, off)
76
+ and its confirm, and the view and avatar switches are gone. Its footer says how instead:
77
+ `/counterparts:meet` for the intro, `/counterparts:dashboard` for the dashboard, say
78
+ "pause memory here" to Claude to pause a folder, `/counterparts quiet` to hide it. A
79
+ paused folder still says so, with how to resume; `/counterparts resume` now says how
80
+ rather than resuming. COUNTERPARTS and a long memory's `more` are plain words, not links.
81
+ - **The sidebar makes no network request.** It used to ask the dashboard on 127.0.0.1;
82
+ now Counterparts' own background processes (the one after each reply, and the memory
83
+ server) write `~/.counterparts/sidebar.json` (mode 0600, beside `claude-code.json`) and
84
+ the sidebar reads it every 15 to 30 seconds while it is open. The file holds the day and
85
+ the count, today's counts, the last dream, recent activity and the memories it names
86
+ (title and the first 800 characters; a confidential memory's text is withheld). It is
87
+ written only while the plugin is installed; an npm-only install never writes it, and
88
+ once the plugin is gone the next Counterparts process deletes it. A surfaced memory's
89
+ title can take up to about 30 seconds to appear. `COUNTERPARTS_DASHBOARD_PORT` no longer
90
+ matters to the sidebar.
91
+ - **The sidebar's brain is gone; the fox stays.** `/counterparts avatar` takes `animal` or
92
+ `off`; a brain chosen before shows the fox. `/counterparts fps` is gone with it.
93
+ - **The directory build never reads `~/.claude.json`.** The plugin as built for
94
+ Anthropic's directory does not open Claude Code's user configuration file. The cost: it
95
+ can't see an npm install's memory server there, so beside a wired npm install it doesn't
96
+ stand down; both run on the same memory and Claude is offered the memory tools twice.
97
+ Keep one: `counterparts disconnect` and a restart keep only the plugin, uninstalling the
98
+ plugin keeps only the npm install. The npm install's doctor tells the two plugin builds
99
+ apart and says this. The marketplace's plugin (the full build) is unchanged and still
100
+ stands down.
101
+ - **The directory build leaves out the dashboard's 3D brain** (and three.js); its home
102
+ page draws without the picture. No file in that build is over 256 KiB.
103
+ - **Uninstalling the directory build with no `claude` on PATH keeps your memory.** It
104
+ can't confirm the memory server registration is gone, so it stops before deleting or
105
+ moving the store, and prints the `claude mcp remove` line to run.
106
+ - The dashboard's icon is now a file of its own (same address, same picture).
107
+
3
108
  ## 0.3.22 — 2026-10-14
4
109
 
5
110
  The sidebar is ready for Anthropic's plugin directory, and the plugin now installs from a repository of its own. In the sidebar the search box is gone, COUNTERPARTS and a memory's `more` are links to the dashboard in a terminal and buttons in the desktop app, and the sidebar no longer runs a command to open a browser; `counterparts dashboard` opens the dashboard already running for your memory instead of failing on its port. The plugin's marketplace entry now names `counterparts-ai/counterparts-plugin`, a generated folder that holds only the plugin, so an install clones a few hundred files instead of the whole development repository; if you added the marketplace before, run `/plugin marketplace update counterparts` first, and your memory and the plugin's data folder stay where they are. Also: the memory tools tell a host which of them only read and which can take something away, and the context a session starts with offers the first meeting and its other steps instead of ordering them. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.21, and `counterparts connect` is not needed.
@@ -55,6 +55,7 @@ input — does `encode` shrink to gates-and-tagging inside `remember`'s pipeline
55
55
  | `spawn.ts` | The detached worker's plan and start (`planSpawn`, `spawnDetached`): watchdog checked against the staleness window, environment pinned last. Moved out of `claude-code/` on **2026-09-30** so any host's adapter can start the same worker. |
56
56
  | `fired.ts` | Which mechanisms have fired and which have gone quiet, read only from the store's rows — `counterparts mechanisms`, the dashboard's panel. Each entry names the module that does the work. |
57
57
  | `snapshots.ts` | The daily rotating snapshot and its rotation — the one place this package deletes a copy of the memory, and only what it can prove is a snapshot. |
58
+ | `sidebar-status.ts` | The Claude Code sidebar's status file (`sidebar.json` beside the configuration): what the sidebar shows, built by the dashboard's view functions over an observer handle and written whole, by the worker after each boundary and by the memory server off its tool calls' path, so the sidebar makes no network request. |
58
59
  | `stance-env.ts` | `COUNTERPARTS_OBSERVER` / `COUNTERPARTS_OWNER`, read the way the explicit-dir guard is, each failing toward less power. Unset, the configuration's `owner: true` decides for a server Claude Code starts (`mcp/bin/serve.ts#ownerStance`, 2026-10-02). |
59
60
  | `log/` | A shared leaf with its own CONTRACT: the process log — one line per allowlisted event (failures, stand-downs, turn ends, write-ups, the night, the wake) from the hook, the worker, the nightly run and the MCP server, to `<dataDir>/sessions/log/<date>.log`, ids and codes only, kept 7 days. Read by `counterparts log` and one doctor line. **Added 2026-09-30**: none of the four processes wired its `onEvent`, so ~270 event names died with their process. |
60
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
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": {
@@ -66,6 +66,7 @@
66
66
  * It exits 0 on every path. Nothing about a failed run may reach the host.
67
67
  */
68
68
  import { readFileSync } from "node:fs";
69
+ import { homedir } from "node:os";
69
70
  import { resolve } from "node:path";
70
71
  import { fileURLToPath } from "node:url";
71
72
 
@@ -102,6 +103,8 @@ import type { LiveEmbedder } from "../embed-client.js";
102
103
  import { DATA_DIR_ENV, SCOPE_ENV, SESSION_ENV, WATCHDOG_ENV } from "../../spawn.js";
103
104
  import { backfillVectors, laggedSemantic } from "../vectors.js";
104
105
  import type { BackfillReport, LagReport } from "../vectors.js";
106
+ import { removeSidebarStatus, sidebarInstalled, writeSidebarStatus } from "../../sidebar-status.js";
107
+ import type { SidebarWrite } from "../../sidebar-status.js";
105
108
  import { runSnapshot } from "../../snapshots.js";
106
109
  import type { SnapshotRunReport } from "../../snapshots.js";
107
110
 
@@ -142,6 +145,9 @@ export interface RunReport {
142
145
  /** The day's retention pass, or why it did not run. Null when the run refused
143
146
  * before it opened a store at all. */
144
147
  readonly retention: RetentionJobReport | null;
148
+ /** The sidebar's status file (`adapters/sidebar-status.ts`), written after the
149
+ * store closed; absent when the run was not asked to (no configuration path). */
150
+ readonly sidebar?: SidebarWrite;
145
151
  }
146
152
 
147
153
  /** What the retention step came to on one worker run. */
@@ -310,6 +316,9 @@ export async function runOnce(input: {
310
316
  /** The package version this run is, for the wake's build stamp. Absent: the
311
317
  * installed manifest's (`installedVersion`). Injected so a test can be an upgrade. */
312
318
  build?: string | null;
319
+ /** The configuration this run read: the sidebar's status file is written
320
+ * beside it once the run is done (`adapters/sidebar-status.ts`). Absent: none. */
321
+ sidebarConfigPath?: string;
313
322
  onEvent?: (name: string, data: Record<string, string | number | boolean | null>) => void;
314
323
  }): Promise<RunReport> {
315
324
  const { config } = input;
@@ -503,7 +512,20 @@ export async function runOnce(input: {
503
512
  }
504
513
  counterpart.close();
505
514
  }
506
- return { ...result, snapshot: snapshotReport, retention: retentionReport };
515
+ // 5. THE SIDEBAR'S STATUS FILE (2026-10-14), last: what the Claude Code
516
+ // sidebar shows, from what every step above left, through a handle of its
517
+ // own (observer) opened after this run's closed. Detached, so no hook waits
518
+ // on it; it never throws.
519
+ let sidebar: SidebarWrite | undefined;
520
+ if (input.sidebarConfigPath !== undefined && input.sidebarConfigPath.length > 0) {
521
+ sidebar = writeSidebarStatus({
522
+ configPath: input.sidebarConfigPath,
523
+ dataDir: config.dataDir,
524
+ ...(config.timeZone === undefined ? {} : { timeZone: config.timeZone }),
525
+ });
526
+ emit("runner.sidebar", { written: sidebar.written, reason: sidebar.reason, bytes: sidebar.bytes, ms: sidebar.ms });
527
+ }
528
+ return { ...result, snapshot: snapshotReport, retention: retentionReport, ...(sidebar === undefined ? {} : { sidebar }) };
507
529
  }
508
530
 
509
531
  /**
@@ -653,12 +675,16 @@ async function main(): Promise<void> {
653
675
  observer: config.observer === true,
654
676
  });
655
677
  log.start();
678
+ const sidebarWanted = sidebarInstalled(process.env, homedir());
679
+ if (!sidebarWanted && removeSidebarStatus(choice.path)) log.event({ name: "runner.sidebar", data: { removed: true } });
656
680
  try {
657
681
  const report = await runOnce({
658
682
  config,
659
683
  signal: controller.signal,
660
684
  ...(pinnedSession() === null ? {} : { session: pinnedSession() as string }),
661
685
  ...(pinnedScope() === null ? {} : { scope: pinnedScope() as string }),
686
+ // Only where the sidebar is installed (the plugin); otherwise an old file goes.
687
+ ...(sidebarWanted ? { sidebarConfigPath: choice.path } : {}),
662
688
  onEvent: (name, data) => log.event({ name, data }),
663
689
  });
664
690
  log.end(report.reason, { swept: report.swept, minted: report.minted, code: report.code });
@@ -51,6 +51,10 @@ export interface HostReading {
51
51
  readonly mcpFile: string;
52
52
  /** The MCP file exists but could not be read or parsed. */
53
53
  readonly mcpUnreadable: boolean;
54
+ /** False: this build does not open the MCP file at all (the plugin
55
+ * directory's, `runtime.ts#readsHostUserConfig`), so there is no MCP clause,
56
+ * and its plugin does not stand down beside the npm install. Absent: read. */
57
+ readonly mcpRead?: boolean;
54
58
  /**
55
59
  * Whether a `claude` executable is on the PATH the caller would run
56
60
  * `counterparts connect` with (the go-public Phase C walk, 2026-09-23).
@@ -281,15 +285,17 @@ export function hostFindings(reading: HostReading): Finding[] {
281
285
  stale: stale.map((s) => `${s.event}→${s.path}`).join(","),
282
286
  settingsRead: reading.settingsRead.join(","),
283
287
  settingsUnreadable: reading.settingsUnreadable.join(","),
284
- mcp: reading.mcp,
285
- mcpFile: reading.mcpFile,
288
+ // Null when this build never opened the MCP file (`mcpRead`).
289
+ mcp: reading.mcpRead === false ? null : reading.mcp,
290
+ mcpFile: reading.mcpRead === false ? null : reading.mcpFile,
286
291
  };
287
292
  // THE PLUGIN (prototype, 2026-10-09). A plugin install wires nothing in
288
293
  // these files — Claude Code loads its hooks and server from the plugin — so
289
294
  // without this the line told a plugin user "no hook of ours is connected,
290
295
  // run counterparts connect", which would wire the host twice. Enabled and
291
- // alone: connected. Enabled beside live npm wiring: the plugin stands down
292
- // (`adapters/plugin.ts`), which works, and is said, with both ways out.
296
+ // alone: connected. Enabled beside live npm wiring: the launcher flavor
297
+ // stands down (`adapters/plugin.ts`), the directory flavor runs beside it
298
+ // (below); either is said, with both ways out.
293
299
  const plugin = reading.plugin !== undefined && reading.plugin !== null && reading.plugin.enabled ? reading.plugin : null;
294
300
  data["plugin"] = plugin === null ? null : plugin.id;
295
301
  const npmAny = reading.events.length > 0 || reading.mcp;
@@ -305,13 +311,26 @@ export function hostFindings(reading: HostReading): Finding[] {
305
311
  ),
306
312
  ];
307
313
  }
314
+ // THE PLUGIN DIRECTORY'S BUILD DOES NOT STAND DOWN (2026-10-14): it never
315
+ // reads `~/.claude.json`, so it cannot tell this wiring is there, and both
316
+ // run, on the same memory, until a marker-based check lands (docs/plugin.md).
317
+ // Known two ways: this doctor IS that build (`mcpRead` false), or the
318
+ // installed plugin is (`standsDown` false, read from its `installPath`, the
319
+ // case of an npm doctor beside it). Unknown (null) keeps the launcher's word.
320
+ const bothRun = plugin !== null && (reading.mcpRead === false || plugin.standsDown === false);
308
321
  const twiceClause =
309
- plugin === null ? "" : `ALSO installed as the Claude Code plugin (${plugin.id}), which stands down while this wiring is live`;
322
+ plugin === null
323
+ ? ""
324
+ : bothRun
325
+ ? `ALSO installed as the Claude Code plugin (${plugin.id}), whose build does not check for the other install, so both are running, on the same memory: every hook and memory tool is wired twice until a later version checks`
326
+ : `ALSO installed as the Claude Code plugin (${plugin.id}), which stands down while this wiring is live`;
310
327
  const twiceFix =
311
328
  plugin === null
312
329
  ? ""
313
- : `Installed twice: to keep only the plugin, run \`counterparts disconnect\` and restart Claude Code; to keep only this install, run \`claude plugin uninstall ${plugin.id}\`. Same memory either way.`;
314
- const mcpClause = reading.mcp
330
+ : `Installed twice${bothRun ? "; remove one" : ""}: to keep only the plugin, run \`counterparts disconnect\` and restart Claude Code; to keep only this install, run \`claude plugin uninstall ${plugin.id}\`. Same memory either way.`;
331
+ const mcpClause = reading.mcpRead === false
332
+ ? ""
333
+ : reading.mcp
315
334
  ? `the MCP server is registered in ${reading.mcpFile}`
316
335
  : reading.mcpUnreadable
317
336
  ? `${reading.mcpFile} could not be read, so the MCP registration could not be checked`
@@ -362,8 +381,8 @@ export function hostFindings(reading: HostReading): Finding[] {
362
381
  // that one case the fix is the line `connect` itself prints: run it wherever
363
382
  // `claude` works. The hooks half, if it is owed, is still `connect`'s.
364
383
  const cannotRegister =
365
- !reading.mcp && !reading.mcpUnreadable && reading.claudeOnPath === false && reading.mcpAddLine !== undefined;
366
- if (!reading.mcp && !reading.mcpUnreadable && !cannotRegister) does.push("registers the memory tools");
384
+ reading.mcpRead !== false && !reading.mcp && !reading.mcpUnreadable && reading.claudeOnPath === false && reading.mcpAddLine !== undefined;
385
+ if (reading.mcpRead !== false && !reading.mcp && !reading.mcpUnreadable && !cannotRegister) does.push("registers the memory tools");
367
386
  const byHand = cannotRegister
368
387
  ? `\`claude\` is not on this PATH, so \`counterparts connect\` cannot register the memory tools: run this where \`claude\` works — ${reading.mcpAddLine ?? ""} — then restart Claude Code.`
369
388
  : "";
@@ -511,10 +511,17 @@ export const PAGE_WRITER_TOOL = "counterparts self_page";
511
511
  * capture (`ritual`, CONTRACT §5 G11) whichever emission shape carried it —
512
512
  * today's `additionalContext`, or the stderr and `reason` shapes older
513
513
  * transcripts hold.
514
+ *
515
+ * RATINGS (2026-10-14; Mike's call, tracking only): one clause asks the
516
+ * session to score the footnotes shown since it last wrote, and every `drewOn`
517
+ * id — `session_end`'s `rated` field says the anchors and the rest. The ids
518
+ * are not listed here: every Stop's injection is noise someone pays for.
514
519
  */
520
+ export const RATE_CLAUSE = "`rated` 0–3 each footnote shown since you last wrote, and each `drewOn` id";
521
+
515
522
  export function stopAsk(sessionId: string, chapter: number): string {
516
523
  return [
517
- `${STOP_ASK_OPENER} 1) hand back what caught your attention since you last wrote, one idea each — what you read, what they said, what happened — with the counterparts session_end tool, session: ${sessionId}. \`handoff\` only if work here is unfinished; \`retireHandoff\` any now done; \`updates\` anything dated or open now done. ${PRONOUN_RULE}`,
524
+ `${STOP_ASK_OPENER} 1) hand back what caught your attention since you last wrote, one idea each — what you read, what they said, what happened — with the counterparts session_end tool, session: ${sessionId}. \`handoff\` only if work here is unfinished; \`retireHandoff\` any now done; \`updates\` anything dated or open now done; ${RATE_CLAUSE}. ${PRONOUN_RULE}`,
518
525
  `2) Write chapter ${String(chapter)} with the counterparts chapter tool, session: ${sessionId}.`,
519
526
  ].join("\n");
520
527
  }
@@ -351,7 +351,10 @@ The standalone verb does not ask either: typing it is the yes.*
351
351
  through `claude mcp add` / `claude mcp remove` as an argument vector, never a shell
352
352
  string. That file is READ to decide whether to call them, and a read that sees nothing
353
353
  does not stop the removal being attempted — the host owns that file and may move it,
354
- so our read is evidence, not authority. `claude` missing is a printed line and exit 0,
354
+ so our read is evidence, not authority (except on the plugin's uninstall that keeps
355
+ the memory, which removes a hook or the registration only when what it runs is gone:
356
+ a blind removal there could take a running npm install's server, 2026-10-14).
357
+ `claude` missing is a printed line and exit 0,
355
358
  never a failed install. *`unwire` is also the one of the three that runs with NO
356
359
  configuration at all: it needs nothing out of the file, and the person most likely to
357
360
  be running it is somebody who deleted `~/.counterparts` by hand and now has five hooks
@@ -1207,6 +1207,14 @@ disk and can hold anything a shell would interpret). One consequence found by th
1207
1207
  loop: `unwire` must attempt `claude mcp remove` **even when our read saw no
1208
1208
  registration**, because that file may move and our read is evidence rather than authority.
1209
1209
  "Tolerate not found" is cheaper than a server left pointed at a store nobody is wiring.
1210
+ The plugin's uninstall on the arms that keep the memory is the exception (`onlyDead`,
1211
+ 2026-10-14): it removes a hook or the registration only when what it runs is gone, so it
1212
+ runs `claude mcp remove` only for a registration read as dead — or, in the directory flavor
1213
+ that never reads the file, when no npm install's `counterparts` is on PATH and no hook of ours there still runs. A blind removal
1214
+ there could take a running npm install's server, which the plugin never registered. A hook or
1215
+ registration that runs the plugin's own files (its root, its data directory, Claude Code's
1216
+ plugins directory: the plugin's console can run `connect`) counts as gone on that route,
1217
+ since it is dead once the plugin is (review of #491).
1210
1218
 
1211
1219
  **`--delete-memories` counts before it warns, and the fallback matters more than the
1212
1220
  count.** A store that will not open on this build — the old-floor `STORE_PRE_ROWS` case,
@@ -3,8 +3,8 @@ import { existsSync, statSync } from "node:fs";
3
3
  import { isDay, localDate, localTime, resolveZone, todayIn } from "../../core/time.js";
4
4
  import { homedir } from "node:os";
5
5
  import { delimiter, join } from "node:path";
6
- import { BOUNDARY_EVENT, RECALL_CREDIT_EVENT, RECALL_DECISION_EVENT } from "../../core/counterpart.js";
7
- import { PROBE_ROW_CEILING, probeOQ4, renderProbe } from "../../core/recall/probe.js";
6
+ import { BOUNDARY_EVENT, MCP_RECALL_EVENT, RECALL_CREDIT_EVENT, RECALL_DECISION_EVENT, RECALL_RATED_EVENT } from "../../core/counterpart.js";
7
+ import { PROBE_ROW_CEILING, probeOQ4, probeRatings, renderProbe, renderRatings } from "../../core/recall/probe.js";
8
8
  // `band` is imported rather than mirrored: the dashboard computes the live
9
9
  // band with this exact function, and two implementations of "which band is this
10
10
  // row in today" is how the two surfaces disagreed in the first place.
@@ -117,9 +117,18 @@ export function probeCommand(dir: string, io: Io, namedDir: boolean): number {
117
117
  const credits = store.eventLog({ name: RECALL_CREDIT_EVENT, order: "desc", limit: PROBE_ROW_CEILING }).reverse();
118
118
  const rows = [...decisions, ...credits].map((r) => ({ name: r.name, day: r.day, payload: r.payload }));
119
119
  for (const line of renderProbe(probeOQ4(rows))) io.out(line);
120
+ // THE RATINGS (2026-10-14; Mike's call, tracking only): what sessions
121
+ // scored of what they were shown, beside the hit rate above.
122
+ const ratings = store.eventLog({ name: RECALL_RATED_EVENT, order: "desc", limit: PROBE_ROW_CEILING }).reverse();
123
+ const lookups = store.eventLog({ name: MCP_RECALL_EVENT, order: "desc", limit: PROBE_ROW_CEILING }).reverse();
124
+ io.out("");
125
+ const rated = [...rows, ...[...ratings, ...lookups].map((r) => ({ name: r.name, day: r.day, payload: r.payload }))];
126
+ for (const line of renderRatings(probeRatings(rated))) io.out(line);
120
127
  for (const [name, got] of [
121
128
  [RECALL_DECISION_EVENT, decisions.length],
122
129
  [RECALL_CREDIT_EVENT, credits.length],
130
+ [RECALL_RATED_EVENT, ratings.length],
131
+ [MCP_RECALL_EVENT, lookups.length],
123
132
  ] as const) {
124
133
  if (got >= PROBE_ROW_CEILING) {
125
134
  io.err(`warning: ${name} hit the ${PROBE_ROW_CEILING}-row ceiling; the oldest rows are missing from this table`);
@@ -1,5 +1,6 @@
1
1
  /** `start-fresh`, its `--undo`, and `rollback` (moved out of `commands.ts`, 2026-10-11). */
2
2
  import { existsSync, renameSync } from "node:fs";
3
+ import { sidebarStatusPath, writeSidebarStatus } from "../sidebar-status.js";
3
4
  import { homedir } from "node:os";
4
5
  import { basename, dirname, isAbsolute, join, resolve } from "node:path";
5
6
  import {
@@ -525,6 +526,13 @@ export async function startFreshCommand(
525
526
 
526
527
  const created = parking ? final.storeDir : installTarget;
527
528
 
529
+ // THE SIDEBAR'S STATUS FILE (2026-10-14) showed the store just set aside, a
530
+ // few of its memories' words included: written again, now, for the new one
531
+ // (which is nothing yet). Only where there is one: the sidebar is installed.
532
+ if (existsSync(sidebarStatusPath(configPath))) {
533
+ writeSidebarStatus({ configPath, dataDir: created, ...(host.config.timeZone === undefined ? {} : { timeZone: host.config.timeZone }) });
534
+ }
535
+
528
536
  // ── the record the new store keeps of its own beginning ───────────────────
529
537
  //
530
538
  // Box 2's meta table, which is this store's general-purpose key space. NOT a
@@ -39,7 +39,7 @@ import { existsSync, readFileSync } from "node:fs";
39
39
  import { dirname } from "node:path";
40
40
 
41
41
  import { CONFIG_ENV } from "../config-path.js";
42
- import { scriptArgs } from "../runtime.js";
42
+ import { readsHostUserConfig, scriptArgs } from "../runtime.js";
43
43
  import { BIN, desktopConfigPath, hostConfigBase, hostMcpFile, isOurDesktopEntry, MCP_SCRIPT, MCP_SERVER_NAME } from "./install.js";
44
44
  import { sightSettings, tilde, unparsedSettingsWhy, writeSettings } from "./wire.js";
45
45
 
@@ -288,15 +288,20 @@ function dataDirOf(entry: unknown): string | null {
288
288
 
289
289
  /**
290
290
  * READ DESKTOP'S CONFIG FOR DOCTOR — two small file reads, never a write:
291
- * Desktop's own file, and Claude Code's `~/.claude.json` for the name clash.
291
+ * Desktop's own file, and Claude Code's `~/.claude.json` for the name clash —
292
+ * not opened by the plugin directory's build (`runtime.ts#readsHostUserConfig`),
293
+ * which then reports no clash.
292
294
  */
293
- export function readDesktop(home: string, env: Record<string, string | undefined> = {}): DesktopConfigReading {
295
+ export function readDesktop(
296
+ home: string,
297
+ env: Record<string, string | undefined> = {},
298
+ readsUserConfig: boolean = readsHostUserConfig(),
299
+ ): DesktopConfigReading {
294
300
  const path = desktopConfigPath(home);
295
301
  const read = readObject(path);
296
302
  const servers = read.value["mcpServers"];
297
303
  const ours = isRecord(servers) ? servers[MCP_SERVER_NAME] : undefined;
298
- const code = readObject(hostMcpFile(hostConfigBase(home, env)));
299
- const codeServers = code.value["mcpServers"];
304
+ const codeServers = readsUserConfig ? readObject(hostMcpFile(hostConfigBase(home, env))).value["mcpServers"] : undefined;
300
305
  const codeOurs = isRecord(codeServers) ? codeServers[MCP_SERVER_NAME] : undefined;
301
306
  return {
302
307
  path,
@@ -377,6 +377,9 @@ export const COMMAND_DETAIL: Record<string, readonly string[]> = {
377
377
  "probe-oq4": [
378
378
  "recall CONTRACT §7. The footnote header is the one string the probe varies",
379
379
  "(recall/render.ts).",
380
+ "",
381
+ "Then the ratings: what sessions scored, 0 to 3, of what they were shown, by",
382
+ "date and lane, beside drewOn and the hit rate. Tracking only.",
380
383
  ],
381
384
  mechanisms: [
382
385
  "One line per memory mechanism: ● working this week, ◐ built but not firing,",
@@ -470,9 +473,10 @@ export const COMMAND_DETAIL: Record<string, readonly string[]> = {
470
473
  "A settings file it cannot parse is a refusal: it changes nothing and",
471
474
  "prints the block for you to merge by hand.",
472
475
  "",
473
- "The MCP server is registered by running `claude mcp add`; it never writes",
474
- "~/.claude.json itself, because Claude Code owns that file. If `claude` is",
475
- "not on your PATH the hooks still go in and the line is printed for you.",
476
+ "The MCP server is registered by running `claude mcp add`; it never edits",
477
+ "Claude Code's user configuration file itself, because Claude Code owns it.",
478
+ "If `claude` is not on your PATH the hooks still go in and the line is",
479
+ "printed for you.",
476
480
  "",
477
481
  "Claude Code is the one host it knows today, so `counterparts connect` and",
478
482
  "`counterparts connect claude-code` are the same thing and any other name",
@@ -59,7 +59,7 @@ export const DEFAULT_STORE_DIR = "store";
59
59
  import { EMBEDDER_KINDS } from "../config.js";
60
60
  import type { EmbedderKind } from "../config.js";
61
61
  import { CONFIG_ENV, CONFIG_FLAG, defaultConfigPath } from "../config-path.js";
62
- import { entryScript, parseScriptInvocation, runtimeOf, runtimePresent, scriptArgs, shellTokens } from "../runtime.js";
62
+ import { entryScript, parseScriptInvocation, readsHostUserConfig, runtimeOf, runtimePresent, scriptArgs, shellTokens } from "../runtime.js";
63
63
  import type { RuntimeKind } from "../runtime.js";
64
64
  import { pluginInstall, readOurHook } from "../host-wiring.js";
65
65
  import type { PluginInstallRead } from "../host-wiring.js";
@@ -577,6 +577,10 @@ export interface HostRead {
577
577
  readonly mcpName: string;
578
578
  readonly mcpFile: string;
579
579
  readonly mcpUnreadable: boolean;
580
+ /** False when this build does not open the MCP file at all
581
+ * (`runtime.ts#readsHostUserConfig`, the plugin directory's bundle): `mcp`
582
+ * is then "not looked", never "not registered". */
583
+ readonly mcpRead: boolean;
580
584
  /** The runtimes our hook commands and our MCP registration name, one row
581
585
  * per distinct executable (`adapters/runtime.ts`), and whether each is there. */
582
586
  readonly runtimes: readonly HostRuntime[];
@@ -763,6 +767,7 @@ export function readHost(
763
767
  home: string,
764
768
  cwd: string,
765
769
  env: Record<string, string | undefined> = process.env,
770
+ readsUserConfig: boolean = readsHostUserConfig(),
766
771
  ): HostRead {
767
772
  const base = hostConfigBase(home, env);
768
773
  const events = new Set<string>();
@@ -829,7 +834,8 @@ export function readHost(
829
834
  }
830
835
  }
831
836
  const mcpFile = hostMcpFile(base);
832
- const mcpRead = readJsonFile(mcpFile);
837
+ // Not opened by the plugin directory's build (`runtime.ts#readsHostUserConfig`).
838
+ const mcpRead: ReturnType<typeof readJsonFile> = readsUserConfig ? readJsonFile(mcpFile) : { state: "absent", value: {} };
833
839
  const servers = mcpRead.value["mcpServers"];
834
840
  const mcp =
835
841
  servers !== null &&
@@ -869,6 +875,7 @@ export function readHost(
869
875
  mcpName: MCP_SERVER_NAME,
870
876
  mcpFile,
871
877
  mcpUnreadable: mcpRead.state === "unreadable",
878
+ mcpRead: readsUserConfig,
872
879
  runtimes: [...runtimes.entries()].map(([exe, row]) => ({
873
880
  exe,
874
881
  kind: row.kind,
@@ -120,16 +120,23 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
120
120
  id: "emotional",
121
121
  evidence: ["feelings", "emotion-weight", "mood-match"],
122
122
  // Emotion part A (2026-09-26): a memory's strongest feeling lifts it and
123
- // slows its fading, and a recorded mood lifts matching memories in recall.
123
+ // slows its fading. Since 2026-10-14 it fires when a memory is saved with
124
+ // a feeling or one carrying a feeling comes to mind; the mood match (off
125
+ // by decision since 2026-10-10) is said only when it counted.
124
126
  read: (v, rows) => {
125
127
  const weighted = rows("emotion-weight")?.total ?? 0;
126
128
  const withFeelings = rows("feelings")?.total ?? 0;
129
+ const felt = part(v, "felt");
130
+ const feltRecalled = part(v, "feltRecalled");
127
131
  const newWeighted = part(v, "weighted");
128
132
  const matched = part(v, "moodMatched");
129
133
  const held = `${plural(weighted, "memory", "memories")} held higher and fading slower (${String(withFeelings)} with recorded feelings)`;
130
134
  if (v.fired) {
131
135
  const parts: string[] = [];
132
- if (newWeighted > 0) parts.push(`${plural(newWeighted, "new memory", "new memories")} carrying feeling`);
136
+ // Saved with a feeling and new memories carrying one overlap: the first is said when it counted.
137
+ if (felt > 0) parts.push(`${plural(felt, "memory", "memories")} saved with a feeling`);
138
+ else if (newWeighted > 0) parts.push(`${plural(newWeighted, "new memory", "new memories")} carrying feeling`);
139
+ if (feltRecalled > 0) parts.push(`${plural(feltRecalled, "turn", "turns")} brought one carrying a feeling to mind`);
133
140
  if (matched > 0) parts.push(`${plural(matched, "memory", "memories")} a matching mood brought closer`);
134
141
  return { light: LIGHT.working, says: `${parts.join("; ")}; ${held}` };
135
142
  }
@@ -79,6 +79,7 @@ import type {
79
79
  // destruction path. It is reachable by importing the seam on purpose, never by
80
80
  // holding a `Store` (INTERFACE-GAPS §1, closed 2026-08-25).
81
81
  import { chaseRemoved } from "../../core/store/owner-op-seam.js";
82
+ import { chaseSidebarStatus } from "../sidebar-status.js";
82
83
  // The page has its own door out (`self-page --clear`), and removal is not it.
83
84
  import { isSelfPageRow } from "../../core/self/page.js";
84
85
 
@@ -1061,6 +1062,12 @@ export function ownerRemoval(
1061
1062
  // have already gone.
1062
1063
  chaseWriteAheadLog(store.dir, chased, unchased);
1063
1064
 
1065
+ // THE SIDEBAR'S STATUS FILE (2026-10-14) holds a few memories' words for the
1066
+ // Claude Code sidebar, beside the configuration: deleted when it names this
1067
+ // one, and written again without it (`adapters/sidebar-status.ts`).
1068
+ const sidebar = chaseSidebarStatus(store.dir, request.targetId);
1069
+ if (sidebar !== null) (sidebar.chased ? chased : unchased).push(sidebar.line);
1070
+
1064
1071
  // THE DURABLE RECORD MUST NOT CLAIM MORE THAN THE CONSOLE (third review's
1065
1072
  // open question). The record's stages carry no surface list, so `complete`
1066
1073
  // has always meant "the ceremony finished", not "everything was reached" —