counterparts 0.3.33 → 0.3.35

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 (44) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/package.json +1 -1
  3. package/src/adapters/claude-code/CONTRACT.md +7 -1
  4. package/src/adapters/claude-code/NOTES.md +41 -0
  5. package/src/adapters/claude-code/doctor-self-page.ts +56 -12
  6. package/src/adapters/claude-code/index.ts +8 -0
  7. package/src/adapters/claude-code/night-run.ts +336 -14
  8. package/src/adapters/claude-code/transcript.ts +34 -0
  9. package/src/adapters/cli/commands.ts +1 -1
  10. package/src/adapters/cli/dream-core.ts +21 -3
  11. package/src/adapters/cli/help.ts +1 -1
  12. package/src/adapters/cli/self-page.ts +1 -1
  13. package/src/adapters/cli/uninstall.ts +11 -2
  14. package/src/adapters/config.ts +72 -4
  15. package/src/adapters/dashboard/registries.ts +2 -2
  16. package/src/adapters/dashboard/web/narrate.ts +1 -1
  17. package/src/adapters/dashboard/web/pages/health/sections/checks.js +1 -1
  18. package/src/adapters/dashboard/web/pages/health/sections/wake.js +1 -1
  19. package/src/adapters/dashboard/web/pages/self/sections/page.js +14 -4
  20. package/src/adapters/dashboard/web/views/mind.ts +17 -5
  21. package/src/adapters/mcp/server-self-tools.ts +449 -33
  22. package/src/adapters/mcp/server-words.ts +18 -1
  23. package/src/adapters/mcp/server.ts +37 -3
  24. package/src/adapters/mcp/tools.ts +26 -2
  25. package/src/core/counterpart-types.ts +1 -1
  26. package/src/core/counterpart.ts +44 -9
  27. package/src/core/dream/CONTRACT.md +28 -3
  28. package/src/core/dream/NOTES.md +105 -0
  29. package/src/core/dream/index.ts +351 -47
  30. package/src/core/dream/reflect.ts +643 -50
  31. package/src/core/dream/slices.ts +91 -7
  32. package/src/core/dream/tunables.ts +67 -0
  33. package/src/core/fit/index.ts +162 -0
  34. package/src/core/physics/CONTRACT.md +16 -0
  35. package/src/core/physics/NOTES.md +14 -0
  36. package/src/core/physics/index.ts +61 -3
  37. package/src/core/seat.ts +36 -3
  38. package/src/core/self/NOTES.md +95 -0
  39. package/src/core/self/index.ts +67 -2
  40. package/src/core/self/measures.ts +48 -2
  41. package/src/core/self/page.ts +178 -0
  42. package/src/core/self/tunables.ts +48 -0
  43. package/src/core/self/writer.ts +152 -5
  44. package/src/core/store/index.ts +42 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.35 — 2026-10-24
4
+
5
+ The morning reflection reads a shorter list of the memories that may become core: at most 30 a night, the 20 strongest and 10 taking turns through the rest, with the others counted in one line (on a copy of the author's store, 132 candidates → 30 shown and "+102 more", the reflection's reading 85k characters in 4 parts → 74k in 3; a tail of about 100 comes round in about 10 nights). Day's end's known misread from 0.3.34 is fixed: a night that tells the day and then writes the page reads as a page revised. A memory written in one session now counts as used the first time another session draws on it, the same day. No store-format change (store v14, cache v7), no wiring change: `counterparts connect` is not needed after upgrading. Restart the dashboard and every Claude Code session afterwards so the long-running memory server and dashboard load the new version.
6
+
7
+ - **The morning reflection is shown at most 30 core candidates a night, not every one.** The 20 strongest felt and
8
+ newest come every night, and 10 more take turns through the rest, the ones it saw longest ago first, so each still
9
+ comes round. The rest are counted in one line. On a store with about 130 candidates the reflection's bundle is
10
+ about 11k characters shorter and one part fewer. Switch: `dream.REFLECT_CANDIDATES_CAP`.
11
+ - **Day's end that tells the day first and then writes the page anyway is read as a page
12
+ written.** The night's row, doctor and the dashboard said "nothing to say" for that night
13
+ although the page had changed; now they say it was revised, and the day summary stays
14
+ with it.
15
+ - **A memory can be credited on the day it was written, by any session but the one that wrote
16
+ it.** Until now no use counted on a memory's first day, so a note another session opened or
17
+ drew on within minutes stayed at zero uses. The rule's real cause was the writing session
18
+ seeing its own words in its reply, so that session is now the one refused that day. Switch:
19
+ `physics.OWN_WRITE_GATE`.
20
+
21
+ ## 0.3.34 — 2026-10-23
22
+
23
+ The night is lighter and better organised. Its helpers start slim, with only the memory tools they use and a short prompt of their own, and the dream's and the reflection's reading goes out as plain lines with short ids (on a copy of the author's store the dream's bundle fell by 43–45%, the reflection's by about 13%, with the same memories shown). The nightly page writer is now called **day's end**: it runs first, in its own child, reads the day by its chapters' summaries and its strongest memories, writes Lately and How I work, and leaves a short account of the day that the dream reads first; the reflection writes Core. The reflection sees the long view again: on busy nights it had been shown no core memories at all, and now it reads them first, with the last three weeks as a line a day. `counterparts night last` and doctor say what a night cost in tokens. No store-format change (store v14, cache v7), no wiring change: `counterparts connect` is not needed after upgrading. Restart the dashboard and every Claude Code session afterwards so the long-running memory server and dashboard load the new version.
24
+
25
+ - **The nightly page writer is now called day's end: it closes the day before the dream.** It now reads the day
26
+ as it was told, each of the day's chapters by its summary, plus the day's 12 strongest memories, and can say which
27
+ memories a sentence on your page rests on. The setting keeps its old name (`pageWriter.mode` in `claude-code.json`).
28
+ - **The night writes the self page in two lanes.** Day's end now runs first, on its own, and
29
+ amends the day's sections (Lately, How I work); the reflection writes Core, the long view. Each
30
+ keeps to its own sections, a sentence kept word for word keeps what it rested on, and the dream no
31
+ longer carries the day's page work. One setting turns it back (`self.PAGE_SPLIT`).
32
+ - **Day's end leaves a short account of the day; the dream reads it first and the reflection sees the last three
33
+ weeks as a line a day.** With its one closing call each night (with the page, or alone when the page stands), day's
34
+ end writes a few lines about what the day was about and what is in motion, and the memories they rest on. The
35
+ dream opens with it, above everything it was going to read anyway, and the morning reflection gets a timeline of
36
+ the last 21 days, so it can see a pattern across weeks. `counterparts night last` and the dashboard's page strip
37
+ show it. Switch: `self.DAY_SUMMARY`.
38
+ - **A known misread:** if day's end sends its summary alone and then writes a page anyway, that night's row
39
+ reads "nothing-to-say" although the page changed. Day's end is told to send the summary alone only when the
40
+ page stands.
41
+ - **The reflection reads the long view first.** On a busy night the morning reflection was handed the day's
42
+ chapters and a line for everything the dream saw before any of its core memories, and often never got to them
43
+ (on the author's 10-21 and 10-22 nights it was shown no core memories, candidates or strongly felt ones at all).
44
+ Now your core memories, the memories that may become core and the most strongly felt ones always come first,
45
+ then the last few days' chapters by their summaries, then what the dream changed.
46
+ - **The night reads lighter.** The dream's and the reflection's bundles now go out as plain
47
+ lines with short ids for the night (m1, m2… for memories, c1… for journals) instead of
48
+ JSON inside JSON, and the dream reads each chapter by its summary with its address, a
49
+ lookup away from the whole. On a copy of the author's store the dream's bundle fell from
50
+ about 147k characters in 4–5 parts to about 82k in 3, the reflection's by about 13%,
51
+ with the same memories shown. Every tool the night uses takes the short ids, and real
52
+ ids still work. `propose` and the reflection's `finish` answer with counts and only what
53
+ went wrong. On a quiet day the dream's room shrinks, spending less on whole texts while
54
+ showing the same memories. `dream.LEAN_BUNDLE` off puts the old shape back.
55
+ - **The night's helpers start lighter.** Each background run of the night (day's end, the dream, the
56
+ reflection, tagging, a write-up owed) now starts with only the memory tools it uses and a
57
+ short prompt of its own, instead of Claude Code's full coding setup, so it spends fewer
58
+ tokens before it begins.
59
+ - **`counterparts night last` shows what a night cost in tokens.** The night's line says its
60
+ total, and `counterparts doctor`'s Nightly run line says it too.
61
+ - **For a host built on the package:** `counterparts` now exports `SPLIT_DREAM_TOOLS`, `SPLIT_REFLECTION_TOOLS`
62
+ and `seatTools` (which memory tools each night child is served), and `counterparts/claude-code` exports
63
+ `NIGHT_SERVED_TOOLS`, `NIGHT_SYSTEM_PROMPT`, `childUsage` (a night child's tokens from its `result` line),
64
+ `NIGHT_DEBUG_DIR`, `NIGHT_TRANSCRIPT_DAYS`, `nightDebugDir`, `writeNightTranscript` and `pruneNightTranscripts`
65
+ (the dev-only `debug` switch, documented in CONTRIBUTING.md). Nothing was removed.
66
+
3
67
  ## 0.3.33 — 2026-10-23
4
68
 
5
69
  On the first new lived day after upgrading (when the first turn or session ends on a new day; if today's card pass already ran, tomorrow), the card pass merges once the pairs of cards that share a name (a race fixed in 0.3.31 left them; the author's store had 50 pairs): the younger card of each pair is archived under the older one, which gains the links neither had while both were live. `counterparts dream --undo-twins` puts the cards back if you want them. The same night hands cards that were filed as a person or a place only by how they were born back to its kinds question. The dream takes in more of the day's new memories a night (a 16,000-character list, 4 neighbours each; an experiment, checked 10-29). `counterparts note --tags` and `counterparts dream --undo-tags` are new, and `counterparts mechanisms` says how often a settled thing comes back. No store-format change (store v14, cache v7), no wiring change: `counterparts connect` is not needed after upgrading. Restart the dashboard and every Claude Code session afterwards so the long-running memory server and dashboard load the new version.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterparts",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
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": {
@@ -849,7 +849,13 @@ output is ignored. Every child, the plain retry included, also passes
849
849
  `--no-session-persistence` (2026-10-21; checked on 2.1.306 with `--session-id` and
850
850
  `stream-json`), so the host keeps no transcript of it under `~/.claude/projects`: its
851
851
  words — memories it read, the conversation it wrote up — do not outlive this package's own
852
- retention there. On a host too old to know the flag the night does not run. It
852
+ retention there. On a host too old to know the flag the night does not run. Every child,
853
+ the plain retry and the catch-up included, is also SLIM (2026-10-23): `--tools ""` (no
854
+ built-in tool at all, `ToolSearch` included, so the host offers our tools up front instead
855
+ of deferring them — measured on 2.1.309 and so documented), `--system-prompt` our own
856
+ fixed words (`NIGHT_SYSTEM_PROMPT`) in place of the host's coding-assistant prompt, and
857
+ every counterparts tool the child is not granted denied (`NIGHT_SERVED_TOOLS`), so it is not
858
+ offered either; `NIGHT_DENIED_TOOLS` stays as the second fence. It
853
859
  starts in a NEUTRAL directory — the store's own — so no project's CLAUDE.md, hooks or MCP
854
860
  servers load. The parent's stance, `CLAUDE_PROJECT_DIR` and `CLAUDECODE` variables are
855
861
  removed; this package's values are written last.
@@ -2666,3 +2666,44 @@ running both, found confusing. The npm install now leaves `npm-live.json` beside
2666
2666
  children, so a `tags` child (10-21) was dropped from a row read back from meta (the
2667
2667
  run's own return and the event's `children` words kept it). It now keeps `tags`, with
2668
2668
  its `hostSession`.
2669
+
2670
+ ## 2026-10-23 — the slim night child (lane N1, step 1)
2671
+
2672
+ - **Every child is slim**: `--tools ""` and `--system-prompt NIGHT_SYSTEM_PROMPT`, on the
2673
+ dream, the reflection, the tagging child, the catch-up child and the plain retry
2674
+ (`planNightChild`, the one place they are all planned). Owner, 10-23: "worth testing and
2675
+ replacing system prompt, and removing unused tools as long as we're sure we don't need
2676
+ them." Across every night transcript (Sept–10-21) the only built-in tool a child called
2677
+ was `ToolSearch`, to load our deferred tools.
2678
+ - **Checked first, on 2.1.309, against a temp store** (one trivial `claude -p` each way,
2679
+ `--setting-sources project` in a temp directory so no user setting or hook loaded):
2680
+ master's child offered nine built-ins (`ToolSearch`, `CronDelete`, `CronList`,
2681
+ `ScheduleWakeup`, `PushNotification`, `ListAgents`, `ExitWorktree`, `DesignSync`,
2682
+ `ReportFindings` — none in `NIGHT_DENIED_TOOLS`) and our ten tools deferred; it called
2683
+ `ToolSearch` to load `recall`, then `recall`. Its first call was 6,903 tokens, 9,253 after
2684
+ the load. The slim child's `init` listed our ten tools and nothing else, and it called
2685
+ `recall` on its first turn. Claude Code's docs say the same: with `ToolSearch` denied or
2686
+ left out of `--tools`, MCP tools load up front.
2687
+ - **Up front means all of them**: the slim child offered all ten began at 29,842 tokens —
2688
+ the ten definitions are ~84k characters (`remember` and `session_end` ~18k each). So a
2689
+ child is now denied every tool of ours it is not granted (`NIGHT_SERVED_TOOLS`, pinned to
2690
+ the server's `TOOL_NAMES` by a test rather than imported, so the hook does not load the
2691
+ tool registry), and a denied tool is not offered. Per act, what is offered up front:
2692
+ dream ~24k characters (dream, self_page, recall), reflection ~37k (+ reflect), tags ~10k
2693
+ (dream), catch-up ~18k (session_end). The fat child paid for the same definitions once
2694
+ `ToolSearch` loaded them, plus ~6.5k of host prompt and built-ins and a turn per load.
2695
+ - **The system prompt** says only where the child is and what holds whatever the act; the
2696
+ act itself comes on stdin as before. Fixed words, so argv is fine. Nothing the host does
2697
+ with an oversized result depends on the prompt: the cut is reported in the `stream-json`
2698
+ output either way (`readNightSpills`), and the file a cut points to was never readable
2699
+ (`Read` denied).
2700
+ - **The plain retry keeps both flags.** `--system-prompt` is in print mode since 1.0 and
2701
+ `--tools` since before 2.1.0; no night has run on a host older than 2.1.284. A host that
2702
+ refused them would end the night as `--no-session-persistence` would (a quick exit on the
2703
+ row). Dropping them on the retry instead is one line, if a host ever does.
2704
+ - **`NIGHT_DENIED_TOOLS` stays, as the second fence**, with the eight unlisted built-ins
2705
+ above added for a host that ignored `--tools`.
2706
+ - Not measured: the real night's base (user settings, plugins and the user's CLAUDE.md load
2707
+ in a night child; the check above left them out), and whether `--system-prompt` changes
2708
+ what of the user's CLAUDE.md reaches the child. A model night after release, or the
2709
+ coordinator's `childUsage` per child, says.
@@ -12,8 +12,10 @@ import {
12
12
  nightRunLost,
13
13
  nightRunOf,
14
14
  nightRunWords,
15
+ nightTokenCount,
16
+ nightTokensWords,
15
17
  } from "../../core/dream/index.js";
16
- import type { DreamingSetting } from "../../core/dream/index.js";
18
+ import type { DreamingSetting, NightChildRun } from "../../core/dream/index.js";
17
19
  // The page's own reader, so this line cannot drift from what the wake prints.
18
20
  import { clearedMarker, findPageRow, readSelfPage } from "../../core/self/page.js";
19
21
  import { coreBeliefFloors, coreFromBeliefs, coreSupport, pageTrace } from "../../core/self/measures.js";
@@ -24,6 +26,7 @@ import {
24
26
  lastPageWriterRun,
25
27
  pageWriterDue,
26
28
  pageWriterNight,
29
+ pageWriterRuns,
27
30
  pageWriterStatus,
28
31
  } from "../../core/self/writer.js";
29
32
  // The what-fired reading, shared with the console's `fired` command and the
@@ -90,6 +93,15 @@ export function dreamingFindings(input: DoctorInput, store: Store): Finding[] {
90
93
  ];
91
94
  }
92
95
 
96
+ /** Did day's end leave a day summary during the run that started at `startedAt` (2026-10-23, lane D2)? Never throws. */
97
+ function toldDuring(store: Store, startedAt: number): boolean {
98
+ try {
99
+ return pageWriterRuns(store, { limit: 50 }).some((r) => r.at >= startedAt && r.summary.trim().length > 0);
100
+ } catch {
101
+ return false;
102
+ }
103
+ }
104
+
93
105
  /**
94
106
  * THE NIGHTLY RUN, headless (2026-09-29): what became of the latest run the
95
107
  * host started itself (setting `auto`) — the store's one-row record
@@ -127,14 +139,33 @@ export function nightRunFindings(input: DoctorInput, store: Store): Finding[] {
127
139
  dream: run.dream,
128
140
  reflection: run.reflection,
129
141
  ...(cu === null ? {} : { catchUp: cu.state, writtenUp: cu.written, writeUpParts: cu.parts, leftOwed: cu.left }),
142
+ ...(run.usage?.total == null || !Number.isFinite(nightTokenCount(run.usage.total)) ? {} : { tokens: nightTokenCount(run.usage.total) }),
130
143
  };
131
144
  const mins = (ms: number): string => `${String(Math.max(1, Math.round(ms / 60_000)))} min`;
132
145
  const took = run.endedAt === null ? "" : ` after ${mins(run.endedAt - run.startedAt)}`;
133
146
  const skipped = dreamSkippedOf(run);
134
147
  const what = run.kind === "reflection" ? "the reflection alone" : skipped !== null ? `the catch-up alone; ${dreamSkippedWords(skipped)}` : "the whole night";
148
+ // THE PAGE WRITER'S OWN CHILD MISSED (2026-10-23, `self.PAGE_SPLIT`): its
149
+ // exit is never the run's, so a night can finish with the page unwritten
150
+ // by it; said here. A writer with nothing to do tonight is not missed.
151
+ const missed = writerMissed(run.children ?? []);
152
+ const writerNote = missed === null ? "" : `; day's end was missed (${missed})`;
153
+ // WHAT THE NIGHT COST (2026-10-23), one clause, when its children said.
154
+ const cost = nightTokensWords(run.usage);
155
+ // DAY'S END TOLD THE DAY (2026-10-23, lane D2): said when it did, nothing else.
156
+ const costNote = (cost === null ? "" : `; ${cost}`) + (toldDuring(store, run.startedAt) ? "; day summary: yes" : "");
135
157
  if (run.state === "done") {
136
158
  const ids = [run.dream, run.reflection].filter((x): x is string => x !== null).join(", ");
137
- return [finding("night-run", "green", "Nightly run", `${setting}; last run ${run.date} (${what}) finished${took}${ids.length > 0 ? ` — ${ids}` : ""}${caught}`, "", data)];
159
+ return [
160
+ finding(
161
+ "night-run",
162
+ missed !== null && setting === "auto" ? "amber" : "green",
163
+ "Nightly run",
164
+ `${setting}; last run ${run.date} (${what}) finished${took}${ids.length > 0 ? ` — ${ids}` : ""}${costNote}${writerNote}${caught}`,
165
+ missed === null ? "" : "Nothing to do by hand: tomorrow's writer reads its own day. If it repeats, run claude -p once by hand in a terminal to see why it stops.",
166
+ { ...data, ...(missed === null ? {} : { writerMissed: missed }) },
167
+ ),
168
+ ];
138
169
  }
139
170
  if (run.state === "partial") {
140
171
  // PART OF THE RUN RAN (2026-09-29, owner): which parts, and — when the
@@ -145,7 +176,7 @@ export function nightRunFindings(input: DoctorInput, store: Store): Finding[] {
145
176
  "night-run",
146
177
  setting === "auto" ? "amber" : "green",
147
178
  "Nightly run",
148
- `${setting}; the run of ${run.date} (${what}) was partial${took}: ${nightPartsWords(run)}${why}${caught}`,
179
+ `${setting}; the run of ${run.date} (${what}) was partial${took}: ${nightPartsWords(run)}${why}${costNote}${writerNote}${caught}`,
149
180
  "Nothing to do by hand: a later session picks up what did not run — a dream cut off is resumed, a reflection cut off runs alone.",
150
181
  { ...data, parts: (run.parts ?? []).join(",") },
151
182
  ),
@@ -176,7 +207,20 @@ export function nightRunFindings(input: DoctorInput, store: Store): Finding[] {
176
207
  : run.reason === "nothing-ran"
177
208
  ? "The headless run needs the counterparts MCP server registered for claude at user scope (claude mcp list shows it); the server's own mcp.session rows say whether it refused the session."
178
209
  : "A later session starts it again, or asks when it cannot. counterparts dream --setting ask stops the headless runs.";
179
- return [finding("night-run", setting === "auto" ? "amber" : "green", "Nightly run", `${setting}; the run of ${run.date} (${what}) ${ended}${took}: ${words}${caught}`, fix, data)];
210
+ return [finding("night-run", setting === "auto" ? "amber" : "green", "Nightly run", `${setting}; the run of ${run.date} (${what}) ${ended}${took}: ${words}${costNote}${writerNote}${caught}`, fix, data)];
211
+ }
212
+
213
+ /** Why the night's page-writer child did not do its part, in a few words; null when it did, or had nothing to do. */
214
+ export function writerMissed(children: readonly NightChildRun[]): string | null {
215
+ const w = children.find((c) => c.child === "writer");
216
+ if (w === undefined) return null;
217
+ if (w.timedOut === true) return "stopped by its watchdog";
218
+ // Every skip on the row is a child that could not run (a writer with
219
+ // nothing to do leaves no line): no claude, a spawn that failed, a store
220
+ // unread, or a seat that refused it.
221
+ if (w.skipped !== undefined) return `could not start: ${w.skipped}`;
222
+ if (w.code !== null && w.code !== 0) return `exited ${String(w.code)}`;
223
+ return null;
180
224
  }
181
225
 
182
226
  export function selfPageFindings(store: Store): Finding[] {
@@ -259,7 +303,7 @@ export function selfPageFindings(store: Store): Finding[] {
259
303
  "amber",
260
304
  "Self page",
261
305
  `${detail} — stale (over ${SELF_TUNABLES.PAGE_STALE_DAYS} days)`,
262
- `Nothing has revised it lately: check the page writer, or amend it yourself with counterparts self-page --write.${fix === "" ? "" : ` ${fix}`}`,
306
+ `Nothing has revised it lately: check day's end, or amend it yourself with counterparts self-page --write.${fix === "" ? "" : ` ${fix}`}`,
263
307
  data,
264
308
  )
265
309
  : short
@@ -284,7 +328,7 @@ export function selfPageTraceFindings(store: Store): Finding[] {
284
328
  const cited =
285
329
  t.source === "none"
286
330
  ? `no cites kept with it (written by ${page.by ?? "an unrecorded door"})`
287
- : `${t.source === "reflection" ? "its reflection's record cites" : "cites"} ${n(t.cites, "memory", "memories")}, ${String(t.live)} live, ${String(t.archivedOrMissing)} archived or missing`;
331
+ : `${t.source === "reflection" ? "its reflection's record cites" : "cites"} ${n(t.cites, "memory", "memories")}, ${String(t.live)} live${t.throughLater > 0 ? ` (${String(t.throughLater)} through a later memory)` : ""}, ${String(t.archivedOrMissing)} archived or missing`;
288
332
  const perClaim =
289
333
  t.uncited === null
290
334
  ? t.source === "none"
@@ -298,7 +342,7 @@ export function selfPageTraceFindings(store: Store): Finding[] {
298
342
  "Self page claims",
299
343
  `${n(t.claims, "claim", "claims")}; ${cited}${perClaim}`,
300
344
  "",
301
- { claims: t.claims, source: t.source, cites: t.cites, live: t.live, archivedOrMissing: t.archivedOrMissing, uncited: t.uncited },
345
+ { claims: t.claims, source: t.source, cites: t.cites, live: t.live, archivedOrMissing: t.archivedOrMissing, throughLater: t.throughLater, uncited: t.uncited },
302
346
  ),
303
347
  ];
304
348
  }
@@ -458,7 +502,7 @@ export function pageWriterFindings(store: Store, config: AdapterConfig): Finding
458
502
  finding(
459
503
  "page-writer",
460
504
  "amber",
461
- "Page writer",
505
+ "Day's end",
462
506
  `${mode} mode; ${ignored.join("; ")}`,
463
507
  "Fix the pageWriter block in claude-code.json. Nothing else in the file was affected, and memory is unaffected.",
464
508
  { ...data, ignored: ignored.join(" | ") },
@@ -474,7 +518,7 @@ export function pageWriterFindings(store: Store, config: AdapterConfig): Finding
474
518
  finding(
475
519
  "page-writer",
476
520
  "green",
477
- "Page writer",
521
+ "Day's end",
478
522
  page === null
479
523
  ? "off — nothing writes the self page on its own, and nothing has been written by hand either"
480
524
  : "off — the page stands, and from here it changes only when somebody writes it",
@@ -492,7 +536,7 @@ export function pageWriterFindings(store: Store, config: AdapterConfig): Finding
492
536
  finding(
493
537
  "page-writer",
494
538
  "green",
495
- "Page writer",
539
+ "Day's end",
496
540
  young
497
541
  ? `${mode} mode; never run — this store has no day before ${today} yet`
498
542
  : `${mode} mode; never run — it is the first part of the next nightly run, before the dream (${about})${dreamingSetting(store) === "off" ? "; dreaming is off, so the nightly run does not start" : ""}`,
@@ -538,10 +582,10 @@ export function pageWriterFindings(store: Store, config: AdapterConfig): Finding
538
582
  finding(
539
583
  "page-writer",
540
584
  bad || overdue ? "amber" : "green",
541
- "Page writer",
585
+ "Day's end",
542
586
  detail,
543
587
  bad || overdue
544
- ? "counterparts mechanisms --all --dir <store> --observer shows the run's own row. The page writer is the first part of the nightly run, before the dream: counterparts dream shows whether the runs are happening and how each ended. counterparts self-page --write amends the page by hand meanwhile."
588
+ ? "counterparts mechanisms --all --dir <store> --observer shows the run's own row. Day's end is the first part of the nightly run, before the dream: counterparts dream shows whether the runs are happening and how each ended. counterparts self-page --write amends the page by hand meanwhile."
545
589
  : "",
546
590
  {
547
591
  ...data,
@@ -94,6 +94,8 @@ export {
94
94
  NIGHT_MCP_SCRIPT,
95
95
  NIGHT_MCP_SERVER,
96
96
  NIGHT_RUN_ENV,
97
+ NIGHT_SERVED_TOOLS,
98
+ NIGHT_SYSTEM_PROMPT,
97
99
  NIGHT_TOOLS,
98
100
  claudeCodeSeat,
99
101
  hostToolName,
@@ -109,6 +111,11 @@ export {
109
111
  readKind,
110
112
  readNightSpills,
111
113
  runNight,
114
+ NIGHT_DEBUG_DIR,
115
+ NIGHT_TRANSCRIPT_DAYS,
116
+ nightDebugDir,
117
+ pruneNightTranscripts,
118
+ writeNightTranscript,
112
119
  } from "./night-run.js";
113
120
  export type { ClaudeCodeAnswer, ClaudeCodeSeatInput, NightAnswer, NightChild, NightChildPlan, NightKind, NightRunInput, NightRunnerPlan, NightStarter } from "./night-run.js";
114
121
 
@@ -135,6 +142,7 @@ export {
135
142
  WAKE_HEAD_MAX_LINES,
136
143
  attributePeers,
137
144
  classifyBlock,
145
+ childUsage,
138
146
  expansionIdsOf,
139
147
  parseToolSpills,
140
148
  parseTranscript,