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.
Files changed (75) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/CONSTITUTION.md +6 -4
  3. package/README.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/docs/manual.md +123 -0
  6. package/docs/module-map.md +2 -1
  7. package/package.json +2 -1
  8. package/src/adapters/claude-code/NOTES.md +2 -1
  9. package/src/adapters/claude-code/doctor.ts +21 -7
  10. package/src/adapters/claude-code/night-catch-up.ts +2 -0
  11. package/src/adapters/claude-code/transcript.ts +60 -6
  12. package/src/adapters/cli/commands-install.ts +9 -4
  13. package/src/adapters/cli/commands-readings.ts +10 -2
  14. package/src/adapters/cli/commands.ts +3 -2
  15. package/src/adapters/cli/help.ts +2 -1
  16. package/src/adapters/cli/uninstall.ts +21 -4
  17. package/src/adapters/dashboard/web/pages/memories/index.js +4 -2
  18. package/src/adapters/dashboard/web/views/memories.ts +8 -2
  19. package/src/adapters/dashboard/web/views/overview.ts +14 -3
  20. package/src/adapters/dashboard/web/views/today.ts +3 -1
  21. package/src/adapters/hosts.ts +26 -4
  22. package/src/adapters/lifecycle.ts +9 -2
  23. package/src/adapters/mcp/NOTES.md +43 -0
  24. package/src/adapters/mcp/facts.ts +23 -6
  25. package/src/adapters/mcp/manual.ts +145 -0
  26. package/src/adapters/mcp/meaning.ts +7 -2
  27. package/src/adapters/mcp/server-self-tools.ts +7 -2
  28. package/src/adapters/mcp/server-words.ts +3 -3
  29. package/src/adapters/mcp/server.ts +71 -15
  30. package/src/adapters/mcp/tools.ts +75 -13
  31. package/src/adapters/mcp/write-up.ts +3 -1
  32. package/src/adapters/plugin-run.sh +32 -8
  33. package/src/adapters/remote/http.ts +6 -1
  34. package/src/adapters/sessions.ts +14 -0
  35. package/src/adapters/update-check.ts +1 -1
  36. package/src/core/counterpart-wake-news.ts +230 -0
  37. package/src/core/counterpart-wake-shape.ts +95 -17
  38. package/src/core/counterpart.ts +21 -1
  39. package/src/core/dream/NOTES.md +9 -0
  40. package/src/core/dream/index.ts +4 -0
  41. package/src/core/dream/reflect.ts +4 -2
  42. package/src/core/onboarding.ts +43 -13
  43. package/src/core/recall/CONTRACT.md +1 -1
  44. package/src/core/recall/INTERFACE-GAPS.md +1 -1
  45. package/src/core/recall/NOTES.md +110 -0
  46. package/src/core/recall/activate.ts +28 -5
  47. package/src/core/recall/gate.ts +63 -12
  48. package/src/core/recall/habituation.ts +15 -2
  49. package/src/core/recall/index.ts +10 -2
  50. package/src/core/recall/session.ts +9 -3
  51. package/src/core/recall/tunables.ts +8 -2
  52. package/src/core/remember/CONTRACT.md +5 -0
  53. package/src/core/remember/spans.ts +12 -1
  54. package/src/core/schemas/index.ts +2 -2
  55. package/src/core/self/CONTRACT.md +1 -1
  56. package/src/core/self/NOTES.md +54 -0
  57. package/src/core/self/briefing-delivery.ts +16 -4
  58. package/src/core/self/identity.ts +4 -0
  59. package/src/core/self/index.ts +4 -1
  60. package/src/core/self/journal-file.ts +2 -1
  61. package/src/core/self/tunables.ts +34 -2
  62. package/src/core/self/writer.ts +9 -2
  63. package/src/core/sleep/CONTRACT.md +4 -2
  64. package/src/core/sleep/consolidate.ts +8 -0
  65. package/src/core/sleep/cycle.ts +20 -0
  66. package/src/core/sleep/types.ts +7 -0
  67. package/src/core/store/CONTRACT.md +1 -1
  68. package/src/core/store/NOTES.md +9 -1
  69. package/src/core/store/index.ts +27 -4
  70. package/src/core/store/reads-memories.ts +44 -1
  71. package/src/core/store/shapes.ts +10 -0
  72. package/src/core/store/tag-reads.ts +3 -0
  73. package/src/core/told.ts +249 -0
  74. package/src/core/types.ts +5 -0
  75. package/tools/install-loop/run.sh +21 -7
@@ -642,7 +642,7 @@ export const COMMAND_BLURB: Record<Command, string> = {
642
642
  "Disconnect an AI: take the Counterparts hooks back out of the host's settings file and deregister the memory server. It removes only what it recognises as ours; another tool's hooks are never candidates. Your memory is not touched.",
643
643
  uninstall:
644
644
  "Leave: disconnect Claude Code, then say where your memory still is and how to remove the package. At a terminal it then asks whether to delete your memory too (Enter keeps it; a yes asks you to type a phrase). Otherwise it never touches your memory unless you say --park (one rename, dated) or --delete-memories (which counts first and asks you to type a phrase).",
645
- init: "Just a store: create a data dir and PRINT the install steps. For a second store or a scratch one.",
645
+ init: "init makes a bare store, with no starter notes; install sets up yours. It creates a data dir and PRINTS the install steps: for a second store or a scratch one.",
646
646
  "start-fresh":
647
647
  "Begin again as a stranger (or --undo to put the parked store back): park the store your configuration names beside itself under a dated name, park its snapshots the same way, and create a blank store at the same path. One atomic rename each — it never copies, never deletes, and never opens the old store, not even read-only. The configuration is kept byte for byte.",
648
648
  rollback:
@@ -650,7 +650,8 @@ export const COMMAND_BLURB: Record<Command, string> = {
650
650
  note: "Remember this, deliberately — the same two doors the MCP tool uses.",
651
651
  ask: "Ask memory a question. Read-only.",
652
652
  recall: "Ask memory a question — the same command as `ask`, under its older name. Read-only.",
653
- export: "A portable copy of the store, encrypted unless you say otherwise.",
653
+ export:
654
+ "A portable copy of the store. --passphrase encrypts it; --plaintext says on purpose that it is not encrypted. With neither, it refuses.",
654
655
  backup: "Snapshot: the canonical DB via VACUUM INTO. The cache is excluded, and so is conversation text: backups never hold it.",
655
656
  remove:
656
657
  "The loud removal. With nothing after it, at a terminal, it asks for a memory id or for words to search for, numbers what it finds, lets you pick one or several (or name several ids outright), shows the plan for each, and asks once before it deletes them. --confirm is the scripted door: that exact id, confirmed by typing it back. Anywhere a person cannot be asked — a pipe, a redirect, a CI job — and without --confirm, it prints the plan and changes nothing.",
@@ -119,7 +119,7 @@ export const SHORT: Record<string, string | readonly string[]> = {
119
119
  scope: "Choose which folders it remembers",
120
120
  uninstall: "Remove Counterparts; keeps your memory unless you say otherwise",
121
121
  // ── your data ──
122
- export: "A copy of your memory you can take anywhere, encrypted by default",
122
+ export: "A copy of your memory you can take anywhere, encrypted with --passphrase",
123
123
  backup: "Save a snapshot of your memory to a folder",
124
124
  remove: "Delete one memory for good",
125
125
  delete: "Delete one kind of data: conversation text, backups or the activity log",
@@ -353,6 +353,7 @@ export const COMMAND_DETAIL: Record<string, readonly string[]> = {
353
353
  "connect again.",
354
354
  ],
355
355
  init: [
356
+ "init makes a bare store, with no starter notes; install sets up yours.",
356
357
  "No host config, nothing under ~/.counterparts/ — that",
357
358
  "is what install is for.",
358
359
  ],
@@ -124,6 +124,7 @@ import { confirm, typed, ui } from "./ui.js";
124
124
  import type { Ui } from "./ui.js";
125
125
  import type { Outcome, ProcessLister, Spawner, WireInput, WireResult } from "./wire.js";
126
126
  import { look, readMcp, tilde, unwire } from "./wire.js";
127
+ import { isTold } from "../../core/told.js";
127
128
 
128
129
  /** The phrase `--delete-memories` asks for, exactly. Case-sensitive, and
129
130
  * nothing is trimmed but the end-of-line (`ui.ts#typed`). */
@@ -274,6 +275,9 @@ export type Census =
274
275
  /** Beliefs, entities and the self page — `status`'s second population.
275
276
  * Reported so a warning is never the bare word "0" while a store goes. */
276
277
  readonly schemas: number;
278
+ /** Of `memories`: the starter memories (S1, `core/told.ts`), which the
279
+ * count includes and always says (ROADMAP, 11-03). */
280
+ readonly told: number;
277
281
  }
278
282
  | { readonly kind: "size"; readonly bytes: number; readonly why: string };
279
283
 
@@ -384,6 +388,17 @@ export function grouped(n: number): string {
384
388
  return n.toLocaleString("en-US");
385
389
  }
386
390
 
391
+ /**
392
+ * The starter memories inside a count, said (S1; ROADMAP, 11-03): `, 11 of
393
+ * them starter notes` (or ` (11 of them starter notes)` in a sentence), so a
394
+ * count that includes them never passes them off as lived. Empty when none.
395
+ */
396
+ export function starterPart(told: number, of: number, lead: ", " | " ("): string {
397
+ if (told <= 0) return "";
398
+ const words = of === 1 ? "a starter note" : told === 1 ? "1 of them a starter note" : `${grouped(told)} of them starter notes`;
399
+ return lead === ", " ? `, ${words}` : ` (${words})`;
400
+ }
401
+
387
402
  /** `1,204 memories`, and `1 memory`. A brand-new install holds exactly one — its
388
403
  * identity core — so "1 memories" was what somebody leaving after five minutes
389
404
  * actually read. */
@@ -425,6 +440,7 @@ export function censusOf(base: string, storeDir: string | null): Census {
425
440
  try {
426
441
  const denied = new Set(opened.deniedIds());
427
442
  let live = 0;
443
+ let told = 0;
428
444
  let journal = 0;
429
445
  let schemas = 0;
430
446
  for (const id of opened.list()) {
@@ -441,8 +457,9 @@ export function censusOf(base: string, storeDir: string | null): Census {
441
457
  continue;
442
458
  }
443
459
  live += 1;
460
+ if (isTold(row)) told += 1;
444
461
  }
445
- return { kind: "memories", memories: live, journal, schemas };
462
+ return { kind: "memories", memories: live, journal, schemas, told };
446
463
  } finally {
447
464
  opened.close();
448
465
  }
@@ -476,7 +493,7 @@ export function censusWords(census: Census): string {
476
493
  census.journal === 0
477
494
  ? ""
478
495
  : `, ${grouped(census.journal)} journal entr${census.journal === 1 ? "y" : "ies"}`;
479
- if (census.memories > 0) return `${memories(census.memories)}${journal}`;
496
+ if (census.memories > 0) return `${memories(census.memories)}${starterPart(census.told, census.memories, ", ")}${journal}`;
480
497
  const rest =
481
498
  census.schemas === 0
482
499
  ? ""
@@ -1377,7 +1394,7 @@ export async function uninstall(input: UninstallInput): Promise<Outcome> {
1377
1394
  const where = tilde(input.config.dataDir ?? join(configDir, "store"), home);
1378
1395
  u.ok(
1379
1396
  kept.kind === "memories"
1380
- ? `${memories(kept.memories)} ${kept.memories === 1 ? "is" : "are"} still at ${where}.`
1397
+ ? `${memories(kept.memories)}${starterPart(kept.told, kept.memories, " (")} ${kept.memories === 1 ? "is" : "are"} still at ${where}.`
1381
1398
  : `everything is still at ${tilde(configDir, home)} (${humanBytes(kept.bytes)}).`,
1382
1399
  );
1383
1400
  if (offers(input)) return offerDelete(input, u, removed, viaPlugin ? wireInput : null);
@@ -1729,7 +1746,7 @@ function deletePlan(input: UninstallInput, u: Ui, plan: UninstallPlan): Outcome
1729
1746
  if (plan.storeActed) {
1730
1747
  u.hint(
1731
1748
  plan.census !== null && plan.census.kind === "memories"
1732
- ? `${memories(plan.census.memories)} ${plan.census.memories === 1 ? "is" : "are"} gone with it.`
1749
+ ? `${memories(plan.census.memories)}${starterPart(plan.census.told, plan.census.memories, " (")} ${plan.census.memories === 1 ? "is" : "are"} gone with it.`
1733
1750
  : "Your memory went with it.",
1734
1751
  );
1735
1752
  } else {
@@ -48,8 +48,10 @@ async function render() {
48
48
  * same number the list's "kept" chip and the home headline say. A zero "new
49
49
  * today" is left out, as on Home. */
50
50
  export function count(d) {
51
- if (d.total === 0) return "Nothing held yet. Add a memory, or just talk.";
52
- return d.total + (d.total === 1 ? " memory" : " memories") + (d.newToday > 0 ? " · " + d.newToday + " new today" : "");
51
+ // The starter notes said apart (S1): "0 memories · 11 starter notes".
52
+ const starter = d.starter > 0 ? " · " + d.starter + (d.starter === 1 ? " starter note" : " starter notes") : "";
53
+ if (d.total === 0 && starter === "") return "Nothing held yet. Add a memory, or just talk.";
54
+ return d.total + (d.total === 1 ? " memory" : " memories") + starter + (d.newToday > 0 ? " · " + d.newToday + " new today" : "");
53
55
  }
54
56
 
55
57
  /** Who "I" am, once: "I'm Claude. This is what I've kept from working with Mike." */
@@ -55,6 +55,8 @@ export interface MemoriesView {
55
55
  readonly owner: string | null;
56
56
  /** Of `total`: memories proper — the number `counterparts status` prints. */
57
57
  readonly memories: number;
58
+ /** The starter memories (S1), apart from `total` and `memories`; they are in `points`. */
59
+ readonly starter: number;
58
60
  /** Of `total`: entities and beliefs about them (schema rows). */
59
61
  readonly schemas: number;
60
62
  /** How firmly what I hold is held: firm / settling / fading, over every live
@@ -157,6 +159,8 @@ export function memoriesView(src: DashboardSource, opts: { limit?: number } = {}
157
159
  const store = src.store;
158
160
  const day = store.livedDay();
159
161
  const rows = census(src);
162
+ const toldIds = new Set(store.toldIds());
163
+ const starter = rows.filter((r) => toldIds.has(r.id)).length;
160
164
  const limit = opts.limit ?? 4000;
161
165
  const byKind = countMap<Kind>(rows, "kind");
162
166
  const everLived = day > 0 || rows.length > 0;
@@ -202,10 +206,12 @@ export function memoriesView(src: DashboardSource, opts: { limit?: number } = {}
202
206
 
203
207
  return {
204
208
  day,
205
- total: rows.length,
209
+ // The starter memories apart (S1): the list shows them, the count doesn't claim them.
210
+ total: rows.length - starter,
206
211
  newToday: newTodayOf(src),
207
212
  owner: ownerOf(src),
208
- memories: rows.filter((r) => !r.schema).length,
213
+ memories: rows.filter((r) => !r.schema).length - starter,
214
+ starter,
209
215
  schemas: rows.filter((r) => r.schema).length,
210
216
  hold,
211
217
  nearLetGoDays: NEAR_LET_GO_DAYS,
@@ -24,6 +24,7 @@ import { selfMap } from "./self-map.js";
24
24
  import type { SelfMap } from "./self-map.js";
25
25
  import { todayView } from "./today.js";
26
26
  import type { TodayView } from "./today.js";
27
+ import { starterNotes } from "../../../../core/told.js";
27
28
 
28
29
  // ─────────────────────────────────────────────────────────────────────────────
29
30
  // overview
@@ -51,14 +52,18 @@ export interface Hero {
51
52
  readonly memories: number;
52
53
  /** Memories written today (`todayView`'s `newToday`). */
53
54
  readonly newToday: number;
55
+ /** The starter memories (S1), counted apart from `memories`. */
56
+ readonly starter: number;
54
57
  }
55
58
 
56
59
  /** The headline, in short parts joined by a dot. A zero "new today" is left out. */
57
- export function heroHeadline(x: { day: number; lived: boolean; owner: string | null; memories: number; newToday: number }): string {
60
+ export function heroHeadline(x: { day: number; lived: boolean; owner: string | null; memories: number; newToday: number; starter?: number }): string {
58
61
  const parts = [
59
62
  x.lived ? `Day ${x.day}${x.owner === null ? "" : ` with ${x.owner}`}` : "Nothing lived yet",
60
63
  `${x.memories} ${x.memories === 1 ? "memory" : "memories"}`,
61
64
  ];
65
+ // The starter notes apart (S1; ROADMAP, 11-03): day one never claims memories nobody made.
66
+ if ((x.starter ?? 0) > 0) parts.push(starterNotes(x.starter ?? 0));
62
67
  if (x.newToday > 0) parts.push(`${x.newToday} new today`);
63
68
  return parts.join(" · ");
64
69
  }
@@ -122,7 +127,12 @@ export interface OverviewView {
122
127
  export function overviewView(src: DashboardSource, feedLimit = FEED_LIMIT): OverviewView {
123
128
  const store = src.store;
124
129
  const day = store.livedDay();
125
- const rows = census(src);
130
+ // THE STARTER MEMORIES ARE COUNTED APART (S1): told, not lived, so neither
131
+ // the headline's number nor "I am holding" includes them.
132
+ const toldIds = new Set(store.toldIds());
133
+ const all = census(src);
134
+ const rows = all.filter((r) => !toldIds.has(r.id));
135
+ const starter = all.length - rows.length;
126
136
  // A SCHEMA ROW IS NOT A MEMORY. The census keeps both, because the bands and
127
137
  // kinds below are true of both and the physics runs on both — but the number
128
138
  // in the headline tile is the one a person compares against the console, and
@@ -209,9 +219,10 @@ export function overviewView(src: DashboardSource, feedLimit = FEED_LIMIT): Over
209
219
  const memories = rows.length;
210
220
  const today = todayView(src);
211
221
  const hero: Hero = {
212
- headline: heroHeadline({ day, lived: !(day === 0 && rows.length === 0), owner: ownerName(src), memories, newToday: today.newToday }),
222
+ headline: heroHeadline({ day, lived: !(day === 0 && rows.length === 0), owner: ownerName(src), memories, newToday: today.newToday, starter }),
213
223
  memories,
214
224
  newToday: today.newToday,
225
+ starter,
215
226
  };
216
227
 
217
228
  return {
@@ -23,6 +23,7 @@ import { isJournal } from "../../../../core/sleep/index.js";
23
23
  import type { DashboardSource } from "../../source.js";
24
24
  import { reveal } from "../reveal.js";
25
25
  import { isChapterMemory } from "./memory-words.js";
26
+ import { isTold } from "../../../../core/told.js";
26
27
 
27
28
  /** At most this many lines, the "and N more" line included. */
28
29
  export const TODAY_LINES = 6;
@@ -62,7 +63,8 @@ function writtenOn(src: DashboardSource, from: number): Map<number, { id: string
62
63
  const out = new Map<number, { id: string; at: number }[]>();
63
64
  for (const id of src.store.list({ archived: false })) {
64
65
  const row = src.store.row(id);
65
- if (row === undefined || row.type !== "memory" || isJournal(row) || isChapterMemory(row)) continue;
66
+ // A starter memory (S1) was told at birth, not written that day.
67
+ if (row === undefined || row.type !== "memory" || isJournal(row) || isChapterMemory(row) || isTold(row)) continue;
66
68
  if (row.birth_day < from) continue;
67
69
  const list = out.get(row.birth_day) ?? [];
68
70
  list.push({ id, at: typeof row.created_at === "number" ? row.created_at : 0 });
@@ -198,6 +198,16 @@ export interface HostWording {
198
198
  readonly offRefusal: (at: RefusalPlace) => string;
199
199
  /** The same while it is PAUSED. */
200
200
  readonly pausedRefusal: (at: RefusalPlace) => string;
201
+ /** The `scope` tool's read, when this place (or a parent) has a setting. */
202
+ readonly scopeReadSet: string;
203
+ /** The same when nothing is set, so it is on by default. */
204
+ readonly scopeReadUnset: string;
205
+ /**
206
+ * Does a `scope` result name the registry file's path? Where the person can
207
+ * open that file it helps; claude.ai's is the server's, a path its person
208
+ * can do nothing with.
209
+ */
210
+ readonly scopeShowsRegistry: boolean;
201
211
  }
202
212
 
203
213
  /**
@@ -251,6 +261,9 @@ export const HOST_WORDING: Readonly<Record<string, HostWording>> = {
251
261
  at.inherited === null
252
262
  ? `Counterparts is paused for this directory (${at.here}). Nothing is recorded or read here until it is resumed — call \`scope\` with mode \`resume\`, or run \`${at.entryCommand("--resume")}\`.`
253
263
  : `Counterparts is paused for ${at.inherited}, which includes this directory (${at.here}). Nothing is recorded or read here until it is resumed — run \`${at.entryCommand("--resume")}\`. The \`scope\` tool sets only this directory: mode \`resume\` refuses here, and mode \`on\` turns this directory on alone while ${at.inherited} stays paused.`,
264
+ scopeReadSet: "This is what the host's scope registry says about this directory.",
265
+ scopeReadUnset: "Nothing is set for this directory or any parent, so it is on by default. Ask the user before setting it.",
266
+ scopeShowsRegistry: true,
254
267
  },
255
268
  // Desktop has no `/mcp` and no hooks: the one server every chat talks to is
256
269
  // started with the app, so a newer build loads when the app does.
@@ -267,6 +280,9 @@ export const HOST_WORDING: Readonly<Record<string, HostWording>> = {
267
280
  `Counterparts is off for Claude Desktop's chats. Nothing is recorded or read here — call \`scope\` with mode \`on\`, or run \`${at.hereCommand("--on")}\`.`,
268
281
  pausedRefusal: (at) =>
269
282
  `Counterparts is paused for Claude Desktop's chats. Nothing is recorded or read here until it is resumed — call \`scope\` with mode \`resume\`, or run \`${at.entryCommand("--resume")}\`.`,
283
+ scopeReadSet: "This is what the host's scope registry says about this directory.",
284
+ scopeReadUnset: "Nothing is set for this directory or any parent, so it is on by default. Ask the user before setting it.",
285
+ scopeShowsRegistry: true,
270
286
  },
271
287
  // claude.ai has no app to reopen and no `/mcp`: the server behind the
272
288
  // connector is a process somebody started, and a newer build loads when it
@@ -278,10 +294,16 @@ export const HOST_WORDING: Readonly<Record<string, HostWording>> = {
278
294
  "claude.ai's chats are no longer recorded or read. Every other tool will refuse until it is turned back on — including in a new chat, which is the point.",
279
295
  scopeOn:
280
296
  "Recorded. This takes effect immediately, for every tool in every claude.ai chat. Nothing is collected from before now: claude.ai keeps no transcript here, so only what is written through the tools is remembered.",
281
- offRefusal: (at) =>
282
- `Counterparts is off for claude.ai's chats. Nothing is recorded or read here — call \`scope\` with mode \`on\`, or run \`${at.hereCommand("--on")}\`.`,
283
- pausedRefusal: (at) =>
284
- `Counterparts is paused for claude.ai's chats. Nothing is recorded or read here until it is resumed — call \`scope\` with mode \`resume\`, or run \`${at.entryCommand("--resume")}\`.`,
297
+ // NO TERMINAL HERE (2026-11-03, the 11-03 reviews): a claude.ai person has
298
+ // no `counterparts scope` to run, and on hosted one account is one memory
299
+ // (ROADMAP's words). The `scope` tool is the whole way back.
300
+ offRefusal: () =>
301
+ "Counterparts' memory is off for claude.ai. Nothing is recorded or read until it is turned back on — call `scope` with mode `on` when the person says.",
302
+ pausedRefusal: () =>
303
+ "Counterparts' memory is paused for claude.ai. Nothing is recorded or read until it is resumed — call `scope` with mode `resume` when the person says.",
304
+ scopeReadSet: "One account is one memory: they can pause it or turn it off, and back on. This is what it is set to now.",
305
+ scopeReadUnset: "One account is one memory: they can pause it or turn it off, and back on. Nothing is set, so it is on.",
306
+ scopeShowsRegistry: false,
285
307
  },
286
308
  };
287
309
 
@@ -961,9 +961,16 @@ export class Lifecycle implements HostLifecycle {
961
961
  const none = { context: "", notices: [], due: [] };
962
962
  if (input.at === undefined || input.nightRun === true) return none;
963
963
  try {
964
- const all = this.counterpart.plainDueToday({ at: input.at });
964
+ // The setting, read at most once, and only when something is due (the
965
+ // settle's fence asks it first when a done row could settle one).
966
+ const read: { on?: FolderOn | undefined } = {};
967
+ const folders = (): FolderOn | undefined => {
968
+ if (!("on" in read)) read.on = this.writeUpFolders();
969
+ return read.on;
970
+ };
971
+ const all = this.counterpart.plainDueToday({ at: input.at, scope: input.scope, folders });
965
972
  if (all.length === 0) return none;
966
- const on = this.writeUpFolders();
973
+ const on = folders();
967
974
  const held = on === undefined ? new Set<string>() : this.counterpart.plainHeldBack(all.map((r) => r.memoryId), on, input.scope);
968
975
  const due = all.filter((r) => !held.has(r.memoryId));
969
976
  return {
@@ -1981,3 +1981,46 @@ its own small PR, after a look at its live use.
1981
1981
  - **Not tested, not claimed:** whether claude.ai skips a permission prompt for a read-only tool at all. Nothing here can
1982
1982
  observe claude.ai's prompts. If Mike was asked about Memory status too on that first use, the hint wasn't what
1983
1983
  decided it. The real fix for the prompts (an "Always allow" line on the setup page) is the site's.
1984
+
1985
+ ## 2026-11-03 — the manual, behind a recall handle (H1)
1986
+
1987
+ `docs/manual.md` is how Counterparts works and how to use it, for the counterpart first.
1988
+ The door is `recall`'s handle `manual` (the index: each section's first sentence and the
1989
+ exact handle that opens it) and `manual <section>` (heading in any case, or its number),
1990
+ served from `manual.ts`. A handle, not a tool: a twelfth description would be read by every
1991
+ session, and the handle costs one sentence in `recall`'s `handle` description (175 bytes of
1992
+ `tools/list` on each host) plus one clause in the Desktop and claude.ai `instructions`
1993
+ (57 bytes each). Claude Code gets no `instructions`, so the handle's sentence is its pointer.
1994
+ The wake was left alone: its preface has a structural reserve the page's room derives from.
1995
+
1996
+ It is answered before the observer stand-down, because it reads no memory and an observer
1997
+ folder is where "how do I turn this back on?" gets asked. Unlike every other handle, `manual <words>` is
1998
+ a family, so words that name no section go the ordinary way first (a memory titled "Manual
1999
+ for the boiler" keeps its exact-title door) and come back as the unknown-section refusal only
2000
+ when nothing answers them (review of #730). It writes nothing and credits
2001
+ nothing. The file ships four ways (npm `files`, the plugin bundle by `packagePath`'s
2002
+ literal, the single binary's `embeddedFiles`, the hosted image); `test/manual.test.ts`
2003
+ holds all four, and checks every code span in the manual against the dispatch table, the
2004
+ declared flags, the served tools and their fields, and the recall handles.
2005
+
2006
+ ## 2026-11-03 — the meeting's questions, round 2 (Q1)
2007
+
2008
+ - **Mike's calls (11-03).** `love` ("What do you love most about what you do?") is dropped with no replacement: it
2009
+ overlapped `work`. `work` asks "What are you working on right now?" (the old "lately that you're actually enjoying"
2010
+ was hard to answer). `origin` asks the "into lately" question for everyone; the "what got you started building
2011
+ things?" branch is gone. The one-word swap replaces only `saturday`. The order is name, week, work, origin, saturday,
2012
+ then style. Both the Claude Code and the claude.ai meeting read the same script (`meetingInstructions`), so both
2013
+ changed at once.
2014
+ - **What a meeting in flight is.** The store keeps no current step. It keeps the state row (`onboarding.meet`:
2015
+ `offered`, or `later` if they paused) and `onboarding.answers` (`{ <step>: <memory id> }`). The window that started
2016
+ the meeting holds the script it read. So an in-flight meeting is a client sending the old script's step names, and
2017
+ the only renamed or removed name is `love`. `work` and `origin` keep their ids; only the words changed.
2018
+ - **`love` is retired, not aliased.** `RETIRED_ANSWER_STEPS` lists it. `meet` still takes it with an answer, writes
2019
+ the memory, and files it under `love`. A bare one gets `MEET_NO_ANSWER`, like any other answer step. It is not in
2020
+ `MEET_STEPS`, so the schema never offers it. It isn't served as `work` the way `started` is served as `origin`:
2021
+ `love` has no new step, and `recordAnswer` filed under `work` would replace the work answer that `ahaDue` reads
2022
+ first. `ahaDue` already lists `love`.
2023
+ - **Tests** (`test/onboarding.test.ts`, over the stdio door): one meeting on the new script from start to finish, and
2024
+ one in-flight meeting for each changed step (`love` after a `later`; `work` from a dropped session; `origin`, sent as
2025
+ the older `started`). Each in-flight meeting starts in one session through `meet` and resumes in another. The
2026
+ script it reads there is the new one, and the old script's next step lands.
@@ -144,6 +144,7 @@ import {
144
144
  nightlyMade,
145
145
  provenanceParts,
146
146
  } from "./deliberate.js";
147
+ import { isTold } from "../../core/told.js";
147
148
 
148
149
  // ── the working defaults (held lightly; revisit after a few days of use) ────
149
150
 
@@ -823,25 +824,37 @@ export function factsRecall(ctx: FactsContext, question: string, opts: { page?:
823
824
  for (const id of pool.keys()) beyond.delete(id);
824
825
 
825
826
  // ── the weak tail ───────────────────────────────────────────────────────
827
+ // A LIVED MATCH'S BAR IS SET BY LIVED MATCHES (S1 fix, 2026-11-03): a starter
828
+ // memory (`core/told.ts`) never pushes a lived match into the weak tail. On a
829
+ // new store a seed that shares a question word ("own", "which") outscored a
830
+ // lived note found by meaning alone five to one, and the note was cut as weak
831
+ // before the order below could halve the seed (the single-binary smoke's
832
+ // "which coffee maker do we own?"). A seed faces the whole pool's bar.
826
833
  let weak = 0;
827
- const best = (m: ReadonlyMap<string, Candidate>): number => {
834
+ const told = (id: string): boolean => isTold(rows.get(id));
835
+ const best = (m: ReadonlyMap<string, Candidate>, livedOnly = false): number => {
828
836
  let b = 0;
829
- for (const c of m.values()) if (c.score > b) b = c.score;
837
+ for (const c of m.values()) if (c.score > b && !(livedOnly && told(c.id))) b = c.score;
830
838
  return b;
831
839
  };
832
840
  const top = best(pool);
841
+ const topLived = best(pool, true);
833
842
  if (!onlyTime && top > 0) {
834
843
  for (const [id, c] of [...pool]) {
835
- if (c.score < FACTS_WEAK_FRACTION * top) {
844
+ if (c.score < FACTS_WEAK_FRACTION * (told(id) ? top : topLived)) {
836
845
  weak += 1;
837
846
  pool.delete(id);
838
847
  }
839
848
  }
840
849
  }
841
- // Outside the window, by the same bar — the best match anywhere sets it.
850
+ // Outside the window, by the same bars — the best match anywhere sets each.
842
851
  const topAll = Math.max(top, best(beyond));
852
+ const topAllLived = Math.max(topLived, best(beyond, true));
843
853
  let outside = 0;
844
- for (const c of beyond.values()) if (onlyTime || topAll <= 0 || c.score >= FACTS_WEAK_FRACTION * topAll) outside += 1;
854
+ for (const c of beyond.values()) {
855
+ const bar = told(c.id) ? topAll : topAllLived;
856
+ if (onlyTime || bar <= 0 || c.score >= FACTS_WEAK_FRACTION * bar) outside += 1;
857
+ }
845
858
 
846
859
  // ── a soft word: the recent first, nothing filtered ─────────────────────
847
860
  // After the weak tail, so the bar is the matches' own; the ORDER only.
@@ -872,8 +885,12 @@ export function factsRecall(ctx: FactsContext, question: string, opts: { page?:
872
885
  const r = rows.get(id);
873
886
  return r === undefined ? 0 : (r.type === "episode" ? (r.updated_at ?? r.created_at ?? 0) : (r.created_at ?? 0));
874
887
  };
888
+ // EVERY LIVED MATCH BEFORE EVERY STARTER ONE (S1 fix, ROADMAP 11-03; see
889
+ // `core/told.ts`): whatever the scores, lived matches first, then the seeds,
890
+ // each by its match. A seed is never dropped for a lived one either (the weak
891
+ // tail above sets a lived match's bar from lived matches only).
875
892
  const order = (a: Candidate, b: Candidate): number =>
876
- b.score - a.score || moment(b.id) - moment(a.id) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
893
+ (told(a.id) ? 1 : 0) - (told(b.id) ? 1 : 0) || b.score - a.score || moment(b.id) - moment(a.id) || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
877
894
  main.sort(order);
878
895
 
879
896
  // ── near-duplicates, walked in order as far as this page needs ─────────
@@ -0,0 +1,145 @@
1
+ /**
2
+ * THE MANUAL (H1, 2026-11-03; Mike approved the lane 11-03 13:01, lightly held).
3
+ *
4
+ * How Counterparts works and how to use it, for the counterpart first and
5
+ * readable by a person: one file, `docs/manual.md`, that ships with every
6
+ * install (package.json `files`, the plugin binary's embedded files, the
7
+ * hosted image), so the manual a counterpart opens is the one for the code it
8
+ * runs on, offline. The web page at counterparts.ai/manual is generated from
9
+ * the same file.
10
+ *
11
+ * The door is `recall`'s handle `manual`: the section index, one line each;
12
+ * and `manual <section>` (the section's heading, any case, or its number):
13
+ * that section whole. No tool of its own, so no session pays for a twelfth
14
+ * description; the handle's description names it in one sentence.
15
+ *
16
+ * The file's shape is the contract: one `# ` title, an intro, then `## `
17
+ * sections, each opening with one plain sentence (the index line). A test
18
+ * (`test/manual.test.ts`) checks every command, flag, tool and handle the
19
+ * file names against the code, so the manual cannot silently go stale.
20
+ */
21
+ import { readFileSync } from "node:fs";
22
+ import { packagePath } from "../runtime.js";
23
+
24
+ /** The recall handle that opens the manual. Exact, trimmed, case-folded, like `still open`. */
25
+ export const MANUAL_HANDLE = "manual";
26
+
27
+ /** Where the manual sits in the package, relative to its root. */
28
+ export const MANUAL_PATH = "docs/manual.md";
29
+
30
+ export interface ManualSection {
31
+ /** 1-based, in the file's order. */
32
+ readonly n: number;
33
+ /** The heading as written, after `## `. */
34
+ readonly heading: string;
35
+ /** The handle that opens it: `manual <heading, lower case>`. */
36
+ readonly handle: string;
37
+ /** Its first sentence: the line the index shows. */
38
+ readonly line: string;
39
+ /** The section whole, heading included. */
40
+ readonly text: string;
41
+ }
42
+
43
+ export interface Manual {
44
+ readonly title: string;
45
+ /** What comes before the first section. */
46
+ readonly intro: string;
47
+ readonly sections: readonly ManualSection[];
48
+ }
49
+
50
+ /** Case, punctuation and spacing folded, as `asksStillOpen` folds. */
51
+ function fold(s: string): string {
52
+ return s.toLowerCase().replace(/[’']/g, "").replace(/[^a-z0-9 ]+/g, " ").replace(/\s+/g, " ").trim();
53
+ }
54
+
55
+ function firstSentence(body: string): string {
56
+ const para = body.split(/\n\s*\n/).map((p) => p.trim()).find((p) => p.length > 0 && !p.startsWith("```")) ?? "";
57
+ const flat = para.replace(/\s+/g, " ");
58
+ const m = /[.!?](?=\s|$)/.exec(flat);
59
+ return m === null ? flat : flat.slice(0, m.index + 1);
60
+ }
61
+
62
+ /** Read the manual's text into its title, intro and sections. */
63
+ export function parseManual(text: string): Manual {
64
+ const lines = text.replace(/\r\n/g, "\n").split("\n");
65
+ let title = "";
66
+ const intro: string[] = [];
67
+ const raw: { heading: string; body: string[] }[] = [];
68
+ let inFence = false;
69
+ for (const line of lines) {
70
+ if (line.startsWith("```")) inFence = !inFence;
71
+ if (!inFence && line.startsWith("# ") && title === "") {
72
+ title = line.slice(2).trim();
73
+ continue;
74
+ }
75
+ if (!inFence && line.startsWith("## ")) {
76
+ raw.push({ heading: line.slice(3).trim(), body: [] });
77
+ continue;
78
+ }
79
+ if (raw.length === 0) intro.push(line);
80
+ else raw[raw.length - 1]?.body.push(line);
81
+ }
82
+ const sections = raw.map((s, i): ManualSection => {
83
+ const body = s.body.join("\n").trim();
84
+ return {
85
+ n: i + 1,
86
+ heading: s.heading,
87
+ handle: `${MANUAL_HANDLE} ${fold(s.heading)}`,
88
+ line: firstSentence(body),
89
+ text: `## ${s.heading}\n\n${body}`,
90
+ };
91
+ });
92
+ return { title, intro: intro.join("\n").trim(), sections };
93
+ }
94
+
95
+ let cached: { readonly at: string; readonly manual: Manual } | null = null;
96
+
97
+ /** The installed manual, read once per process; null when the file is missing. */
98
+ // The path is written out, not `MANUAL_PATH`: the plugin bundle's trace
99
+ // (`tools/plugin-bundle/build.ts#followModule`) carries what `packagePath`
100
+ // names by a literal, and a test holds the two equal.
101
+ export function installedManual(path: string = packagePath("docs/manual.md")): Manual | null {
102
+ if (cached !== null && cached.at === path) return cached.manual;
103
+ let text: string;
104
+ try {
105
+ text = readFileSync(path, "utf8");
106
+ } catch {
107
+ return null;
108
+ }
109
+ cached = { at: path, manual: parseManual(text) };
110
+ return cached.manual;
111
+ }
112
+
113
+ /**
114
+ * What a recall handle asks of the manual: the index, one section, a section
115
+ * the manual has no such name for (`unknown`), or nothing (not the manual's
116
+ * handle at all).
117
+ */
118
+ export type ManualAsk = { readonly kind: "index" } | { readonly kind: "section"; readonly asked: string } | null;
119
+
120
+ export function manualAsk(handle: unknown): ManualAsk {
121
+ if (typeof handle !== "string") return null;
122
+ const h = fold(handle);
123
+ if (h === MANUAL_HANDLE) return { kind: "index" };
124
+ if (h.startsWith(`${MANUAL_HANDLE} `)) return { kind: "section", asked: h.slice(MANUAL_HANDLE.length + 1) };
125
+ return null;
126
+ }
127
+
128
+ /** The section a handle's words name: its heading (folded) or its number. */
129
+ export function findSection(manual: Manual, asked: string): ManualSection | null {
130
+ const a = fold(asked);
131
+ if (/^\d+$/.test(a)) return manual.sections[Number(a) - 1] ?? null;
132
+ return manual.sections.find((s) => fold(s.heading) === a) ?? null;
133
+ }
134
+
135
+ /** The index: the intro, then a line per section with the handle that opens it. */
136
+ export function manualIndexText(manual: Manual): string {
137
+ return [
138
+ `# ${manual.title}`,
139
+ "",
140
+ manual.intro,
141
+ "",
142
+ "Sections (open one with recall's handle, as written here):",
143
+ ...manual.sections.map((s) => `- "${s.handle}": ${s.line}`),
144
+ ].join("\n");
145
+ }
@@ -80,6 +80,7 @@ import { RECURRING_META, feelingValence, feltDay, tokenize } from "../../core/st
80
80
  import type { FeelingRow, MemoryRow } from "../../core/store/index.js";
81
81
  import { calendarOverlaps, daysBetween, isDay, isRecurrence, localDate, occurrenceOnOrAfter, readableRecurrence } from "../../core/time.js";
82
82
  import { RECALL_RESULT_CHARS, hasFaded } from "./deliberate.js";
83
+ import { TOLD_SOURCE, isTold } from "../../core/told.js";
83
84
 
84
85
  // ── the numbers (working defaults, 2026-10-03; tune at the revisit) ──────────
85
86
 
@@ -404,7 +405,10 @@ export function meaningRecall(ctx: MeaningContext, question: string, opts: { pag
404
405
  row.type === "memory" &&
405
406
  row.archived === 0 &&
406
407
  row.superseded_by === null &&
407
- !denied.has(id)
408
+ !denied.has(id) &&
409
+ // A STARTER MEMORY (S1) is no moment of anyone's arc: told at birth,
410
+ // not lived. Facts mode finds it, after the lived matches.
411
+ !isTold(row)
408
412
  ) {
409
413
  out = row;
410
414
  }
@@ -1669,7 +1673,8 @@ function contentWords(
1669
1673
  );
1670
1674
  const out = (words: string[]): TopicWords => ({ words, names, shown: words.map((w) => asTyped.get(w) ?? w) });
1671
1675
  if (candidates.length === 0) return out([]);
1672
- const total = safe(() => c.store.countMemories({ archived: false }), 0);
1676
+ // Lived rows (S1 review): the starter set is no sign the store is big enough to call a word common.
1677
+ const total = safe(() => c.store.countMemories({ archived: false, notSource: TOLD_SOURCE }), 0);
1673
1678
  if (total < 20) return out(candidates);
1674
1679
  const df = safe(() => c.store.docFrequency(candidates), new Map<string, number>());
1675
1680
  return out(candidates.filter((w) => names.has(w) || (df.get(w) ?? 0) <= total * COMMON_SHARE));
@@ -19,6 +19,7 @@ import type { PageWriterMode, PageWriterRun } from "../../core/self/index.js";
19
19
  import type { ToolResult } from "./server-options.js";
20
20
  import { DREAMING_OFF_REFUSAL, dreamHow, dreamLaunchHowFor, PAGE_REFUSAL_DETAIL, pageLaneAnswer, pageRoomAnswer, reflectLaunchHowFor, settingSaidFor } from "./server-words.js";
21
21
  import type { McpServer } from "./server.js";
22
+ import { isTold } from "../../core/told.js";
22
23
 
23
24
  /**
24
25
  * `dream` — dreaming, in phases (`core/dream/`, 2026-09-26). Every phase
@@ -1006,7 +1007,9 @@ function daySummaryArgs(server: McpServer, sent: string, rawCites: unknown, from
1006
1007
  const id = aliases?.resolve(x) ?? x.trim();
1007
1008
  let known = false;
1008
1009
  try {
1009
- known = server.counterpart.store.row(id)?.type === "memory";
1010
+ // A starter memory (S1) is never a day's evidence: the writer is never shown one.
1011
+ const row = server.counterpart.store.row(id);
1012
+ known = row?.type === "memory" && !isTold(row);
1010
1013
  } catch {
1011
1014
  known = false;
1012
1015
  }
@@ -1272,7 +1275,9 @@ function pageTraceArgs(server: McpServer, args: Record<string, unknown>): { trac
1272
1275
  const refused: string[] = [];
1273
1276
  const known = (id: string): boolean => {
1274
1277
  try {
1275
- return server.counterpart.store.row(id)?.type === "memory";
1278
+ // A starter memory (S1) is never what the page rests on: told, not lived.
1279
+ const row = server.counterpart.store.row(id);
1280
+ return row?.type === "memory" && !isTold(row);
1276
1281
  } catch {
1277
1282
  return false;
1278
1283
  }