counterparts 0.3.2 → 0.3.3

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 (66) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/package.json +1 -1
  3. package/src/adapters/claude-code/NOTES.md +12 -0
  4. package/src/adapters/claude-code/bin/hook.ts +85 -22
  5. package/src/adapters/claude-code/config.ts +7 -0
  6. package/src/adapters/claude-code/doctor.ts +20 -4
  7. package/src/adapters/claude-code/hooks.ts +157 -6
  8. package/src/adapters/claude-code/index.ts +3 -0
  9. package/src/adapters/cli/commands.ts +11 -0
  10. package/src/adapters/cli/mechanisms.ts +46 -21
  11. package/src/adapters/dashboard/registries.ts +4 -0
  12. package/src/adapters/dashboard/web/README.md +19 -11
  13. package/src/adapters/dashboard/web/flow.ts +2 -0
  14. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +9 -5
  15. package/src/adapters/dashboard/web/mechanisms/prospective/index.js +6 -3
  16. package/src/adapters/dashboard/web/narrate.ts +8 -0
  17. package/src/adapters/dashboard/web/pages/health/sections/checks.js +17 -1
  18. package/src/adapters/dashboard/web/pages/self/index.js +55 -16
  19. package/src/adapters/dashboard/web/pages/self/sections/journal.js +75 -19
  20. package/src/adapters/dashboard/web/pages/self/sections/page.js +108 -65
  21. package/src/adapters/dashboard/web/pages/self/sections/settling.js +94 -99
  22. package/src/adapters/dashboard/web/pages/self/sections/wake.js +31 -15
  23. package/src/adapters/dashboard/web/pages/self/self.css +119 -59
  24. package/src/adapters/dashboard/web/pages/self/state.js +23 -0
  25. package/src/adapters/dashboard/web/pages/self/tips.js +50 -0
  26. package/src/adapters/dashboard/web/shared/memory-modal.js +9 -0
  27. package/src/adapters/dashboard/web/views/mechanisms.ts +85 -14
  28. package/src/adapters/dashboard/web/views/memory.ts +15 -1
  29. package/src/adapters/dashboard/web/views/mind.ts +130 -6
  30. package/src/adapters/feelings-line.ts +74 -0
  31. package/src/adapters/fired.ts +78 -18
  32. package/src/adapters/mcp/CONTRACT.md +8 -0
  33. package/src/adapters/mcp/NOTES.md +45 -0
  34. package/src/adapters/mcp/server.ts +165 -6
  35. package/src/adapters/mcp/tools.ts +51 -4
  36. package/src/core/bridge.ts +21 -16
  37. package/src/core/counterpart.ts +309 -6
  38. package/src/core/encode/CONTRACT.md +7 -1
  39. package/src/core/feelings-wheel.ts +171 -13
  40. package/src/core/mint.ts +9 -0
  41. package/src/core/physics/CONTRACT.md +43 -0
  42. package/src/core/physics/NOTES.md +94 -0
  43. package/src/core/physics/index.ts +98 -6
  44. package/src/core/prospective/CONTRACT.md +35 -6
  45. package/src/core/prospective/INTERFACE-GAPS.md +10 -5
  46. package/src/core/prospective/NOTES.md +175 -4
  47. package/src/core/prospective/derive.ts +32 -3
  48. package/src/core/prospective/index.ts +362 -39
  49. package/src/core/prospective/tunables.ts +18 -1
  50. package/src/core/prospective/windows.ts +104 -46
  51. package/src/core/recall/CONTRACT.md +28 -0
  52. package/src/core/recall/NOTES.md +39 -0
  53. package/src/core/recall/activate.ts +32 -5
  54. package/src/core/recall/gate.ts +7 -1
  55. package/src/core/recall/index.ts +19 -0
  56. package/src/core/recall/mood.ts +106 -0
  57. package/src/core/recall/tunables.ts +26 -0
  58. package/src/core/remember/index.ts +1 -0
  59. package/src/core/remember/proposals.ts +86 -3
  60. package/src/core/self/identity.ts +20 -1
  61. package/src/core/store/CONTRACT.md +9 -2
  62. package/src/core/store/NOTES.md +20 -0
  63. package/src/core/store/feelings.ts +23 -6
  64. package/src/core/store/index.ts +107 -10
  65. package/src/core/store/operational.ts +15 -1
  66. package/src/core/types.ts +9 -0
package/src/core/mint.ts CHANGED
@@ -49,6 +49,7 @@
49
49
  * resolution, upstream, and this file does not write a second one.
50
50
  */
51
51
  import { TUNABLES as PHYSICS, clampSalienceAtSeam } from "./physics/index.js";
52
+ import { CUE_MODE_META, DATE_FROM_META } from "./prospective/index.js";
52
53
  import type { Proposal } from "./remember/index.js";
53
54
  import { localDate } from "./time.js";
54
55
  import type { Store } from "./store/index.js";
@@ -182,6 +183,12 @@ export function mintProposal(store: Store, proposal: Proposal, opts: MintOptions
182
183
  // Durable, because the event ring is not: prose is canonical, so the flag on
183
184
  // the document is what makes "defaulted vs claimed" countable tomorrow.
184
185
  if (clamp.defaulted) meta[CLAIMED_DEFAULT_META_KEY] = true;
186
+ // PLAIN OR QUIET rides the meta bag beside its date (2026-09-26, no schema
187
+ // bump), under the key its one reader owns.
188
+ if (proposal.eventDate !== null && proposal.remind !== null) meta[CUE_MODE_META] = proposal.remind;
189
+ // The memory a revision took its reminder from (`Counterpart#carryReminder`):
190
+ // an id, so what was already said for the same window still counts.
191
+ if (proposal.reminderFrom !== undefined) meta[DATE_FROM_META] = proposal.reminderFrom;
185
192
 
186
193
  // THE PROPOSAL'S OWN INSTANT, not the write's (§I7). `proposal.at` is the
187
194
  // span buffer's injected clock read at the moment the author deposited; the
@@ -203,6 +210,8 @@ export function mintProposal(store: Store, proposal: Proposal, opts: MintOptions
203
210
  body: proposal.content,
204
211
  learnedOn,
205
212
  ...(proposal.title === null ? {} : { title: proposal.title }),
213
+ // The reminder date, as the author wrote it (schema v7's `event_date`).
214
+ ...(proposal.eventDate === null ? {} : { eventDate: proposal.eventDate }),
206
215
  meta,
207
216
  band: opts.band ?? "episodic",
208
217
  ...(opts.model === undefined ? {} : { model: opts.model }),
@@ -307,6 +307,49 @@ low-strength memory is still present and still retrievable by a strong enough cu
307
307
  calibration and a fixture-bounded window, or disabled (scar §2.8).
308
308
  12. **[M]** Up-moves and down-moves are counted separately, per kind, with a stated expected
309
309
  ratio — the symmetry counter that made v1's one-way ratchet visible (scar §2.10).
310
+ 13. **[M]** Emotion (§5.10) lifts only the SALIENCE arm and lengthens only stability:
311
+ `sal()` is unchanged (recall's turn gate and revision force read it without the
312
+ lift), the repetition arm gets no lift (guarantee 4 stands), and a silent note with
313
+ the strongest possible feeling is below `THETA_SEM` at birth and below `THETA_ID`
314
+ even consolidated. The recorded feeling is never rewritten; softening is a read.
315
+ **Emotion does not count toward identity:** promotion reads `promotionBase` (`base`
316
+ without the lift), so its reach is unchanged by §5.10 (coordinator, 2026-09-26,
317
+ pending the owner's consolidation redesign; NOTES §17).
318
+
319
+ ### 5.10 Emotion — height, slope, and the feeling that softens
320
+
321
+ *(Added 2026-09-26, emotion part A — owner decisions of 2026-09-25/26. Working defaults,
322
+ not rulings: the three constants are CAL and unmeasured. NOTES "Emotion, part A" has the
323
+ simulation and the reasons.)*
324
+
325
+ ```
326
+ I(m) = max( emotional(m), max strength of the feelings recorded on m ) # his or mine
327
+ salArm(m) = clamp01( sal(m) + EMO_LIFT × I(m) ) EMO_LIFT = 0.15 # TUNABLE
328
+ base(m) = max( ω_sal(k) × salArm(m), ω_rep(k) × rep(m) ) + cons(m) # §5.2, arm lifted
329
+ S(m) = §5.4's S × (1 + EMO_SLOPE × I(m)) EMO_SLOPE = 0.5 # TUNABLE
330
+ feeling now = strength × exp( −(d − birth_day(m)) / S_FEELING ) S_FEELING = 20 # read only
331
+ ```
332
+
333
+ - **Height ADDS.** Before this, a lone `emotional: 0.9` on a note read as a mean of 0.3
334
+ under a claimed floor of 0.25 — the feeling averaged away. Now intensity adds on top of
335
+ whatever the mean-with-floor is. `sal()` itself is v0's verbatim mean and stays that way.
336
+ - **The strongest feeling decides**, whoever's it is: `I` is a MAX over the numeric score
337
+ and every recorded feeling on the memory (the owner's and the self's), read beside the
338
+ row by `store.row()` as `feelingPeak`. A MAX, like `base`, so quieter feelings never
339
+ average a strong one down.
340
+ - **Slope follows the same number.** "How long a memory lasts follows the strongest
341
+ feeling on it." It changes decay on EXISTING stores — every row with an `emotional`
342
+ score or a recorded feeling — which is why the multiplier is modest (×1.45 at I = 0.9).
343
+ - **The feeling softens faster than the fact.** A feeling's strength as it reads now is
344
+ the recorded strength softened over the lived days since its MEMORY was born.
345
+ `S_FEELING = 20 < S_BASE = 60`. The table keeps the strength as recorded; nothing
346
+ writes the softened value back. Height and slope use the RECORDED peak (affect stamps a
347
+ trace at encoding); the softened value is what mood-matching (recall G18) and the
348
+ displays read. **Approximation, named:** a feeling's age is counted from its memory's
349
+ birth day, because the lived-day clock cannot map a feeling's wall-clock `created_at`
350
+ back to a lived day. Today every feeling is written in the same call that mints its
351
+ memory, so the two agree; a feeling added to an old memory later (`addFeelings` is
352
+ public) would read as already softened.
310
353
 
311
354
  ## 6. Scars honored
312
355
 
@@ -134,6 +134,100 @@ decided twice.)*
134
134
  The FALLBACK channel is untouched: its ceiling and its interpreter-supplied
135
135
  dimensions are exactly what they were. CAL, and a working default.
136
136
 
137
+ 17. **Emotion, part A (2026-09-26) — feelings start to matter (CONTRACT §5.10).**
138
+ Owner decisions of 2026-09-25/26, built as working defaults. Three constants,
139
+ all CAL and unmeasured, chosen by the arithmetic below and kept modest because
140
+ this changes decay on an existing store.
141
+
142
+ **Where the lift lives.** In `base()`'s salience ARM (`salArm`), not in `sal()`.
143
+ `sal()` is also what recall's turn gate reads (§9 G10: the emotional dimension
144
+ counts only when the turn itself carries first-person feeling) and what
145
+ `challengeForce` multiplies by (the author's own how-much-this-mattered). Folding
146
+ the lift into `sal()` would have broken G10 silently and changed revision force.
147
+ The repetition arm gets nothing, so "repetition never reaches identity" is still
148
+ the cap arithmetic alone.
149
+
150
+ **Intensity** `I = max(emotional, strongest recorded feeling)`. `feelingPeak` is
151
+ read beside the row by `Store.row()` (one indexed subquery), which every physics
152
+ read goes through — sleep, recall, the dashboard, `physicsOf`, `read`. A bare
153
+ `SELECT * FROM memories` carries none and reads as the numeric score alone.
154
+
155
+ **The simulation.** A silent authored fact (claimed default 0.25, no dimensions,
156
+ never used, κ = 1), strength over lived days, at three intensities:
157
+
158
+ | I | height | S (lived days) | d0 | d7 | d30 | d60 | d90 | below φ = 0.02 on |
159
+ |---|---|---|---|---|---|---|---|---|
160
+ | 0 | 0.250 | 60 | 0.250 | 0.222 | 0.152 | 0.092 | 0.056 | day 152 |
161
+ | 0.5 | 0.325 | 75 | 0.325 | 0.296 | 0.218 | 0.146 | 0.098 | day 210 |
162
+ | 0.9 | 0.385 | 87 | 0.385 | 0.355 | 0.273 | 0.193 | 0.137 | day 258 |
163
+
164
+ (`test/emotion.test.ts` pins this table.) A `person` memory (κ = 0.75) at I = 0.9:
165
+ S = 116, below the floor on day 344 instead of 203. A note that said only
166
+ `emotional: 0.9`: before, height 0.300 and S = 60 (floor on day 163); now height
167
+ 0.435 and S = 87 (floor on day 268).
168
+
169
+ **Why these numbers.**
170
+ - `EMO_LIFT = 0.15`. The lift is felt (a strongly felt silent note starts 54%
171
+ higher than an unfelt one) and bounded where it matters:
172
+ `AUTHORED_DEFAULT_CLAIM + EMO_LIFT = 0.40 < THETA_SEM`, so a feeling alone does
173
+ not make a silent note semantic at birth — consolidation (+0.2) or use still has
174
+ to, and a consolidated one at I = 0.9 holds semantic for ~14 lived days, then
175
+ fades back. Consolidated, it is 0.60, far under `THETA_ID = 0.85`. Larger lifts
176
+ (0.25+) would carry a felt silent note to semantic on birth; smaller ones (0.05)
177
+ are rounding error against a 0.25 floor.
178
+ - `EMO_SLOPE = 0.5`. ×1.25 stability at I = 0.5, ×1.45 at 0.9 — the strongly felt
179
+ memory lasts ~1.7× as long before it reaches the prune floor. It stays a slope,
180
+ not an exemption: nothing becomes immortal by being felt (identity is still the
181
+ only decay exemption, and still by promotion only).
182
+ - `S_FEELING = 20`. A 0.9 feeling reads 0.63 after a week, 0.45 after two, 0.20
183
+ after a month — while the fact it sits on is still at 0.79 of its height after
184
+ two weeks. "The feeling softens faster than the fact" as arithmetic.
185
+
186
+ **What moves on an existing store.** Every row with an `emotional` score or a
187
+ recorded feeling is now taller and slower. The first sleep pass after an upgrade
188
+ will re-read those bands; some episodic rows will read semantic (counted as
189
+ up-moves by guarantee 12's counter — expected, and a one-time step). A felt row
190
+ that reads semantic on a day after its birth is then CONSOLIDATED by the same
191
+ pass, and `consolidated` is permanent (+0.2 to `base` for life).
192
+
193
+ **Identity would have been reachable, in a window (adversarial review of #244) — closed below.**
194
+ Promotion eligibility is on `base`, and the lift is in `base`. The "stays under
195
+ identity" bound above is for a SILENT note only. For a memory whose `sal` was
196
+ claimed or computed, the consolidated bar `THETA_ID − CONS_BONUS = 0.65` is now
197
+ met at `sal ≥ 0.65 − 0.15 × I`: at I = 0.9 a consolidated memory with
198
+ `sal ∈ [0.515, 0.65)` and ≥ 3 distinct reinforced days is newly eligible, where
199
+ before it was not. Identity is decay-exempt, so this is one-way. It includes the
200
+ retelling channel: a sweep memory at `SWEEP_CLAIM_CEILING = 0.6` with an
201
+ `emotional` dimension ≥ 0.34 reaches 0.6 + 0.15 × I + 0.2 ≥ 0.85 (0.80 before).
202
+ On an existing store the first sleep after the upgrade could have promoted such rows.
203
+ **Settled 2026-09-26 (coordinator, holding the status quo until the owner's
204
+ consolidation/dreaming redesign lands): emotion does NOT count toward identity.**
205
+ Promotion reads `promotionBase` — `base` without the lift — so its reach is exactly
206
+ what it was before #244, and the settling view (which reads the verdict's `base`)
207
+ follows. The lift still makes a memory taller and slower to fade.
208
+
209
+ Anything that ranks by strength (the self page's ordering, the dashboard's
210
+ lists) shifts toward felt memories. Felt, consolidated, high-salience memories
211
+ also reach the strength CEILING of 1.0 more often (`strength` clamps `base × D`,
212
+ and base can exceed 1 with the consolidation bonus), so anything that ranks by
213
+ strength sees more ties. The self lanes break a tie on born day, then on a hash
214
+ of the memory's words (`self/identity.ts#tieKey`, added in review), then id —
215
+ so two stores built alike (the demo seed's two runs) render the same wake, and
216
+ `demo-seed.test.ts` compares the wake's bytes exactly again. On a live store,
217
+ lines tied on everything else move from id order to hash order — both
218
+ arbitrary, so nothing is lost; identity additionally rotates by last-rendered
219
+ day, which dominates after one render.
220
+
221
+ **Softening's clock, an approximation named.** A feeling softens over the lived
222
+ days since its MEMORY's birth day: the lived-day clock is a counter and cannot map
223
+ a feeling's wall-clock `created_at` back to a lived day. Every feeling written
224
+ today is written in the same call that minted its memory, so they agree; a later
225
+ `addFeelings` on an old memory would read as already softened.
226
+
227
+ **Not carried across a revision.** Feelings belong to a memory id. A supersede
228
+ mints a new id, so the successor starts without them (and without their lift).
229
+ Named, not solved — revisit with the self/schemas work.
230
+
137
231
  ## Observations for the owner (arithmetic vs prose)
138
232
 
139
233
  - **§5.6's "a slow kind cannot cross from rest in fewer than ~3 lived days" is
@@ -54,7 +54,9 @@ export const TUNABLES = {
54
54
  * self-claimed importance (mode 0.8), parking ~75% of the store above
55
55
  * THETA_SEM with no independent check (review F5). 0.6 clears the semantic
56
56
  * floor (a crashed day still matters) and sits structurally below THETA_ID.
57
- * WORKING DEFAULT — to be revisited against the re-run's watch metrics.
57
+ * The emotion lift (§5.10) does not change that: promotion reads
58
+ * `promotionBase`, which leaves the lift out (NOTES §17). WORKING DEFAULT — to be revisited against the re-run's watch
59
+ * metrics.
58
60
  */
59
61
  SWEEP_CLAIM_CEILING: 0.6,
60
62
  /**
@@ -105,6 +107,41 @@ export const TUNABLES = {
105
107
  /** CAL. Size of the nearest-neighbour slice in E(m) for novelty (v1's top-M). */
106
108
  K_NEAREST: 8,
107
109
 
110
+ // --- §5.10 emotion (owner decisions 2026-09-25/26 — WORKING DEFAULTS) ---
111
+ /**
112
+ * How much a memory's emotional intensity ADDS to its salience arm (§5.2):
113
+ * `clamp01(sal + EMO_LIFT x I)`. Before this, a 0.9 `emotional` on a note
114
+ * with no other dimensions read as mean 0.3 — the feeling averaged away by
115
+ * the claimed floor. 0.15 is chosen so the lift is felt but cannot on its
116
+ * own carry a silent note across a band: `AUTHORED_DEFAULT_CLAIM + EMO_LIFT
117
+ * = 0.40 < THETA_SEM` (a strong feeling alone does not make a silent note
118
+ * semantic at birth; consolidation or use still has to), and even
119
+ * consolidated it stays under identity: `0.25 + EMO_LIFT + CONS_BONUS = 0.60
120
+ * < THETA_ID`. Promotion reads `promotionBase` (no lift), so the lift never
121
+ * makes anything promotion-eligible (NOTES §17). NOTES.md "Emotion, part
122
+ * A" has the simulation. CAL.
123
+ */
124
+ EMO_LIFT: 0.15,
125
+ /**
126
+ * How much the same intensity slows decay: stability x (1 + EMO_SLOPE x I).
127
+ * At I = 0.9 that is x1.45 — a fact with S = 60 lived days gets S = 87. It
128
+ * changes decay on EXISTING stores (every row with an `emotional` score or a
129
+ * feeling), which is why it is modest: a strongly felt, never-used note
130
+ * reaches the prune floor after ~255 lived days instead of ~150. CAL.
131
+ */
132
+ EMO_SLOPE: 0.5,
133
+ /**
134
+ * How fast a recorded FEELING softens, in lived days: `strength x
135
+ * exp(-age / S_FEELING)`, age counted from the memory's birth day. 20 < 60 =
136
+ * S_BASE is the owner's "the feeling softens faster than the fact" as
137
+ * arithmetic: half the feeling is gone in ~14 lived days, while the fact
138
+ * itself is still at ~0.8 of its height. Softening is READ-SIDE ONLY — the
139
+ * table keeps the strength as recorded, and height and slope use that
140
+ * recorded peak; the softened value is what mood-matching and the displays
141
+ * read. CAL.
142
+ */
143
+ S_FEELING: 20,
144
+
108
145
  // --- §5.5 reinforcement ---
109
146
  /** Retrospective credit weights by tier. The ignorable tier never trains. */
110
147
  W_REFERENCED: 1.0,
@@ -402,13 +439,56 @@ export function cons(m: Pick<MemoryPhysics, "consolidated">): number {
402
439
  */
403
440
  export function base(m: MemoryPhysics): number {
404
441
  const k = kindPhysics(m.kind);
405
- return Math.max(k.wSal * sal(m.salience), k.wRep * rep(m)) + cons(m);
442
+ return Math.max(k.wSal * salArm(m), k.wRep * rep(m)) + cons(m);
443
+ }
444
+
445
+ // ---------------------------------------------------------------------------
446
+ // §5.10 Emotion — height, slope, and the feeling that softens
447
+ // ---------------------------------------------------------------------------
448
+
449
+ /**
450
+ * I(m) — a memory's emotional intensity: the STRONGEST of its numeric
451
+ * `emotional` score and the recorded strengths of the feelings on it, whoever's
452
+ * they are (owner decision 2026-09-25/26: "how long a memory lasts follows the
453
+ * strongest feeling on it, his or mine"). A MAX, like `base`, so a lone strong
454
+ * feeling is never averaged down by quieter ones. 0 when there is neither.
455
+ */
456
+ export function emotionalIntensity(m: { salience: Salience; feelingPeak?: number | null | undefined }): number {
457
+ const peak = m.feelingPeak;
458
+ return Math.max(
459
+ clamp01(m.salience.emotional),
460
+ typeof peak === "number" && Number.isFinite(peak) ? clamp01(peak) : 0,
461
+ );
406
462
  }
407
463
 
408
- /** Stability S, in lived days. kappa DIVIDES (§5.4). */
409
- export function stability(m: Pick<MemoryPhysics, "kind" | "uses">): number {
464
+ /**
465
+ * The salience ARM of `base`: `sal(m)` with the emotion ADDED on top of it.
466
+ * `sal()` itself stays v0's verbatim mean-with-floor — it is also what recall's
467
+ * turn gate (§9 G10) and `challengeForce` read, and neither may see this lift.
468
+ * The repetition arm gets no lift at all, so "repetition is capped below
469
+ * identity" (§3) is untouched.
470
+ */
471
+ export function salArm(m: Pick<MemoryPhysics, "salience" | "feelingPeak">): number {
472
+ return clamp01(sal(m.salience) + TUNABLES.EMO_LIFT * emotionalIntensity(m));
473
+ }
474
+
475
+ /**
476
+ * How a recorded feeling reads NOW — softened over the lived days since it was
477
+ * recorded. `ageDays` is lived days (the one clock); a negative or non-finite
478
+ * age reads as fresh. Never written back: the table keeps the strength as felt.
479
+ */
480
+ export function softenedFeeling(strength: number, ageDays: number): number {
481
+ const age = Number.isFinite(ageDays) ? Math.max(0, ageDays) : 0;
482
+ return clamp01(strength) * Math.exp(-age / TUNABLES.S_FEELING);
483
+ }
484
+
485
+ /** Stability S, in lived days. kappa DIVIDES (§5.4); emotion lengthens it (§5.10). */
486
+ export function stability(
487
+ m: Pick<MemoryPhysics, "kind" | "uses"> & Partial<Pick<MemoryPhysics, "salience" | "feelingPeak">>,
488
+ ): number {
489
+ const felt = m.salience === undefined ? 0 : emotionalIntensity({ salience: m.salience, feelingPeak: m.feelingPeak });
410
490
  return (
411
- (TUNABLES.S_BASE * (1 + TUNABLES.BETA * Math.log(1 + Math.max(0, m.uses)))) /
491
+ (TUNABLES.S_BASE * (1 + TUNABLES.BETA * Math.log(1 + Math.max(0, m.uses))) * (1 + TUNABLES.EMO_SLOPE * felt)) /
412
492
  kindPhysics(m.kind).kappa
413
493
  );
414
494
  }
@@ -491,8 +571,20 @@ export interface PromotionVerdict {
491
571
  * Note it is `base`, not decayed strength: promotion is about what the memory
492
572
  * earned, not about how recently it was touched.
493
573
  */
574
+ /**
575
+ * The base promotion reads: `base` WITHOUT the emotion lift (§5.10). Emotion
576
+ * makes a memory taller and slower to fade, but it does not count toward
577
+ * identity — identity is decay-exempt and permanent, and how a memory earns it
578
+ * is being redesigned with the owner (dreaming + consolidation, 2026-09-26).
579
+ * Until then promotion keeps its pre-#244 reach exactly.
580
+ */
581
+ export function promotionBase(m: MemoryPhysics): number {
582
+ const k = kindPhysics(m.kind);
583
+ return Math.max(k.wSal * sal(m.salience), k.wRep * rep(m)) + cons(m);
584
+ }
585
+
494
586
  export function promotionEligibility(m: MemoryPhysics): PromotionVerdict {
495
- const b = base(m);
587
+ const b = promotionBase(m);
496
588
  const days = reinforcedDays(m);
497
589
  const blockedBy: PromotionReason[] = [];
498
590
  if (m.promotedIdentity) blockedBy.push("already-identity");
@@ -21,6 +21,19 @@ clothes. **Hold debts, lose deadlines.**
21
21
  turning to June is treated exactly like the user saying "Portland": one more cue into the
22
22
  same activation → gate → tier competition, under the same floors, refractory, dedup, and
23
23
  footnote-first tiering as everything else.
24
+ **One named exception, by the owner's decision (2026-09-25/26, a working default, not a
25
+ rule): a PLAIN item.** When the author of a dated memory marks it `remind: "plain"` —
26
+ because the person said "don't let me forget", or it is a real deadline — it is *also*
27
+ said outright on its day: one line to the person (the host's terminal) and the same line
28
+ to the model, at most once per beat (a day item on its day; a month or range the first
29
+ day it is seen open and again on its last day). That is a bypass lane on purpose, and it
30
+ is bounded like one: no salience floor (it was asked for), but never under observer,
31
+ never for an archived, superseded, removed or journal row, never for a year, and never
32
+ twice for the same beat (`Prospective.plainDue` / `claimPlain`), and a beat is claimed
33
+ only by a host about to show it (the Claude Code hooks claim after the envelope is known
34
+ to carry the line, 2026-09-26 review). Quiet — the default —
35
+ is everything above, unchanged. A plain item told today is not also offered as a quiet
36
+ cue that day (`told-plainly-today`).
24
37
  - **Prospectivity is DERIVED, never stored.** [v1] §12 G2 — eligibility is a predicate over
25
38
  the event date, the encode date, salience, and flags, so the property expires by itself
26
39
  when the window passes: no cleanup pass, no second source of truth, nothing for decay to
@@ -33,8 +46,18 @@ clothes. **Hold debts, lose deadlines.**
33
46
  `derive`'s seven call sites. Found by adversarial review when a dated chapter rendered
34
47
  in the wake's horizon lane as a thing about to happen.
35
48
  **A missing encode date fails conservatively.** [v1] §12 G3.
49
+ **An explicit date is its own importance signal** (owner decision 2026-09-26, a working
50
+ default): a memory whose author wrote its `eventDate` is exempt from the salience floor,
51
+ which now gates only a date a caller extracted. Decay is not exempted — a dated memory
52
+ faded to `FADED_STRENGTH` refuses as `faded` (G10) — and archived, skill and journal
53
+ still refuse.
36
54
  - **Precision is carried by the date's own format**, never rounded, and the ramp differs by
37
- precision — a stated month *means* early month more than the 29th. [v1] §12 G4.
55
+ precision — a stated month *means* early month more than the 29th. [v1] §12 G4. Since
56
+ 2026-09-26 there are four shapes (`core/time.ts`): a day, a month, a year (no window), and
57
+ a RANGE `a..b` — the author saying exactly which days, so it is at full intensity for the
58
+ whole span. The date is the `memories.event_date` column (schema v7), written by `note`
59
+ and `session_end` as an explicit field; nothing in this module or upstream of it reads a
60
+ date out of prose.
38
61
  - **A temporal cue alone reaches the footnote tier at most.** [v1] §12 G5.
39
62
  - **Once-ness has four independent brakes**: one ambient fire per occasion per lived day;
40
63
  a cap per window; session dedup; and — decisive — **once the assistant is observed to
@@ -85,14 +108,17 @@ clothes. **Hold debts, lose deadlines.**
85
108
  the cue and gate machinery of `recall/`; per-occasion firing history; the previous
86
109
  session's affect summary; the observer predicate.
87
110
  **Outputs** — at most a line or two on the session's horizon, framed *"remembered, not
88
- tasks"*, and/or a temporal cue fed into the ordinary turn-time pass; firing-state
89
- transitions; telemetry by reference.
111
+ tasks"* (day-dated items only, since 2026-09-26), and/or a temporal cue fed into the
112
+ ordinary turn-time pass; for a PLAIN item, a claimed record the host turns into one line on
113
+ its day (§3's named exception) — records, never words; firing-state transitions;
114
+ telemetry by reference.
90
115
 
91
116
  **Guarantees** — **[M]** mechanized, **[A]** advisory:
92
117
 
93
- 1. **[M] There is no bypass lane.** A temporal cue enters `recall/` through the same
94
- activation and gate path as any other cue; a test asserts no second injection path
95
- exists.
118
+ 1. **[M] There is no bypass lane for a quiet item.** A temporal cue enters `recall/`
119
+ through the same activation and gate path as any other cue; a test asserts no second
120
+ injection path exists. The plain lane (§3) is the one named exception, and this module
121
+ still holds no words for it — it hands out records, and a test asserts the exports.
96
122
  2. **[M] Eligibility is a pure predicate, computed at read time.** Nothing stores
97
123
  "prospective"; nothing has to clean it up.
98
124
  3. **[M] A missing or year-only encode date fails closed.**
@@ -135,3 +161,6 @@ admission criterion, with a named negative example) · **§2.17** (exit paths ar
135
161
  lane would be simpler and more brain-faithful.
136
162
  3. **What replaces `session dedup` if `recall/`'s per-session gate state is not persisted?**
137
163
  One of the four brakes depends on it — see `recall/` open question 1.
164
+ 4. **Is "plain" the right amount of loud?** (2026-09-26.) Once on the day, twice for a
165
+ month or range, only on the stated span — no lead-day warning, no nag when the day is
166
+ missed. The owner's first weeks of use answer it; nothing here measured it.
@@ -48,10 +48,15 @@ computes arrivals and nothing consumes them.
48
48
  `revise({ eventDate })` (null clears it; the old date stays in the version), a partial
49
49
  index, and `Store.datedMemories(from, to)`. A new column rather than a widened
50
50
  `happenedOn`, because `schemas/` already writes every belief's `statedOn` into
51
- `happened_on` (store NOTES 2026-09-25). **Still open, for PR B:** nothing writes
52
- `event_date` yet, and `arrivals()` / `exitReport()` still scan `store.list()` and read
53
- `contentDates` (which keeps reading `happenedOn` and the `eventDate` meta convention); a
54
- range is not yet a window precision (`windows.ts` knows day and month).
51
+ `happened_on` (store NOTES 2026-09-25).
52
+
53
+ **Closed 2026-09-26 (PR B).** `note` and `session_end` write `event_date` (an explicit
54
+ field the model fills; never read from text). `arrivals()` enumerates through
55
+ `Store.datedMemories(at − GRACE_DAYS, at + LEAD_DAYS)`, `exitReport()` through
56
+ `datedMemories(…, { archived: true })` plus the new `Store.prospectiveMemoryIds()`; no
57
+ `store.list()` scan is left. `contentDates` reads `ProseDoc.eventDate` alone — the
58
+ `happenedOn` reading and the `meta.eventDate` convention are dropped (NOTES §12). A range
59
+ is a window precision. What follows is the history of the gap.
55
60
 
56
61
  **Owner:** `store/`.
57
62
  **Needed:** (a) somewhere canonical for "the date this memory is ABOUT, in the future";
@@ -83,7 +88,7 @@ seam it will use for the wiring in gap #1.
83
88
 
84
89
  ## 4. `store.revise` cannot patch `happenedOn`, so a reschedule cannot complete here
85
90
 
86
- **Closed 2026-09-24** — `Store#revise` takes `happenedOn` in its patch (`store/index.ts`, schema v6). `Prospective.reschedule()` still leaves that revise to its caller.
91
+ **Closed 2026-09-24** — `Store#revise` takes `happenedOn` in its patch (`store/index.ts`, schema v6). `Prospective.reschedule()` still leaves that revise to its caller — which, since v7 and PR B, is `revise(id, { eventDate })`, the column this module reads.
87
92
 
88
93
  **Owner:** `store/`.
89
94
  **Needed:** §12 G8 — the correction "names the exact current value, carries a reason, and
@@ -48,6 +48,18 @@ where a faded memory actually loses — which is the whole "no bypass lane" clai
48
48
  `sal()` is imported from `physics/`. A local mean would be a second implementation of the
49
49
  one arithmetic rule, which is exactly the divergence v1's "two clocks" produced.
50
50
 
51
+ **Revised 2026-09-26 (owner decision, PR #243 review).** A memory with an EXPLICIT
52
+ `eventDate` (the `event_date` column its author wrote) no longer faces the floor: choosing
53
+ a date is itself the importance signal, and an ordinary note sits at the 0.25 authored
54
+ default, so the floor made quiet reminders dead for most notes. The floor still gates a
55
+ date a caller extracted (`extraDates`). With the floor lifted, decay needed saying
56
+ explicitly, so the predicate gained a `faded` refusal — strength at or below
57
+ `FADED_STRENGTH`, the same line §8's `faded` exit uses, computed by `load()` so `derive`
58
+ stays pure. That is G10 kept, not broken: a dated memory that faded before its window
59
+ still does not arrive. Archived, journal and skill still refuse as before. Measured end to
60
+ end: a quiet `note` at the authored default reaches the footnote tier on its day and spends
61
+ its fire (`test/prospective-review-pr243.test.ts`).
62
+
51
63
  ## 5. Ramp shape: linear, two anchors, both CAL
52
64
 
53
65
  `RAMP_OPEN = 0.4` rising to 1 at the peak, then falling to `RAMP_CLOSE = 0.2` at the last
@@ -154,7 +166,166 @@ day", which is the smallest fact that answers the question.
154
166
  The ring emits are untouched: they are the live debugging channel and they die with the
155
167
  process. What is new is the half that outlives it.
156
168
 
157
- **Still true, and worth saying:** `fire()` has one caller in the whole tree
158
- (`tools/demo/seed.ts`), so on the live store these rows will read `never` until something
159
- arms and fires a window in earnest. That is inventory §3 S4, not a fault in this row — and
160
- now it is a silence the view can finally tell apart from a mechanism nobody watched.
169
+ **Was true until 2026-09-26:** `fire()` had one caller in the whole tree
170
+ (`tools/demo/seed.ts`). §12 names the live one.
171
+
172
+ ## 12. PR B, 2026-09-26: reminders actually working
173
+
174
+ Owner decisions of 2026-09-25/26, all experimental working defaults.
175
+
176
+ **The date is a field the model writes.** `note` and every `session_end` entry (so the
177
+ write-up door too — it deposits through the same `depositEntries`) take `eventDate` in the
178
+ v7 shapes and `remind: "plain" | "quiet"`. The MCP adapter checks the date with
179
+ `time.ts#parseCalendarDate` before anything is captured and refuses an unreadable one by
180
+ name, listing the shapes; `remember/proposals.ts#intake` checks it again at the one front
181
+ door (`EVENT_DATE_UNREADABLE`, `REMIND_UNKNOWN`). `mint.ts` writes it to the column and
182
+ `remind` to `meta.remind` (`CUE_MODE_META`) — no schema bump. `remind` with no date is
183
+ dropped, counted, and said in the tool's reply; the memory still lands. The sweep never
184
+ dates anything.
185
+
186
+ **The caller of `fire()` is `Counterpart#spendArrivals`, reached from
187
+ `Counterpart#recallForTurn`** — the UserPromptSubmit hook's recall. `recallForTurn` now
188
+ reads `arrivals()` itself (so each cue keeps its window key), hands the cues to recall as
189
+ `turn.temporal` (so `composeTurn` does not read them a second time), and after the gate
190
+ spends one fire for each arrival whose memory the turn actually surfaced or footnoted. An
191
+ aborted turn spends nothing; an observer's `fire()` stands down on its own. The wake's
192
+ horizon lines do NOT spend a fire: the bundle is rendered at a boundary and served to
193
+ every session until the next one, so a render is an offer, not a surfacing. They are
194
+ bounded anyway, because `horizon()` reads `arrivals()` and a spent window is not offered.
195
+
196
+ **Enumeration is the index.** `arrivals()` asks `Store.datedMemories(at − GRACE_DAYS,
197
+ at + LEAD_DAYS)` — exactly the memories whose window can be open — plus any `extraDates`
198
+ ids; `exitReport()` asks `datedMemories` over all time with archived rows included, plus
199
+ `Store.prospectiveMemoryIds()` for rows that outlived a cleared date. No `store.list()`
200
+ scan remains. Two consequences: `window-not-open` and `window-passed` are now reachable
201
+ only through a caller's `extraDates` (the index never hands over a date whose window is
202
+ shut), and the old sources are gone — `happenedOn` (a past date by name, and every
203
+ belief's `statedOn` lands there) and the `meta.eventDate` convention (nothing ever wrote
204
+ it). Nobody had dated memories yet, so nothing was migrated.
205
+
206
+ **Range precision, and year.** A range `a..b` opens `LEAD_DAYS` before `a`, holds full
207
+ intensity from `a` through `b` (a plateau: "late October" means all of it), and decays
208
+ through grace after `b`. Its key is `r:a..b`. A year still has no window and is never told
209
+ plainly: it names no day it could mean.
210
+
211
+ **The four July tune questions** (bansai `eval/replay/GATES.md` finding 3), each with an
212
+ acceptance test in `test/prospective-reminders.test.ts`:
213
+
214
+ - (a) *Stagger month warmth.* A month's peak is its 1st plus a stable per-memory offset
215
+ (FNV-1a of the id, mod `MONTH_STAGGER_DAYS` = 7). The window KEY is unchanged — the
216
+ stagger lives only in `peakOn` — so G9 holds.
217
+ - (b) *Space a month's fires so it gets an "after" beat.* With `FIRES_PER_WINDOW >= 2`, a
218
+ month or range window's last fire is held (`held-for-after`) until the stated span has
219
+ ended; it can then land in grace. Applied to ranges too, since a range front-loads its
220
+ budget the same way. A day window is untouched: it already had grace.
221
+ - (c) *Only day-dated items take wake lines.* `horizon()` filters to day precision. Month
222
+ and range items still arrive as cues every day of their windows.
223
+ - (d) *Imminence breaks salience ties.* `arrivals()` sorts by ramp × strength; scores
224
+ within 1e-9 are a tie, broken by days until the span starts, then span width (narrower
225
+ first), then key. The v1 caveat — month items must not be starved by a stream of
226
+ imminent day items — is bounded as v1 said: each occasion needs at most two slots, and
227
+ (c) already takes months out of the wake entirely.
228
+
229
+ **Plain items** (CONTRACT §3's named exception). `plainDue({at})` lists plain memories
230
+ whose STATED span covers `at` (no lead, no grace) and whose beat has not been told;
231
+ `claimPlain` writes the `prospective.plain` row with a `dedupKey` per memory, window and
232
+ beat, and returns true only when this call wrote it — so two hook processes cannot both
233
+ say it. `Counterpart#plainDueToday` reads and adds `what` (title, else the first line);
234
+ `claimPlainReminder` claims one; `plainReminders` is the two together. The claude-code
235
+ adapter words it (`hooks.ts#plainLine`, clipped to `PLAIN_WHAT_MAX_CHARS`), puts it under
236
+ the `Now:` line for the model, and returns it as `notices` + `plain` for the terminal's
237
+ `systemMessage` at SessionStart and at a prompt (a day that began mid-session is said at
238
+ the next prompt) — UNCLAIMED: `bin/hook.ts#deliverTurn` claims only once it knows the
239
+ envelope carries the line (see the review, below). Beats: `day` on the day; `opens` the first
240
+ day a month or range is seen open; `last-day` on its last day. The latch is by beat, and a
241
+ beat belongs to a CALENDAR day — not the lived-day counter, which only moves at a boundary
242
+ and would keep "today" shut all morning. No salience floor: the floor gates unasked
243
+ surfacing, and an ordinary note sits at the 0.25 authored default. A plain item told today
244
+ is not also offered as a quiet cue that day (`told-plainly-today`). A confidential one is
245
+ told only in the owner's own session, recall's boundary gate kept by hand.
246
+
247
+ Two edges, named by the builder. The model's copy sits under the `Now:` line, above the
248
+ wake block; the delivery check finds the wake's sentinels by searching the attachment's
249
+ text, not by line, so the extra lines cost it nothing. The second — a beat claimed before
250
+ anyone knew the envelope would carry it — was FIXED by the review (below).
251
+
252
+ **The review's fixes (2026-09-26, `docs/adversarial-review-pr243-2026-09-26.md`).**
253
+
254
+ - *Claim only what is certainly leaving.* The adapter returns plain lines UNCLAIMED;
255
+ `bin/hook.ts#deliverTurn` puts them first among the notices, probes the envelope, and
256
+ claims (`ClaudeCodeAdapter#claimPlain`) only if it fits. No room — a ~9 KB wake at
257
+ SessionStart leaves none in the host's 10,000-character envelope — means no claim, and
258
+ the lines are stripped from the model's copy too (`withoutPlain`), so the first prompt
259
+ says them instead. A claim lost to another process strips the same way. The update
260
+ notice can no longer cost a plain line that fit: when the two do not fit together, the
261
+ delivery without the update notice stands.
262
+ - *The page writer's headless child* (`COUNTERPARTS_PAGE_WRITER`) is told nothing, so it
263
+ cannot spend a beat nobody sees (`HookInput.pageWriter`). Any OTHER headless `claude -p`
264
+ with the hooks on still can: SessionStart gives no sign it is headless.
265
+ - *Said outright means not also cued* on the same prompt: the plain ids are withheld from
266
+ that turn's temporal cues (`recallForTurn`'s `withhold`), since the claim that makes
267
+ `told-plainly-today` true now lands after recall.
268
+ - *A fire row carries its calendar `date`*, as the plain row does, so the fired view counts
269
+ it on the day it was asked in any zone (the gauge test failed in Pacific/Auckland).
270
+
271
+ The dashboard's "N today" counts rows on the current LIVED day, like its seven-day window;
272
+ it stays on yesterday's number in the morning until a boundary moves the clock.
273
+
274
+ **Still not wired:** `reference()` (brake 4, referenced-stop) has no live caller — when the
275
+ model uses a dated memory, nothing yet stops its window. Session dedup (brake 3) is still
276
+ in-process only, and every hook is its own process, so in live use brakes 1 and 2 are the
277
+ ones doing the work. No bad-day or crisis switch was flipped: `refractory` and
278
+ `previousSessionHighAffect` exist, and no live caller passes them.
279
+
280
+ ## 13. A revision owns the reminder (review N7, 2026-09-26)
281
+
282
+ The review's N7 said a `note` with `updates:` and no `eventDate` minted an undated
283
+ successor, "once the old one is superseded the reminder is gone". The premise was half
284
+ right: revising an ORDINARY memory is link-only (`revision.ts`'s table) — nothing
285
+ supersedes it — so the old row kept its date and kept coming back, while the newest version
286
+ of the thing was undated. Carrying the date over alone would therefore have doubled the
287
+ reminder (two live dated rows; the plain latch is per memory, so said twice on its day),
288
+ and a reschedule already left the old day firing.
289
+
290
+ So the carry and a move, in `Counterpart#carryReminder` / `#moveReminder`, on the authored
291
+ path only: field by field, what the author sent wins, `eventDate: null` drops the date,
292
+ anything left out comes from the memory being revised; then the revised row's date is
293
+ cleared with `Store#revise({ eventDate: null, reason: "reminder-moved" })`, which keeps the
294
+ old date in its version (constitution 7). One reminder, on the newest memory. `remind`
295
+ carries on its own, so a reschedule of a plain item that does not repeat `remind` stays
296
+ plain, and `remind` alone on a revision reshapes the carried date rather than being
297
+ ignored.
298
+
299
+ Only for an address the author DECLARED and the store resolved. A content-matched link is
300
+ the engine's guess; moving a date off a guessed row would be a wrong write, and leaving it
301
+ where it is loses nothing. The sweep never dates anything and builds its proposals without
302
+ a `DateIntent`, so it neither carries nor moves.
303
+
304
+ **The adversarial review of #247 (same day) closed three holes in the first cut.**
305
+ (`docs/adversarial-review-pr247-2026-09-26.md`.)
306
+
307
+ - *The reminder is found where it moved.* The old row stays LIVE after a move (link-only),
308
+ so recall keeps showing it and the model's next `updates:` names it again — the normal
309
+ case, not an edge. The first cut read the date off that row only, found none, and so a
310
+ cancel by the old id did nothing (silently) and a reschedule by it minted a second dated
311
+ row beside the carried one, at quiet. Now the move writes `meta.reminderMovedTo` on the
312
+ old row in the SAME `revise` that clears its date, and `Counterpart#reminderHolder` walks
313
+ that chain (each hop through `Store#resolve`, bounded by `DATE_LINEAGE_MAX`) to the
314
+ live memory holding the date; `from` in the reply names that holder. A cancel that finds
315
+ no dated memory at all now says so (`reminder: { cleared: false }`).
316
+ - *A move is not a new reminder.* The plain latch and the quiet firing rows are keyed by
317
+ memory id, so the successor started with nothing spent: a month or range already opened
318
+ was told "opens" again on any later day of it (not only the same day, as first noted), and
319
+ a quiet window the assistant had already used came back with a fresh budget. The
320
+ successor's `meta.reminderFrom` names its predecessor, and `lineage` lets the plain reads
321
+ (`plainTold`, `plainToldOn`) and the brakes (`firingRowsFor`, in `arrivals` and `fire`)
322
+ count what was spent for the SAME window key on the memories it moved through. A new date
323
+ is a new key and starts fresh, as `reschedule` does. Read-side on purpose: copying the
324
+ plain rows would have added `prospective.plain` rows for tells that never happened.
325
+ - *An archived holder carries nothing*, matching `revision.ts`'s `target-archived`: a
326
+ reminder that faded or was put away is not revived onto a live row by a revision.
327
+
328
+ Still open, left alone: the old memory's firing rows stay where they are, so `exitReport`
329
+ can count a moved window twice (once per memory); and a failed clear (`moved: false`,
330
+ evented, `unmoved: true` in the reply) leaves the reminder on both rows — a double, never a
331
+ loss, because the successor is minted first.