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
@@ -0,0 +1,143 @@
1
+ # `dream/` — CONTRACT
2
+
3
+ *Added 2026-09-26 from the owner's decisions of that day (dreaming + consolidation).
4
+ Working defaults, held lightly: "try it, see how it goes, adjust".*
5
+
6
+ ## 1. Purpose
7
+
8
+ Let the counterpart dream: a few minutes, once a day at most and only when the owner
9
+ says yes, of replaying what was lived since the last dream beside what it resembles,
10
+ and changing the store in the ways sleep changes a brain: merge, link, strengthen,
11
+ notice a pattern, flag a contradiction, soften a feeling. Keep a dream journal. Never
12
+ let a dream pass for something that happened, and make every dream undoable as a whole.
13
+
14
+ This module holds the RULES and the BOOKKEEPING: when a dream is due, what a dream is
15
+ shown, what it may change and how much, the record of every change, and undo. The
16
+ dreamer is the model (a background agent the session launches), outside this process.
17
+
18
+ ## 2. Brain analog
19
+
20
+ - **Deep-sleep replay** (the hippocampus replaying the day during slow-wave sleep and
21
+ handing it to cortex — Wilson & McNaughton 1994; Diekelmann & Born 2010): file what
22
+ happened, link what belongs together, merge near-copies into one trace, and strengthen
23
+ what matters. Here: `merge`, `link`, `replayed` (a return at half weight).
24
+ - **REM mixing** (loose associations across distant memories; insight and pattern after
25
+ sleep — Wagner et al. 2004; Cai et al. 2009): `mixing` and `lookback` in the bundle,
26
+ `gist` as the pattern written down, `contradiction` when two memories cannot both hold.
27
+ - **Emotional softening** ("sleep to forget, sleep to remember" — Walker & van der Helm
28
+ 2009): the sting fades, the memory stays. Here: `feeling-now`, recorded beside the
29
+ original, never stronger than it was felt.
30
+ - **A dream journal.** Dreams are remembered as dreams.
31
+
32
+ **Named deviations** (constitution line 12):
33
+
34
+ 1. **A dream is ASKED for.** Humans do not consent to sleep; here the owner says yes, once
35
+ a day at most, because a dream spends his model's time and changes his store.
36
+ 2. **A dream is not lived.** Its words are refused by capture (`DREAM_MARK`), its journal
37
+ is not a memory, a gist it writes starts lower than anything lived (source
38
+ `dreamed`), and its replays count toward no core lane. Human dreams leak into waking
39
+ memory; this one is kept from doing so on purpose.
40
+ 3. **Nothing is lost to a dream.** A merge archives its originals with a forwarding
41
+ address and keeps their words as a version; the whole dream can be undone.
42
+
43
+ ## 3. Keeps
44
+
45
+ - **Sleep changes memory offline** [v0: auto-consolidation on a cycle; the field guide's
46
+ consolidation]. `sleep/` stays arithmetic-only; this is the part that needs a model,
47
+ and so it is a separate, asked-for act.
48
+ - **Recall's gates** [v2 recall §9.1]: a dream is shown only what could surface in the
49
+ session that launched it — no archived, superseded, protected or schema row; nothing
50
+ confidential outside the owner's own session.
51
+ - **Versions, never deletion** [constitution 7; store §16]: merges supersede; undo
52
+ restores.
53
+ - **One door per act, every claim mechanized** [mcp §5 G2]: one tool, `dream`, with
54
+ phases.
55
+ - **The authorship doctrine's provenance** [owner ruling 2026-08-29]: a dream's gist is
56
+ minted on its own channel, `dreamed`, engine-set.
57
+ - **#238's idea**, harvested for returns rather than here: what the display prompts is
58
+ not evidence.
59
+
60
+ ## 4. Drops / simplifies
61
+
62
+ - **No model call in this module**, and none in `sleep/`: the dreamer is a background
63
+ agent the session launches with its own tools.
64
+ - **No automatic dreaming.** The ask is a quiet line; no hook dreams on its own.
65
+ - **No settling of contradictions.** A dream flags a pair; the pair is raised awake next
66
+ session, and to the owner when it is about him.
67
+ - **No promotion.** A dream nominates; only a core lane at consolidation promotes.
68
+
69
+ ## 5. Contract
70
+
71
+ ### 5.1 The ask
72
+
73
+ - Due when: not observer; the store has lived more than one day; no dream this lived
74
+ day; the day's ask neither raised nor declined; and at least `MIN_NEW` showable
75
+ memories made since the last dream.
76
+ - Raised as ONE quiet line for the model (the hook's `additionalContext`), at most once
77
+ per CALENDAR day across every session (the `dream_asks` latch). It asks the model to
78
+ ask the owner at a natural moment. A "no" is phase `decline`: snoozed for the day.
79
+ - Never in the host-mode page writer's headless session.
80
+ - A contradiction a dream flagged is raised the same way, once, when both memories are
81
+ showable.
82
+
83
+ ### 5.2 The dream
84
+
85
+ - `launch` returns a prompt for a background agent (same model, same MCP server, the
86
+ session's id), written by this module (`launchPrompt`).
87
+ - `begin` refuses under observer, when a dream already ran this lived day, and when
88
+ nothing is new; otherwise it records the dream and returns the bundle: the self page,
89
+ the wake, journal chapters since the last dream, the owner's names and the memories
90
+ about him, every new memory with its `NEIGHBOURS` nearest older ones (the static
91
+ embedder's vectors, or the token index), `MIXING` loosely related older ones, and the
92
+ `LOOKBACK_COUNT` strongest-feeling memories from about a week back. The ids shown are
93
+ recorded on the dream; nothing else can be changed by it.
94
+ - `propose` applies each change on its own, within per-dream `LIMITS`, and records it
95
+ with what undo needs (ids and numbers only):
96
+ `merge` (2–3 near-copies of one kind, not core, into one memory in better words; the
97
+ merged memory stands where the strongest original stood, carries their returns and
98
+ feelings, and inherits their links), `link` (both ways, `LINK_WEIGHT`), `replayed` (a
99
+ return at `DREAM_RETURN_WEIGHT`, never a use), `gist` (source `dreamed`, citing and
100
+ linked to its sources, salience capped at `DREAMED_CLAIM_CEILING`), `contradiction`,
101
+ `feeling-now` (the self's feeling today, capped at the memory's peak), `nominate-core`
102
+ (a memory about me or about us; recorded in `core_events` with the dream's reason).
103
+ - `journal` closes the dream with its entry (kept in `dreams.journal`, never a memory)
104
+ and returns the hand-back line, which begins with the mark.
105
+ - Every word a dream writes is redacted of credentials first.
106
+
107
+ ### 5.3 Guarantees
108
+
109
+ 1. **[M]** A dream cannot delete, edit the self page, promote, rewrite a memory in place,
110
+ or change a memory it was not shown (`apply`'s action list and `shown`).
111
+ 2. **[M]** At most one dream per lived day (`begin`).
112
+ 3. **[M]** A dream's words never become a lived memory: the bundle and the hand-back carry
113
+ `DREAM_MARK`; `remember/spans.ts#enters` refuses any turn carrying it; the Claude Code
114
+ reader tags such a block `dream`. Tested end to end: seed, dream, sweep, zero rows.
115
+ 4. **[M]** Undo reverses the whole batch and is idempotent: originals restored (their
116
+ versions kept), the merged memory and gists archived `dream-undone`, links back to
117
+ their prior weights, the dream's feelings, replays and nominations removed. A merge
118
+ whose merged memory has moved on since (revised into a successor, merged again,
119
+ archived or removed) is left as it is and counted (`kept`), so an undo never stands
120
+ originals beside a live successor (review of #251).
121
+ 7. **[M]** What a dream makes keeps the rules of what it was made from: a merge or gist drawn
122
+ from a confidential memory is confidential; a dated reminder and a memory the owner
123
+ demoted from the core are not merged; a dream's merges are not "new" for the next
124
+ ask; a dream left open is closed to changes once a newer one begins (review of #251).
125
+ 5. **[M]** Under observer stance nothing is written and every phase says so.
126
+ 6. **[M]** The journal lives in the `dreams` table: no decay, dedup, prune or recall
127
+ touches it.
128
+
129
+ ## 6. Scars honored
130
+
131
+ **§2.4** (every refusal named; a dream that changed nothing says so) · **§2.6** (every
132
+ tool claim mechanized) · **§2.16** (the tool carries an admission test and negative
133
+ examples) · **§2.19** (every change enumerable: `counterparts dream --show`) · **G11**
134
+ (this system's own words never enter capture).
135
+
136
+ ## 7. Open questions
137
+
138
+ 1. How often will the owner say yes? The ask is once a day at most; if it is a nag, a
139
+ longer snooze or a weekly rhythm is the next knob.
140
+ 2. Should a gist that proves true awake be promoted out of `dreamed` provenance?
141
+ 3. Should dream links be stored differently from Hebbian links (a marker, a hop
142
+ weight)? A session designing association with the owner may decide; today they are
143
+ ordinary edges at `LINK_WEIGHT`.
@@ -0,0 +1,24 @@
1
+ # `dream/` — INTERFACE-GAPS
2
+
3
+ What this module still owes, or asks of others (2026-09-26).
4
+
5
+ 1. **Live try-out with a real background agent.** The flow was exercised against a demo
6
+ store through the MCP server (launch → begin → propose → journal, then
7
+ `counterparts dream --show/--undo`); a real Claude Code session launching the Agent
8
+ tool with the prompt has not yet been watched end to end on the owner's machine.
9
+ 2. **The ask is claimed when composed**, not at delivery. If the host drops the line
10
+ (envelope limits), that day's ask is lost. The plain reminders' pattern
11
+ (`bin/hook.ts#deliverTurn` → claim only what the envelope carries) is the fix.
12
+ 3. **A subagent's own turns (the sidechain).** On current hosts a subagent's transcript
13
+ is a separate file the boundary does not read; if a host ever writes a dreamer's
14
+ turns into the parent's file, only turns carrying the mark are refused. The
15
+ dreamer's final message is the marked hand-back by instruction and by the tool
16
+ handing it the words.
17
+ 4. **`export --markdown` does not carry the `dreams` table**, and there is no door to
18
+ remove one dream's journal short of undoing it (which keeps it, marked undone). The
19
+ owner's removal of a MEMORY blanks its address in `dream_changes`.
20
+ 5. **Merged memories keep no embedding** until the next backfill embeds them (as any new
21
+ memory).
22
+ 6. **Dream links are ordinary edges.** If the association work wants them marked (a
23
+ table, a starting weight, a hop rule), `apply`'s `link` and `gist` arms are the two
24
+ writers.
@@ -0,0 +1,84 @@
1
+ # `dream/` — NOTES
2
+
3
+ What the build learned, and every choice the brief left open (2026-09-26).
4
+
5
+ ## The tunables (`tunables.ts`), and why each number
6
+
7
+ | name | value | reason |
8
+ |---|---|---|
9
+ | `MIN_NEW` | 3 | a dream with less than three new memories to replay is not worth the owner's minutes |
10
+ | `FIRST_DREAM_DAYS` | 7 | a store that never dreamed treats the last week as "new" |
11
+ | `MAX_NEW` | 40 | bounds the bundle: newest first |
12
+ | `NEIGHBOURS` | 6 | the owner's "5–8" |
13
+ | `MIXING` / `MIXING_FROM_RANK` / `MIXING_TO_RANK` | 5 / 12 / 40 | "loosely related": ranks 12–40 of a new memory's neighbourhood, picked at random (a seeded RNG, so a bundle is reproducible from its dream id) |
14
+ | `LOOKBACK_DAYS` ± `LOOKBACK_SPREAD`, `LOOKBACK_COUNT` | 7 ± 2, 5 | "about a week back", the strongest-felt five |
15
+ | `TEXT_CHARS`, `PAGE_CHARS`, `WAKE_CHARS`, `CHAPTER_CHARS`, `MAX_CHAPTERS` | 400, 6000, 6000, 3000, 6 | keep the bundle well under an MCP tool result's size |
16
+ | `LIMITS` | merge 10, link 20, gist 3, replayed 60, contradiction 10, feeling-now 10, nominate-core 3 | the owner's "~10 merges, 20 links, 3 gists"; the rest sized so a dream over 40 new memories can replay each |
17
+ | `LINK_WEIGHT` | 0.3 | about three Hebbian co-activations (`HEBB_RATE` 0.1): a dream's link is a suggestion, not a certainty |
18
+ | `MAX_TEXT_CHARS`, `MAX_JOURNAL_CHARS` | 2000, 12000 | bounds, not targets |
19
+
20
+ ## Choices the brief left open
21
+
22
+ 1. **The journal is a column on `dreams`, not a memory kind.** The brief allowed either.
23
+ A memory kind would have needed every scan (decay, dedup, prune, recall, the wake,
24
+ the census, the dashboard's lists) to learn to skip it; a table nobody scans for
25
+ memories needs nothing. The owner reads it with `counterparts dream --show` and on
26
+ the dashboard.
27
+ 2. **"Last dreamed" is the newest `dreams` row**, and the snooze a `dream_asks` row per
28
+ calendar date — both durable rows, not meta.
29
+ 3. **The ask is once per calendar day across sessions**, claimed when the line is
30
+ composed. A line the host then drops (an envelope too small) costs that day's ask;
31
+ the plain reminders' claim-at-delivery would fix it (INTERFACE-GAPS §2).
32
+ 4. **The ask waits for a store's second lived day**: "I haven't dreamed since …" needs a
33
+ since.
34
+ 5. **A begun dream that did nothing does not use up the day**: the next `begin` closes it
35
+ `undone` and opens a fresh one (an agent that gave up, a crash).
36
+ 6. **A merge takes 2–3 memories of ONE kind, none of them core.** The merged memory
37
+ stands where the strongest original stood (its salience, its channel, its legacy
38
+ consolidation), with the most uses, the latest use and the earliest birth, every
39
+ original's returns (the `returns` rows are carried) and feelings, and their links
40
+ (`associate.retargetOnSupersede`, which had no caller until now). So a merge never
41
+ leaves a memory weaker than what it was made from.
42
+ 7. **`feeling-now` is the self's feeling, capped at the memory's peak.** A dream records
43
+ softening; it cannot raise a memory, nor open the core's fast lane.
44
+ 8. **`nominate-core` only for a memory about me or about us** — the same reading the
45
+ lanes use; a nomination of anything else would be noise.
46
+ 9. **A dream's words are redacted of credentials, not run through the full gate
47
+ battery.** The battery refused short text (`content-too-short`): a one-line journal,
48
+ a nomination's reason, a merged sentence. The words are rewordings of memories that
49
+ already crossed the battery.
50
+ 10. **Contradictions are raised once each**, by a meta latch (`dream.raised.<dream>.<seq>`),
51
+ at most two a session, and only when both memories are showable in that session.
52
+
53
+ 11. **The ask is cheap, because it runs on every prompt.** `status` answers observer,
54
+ first day, dreamed today and the day's ask row before it counts anything, and "new
55
+ since" is one bounded read (`store.newMemoryIds`, the column gates in SQL) with the
56
+ deny-list and confidentiality applied to what comes back. The first version walked
57
+ every memory row per prompt (~17k queries on the owner's store) on every quiet day.
58
+ 12. **One anchor for "the last dream"**: the newest dream not undone. The ask, "new
59
+ since" and `begin` all read it, so after an undo they agree.
60
+ 13. **A dream cannot strengthen what a dream wrote**: `replayed` and `merge` refuse a
61
+ `dreamed` row (`dreamed-rises-only-awake`). A gist rises only by proving true awake.
62
+ 14. **A dream can refer to what it made** in an earlier `propose` call of the same dream
63
+ (a merge's memory, a gist): those ids join what it was shown.
64
+
65
+ ## What it cost to find out
66
+
67
+ - The dashboard's import-scan reads `from"` as a module path, so reading a merge's
68
+ `from` key needed a destructure (dashboard NOTES).
69
+ - The store bans deletion verbs in method names; undo's helpers are `restoreEdge` and
70
+ `retract*`.
71
+
72
+
73
+ ## After the review of #251 (2026-09-26)
74
+
75
+ - **Merged return days are a UNION (Q4, confirmed and tested).** `supersedeInto` copies
76
+ returns under `(memory_id, day, source)`, and `return_days` is `COUNT(DISTINCT day)`
77
+ of awake rows. Two originals that came back on the same day give the merged memory
78
+ that day once.
79
+ - **An undone dream no longer lights anything.** Proofs read from dream events carry
80
+ `stands`, which drops rows whose dream is undone. This covers Dreaming,
81
+ Consolidation's dream merges, and Episodic → semantic's gist.
82
+ - **Replays follow spacing** (physics NOTES): a memory in every night's bundle counts at
83
+ most once a week.
84
+ - **Removal redacts journals** that cite or quote the removed memory (store NOTES).