counterparts 0.3.0 → 0.3.2

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 (207) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/docs/module-map.md +2 -0
  3. package/package.json +2 -1
  4. package/src/adapters/claude-code/CONTRACT.md +2 -1
  5. package/src/adapters/claude-code/NOTES.md +90 -2
  6. package/src/adapters/claude-code/bin/hook.ts +17 -2
  7. package/src/adapters/claude-code/bin/runner.ts +4 -1
  8. package/src/adapters/claude-code/config.ts +23 -0
  9. package/src/adapters/claude-code/doctor.ts +148 -26
  10. package/src/adapters/claude-code/hooks.ts +37 -12
  11. package/src/adapters/claude-code/index.ts +2 -0
  12. package/src/adapters/claude-code/standdown.ts +12 -1
  13. package/src/adapters/claude-code/transcript.ts +79 -6
  14. package/src/adapters/cli/INTERFACE-GAPS.md +4 -0
  15. package/src/adapters/cli/commands.ts +209 -61
  16. package/src/adapters/cli/export.ts +27 -3
  17. package/src/adapters/cli/help.ts +22 -8
  18. package/src/adapters/cli/install.ts +3 -5
  19. package/src/adapters/cli/mechanisms.ts +295 -0
  20. package/src/adapters/cli/repair-dates.ts +3 -1
  21. package/src/adapters/cli/snapshot.ts +4 -27
  22. package/src/adapters/dashboard/CONTRACT.md +13 -9
  23. package/src/adapters/dashboard/INTERFACE-GAPS.md +4 -0
  24. package/src/adapters/dashboard/NOTES.md +3 -2
  25. package/src/adapters/dashboard/activity.ts +2 -1
  26. package/src/adapters/dashboard/bin/dashboard.ts +18 -3
  27. package/src/adapters/dashboard/upgrade.ts +23 -0
  28. package/src/adapters/dashboard/web/README.md +153 -0
  29. package/src/adapters/dashboard/web/actions.ts +631 -0
  30. package/src/adapters/dashboard/web/app.html +40 -1703
  31. package/src/adapters/dashboard/web/app.js +55 -0
  32. package/src/adapters/dashboard/web/mechanisms/association/index.js +15 -0
  33. package/src/adapters/dashboard/web/mechanisms/association/panel.js +17 -0
  34. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +15 -0
  35. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +23 -0
  36. package/src/adapters/dashboard/web/mechanisms/decay/index.js +15 -0
  37. package/src/adapters/dashboard/web/mechanisms/decay/panel.js +45 -0
  38. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +15 -0
  39. package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +15 -0
  40. package/src/adapters/dashboard/web/mechanisms/index.js +60 -0
  41. package/src/adapters/dashboard/web/mechanisms/interference/index.js +15 -0
  42. package/src/adapters/dashboard/web/mechanisms/picture.js +28 -0
  43. package/src/adapters/dashboard/web/mechanisms/prospective/index.js +15 -0
  44. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +15 -0
  45. package/src/adapters/dashboard/web/mechanisms/reconsolidation/panel.js +15 -0
  46. package/src/adapters/dashboard/web/mechanisms/regions.js +30 -0
  47. package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +15 -0
  48. package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +20 -0
  49. package/src/adapters/dashboard/web/mechanisms/salience/index.js +15 -0
  50. package/src/adapters/dashboard/web/mechanisms/salience/panel.js +14 -0
  51. package/src/adapters/dashboard/web/mechanisms/schema/index.js +15 -0
  52. package/src/adapters/dashboard/web/narrate.ts +10 -10
  53. package/src/adapters/dashboard/web/pages/flow/flow.css +38 -0
  54. package/src/adapters/dashboard/web/pages/flow/index.js +117 -0
  55. package/src/adapters/dashboard/web/pages/flow/sections/blind.js +12 -0
  56. package/src/adapters/dashboard/web/pages/flow/sections/detail.js +45 -0
  57. package/src/adapters/dashboard/web/pages/flow/sections/diagram.js +291 -0
  58. package/src/adapters/dashboard/web/pages/flow/sections/feed.js +11 -0
  59. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +41 -0
  60. package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +25 -0
  61. package/src/adapters/dashboard/web/pages/flow/sections/records.js +24 -0
  62. package/src/adapters/dashboard/web/pages/flow/sections/symmetry.js +17 -0
  63. package/src/adapters/dashboard/web/pages/flow/state.js +3 -0
  64. package/src/adapters/dashboard/web/pages/health/health.css +93 -0
  65. package/src/adapters/dashboard/web/pages/health/index.js +41 -0
  66. package/src/adapters/dashboard/web/pages/health/sections/archive.js +84 -0
  67. package/src/adapters/dashboard/web/pages/health/sections/checks.js +172 -0
  68. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +37 -0
  69. package/src/adapters/dashboard/web/pages/health/sections/verify.js +54 -0
  70. package/src/adapters/dashboard/web/pages/home/brain.js +375 -0
  71. package/src/adapters/dashboard/web/pages/home/home.css +134 -0
  72. package/src/adapters/dashboard/web/pages/home/index.js +84 -0
  73. package/src/adapters/dashboard/web/pages/home/sections/explorer.js +206 -0
  74. package/src/adapters/dashboard/web/pages/home/sections/hero.js +22 -0
  75. package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +25 -0
  76. package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +13 -0
  77. package/src/adapters/dashboard/web/pages/home/sections/tiles.js +52 -0
  78. package/src/adapters/dashboard/web/pages/memories/index.js +75 -0
  79. package/src/adapters/dashboard/web/pages/memories/memories.css +143 -0
  80. package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +178 -0
  81. package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +42 -0
  82. package/src/adapters/dashboard/web/pages/memories/sections/list.js +114 -0
  83. package/src/adapters/dashboard/web/pages/memories/sections/search.js +102 -0
  84. package/src/adapters/dashboard/web/pages/memories/sections/tools.js +155 -0
  85. package/src/adapters/dashboard/web/pages/memories/state.js +22 -0
  86. package/src/adapters/dashboard/web/pages/self/diff.js +79 -0
  87. package/src/adapters/dashboard/web/pages/self/index.js +43 -0
  88. package/src/adapters/dashboard/web/pages/self/markdown.js +61 -0
  89. package/src/adapters/dashboard/web/pages/self/sections/journal.js +32 -0
  90. package/src/adapters/dashboard/web/pages/self/sections/page.js +149 -0
  91. package/src/adapters/dashboard/web/pages/self/sections/settling.js +150 -0
  92. package/src/adapters/dashboard/web/pages/self/sections/stories.js +47 -0
  93. package/src/adapters/dashboard/web/pages/self/sections/wake.js +74 -0
  94. package/src/adapters/dashboard/web/pages/self/self.css +182 -0
  95. package/src/adapters/dashboard/web/server.ts +305 -28
  96. package/src/adapters/dashboard/web/shared/absence.js +14 -0
  97. package/src/adapters/dashboard/web/shared/actions.js +48 -0
  98. package/src/adapters/dashboard/web/shared/api.js +17 -0
  99. package/src/adapters/dashboard/web/shared/base.css +34 -0
  100. package/src/adapters/dashboard/web/shared/canvas.js +68 -0
  101. package/src/adapters/dashboard/web/shared/colors.js +6 -0
  102. package/src/adapters/dashboard/web/shared/dom.js +4 -0
  103. package/src/adapters/dashboard/web/shared/event-modal.js +25 -0
  104. package/src/adapters/dashboard/web/shared/fonts/OFL-courier-prime.txt +93 -0
  105. package/src/adapters/dashboard/web/shared/fonts/OFL-outfit.txt +93 -0
  106. package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-400.woff2 +0 -0
  107. package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-700.woff2 +0 -0
  108. package/src/adapters/dashboard/web/shared/fonts/outfit-latin-wght.woff2 +0 -0
  109. package/src/adapters/dashboard/web/shared/format.js +31 -0
  110. package/src/adapters/dashboard/web/shared/layout.css +32 -0
  111. package/src/adapters/dashboard/web/shared/memory-modal.js +124 -0
  112. package/src/adapters/dashboard/web/shared/modal.css +24 -0
  113. package/src/adapters/dashboard/web/shared/modal.js +22 -0
  114. package/src/adapters/dashboard/web/shared/state.js +12 -0
  115. package/src/adapters/dashboard/web/shared/tip.css +4 -0
  116. package/src/adapters/dashboard/web/shared/tip.js +12 -0
  117. package/src/adapters/dashboard/web/shared/tokens.css +50 -0
  118. package/src/adapters/dashboard/web/shared/type.css +52 -0
  119. package/src/adapters/dashboard/web/shared/utilities.css +5 -0
  120. package/src/adapters/dashboard/web/shared/vendor/MIT-three.txt +21 -0
  121. package/src/adapters/dashboard/web/shared/vendor/three.module.min.js +6 -0
  122. package/src/adapters/dashboard/web/shared/widgets/bar.css +9 -0
  123. package/src/adapters/dashboard/web/shared/widgets/card.css +6 -0
  124. package/src/adapters/dashboard/web/shared/widgets/chapters.js +15 -0
  125. package/src/adapters/dashboard/web/shared/widgets/chart.css +4 -0
  126. package/src/adapters/dashboard/web/shared/widgets/confirm.css +31 -0
  127. package/src/adapters/dashboard/web/shared/widgets/confirm.js +52 -0
  128. package/src/adapters/dashboard/web/shared/widgets/feed.css +13 -0
  129. package/src/adapters/dashboard/web/shared/widgets/feed.js +41 -0
  130. package/src/adapters/dashboard/web/shared/widgets/light.css +4 -0
  131. package/src/adapters/dashboard/web/shared/widgets/light.js +15 -0
  132. package/src/adapters/dashboard/web/shared/widgets/rows.css +7 -0
  133. package/src/adapters/dashboard/web/shared/widgets/table.css +17 -0
  134. package/src/adapters/dashboard/web/shared/widgets/tiles.css +14 -0
  135. package/src/adapters/dashboard/web/shell/pages.js +15 -0
  136. package/src/adapters/dashboard/web/shell/pulse.js +86 -0
  137. package/src/adapters/dashboard/web/shell/tabs.js +49 -0
  138. package/src/adapters/dashboard/web/static.ts +76 -0
  139. package/src/adapters/dashboard/web/views/activity.ts +80 -0
  140. package/src/adapters/dashboard/web/views/archive-words.ts +57 -0
  141. package/src/adapters/dashboard/web/views/flow-view.ts +217 -0
  142. package/src/adapters/dashboard/web/views/health.ts +328 -0
  143. package/src/adapters/dashboard/web/views/mechanism-panel.ts +370 -0
  144. package/src/adapters/dashboard/web/views/mechanisms.ts +302 -0
  145. package/src/adapters/dashboard/web/views/memories.ts +342 -0
  146. package/src/adapters/dashboard/web/views/memory.ts +210 -0
  147. package/src/adapters/dashboard/web/views/meta.ts +64 -0
  148. package/src/adapters/dashboard/web/views/mind.ts +729 -0
  149. package/src/adapters/dashboard/web/views/overview.ts +282 -0
  150. package/src/adapters/dashboard/web/views/pulse.ts +19 -0
  151. package/src/adapters/dashboard/web/views/rows.ts +207 -0
  152. package/src/adapters/dashboard/web/views/search.ts +62 -0
  153. package/src/adapters/dashboard/web/views/shared.ts +161 -0
  154. package/src/adapters/dashboard/web/views.ts +34 -1724
  155. package/src/adapters/fired.ts +138 -31
  156. package/src/adapters/mcp/INTERFACE-GAPS.md +4 -1
  157. package/src/adapters/mcp/NOTES.md +43 -0
  158. package/src/adapters/mcp/bin/serve.ts +9 -1
  159. package/src/adapters/mcp/index.ts +7 -0
  160. package/src/adapters/mcp/server.ts +167 -6
  161. package/src/adapters/mcp/tools.ts +42 -0
  162. package/src/adapters/mcp/write-up.ts +1 -1
  163. package/src/adapters/sessions.ts +18 -1
  164. package/src/adapters/snapshots.ts +71 -39
  165. package/src/core/associate/INTERFACE-GAPS.md +8 -0
  166. package/src/core/counterpart.ts +86 -7
  167. package/src/core/encode/INTERFACE-GAPS.md +12 -0
  168. package/src/core/feelings-wheel.ts +218 -0
  169. package/src/core/handoff/INTERFACE-GAPS.md +2 -0
  170. package/src/core/mint.ts +14 -2
  171. package/src/core/prospective/INTERFACE-GAPS.md +14 -0
  172. package/src/core/prospective/windows.ts +10 -48
  173. package/src/core/recall/INTERFACE-GAPS.md +6 -0
  174. package/src/core/remember/INTERFACE-GAPS.md +10 -0
  175. package/src/core/schemas/INTERFACE-GAPS.md +8 -0
  176. package/src/core/schemas/NOTES.md +118 -1
  177. package/src/core/schemas/index.ts +330 -40
  178. package/src/core/schemas/tunables.ts +23 -0
  179. package/src/core/schemas/types.ts +64 -1
  180. package/src/core/self/CONTRACT.md +3 -0
  181. package/src/core/self/INTERFACE-GAPS.md +10 -0
  182. package/src/core/self/NOTES.md +33 -2
  183. package/src/core/self/calendar.ts +7 -78
  184. package/src/core/self/episodes.ts +52 -12
  185. package/src/core/self/index.ts +40 -12
  186. package/src/core/self/writer.ts +22 -22
  187. package/src/core/sleep/NOTES.md +36 -0
  188. package/src/core/sleep/cycle.ts +38 -3
  189. package/src/core/sleep/fade.ts +76 -0
  190. package/src/core/sleep/index.ts +4 -1
  191. package/src/core/sleep/prune.ts +8 -1
  192. package/src/core/sleep/tunables.ts +5 -0
  193. package/src/core/sleep/types.ts +24 -0
  194. package/src/core/store/CONTRACT.md +36 -7
  195. package/src/core/store/NOTES.md +197 -0
  196. package/src/core/store/errors.ts +22 -0
  197. package/src/core/store/feelings.ts +182 -0
  198. package/src/core/store/index.ts +339 -45
  199. package/src/core/store/operational.ts +240 -22
  200. package/src/core/store/owner-op-seam.ts +13 -3
  201. package/src/core/store/paths.ts +15 -1
  202. package/src/core/store/pre-migration.ts +258 -0
  203. package/src/core/store/prose.ts +8 -1
  204. package/src/core/store/render.ts +3 -0
  205. package/src/core/time.ts +374 -0
  206. package/src/core/types.ts +13 -0
  207. package/src/adapters/dashboard/web/brain.html +0 -463
@@ -27,6 +27,7 @@
27
27
  * is testable against a temp dir with a faked console.
28
28
  */
29
29
  import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
30
+ import { localDate, resolveZone, todayIn } from "../../core/time.js";
30
31
  import { homedir, tmpdir } from "node:os";
31
32
  import { basename, delimiter, dirname, isAbsolute, join, resolve } from "node:path";
32
33
  import { spawn } from "node:child_process";
@@ -131,6 +132,8 @@ import { OBSERVER_ENV, observerFromEnv, unreadableStanceLine } from "../stance-e
131
132
  // so the three surfaces cannot disagree about what "silent" means.
132
133
  import { STATE_MEANING, STATE_ORDER, firedReport } from "../fired.js";
133
134
  import type { FiredReport, FiredState } from "../fired.js";
135
+ // The short view over the same reading: one line per memory mechanism.
136
+ import { mechanismsLines } from "./mechanisms.js";
134
137
  // The two snapshot readers `status` shares with doctor: the DIRECTORY is what
135
138
  // says how many copies you have, and a row only says what a run once wrote.
136
139
  import { readSnapshotsDir, resolveSnapshotsDir } from "../snapshots.js";
@@ -283,6 +286,10 @@ export const COMMANDS = [
283
286
  "probe-oq4",
284
287
  // Constitution 11's last sentence as a command: which mechanisms fired this
285
288
  // week, which have gone quiet, and which record nothing at all. Read-only.
289
+ // ONE COMMAND, TWO NAMES (2026-09-25): `mechanisms` is the listed spelling
290
+ // and prints one line per memory mechanism; `fired` is its older name and
291
+ // dispatches for good. `--all` on either prints the full `fired` report.
292
+ "mechanisms",
286
293
  "fired",
287
294
  // I32's reading: whether the background half is alive. (Its partner, the
288
295
  // `credentials` command, went with the API keys on 2026-09-24.)
@@ -452,6 +459,16 @@ export interface RunOptions {
452
459
  * pass it and get `realDashboard()`, which loads the server module lazily.
453
460
  */
454
461
  dashboard?: DashboardSeam;
462
+ /**
463
+ * WHERE A NOTE IS FILED — the scope `note` stamps on what it writes. Real
464
+ * terminal runs pass nothing and get the working directory, which is where
465
+ * the person typing is. The dashboard passes its store's own directory: a
466
+ * note written in the browser was not written from any project, and the
467
+ * server's working directory is only wherever it happened to be launched.
468
+ * (The store dir is the same "no project" answer `mcp/server.ts#resolveScope`
469
+ * falls back to.)
470
+ */
471
+ scope?: string;
455
472
  }
456
473
 
457
474
  /**
@@ -670,14 +687,15 @@ export const COMMAND_FLAGS: Record<Command, readonly string[]> = {
670
687
  rebrief: ["budget", "config"],
671
688
  // Read-only, like `status`: rows in, a table out.
672
689
  "probe-oq4": [],
690
+ mechanisms: ["all"],
673
691
  fired: ["all"],
674
692
  // `doctor` takes `--config` for the same reason `rebrief` does: it reports on
675
693
  // the host configuration, and on a machine with two of them the reading is
676
694
  // about whichever one the hooks read.
677
695
  // `--all` unfolds the screen: on a terminal `doctor` folds every green
678
696
  // worker-internal line into one, and this prints them all. Shared with
679
- // `fired`, whose `--all` means the same thing — every mechanism, including
680
- // the quiet ones.
697
+ // `mechanisms` (and its older name `fired`), whose `--all` means the same
698
+ // thing — every mechanism and every part, in full.
681
699
  doctor: ["config", "json", "all"],
682
700
  // `--config` because the registry sits BESIDE the configuration, so the flag
683
701
  // that says which configuration also says which registry. `--observer` is
@@ -743,8 +761,10 @@ export const COMMAND_BLURB: Record<Command, string> = {
743
761
  rebrief: "Re-render and republish the wake bundle NOW, through the boundary's own renderer.",
744
762
  "probe-oq4":
745
763
  "The OQ4 probe: footnotes delivered vs. later expanded, by calendar date, from recall.decision and recall.credit rows. Read-only.",
764
+ mechanisms:
765
+ "Is each memory mechanism working? One line per mechanism, with a light (● working this week, ◐ built but not firing, ○ not built yet) and the count from the store behind it, then the plumbing in one line that names only what is failing. --all prints the full report: every part, silent first, when it last fired, how often in the last 7 days, what it turned away, and why the store cannot tell for the ones nothing records. Read-only.",
746
766
  fired:
747
- "Which mechanisms have actually fired. One line each, silent first: when it last fired, how often in the last 7 days, what it turned away, and — for the ones nothing records — why the store cannot tell. Read-only.",
767
+ "The older name of `mechanisms` — the same command, the same output. --all prints the full report. Read-only.",
748
768
  doctor:
749
769
  "Is the background half alive? The config, the two clocks, the newest sweep, sleep, backfill and credit rows, the spawn refusals and the vector coverage — worst first, each with the line that fixes it. Read-only; exit 1 if anything is red.",
750
770
  scope:
@@ -752,7 +772,7 @@ export const COMMAND_BLURB: Record<Command, string> = {
752
772
  "self-page":
753
773
  "The written page the wake opens with. With no flags it prints the page, its date and its size; --write --file <path> or --write --stdin replaces it whole, keeping every earlier version; --versions lists those and --version <seq> prints one. Reading works under observer; writing refuses there.",
754
774
  dashboard:
755
- "Open the dashboard in your browser: the web view of the store your configuration names, served on 127.0.0.1 and nowhere else. Ctrl-C stops it. Read-only — it strengthens nothing, deposits nothing, and writes no file of its own.",
775
+ "Open the dashboard in your browser: the web view of the store your configuration names, served on 127.0.0.1 and nowhere else. Ctrl-C stops it. Looking is read-only — it strengthens nothing and deposits nothing. What you do there on purpose (write a note, remove a memory, back up, …) runs through these same commands, and a removal asks you to type the id back.",
756
776
  version: "The version of Counterparts you have. It opens nothing.",
757
777
  help:
758
778
  "The console's own map. With no argument, the commands a person reaches for, one short line each; with 'advanced', the maintenance shelf and the three flags every command takes; with a command name, that command's whole page.",
@@ -856,11 +876,11 @@ const FLAG_HELP: Record<string, string> = {
856
876
  apply: "actually do it — without this, it is a dry run",
857
877
  layout:
858
878
  "also print which directories the store keeps and which of them a backup carries",
859
- // TRUE OF BOTH COMMANDS THAT TAKE IT, as the table requires: `fired --all`
860
- // prints every mechanism including the quiet ones, `doctor --all` prints
861
- // every line including the green ones a terminal folds away.
879
+ // TRUE OF EVERY COMMAND THAT TAKES IT, as the table requires: `mechanisms
880
+ // --all` (and `fired --all`) prints the full report of every part, `doctor
881
+ // --all` prints every line including the green ones a terminal folds away.
862
882
  all:
863
- "print every line, including the mechanisms a store this new has had nothing to do with yet",
883
+ "print every line in full, including the parts a store this new has had nothing to do with yet",
864
884
  config:
865
885
  "an absolute path to the host configuration, instead of ~/.counterparts/claude-code.json ($COUNTERPARTS_CONFIG says the same); install WRITES it there, rebrief reads it, ask and note read whether recall by meaning is on from it, and counterparts-hook and counterparts-mcp take the same flag (the server, the same variable)",
866
886
  batch: "rows per transaction while converting (default 500)",
@@ -1656,14 +1676,16 @@ export async function run(argv: readonly string[], opts: RunOptions): Promise<nu
1656
1676
  dir,
1657
1677
  io,
1658
1678
  typeof parsed.flags["dir"] === "string",
1659
- dateOf(now()),
1679
+ // The person's day, in the zone the config beside this store names,
1680
+ // else this machine's (docs/time.md; UTC before 2026-09-25).
1681
+ localDate(now(), zoneBeside(dir)),
1660
1682
  parsed.flags["layout"] === true,
1661
1683
  env,
1662
1684
  );
1663
1685
  case "init":
1664
1686
  return initCommand(dir, io, opts.home, typeof parsed.flags["name"] === "string" ? parsed.flags["name"] : undefined);
1665
1687
  case "note":
1666
- return await noteCommand(dir, io, parsed, env, opts.home ?? homedir());
1688
+ return await noteCommand(dir, io, parsed, env, opts.home ?? homedir(), opts.scope);
1667
1689
  // ONE COMMAND, TWO NAMES — the same function, not a forwarding shim, so
1668
1690
  // there is no arm where one spelling can behave differently from the other.
1669
1691
  case "ask":
@@ -1697,6 +1719,7 @@ export async function run(argv: readonly string[], opts: RunOptions): Promise<nu
1697
1719
  return rebriefCommand(dir, io, parsed.flags["budget"], now, opts.home, named);
1698
1720
  case "probe-oq4":
1699
1721
  return probeCommand(dir, io, typeof parsed.flags["dir"] === "string");
1722
+ case "mechanisms":
1700
1723
  case "fired":
1701
1724
  return firedCommand(
1702
1725
  dir,
@@ -1716,7 +1739,7 @@ export async function run(argv: readonly string[], opts: RunOptions): Promise<nu
1716
1739
  );
1717
1740
  }
1718
1741
  } catch (err) {
1719
- io.err(`${command} failed: ${describeDirRefusal(err)}`);
1742
+ io.err(upgradePending(err) ?? `${command} failed: ${describeDirRefusal(err)}`);
1720
1743
  return EXIT.failed;
1721
1744
  }
1722
1745
  }
@@ -1761,10 +1784,37 @@ function describeDirRefusal(err: unknown, dir?: string): string {
1761
1784
  describeGuardRefusal(err, `Name the store: --dir <path>, or ${DATA_DIR_ENV}.`) ??
1762
1785
  describePreRowsRefusal(err, `Name a store with --dir <path>.`) ??
1763
1786
  preRowsInDisguise(err, dir) ??
1787
+ upgradePending(err) ??
1764
1788
  String((err as Error).message ?? err)
1765
1789
  );
1766
1790
  }
1767
1791
 
1792
+ /**
1793
+ * A store on an OLDER schema, met by a read-only door (review N1, 2026-09-25).
1794
+ * `STORE_UNINITIALIZED` with a `found` version below this build's reads, to an
1795
+ * observer, like an empty store; it is not — it is waiting for the first
1796
+ * session, which copies it and upgrades it. Doctor's sentence, said here too.
1797
+ */
1798
+ function upgradePending(err: unknown): string | null {
1799
+ if (!isStoreError(err, "STORE_UNINITIALIZED")) return null;
1800
+ const found = Number.parseInt(String(err.detail["found"] ?? ""), 10);
1801
+ // Only a store this build can migrate: v6 up. Below the floor is the
1802
+ // pre-rows refusal's sentence, never "the next session upgrades it".
1803
+ if (!Number.isFinite(found) || found < 6 || found >= SCHEMA_VERSION) return null;
1804
+ return (
1805
+ `this store is on schema v${String(found)}; the next Claude Code session copies it and upgrades it ` +
1806
+ `to v${String(SCHEMA_VERSION)}. Nothing to do: start a session, then run this again.`
1807
+ );
1808
+ }
1809
+
1810
+ /** The line a read-only door prints when its open was refused. */
1811
+ function openRefusalLine(err: unknown, dir?: string): string {
1812
+ if (dir !== undefined && preRowsInDisguise(err, dir) !== null) {
1813
+ return `could not open the store: ${describeDirRefusal(err, dir)}`;
1814
+ }
1815
+ return upgradePending(err) ?? `could not open the store: ${describeDirRefusal(err, dir)}`;
1816
+ }
1817
+
1768
1818
  /**
1769
1819
  * The shape-lock shape, wearing `STORE_UNINITIALIZED`'s clothes.
1770
1820
  *
@@ -1815,9 +1865,9 @@ function probeCommand(dir: string, io: Io, namedDir: boolean): number {
1815
1865
  }
1816
1866
  let store: Store;
1817
1867
  try {
1818
- store = Store.open({ dir, observer: true });
1868
+ store = openStoreAt({ dir, observer: true });
1819
1869
  } catch (err) {
1820
- io.err(`could not open the store: ${describeDirRefusal(err, dir)}`);
1870
+ io.err(openRefusalLine(err, dir));
1821
1871
  return EXIT.failed;
1822
1872
  }
1823
1873
  try {
@@ -1842,13 +1892,18 @@ function probeCommand(dir: string, io: Io, namedDir: boolean): number {
1842
1892
  }
1843
1893
 
1844
1894
  /**
1845
- * `fired` — which mechanisms have actually fired, and which have not.
1895
+ * `mechanisms` (and its older name `fired`) — which mechanisms have actually
1896
+ * fired, and which have not.
1897
+ *
1898
+ * Two views over ONE reading. The default is the short one a regular user
1899
+ * reads: a line per memory mechanism the site names, and the plumbing in one
1900
+ * line (`mechanisms.ts`). `--all` is the full report below, unchanged.
1846
1901
  *
1847
1902
  * Read-only, and the same store-absent and open rules as `status`: it opens the
1848
1903
  * store in OBSERVER stance whatever the console's own stance is, because reading
1849
1904
  * what fired must not be able to change it.
1850
1905
  *
1851
- * SILENT FIRST is the whole shape of the output. A page that opened with
1906
+ * SILENT FIRST is the whole shape of the full report. A page that opened with
1852
1907
  * everything that worked would bury the one thing worth acting on — constitution
1853
1908
  * 11's "one that stays silent is diagnosed and fixed" needs the silences on the
1854
1909
  * first screen, and every group carries the one line that says what its state
@@ -1867,13 +1922,14 @@ function firedCommand(
1867
1922
  }
1868
1923
  let store: Store;
1869
1924
  try {
1870
- store = Store.open({ dir, observer: true });
1925
+ store = openStoreAt({ dir, observer: true });
1871
1926
  } catch (err) {
1872
- io.err(`could not open the store: ${describeDirRefusal(err, dir)}`);
1927
+ io.err(openRefusalLine(err, dir));
1873
1928
  return EXIT.failed;
1874
1929
  }
1875
1930
  try {
1876
- for (const line of firedLines(firedReport(store, dateOf(now())), all)) io.out(line);
1931
+ const report = firedReport(store, localDate(now(), store.zone()));
1932
+ for (const line of all ? firedLines(report, true) : mechanismsLines(report)) io.out(line);
1877
1933
  return EXIT.ok;
1878
1934
  } finally {
1879
1935
  store.close();
@@ -1980,7 +2036,7 @@ async function selfPageCommand(
1980
2036
  try {
1981
2037
  counterpart = openCounterpart(dir, observer);
1982
2038
  } catch (err) {
1983
- io.err(`could not open the store: ${describeDirRefusal(err, dir)}`);
2039
+ io.err(openRefusalLine(err, dir));
1984
2040
  return EXIT.failed;
1985
2041
  }
1986
2042
  try {
@@ -2080,7 +2136,7 @@ const YOUNG_STATES: readonly FiredState[] = ["firing", "blocked", "quiet"];
2080
2136
  /** The report as plain text: one mechanism per line, grouped by state. */
2081
2137
  export function firedLines(report: FiredReport, all = false): string[] {
2082
2138
  const lines = [
2083
- `what has fired — ${report.from}→${report.today} (UTC), against ${report.previousFrom}→${report.previousTo}`,
2139
+ `what has fired — ${report.from}→${report.today}, against ${report.previousFrom}→${report.previousTo}`,
2084
2140
  "",
2085
2141
  ];
2086
2142
  const young = report.young && !all;
@@ -2099,7 +2155,7 @@ export function firedLines(report: FiredReport, all = false): string[] {
2099
2155
  `This store is on lived day ${String(report.livedDay)} — ${age}. Most mechanisms have had ` +
2100
2156
  `nothing to do yet, so below is only what HAS fired and anything that was stopped. The ` +
2101
2157
  `full roll-call of ${String(report.rows.length)} comes back on its own once the store is ` +
2102
- "old enough for silence to mean something — or run `counterparts fired --all` now.",
2158
+ "old enough for silence to mean something — or run `counterparts mechanisms --all` now.",
2103
2159
  "",
2104
2160
  );
2105
2161
  }
@@ -2167,7 +2223,7 @@ function newestBoundary(store: Store, livedDay: number): string | null {
2167
2223
  if (last === undefined) return null;
2168
2224
  const payload = JSON.parse(last.payload ?? "{}") as Record<string, unknown>;
2169
2225
  const date = payload["date"];
2170
- return typeof date === "string" && date.length === 10 ? date : dateOf(last.at);
2226
+ return typeof date === "string" && date.length === 10 ? date : localDate(last.at, store.zone());
2171
2227
  } catch {
2172
2228
  return null;
2173
2229
  }
@@ -2246,9 +2302,9 @@ function statusCommand(
2246
2302
  }
2247
2303
  let store: Store;
2248
2304
  try {
2249
- store = Store.open({ dir, observer: true });
2305
+ store = openStoreAt({ dir, observer: true });
2250
2306
  } catch (err) {
2251
- io.err(`could not open the store: ${describeDirRefusal(err, dir)}`);
2307
+ io.err(openRefusalLine(err, dir));
2252
2308
  return EXIT.failed;
2253
2309
  }
2254
2310
  try {
@@ -2414,7 +2470,7 @@ function statusCommand(
2414
2470
  if (beganSaid !== null) say(`Began: ${beganSaid}`);
2415
2471
  const asides = [
2416
2472
  "Memories is the number the wake preface states; the journal does not decay.",
2417
- "counterparts doctor grades all of this; counterparts fired says which mechanisms have run.",
2473
+ "counterparts doctor grades all of this; counterparts mechanisms says which mechanisms are working.",
2418
2474
  ];
2419
2475
  say("");
2420
2476
  for (const aside of asides) say(` ${aside}`);
@@ -2423,7 +2479,7 @@ function statusCommand(
2423
2479
  if (removals.length > 0) {
2424
2480
  // Owner side: the id and the date, no body and no content hash — ever.
2425
2481
  const rows = removals.map(
2426
- (row) => ` ${new Date(row.at).toISOString().slice(0, 10)} ${row.memory_id} by ${row.actor}`,
2482
+ (row) => ` ${localDate(row.at, store.zone())} ${row.memory_id} by ${row.actor}`,
2427
2483
  );
2428
2484
  tail.push({ title: "Removed:", lines: rows });
2429
2485
  say("");
@@ -2659,7 +2715,7 @@ function installCommand(
2659
2715
  const existed = storeExists(layout.store);
2660
2716
  let store: Store;
2661
2717
  try {
2662
- store = Store.open({ dir: layout.store });
2718
+ store = openStoreAt({ dir: layout.store });
2663
2719
  } catch (err) {
2664
2720
  io.err(prefixedRefusal(describeDirRefusal(err, layout.store)));
2665
2721
  return EXIT.refused;
@@ -3028,6 +3084,15 @@ async function installConversation(
3028
3084
  io.out(`Nice to meet you, ${answer}.`);
3029
3085
  }
3030
3086
  }
3087
+ // THE ZONE, SAID ONCE AND NOT ASKED (docs/time.md rule 2, 2026-09-25): times
3088
+ // follow the computer, so there is nothing to answer — but a person should
3089
+ // see which clock their memory will read, and how to pin another.
3090
+ const zoneSet = hostConfigFor(layout.config).config.timeZone;
3091
+ u.hint(
3092
+ zoneSet === undefined
3093
+ ? `Times read in ${resolveZone(undefined)}, this computer's zone — "timeZone" in the config pins another.`
3094
+ : `Times read in ${zoneSet}, as the config's "timeZone" says.`,
3095
+ );
3031
3096
  u.blank();
3032
3097
 
3033
3098
  // ── the store and the configuration — SILENTLY ────────────────────────────
@@ -3578,6 +3643,8 @@ export interface RunningView {
3578
3643
  readonly url: string;
3579
3644
  /** The store it opened, resolved — printed, so it is never a guess. */
3580
3645
  readonly dir: string;
3646
+ /** The store waits for its one-time upgrade; the page says so, and so does this. */
3647
+ readonly upgradePending?: boolean;
3581
3648
  stop(): Promise<void>;
3582
3649
  }
3583
3650
 
@@ -3595,7 +3662,7 @@ export interface RunningView {
3595
3662
  * dashboard's own server, named in `test/claude-code.test.ts`.)
3596
3663
  */
3597
3664
  export interface DashboardSeam {
3598
- start(opts: { readonly dir: string; readonly port?: number }): Promise<RunningView>;
3665
+ start(opts: { readonly dir: string; readonly port?: number; readonly config?: string }): Promise<RunningView>;
3599
3666
  /** Open the person's browser. Never throws: a machine with no opener, or a
3600
3667
  * desktop that refuses, is not a reason for the dashboard to fail. */
3601
3668
  open?(url: string): void;
@@ -3673,7 +3740,19 @@ async function dashboardCommand(
3673
3740
  const seam = opts.dashboard ?? realDashboard(env);
3674
3741
  let running: RunningView;
3675
3742
  try {
3676
- running = await seam.start({ dir, ...(port === undefined ? {} : { port }) });
3743
+ // THE CONFIGURATION rides along for the dashboard's management actions
3744
+ // (`scope` and `rebrief` read one) — when this command resolved the store
3745
+ // through it, or when one was named outright. A bare `--dir` names a store
3746
+ // and no configuration, and the dashboard then offers no `scope`.
3747
+ const config =
3748
+ typeof parsed.flags["dir"] !== "string" || (named !== undefined && named.source !== "default")
3749
+ ? configPath
3750
+ : undefined;
3751
+ running = await seam.start({
3752
+ dir,
3753
+ ...(port === undefined ? {} : { port }),
3754
+ ...(config === undefined ? {} : { config }),
3755
+ });
3677
3756
  } catch (err) {
3678
3757
  if ((err as { code?: string }).code === "EADDRINUSE") {
3679
3758
  io.err(
@@ -3691,6 +3770,12 @@ async function dashboardCommand(
3691
3770
  // changed: a whole memory is being served, and "which one" must never be a
3692
3771
  // guess (constitution 16).
3693
3772
  io.out(`reading ${tilde(running.dir, home_)}`);
3773
+ if (running.upgradePending === true) {
3774
+ io.out(
3775
+ `this store is on an older schema; the next Claude Code session copies it and upgrades it to ` +
3776
+ `v${String(SCHEMA_VERSION)}. The page says so until then; reload it after.`,
3777
+ );
3778
+ }
3694
3779
  if (parsed.flags["no-open"] !== true) seam.open?.(running.url);
3695
3780
 
3696
3781
  await (seam.until ?? untilInterrupted)();
@@ -3711,8 +3796,9 @@ function realDashboard(env: Record<string, string | undefined>): DashboardSeam {
3711
3796
  const up = await startDashboard({
3712
3797
  dir: o.dir,
3713
3798
  ...(o.port === undefined ? {} : { port: o.port }),
3799
+ ...(o.config === undefined ? {} : { config: o.config }),
3714
3800
  });
3715
- return { url: up.url, dir: up.dir, stop: (): Promise<void> => up.stop() };
3801
+ return { url: up.url, dir: up.dir, upgradePending: up.upgradePending, stop: (): Promise<void> => up.stop() };
3716
3802
  },
3717
3803
  open(url: string): void {
3718
3804
  openInBrowser(url, env);
@@ -3781,7 +3867,7 @@ function initCommand(dir: string, io: Io, home = homedir(), name?: string): numb
3781
3867
  const existed = storeExists(dir);
3782
3868
  let store: Store;
3783
3869
  try {
3784
- store = Store.open({ dir });
3870
+ store = openStoreAt({ dir });
3785
3871
  } catch (err) {
3786
3872
  io.err(prefixedRefusal(describeDirRefusal(err, dir)));
3787
3873
  return EXIT.refused;
@@ -4329,7 +4415,7 @@ async function startFreshCommand(
4329
4415
  const previous = parkedStore ?? soleParked(final);
4330
4416
  if (!existedBefore) {
4331
4417
  try {
4332
- const store = Store.open({ dir: created });
4418
+ const store = openStoreAt({ dir: created });
4333
4419
  try {
4334
4420
  const entries: [string, string][] = [
4335
4421
  [STORE_STARTED_KEY, final.date],
@@ -4447,7 +4533,7 @@ async function startFreshUndo(
4447
4533
  // path, of the NEW store, as an observer.
4448
4534
  const readRecord = (): string | null => {
4449
4535
  try {
4450
- const store = Store.open({ dir: storeDir, observer: true });
4536
+ const store = openStoreAt({ dir: storeDir, observer: true });
4451
4537
  try {
4452
4538
  return store.getMeta(STORE_PREVIOUS_PARKED_KEY) ?? null;
4453
4539
  } finally {
@@ -4820,6 +4906,7 @@ async function noteCommand(
4820
4906
  parsed: Parsed,
4821
4907
  env: Record<string, string | undefined>,
4822
4908
  home: string,
4909
+ filedUnder?: string,
4823
4910
  ): Promise<number> {
4824
4911
  const text = parsed.positional.join(" ").trim();
4825
4912
  if (text.length === 0) {
@@ -4850,7 +4937,7 @@ async function noteCommand(
4850
4937
  // printed was that something had been remembered.
4851
4938
  io.out(`Store: ${counterpart.store.dir}`);
4852
4939
  const session = "console";
4853
- const scope = process.cwd();
4940
+ const scope = filedUnder ?? process.cwd();
4854
4941
  // Step 1 of 2, and the ORDER is the rule (see the docblock above).
4855
4942
  const captured = counterpart.captureJot({ session, scope, text });
4856
4943
  const ownSpanHash = captured.spans[0]?.hash ?? null;
@@ -4938,7 +5025,8 @@ export function askGist(title: string | null, body: string): string {
4938
5025
 
4939
5026
  /**
4940
5027
  * The quieter line under an answer: what it is, when, and its id —
4941
- * `self · chapter 1 · Wed 23 Sep 2026 · lived day 2 · mem_0a1b2c3d4e5f`.
5028
+ * `self · chapter 1 · Wed 23 Sep 2026 · claude-opus-5-5 · lived day 2 · mem_0a1b2c3d4e5f`
5029
+ * (the model only where the heading names one).
4942
5030
  *
4943
5031
  * The DATE is the one the chapter's own heading names when it names one (a
4944
5032
  * chapter written since 2026-09-24 carries the day it was written, in the
@@ -4958,6 +5046,7 @@ export function askMeta(
4958
5046
  }
4959
5047
  const date = lead.date ?? (learnedOn === null ? "" : readableDate(learnedOn));
4960
5048
  if (date.length > 0) parts.push(date);
5049
+ if (lead.model !== null) parts.push(lead.model);
4961
5050
  if (lead.livedDay !== null) parts.push(`lived day ${String(lead.livedDay)}`);
4962
5051
  parts.push(m.id);
4963
5052
  return parts.join(" · ");
@@ -5020,8 +5109,15 @@ async function recallCommand(
5020
5109
  // Opened WITH the embedder's identity, the way `mcp/index.ts#openServer`
5021
5110
  // opens the server's store: the store reconciles box 3's tag at open, so a
5022
5111
  // held or mismatched meaning index ranks nothing rather than a cosine across
5023
- // two models. That open may write the tag once, as every hook's open does.
5024
- const counterpart = openCounterpart(dir, false, undefined, embedder?.embed);
5112
+ // two models.
5113
+ //
5114
+ // AND IN OBSERVER STANCE (owner, 2026-09-25: asking is looking, and looking
5115
+ // changes nothing). A writable open here backfilled the meaning index — on a
5116
+ // fresh store, one `ask` embedded and wrote every row's vector into box 3 —
5117
+ // and asking from the dashboard runs this same function. Under observer the
5118
+ // question is still embedded and answered; nothing is written, the cache
5119
+ // included. The backfill is the worker's and the hooks' job.
5120
+ const counterpart = openCounterpart(dir, true, undefined, embedder?.embed);
5025
5121
  try {
5026
5122
  // Same rule as `note` and `status`: say which store answered.
5027
5123
  if (parsed.flags["json"] !== true) io.out(`Store: ${counterpart.store.dir}`);
@@ -5469,7 +5565,7 @@ function verifyCommand(dir: string, io: Io, flags: Record<string, string | boole
5469
5565
  * not be paid for with `--rebuild`, which drops every embedding.
5470
5566
  */
5471
5567
  function verifyPruneIndex(dir: string, io: Io): number {
5472
- const store = Store.open({ dir });
5568
+ const store = openStoreAt({ dir });
5473
5569
  try {
5474
5570
  const removed = store.pruneDeadIndex();
5475
5571
  io.out(`Store: ${dir}`);
@@ -5502,7 +5598,7 @@ function verifyPruneIndex(dir: string, io: Io): number {
5502
5598
  * lose nothing.
5503
5599
  */
5504
5600
  function verifyRetrySkipped(dir: string, io: Io): number {
5505
- const store = Store.open({ dir });
5601
+ const store = openStoreAt({ dir });
5506
5602
  try {
5507
5603
  const skipped = store.skippedVectorIds();
5508
5604
  const held = store.metaWithPrefix(EMBED_FAILED_PREFIX);
@@ -5535,13 +5631,13 @@ function verifyRetrySkipped(dir: string, io: Io): number {
5535
5631
  * which is what this read-only line is for. The cap is the sleep budget itself,
5536
5632
  * imported rather than restated, so the number printed is the number in force.
5537
5633
  */
5538
- export function eventLogLines(log: EventLogCensus): string[] {
5634
+ export function eventLogLines(log: EventLogCensus, zone?: string): string[] {
5539
5635
  const cap = SLEEP_TUNABLES.BUDGETS.log;
5540
5636
  const wouldDelete = Math.min(log.eligible, cap);
5541
5637
  const oldest =
5542
5638
  log.oldestDay === null || log.oldestAt === null
5543
5639
  ? "oldest: none"
5544
- : `oldest: lived day ${log.oldestDay} (${dateOf(log.oldestAt)})`;
5640
+ : `oldest: lived day ${log.oldestDay} (${localDate(log.oldestAt, zone)})`;
5545
5641
  return [
5546
5642
  `Events: ${log.rows} held (${log.latched} latched records) ${oldest} ` +
5547
5643
  `window: ${log.retentionDays} lived days (cutoff day ${log.cutoffDay})`,
@@ -5557,7 +5653,7 @@ export function eventLogLines(log: EventLogCensus): string[] {
5557
5653
  * out of date — dashboard INTERFACE-GAPS §1 — which is box 3's business.)
5558
5654
  */
5559
5655
  function verifyCensus(dir: string, io: Io): number {
5560
- const store = Store.open({ dir, observer: true });
5656
+ const store = openStoreAt({ dir, observer: true });
5561
5657
  let canonical: string[];
5562
5658
  let live: string[];
5563
5659
  let denied: string[];
@@ -5632,7 +5728,7 @@ function verifyCensus(dir: string, io: Io): number {
5632
5728
  "and let sessions start again.",
5633
5729
  );
5634
5730
  }
5635
- for (const line of eventLogLines(log)) io.out(line);
5731
+ for (const line of eventLogLines(log, store.zone())) io.out(line);
5636
5732
 
5637
5733
  // The unreadable half of this is narrow by construction: `Store.open` builds
5638
5734
  // box 3 on the way in, so a cache this process cannot read usually fails the
@@ -5731,7 +5827,7 @@ function verifyRebuild(dir: string, io: Io, dropVectors: boolean, keepVectors: b
5731
5827
  // longer a reason to refuse, because the count it could not take was only
5732
5828
  // ever the count of what would be LOST.
5733
5829
  if (keepVectors) {
5734
- const store = Store.open({ dir });
5830
+ const store = openStoreAt({ dir });
5735
5831
  try {
5736
5832
  const canonical = store.list().length;
5737
5833
  const report = store.rebuildCache({ keepVectors: true });
@@ -5770,7 +5866,7 @@ function verifyRebuild(dir: string, io: Io, dropVectors: boolean, keepVectors: b
5770
5866
  );
5771
5867
  return EXIT.refused;
5772
5868
  }
5773
- const store = Store.open({ dir });
5869
+ const store = openStoreAt({ dir });
5774
5870
  try {
5775
5871
  const canonical = store.list().length;
5776
5872
  const report = store.rebuildCache();
@@ -6262,10 +6358,10 @@ function backupCommand(
6262
6358
  // is now an ordinary failure report with an exit code.
6263
6359
  let store: Store;
6264
6360
  try {
6265
- store = Store.open({ dir, observer: true });
6361
+ store = openStoreAt({ dir, observer: true });
6266
6362
  } catch (err) {
6267
6363
  io.out(`Snapshot: none — nothing was copied.`);
6268
- io.err(` could not open the store: ${describeDirRefusal(err, dir)}`);
6364
+ io.err(` ${openRefusalLine(err, dir)}`);
6269
6365
  return EXIT.failed;
6270
6366
  }
6271
6367
  try {
@@ -6316,7 +6412,7 @@ function exportCommand(
6316
6412
  // the store it is reading, the durable row included).
6317
6413
  let store: Store;
6318
6414
  try {
6319
- store = Store.open({ dir, observer });
6415
+ store = openStoreAt({ dir, observer });
6320
6416
  } catch (err) {
6321
6417
  io.err(`export refused: ${describeDirRefusal(err, dir)}`);
6322
6418
  return EXIT.refused;
@@ -6479,7 +6575,7 @@ async function removeByIdCommand(
6479
6575
  const planOpts = removalPlanOptions(flags);
6480
6576
 
6481
6577
  // THE PLAN, made read-only and with no lock held (scar E5).
6482
- const planning = Store.open({ dir, observer: true });
6578
+ const planning = openStoreAt({ dir, observer: true });
6483
6579
  let plan;
6484
6580
  try {
6485
6581
  plan = planRemoval(planning, targetId, planOpts);
@@ -6510,7 +6606,7 @@ async function removeByIdCommand(
6510
6606
 
6511
6607
  // RELOAD AND RE-PLAN under the writing store: the human took time, and the
6512
6608
  // store may not be the store the plan was made against.
6513
- const store = Store.open({ dir });
6609
+ const store = openStoreAt({ dir });
6514
6610
  try {
6515
6611
  const outcome = removeOne(store, io, targetId, flags, now, planOpts, "scripted");
6516
6612
  return outcome === "removed" ? EXIT.ok : outcome === "refused" ? EXIT.refused : EXIT.failed;
@@ -6756,7 +6852,7 @@ async function removeInteractively(
6756
6852
  // ONE writing store for the whole selection, and each memory re-planned under
6757
6853
  // it on its own — the human took time, and the store may have moved since the
6758
6854
  // lines above were printed.
6759
- const store = Store.open({ dir });
6855
+ const store = openStoreAt({ dir });
6760
6856
  let removed = 0;
6761
6857
  let refused = 0;
6762
6858
  let failed = 0;
@@ -6923,7 +7019,7 @@ function searchForRemoval(
6923
7019
  query: string,
6924
7020
  ): { candidates: RemovalCandidate[]; truncated: boolean } {
6925
7021
  const fetch = REMOVE_SEARCH_LIMIT * 2;
6926
- const store = Store.open({ dir, observer: true });
7022
+ const store = openStoreAt({ dir, observer: true });
6927
7023
  try {
6928
7024
  const out: RemovalCandidate[] = [];
6929
7025
  const hits = store.search(query, fetch);
@@ -6960,7 +7056,7 @@ function inspectForRemoval(
6960
7056
  refused: { id: string; reason: RemovalPlan["reason"] } | null;
6961
7057
  entries: { line: string; plan: RemovalPlan }[];
6962
7058
  } {
6963
- const store = Store.open({ dir, observer: true });
7059
+ const store = openStoreAt({ dir, observer: true });
6964
7060
  try {
6965
7061
  const entries: { line: string; plan: RemovalPlan }[] = [];
6966
7062
  for (const id of chosen) {
@@ -7086,7 +7182,7 @@ function backfillClaimsCommand(
7086
7182
  const floor = TUNABLES.AUTHORED_DEFAULT_CLAIM;
7087
7183
 
7088
7184
  // The plan is made read-only, as every plan here is (scar E5).
7089
- const planning = Store.open({ dir, observer: true });
7185
+ const planning = openStoreAt({ dir, observer: true });
7090
7186
  let targets: { id: string; kind: string; dims: string }[];
7091
7187
  try {
7092
7188
  targets = backfillTargets(planning);
@@ -7110,7 +7206,7 @@ function backfillClaimsCommand(
7110
7206
  return EXIT.ok;
7111
7207
  }
7112
7208
 
7113
- const store = Store.open({ dir });
7209
+ const store = openStoreAt({ dir });
7114
7210
  let written = 0;
7115
7211
  const failures: string[] = [];
7116
7212
  try {
@@ -7325,7 +7421,7 @@ function repairMergedBeliefsCommand(
7325
7421
  }
7326
7422
 
7327
7423
  // The plan is made read-only, as every plan here is (scar E5).
7328
- const planning = Store.open({ dir, observer: true });
7424
+ const planning = openStoreAt({ dir, observer: true });
7329
7425
  let targets: MergedBelief[];
7330
7426
  try {
7331
7427
  targets = mergedBeliefs(planning);
@@ -7371,7 +7467,7 @@ function repairMergedBeliefsCommand(
7371
7467
  return EXIT.ok;
7372
7468
  }
7373
7469
 
7374
- const store = Store.open({ dir });
7470
+ const store = openStoreAt({ dir });
7375
7471
  let restored = 0;
7376
7472
  const failures: string[] = [];
7377
7473
  try {
@@ -7547,7 +7643,7 @@ function rebriefCommand(
7547
7643
  try {
7548
7644
  // The horizon lane asks about a calendar date; the console's own clock is
7549
7645
  // the only one in the room, and tests inject it.
7550
- const at = new Date(now()).toISOString().slice(0, 10);
7646
+ const at = localDate(now(), counterpart.store.zone());
7551
7647
  const report = counterpart.rebrief({ budgetBytes: ceiling.bytes, at });
7552
7648
  if (!report.rendered) {
7553
7649
  io.err(`refused: the render declined (${report.reason}).`);
@@ -7955,14 +8051,56 @@ export function openCounterpart(
7955
8051
  // one way, with a name from a flag instead of from `claude-code.json`.
7956
8052
  // `embed` likewise: the option every composition root hands its embedder's
7957
8053
  // sync face through (`ask`, 2026-09-24).
8054
+ const snapshotsDir = observer ? undefined : snapshotsDirBeside(dir);
8055
+ const timeZone = zoneBeside(dir);
7958
8056
  return Counterpart.open({
7959
8057
  dir,
7960
8058
  observer,
8059
+ ...(timeZone === undefined ? {} : { timeZone }),
7961
8060
  ...(identity === undefined ? {} : { identity }),
7962
8061
  ...(embed === undefined ? {} : { embed }),
8062
+ ...(snapshotsDir === undefined ? {} : { snapshotsDir }),
7963
8063
  });
7964
8064
  }
7965
8065
 
8066
+ /**
8067
+ * `snapshots.dir` from the host configuration beside the store
8068
+ * (`<base>/claude-code.json`, the file `install` writes), so a migration the
8069
+ * console runs puts its copy where the worker's rotation and doctor look.
8070
+ * Absent, unreadable or unset: undefined, and the store's default applies.
8071
+ */
8072
+ /**
8073
+ * `timeZone` from the host configuration beside the store — the same file
8074
+ * `snapshotsDirBeside` reads — so a console command names the person's day in
8075
+ * the zone the hooks use (docs/time.md, 2026-09-25). Absent or unreadable:
8076
+ * undefined, and the store follows the machine's zone.
8077
+ */
8078
+ export function zoneBeside(dir: string): string | undefined {
8079
+ const beside = join(dir, "..", "claude-code.json");
8080
+ if (!existsSync(beside)) return undefined;
8081
+ try {
8082
+ return loadConfig(JSON.parse(readFileSync(beside, "utf8"))).config.timeZone;
8083
+ } catch {
8084
+ return undefined;
8085
+ }
8086
+ }
8087
+
8088
+ /** `Store.open` for the console: the config's zone beside the store rides along. */
8089
+ function openStoreAt(opts: { dir: string; observer?: boolean }): Store {
8090
+ const timeZone = zoneBeside(opts.dir);
8091
+ return Store.open({ ...opts, ...(timeZone === undefined ? {} : { timeZone }) });
8092
+ }
8093
+
8094
+ export function snapshotsDirBeside(dir: string): string | undefined {
8095
+ const beside = join(dir, "..", "claude-code.json");
8096
+ if (!existsSync(beside)) return undefined;
8097
+ try {
8098
+ return loadConfig(JSON.parse(readFileSync(beside, "utf8"))).config.snapshots?.dir;
8099
+ } catch {
8100
+ return undefined;
8101
+ }
8102
+ }
8103
+
7966
8104
  // ── doctor ──────────────────────────────────────────────────────────────────
7967
8105
 
7968
8106
  /**
@@ -8150,7 +8288,8 @@ function doctorCommand(
8150
8288
  return EXIT.refused;
8151
8289
  }
8152
8290
 
8153
- const today = new Date().toISOString().slice(0, 10);
8291
+ // The person's day: the config's zone, else the machine's (docs/time.md).
8292
+ const today = todayIn(resolveZone(config.timeZone));
8154
8293
  let store: Store | null = null;
8155
8294
  try {
8156
8295
  // WOULD A SESSION OPEN THIS STORE — asked FIRST, and closed again inside the
@@ -8160,8 +8299,17 @@ function doctorCommand(
8160
8299
  // `Counterpart.open` throws at every session start (H1). Inside this `try`
8161
8300
  // rather than above it, because `doctor` is the command people run BECAUSE
8162
8301
  // something is wrong, and its own reading must not be the thing that throws.
8163
- const open = storeExists(dir) ? readCounterpartOpen(dir) : undefined;
8164
- if (storeExists(dir)) store = Store.open({ dir, observer: true });
8302
+ const open = storeExists(dir) ? readCounterpartOpen(dir, undefined, config.snapshots?.dir) : undefined;
8303
+ if (storeExists(dir)) {
8304
+ try {
8305
+ store = Store.open({ dir, observer: true, ...(config.timeZone === undefined ? {} : { timeZone: config.timeZone }) });
8306
+ } catch (err) {
8307
+ // A store BEHIND this build refuses an observer until a session has
8308
+ // upgraded it; the Store open line already grades that, so the rest of
8309
+ // the reading goes on without a handle rather than failing.
8310
+ if (open?.migration === undefined || !isStoreError(err, "STORE_UNINITIALIZED")) throw err;
8311
+ }
8312
+ }
8165
8313
  const findings = doctorFindings({
8166
8314
  configPath,
8167
8315
  configReason: reason,