counterparts 0.3.4 → 0.3.5

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 (124) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/docs/module-map.md +2 -2
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/NOTES.md +13 -0
  5. package/src/adapters/claude-code/doctor.ts +126 -0
  6. package/src/adapters/claude-code/hooks.ts +15 -0
  7. package/src/adapters/claude-code/index.ts +2 -0
  8. package/src/adapters/cli/NOTES.md +12 -0
  9. package/src/adapters/cli/commands.ts +34 -5
  10. package/src/adapters/cli/dream-core.ts +70 -3
  11. package/src/adapters/cli/export.ts +21 -2
  12. package/src/adapters/cli/help.ts +8 -5
  13. package/src/adapters/cli/mechanisms.ts +7 -1
  14. package/src/adapters/dashboard/source.ts +8 -0
  15. package/src/adapters/dashboard/web/README.md +105 -28
  16. package/src/adapters/dashboard/web/actions.ts +45 -3
  17. package/src/adapters/dashboard/web/ask-voice.ts +364 -0
  18. package/src/adapters/dashboard/web/lanes.ts +32 -2
  19. package/src/adapters/dashboard/web/mechanisms/association/index.js +1 -0
  20. package/src/adapters/dashboard/web/mechanisms/association/panel.js +1 -3
  21. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +1 -0
  22. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +31 -17
  23. package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -0
  24. package/src/adapters/dashboard/web/mechanisms/decay/panel.js +1 -3
  25. package/src/adapters/dashboard/web/mechanisms/dreaming/index.js +3 -2
  26. package/src/adapters/dashboard/web/mechanisms/dreaming/panel.js +20 -0
  27. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +1 -0
  28. package/src/adapters/dashboard/web/mechanisms/emotional/panel.js +24 -0
  29. package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +1 -0
  30. package/src/adapters/dashboard/web/mechanisms/episodic-semantic/panel.js +11 -0
  31. package/src/adapters/dashboard/web/mechanisms/index.js +15 -4
  32. package/src/adapters/dashboard/web/mechanisms/interference/index.js +1 -0
  33. package/src/adapters/dashboard/web/mechanisms/prospective/index.js +1 -0
  34. package/src/adapters/dashboard/web/mechanisms/prospective/panel.js +18 -0
  35. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +1 -0
  36. package/src/adapters/dashboard/web/mechanisms/reconsolidation/panel.js +1 -3
  37. package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +1 -0
  38. package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +54 -15
  39. package/src/adapters/dashboard/web/mechanisms/salience/index.js +1 -0
  40. package/src/adapters/dashboard/web/mechanisms/salience/panel.js +1 -2
  41. package/src/adapters/dashboard/web/mechanisms/schema/index.js +1 -0
  42. package/src/adapters/dashboard/web/narrate.ts +53 -3
  43. package/src/adapters/dashboard/web/pages/health/health.css +14 -0
  44. package/src/adapters/dashboard/web/pages/health/index.js +5 -1
  45. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +8 -5
  46. package/src/adapters/dashboard/web/pages/health/sections/wake.js +49 -0
  47. package/src/adapters/dashboard/web/pages/home/home.css +114 -32
  48. package/src/adapters/dashboard/web/pages/home/index.js +9 -7
  49. package/src/adapters/dashboard/web/pages/home/sections/explorer.js +118 -42
  50. package/src/adapters/dashboard/web/pages/home/sections/hero.js +7 -3
  51. package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +6 -3
  52. package/src/adapters/dashboard/web/pages/home/sections/tiles.js +4 -11
  53. package/src/adapters/dashboard/web/pages/home/sections/tonight.js +74 -0
  54. package/src/adapters/dashboard/web/pages/home/sections/written.js +76 -0
  55. package/src/adapters/dashboard/web/pages/memories/fold.js +48 -0
  56. package/src/adapters/dashboard/web/pages/memories/memories.css +5 -0
  57. package/src/adapters/dashboard/web/pages/memories/row.js +8 -2
  58. package/src/adapters/dashboard/web/pages/memories/sections/search.js +50 -10
  59. package/src/adapters/dashboard/web/pages/self/index.js +15 -11
  60. package/src/adapters/dashboard/web/pages/self/sections/dreams.js +2 -1
  61. package/src/adapters/dashboard/web/pages/self/sections/journal.js +31 -12
  62. package/src/adapters/dashboard/web/pages/self/sections/map.js +217 -0
  63. package/src/adapters/dashboard/web/pages/self/sections/page.js +120 -61
  64. package/src/adapters/dashboard/web/pages/self/sections/settling.js +31 -41
  65. package/src/adapters/dashboard/web/pages/self/sections/traits.js +101 -0
  66. package/src/adapters/dashboard/web/pages/self/sections/wake.js +45 -52
  67. package/src/adapters/dashboard/web/pages/self/self.css +105 -72
  68. package/src/adapters/dashboard/web/pages/self/state.js +4 -0
  69. package/src/adapters/dashboard/web/server.ts +20 -1
  70. package/src/adapters/dashboard/web/shared/absence.js +1 -3
  71. package/src/adapters/dashboard/web/shared/memory-card-words.js +96 -0
  72. package/src/adapters/dashboard/web/shared/memory-modal.js +13 -22
  73. package/src/adapters/dashboard/web/shared/widgets/feed.js +44 -7
  74. package/src/adapters/dashboard/web/views/activity.ts +33 -3
  75. package/src/adapters/dashboard/web/views/core-road.ts +56 -0
  76. package/src/adapters/dashboard/web/views/health.ts +61 -9
  77. package/src/adapters/dashboard/web/views/mechanism-panel.ts +375 -86
  78. package/src/adapters/dashboard/web/views/mechanisms.ts +106 -5
  79. package/src/adapters/dashboard/web/views/memory.ts +96 -31
  80. package/src/adapters/dashboard/web/views/mind.ts +582 -52
  81. package/src/adapters/dashboard/web/views/overview.ts +14 -21
  82. package/src/adapters/dashboard/web/views/search.ts +45 -2
  83. package/src/adapters/dashboard/web/views/self-map.ts +124 -0
  84. package/src/adapters/dashboard/web/views/tonight.ts +158 -0
  85. package/src/adapters/dashboard/web/views/traits.ts +197 -0
  86. package/src/adapters/dashboard/web/views/written-returned.ts +93 -0
  87. package/src/adapters/dashboard/web/views.ts +6 -4
  88. package/src/adapters/fired.ts +23 -1
  89. package/src/adapters/mcp/CONTRACT.md +3 -0
  90. package/src/adapters/mcp/NOTES.md +40 -0
  91. package/src/adapters/mcp/bin/serve.ts +6 -1
  92. package/src/adapters/mcp/index.ts +4 -0
  93. package/src/adapters/mcp/server.ts +256 -5
  94. package/src/adapters/mcp/tools.ts +196 -1
  95. package/src/adapters/mechanism-evidence.ts +26 -3
  96. package/src/core/counterpart.ts +86 -2
  97. package/src/core/dream/CONTRACT.md +93 -9
  98. package/src/core/dream/INTERFACE-GAPS.md +25 -0
  99. package/src/core/dream/NOTES.md +106 -0
  100. package/src/core/dream/index.ts +143 -13
  101. package/src/core/dream/mind.ts +110 -0
  102. package/src/core/dream/reflect.ts +1154 -0
  103. package/src/core/physics/CONTRACT.md +23 -1
  104. package/src/core/physics/NOTES.md +48 -0
  105. package/src/core/physics/index.ts +100 -7
  106. package/src/core/self/CONTRACT.md +8 -1
  107. package/src/core/self/INTERFACE-GAPS.md +4 -0
  108. package/src/core/self/NOTES.md +15 -0
  109. package/src/core/sleep/CONTRACT.md +2 -1
  110. package/src/core/sleep/NOTES.md +51 -0
  111. package/src/core/sleep/consolidate.ts +146 -25
  112. package/src/core/sleep/index.ts +12 -2
  113. package/src/core/sleep/types.ts +17 -0
  114. package/src/core/store/CONTRACT.md +15 -0
  115. package/src/core/store/NOTES.md +89 -0
  116. package/src/core/store/errors.ts +12 -0
  117. package/src/core/store/feelings.ts +16 -0
  118. package/src/core/store/index.ts +502 -19
  119. package/src/core/store/operational.ts +351 -7
  120. package/src/core/store/owner-op-seam.ts +110 -1
  121. package/src/core/store/traits.ts +161 -0
  122. package/src/core/types.ts +17 -2
  123. package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +0 -17
  124. package/src/adapters/dashboard/web/shared/widgets/chapters.js +0 -15
@@ -364,13 +364,16 @@ export const COMMAND_DETAIL: Record<string, readonly string[]> = {
364
364
  "minutes; the owner says yes or not today. A dream runs as a background",
365
365
  "agent and every change it makes is recorded under its id, so --undo can",
366
366
  "reverse the whole batch. Its journal lives with the dream, never as a",
367
- "memory.",
367
+ "memory. Then the dreamer wakes and reflects: a lived entry, maybe a new",
368
+ "self page, and a short morning share the session tells you.",
368
369
  ],
369
370
  core: [
370
- "The core does not fade. Only a memory about me or about us gets there: by",
371
- "the fast lane (strongly felt, and it came back after a gap) or the slow",
372
- "lane (it came back on several separate days over weeks), at most a few a",
373
- "night. A dream can nominate one; only a lane promotes it.",
371
+ "The core does not fade. Only a memory about me, about us or about the",
372
+ "owner gets there — what a memory is about is marked by meaning, by the",
373
+ "writer or a reflection: by the fast lane (strongly felt, and it came back",
374
+ "after a gap) or the slow lane (it came back on several separate days over",
375
+ "weeks), at most a few a night. A dream can nominate one; only a lane",
376
+ "promotes it.",
374
377
  ],
375
378
  fired: [
376
379
  "`counterparts mechanisms` is the same command, and it is the listed",
@@ -271,10 +271,16 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
271
271
  read: (v) => {
272
272
  const dreams = part(v, "dreams");
273
273
  const changes = part(v, "changes");
274
+ // Said apart from the changes: a nomination moves nothing until a lane promotes it awake.
275
+ const suggestions = part(v, "suggestions");
276
+ const made = [...(changes > 0 ? [plural(changes, "change")] : []), ...(suggestions > 0 ? [plural(suggestions, "core suggestion")] : [])];
277
+ const reflections = part(v, "reflections");
274
278
  if (v.fired) {
275
279
  return {
276
280
  light: LIGHT.working,
277
- says: `${plural(dreams, "dream")} this week${changes > 0 ? ` (${plural(changes, "change")})` : ""}`,
281
+ says: `${plural(dreams, "dream")} this week${made.length > 0 ? ` (${made.join(", ")})` : ""}${
282
+ reflections > 0 ? `; ${plural(reflections, "reflection")} afterwards` : ""
283
+ }`,
278
284
  };
279
285
  }
280
286
  return {
@@ -22,6 +22,7 @@
22
22
  * scan stays — it is what covers them, and a cast.
23
23
  */
24
24
  import type { Counterpart } from "../../core/counterpart.js";
25
+ import type { Dreams } from "../../core/dream/index.js";
25
26
  import type { Schemas } from "../../core/schemas/index.js";
26
27
  import type { Self } from "../../core/self/index.js";
27
28
  import type { ReadOnlyStore } from "../../core/store/index.js";
@@ -30,6 +31,12 @@ export interface DashboardSource {
30
31
  readonly store: ReadOnlyStore;
31
32
  readonly schemas: Schemas;
32
33
  readonly self: Self;
34
+ /**
35
+ * The dream gate's read-only preview (`Dreams.previewAsk`, #262): would the
36
+ * day's ask be raised now, and why. Optional so a hand-built source still
37
+ * type-checks; a view without it says only how much is new.
38
+ */
39
+ readonly dreams?: Pick<Dreams, "previewAsk">;
33
40
  /** Always true. A false one never gets built. */
34
41
  readonly observer: boolean;
35
42
  }
@@ -49,6 +56,7 @@ export function sourceOf(counterpart: Counterpart): DashboardSource {
49
56
  store: counterpart.store,
50
57
  schemas: counterpart.schemas,
51
58
  self: counterpart.self,
59
+ dreams: counterpart.dreams,
52
60
  observer: true,
53
61
  };
54
62
  }
@@ -12,9 +12,10 @@ step, no dependencies. `server.ts` serves them as files (see "Serving" below).
12
12
  |---|---|
13
13
  | `server.ts` | `node:http` on 127.0.0.1, the Host allowlist, `router()` (GET: `/`, `/brain` (now a redirect to `/#home`), the favicon, `/api/*`, the static files), and the POST hand-off to `actions.ts`. A store waiting for its one-time upgrade (v6 met by v7, `../upgrade.ts`) gets one calm page instead, and is tried again on every request |
14
14
  | `actions.ts` | managing: `POST /api/action/<name>` — the same-origin + per-launch-token guard, argument validation, and the console's own `run()` (loaded lazily; never handed the observer source). `ACTIONS` lists them: `ask`, `note`, `remove`, `backup`, `export`, `scope`, `rebrief`, `verify`, and `doctor` (a read: the health tab's checklist, `doctor --json`) |
15
+ | `ask-voice.ts` | `toMyVoice(question, ownerName)`: Ask is the owner talking to me, so `ask` turns his question into my voice before it searches ("do you remember what I said" → "do I remember what Mike said"; his I → "you" when the store knows no name). Pure; the rules are in its header and `test/dashboard-ask-voice.test.ts`. The server reads the name (`sleep#ownerNames`) and hands `actions.ts` the string |
15
16
  | `static.ts` | `resolveStatic()`: which URL paths are static files and where they live (pure; no fs) |
16
17
  | `views.ts` | the index of `views/`: re-exports every view, so callers import from here |
17
- | `views/<name>.ts` | one module per `/api` view: `meta`, `overview` (the home tab's), `memories` (`/api/memories` + `/api/memories/list`), `memory`, `search`, `mind` (the self tab's), `activity`, `flow-view` (`/api/flow` + `/api/node`), `health`, `pulse`, `mechanisms`, `mechanism-panel` (`/api/mechanism?id=`) |
18
+ | `views/<name>.ts` | one module per `/api` view: `meta`, `overview` (the home tab's), `memories` (`/api/memories` + `/api/memories/list`), `memory`, `search` (`/api/search` + `/api/chapters`), `mind` (the self tab's; its trait bars are `traits`), `activity`, `flow-view` (`/api/flow` + `/api/node`), `health`, `pulse`, `mechanisms`, `mechanism-panel` (`/api/mechanism?id=`) |
18
19
  | `views/archive-words.ts` | why a memory was archived, in plain words: one table (`ARCHIVE_WORDS`, a group phrase and a single-row phrase per reason) and one fallback for a reason nobody mapped; health's bar, the memories list and home's archived count read it |
19
20
  | `views/mechanisms.ts` | `/api/mechanisms`: each mechanism's light (grey = not built, green = fired in the last 7 lived days, waiting = built and not due — a scheduled run ahead, or nothing to act on — amber = built and quiet), its `build` (built / partly / not: the pill's "partly built" tag), one evidence line, the newest backing event `seq`s. Which rows count as a firing is `adapters/mechanism-evidence.ts` — ONE judgement shared with `counterparts mechanisms` (`cli/mechanisms.ts`), which keeps its own words and its calendar window; this file owns the lived-day window and the dashboard's words |
20
21
  | `views/shared.ts` | the census and small counters every view leans on |
@@ -55,7 +56,7 @@ shared/
55
56
  event-modal.js openEvent (window global)
56
57
  state.js tabs {current, loaded}; live {lastSeq, fingerprint}
57
58
  widgets/ card rows table chart tiles bar feed light .css;
58
- feed.js (renderFeed, live-feed registry), chapters.js (chapterRows),
59
+ feed.js (renderFeed, live-feed registry),
59
60
  confirm.js + .css (confirmTyped: type a phrase back to confirm),
60
61
  light.js (the status dot: green / waiting ring / amber / grey),
61
62
  tips.js + .css (the `?`: explaining words behind a tap or hover; one
@@ -69,9 +70,11 @@ pages/<tab>/ tabs: home (was overview), memories, self (was mind), flow
69
70
  <tab>.css styles only this page uses (home, memories, self, flow, health)
70
71
  mechanisms/
71
72
  index.js MECHANISMS (the site's eleven, in its order) and FAMILIES (its four, with colours)
72
- <id>/index.js default export { id, family, name, short, tagline, inDev, explainer };
73
- the light comes from /api/mechanisms
74
- <id>/panel.js picture(payload): the Explorer panel's picture, where one is drawn
73
+ <id>/index.js default export { id, family, name, short, tagline, does, explainer,
74
+ built, inDevelopment }; the light (and its big number) come from
75
+ /api/mechanisms
76
+ <id>/panel.js picture(payload): the Explorer panel's list of our memories (every
77
+ built mechanism has one since home round 3b)
75
78
  picture.js the pictures' shared pieces
76
79
  regions.js brain regions → mechanisms, as the site maps them
77
80
  ```
@@ -90,9 +93,8 @@ drawn. The home hero's four counts are links of this kind.
90
93
  The home page (round 2, 2026-09-26, an experiment) is one short headline
91
94
  ("Day 30 · 145 memories · 8 of 11 built · 6 active this week"; the mechanism
92
95
  score is behind `SHOW_MECHANISM_SCORE` in `views/overview.ts`, the one place to
93
- take it out), four small tiles (`sections/tiles.js`: memories, core with the
94
- closest candidate's days from `views/mind.ts#coreCandidates`, chapters, and
95
- replaced, with what was let go or removed as its own small number via
96
+ take it out), four small tiles (`sections/tiles.js`: memories, core (the count and a
97
+ link to Self, since round 3b), chapters, and replaced, with what was let go or removed as its own small number via
96
98
  `archive-words.ts#archiveGroup`), the brain, the mechanism panel, and a live
97
99
  feed of memory events only (`lanes.ts`; the housekeeping stays on the flow
98
100
  tab's feed, and the pulse's live rows are filtered by `registerLiveFeed(id,
@@ -115,6 +117,35 @@ narrated, plus a `picture`, both read-only). `mechanisms/picture.js` holds the
115
117
  pictures' shared pieces. A mechanism built later gets a `panel.js`, one line in
116
118
  `PANELS`, and a case in `mechanism-panel.ts`.
117
119
 
120
+ Home round 3 (2026-09-27, a try): under the tiles, `sections/written.js` draws
121
+ "written vs came back" per lived day (`views/written-returned.ts`, from the
122
+ `returns` table by source; `legacy` rows are never shown). Beside the feed,
123
+ `sections/tonight.js` is the next sleep in a few lines (`views/tonight.ts`:
124
+ the sleep markers, the core road, the let-go line, new since the last dream,
125
+ the last dream's suggestions). Anything that says who is close to the core asks
126
+ `views/core-road.ts`, a thin wrapper over sleep's `aboutMe` and physics'
127
+ `promotionEligibility`; nothing here re-derives eligibility. A sleep that only
128
+ checked and found nothing due (`lanes.ts#isSleepCheck`) goes to the flow feed;
129
+ the home feed folds neighbours that read the same (server: `activityView`'s
130
+ `fold`; pulse: `registerLiveFeed(id, accept, { fold: true })`), and a merged
131
+ line prints its span ("days 1–6").
132
+
133
+ Home round 3b (2026-09-27, a try): less on the page, and what remains is about
134
+ our memories; each thing lives on one page and is linked from the others. The
135
+ pills are one line that scrolls sideways inside itself (`.mechs`), each with its
136
+ stage as a small colour mark instead of a heading. The panel is the same three
137
+ things for every mechanism: one big number (`lead` on each light, picked from
138
+ the evidence parts by `LEADS` in `views/mechanisms.ts`), the memories behind it
139
+ (at most `PICTURE_ROWS` in `views/mechanism-panel.ts`), and the module's one
140
+ `does` line. The rest (the site's line, the explainer, the firing line, built /
141
+ in development, Lately, the Field Guide link) is behind a "how it works" fold,
142
+ closed by default and kept open for the tab's session (sessionStorage). The core
143
+ (who is close), chapters and dreams live on the Self tab: the core tile and
144
+ Tonight give counts that link to `#self/settling` and `#self/dreams`, the
145
+ Consolidation picture shows what came back, merged or was replayed this week,
146
+ and the Dreaming picture links "the dream journal →". The "Latest chapters"
147
+ column and `shared/widgets/chapters.js` are gone.
148
+
118
149
  `pages/memories/` — the memories tab (round 2, 2026-09-26, an experiment:
119
150
  brighter = held more firmly, everywhere on the tab). `state.js` holds the
120
151
  page's filters (live/archived/all, kind, core, journal, hold, feeling, sort, page
@@ -123,7 +154,12 @@ from it and puts the scroll back, and `counterparts:changed` (a window event,
123
154
  fired after a note and after a removal on the memory card) makes the page
124
155
  re-read at once. `row.js` is the one row shape the list, search hits and Ask's
125
156
  answers share. Sections: `search.js` (search by words,
126
- plus Ask via `act("ask", {json:true})`, its tiers drawn as brightness),
157
+ plus Ask via `act("ask", {json:true})`, its tiers drawn as brightness; a
158
+ journal chapter and the memory drawn from it are folded into one answer by
159
+ `fold.js`, with a "from chapter …" link, from `/api/chapters` in
160
+ `views/search.ts`; the question is turned into my voice server side by
161
+ `ask-voice.ts`, and when it was, a grey "searched as: …" line sits under the
162
+ answers with "search exactly as typed", which holds until the box changes),
127
163
  `tools.js` (write a note, and the back-up/export folder dialog),
128
164
  `hold.js` ("How firmly it's held": one bar, firm / settling / fading, from
129
165
  `holdOf` in `views/memories.ts`; a part clicked filters the list), `feel.js`
@@ -135,24 +171,61 @@ feelings in words); archive reasons come from `views/archive-words.ts`.
135
171
  `shared/memory-marks.{js,css}` are the kind icons and colours, feeling dots,
136
172
  the strength meter and the badges, used by the rows and the memory card
137
173
  (`shared/memory-modal.js`, whose strength curve comes from `fadeCurve` in
138
- `views/mechanism-panel.ts`, the Forgetting panel's own maths).
139
-
140
- `pages/self/`: the self tab (reworked 2026-09-26 as an experiment). The top is
141
- two columns: the self page on the left (rendered by `markdown.js`, which escapes
142
- first), and a side column with when it was rewritten and by whom, the page
143
- writer's newest night in words (`writer` in `views/mind.ts`, read through
144
- `self/`'s `pageWriterStatus`), the history as a line of dots, and the wake.
145
- `sections/page.js` draws the page, the side column's facts and the dots;
146
- clicking a dot opens that version above the page and diffs it against the one
147
- before with `diff.js` (line comparison, then words, no deps); nothing is open
148
- by default. `sections/settling.js` is one line of counts (core, protected,
149
- argued with; each opens its list) over a compact chart of the closest
150
- candidates for the core; the view computes them with
151
- `physics#promotionEligibility`. `sections/wake.js` is the wake as one line and
152
- a stacked bar of its parts (`wakeParts`, cut at the lane headings from `self/`),
153
- with the rebrief button shown disabled ("coming soon", back with the sleep
154
- work). `sections/journal.js` is a strip of days; a day lists its chapters, a
155
- chapter opens in place. The `?` that holds each explaining line is
174
+ `views/mechanism-panel.ts`, the Forgetting panel's own maths). The card's
175
+ sentences that read the payload — the road to the core (the engine's verdict,
176
+ `views/memory.ts#coreRoad`, from `physics#promotionEligibility`; the fast lane
177
+ named when it applies), where the curve starts ("written" until a real use),
178
+ and the Versions rows (a dream's near-copy merges named and grouped) — are
179
+ pure functions in `shared/memory-card-words.js`, checked in `bun test`.
180
+
181
+ `pages/self/`: the self tab (reworked 2026-09-26 as an experiment; round 3b,
182
+ 2026-09-27, prefers a picture to a paragraph). The top is two columns: the self
183
+ page on the left (rendered by `markdown.js`, which escapes first), and a side
184
+ column with the page's history as ONE strip and the wake as a short list.
185
+ `sections/page.js` draws the page and the strip: one dot per lived day from the
186
+ page's first version to the newest lived day (`pageDays` in `views/mind.ts`). A
187
+ filled dot is a day it was rewritten; clicking it opens that day's newest
188
+ version above the page, diffed against the one before with `diff.js` (line
189
+ comparison, then words, no deps). A hollow dot is a day it was not; hover or
190
+ tap it for why, in the page writer's own recorded words (the newest
191
+ `pageWriterRuns` row that happened that lived day, read through `self/`'s
192
+ `pageWriterStatus` and worded by `writerWords`), or "no record" when there is
193
+ none. A version sits on the lived day it was WRITTEN (`PageVersion.day` is the
194
+ day it was replaced). Nothing is open by default. A page
195
+ `PAGE_BEHIND_LIVED_DAYS` or more lived days old gets one calm line above it
196
+ (`pageBehind`: when it was written, and the lived days, chapters and dreams
197
+ since). `sections/settling.js` is one line of counts (core, protected, argued
198
+ with; each opens its list), then the self map, then what crossed lately. The
199
+ self map (`sections/map.js` + `views/self-map.ts`, an experiment kept in those
200
+ two files so it is easy to change or take out) draws the memories about me or
201
+ about us as dots, as bright as they are firmly held, the core ringed in the
202
+ middle, a faint ring on the ones one awake return away, nearer the middle the
203
+ closer to the core, and the association links (`edgesFrom`) as lines; hover
204
+ for the words, click for the card. Who is drawn and how close each is comes
205
+ from `coreCandidates` (`physics#promotionEligibility` in the engine's own
206
+ context: `aboutMe`, the lived day, the owner's demotion; a memory he sent back
207
+ is not drawn), and the faint ring is `oneReturnAway`; the layout is a pure
208
+ function of the data, so a live refresh draws the same picture. `settling.candidates`
209
+ (the five closest) stays in the view for the home tile's sake. `sections/traits.js`
210
+ ("How I act", 2026-09-27, a try) sits under the settling panel: the seven trait
211
+ axes (`store/traits.ts#TRAIT_AXES`) as thin spectrum bars, the left pole's word,
212
+ a track, a marker, the right pole's word, and how many memories stand behind
213
+ it; an axis's gloss is behind a `?`. The balance is `views/traits.ts`
214
+ (`balanceOf`): each nudge counts `strength × firmness` (the memory's strength on
215
+ today's lived day; a core memory counts 1), signed −1 toward `poles[0]` and +1
216
+ toward `poles[1]`, over Σ unsigned. A faint marker is the same over the nudges
217
+ recorded 7 or more calendar days ago, with today's firmness. Nudges come from
218
+ `traitsAll()` (live memories only, so a merge is not counted twice); a
219
+ confidential memory's nudge moves the bar and its words show as "withheld". An
220
+ axis with nothing behind it draws an empty track and no marker. Tapping a row
221
+ lists its memories (each opens its card); `state.js#trait` keeps it open.
222
+ `sections/wake.js`
223
+ is "Next time I wake, I start with:" — the page and its age, the nearby
224
+ memories by title (the hints lane's open `wake_display` rows, each opening its
225
+ card; the lane's own lines on an older store), anything arriving (the horizon
226
+ lane) — and "read it" for the whole wake. `sections/journal.js` is a strip of days, each with its date in one
227
+ format (the view's `iso`: the chapter heading's date, else the entry's own), its
228
+ lived day and "N chapters"; a day lists its chapters, a chapter opens in place. The `?` that holds each explaining line is
156
229
  `shared/widgets/tips.js`; `state.js` holds what is open, so the pulse's `refresh()` (which redraws only
157
230
  the panels whose data moved) keeps it open. `sections/stories.js` is only
158
231
  `storyCard`, opened in the overlay. The view is still `views/mind.ts` / `/api/mind`.
@@ -162,7 +235,11 @@ The health tab answers "is it working?": `pages/health/sections/checks.js` runs
162
235
  opened on a bare `--dir` arms the explicit-dir guard for that run, so the
163
236
  settings line reads "not checked") and draws its findings as a checklist,
164
237
  folding the non-headline greens the way `cli/report.ts` does; `cycle.js` is the
165
- last sleep cycle as one line with a dot per phase; `archive.js` is one stacked
238
+ last sleep cycle as one line with a dot per phase; `wake.js` (round 3b, moved
239
+ from the self tab) answers "is the wake overflowing?" in one compact row: its
240
+ size against the ceiling the newest `self.briefing` row recorded, as a stacked
241
+ bar of its parts (`wakeParts`, cut at the lane headings from `self/`), amber
242
+ when that render had to trim to fit (`healthView#wake`); `archive.js` is one stacked
166
243
  bar of `archived_reason` (plain phrases in the shared archive-words module,
167
244
  unknown reasons get their own segment); `verify.js` is "Check the index"
168
245
  (`verify` through the seam). The developer panels (band symmetry, what fired,
@@ -9,7 +9,9 @@
9
9
  * in this file can reach that source: no function here takes a
10
10
  * `DashboardSource`, a `Dashboard` or a `Store`. It is handed the store's
11
11
  * DIRECTORY and the configuration's PATH — two strings, exactly what a
12
- * person types after `--dir` and `--config`.
12
+ * person types after `--dir` and `--config` — and, for `ask`, the owner's
13
+ * NAME, a third string the server reads off the identity core per request
14
+ * (`ask-voice.ts` turns the owner's question into my voice with it).
13
15
  * - **Managing** is the console's own `run()` — the function
14
16
  * `bin/counterparts.ts` calls — with an argv array built here from
15
17
  * validated fields. Every check, refusal and sentence is the CLI's; this
@@ -48,6 +50,7 @@ import { isAbsolute } from "node:path";
48
50
 
49
51
  import { REQUIRE_EXPLICIT_DIR_ENV } from "../../../core/store/paths.js";
50
52
  import { CONFIG_ENV } from "../../config-path.js";
53
+ import { toMyVoice } from "./ask-voice.js";
51
54
 
52
55
  /**
53
56
  * THE HOME A BARE-STORE ACTION RESOLVES CONFIGURATIONS UNDER: a path that does
@@ -210,6 +213,19 @@ export interface ActionContext {
210
213
  readonly env?: Record<string, string | undefined>;
211
214
  /** The home the console resolves configurations under (tests only). */
212
215
  readonly home?: string;
216
+ /** The owner's name as the store knows it (`sleep#ownerNames`, first entry),
217
+ * or null: what `ask` puts in place of his "I" (`ask-voice.ts`). */
218
+ readonly ownerName?: string | null;
219
+ }
220
+
221
+ /** What `ask` searched with: the question in my voice, unless asked exactly. */
222
+ export interface Searched {
223
+ /** The text handed to `counterparts ask`. */
224
+ readonly text: string;
225
+ /** Whether it differs from what the owner typed. */
226
+ readonly changed: boolean;
227
+ /** The owner asked for it exactly as typed (nothing turned round). */
228
+ readonly exact: boolean;
213
229
  }
214
230
 
215
231
  export interface Built {
@@ -221,6 +237,8 @@ export interface Built {
221
237
  readonly env?: Record<string, string | undefined>;
222
238
  /** The home the console resolves configurations under, for this one run. */
223
239
  readonly home?: string;
240
+ /** `ask` by question: what it searched with. */
241
+ readonly searched?: Searched;
224
242
  }
225
243
 
226
244
  /** A memory id as the store accepts one: its family prefix, no whitespace, no slash. */
@@ -335,7 +353,17 @@ function argvFor(name: ActionName, body: Body, ctx: ActionContext): Built {
335
353
  // The answers as data, so the page can list them and open each one.
336
354
  if (flag(body, "json")) argv.push("--json");
337
355
  if (id !== undefined) return { argv: [...argv, "--id", id] };
338
- return { argv: [...argv, "--", words(question as string, "question")] };
356
+ // THE OWNER'S VOICE, TURNED INTO MINE (memories round 3b): "what have you
357
+ // learned about yourself?" searches as "what have I learned about
358
+ // myself?". The page shows what was searched and can ask again with
359
+ // `exact: true`. The CLI's own `ask` is untouched.
360
+ const typed = words(question as string, "question");
361
+ const exact = flag(body, "exact");
362
+ const voiced = exact ? { text: typed, changed: false } : toMyVoice(typed, ctx.ownerName ?? null);
363
+ return {
364
+ argv: [...argv, "--", words(voiced.text, "question")],
365
+ searched: { text: voiced.text, changed: voiced.changed, exact },
366
+ };
339
367
  }
340
368
  case "note": {
341
369
  const content = text(body, "text", MAX_TEXT, true) as string;
@@ -469,6 +497,8 @@ export interface ActionResult {
469
497
  readonly err?: string[];
470
498
  readonly truncated?: boolean;
471
499
  readonly error?: string;
500
+ /** `ask` by question: what it searched with. */
501
+ readonly searched?: Searched;
472
502
  };
473
503
  }
474
504
 
@@ -627,5 +657,17 @@ export async function runAction(
627
657
  },
628
658
  };
629
659
  }
630
- return { status: 200, body: { action: name, command, exit, ok: exit === 0, out, err, truncated } };
660
+ return {
661
+ status: 200,
662
+ body: {
663
+ action: name,
664
+ command,
665
+ exit,
666
+ ok: exit === 0,
667
+ out,
668
+ err,
669
+ truncated,
670
+ ...(built.searched === undefined ? {} : { searched: built.searched }),
671
+ },
672
+ };
631
673
  }