counterparts 0.3.2 → 0.3.4

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 (153) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/docs/module-map.md +3 -2
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/NOTES.md +28 -0
  5. package/src/adapters/claude-code/bin/hook.ts +85 -22
  6. package/src/adapters/claude-code/config.ts +7 -0
  7. package/src/adapters/claude-code/doctor.ts +166 -4
  8. package/src/adapters/claude-code/hooks.ts +185 -6
  9. package/src/adapters/claude-code/index.ts +3 -0
  10. package/src/adapters/claude-code/transcript.ts +7 -0
  11. package/src/adapters/cli/CONTRACT.md +11 -0
  12. package/src/adapters/cli/INTERFACE-GAPS.md +16 -0
  13. package/src/adapters/cli/NOTES.md +25 -0
  14. package/src/adapters/cli/commands.ts +184 -4
  15. package/src/adapters/cli/dream-core.ts +126 -0
  16. package/src/adapters/cli/help.ts +17 -0
  17. package/src/adapters/cli/mechanisms.ts +199 -106
  18. package/src/adapters/dashboard/CONTRACT.md +5 -0
  19. package/src/adapters/dashboard/INTERFACE-GAPS.md +12 -0
  20. package/src/adapters/dashboard/NOTES.md +38 -0
  21. package/src/adapters/dashboard/registries.ts +35 -1
  22. package/src/adapters/dashboard/web/README.md +63 -26
  23. package/src/adapters/dashboard/web/app.html +2 -0
  24. package/src/adapters/dashboard/web/flow.ts +14 -0
  25. package/src/adapters/dashboard/web/lanes.ts +141 -0
  26. package/src/adapters/dashboard/web/mechanisms/association/index.js +1 -2
  27. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +8 -5
  28. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +7 -7
  29. package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -2
  30. package/src/adapters/dashboard/web/mechanisms/dreaming/index.js +19 -0
  31. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +9 -6
  32. package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +4 -5
  33. package/src/adapters/dashboard/web/mechanisms/index.js +5 -3
  34. package/src/adapters/dashboard/web/mechanisms/interference/index.js +1 -2
  35. package/src/adapters/dashboard/web/mechanisms/prospective/index.js +7 -5
  36. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +1 -2
  37. package/src/adapters/dashboard/web/mechanisms/regions.js +1 -1
  38. package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +1 -2
  39. package/src/adapters/dashboard/web/mechanisms/salience/index.js +1 -2
  40. package/src/adapters/dashboard/web/mechanisms/schema/index.js +1 -2
  41. package/src/adapters/dashboard/web/narrate.ts +76 -13
  42. package/src/adapters/dashboard/web/pages/health/sections/checks.js +17 -1
  43. package/src/adapters/dashboard/web/pages/home/home.css +29 -13
  44. package/src/adapters/dashboard/web/pages/home/index.js +2 -0
  45. package/src/adapters/dashboard/web/pages/home/sections/explorer.js +22 -7
  46. package/src/adapters/dashboard/web/pages/home/sections/hero.js +15 -3
  47. package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +15 -9
  48. package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +6 -2
  49. package/src/adapters/dashboard/web/pages/home/sections/tiles.js +35 -18
  50. package/src/adapters/dashboard/web/pages/memories/index.js +30 -36
  51. package/src/adapters/dashboard/web/pages/memories/memories.css +97 -72
  52. package/src/adapters/dashboard/web/pages/memories/row.js +51 -0
  53. package/src/adapters/dashboard/web/pages/memories/sections/feel.js +176 -0
  54. package/src/adapters/dashboard/web/pages/memories/sections/hold.js +67 -0
  55. package/src/adapters/dashboard/web/pages/memories/sections/list.js +65 -43
  56. package/src/adapters/dashboard/web/pages/memories/sections/search.js +26 -23
  57. package/src/adapters/dashboard/web/pages/memories/state.js +12 -5
  58. package/src/adapters/dashboard/web/pages/self/index.js +57 -16
  59. package/src/adapters/dashboard/web/pages/self/sections/dreams.js +76 -0
  60. package/src/adapters/dashboard/web/pages/self/sections/journal.js +75 -19
  61. package/src/adapters/dashboard/web/pages/self/sections/page.js +108 -65
  62. package/src/adapters/dashboard/web/pages/self/sections/settling.js +129 -104
  63. package/src/adapters/dashboard/web/pages/self/sections/wake.js +31 -15
  64. package/src/adapters/dashboard/web/pages/self/self.css +122 -59
  65. package/src/adapters/dashboard/web/pages/self/state.js +21 -0
  66. package/src/adapters/dashboard/web/server.ts +9 -0
  67. package/src/adapters/dashboard/web/shared/memory-marks.css +17 -0
  68. package/src/adapters/dashboard/web/shared/memory-marks.js +81 -0
  69. package/src/adapters/dashboard/web/shared/memory-modal.js +240 -53
  70. package/src/adapters/dashboard/web/shared/modal.css +67 -0
  71. package/src/adapters/dashboard/web/shared/tip.js +1 -1
  72. package/src/adapters/dashboard/web/shared/widgets/feed.css +4 -0
  73. package/src/adapters/dashboard/web/shared/widgets/feed.js +56 -14
  74. package/src/adapters/dashboard/web/shared/widgets/light.css +1 -0
  75. package/src/adapters/dashboard/web/shared/widgets/light.js +7 -5
  76. package/src/adapters/dashboard/web/shared/widgets/tips.css +19 -0
  77. package/src/adapters/dashboard/web/shared/widgets/tips.js +56 -0
  78. package/src/adapters/dashboard/web/views/activity.ts +18 -2
  79. package/src/adapters/dashboard/web/views/archive-words.ts +27 -10
  80. package/src/adapters/dashboard/web/views/dreams.ts +199 -0
  81. package/src/adapters/dashboard/web/views/mechanism-panel.ts +116 -35
  82. package/src/adapters/dashboard/web/views/mechanisms.ts +81 -255
  83. package/src/adapters/dashboard/web/views/memories.ts +245 -43
  84. package/src/adapters/dashboard/web/views/memory-words.ts +133 -0
  85. package/src/adapters/dashboard/web/views/memory.ts +226 -4
  86. package/src/adapters/dashboard/web/views/mind.ts +261 -61
  87. package/src/adapters/dashboard/web/views/overview.ts +80 -42
  88. package/src/adapters/dashboard/web/views/search.ts +35 -1
  89. package/src/adapters/dashboard/web/views/shared.ts +14 -0
  90. package/src/adapters/dashboard/web/views.ts +2 -0
  91. package/src/adapters/feelings-line.ts +74 -0
  92. package/src/adapters/fired.ts +163 -23
  93. package/src/adapters/mcp/CONTRACT.md +8 -0
  94. package/src/adapters/mcp/NOTES.md +56 -0
  95. package/src/adapters/mcp/server.ts +254 -6
  96. package/src/adapters/mcp/tools.ts +180 -5
  97. package/src/adapters/mechanism-evidence.ts +465 -0
  98. package/src/core/bridge.ts +21 -16
  99. package/src/core/counterpart.ts +422 -10
  100. package/src/core/dream/CONTRACT.md +143 -0
  101. package/src/core/dream/INTERFACE-GAPS.md +24 -0
  102. package/src/core/dream/NOTES.md +84 -0
  103. package/src/core/dream/index.ts +1067 -0
  104. package/src/core/dream/mark.ts +14 -0
  105. package/src/core/dream/tunables.ts +56 -0
  106. package/src/core/encode/CONTRACT.md +7 -1
  107. package/src/core/feelings-wheel.ts +171 -13
  108. package/src/core/mint.ts +9 -0
  109. package/src/core/physics/CONTRACT.md +132 -21
  110. package/src/core/physics/NOTES.md +233 -0
  111. package/src/core/physics/index.ts +419 -50
  112. package/src/core/prospective/CONTRACT.md +35 -6
  113. package/src/core/prospective/INTERFACE-GAPS.md +10 -5
  114. package/src/core/prospective/NOTES.md +175 -4
  115. package/src/core/prospective/derive.ts +32 -3
  116. package/src/core/prospective/index.ts +362 -39
  117. package/src/core/prospective/tunables.ts +18 -1
  118. package/src/core/prospective/windows.ts +104 -46
  119. package/src/core/recall/CONTRACT.md +28 -0
  120. package/src/core/recall/NOTES.md +55 -0
  121. package/src/core/recall/activate.ts +32 -5
  122. package/src/core/recall/gate.ts +7 -1
  123. package/src/core/recall/index.ts +28 -2
  124. package/src/core/recall/mood.ts +106 -0
  125. package/src/core/recall/tunables.ts +26 -0
  126. package/src/core/remember/CONTRACT.md +5 -0
  127. package/src/core/remember/index.ts +1 -0
  128. package/src/core/remember/proposals.ts +86 -3
  129. package/src/core/remember/spans.ts +11 -1
  130. package/src/core/self/CONTRACT.md +3 -0
  131. package/src/core/self/INTERFACE-GAPS.md +7 -0
  132. package/src/core/self/NOTES.md +30 -0
  133. package/src/core/self/identity.ts +115 -6
  134. package/src/core/self/index.ts +17 -0
  135. package/src/core/self/tunables.ts +17 -0
  136. package/src/core/sleep/CONTRACT.md +17 -1
  137. package/src/core/sleep/INTERFACE-GAPS.md +19 -0
  138. package/src/core/sleep/NOTES.md +36 -0
  139. package/src/core/sleep/consolidate.ts +149 -96
  140. package/src/core/sleep/decay.ts +11 -0
  141. package/src/core/sleep/index.ts +4 -1
  142. package/src/core/sleep/tunables.ts +9 -0
  143. package/src/core/sleep/types.ts +17 -0
  144. package/src/core/sleep/upgrade.ts +168 -0
  145. package/src/core/store/CONTRACT.md +21 -2
  146. package/src/core/store/NOTES.md +68 -0
  147. package/src/core/store/feelings.ts +23 -6
  148. package/src/core/store/index.ts +716 -17
  149. package/src/core/store/operational.ts +329 -4
  150. package/src/core/store/owner-op-seam.ts +79 -1
  151. package/src/core/types.ts +37 -0
  152. package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +0 -178
  153. package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +0 -42
@@ -10,6 +10,8 @@ import type { Band, Kind } from "../../../../core/types.js";
10
10
  import { NEVER, NONE } from "../../layout.js";
11
11
  import type { DashboardSource } from "../../source.js";
12
12
  import { reveal } from "../reveal.js";
13
+ import { feelingsShown, isChapterMemory, shownOf } from "./memory-words.js";
14
+ import type { DateFrom, FeelingShown } from "./memory-words.js";
13
15
 
14
16
  // ─────────────────────────────────────────────────────────────────────────────
15
17
  // search
@@ -17,7 +19,24 @@ import { reveal } from "../reveal.js";
17
19
 
18
20
  export interface SearchView {
19
21
  readonly q: string;
20
- readonly hits: { id: string; score: number; text: string; kind: Kind; band: Band; strength: number; confidential: boolean }[];
22
+ readonly hits: {
23
+ id: string;
24
+ score: number;
25
+ text: string;
26
+ kind: Kind;
27
+ band: Band;
28
+ strength: number;
29
+ confidential: boolean;
30
+ /** The row shape the memories list uses (`memory-words.ts`). */
31
+ title: string | null;
32
+ shown: string;
33
+ date: string | null;
34
+ dateFrom: DateFrom | null;
35
+ core: boolean;
36
+ protected: boolean;
37
+ journal: boolean;
38
+ feelings: FeelingShown[];
39
+ }[];
21
40
  readonly absent: string | null;
22
41
  }
23
42
 
@@ -47,6 +66,13 @@ export function searchView(src: DashboardSource, q: string, limit = 25): SearchV
47
66
  } catch {
48
67
  /* a row that will not read is still a hit; it lists with a named absence */
49
68
  }
69
+ const chapter = isChapterMemory(row);
70
+ const shown = shownOf(row.body, {
71
+ chapter,
72
+ learnedOn: row.learned_on,
73
+ confidential: r.confidential || !r.present,
74
+ withheld: r.text ?? r.label,
75
+ });
50
76
  hits.push({
51
77
  id: hit.id,
52
78
  score: hit.score,
@@ -55,6 +81,14 @@ export function searchView(src: DashboardSource, q: string, limit = 25): SearchV
55
81
  band: b,
56
82
  strength: s,
57
83
  confidential: r.confidential,
84
+ title: r.confidential || row.title === null || row.title.trim() === "" ? null : row.title.trim(),
85
+ shown: shown.text || (r.text ?? r.label),
86
+ date: shown.date,
87
+ dateFrom: shown.dateFrom,
88
+ core: row.promoted_identity === 1,
89
+ protected: row.protected === 1,
90
+ journal: chapter,
91
+ feelings: feelingsShown(store, hit.id),
58
92
  });
59
93
  if (hits.length >= limit) break;
60
94
  }
@@ -150,6 +150,20 @@ export function memoriesHeld(src: DashboardSource): number {
150
150
  return census(src).filter((r) => !r.schema).length;
151
151
  }
152
152
 
153
+ /**
154
+ * THE DASHBOARD'S ONE MEMORY COUNT (2026-09-26, an experiment): every live row
155
+ * but the journal's episodes — memories, and the cards for people and projects
156
+ * with their beliefs. It is what the memories list's "live" chip counts, and
157
+ * what the home page and the memories header say.
158
+ *
159
+ * NOT the console's `Memories:` (`memoriesHeld` above, memory rows only), which
160
+ * is also doctor's and the wake preface's; the two differ by the schema rows,
161
+ * a known gap, left open for now.
162
+ */
163
+ export function memoriesLive(src: DashboardSource): number {
164
+ return census(src).length;
165
+ }
166
+
153
167
  /**
154
168
  * Every event name's row count, in ONE grouped query (`Store.eventCounts`,
155
169
  * INTERFACE-GAPS §5) — where this used to read up to `LOG_CEILING` rows per
@@ -56,6 +56,8 @@ export { BLIND_SPOTS, healthView } from "./views/health.js";
56
56
  export type { HealthView } from "./views/health.js";
57
57
  export { pulse } from "./views/pulse.js";
58
58
  export { MECHANISM_PROOFS, mechanismsView } from "./views/mechanisms.js";
59
+ export { coreHistory, dreamsView } from "./views/dreams.js";
60
+ export type { CoreHistory, CoreHistoryRow, DreamChangeView, DreamView, DreamsView } from "./views/dreams.js";
59
61
  export type { MechanismLight, MechanismsView } from "./views/mechanisms.js";
60
62
  export { mechanismPanel } from "./views/mechanism-panel.js";
61
63
  export type { MechanismPanelView, Picture } from "./views/mechanism-panel.js";
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A memory's feelings as ONE plain line, for the surfaces where a memory's
3
+ * detail is shown (the dashboard's memory view, `counterparts ask --full`):
4
+ *
5
+ * you: worried 0.6 (now 0.3) · me: tender 0.4
6
+ *
7
+ * "you" is the owner — the person reading — and "me" is the counterpart
8
+ * (emotion part A, owner decision 6). The number is the strength as recorded;
9
+ * "now" is the same feeling softened by the lived days since (physics §5.10),
10
+ * shown only when it has moved. The word is the wheel word, or the writer's own
11
+ * for an `other`. `carried_by` is not shown: it is a pointer at the moment,
12
+ * and it stays with the export.
13
+ */
14
+ import { softenedFeeling } from "../core/physics/index.js";
15
+ import type { FeelingRow } from "../core/store/index.js";
16
+
17
+ /** What each `whose` is called on a surface the owner reads. */
18
+ export function whoseLabel(whose: string): string {
19
+ return whose === "owner" ? "you" : whose === "self" ? "me" : whose;
20
+ }
21
+
22
+ /** The word a feeling is shown as: the wheel word (unqualified), or the writer's own. */
23
+ export function feelingWord(row: Pick<FeelingRow, "emotion" | "other_word">): string {
24
+ if (row.emotion === "other") return row.other_word ?? "other";
25
+ const dot = row.emotion.indexOf(".");
26
+ return dot >= 0 ? row.emotion.slice(dot + 1) : row.emotion;
27
+ }
28
+
29
+ export interface ShownFeeling {
30
+ readonly who: string;
31
+ readonly word: string;
32
+ readonly strength: number;
33
+ readonly now: number;
34
+ }
35
+
36
+ export function shownFeelings(
37
+ rows: readonly Pick<FeelingRow, "whose" | "emotion" | "other_word" | "strength">[],
38
+ ageDays: number,
39
+ ): ShownFeeling[] {
40
+ return rows.map((r) => ({
41
+ who: whoseLabel(r.whose),
42
+ word: feelingWord(r),
43
+ strength: r.strength,
44
+ now: softenedFeeling(r.strength, ageDays),
45
+ }));
46
+ }
47
+
48
+ const n1 = (x: number): string => x.toFixed(1);
49
+
50
+ /**
51
+ * The line, grouped by person — the owner's first, then the counterpart's, then
52
+ * anyone else — or "" when there are no feelings.
53
+ */
54
+ export function feelingsLine(
55
+ rows: readonly Pick<FeelingRow, "whose" | "emotion" | "other_word" | "strength">[],
56
+ ageDays: number,
57
+ ): string {
58
+ const shown = shownFeelings(rows, ageDays);
59
+ if (shown.length === 0) return "";
60
+ const order = (who: string): number => (who === "you" ? 0 : who === "me" ? 1 : 2);
61
+ const people = [...new Set(shown.map((s) => s.who))].sort((a, b) => order(a) - order(b) || (a < b ? -1 : 1));
62
+ return people
63
+ .map((who) => {
64
+ const words = shown
65
+ .filter((s) => s.who === who)
66
+ .map((s) => {
67
+ const at = n1(s.strength);
68
+ const now = n1(s.now);
69
+ return now === at ? `${s.word} ${at}` : `${s.word} ${at} (now ${now})`;
70
+ });
71
+ return `${who}: ${words.join(", ")}`;
72
+ })
73
+ .join(" · ");
74
+ }
@@ -55,6 +55,8 @@
55
55
  import { TUNABLES as ENCODE } from "../core/encode/tunables.js";
56
56
  import { addDays, daysBetween as calendarDaysBetween, localDate } from "../core/time.js";
57
57
  import type { EventRow, ReadOnlyStore } from "../core/store/index.js";
58
+ import { rowToPhysics } from "../core/store/index.js";
59
+ import { emotionalIntensity } from "../core/physics/index.js";
58
60
  import type { DurableEventName } from "./dashboard/registries.js";
59
61
 
60
62
  /** The window every count on this page is measured over. Seven CALENDAR days,
@@ -140,10 +142,21 @@ export const STATE_MEANING: Record<FiredState, string> = {
140
142
  */
141
143
  export type ProbeId =
142
144
  | "edges"
145
+ /** Live memories carrying at least one recorded feeling (dated by the newest). */
146
+ | "feelings"
147
+ /** Live memories whose emotional intensity is above 0 (dated by birth day). */
148
+ | "emotion.weighted"
143
149
  | "prospective.armed"
144
150
  | "prospective.fired"
151
+ | "prospective.dated"
145
152
  | "protected"
146
153
  | "removals"
154
+ /** Counted awake RETURNS (schema v8's `returns` table), dated by their moment. */
155
+ | "returns.awake"
156
+ /** Counted dream REPLAYS — returns a dream made, dated the same way. */
157
+ | "returns.dream"
158
+ /** Live memories a DREAM wrote in its own words (source `dreamed`), dated by when. */
159
+ | "dreamed"
147
160
  | `versions:${string}`;
148
161
 
149
162
  export type Evidence =
@@ -353,6 +366,30 @@ export const MECHANISMS: readonly Mechanism[] = [
353
366
  )} (encode/tunables.ts) — a named decision, not a fault`,
354
367
  }),
355
368
  },
369
+ // EMOTION PART A (2026-09-26): feelings weigh now. Three rows, because the
370
+ // three halves leave three different traces — a feeling on a row, a row
371
+ // whose intensity lifts and slows it, and a turn whose mood lifted a memory.
372
+ {
373
+ id: "feelings",
374
+ label: "how something felt was recorded on a memory, the owner's or the self's",
375
+ module: "store/feelings.ts",
376
+ evidence: { kind: "probe", probe: "feelings" },
377
+ since: "2026-09-25",
378
+ },
379
+ {
380
+ id: "emotion-weight",
381
+ label: "a memory's strongest feeling holds it higher at birth and slows its fading",
382
+ module: "physics/ §5.10",
383
+ evidence: { kind: "probe", probe: "emotion.weighted" },
384
+ since: "2026-09-26",
385
+ },
386
+ {
387
+ id: "mood-match",
388
+ label: "a memory that felt the way someone feels now came to mind more easily",
389
+ module: "recall/mood.ts",
390
+ evidence: { kind: "event", names: ["recall.decision"], positive: "moodMatched" },
391
+ since: "2026-09-26",
392
+ },
356
393
  {
357
394
  id: "salience",
358
395
  label: "every memory is scored for novelty, relevance, feeling and usefulness as it is written",
@@ -515,10 +552,38 @@ export const MECHANISMS: readonly Mechanism[] = [
515
552
  // `budgetExhausted` and `skippedForBudget` on the same cycle row, which is
516
553
  // where it belongs.
517
554
  id: "promotion",
518
- label: "a memory reinforced over several days is promoted into identity",
555
+ label: "a memory about me or about us comes back and becomes core, by the fast or slow lane",
519
556
  module: "sleep/consolidate.ts",
520
557
  evidence: { kind: "event", names: ["band.promoted"] },
521
558
  },
559
+ {
560
+ // RETURNS (2026-09-26, physics §5.11): the new road to staying strong. One
561
+ // row in the `returns` table per counted awake return, dated by its
562
+ // moment; a use while the memory was showing in the wake's hints lane is
563
+ // not one, so a quiet week here is "nothing came back unprompted".
564
+ id: "returns",
565
+ label: "a memory used again after a gap comes back stronger: it will fade more slowly",
566
+ module: "physics/ (creditReturn), store/index.ts#reinforce",
567
+ evidence: { kind: "probe", probe: "returns.awake" },
568
+ since: "2026-09-26",
569
+ },
570
+ {
571
+ // The owner's door out of the core, the mirror of `band.promoted`.
572
+ id: "core-demote",
573
+ label: "the owner sent a core memory back to ordinary fading, and said why",
574
+ module: "counterpart.ts#demoteCore",
575
+ evidence: { kind: "event", names: ["band.demoted"] },
576
+ since: "2026-09-26",
577
+ },
578
+ {
579
+ // The v8 upgrade's one-time proof: every memory measured by the old
580
+ // arithmetic and the new. One row per store, ever; doctor reads the verdict.
581
+ id: "upgrade-census",
582
+ label: "after the v8 upgrade, every memory was checked by the old rules and the new",
583
+ module: "sleep/upgrade.ts",
584
+ evidence: { kind: "event", names: ["physics.upgrade.census"] },
585
+ since: "2026-09-26",
586
+ },
522
587
  {
523
588
  // TWO GATES out of six. `declared-revision-never-merged` and
524
589
  // `revision-successor-never-merged` are rules refusing a merge that the
@@ -606,10 +671,44 @@ export const MECHANISMS: readonly Mechanism[] = [
606
671
  },
607
672
  },
608
673
  {
674
+ // Built 2026-09-26: a dream may write a GIST — a pattern across memories,
675
+ // in its own words, citing its sources — as a memory of source `dreamed`
676
+ // that starts low. The evidence is those rows, dated by when.
609
677
  id: "gist",
610
- label: "the gist of many episodes is distilled into one lasting memory",
611
- module: "—",
612
- evidence: { kind: "none", reason: "not built yet; the storage spec marks it thin." },
678
+ label: "a dream distilled a pattern across several memories into one, in its own words",
679
+ module: "dream/ (gist)",
680
+ evidence: { kind: "probe", probe: "dreamed" },
681
+ since: "2026-09-26",
682
+ },
683
+ // ── dreaming (2026-09-26) ─────────────────────────────────────────────────
684
+ {
685
+ id: "dream",
686
+ label: "the counterpart dreamed: replayed what was lived since the last dream, and wrote a journal",
687
+ module: "dream/",
688
+ evidence: { kind: "event", names: ["dream.journaled"] },
689
+ covers: ["dream.begun", "dream.undone"],
690
+ since: "2026-09-26",
691
+ },
692
+ {
693
+ id: "dream-changes",
694
+ label: "a dream changed memories: merged near-copies, drew links, replayed, flagged a contradiction",
695
+ module: "dream/ (propose)",
696
+ evidence: { kind: "event", names: ["dream.changed"] },
697
+ since: "2026-09-26",
698
+ },
699
+ {
700
+ id: "dream-ask",
701
+ label: "a session was handed the day's dream ask, or the owner said not today",
702
+ module: "dream/ (askLine, decline), claude-code/hooks.ts",
703
+ evidence: { kind: "event", names: ["dream.ask"] },
704
+ since: "2026-09-26",
705
+ },
706
+ {
707
+ id: "dream-replays",
708
+ label: "a dream replayed a memory: a return worth half an awake one",
709
+ module: "store/index.ts#replayReturn",
710
+ evidence: { kind: "probe", probe: "returns.dream" },
711
+ since: "2026-09-26",
613
712
  },
614
713
 
615
714
  // ── the self ─────────────────────────────────────────────────────────────
@@ -735,26 +834,38 @@ export const MECHANISMS: readonly Mechanism[] = [
735
834
  },
736
835
  },
737
836
  {
738
- // STILL BLIND, and the rows are built and waiting (2026-09-20, E2).
739
- //
740
- // `prospective.fire` and `prospective.fire.refused` exist now and are
741
- // written by `Prospective.fire()`. What does NOT exist is a caller: the
742
- // only one in the tree is `tools/demo/seed.ts` (mechanism inventory §3 S4).
743
- // So pointing this row's evidence at the new name would make it read `new`
744
- // for two days and then `never` for ever — durable evidence asserted for a
745
- // mechanism nothing can make fire, which is the blind case wearing a never
746
- // label, and exactly the confusion this view exists to break.
747
- //
748
- // It goes back to event evidence the day the surfacing path spends a fire.
837
+ // A memory with a reminder date on it (2026-09-26): `note` and
838
+ // `session_end` write the `event_date` column now. The count the gauge
839
+ // reads as "dated memories held".
840
+ id: "prospective-dated",
841
+ label: "a memory was given a date to come back on",
842
+ module: "prospective/, mcp/tools.ts",
843
+ evidence: { kind: "probe", probe: "prospective.dated" },
844
+ },
845
+ {
846
+ // BACK ON EVENT EVIDENCE (2026-09-26). Until today the only caller of
847
+ // `fire()` was `tools/demo/seed.ts`, so this row was `blind` on purpose;
848
+ // `Counterpart#spendArrivals` now spends a fire whenever a date's cue
849
+ // actually surfaced in a turn. A QUIET reminder, the default.
749
850
  id: "prospective-fired",
750
851
  label: "that future date arrived and the reminder came back",
751
- module: "prospective/",
752
- evidence: {
753
- kind: "none",
754
- reason:
755
- "the two rows that would record it now exist (`prospective.fire`, `prospective.fire.refused`) and nothing calls `fire()` outside the demo seeder, so no row can land: `arrivals()` is read every turn but the fire budget is never spent. Wiring the surfacing path to spend it is what closes this, not another row.",
756
- },
757
- covers: ["prospective.fire", "prospective.fire.refused"],
852
+ module: "prospective/, counterpart.ts#spendArrivals",
853
+ evidence: { kind: "event", names: ["prospective.fire"] },
854
+ // The refusal row is ACCOUNTED FOR here, and deliberately not read as a
855
+ // refusal column: its reasons are budget and calendar ("already fired
856
+ // today", "held for after"), the "not yet" vocabulary `RefusalSource.only`
857
+ // exists to keep out of the blocked list.
858
+ covers: ["prospective.fire.refused"],
859
+ since: "2026-09-26",
860
+ },
861
+ {
862
+ // A PLAIN reminder told to the person on its day (2026-09-26): one row per
863
+ // memory, window and beat, latched.
864
+ id: "prospective-plain",
865
+ label: "a reminder marked plain was said plainly on its day",
866
+ module: "prospective/, claude-code/hooks.ts",
867
+ evidence: { kind: "event", names: ["prospective.plain"] },
868
+ since: "2026-09-26",
758
869
  },
759
870
 
760
871
  // ── the machinery underneath ─────────────────────────────────────────────
@@ -1436,7 +1547,7 @@ function countInto(
1436
1547
 
1437
1548
  /** The CALENDAR date a row is about: its own field, else the wall clock it was
1438
1549
  * written at. `day` is the lived-day column and answers a different question. */
1439
- function rowDate(row: EventRow, payload: Record<string, unknown>, zone: string): string {
1550
+ export function rowDate(row: EventRow, payload: Record<string, unknown>, zone: string): string {
1440
1551
  const date = payload["date"];
1441
1552
  if (typeof date === "string" && date.length === 10) return date;
1442
1553
  return localDate(row.at, zone);
@@ -1647,6 +1758,21 @@ function readProbes(store: ReadOnlyStore, w: Window): Probed {
1647
1758
  for (const id of scanned) {
1648
1759
  const row = store.row(id);
1649
1760
  if (row !== undefined && row.archived === 0 && row.protected === 1) bump("protected");
1761
+ // Emotion part A: `row()` carries the strongest recorded feeling beside the
1762
+ // row, so only a memory that HAS one pays for the dated read.
1763
+ if (row !== undefined && row.archived === 0 && row.superseded_by === null) {
1764
+ if (emotionalIntensity(rowToPhysics(row)) > 0) bump("emotion.weighted", { livedDay: row.birth_day });
1765
+ if (row.feeling_peak !== null && row.feeling_peak !== undefined) {
1766
+ let newest: number | null = null;
1767
+ for (const f of store.feelingsFor(id)) if (newest === null || f.created_at > newest) newest = f.created_at;
1768
+ bump("feelings", { at: newest });
1769
+ }
1770
+ }
1771
+ // A live memory carrying a reminder date (schema v7's `event_date`), dated
1772
+ // by when it was written: the day a date was SET is the row's own moment.
1773
+ if (row !== undefined && row.archived === 0 && row.event_date !== null) {
1774
+ bump("prospective.dated", { at: row.created_at });
1775
+ }
1650
1776
  for (const edge of store.edgesFrom(id)) bump("edges", { livedDay: edge.last_day });
1651
1777
  for (const p of store.prospectiveFor(id)) {
1652
1778
  bump("prospective.armed");
@@ -1655,6 +1781,15 @@ function readProbes(store: ReadOnlyStore, w: Window): Probed {
1655
1781
  for (const v of store.versions(id)) {
1656
1782
  bump(`versions:${v.reason}`, { livedDay: v.version_day, at: v.archived_at });
1657
1783
  }
1784
+ // v8: every counted return, awake or dreamed, and every dreamed memory.
1785
+ // The upgrade's LEGACY credits are history, not something that fired.
1786
+ for (const r of store.returnsOf(id)) {
1787
+ if (r.source === "legacy") continue;
1788
+ bump(r.source === "dream" ? "returns.dream" : "returns.awake", { at: r.at });
1789
+ }
1790
+ if (row !== undefined && row.archived === 0 && row.source === "dreamed") {
1791
+ bump("dreamed", { at: row.created_at, livedDay: row.birth_day });
1792
+ }
1658
1793
  }
1659
1794
  return { byId, livedDay, truncated: scanned.length < ids.length, zone: w.zone };
1660
1795
  }
@@ -1698,5 +1833,10 @@ function probeLabel(probe: ProbeId): string {
1698
1833
  if (probe === "protected") return "memories marked permanent";
1699
1834
  if (probe === "removals") return "the removal record";
1700
1835
  if (probe === "edges") return "the links table";
1836
+ if (probe === "feelings") return "memories carrying a recorded feeling";
1837
+ if (probe === "emotion.weighted") return "memories a feeling holds higher and fades slower";
1838
+ if (probe === "returns.awake") return "the returns table (awake returns)";
1839
+ if (probe === "returns.dream") return "the returns table (dream replays)";
1840
+ if (probe === "dreamed") return "memories a dream wrote";
1701
1841
  return `the ${probe.replace(".", " ")} table`;
1702
1842
  }
@@ -303,6 +303,14 @@ this scar's direct descendant) · **§2.7** (the note traverses the one write ch
303
303
  what a feeling's magnitude IS (a fired-cue count? a stated intensity the author
304
304
  supplies alongside the type?) — a design question, not a wiring one. Until then the
305
305
  author's own `emotional` score is the only route, which is why it is now exposed.
306
+ **ANSWERED 2026-09-25/26:** a stated intensity. `note` and `session_end` take
307
+ `feelings` (schema v7), each with its own `strength`; since emotion part A the
308
+ strongest of those and `emotional` is the memory's intensity, which lifts its height
309
+ and slows its decay (physics §5.10), and a recent one sets the mood recall matches
310
+ (recall G18). A lone `emotional` score was already kept on the row by `mint.ts`; the
311
+ battery now reads it the same way (`bridge.ts#dimensionsFrom` pads a missing
312
+ dimension with 0 instead of dropping all three). The stated-emotion gate still
313
+ supplies no number, and still must not.
306
314
  5. **Is four hours the right TTL?** CAL. Every Stop refreshes the clock and the ask is
307
315
  delivered AT a Stop, so the window only ever bounds the gap between an ask and its
308
316
  answer: four hours is far past any plausible think-time and comfortably inside a day,
@@ -662,3 +662,59 @@ the feelings, never the memory, and says so. No salience, decay or recall change
662
662
  - `other_word` is now in the published schema, so the schema and the reader agree.
663
663
  - **N6.** A note that did not land (a duplicate, a gate) answers
664
664
  `feelings: { stored: 0, reason: "memory-not-stored" }`.
665
+
666
+ ## 2026-09-26 — `eventDate` and `remind` on `note` and `session_end` (PR B)
667
+
668
+ An optional `eventDate` (a day, a month, a year or an `a..b` range, read by
669
+ `time.ts#parseCalendarDate`) and `remind: "plain" | "quiet"` on a `note` and on every
670
+ `session_end` entry, the write-up door's included. `readReminder` checks both BEFORE
671
+ anything is captured or minted: an unreadable date refuses the note, or that one entry,
672
+ as `event-date-unreadable` with the four shapes in `detail`; anything but the two words is
673
+ `remind-unknown`. The model converts "late October" itself — nothing here, or anywhere,
674
+ reads a date out of the text. A deposit that landed answers `reminder: { eventDate,
675
+ remind }` (plus a note when the date is a bare year, which never comes back on its own);
676
+ `remind` sent with no date is dropped and said (`reminder: { ignored: "remind" }`), and
677
+ the memory still lands. The `remind` description carries the owner's plain-vs-quiet
678
+ guidance: plain for a real deadline or an important date, or when
679
+ the person says it matters; quiet otherwise. What happens after the deposit is
680
+ `prospective/` NOTES §12.
681
+
682
+ **Review, same day (owner decision):** an explicit `eventDate` now qualifies a quiet
683
+ reminder whatever its salience — choosing a date is itself the importance signal — so the
684
+ description no longer says "about 0.6". The salience floor still gates a date a caller
685
+ extracted; decay (faded) and archival still keep a memory from arriving.
686
+
687
+ **Follow-ups, same day (review N7, N8).** `eventDate` also takes `null` (the schema type is
688
+ now `["string", "null"]`): on a revision it drops the date. `readReminder` passes `remind`
689
+ through only when it was SENT, so `remember/intake` can tell a left-out mode from a stated
690
+ one (`DateIntent`). The echo reports what was RECORDED, not what was sent: a revision that
691
+ carried a date answers `reminder: { eventDate, remind, from, carriedOver }`, and one that
692
+ dropped it `reminder: { cleared: true, from }` (the carry itself is `core/counterpart.ts`,
693
+ `prospective/` NOTES §13). A date whose last day is before the person's today —
694
+ `time.ts#todayIn` in the store's zone, off this server's injectable clock — is kept and
695
+ answered with `note: "That date has already passed — it won't come back as a reminder."`;
696
+ that note wins over the bare-year one. A plain past date is indeed never said; a quiet one
697
+ could still be cued in the week of grace after it, which the note does not spell out —
698
+ its job is to let the model catch a wrong year. The carry runs only for an `updates`
699
+ address that resolved as an ID (`Store#resolve` is id-only): a handle or title falls to
700
+ content matching, which carries nothing — so the `eventDate` description says "by its id".
701
+
702
+ **After the adversarial review of #247.** `from` in a carried or cleared reply names the
703
+ memory the reminder came FROM, which is not always the id the author sent: when that
704
+ memory's reminder had already moved on, the carry follows it (`Counterpart#reminderHolder`,
705
+ prospective NOTES §13), so a cancel or a reschedule sent against the first id still lands.
706
+ A revision that sends `eventDate: null` and reaches no dated memory now answers
707
+ `reminder: { cleared: false, note }` instead of nothing; a fresh note sending `null` (no
708
+ `updates`) still answers nothing, since a client that fills every optional field with null
709
+ would otherwise get the note on every deposit.
710
+
711
+ ## 2026-09-26 — `dream`, the eighth tool
712
+
713
+ One tool with phases (`launch`, `begin`, `propose`, `journal`, `decline`) because a
714
+ dream is one act in steps, and the audit wants every door enumerated. Every phase binds
715
+ the session (`requireBoundSession`): the dreamer is a background agent the session
716
+ launched, talking to this same server, and its writes belong to that session. `launch`
717
+ writes nothing and returns the prompt `dream/` composes; the in-session model hands it to
718
+ the Agent tool unchanged. `begin` returns the bundle as JSON behind the dream's mark;
719
+ `journal` returns the hand-back the dreamer must end on. Under observer every phase
720
+ stands down. The schema gate's "every tool refuses" fixture calls `launch`.