counterparts 0.3.12 → 0.3.13

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 (116) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/docs/module-map.md +1 -1
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/CONTRACT.md +36 -10
  5. package/src/adapters/claude-code/INTERFACE-GAPS.md +116 -16
  6. package/src/adapters/claude-code/NOTES.md +131 -0
  7. package/src/adapters/claude-code/bin/hook.ts +35 -2
  8. package/src/adapters/claude-code/doctor.ts +155 -21
  9. package/src/adapters/claude-code/hooks.ts +49 -7
  10. package/src/adapters/claude-code/index.ts +11 -0
  11. package/src/adapters/claude-code/night-run.ts +133 -12
  12. package/src/adapters/claude-code/transcript.ts +268 -1
  13. package/src/adapters/cli/CONTRACT.md +5 -0
  14. package/src/adapters/cli/INTERFACE-GAPS.md +8 -4
  15. package/src/adapters/cli/NOTES.md +111 -0
  16. package/src/adapters/cli/commands.ts +65 -14
  17. package/src/adapters/cli/dream-core.ts +57 -42
  18. package/src/adapters/cli/export.ts +320 -21
  19. package/src/adapters/cli/index.ts +1 -0
  20. package/src/adapters/cli/install.ts +39 -7
  21. package/src/adapters/cli/mechanisms.ts +7 -1
  22. package/src/adapters/cli/uninstall.ts +13 -5
  23. package/src/adapters/cli/wire.ts +189 -63
  24. package/src/adapters/dashboard/INTERFACE-GAPS.md +10 -1
  25. package/src/adapters/dashboard/NOTES.md +79 -0
  26. package/src/adapters/dashboard/registries.ts +10 -2
  27. package/src/adapters/dashboard/web/README.md +19 -14
  28. package/src/adapters/dashboard/web/actions.ts +23 -1
  29. package/src/adapters/dashboard/web/flow.ts +4 -1
  30. package/src/adapters/dashboard/web/lanes.ts +3 -0
  31. package/src/adapters/dashboard/web/narrate.ts +30 -2
  32. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +1 -0
  33. package/src/adapters/dashboard/web/pages/memories/memories.css +17 -4
  34. package/src/adapters/dashboard/web/pages/memories/row.js +37 -21
  35. package/src/adapters/dashboard/web/pages/memories/sections/search.js +279 -60
  36. package/src/adapters/dashboard/web/pages/memories/state.js +2 -1
  37. package/src/adapters/dashboard/web/server.ts +0 -5
  38. package/src/adapters/dashboard/web/shared/memory-marks.css +7 -0
  39. package/src/adapters/dashboard/web/shared/memory-marks.js +33 -0
  40. package/src/adapters/dashboard/web/shared/memory-modal.js +5 -3
  41. package/src/adapters/dashboard/web/views/health.ts +1 -1
  42. package/src/adapters/dashboard/web/views/search.ts +4 -45
  43. package/src/adapters/dashboard/web/views.ts +2 -2
  44. package/src/adapters/fired.ts +410 -25
  45. package/src/adapters/host-wiring.ts +300 -0
  46. package/src/adapters/lifecycle.ts +14 -0
  47. package/src/adapters/log/index.ts +2 -0
  48. package/src/adapters/mcp/CONTRACT.md +33 -3
  49. package/src/adapters/mcp/INTERFACE-GAPS.md +24 -2
  50. package/src/adapters/mcp/NOTES.md +136 -0
  51. package/src/adapters/mcp/bin/serve.ts +30 -0
  52. package/src/adapters/mcp/facts.ts +13 -1
  53. package/src/adapters/mcp/meaning.ts +208 -13
  54. package/src/adapters/mcp/server.ts +87 -15
  55. package/src/adapters/mcp/stdio.ts +3 -1
  56. package/src/adapters/mcp/stood-down.ts +51 -0
  57. package/src/adapters/mcp/tools.ts +27 -7
  58. package/src/adapters/plugin-run.sh +133 -0
  59. package/src/adapters/plugin.ts +329 -0
  60. package/src/core/associate/CONTRACT.md +2 -1
  61. package/src/core/associate/INTERFACE-GAPS.md +6 -1
  62. package/src/core/associate/NOTES.md +45 -0
  63. package/src/core/briefing.ts +12 -3
  64. package/src/core/contradictions.ts +184 -0
  65. package/src/core/counterpart.ts +451 -18
  66. package/src/core/dream/CONTRACT.md +5 -2
  67. package/src/core/dream/INTERFACE-GAPS.md +29 -6
  68. package/src/core/dream/NOTES.md +21 -0
  69. package/src/core/dream/index.ts +33 -1
  70. package/src/core/dream/reflect.ts +20 -5
  71. package/src/core/encode/INTERFACE-GAPS.md +3 -1
  72. package/src/core/fit/INTERFACE-GAPS.md +8 -2
  73. package/src/core/fit/NOTES.md +5 -2
  74. package/src/core/fit/index.ts +4 -1
  75. package/src/core/handoff/CONTRACT.md +37 -2
  76. package/src/core/handoff/INTERFACE-GAPS.md +10 -0
  77. package/src/core/handoff/NOTES.md +66 -0
  78. package/src/core/handoff/index.ts +214 -12
  79. package/src/core/mint.ts +8 -2
  80. package/src/core/physics/CONTRACT.md +11 -1
  81. package/src/core/physics/NOTES.md +30 -0
  82. package/src/core/physics/index.ts +26 -4
  83. package/src/core/prospective/CONTRACT.md +45 -6
  84. package/src/core/prospective/INTERFACE-GAPS.md +4 -0
  85. package/src/core/prospective/NOTES.md +138 -0
  86. package/src/core/prospective/derive.ts +33 -5
  87. package/src/core/prospective/index.ts +90 -5
  88. package/src/core/prospective/windows.ts +72 -1
  89. package/src/core/recall/CONTRACT.md +6 -2
  90. package/src/core/recall/INTERFACE-GAPS.md +28 -4
  91. package/src/core/recall/NOTES.md +57 -1
  92. package/src/core/recall/probe.ts +58 -0
  93. package/src/core/recall/session.ts +27 -3
  94. package/src/core/recall/time-ask.ts +116 -18
  95. package/src/core/remember/CONTRACT.md +4 -1
  96. package/src/core/remember/INTERFACE-GAPS.md +9 -1
  97. package/src/core/remember/proposals.ts +38 -5
  98. package/src/core/revision.ts +5 -0
  99. package/src/core/schemas/CONTRACT.md +13 -1
  100. package/src/core/schemas/INTERFACE-GAPS.md +20 -2
  101. package/src/core/schemas/NOTES.md +127 -0
  102. package/src/core/schemas/types.ts +2 -0
  103. package/src/core/self/CONTRACT.md +15 -4
  104. package/src/core/self/INTERFACE-GAPS.md +7 -2
  105. package/src/core/self/NOTES.md +49 -0
  106. package/src/core/self/briefing.ts +12 -2
  107. package/src/core/self/index.ts +82 -8
  108. package/src/core/self/page.ts +88 -0
  109. package/src/core/sleep/INTERFACE-GAPS.md +22 -3
  110. package/src/core/sleep/NOTES.md +11 -0
  111. package/src/core/sleep/prune.ts +6 -2
  112. package/src/core/store/NOTES.md +14 -0
  113. package/src/core/store/index.ts +107 -0
  114. package/src/core/time.ts +152 -0
  115. package/tools/install-loop/run.sh +48 -12
  116. package/src/adapters/dashboard/web/pages/memories/fold.js +0 -53
@@ -126,6 +126,8 @@ because the memory was actually USED is the best exit there is, and folding it i
126
126
 
127
127
  ## 9. Recurrence stays absent, and so does anything that could grow into it
128
128
 
129
+ **Was true until 2026-10-09** — the owner lifted it; §15 is what replaced it.
130
+
129
131
  No re-arm, no next-occurrence, no "annual" flag, no date arithmetic that produces a date
130
132
  the author never stated. The recorded punt (CONTRACT §4) is not a to-do: annual re-arm is
131
133
  scheduling physics, and scheduling physics is where task-queue behavior creeps back in.
@@ -344,3 +346,139 @@ session that day) keeps its grace week in the lane.
344
346
  Named, not proved through the lane: month and range items take no wake line at all
345
347
  (tune question c), so the `last-day` half of the rule has no visible effect today. It is
346
348
  written for both precisions so the two cannot drift if that changes.
349
+
350
+ ## 15. A date that repeats (2026-10-09, the owner's design, held lightly)
351
+
352
+ `recurring: daily | weekly | monthly | yearly` on a `note` or `session_end` entry, beside
353
+ `eventDate` and `remind`, anchored on the event date. What the build chose:
354
+
355
+ - **Where it lives: `meta.recurring`, beside `meta.remind`** (`store`'s `RECURRING_META`).
356
+ No schema bump: the owner wanted it in 0.3.13 without a store-format change, and a
357
+ build that never heard of it (0.3.12) reads the same file and sees a one-off date that
358
+ has passed — inert, never wrong in the loud direction. The anchor stays on
359
+ `event_date`, as stated, so `datedMemories` keeps its meaning ("the date as stated
360
+ reaches this span"); `Store.recurringMemories()` is the other half — live rows with a
361
+ day `event_date` and the word in meta, a loose text match on the meta (as
362
+ `planCandidates` does for `unresolved`) that the parsed meta confirms. `arrivals()` and
363
+ `plainDue()` union the two; `time.ts#occurrenceBetween` decides which repeats reach the
364
+ span.
365
+ - **Prospectivity is still derived.** `contentDates` carries the rule to `derive`, which
366
+ asks `windows.ts#recurringWindowAt` for the ONE occurrence window open on `at` — or the
367
+ next, pending. Nothing is re-armed and nothing is stored per occurrence until it fires,
368
+ exactly as a one-off date. A repeating date therefore never reads `window-passed`.
369
+ - **The key is the occurrence's date** (`d:2027-05-14`). That one choice makes every
370
+ per-window brake per occurrence without a line of its own: `FIRES_PER_WINDOW`, once per
371
+ lived day, the plain latch per beat, referenced-stop, `told-plainly-today`. And it is
372
+ what keeps a revision from telling or firing the same occurrence twice: `lineage`
373
+ (§13) counts what was spent "for the SAME window key" on the memories a reminder moved
374
+ through, and an occurrence's key does not change when the words do. A revision that
375
+ moves the anchor to another day of the year starts fresh, like a reschedule.
376
+ - **Two occurrences are never open together.** Lead (3) and grace (7) make a window
377
+ eleven days wide, so a weekly date would have two open and a daily one eleven, each with
378
+ its own fire budget — a task queue by arithmetic. So each occurrence's window opens no
379
+ earlier than the day after the previous occurrence and closes the day before the next
380
+ one opens: the coming lead wins over the last grace. Daily: the day. Weekly: Friday to
381
+ Thursday around a Monday. Monthly and yearly: untouched.
382
+ - **Only a day repeats.** A month, a range or a year beside `recurring` is refused at the
383
+ door (`recurring-needs-day`, `RECURRING_NEEDS_DAY`); a revision that moves a repeating
384
+ date to a month drops the repeat and says so. "Every October" is an owner question
385
+ (CONTRACT §7.5), not a gap.
386
+ - **The calendar is `time.ts`'s**, counted from the anchor every time: monthly on the
387
+ 29th–31st falls on the last day of a shorter month; yearly on Feb 29 falls on Feb 28 in
388
+ a common year; never an occurrence before the anchor. `readableRecurrence` gives the
389
+ words ("every May 14", "every Monday", "every month on the 31st", "every day"), from the
390
+ anchor so a February occurrence of the 31st still reads as the 31st. Words live there,
391
+ not here: this module still exports nothing that produces text.
392
+ - **Carried field by field on `updates`** (`Counterpart#carryReminder`): sent wins,
393
+ `null` stops the repeat (the date stays, once), left out comes from the memory being
394
+ revised. The old row keeps its `meta.recurring` when its date is cleared — inert with no
395
+ date, and kept in its version either way.
396
+
397
+ Named, not fixed: `exitReport` (§5 G12, "every dated memory names its exit") sees a
398
+ repeating memory's CURRENT or next occurrence, plus any past occurrence that left a firing
399
+ row. A past occurrence nobody fired — a quiet birthday in a week with no sessions, or a
400
+ plain one told only through the plain latch, which writes an event and no firing row —
401
+ exits nowhere, so G12 is narrower for repeats than for one-off dates. And a past
402
+ occurrence's row is re-derived with `windowFor`, which does not know the clipping, so its
403
+ phase can read a few days long. Both only colour the exit count. The dream's
404
+ "coming up" list and the dashboard's "ahead" list read `datedMemories` alone, so they do
405
+ not show a repeating date's next occurrence yet.
406
+
407
+ Review of #339 (2026-10-09), measured through the hooks with an evening boundary each
408
+ simulated day:
409
+
410
+ - **A daily repeat takes no wake line** (`horizon()`). The wake is rendered at the
411
+ boundary with `at` = that evening's day (`runner.ts`) and read the next morning, so a
412
+ quiet daily read "due <yesterday>, every day" at every first wake, and kept one of the
413
+ two lines for good. A one-off's date is fixed, so a day-old render of it stays true. A
414
+ plain daily is still said outright each day; a quiet one still cues recall each turn
415
+ (one fire a day). A weekly one keeps its line; rendered on the Thursday it closes, it
416
+ reads last Monday at Friday's wake — one day in seven, like a one-off's grace.
417
+ - **A quiet weekly spends both fires in its lead** when it is surfaced every day: Friday
418
+ and Saturday, and nothing on the Monday itself. That is the one-off rule (a day window
419
+ holds no fire back for its day); a repeat just shows it every week.
420
+ - **Decay still holds, and a repeat has to outlive it** (named here; the owner's answer
421
+ is the next section). A memory noted at the default salience fades below `FADED_STRENGTH` and becomes
422
+ prunable at about 152 lived days unless it is used: `derive` then refuses it as
423
+ `faded`, and once prune archives it `recurringMemories()` no longer finds it, so even a
424
+ plain repeat stops. A one-off dated that far out has the same fate; a birthday or a
425
+ daily pill is meant to last for good.
426
+
427
+ ## 16. A repeat is kept alive by coming round (2026-10-09, the owner's decision, held lightly)
428
+
429
+ The answer to §15's last bullet. **Each occurrence that is actually delivered counts as a
430
+ use of the memory**, the way rehearsal keeps a memory alive, and the prune refuses a live
431
+ repeat by name. What the build chose:
432
+
433
+ - **Delivered, not computed.** The two points where an occurrence certainly reached
434
+ someone: a quiet fire (`fire()`, which `Counterpart#spendArrivals` calls only for an
435
+ arrival the gate put in the turn's surfaced or footnoted set) and a plain line the
436
+ host claimed (`claimPlain()`, which the hooks call only for a line their envelope
437
+ carries). The wake's horizon lane is not one: it is rendered at the boundary and read
438
+ later, and a weekly or longer repeat in it also cues recall, which fires.
439
+ - **Credited by the composition root, not here.** `Counterpart#creditOccurrence` calls
440
+ `store.reinforce(id, day, "surfaced")` — the seam recall's credit ends in, so physics'
441
+ own refusals (birth day, already credited today) hold. This module only answers the
442
+ read `occurrenceUndelivered(memoryId, windowKey)`, asked BEFORE the fire or the claim:
443
+ the memory still repeats (`recurrenceOf`, read now) and nothing has delivered this key
444
+ yet — no fire row with a fire spent, no plain beat told, on the memory or one its
445
+ reminder moved from (`firingRowsFor`, `plainTold`). Firing state stays firing state; no
446
+ new durable row and no new event name, because the two latches already there are the
447
+ record of a delivery.
448
+ - **Once per occurrence.** A quiet weekly fired on two lived days is credited on the
449
+ first; a plain weekly fired quietly in its lead and told on its Monday is one
450
+ occurrence, credited at the lead fire. A daily one is credited each day it is said.
451
+ - **`surfaced`, not `referenced`.** It was shown; nothing says the reply used it. And a
452
+ surfaced credit earns no return (`creditReturn` refuses `not-referenced`), so a daily
453
+ reminder about myself cannot reach the core's slow lane on the calendar alone.
454
+ - **Not a one-off, and not a dropped repeat.** `recurrenceOf` is read at the moment of
455
+ credit, so a one-off date (its key `d:2027-05-14` looks the same) is never credited,
456
+ and a repeat revised with `recurring: null` stops being credited from that revision on.
457
+ - **The prune's sixth gate** (physics NOTES, 2026-10-09). One credit a year does not
458
+ carry a yearly repeat across 365 lived days at the default salience; measured through
459
+ the hooks, the test's birthday was let go 263 lived days after its first May 14
460
+ without the gate. `pruneVerdict` refuses `recurring`, as it refuses `protected` — but
461
+ only where the floor would otherwise have let it go (review of #341): a repeat above
462
+ the floor is held by `above-floor` alone. Named on every live repeat every night, it
463
+ read in the fired view as a refusal and turned the prune row BLOCKED on any store with
464
+ a pill reminder and nothing pruned that week.
465
+
466
+ **A live repeat is not refused `faded`** (review of #341, 2026-10-09). The build first
467
+ kept the `faded` refusal and named the gap: between its dates a default-salience yearly
468
+ falls under `FADED_STRENGTH`, so `derive` refused a QUIET one at its next occurrence —
469
+ alive, unpruned, and silent that year, which is not "so they stay alive". So `derive`
470
+ skips `faded` for a memory whose date still repeats (`DerivableMemory.recurring`, set by
471
+ `load` from `recurrenceOf`, read now), the one carve-out from G10; the occurrence is
472
+ delivered by its own remind rules and credited as above. Fading itself is unchanged: the
473
+ strength recall and the views read still decays between dates, and an arrival's
474
+ `strength` still orders it among the day's arrivals. A one-off date, or a repeat whose
475
+ `recurring` was dropped, is refused `faded` as before. Measured through the hooks: a
476
+ quiet yearly `fact` at the default salience, under `PHI_PRUNE` before its 2nd and 3rd
477
+ dates, fires on both and is credited each time (`test/recurring-reinforce.test.ts`).
478
+
479
+ Named, not fixed — **the same-day stronger credit.** If the reply also quotes a repeat
480
+ that recall surfaced loud on the turn its occurrence fired, the boundary's `referenced`
481
+ credit for it is refused `already-credited-today` (physics' one credit a lived day): that
482
+ day counts at 0.25 instead of 1, with no return. Only a repeat, only on the day its
483
+ occurrence is first delivered, and only when it was loud; a temporal cue alone is
484
+ footnoted and earns no boundary credit anyway.
@@ -10,7 +10,8 @@
10
10
  * - there is no second source of truth to drift from the memory;
11
11
  * - decay has nothing to special-case (§12 G10: no decay exemption before
12
12
  * arrival — a future-dated memory that faded before its window was an
13
- * occasion that didn't matter).
13
+ * occasion that didn't matter) — save one carve-out: a date that still
14
+ * REPEATS is not refused `faded` (review of #341, 2026-10-09).
14
15
  *
15
16
  * The dates come from the CALLER. This module does no NLP: it reads the shape of
16
17
  * a date string and nothing else (`windows.ts`). Whoever extracted "September"
@@ -24,8 +25,9 @@
24
25
  */
25
26
  import type { Kind, Salience } from "../types.js";
26
27
  import { sal } from "../physics/index.js";
28
+ import type { Recurrence } from "../time.js";
27
29
  import type { ProspectiveTunables } from "./tunables.js";
28
- import { phaseOf, precisionOf, windowFor } from "./windows.js";
30
+ import { phaseOf, precisionOf, recurringWindowAt, windowFor } from "./windows.js";
29
31
  import type { Phase, Window } from "./windows.js";
30
32
 
31
33
  export type DeriveReason =
@@ -51,7 +53,9 @@ export type DeriveReason =
51
53
  | "below-salience-floor"
52
54
  /** Decayed to physics' prune floor (`FADED_STRENGTH`) — §12 G10, no decay
53
55
  * exemption before arrival: an occasion that faded before its window did
54
- * not matter. Holds for an explicitly dated memory too (2026-09-26). */
56
+ * not matter. Holds for an explicitly dated memory too (2026-09-26), but
57
+ * not for one whose date still REPEATS (`DerivableMemory.recurring`, review
58
+ * of #341, 2026-10-09). */
55
59
  | "faded"
56
60
  /** Every derived window is behind us — the property expiring by itself. */
57
61
  | "window-passed";
@@ -109,11 +113,27 @@ export interface DerivableMemory {
109
113
  * pure predicate. Absent: not checked.
110
114
  */
111
115
  readonly faded?: boolean;
116
+ /**
117
+ * Its reminder date still REPEATS (`meta.recurring` on a day `event_date`,
118
+ * `index.ts#recurrenceOf`). Such a memory is exempt from the `faded`
119
+ * refusal (owner decision 2026-10-09, review of #341): "so they stay
120
+ * alive" means each occurrence is delivered by its own remind rules, and a
121
+ * quiet yearly at the default salience has faded by its second date. Its
122
+ * strength still decays for recall and display; only this refusal is
123
+ * waived. Absent or false: `faded` refuses as before.
124
+ */
125
+ readonly recurring?: boolean;
112
126
  }
113
127
 
114
128
  /** A content-date the CALLER extracted. Its precision is its own shape (§12 G4). */
115
129
  export interface ExtractedDate {
116
130
  readonly date: string;
131
+ /**
132
+ * How often the date comes round (2026-10-09, `meta.recurring`), anchored on
133
+ * it. Read only on a DAY: the window derived is the one occurrence open on
134
+ * `at`, or the next (`windows.ts#recurringWindowAt`). Absent: once, as stated.
135
+ */
136
+ readonly recurring?: Recurrence;
117
137
  }
118
138
 
119
139
  export interface DerivedWindow extends Window {
@@ -168,7 +188,9 @@ export function derive(
168
188
  if (memory.journal) blockedBy.push("journal");
169
189
  if (EXCLUDED_KINDS.includes(memory.kind)) blockedBy.push("excluded-kind");
170
190
  if (!encodeDateOk(memory.learnedOn)) blockedBy.push("missing-encode-date");
171
- if (memory.faded === true) blockedBy.push("faded");
191
+ // A live repeat is exempt (review of #341): its occurrence is a new arrival
192
+ // of something the author asked to come round, not a decayed occasion.
193
+ if (memory.faded === true && memory.recurring !== true) blockedBy.push("faded");
172
194
  // The floor gates UNASKED surfacing of a date somebody else read out of the
173
195
  // memory. An explicit `eventDate` was asked for, so it is exempt (owner
174
196
  // decision 2026-09-26); decay (`faded`, above) and archival still hold.
@@ -188,7 +210,13 @@ export function derive(
188
210
  continue;
189
211
  }
190
212
  // The memory id salts a month's stagger (tune question a) and nothing else.
191
- const w = windowFor(d.date, precision, t, memory.id);
213
+ // A recurring day derives ONE window: the occurrence open on `at`, or the
214
+ // next one — so the property still expires by itself, one occurrence at a
215
+ // time, and a repeating date never reads as `window-passed`.
216
+ const w =
217
+ d.recurring !== undefined && precision === "day"
218
+ ? recurringWindowAt(d.date, d.recurring, at, t, memory.id)
219
+ : windowFor(d.date, precision, t, memory.id);
192
220
  if (w === null) {
193
221
  rejectedDates.push({ date: d.date, reason: "malformed-date" });
194
222
  continue;
@@ -34,7 +34,9 @@ import type { Kind } from "../types.js";
34
34
  import { strength } from "../physics/index.js";
35
35
  import type { UseTier } from "../physics/index.js";
36
36
  import type { ProseDoc, ProspectiveInput, ProspectiveRow, Store } from "../store/index.js";
37
- import { addDays, isDay } from "../time.js";
37
+ import { RECURRING_META } from "../store/index.js";
38
+ import { addDays, isDay, isRecurrence, occurrenceBetween } from "../time.js";
39
+ import type { Recurrence } from "../time.js";
38
40
  import { derive } from "./derive.js";
39
41
  import type { DerivableMemory, DeriveReason, ExtractedDate, Prospectivity } from "./derive.js";
40
42
  import { TEMPORAL_MAX_TIER, withTunables } from "./tunables.js";
@@ -108,6 +110,22 @@ export function cueModeOf(doc: Pick<ProseDoc, "meta">): CueMode {
108
110
  return doc.meta[CUE_MODE_META] === "plain" ? "plain" : "quiet";
109
111
  }
110
112
 
113
+ /**
114
+ * HOW OFTEN IT COMES ROUND (2026-10-09, the owner's design, held lightly):
115
+ * `daily | weekly | monthly | yearly`, in the meta bag beside `remind`
116
+ * (`store`'s `RECURRING_META` — no schema bump), anchored on the event date.
117
+ * Only a DAY repeats: on a month, a range or a year, and with no date at all,
118
+ * this reads null and the date is once, as stated. A repeating date arrives
119
+ * once per OCCURRENCE (`windows.ts#recurringWindowAt`) — each occurrence its
120
+ * own window key, so every per-window brake is per occurrence.
121
+ */
122
+ export { RECURRING_META };
123
+
124
+ export function recurrenceOf(doc: Pick<ProseDoc, "eventDate"> & { readonly meta?: ProseDoc["meta"] }): Recurrence | null {
125
+ const rule = doc.meta?.[RECURRING_META];
126
+ return isRecurrence(rule) && isDay(doc.eventDate) ? rule : null;
127
+ }
128
+
111
129
  /**
112
130
  * A REMINDER THAT MOVED (review of #247, 2026-09-26). When a revision takes a
113
131
  * dated memory's reminder over (`Counterpart#carryReminder`), the two memories
@@ -238,11 +256,17 @@ export interface Arrival {
238
256
  readonly lastFiredDay: number | null;
239
257
  /** Decayed strength on `day`, for ORDERING only. No decay exemption before
240
258
  * arrival (§12 G10): a future-dated memory that faded before its window was
241
- * an occasion that didn't matter. */
259
+ * an occasion that didn't matter — save a live repeat, which arrives faded
260
+ * or not (review of #341, `derive.ts`). */
242
261
  readonly strength: number;
243
262
  /** Plain or quiet, as the author said (`CUE_MODE_META`). Carried so the fire
244
263
  * row can count the two apart; it changes nothing about the cue itself. */
245
264
  readonly mode: CueMode;
265
+ /** A repeating date (2026-10-09): `eventDate` is this occurrence; these say
266
+ * the day it repeats from and how often, so a host can say "every May 14".
267
+ * Absent on a date that does not repeat. */
268
+ readonly anchor?: string;
269
+ readonly recurring?: Recurrence;
246
270
  }
247
271
 
248
272
  /** Which moment of a plain item's window it is being told on. */
@@ -404,9 +428,21 @@ export interface ExitReport {
404
428
  * meant a second enumeration (a scan of every memory) to find what the index
405
429
  * now answers. Caller-extracted dates still arrive through `extraDates`.
406
430
  */
407
- export function contentDates(doc: Pick<ProseDoc, "eventDate">): ExtractedDate[] {
431
+ export function contentDates(doc: Pick<ProseDoc, "eventDate"> & { readonly meta?: ProseDoc["meta"] }): ExtractedDate[] {
408
432
  const v = doc.eventDate;
409
- return typeof v === "string" && v !== "" ? [{ date: v }] : [];
433
+ if (typeof v !== "string" || v === "") return [];
434
+ // A repeating day carries its rule to `derive`, which finds the occurrence.
435
+ const rule = recurrenceOf(doc);
436
+ return [rule === null ? { date: v } : { date: v, recurring: rule }];
437
+ }
438
+
439
+ /** Ids of live memories whose repeating date has an occurrence from `from` to
440
+ * `to` — what `Store.datedMemories` cannot see, since it reads the anchor. */
441
+ function recurringIn(store: Store, from: string, to: string): string[] {
442
+ return store
443
+ .recurringMemories()
444
+ .filter((r) => occurrenceBetween(r.eventDate, r.recurring, from, to) !== null)
445
+ .map((r) => r.id);
410
446
  }
411
447
 
412
448
  /** Every memory whose stated date could have an OPEN window on `at`: the span
@@ -507,6 +543,8 @@ export class Prospective {
507
543
  const ids = new Set<string>(
508
544
  span === null ? [] : this.store.datedMemories(span.from, span.to).map((d) => d.id),
509
545
  );
546
+ // A repeating date is found by an occurrence in the span, not by its anchor.
547
+ if (span !== null) for (const id of recurringIn(this.store, span.from, span.to)) ids.add(id);
510
548
  for (const id of input.extraDates?.keys() ?? []) ids.add(id);
511
549
  let considered = 0;
512
550
  const order = new Map<string, readonly [number, number]>();
@@ -563,6 +601,7 @@ export class Prospective {
563
601
  lastFiredDay: stateRow?.last_fired_day ?? null,
564
602
  strength: loaded.strength,
565
603
  mode,
604
+ ...(w.anchor === undefined || w.recurring === undefined ? {} : { anchor: w.anchor, recurring: w.recurring }),
566
605
  });
567
606
  order.set(`${id} ${w.key}`, imminence(w, input.at));
568
607
  }
@@ -641,8 +680,18 @@ export class Prospective {
641
680
  // written for both so the two cannot drift if that changes). Only the lane:
642
681
  // `arrivals()` is untouched, so recall's cue path still finds it, and a
643
682
  // quiet item is unchanged.
683
+ //
684
+ // A DAILY repeat takes no wake line either (review of #339, 2026-10-09). It
685
+ // is never "arriving" — it is every day — and the lane cannot say it right:
686
+ // the wake is rendered at the evening boundary (`runner.ts`, `at` = that
687
+ // day) and read the next morning, so a quiet daily read "due <yesterday>,
688
+ // every day" at every first wake, measured through the hooks, and held one
689
+ // of the two lines for good. A one-off's date is fixed, so a day-old render
690
+ // of it is still true. A plain daily is still said outright each day
691
+ // (`plainDue`), and a quiet one still cues recall on every turn.
644
692
  const items = considered.arrivals
645
693
  .filter((a) => a.precision === "day")
694
+ .filter((a) => a.recurring !== "daily")
646
695
  .filter((a) => !this.toldForGood(a))
647
696
  .slice(0, this.tunables.HORIZON_ITEMS);
648
697
  const reason: HorizonReason = items.length === 0 ? "nothing-arrived" : "selected";
@@ -689,7 +738,18 @@ export class Prospective {
689
738
  const at = input.at;
690
739
  const denied = new Set(this.store.deniedIds());
691
740
  const out: PlainDue[] = [];
692
- for (const dated of this.store.datedMemories(at, at)) {
741
+ // A REPEATING date is due on each occurrence (2026-10-09): the occurrence
742
+ // that falls on `at` stands in for the date, so its window key — and with
743
+ // it the latch per beat — is that occurrence's own.
744
+ const due: { id: string; eventDate: string }[] = [];
745
+ const repeating = new Set<string>();
746
+ for (const r of this.store.recurringMemories()) {
747
+ repeating.add(r.id);
748
+ const occurrence = occurrenceBetween(r.eventDate, r.recurring, at, at);
749
+ if (occurrence !== null) due.push({ id: r.id, eventDate: occurrence });
750
+ }
751
+ for (const d of this.store.datedMemories(at, at)) if (!repeating.has(d.id)) due.push(d);
752
+ for (const dated of due) {
693
753
  const id = dated.id;
694
754
  if (denied.has(id)) continue;
695
755
  const row = this.store.row(id);
@@ -749,6 +809,29 @@ export class Prospective {
749
809
  }
750
810
  }
751
811
 
812
+ /**
813
+ * IS THIS THE FIRST TIME THIS OCCURRENCE REACHES ANYONE? (2026-10-09.) True
814
+ * only for a memory whose date still REPEATS (`recurrenceOf`, read now — a
815
+ * one-off, or a repeat whose `recurring` was dropped, is always false) and
816
+ * whose `windowKey` nothing has delivered yet: no quiet fire spent on it and
817
+ * no plain beat told, on this memory or one its reminder moved from (the
818
+ * rows the brakes read, so a revision does not count the same occurrence
819
+ * twice). The caller asks BEFORE its `fire` or `claimPlain`, and counts the
820
+ * occurrence as a use of the memory only when that delivery lands
821
+ * (`Counterpart#creditOccurrence`). A read; firing state stays what it is,
822
+ * not canonical memory, and the physics write is the caller's.
823
+ */
824
+ occurrenceUndelivered(memoryId: string, windowKey: string): boolean {
825
+ if (this.observer) return false;
826
+ try {
827
+ if (recurrenceOf(this.store.read(memoryId).doc) === null) return false;
828
+ if ((this.firingRowsFor(memoryId).get(windowKey)?.fires ?? 0) > 0) return false;
829
+ return !this.plainTold(memoryId, windowKey, "day");
830
+ } catch {
831
+ return false;
832
+ }
833
+ }
834
+
752
835
  /** A PLAIN arrival whose window's LAST beat has been told: `day` for a day
753
836
  * item, `last-day` for a month or a range (`plainDue`'s beats). A quiet
754
837
  * arrival never is. A read. */
@@ -1271,6 +1354,8 @@ export class Prospective {
1271
1354
  // importance signal, so it skips the salience floor — never decay.
1272
1355
  explicitDate: explicit.length > 0,
1273
1356
  faded: s <= this.tunables.FADED_STRENGTH,
1357
+ // A live repeat is exempt from `faded` (review of #341, `derive.ts`).
1358
+ recurring: recurrenceOf(read.doc) !== null,
1274
1359
  },
1275
1360
  doc: read.doc,
1276
1361
  dates: dates.filter((d) => (seen.has(d.date) ? false : (seen.add(d.date), true))),
@@ -20,7 +20,8 @@
20
20
  * Pure: no ambient clock read anywhere in this file. The caller supplies `at`.
21
21
  * Every date is read by `core/time.ts#parseCalendarDate` (docs/time.md rule 1).
22
22
  */
23
- import { addDays, daysBetween, monthBounds, parseCalendarDate } from "../time.js";
23
+ import { addDays, daysBetween, isDay, monthBounds, occurrenceOf, occurrenceOnOrAfter, parseCalendarDate } from "../time.js";
24
+ import type { Recurrence } from "../time.js";
24
25
  import type { ProspectiveTunables } from "./tunables.js";
25
26
 
26
27
  /** As stated. `2026` / `2026-08` / `2026-08-25` / `2026-10-20..2026-10-31` —
@@ -55,6 +56,14 @@ export interface Window {
55
56
  readonly lastDay: string;
56
57
  /** Last calendar day the window is open (grace included). */
57
58
  readonly closesOn: string;
59
+ /**
60
+ * A RECURRING date's window (2026-10-09) is one occurrence of it: `eventDate`
61
+ * is that occurrence, and these two say what it is an occurrence OF — the
62
+ * day as stated and how often it comes round. Absent on a date that does
63
+ * not repeat.
64
+ */
65
+ readonly anchor?: string;
66
+ readonly recurring?: Recurrence;
58
67
  }
59
68
 
60
69
  /**
@@ -164,6 +173,68 @@ export function windowFor(
164
173
  };
165
174
  }
166
175
 
176
+ /**
177
+ * THE ONE WINDOW A RECURRING DATE HAS OPEN ON `at` (2026-10-09, the owner's
178
+ * design, held lightly) — or, when none is open, the next one, pending.
179
+ *
180
+ * Each occurrence is its own day window, keyed by its own date (`d:2027-05-14`),
181
+ * so every brake that is per window — the fire cap, once per lived day, the
182
+ * plain latch per beat, referenced-stop, and what a revision carries through
183
+ * `lineage` — is per OCCURRENCE without a line of its own: the birthday is
184
+ * told once each May 14, never once ever and never twice.
185
+ *
186
+ * **Two occurrences are never open together.** Lead and grace are a week and
187
+ * a half wide; a weekly or a daily date would otherwise have two to eleven
188
+ * windows open at once, each with its own fire budget. So an occurrence's
189
+ * window is cut where its neighbours' begin: it opens no earlier than the day
190
+ * after the previous occurrence, and closes the day before the next one opens
191
+ * — the coming one's lead wins over the last one's grace. A daily date's
192
+ * window is its day; a weekly one opens three days before and keeps three days
193
+ * of grace; monthly and yearly are untouched.
194
+ *
195
+ * Only a DAY repeats (`time.ts#occurrenceOf`). Anything else is null, and the
196
+ * caller treats the date as stated, once.
197
+ */
198
+ export function recurringWindowAt(
199
+ anchor: string,
200
+ rule: Recurrence,
201
+ at: string,
202
+ t: ProspectiveTunables,
203
+ salt = "",
204
+ ): Window | null {
205
+ if (!isDay(anchor) || !isDay(at)) return null;
206
+ const occ = (k: number): string | null => (k < 0 ? null : occurrenceOf(anchor, rule, k));
207
+ const opensOf = (k: number): string => {
208
+ const o = occ(k) as string;
209
+ const lead = addDays(o, -t.LEAD_DAYS);
210
+ const prev = occ(k - 1);
211
+ if (prev === null) return lead;
212
+ const after = addDays(prev, 1);
213
+ return lead > after ? lead : after;
214
+ };
215
+ const windowOf = (k: number): Window | null => {
216
+ const o = occ(k);
217
+ if (o === null) return null;
218
+ const w = windowFor(o, "day", t, salt);
219
+ if (w === null) return null;
220
+ const grace = addDays(o, t.GRACE_DAYS);
221
+ const nextOpens = addDays(opensOf(k + 1), -1);
222
+ return {
223
+ ...w,
224
+ opensOn: opensOf(k),
225
+ closesOn: grace < nextOpens ? grace : nextOpens,
226
+ anchor,
227
+ recurring: rule,
228
+ };
229
+ };
230
+ const next = occurrenceOnOrAfter(anchor, rule, at);
231
+ if (next === null) return null;
232
+ // Still in the last occurrence's grace, and the next one's lead not begun.
233
+ const last = windowOf(next.k - 1);
234
+ if (last !== null && at <= last.closesOn) return last;
235
+ return windowOf(next.k);
236
+ }
237
+
167
238
  /** ISO day keys sort lexically, so the comparisons below are the calendar order. */
168
239
  export function phaseOf(w: Window, at: string): Phase {
169
240
  if (at < w.opensOn) return "pending";
@@ -114,7 +114,10 @@ reply actually used reconsolidates, where in humans every retrieval does.
114
114
  model nothing but a title). Never for being named, surfaced, footnoted, or rendered in a
115
115
  wake; the `surfaced` and `footnoted` use tiers stay unused by this consumer. Agreement is
116
116
  not judged: a memory expanded and then argued with is credited. One durable row per
117
- boundary, `recall.credit`, with a `reason` readers split on.**
117
+ boundary, `recall.credit`, with a `reason` readers split on.** *Since 2026-10-09 that row
118
+ also scores what ambient recall showed since the session's last scored boundary: by
119
+ lane, how many a reply expanded or quoted and which it did not (NOTES §28). Measurement
120
+ only; nothing trains on a miss.*
118
121
  - **Framing is load-bearing and part of the spec** — footnotes are pointers, and the "quietly
119
122
  available / ignorable" phrasing is a deliberate probe question, at step 1 since 2026-09-14
120
123
  (§7 OQ4). [v1 §9 G17]
@@ -442,7 +445,8 @@ nothing about what is recallable or ranked moves. Episodes record their director
442
445
  citing one", after the model was measured asserting counts and characterizations of
443
446
  five footnoted memories from their titles without expanding any (IMPROVEMENTS U5). The
444
447
  measurement is `probe.ts` / `counterparts probe-oq4`: per calendar date, footnotes
445
- delivered (`recall.decision`) vs. later expanded by id (`recall.credit.expandedIds`).
448
+ delivered (`recall.decision`) vs. later expanded by id (`recall.credit.expandedIds`),
449
+ and since 2026-10-09 a hit rate by lane from the credit row's own score (NOTES §28).
446
450
  Reversible by one string; the owner rules on the reading, not this file.
447
451
  5. ~~**The absolute floors have never fired in v2, and the loud tier needs them.**~~
448
452
  **ANSWERED 2026-09-04. The floors are in cue units now, and the "cue-count half" was
@@ -50,7 +50,14 @@ store read (`aliasesFor(token)` or `ambiguousHandles()`) that recall consults it
50
50
  Until then a caller that forgets the map silently loses the safety half — which is
51
51
  exactly the scar §2.6 shape, so this gap is the one to close first.
52
52
 
53
- ## 3. No document-frequency statistics on the cache — idf is approximated by probing
53
+ **The borrowed map, closed 2026-08-25 (noted 2026-10-09):** the composition root supplies
54
+ it. `core/retrieval.ts#composeTurn` sets `aliases` from `schemas.aliasMap()` (`d88f957`,
55
+ the wave-3 seam pass; schemas INTERFACE-GAPS §3), and `Counterpart`'s turn goes through
56
+ `recallTurn`, so that caller cannot forget it; `test/seams.test.ts` proves the composed
57
+ turn refuses the credit. The real fix above, a box-2 alias table recall reads itself, is
58
+ not built.
59
+
60
+ ## 3. No document-frequency statistics on the cache — idf is approximated by probing — CLOSED 2026-09-04 (noted 2026-10-09)
54
61
 
55
62
  **Owner:** `store/` (box 3).
56
63
  **Needed:** rarity weighting (§9 G4) needs `df(token)` over the index.
@@ -69,6 +76,11 @@ joined box 3 (cache schema v3) and `Store.search(cue, limit, norm)` takes the no
69
76
  constants, so the cue channel no longer has to pretend every document is the same size. The
70
77
  `df` half above is unchanged.
71
78
 
79
+ **The `df` half, closed 2026-09-04 (noted 2026-10-09):** `Store.docFrequency(tokens)` is
80
+ the single `GROUP BY token` over `doc_tokens` (`store/cache.ts#docFrequency`), and
81
+ `activate.ts` asks it for rarity before it probes for postings (`9991dec`, #28). The
82
+ workaround above is gone.
83
+
72
84
  ## 3a. `doc_tokens` outlives the memory — removed rows still count in `df` and `avgLen`
73
85
 
74
86
  **Closed 2026-09-24** — `store/cache.ts#deindexDoc` drops `doc_tokens` and `doc_lens` at archive and supersede; a removal rebuilds the cache (`cli/removal.ts`). A dead row's vector is a separate note (`recall/NOTES.md` §13).
@@ -85,6 +97,10 @@ where the deny-list entry is already written.
85
97
 
86
98
  ## 4. The observer predicate lives in `store/`
87
99
 
100
+ **Closed 2026-08-25 (noted 2026-10-09)** — the predicate lives in `src/core/observer.ts`
101
+ (hoisted in the wave-3 seam pass, `d88f957`), and `Recall.observer` still reads
102
+ `store.observer`, as below. Associate §8 closed the same way.
103
+
88
104
  Not a defect, and recorded so nobody "fixes" it: `Recall.observer` reads
89
105
  `store.observer` and never re-derives the predicate. `docs/observer-mode.md` G7 says a
90
106
  second definition is a leak waiting to happen — v1 shipped exactly that. If a second core
@@ -98,7 +114,7 @@ the store seam. Deciding which memories the reply actually used — assistant tu
98
114
  no model, no file reads, precision over recall — is §9.2's rule and was not implemented
99
115
  anywhere. **Closed:** `recall/reference.ts` decides (pure; expansions from recall tool
100
116
  calls, verbatim eight-word windows against what surfaced loud), `Counterpart.creditReferences`
101
- applies it through `resolveUses`, and `adapters/claude-code/hooks.ts#creditAtBoundary` calls
117
+ applies it through `resolveUses`, and `adapters/lifecycle.ts#creditAtBoundary` calls
102
118
  it on the slice capture just took, at every session-ending hook. Measured before the close
103
119
  (IMPROVEMENTS U10): 1,374 memories minted since launch, all at `uses = 0`. Proof:
104
120
  `test/lifecycle.test.ts` — the lifecycle through the adapter, the two fixtures (ids named
@@ -148,7 +164,8 @@ lagged cue itself (the hook does not embed the turn — `hooks.ts`'s to change,
148
164
  0.03 ms it now could). The MCP server's `note` no longer writes vectorless under the
149
165
  static table: `openServer` now hands the server's store the embedder's sync face and
150
166
  identity (mcp INTERFACE-GAPS §7's option 1, taken in #190 — that page still describes
151
- the gap as open and is its owner's to close).
167
+ the gap as open and is its owner's to close). *(Noted 2026-10-09: mcp §7 has read
168
+ CLOSED 2026-09-23 (#190) since #195.)*
152
169
 
153
170
  ## 7. Box 3 is 278 MB and 65% of it is JSON punctuation — NAMED, not fixed here
154
171
 
@@ -260,7 +277,10 @@ slips, lexical 10/10). Every number, the grid and the confirmation run:
260
277
  - One synthetic persona and builder-written queries; a lag embedded from the question
261
278
  alone; one topic-change partner per query.
262
279
  - The MCP `recall` tool builds rather than records, so its pair rides `BuildOutput.semantic`
263
- but reaches no telemetry ring until `server.ts` logs it.
280
+ but reaches no telemetry ring until `server.ts` logs it. *(Noted 2026-10-09: the premise
281
+ is gone. Since #323 (2026-10-03) a question goes to facts or meaning mode, neither of
282
+ which calls `Recall.build()`; the `mcp.recall` row names the semantic source, not the
283
+ floor and weight.)*
264
284
 
265
285
  ## 9. Whether a quiet pointer was USED is measured on one host only — OPEN 2026-09-28
266
286
 
@@ -272,6 +292,10 @@ pass shows pointers and never says whether they were used. Also: a pointer the m
272
292
  reads by title (a handle) counts only if the handle log translated it (G50), as for any
273
293
  expansion.
274
294
 
295
+ Since 2026-10-09 the same row scores every ambient showing, used or not, by lane (NOTES
296
+ §28), so recall's hit rate has the same reach: recorded where the credit pass runs, and
297
+ nowhere else.
298
+
275
299
  ## 10. Standing labels reach recall and ask, not the wake's lanes — CLOSED 2026-09-29
276
300
 
277
301
  `standing.ts` labels the ambient injection and the deliberate path (MCP `recall`, the