counterparts 0.3.26 → 0.3.28

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 (103) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/docs/QUICKSTART.md +6 -0
  3. package/docs/README.md +3 -1
  4. package/package.json +1 -1
  5. package/src/adapters/claude-code/CONTRACT.md +21 -3
  6. package/src/adapters/claude-code/bin/hook.ts +2 -0
  7. package/src/adapters/claude-code/bin/runner.ts +46 -1
  8. package/src/adapters/claude-code/doctor-feedback.ts +104 -0
  9. package/src/adapters/claude-code/doctor.ts +19 -4
  10. package/src/adapters/claude-code/embed-client.ts +16 -1
  11. package/src/adapters/claude-code/hooks.ts +25 -6
  12. package/src/adapters/claude-code/night-run.ts +8 -0
  13. package/src/adapters/claude-code/transcript.ts +28 -1
  14. package/src/adapters/claude-code/vectors.ts +6 -0
  15. package/src/adapters/cli/CONTRACT.md +7 -0
  16. package/src/adapters/cli/commands-note.ts +8 -0
  17. package/src/adapters/cli/commands-readings.ts +1 -1
  18. package/src/adapters/cli/commands-self.ts +53 -1
  19. package/src/adapters/cli/commands.ts +18 -0
  20. package/src/adapters/cli/dream-core.ts +16 -6
  21. package/src/adapters/cli/help.ts +5 -1
  22. package/src/adapters/dashboard/CONTRACT.md +5 -2
  23. package/src/adapters/dashboard/registries.ts +3 -3
  24. package/src/adapters/dashboard/web/narrate.ts +4 -0
  25. package/src/adapters/fired.ts +7 -2
  26. package/src/adapters/lifecycle.ts +104 -9
  27. package/src/adapters/mcp/CONTRACT.md +44 -2
  28. package/src/adapters/mcp/NOTES.md +42 -0
  29. package/src/adapters/mcp/deliberate.ts +25 -1
  30. package/src/adapters/mcp/facts.ts +209 -14
  31. package/src/adapters/mcp/nights.ts +283 -0
  32. package/src/adapters/mcp/server-args.ts +42 -2
  33. package/src/adapters/mcp/server-self-tools.ts +35 -9
  34. package/src/adapters/mcp/server-session-end.ts +13 -6
  35. package/src/adapters/mcp/server-words.ts +12 -3
  36. package/src/adapters/mcp/server.ts +90 -13
  37. package/src/adapters/mcp/tools.ts +49 -28
  38. package/src/adapters/snapshots.ts +101 -2
  39. package/src/adapters/store-id.ts +68 -1
  40. package/src/core/associate/CONTRACT.md +20 -0
  41. package/src/core/associate/at-write.ts +4 -0
  42. package/src/core/associate/index.ts +60 -0
  43. package/src/core/associate/tunables.ts +46 -2
  44. package/src/core/briefing.ts +19 -1
  45. package/src/core/counterpart-boundary.ts +4 -0
  46. package/src/core/counterpart-deposit.ts +83 -2
  47. package/src/core/counterpart-events.ts +46 -2
  48. package/src/core/counterpart-types.ts +73 -1
  49. package/src/core/counterpart.ts +729 -111
  50. package/src/core/dream/CONTRACT.md +71 -4
  51. package/src/core/dream/NOTES.md +119 -0
  52. package/src/core/dream/core-ask.ts +134 -0
  53. package/src/core/dream/day.ts +199 -0
  54. package/src/core/dream/index.ts +76 -5
  55. package/src/core/dream/reflect.ts +493 -65
  56. package/src/core/dream/tunables.ts +31 -0
  57. package/src/core/embed/static.ts +27 -0
  58. package/src/core/handoff/CONTRACT.md +28 -1
  59. package/src/core/handoff/NOTES.md +86 -0
  60. package/src/core/handoff/last-here.ts +267 -59
  61. package/src/core/mint.ts +11 -0
  62. package/src/core/onboarding.ts +2 -1
  63. package/src/core/physics/CONTRACT.md +28 -2
  64. package/src/core/physics/index.ts +92 -8
  65. package/src/core/prospective/CONTRACT.md +11 -2
  66. package/src/core/prospective/NOTES.md +64 -0
  67. package/src/core/prospective/index.ts +143 -4
  68. package/src/core/recall/CONTRACT.md +109 -8
  69. package/src/core/recall/NOTES.md +53 -0
  70. package/src/core/recall/activate.ts +197 -8
  71. package/src/core/recall/cues.ts +94 -21
  72. package/src/core/recall/gate.ts +114 -16
  73. package/src/core/recall/habituation.ts +150 -0
  74. package/src/core/recall/index.ts +203 -22
  75. package/src/core/recall/prime.ts +450 -0
  76. package/src/core/recall/probe.ts +5 -4
  77. package/src/core/recall/rated.ts +172 -9
  78. package/src/core/recall/session.ts +93 -7
  79. package/src/core/recall/time-ask.ts +36 -6
  80. package/src/core/recall/tunables.ts +125 -1
  81. package/src/core/reconsolidation.ts +21 -6
  82. package/src/core/retrieval.ts +9 -0
  83. package/src/core/schemas/NOTES.md +2 -1
  84. package/src/core/self/CONTRACT.md +31 -4
  85. package/src/core/self/NOTES.md +113 -0
  86. package/src/core/self/briefing-delivery.ts +49 -0
  87. package/src/core/self/briefing.ts +20 -3
  88. package/src/core/self/identity.ts +23 -4
  89. package/src/core/self/index.ts +252 -5
  90. package/src/core/self/tunables.ts +24 -0
  91. package/src/core/self/writer.ts +20 -8
  92. package/src/core/sleep/CONTRACT.md +7 -1
  93. package/src/core/sleep/consolidate.ts +20 -5
  94. package/src/core/sleep/core-standing.ts +50 -3
  95. package/src/core/sleep/index.ts +1 -1
  96. package/src/core/sleep/tunables.ts +13 -0
  97. package/src/core/store/CONTRACT.md +20 -0
  98. package/src/core/store/NOTES.md +4 -1
  99. package/src/core/store/cache.ts +181 -5
  100. package/src/core/store/index.ts +208 -23
  101. package/src/core/store/reads-memories.ts +92 -2
  102. package/src/core/store/shapes.ts +8 -0
  103. package/src/core/store/stem.ts +166 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,163 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.28 — 2026-10-20
4
+
5
+ The morning share now closes the open threads that are plainly done, and says which and why; say one isn't done and it is reopened. The session-start wake repeats nothing: each session is named once, and "Today, elsewhere" and a new "Here, also open" say by title what the other open sessions are working on. Saying "done" to a weekly reminder closes just this week; it comes back on its next date. Last night's dream and reflection open by their ids, and `counterparts night` reads them without changing anything. The nightly run keeps the self page within its 4,600-byte room, the reflection answers core memories that have waited a week for keep or retire, and facts list the next twenty matches by title. Most of these are experiments, to be checked in a few days. If you use the plugin, update it with this release: the wake's head is now one tag, and a plugin of 0.3.27 or earlier reads the meeting and the store as unknown until it is updated, so its sidebar footer offers the 5-minute intro again and it skips its store check. No store-format change (store v13, cache v7) and no wiring change: nothing to run after upgrading from 0.3.27, and `counterparts connect` is not needed.
6
+
7
+ - **The nightly reflection closes open threads that are plainly done, and tells you, as an
8
+ experiment.** When a memory shows a thing finished, it closes the thread itself and the
9
+ morning share names it with why; say it isn't done and it is reopened, and then only
10
+ ever asked about. Threads it is unsure of, and private ones, are still asked about, as
11
+ before.
12
+ - **Last night opens by its id.** Recall now reads a dream's id (`drm_…`) or a
13
+ reflection's (`rfl_…`) — the ids the morning wake and the share name — as a short,
14
+ read-only summary: what the dream did, the memories it touched and its gists; the
15
+ reflection's entry, its share and whether it was told, what it cited, and any closes.
16
+ Opening one changes nothing. A night that rests on a confidential memory is withheld from
17
+ a session that isn't yours, and says so.
18
+ - **`counterparts night` reads the nights and changes nothing.** The recent dreams and
19
+ reflections, `last`, `last-reflection`, or one by id — the same lines as `dream --show`,
20
+ from a command with no undo, so a session can run it with you. Undo stays on
21
+ `counterparts dream`.
22
+ - **A weekly reminder can be marked done for this week.** Saying a repeating reminder was done
23
+ (a memory that updates it with `status: "done"`) closes just this time: it stops coming up
24
+ today, the reminder keeps its date and repeat, and it comes back on its next date. The answer
25
+ says which day was closed and when it returns. Dropping the date (`eventDate: null`) still
26
+ ends the repeat.
27
+ - **A "done" note written on its own points at the reminder it answers.** When a memory saying
28
+ something was done (or that you said it) lands next to a reminder due now, the answer names
29
+ the reminder and how to close it.
30
+ - **A memory a session just replaced still counts as drawn on.** Naming in `drewOn` a memory the
31
+ same session had just updated with a newer one (or one replaced that day) no longer refuses it.
32
+ One put away by a correction is still refused.
33
+ - **The session-start wake names each session once.** The Yesterday line leaves the newest
34
+ chapter written in this folder to "Last here", and "Last here"'s "Before it" and "+N more
35
+ here" lines, and the chapter-about-me line, leave out what Yesterday already names. A
36
+ Yesterday chapter with no room for its title is counted ("and 3 more"), never printed as a
37
+ bare id.
38
+ - **One tag at the top of the wake.** The meeting's state and the store's id are now fields of
39
+ the wake's own opening comment (`<!-- counterparts:wake meet=done store=st_… elements=…
40
+ bytes=… -->`), or of one `<!-- counterparts:session … -->` tag when there is no wake to
41
+ carry them. The sidebar reads both forms. An older sidebar (plugin 0.3.27 or before) reads
42
+ them as unknown until the plugin is updated: it skips its store check and keeps the
43
+ "5-minute intro" line in its footer.
44
+ - **The chapter-about-me line says where it is from first**: "A chapter about me from
45
+ ~/site: session …, Oct 19 — "…" (epi_…)."
46
+ - **"Coming up" at a session start lists what is due today.** A plain reminder due tomorrow is
47
+ counted with the other dates, as the evening's bundle still lists it for the next morning.
48
+ Every "Coming up" item now carries its own id, beside any "(earlier: …)" pointer.
49
+ - **One backup a day, even when two background runs start at once.** The daily snapshot
50
+ claims the day before it copies, so two runs at one boundary no longer leave two copies.
51
+ - **The nightly page writer and reflection keep your self page within its 4,600-byte room,
52
+ as an experiment.** The night's first page past the room is sent back to be cut, with how
53
+ many bytes over, rather than kept with a short version. A second try is kept, and a page
54
+ that was never sent again is kept when the night ends, so a night's rewrite is never lost.
55
+ A page past the room that has a short version now shows the short version in the wake, so
56
+ the lists beside it keep their room. Pages you or a session write are not held.
57
+ - **A core memory that has waited a week for "keep or retire" gets answered, as an
58
+ experiment.** The nightly reflection is offered up to three that have waited 7 lived
59
+ days, decides the ones it can with a reason, and the morning share says which, in one
60
+ line. Say one was wrong and it is undone: a memory a reflection retired comes back into
61
+ the core with a keep (`counterparts core --reaffirm <id> --reason "..."`, or just say
62
+ so in a session). Agree with one instead (`counterparts core --demote <id>`) and it
63
+ is recorded as your retire, which no session can undo; your own `--reaffirm` still
64
+ can. The wake's "Still open" leads with a week-old one, and still says
65
+ "keep or retire it" when the memory is also unsettled. Doctor's Reflection line counts
66
+ the ones waiting.
67
+ - **Asking for facts also lists the next matches by title.** After the ten results, the next
68
+ twenty are listed one line each (title, id and date), so a memory ranked a little lower is in
69
+ sight and can be opened by its id without asking for page 2. Being listed doesn't strengthen
70
+ a memory; opening it does.
71
+ - **"Lately" and "recently" no longer hide older facts.** A facts question with "lately",
72
+ "recently", "these days" or "nowadays" ranks the past week's matches first instead of keeping
73
+ only those, and says so. "What happened lately?" on its own still means the past week, and
74
+ "last week" or "in September" still keep only that time.
75
+ - **The sidebar's fox stays up while Claude is working, as an experiment.** Any tool call,
76
+ including one waiting on a permission prompt, starts his idle clock over, so he no longer
77
+ lies down or naps in the middle of a long call; he lies down at 45 seconds and naps at 2
78
+ minutes after the last activity, as before. A memory saved from a session shows his
79
+ notepad once.
80
+ - **"Today, elsewhere" and "Since you started" say what the other sessions are working on.**
81
+ Beside each folder's memory count they name up to two of its memories by title and id,
82
+ work in progress first ("planned" or "done" marks, then work memories), newest first:
83
+ `~/random open since 08:33 (live), 8 memories: "Wake check 10-20" (mem_…), "Spans out of
84
+ backups" (mem_…)`. Other sessions open in the same folder get a clause of their own:
85
+ `Here, also open: session 25e12e7d on Fable 5 since 10:05: "…" (mem_…)`. Never from a
86
+ folder that is off, paused or observed, never a confidential memory, a dated one, one about
87
+ you, about the two of you or about your counterpart itself, or small talk. "Since you
88
+ started" names only what was written since it last told you. Both lines stay within their
89
+ old size.
90
+
91
+ ## 0.3.27 — 2026-10-19
92
+
93
+ Recall learns from use, and finds "baking" when you say "bake". The memories a session rates useful, draws on or opens count as used, memories found useful together get linked, and one rated noise twice comes up less for a while; what the conversation has been about, and what is open in its folder, gives related memories a head start. Recall matches word forms and counts everyday words for less, a session's first prompt is matched by meaning too, footnotes skip what this session wrote, and a newer memory stands in for the one it replaced. Most of these are experiments, to be checked in a few days. `counterparts doctor` gains a Feedback loop line. No store migration (store v13) and no wiring change, so `counterparts connect` is not needed; the word index re-indexes itself once in the background (cache v6 to v7, under a second on a typical store). Going back to 0.3.26 is not a plain reinstall: its memory tools refuse the newer cache, and its hooks miss word matches without saying so. To go back, delete `~/.counterparts/store/cache/cache.sqlite*`, then run `counterparts verify --rebuild --keep-vectors --dir ~/.counterparts/store` on 0.3.26 (recall by meaning comes back over the next few sessions, as the background worker re-reads the memories); `counterparts rollback` does not cover a cache change.
94
+
95
+ - **Recall by meaning works on a session's first prompt.** Until now the first prompt of a
96
+ session, and any prompt whose background cue from the turn before wasn't ready, was
97
+ matched by words only. Those prompts are now matched by meaning too, computed on the spot
98
+ with the same local table. It adds a few tens of milliseconds on a typical store.
99
+ - **Asking for facts ignores "how many" and "how often" wording.** Words like "many",
100
+ "much", "often", "typical" and "usually" no longer count as part of what the question is
101
+ about, so they stop pulling in memories that merely contain them.
102
+ - **Footnotes no longer repeat what this session just wrote (an experiment).** A memory
103
+ written in the current conversation is already in front of the model, so it no longer
104
+ comes back as a footnote or a "came to mind" line there. After the conversation is
105
+ compacted, what it wrote before the compaction can come back again. Asking for a memory on
106
+ purpose still finds it.
107
+ - **The nightly dream replays what the day used (an experiment).** Memories the day opened,
108
+ quoted, drew on or rated useful are handed to the night's dream, even ones it already
109
+ dreamed over, with the ones that changed what was said first, and pairs used together
110
+ listed for it to link.
111
+ - **The nightly run's own sessions get no footnotes (an experiment).** The background
112
+ sessions that dream and reflect overnight are no longer handed memories at their first
113
+ prompt; they read what they need on purpose.
114
+ - **Rating what you were shown now counts, as an experiment.** When a session rates the
115
+ memories it was shown at the end, a 3 counts as a full use of the memory, a 2 most of one,
116
+ a 1 a little, and a footnote left unrated a glimpse; a 0 counts nothing. Used memories fade
117
+ more slowly, as before. This is deliberately strong so its effect can be seen, and will be
118
+ tuned after a few days.
119
+ - **A memory a session says it drew on counts as a full use, as an experiment.** Naming it
120
+ in `drewOn` now counts like opening it (it was half a use); still once a day, at most three
121
+ per boundary.
122
+ - **Memories found useful together get linked strongly.** Two memories rated useful (or
123
+ opened, quoted or drawn on) since the session last rated are linked strongly enough that
124
+ the second time it happens, one can bring the other to mind as a quiet pointer. Memories
125
+ shown on the same turn get a faint link, unless one was rated noise.
126
+ - **A memory rated noise twice comes up less for a while.** Rated 0 in two sessions within
127
+ a week, it needs a closer match to show as a footnote. It recovers when those ratings are
128
+ a week old, or at once when a later session rates it useful.
129
+ - **`counterparts doctor` has a Feedback loop line** with what the ratings credited by
130
+ score, the pairs they linked, the links now strong enough to show as pointers, and how
131
+ many memories are holding back as noise.
132
+ - **An earlier version of a memory no longer shows without the one that replaced it.** When
133
+ a turn's words lean towards a memory that a newer one has settled over, the newer one now
134
+ shows in its place (labelled with the earlier one), where before the earlier one could
135
+ slip through on its own as a quiet footnote. If the newer one doesn't clear the bar, the
136
+ earlier one stays out too. If the newer one was written in this same
137
+ session, neither is shown, since it's already in the conversation. This is a trial, to be
138
+ checked in a few days.
139
+ - **A new memory is no longer linked to what was shown when it was written, as an
140
+ experiment.** These faint links were almost never confirmed by use and mostly noise, and
141
+ memories found useful together are now linked by ratings instead. Links between memories
142
+ written one after another stay, and the links already made fade on their own.
143
+ - **A memory that looks like an older one's update no longer fades the older one right away,
144
+ as an experiment.** It is still marked "may be out of date" and the nightly dream is asked
145
+ to confirm it; only a confirmation fades it. The guess was wrong too often to cost the
146
+ older memory anything before then.
147
+ - **Recall matches word forms and quiets everyday words (an experiment).** A prompt that
148
+ says "bake" now finds a memory that says "baking" or "baked", and words like "any",
149
+ "what" or "you" count for much less when deciding what a prompt is about. This applies to
150
+ recall as you work and to asking for facts. The first time the background worker runs
151
+ after the update it re-indexes the words of your memories (under a second on a typical
152
+ store); until then recall matches both the old and the new word forms.
153
+ - **Recall follows the conversation's train of thought (an experiment).** What a
154
+ conversation has been about, what it opened, rated useful or wrote, and what was left
155
+ open in its folder now give related memories a head start, so they win close calls they
156
+ used to lose. Only memories the current message already touches can get one, a memory
157
+ the conversation wrote itself is still never handed back, and the head start fades
158
+ within a few messages once the topic moves on. A conversation's first message, with
159
+ nothing open in its folder, is recalled exactly as before.
160
+
3
161
  ## 0.3.26 — 2026-10-18
4
162
 
5
163
  The wake leads with what is live. "Still open" puts the questions touched in the last two weeks first and counts how many of the rest have gone untouched; a stale handoff says how stale it is in one sentence, and when every handoff listed is stale only the newest shows whole; the Yesterday line names the other folders worked in instead of counting them; and a session still open from an earlier day says its start with the date. Doctor reads mood matching, switched off since 10-10, as disabled rather than amber. No store-format change (store v13, cache v6) and no wiring change: nothing to run after upgrading from 0.3.25, and `counterparts connect` is not needed.
@@ -156,6 +156,12 @@ Then go back in this order. The other order breaks every hook, and the older ver
156
156
  3. `counterparts connect`.
157
157
  4. If you connected Claude Desktop: quit it, then run `counterparts install --host claude-desktop`.
158
158
 
159
+ Going from 0.3.27 or later back to 0.3.26 or earlier also needs the search index rebuilt,
160
+ because 0.3.27 changed its format and `rollback` does not cover it. After step 2, delete
161
+ `~/.counterparts/store/cache/cache.sqlite` (and the `cache.sqlite-wal` and
162
+ `cache.sqlite-shm` beside it), then run `counterparts verify --rebuild --keep-vectors
163
+ --dir ~/.counterparts/store`. Recall by meaning comes back over the next few sessions.
164
+
159
165
  ## Start over
160
166
 
161
167
  To set your memory aside and start with a blank one, close every Claude Code session and
package/docs/README.md CHANGED
@@ -15,7 +15,9 @@ has it; every other page is a working default or a record of what happened.
15
15
 
16
16
  ## Where the work is going
17
17
 
18
- - [`ROADMAP.md`](ROADMAP.md) — the plan for the current round.
18
+ - [`ROADMAP.md`](ROADMAP.md) — the plan for the current round, one line per thing to do.
19
+ - [`WORKLIST.md`](WORKLIST.md) — the details behind the roadmap's to-do list.
20
+ - [`CHECK-AFTER.md`](CHECK-AFTER.md) — experiments in use, each with a date to check.
19
21
  - `HANDOFF.md` — the note one session leaves for the next. It is written locally and is not in
20
22
  the repository (ignored since 2026-10-02).
21
23
  - [`IMPROVEMENTS.md`](IMPROVEMENTS.md) — things noticed while living on it, as opposed to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "license": "MIT",
5
5
  "description": "Memory that turns AI tools into counterparts - a local-first, human-memory-modeled memory layer for AI.",
6
6
  "repository": {
@@ -324,6 +324,11 @@ row, saying which source answered, existed until the keys were removed — §1a.
324
324
  reappear. **The RANKING travels with the cue, not the vector**: `Store.nearestTo`
325
325
  over a live-sized index measured 590-1040 ms, so carrying a vector would have moved
326
326
  the network call off the hot path and left the scan on it.
327
+ **Amended 2026-10-19:** the prompt path still opens no socket, but a turn the lag never
328
+ reached (a session's first prompt, or a stale row) embeds its own text with the store's
329
+ local table and ranks it in line (`recall/session.ts#inLineSemantic`, recorded
330
+ `in-line`): ~18 ms cold on the live store's 2,207 vectors, where the 590-1040 ms above
331
+ was v1's JSON vectors.
327
332
  **It runs on EVERY boundary, outside the sweep gate and regardless of its verdict**,
328
333
  and `stop()`/`sessionEnd()` spawn the worker unconditionally. The crash gate (open
329
334
  question 3, answered) decides whether a *SWEEP* selects anything — its ordinary
@@ -408,7 +413,9 @@ row, saying which source answered, existed until the keys were removed — §1a.
408
413
  **AND, AT A PROMPT, WHAT CHANGED SINCE (2026-10-11).** A session already open
409
414
  never reads a wake again, so `userPromptSubmit` may add one "Since you started"
410
415
  line for the model (`Lifecycle#sinceLine` → `Counterpart#sinceElsewhere`): another
411
- directory's session started or ended, a chapter, new memories, since this session
416
+ directory's session started or ended, a chapter, new memories (since 2026-10-20 up
417
+ to two by title, only ones written since the line last told; and another session
418
+ open in this same folder that started or wrote something), since this session
412
419
  last heard. The same gate as "Today, elsewhere" (`elsewhereGate`, one code path)
413
420
  and the same registry hand-over (`elsewhereHere`). At most once an hour, never at
414
421
  the first prompt after a wake; the state is the session record's `sinceSeen`
@@ -623,7 +630,12 @@ row, saying which source answered, existed until the keys were removed — §1a.
623
630
  as "delete them all"); and **a half-copy is never a snapshot** — the copy is
624
631
  written under a `.partial-…` name and renamed into place, so a worker killed
625
632
  mid-copy leaves something that is not counted toward `keep`, does not satisfy
626
- "today's exists", and is swept once it is too old to be a live run's.
633
+ "today's exists", and is swept once it is too old to be a live run's. **One copy
634
+ a day when two runs start together** (2026-10-20): a run claims the day first
635
+ (`.taking-<date>`, a file created exclusively), looks again under the claim, and
636
+ lets it go once its copy is in place or has failed; the run that finds the claim
637
+ held writes nothing (`already-today`). A killed run's claim is stale, and taken
638
+ over or swept, by the partials' bound.
627
639
 
628
640
  *For now:* the default directory applies only inside the layout this package
629
641
  creates (the store is the `store/` subdirectory of a base directory). A store
@@ -867,7 +879,13 @@ whose liveness check refuses a session left open overnight (review of #282, find
867
879
  child's own session (`--session-id`, host-minted before 2026-10-09) is QUIET (`HookInput.nightRun`, from
868
880
  `COUNTERPARTS_NIGHT_RUN`): its hooks capture nothing (so it owes no write-up) and give no dream
869
881
  lines, plain reminders, Stop ask, write-up pointer or first-launch question. It still wakes
870
- with the ordinary wake.
882
+ with the ordinary wake. *Experiment started 2026-10-19 (feedback-loop build, part F; check on
883
+ ~10-22):* trying its prompt with **no ambient recall** either — no "came to mind", no footnotes, no quiet
884
+ pointers, no `recall.decision` row (`hooks.ts#userPromptSubmit`, reason `night-run`); only
885
+ the clock line — to see that night sessions stop showing up with footnotes in the day's
886
+ numbers. Before, only its temporal cues stood down (#453) and each child's launch prompt was
887
+ handed footnotes that landed in its gate state as shown. The run still reads memories on
888
+ purpose through its tools. Revert by deleting the `nightRun` early return.
871
889
 
872
890
  **[M] The catch-up runs first, and takes everything owed (2026-10-01, wake build 3; unbounded 2026-10-11 — held lightly).** A `night`
873
891
  run (never a reflection-alone one) writes up owed stretches, in ANY directory, before it
@@ -520,6 +520,8 @@ export function toHookInput(
520
520
  ...(transcriptPath === undefined ? {} : { transcriptPath }),
521
521
  // The model that last answered, for the session record (and so the chapter).
522
522
  ...(transcript.model === undefined ? {} : { model: transcript.model }),
523
+ // The last compaction, for the echo skip's window (2026-10-19, part C).
524
+ ...(transcript.compactedAt === undefined ? {} : { compactedAt: transcript.compactedAt }),
523
525
  // The host's re-fire of a blocked Stop, carried INTO the adapter and not
524
526
  // only handled at delivery: the pass that says nothing must also advance
525
527
  // nothing (`hooks.ts#askAtStop`).
@@ -72,6 +72,7 @@ import { fileURLToPath } from "node:url";
72
72
 
73
73
  import { Counterpart, RUNNER_FAILED_EVENT } from "../../../core/counterpart.js";
74
74
  import { recordCoverage } from "../../../core/coverage/index.js";
75
+ import { PAGE_HELD_SETTLE_MS } from "../../../core/self/index.js";
75
76
  import { clearIdleCarries } from "../../../core/recall/index.js";
76
77
  import { RETENTION_EVENT, retentionRow, retentionRuns } from "../../../core/remember/index.js";
77
78
  import type { HostSessionEvidence, RetentionReport } from "../../../core/remember/index.js";
@@ -127,6 +128,11 @@ export function runnerConfigChoice(
127
128
  return resolveConfigPath(argv, env as Record<string, string | undefined>);
128
129
  }
129
130
 
131
+ /** One run's share of the word index re-stem (v7): enough for a live-sized
132
+ * store in one run (the diagnosis's full rebuild, vectors and all, was 3.3 s),
133
+ * small enough that a run on a far larger store stops and resumes. */
134
+ const RESTEM_BUDGET_MS = 5_000;
135
+
130
136
  export interface RunReport {
131
137
  readonly ran: boolean;
132
138
  /** `ran` covers the keyless run too: the day HAPPENED, minus the sweep. The
@@ -145,6 +151,9 @@ export interface RunReport {
145
151
  /** The day's retention pass, or why it did not run. Null when the run refused
146
152
  * before it opened a store at all. */
147
153
  readonly retention: RetentionJobReport | null;
154
+ /** The word index's re-stem (v7 cache, 2026-10-19, an experiment), when this
155
+ * run did any: absent on an index that was already stemmed. */
156
+ readonly terms?: { readonly ready: boolean; readonly examined: number; readonly changed: number; readonly ms: number };
148
157
  /** The sidebar's status file (`adapters/sidebar-status.ts`), written after the
149
158
  * store closed; absent when the run was not asked to (no configuration path). */
150
159
  readonly sidebar?: SidebarWrite;
@@ -394,6 +403,22 @@ export async function runOnce(input: {
394
403
  noteFailure(counterpart, emit, code, "vectors", today);
395
404
  }
396
405
 
406
+ // 0c. THE WORD INDEX RE-STEM (v7 cache, 2026-10-19, an experiment; check
407
+ // ~10-22). A cache migrated from v6 holds surface words until this step
408
+ // re-stems it — bounded per run, resumable, never at open (a hook cannot pay
409
+ // for it). Until it finishes, lookups ask for both forms, so nothing is lost
410
+ // meanwhile. A no-op on an index that is already stemmed.
411
+ let terms: RunReport["terms"];
412
+ try {
413
+ const r = counterpart.store.restemIndex({ budgetMs: RESTEM_BUDGET_MS });
414
+ if (r.examined > 0) {
415
+ terms = r;
416
+ emit("runner.terms", { ready: r.ready, examined: r.examined, changed: r.changed, ms: r.ms });
417
+ }
418
+ } catch (err) {
419
+ noteFailure(counterpart, emit, err instanceof Error ? err.name : "UNKNOWN", "terms", today);
420
+ }
421
+
397
422
  // Step 4's answer, filled in the `finally` below and joined to whichever of
398
423
  // the two results the boundary produced. A `let` rather than a fourth return
399
424
  // arm because the copy must happen on BOTH paths and before `close()`.
@@ -430,13 +455,33 @@ export async function runOnce(input: {
430
455
  // render re-renders it now, not at the next lived day. After the cycle, whose own render already caught up to what was
431
456
  // marked before it; nothing marked, nothing rendered.
432
457
  // Its own try: a render that fails costs the refresh, and the mark stays.
458
+ // First, A HELD PAGE NO RUN END KEPT (review of #541): a night launched
459
+ // from a session (the default `ask`) or a run killed after the hold never
460
+ // reaches `runNight`'s keep, so a boundary keeps it once it has settled —
461
+ // only while the page still stands where it was held.
462
+ try {
463
+ counterpart.self.keepHeldPage({ settledMs: PAGE_HELD_SETTLE_MS });
464
+ } catch {
465
+ /* the held page stays on its refusal row for the next boundary */
466
+ }
433
467
  try {
434
468
  const wake = counterpart.refreshWake({ at: today });
435
469
  if (wake.reason !== "current") emit("runner.wake", { reason: wake.reason, triggers: wake.triggers.join(","), bytes: wake.bytes });
436
470
  } catch (err) {
437
471
  noteFailure(counterpart, emit, err instanceof Error ? err.name : "UNKNOWN", "wake", today);
438
472
  }
439
- result = { ran: true, reason: "ran", swept, minted, code: null, lag, backfill, snapshot: null, retention: null };
473
+ result = {
474
+ ran: true,
475
+ reason: "ran",
476
+ swept,
477
+ minted,
478
+ code: null,
479
+ lag,
480
+ backfill,
481
+ snapshot: null,
482
+ retention: null,
483
+ ...(terms === undefined ? {} : { terms }),
484
+ };
440
485
  } catch (err) {
441
486
  const code =
442
487
  err !== null && typeof err === "object" && typeof (err as { code?: unknown }).code === "string"
@@ -0,0 +1,104 @@
1
+ /**
2
+ * `doctor`'s Feedback loop line (2026-10-19, an experiment; check on ~10-22).
3
+ *
4
+ * Trying ratings as use, strong co-use links and light habituation
5
+ * (`core/recall/rated.ts`, `habituation.ts`) to see whether the day starts
6
+ * teaching the system. This line is what the 2–3 day review reads: over the
7
+ * last week's `recall.rated` rows, the uses credited by tier and the pairs sent
8
+ * to be linked; the links now at or above the quiet-pointer weight; how many
9
+ * memories are habituated now, and how many were shown anyway. Pointers shown
10
+ * and later expanded are on the Association line. Informational: green, with
11
+ * the numbers. Reads only.
12
+ */
13
+ import type { Store } from "../../core/store/index.js";
14
+ import { RECALL_RATED_EVENT } from "../../core/counterpart.js";
15
+ import { TUNABLES as ASSOCIATE_TUNABLES, edgeWeightAt } from "../../core/associate/index.js";
16
+ import { TUNABLES as RECALL_TUNABLES } from "../../core/recall/tunables.js";
17
+ import { habituatedIds } from "../../core/recall/index.js";
18
+ import { finding, num, payloadOf } from "./doctor-finding.js";
19
+ import type { Finding } from "./doctor-finding.js";
20
+
21
+ /** How far back the line reads, in lived days. */
22
+ const FEEDBACK_WINDOW_DAYS = 7;
23
+ /** Rows read per name; a full read is a floor, and says so. */
24
+ const FEEDBACK_ROWS = 5_000;
25
+
26
+ /** The single-link weight the quiet-pointer lane needs — derived, never a constant of its own. */
27
+ export function pointerLinkWeight(): number {
28
+ return (RECALL_TUNABLES.LINK_POINTER_MIN_FRACTION * ASSOCIATE_TUNABLES.MAX_OUT_WEIGHT) / ASSOCIATE_TUNABLES.HOP_DECAY;
29
+ }
30
+
31
+ export function feedbackLoopFindings(store: Store): Finding[] {
32
+ const day = store.livedDay();
33
+ const since = Math.max(0, day - FEEDBACK_WINDOW_DAYS);
34
+ const credited = { shown: 0, ontopic: 0, useful: 0, referenced: 0 };
35
+ let notCredited = 0;
36
+ let coUsePairs = 0;
37
+ let together = 0;
38
+ let calls = 0;
39
+ let shownHabituated = 0;
40
+ let atPointer = 0;
41
+ let habituatedNow = 0;
42
+ let floor = false;
43
+ try {
44
+ const rows = store.eventLog({ name: RECALL_RATED_EVENT, sinceDay: since, order: "desc", limit: FEEDBACK_ROWS });
45
+ floor = rows.length >= FEEDBACK_ROWS;
46
+ for (const row of rows) {
47
+ const p = payloadOf(row);
48
+ const c = p["credited"];
49
+ if (c === null || typeof c !== "object") continue;
50
+ calls += 1;
51
+ const cr = c as Record<string, unknown>;
52
+ for (const k of ["shown", "ontopic", "useful", "referenced"] as const) credited[k] += num(cr, k) ?? 0;
53
+ const nc = p["notCredited"];
54
+ if (nc !== null && typeof nc === "object") for (const v of Object.values(nc)) if (typeof v === "number") notCredited += v;
55
+ const co = p["coUse"];
56
+ if (co !== null && typeof co === "object") coUsePairs += num(co as Record<string, unknown>, "pairs") ?? 0;
57
+ together += num(p, "together") ?? 0;
58
+ }
59
+ for (const row of store.eventLog({ name: "recall.decision", sinceDay: since, order: "desc", limit: FEEDBACK_ROWS })) {
60
+ const p = payloadOf(row);
61
+ for (const lane of ["surfaced", "footnotes"] as const) {
62
+ const list = p[lane];
63
+ if (Array.isArray(list)) for (const e of list) if (e !== null && typeof e === "object" && (e as { habituated?: unknown }).habituated === true) shownHabituated += 1;
64
+ }
65
+ }
66
+ const w = pointerLinkWeight();
67
+ for (const e of store.allEdges()) {
68
+ if (edgeWeightAt({ src: e.src, dst: e.dst, weight: e.weight, lastDay: e.last_day }, day, ASSOCIATE_TUNABLES) >= w) atPointer += 1;
69
+ }
70
+ habituatedNow = habituatedIds(store, day, RECALL_TUNABLES).size;
71
+ } catch {
72
+ return [];
73
+ }
74
+ const total = credited.shown + credited.ontopic + credited.useful + credited.referenced;
75
+ const detail =
76
+ calls === 0
77
+ ? `last ${String(FEEDBACK_WINDOW_DAYS)} lived days — no rating has counted yet (the experiment began 2026-10-19)`
78
+ : `last ${String(FEEDBACK_WINDOW_DAYS)} lived days, ${String(calls)} rating ${calls === 1 ? "call" : "calls"} — ${String(total)} uses credited (${String(credited.shown)} glimpses, ${String(credited.ontopic)} rated 1, ${String(credited.useful)} rated 2, ${String(credited.referenced)} rated 3), ${String(notCredited)} not credited; ${String(coUsePairs)} co-use ${coUsePairs === 1 ? "pair" : "pairs"} and ${String(together)} shown-together ${together === 1 ? "pair" : "pairs"} sent to be linked`;
79
+ return [
80
+ finding(
81
+ "feedback-loop",
82
+ "green",
83
+ "Feedback loop",
84
+ `${detail}. ${String(atPointer)} ${atPointer === 1 ? "link" : "links"} at or above the quiet-pointer weight (${pointerLinkWeight().toFixed(2)}). ${String(habituatedNow)} ${habituatedNow === 1 ? "memory" : "memories"} habituated now; ${String(shownHabituated)} habituated ${shownHabituated === 1 ? "showing" : "showings"} got through anyway` +
85
+ (floor ? ". More rows than were read: the counts are a floor" : ""),
86
+ "",
87
+ {
88
+ calls,
89
+ credited: total,
90
+ glimpses: credited.shown,
91
+ rated1: credited.ontopic,
92
+ rated2: credited.useful,
93
+ rated3: credited.referenced,
94
+ notCredited,
95
+ coUsePairs,
96
+ together,
97
+ atPointer,
98
+ habituatedNow,
99
+ shownHabituated,
100
+ floor,
101
+ },
102
+ ),
103
+ ];
104
+ }
@@ -74,7 +74,7 @@ import {
74
74
  } from "../../core/store/index.js";
75
75
  import { heldCorrections } from "../../core/reconsolidation.js";
76
76
  import { bundledModelDir } from "../runtime.js";
77
- import { acceptsReflectedFeeling, laterFeelingWasAwake, laterFeelingWasReflections, selfRelevantFeeling } from "../../core/sleep/index.js";
77
+ import { TUNABLES as SLEEP_TUNABLES, acceptsReflectedFeeling, laterFeelingWasAwake, laterFeelingWasReflections, selfRelevantFeeling } from "../../core/sleep/index.js";
78
78
  import { TUNABLES as ASSOCIATE_TUNABLES, isDead, pairKey } from "../../core/associate/index.js";
79
79
  import type { EventRow } from "../../core/store/index.js";
80
80
  // The ask allowance the amber hint names, read rather than retyped: a number in
@@ -84,7 +84,7 @@ import { WORK_OVERFLOW_EVENT } from "../../core/self/work.js";
84
84
  import { HANDOFF_REFUSED_EVENT } from "../../core/handoff/index.js";
85
85
  import { LAST_HERE_NOROOM_EVENT } from "../../core/handoff/last-here.js";
86
86
  import { TOOL_RESULT_CEILING } from "../../core/fit/index.js";
87
- import { awakeFeelingCounts, nightRunOf } from "../../core/dream/index.js";
87
+ import { awakeFeelingCounts, coreWaiting, nightRunOf } from "../../core/dream/index.js";
88
88
  import type { DreamingSetting } from "../../core/dream/index.js";
89
89
  import type { AskReason } from "../../core/self/episodes.js";
90
90
  // The what-fired reading, shared with the console's `fired` command and the
@@ -143,6 +143,7 @@ import type { HostReading, DesktopReading } from "./doctor-host.js";
143
143
  import { readOwed, crashWriteUpFindings } from "./doctor-write-ups.js";
144
144
  import type { OwedSource, OwedReading } from "./doctor-write-ups.js";
145
145
  import { worstFirst } from "./doctor-report.js";
146
+ import { feedbackLoopFindings } from "./doctor-feedback.js";
146
147
 
147
148
  // What moved to the doctor-*.ts parts, re-exported so every import of this file still resolves.
148
149
  export { SEVERITIES } from "./doctor-finding.js";
@@ -719,8 +720,8 @@ function withdrawnFinding(input: DoctorInput): Finding | null {
719
720
  "embedder",
720
721
  "amber",
721
722
  RECALL_TITLE,
722
- `off in this process — the store's cache was written by a newer Counterparts (cache v${v.found}; this build reads v${v.expected}). Recall still matches on words`,
723
- `Either install the newer build again (${byInstall(input, "bun add -g counterparts@latest", "in Claude Code, /plugin → Installed → counterparts → Update now")}), or, to stay on this one, delete ${tilde(input.dir)}/cache/cache.sqlite* (the search cache alone; no memory is kept there, and it is rebuilt) — then in Claude Code run /mcp → Reconnect so the server opens it.`,
723
+ `off in this process — the store's cache was written by a newer Counterparts (cache v${v.found}; this build reads v${v.expected}). Recall still matches on words, but may miss words the newer build indexed in another form`,
724
+ `Either install the newer build again (${byInstall(input, "bun add -g counterparts@latest", "in Claude Code, /plugin → Installed → counterparts → Update now")}), or, to stay on this one, delete ${tilde(input.dir)}/cache/cache.sqlite* (the search cache alone; no memory is kept there) and run \`counterparts verify --rebuild --keep-vectors --dir ${tilde(input.dir)}\` to rebuild its word index — then in Claude Code run /mcp → Reconnect so the server opens it.`,
724
725
  { cacheAhead: true, found: v.found, expected: v.expected },
725
726
  );
726
727
  }
@@ -2279,7 +2280,18 @@ export function reflectionFindings(input: DoctorInput, store: Store): Finding[]
2279
2280
  last.entry_id === null ? "nothing much" : "an entry"
2280
2281
  }${last.page_version === null ? "" : ", the self page rewritten"}, ${share[last.share_state] ?? last.share_state}`;
2281
2282
  const byHow = `returns this week — awake ${String(returns.awake)}, reflection ${String(returns.reflection)}, dream ${String(returns.dream)}`;
2283
+ // CORE QUESTIONS THAT WAITED (2026-10-20, an experiment): flagged a week
2284
+ // or more ago with no decision since — what the reflection is offered.
2285
+ let coreWaited = 0;
2286
+ try {
2287
+ coreWaited = coreWaiting(store, store.livedDay()).length;
2288
+ } catch {
2289
+ coreWaited = 0;
2290
+ }
2282
2291
  const aloneLine =
2292
+ (coreWaited > 0
2293
+ ? `; ${String(coreWaited)} core ${coreWaited === 1 ? "memory has" : "memories have"} waited ${String(SLEEP_TUNABLES.CORE_WAITING_DAYS)}+ lived days for a keep or retire (counterparts core --list shows them)`
2294
+ : "") +
2283
2295
  (promotionsUnread
2284
2296
  ? `; how many became core on reflection alone is unknown: more than ${String(PROMOTED_ROWS)} promotions in the log, and only the newest ${String(PROMOTED_ROWS)} were read`
2285
2297
  : "") +
@@ -2324,6 +2336,7 @@ export function reflectionFindings(input: DoctorInput, store: Store): Finding[]
2324
2336
  awakeFeelings: awake.total,
2325
2337
  awakeFeelingsFast: awake.fast,
2326
2338
  awakeFeelingsOwner: awake.owner,
2339
+ coreWaited,
2327
2340
  },
2328
2341
  ),
2329
2342
  ];
@@ -3391,6 +3404,8 @@ export function doctorFindings(input: DoctorInput): Finding[] {
3391
3404
  ["claim", () => claimFindings(store, input.host?.plugin ?? null)],
3392
3405
  // Association build 1 (2026-09-28): what spreading did, and the edges.
3393
3406
  ["association", () => associationFindings(store)],
3407
+ // The feedback loop (2026-10-19, an experiment): ratings as use, co-use links, habituation.
3408
+ ["feedback-loop", () => feedbackLoopFindings(store)],
3394
3409
  // LAST, and deliberately: it is the widest read here — the whole event log,
3395
3410
  // plus a pass over the ids for the table probes — so when the console's
3396
3411
  // reading is cut short this is the group that goes, and the `Budget` finding
@@ -167,7 +167,15 @@ export function createStaticEmbedder(
167
167
  } else hits += 1;
168
168
  return vec;
169
169
  };
170
- const embed: Embedder = Object.assign(compute, { identity });
170
+ // THE WORD WEIGHTS, only from a table someone has calibrated recall's
171
+ // everyday-word discount against (2026-10-19, an experiment: the ramp in
172
+ // `recall/tunables.ts` is in potion-base-8M's own units). Any other table
173
+ // offers none, and recall's word weights stay as they were.
174
+ const calibrated = WORD_NORM_CALIBRATED.has(model.model);
175
+ const embed: Embedder = Object.assign(
176
+ compute,
177
+ calibrated ? { identity, wordNorm: (word: string) => model.wordNorm(word) } : { identity },
178
+ );
171
179
  return {
172
180
  model: model.model,
173
181
  kind: "static",
@@ -182,6 +190,13 @@ export function createStaticEmbedder(
182
190
  };
183
191
  }
184
192
 
193
+ /**
194
+ * Tables whose row norms recall's everyday-word discount was calibrated on
195
+ * (`recall/tunables.ts#EVERYDAY_NORM_LOW`). Another table's norms are in its
196
+ * own units, so it gets no discount until someone measures it.
197
+ */
198
+ export const WORD_NORM_CALIBRATED: ReadonlySet<string> = new Set(["potion-base-8M"]);
199
+
185
200
  /**
186
201
  * The static table that was asked for and is not here: every ask answers null,
187
202
  * no identity (the store never reconciles against it, so nothing in box 3 is
@@ -82,7 +82,7 @@ import { nightRowTimeoutMs, planNightRunner } from "./night-run.js";
82
82
  import { NOTHING_OWED_BEFORE_KEY, catchUpOf, catchUpWords, owedBefore } from "./night-catch-up.js";
83
83
  import type { NightKind } from "./night-run.js";
84
84
  import { spawnDetached } from "../spawn.js";
85
- import { ONE_TAG_LINE, wakeTagLead } from "../store-id.js";
85
+ import { ONE_TAG_LINE, tagLead } from "../store-id.js";
86
86
  import type { SpawnOutcome } from "../spawn.js";
87
87
  import { NO_ARRIVAL, STOP_ASK_OPENER, readWakeArrival, startedByHost } from "./transcript.js";
88
88
  import type { WakeArrival } from "./transcript.js";
@@ -513,7 +513,8 @@ export const PAGE_WRITER_TOOL = "counterparts self_page";
513
513
  * today's `additionalContext`, or the stderr and `reason` shapes older
514
514
  * transcripts hold.
515
515
  *
516
- * RATINGS (2026-10-14; Mike's call, tracking only): one clause asks the
516
+ * RATINGS (2026-10-14; Mike's call; since 2026-10-19 an experiment counts
517
+ * the scores as use, which `session_end`'s field says): one clause asks the
517
518
  * session to score the footnotes shown since it last wrote, and every `drewOn`
518
519
  * id — `session_end`'s `rated` field says the anchors and the rest. The ids
519
520
  * are not listed here: every Stop's injection is noise someone pays for.
@@ -537,7 +538,7 @@ export const RESUME_WAKE_LINE =
537
538
  "Counterparts: this session was resumed; the wake it was handed when it started (above) still holds.";
538
539
 
539
540
  /** What `sessionStart` hands the host: a composed wake, or a resume's line. */
540
- type WokeHere = Pick<ReturnType<Lifecycle["composeWake"]>, "text" | "ok" | "bytes" | "sentinel" | "preface" | "lined"> & {
541
+ type WokeHere = Pick<ReturnType<Lifecycle["composeWake"]>, "text" | "ok" | "bytes" | "sentinel" | "preface" | "lined" | "tags" | "tagged"> & {
541
542
  readonly reason: string;
542
543
  };
543
544
 
@@ -641,7 +642,10 @@ export class ClaudeCodeAdapter extends Lifecycle {
641
642
  // the "Since you started" line says what changed elsewhere since it
642
643
  // last heard. No wake is composed, so no new expectation is written for
643
644
  // the delivery check, and the since-line's state is left to the line.
644
- const woke: WokeHere = resumed ? this.resumeWake(input) : this.composeWake(input, budget);
645
+ // The markers ride in the composed wake's head tag (2026-10-20, ONE
646
+ // TAG; `Lifecycle#composeWake`).
647
+ const markers = (): readonly string[] => [this.onboardingMarker(input), this.storeMarker()];
648
+ const woke: WokeHere = resumed ? this.resumeWake(input) : this.composeWake(input, budget, markers);
645
649
  // The wake has just said what the other directories did today, so the
646
650
  // prompt's "Since you started" line counts from here (2026-10-11).
647
651
  if (!resumed) this.noteSinceWoke(input);
@@ -700,8 +704,10 @@ export class ClaudeCodeAdapter extends Lifecycle {
700
704
  // says which store this session opened, so the mod can tell this
701
705
  // store's dashboard from another's. Since 2026-10-16 both ride on the
702
706
  // wake's own head line, just above its body (`wakeTagLead`, lightly
703
- // held); `ONE_TAG_LINE` off puts them back under the clock.
704
- const tags = wakeTagLead([this.onboardingMarker(input), this.storeMarker()], woke.text);
707
+ // held), and since 2026-10-20 inside its head tag (`ONE_TAG`), or as
708
+ // one tag of their own in front of a wake that has none (`tagLead`);
709
+ // `ONE_TAG_LINE` off puts them back under the clock.
710
+ const tags = tagLead(woke.tags ?? markers(), woke.text, woke.tagged === true);
705
711
  const lead = `${woke.text.length === 0 && plain.context.length === 0 && codeTab === null ? "" : `${this.nowLine()}\n`}${ONE_TAG_LINE ? "" : tags}${codeTab === null ? "" : `${codeTab}\n`}${plain.context}${ONE_TAG_LINE ? tags : ""}`;
706
712
  const sent = woke.bytes + Buffer.byteLength(lead, "utf8");
707
713
  const rides =
@@ -987,6 +993,19 @@ export class ClaudeCodeAdapter extends Lifecycle {
987
993
  if (text.trim().length === 0) {
988
994
  return { ...out, ok: true, reason: "empty-prompt", injection: `${this.nowLine()}${context.length === 0 ? "" : `\n${context.trimEnd()}`}`, ...told };
989
995
  }
996
+ // THE NIGHTLY RUN'S OWN PROMPT GETS NO AMBIENT RECALL (2026-10-19, part
997
+ // F of the feedback-loop build): an experiment, to see night sessions
998
+ // drop out of the day's footnote numbers; check on ~10-22, revert by
999
+ // deleting this return. Until now only its cues
1000
+ // stood down (`noCues`, #453): the launch prompt still ran the composed
1001
+ // recall, so each child (dream, reflection, catch-up) was handed
1002
+ // footnotes nobody reads, and they sat in its gate state — counted as
1003
+ // shown on its boundary's credit row and rateable as if a day had seen
1004
+ // them. The run reads memories on purpose, through its tools; nothing
1005
+ // comes to mind uninvited. The clock line stays.
1006
+ if (input.nightRun === true) {
1007
+ return { ...out, ok: true, reason: "night-run", injection: `${this.nowLine()}${context.length === 0 ? "" : `\n${context.trimEnd()}`}`, ...told };
1008
+ }
990
1009
  // The person's lines (reminders, the dream's) are the JSON form's other
991
1010
  // field, so they take nothing from recall's room (2026-10-10).
992
1011
  const budgetBytes = this.recallRoom(input, context);