counterparts 0.3.30 → 0.3.31
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.
- package/CHANGELOG.md +90 -0
- package/docs/module-map.md +2 -1
- package/package.json +1 -1
- package/src/adapters/claude-code/bin/runner.ts +12 -5
- package/src/adapters/claude-code/doctor-upgrades.ts +37 -2
- package/src/adapters/claude-code/doctor.ts +33 -2
- package/src/adapters/claude-code/night-run.ts +53 -3
- package/src/adapters/cli/CONTRACT.md +12 -0
- package/src/adapters/cli/commands-project.ts +118 -0
- package/src/adapters/cli/commands.ts +12 -1
- package/src/adapters/cli/help.ts +2 -0
- package/src/adapters/config.ts +10 -0
- package/src/adapters/dashboard/NOTES.md +34 -0
- package/src/adapters/dashboard/registries.ts +3 -0
- package/src/adapters/dashboard/web/README.md +2 -2
- package/src/adapters/dashboard/web/app.html +2 -0
- package/src/adapters/dashboard/web/flow.ts +1 -0
- package/src/adapters/dashboard/web/lanes.ts +3 -0
- package/src/adapters/dashboard/web/narrate.ts +13 -0
- package/src/adapters/dashboard/web/pages/self/index.js +1 -0
- package/src/adapters/dashboard/web/pages/self/self.css +3 -0
- package/src/adapters/dashboard/web/pages/subjects/index.js +295 -0
- package/src/adapters/dashboard/web/pages/subjects/subjects.css +67 -0
- package/src/adapters/dashboard/web/server.ts +17 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +12 -0
- package/src/adapters/dashboard/web/shared/modal.css +4 -0
- package/src/adapters/dashboard/web/shell/pages.js +2 -1
- package/src/adapters/dashboard/web/views/memory.ts +37 -0
- package/src/adapters/dashboard/web/views/subjects.ts +614 -0
- package/src/adapters/dashboard/web/views.ts +2 -0
- package/src/adapters/fired.ts +3 -0
- package/src/adapters/lifecycle.ts +2 -0
- package/src/adapters/mcp/CONTRACT.md +23 -0
- package/src/adapters/mcp/INTERFACE-GAPS.md +2 -2
- package/src/adapters/mcp/NOTES.md +34 -0
- package/src/adapters/mcp/facts.ts +3 -2
- package/src/adapters/mcp/server-args.ts +51 -1
- package/src/adapters/mcp/server-self-tools.ts +75 -4
- package/src/adapters/mcp/server-session-end.ts +11 -1
- package/src/adapters/mcp/server-words.ts +1 -1
- package/src/adapters/mcp/server.ts +34 -0
- package/src/adapters/mcp/tools.ts +106 -7
- package/src/core/counterpart-boundary.ts +65 -6
- package/src/core/counterpart-deposit.ts +49 -2
- package/src/core/counterpart-events.ts +21 -0
- package/src/core/counterpart-projects.ts +198 -0
- package/src/core/counterpart-sweep.ts +4 -1
- package/src/core/counterpart-types.ts +24 -0
- package/src/core/counterpart.ts +238 -11
- package/src/core/dream/CONTRACT.md +58 -1
- package/src/core/dream/NOTES.md +139 -0
- package/src/core/dream/index.ts +38 -3
- package/src/core/dream/project-ask.ts +242 -0
- package/src/core/dream/reflect.ts +719 -10
- package/src/core/dream/tags.ts +346 -0
- package/src/core/dream/tunables.ts +42 -0
- package/src/core/dream/unmarked.ts +3 -2
- package/src/core/handoff/last-here.ts +4 -2
- package/src/core/mint.ts +2 -0
- package/src/core/physics/CONTRACT.md +84 -0
- package/src/core/physics/NOTES.md +50 -0
- package/src/core/physics/index.ts +282 -6
- package/src/core/recall/CONTRACT.md +16 -0
- package/src/core/recall/NOTES.md +41 -0
- package/src/core/recall/activate.ts +20 -0
- package/src/core/recall/gate.ts +45 -2
- package/src/core/recall/index.ts +24 -3
- package/src/core/recall/tunables.ts +24 -0
- package/src/core/reconsolidation.ts +40 -6
- package/src/core/remember/proposals.ts +9 -0
- package/src/core/revision.ts +41 -2
- package/src/core/schemas/CONTRACT.md +51 -4
- package/src/core/schemas/INTERFACE-GAPS.md +5 -0
- package/src/core/schemas/NOTES.md +158 -0
- package/src/core/schemas/index.ts +648 -30
- package/src/core/schemas/tags.ts +299 -0
- package/src/core/schemas/tunables.ts +94 -0
- package/src/core/schemas/types.ts +109 -0
- package/src/core/seat.ts +4 -2
- package/src/core/self/CONTRACT.md +15 -1
- package/src/core/self/INTERFACE-GAPS.md +2 -1
- package/src/core/self/NOTES.md +79 -0
- package/src/core/self/identity.ts +17 -8
- package/src/core/self/index.ts +3 -0
- package/src/core/self/tunables.ts +19 -0
- package/src/core/self/work.ts +266 -33
- package/src/core/sleep/CONTRACT.md +6 -1
- package/src/core/sleep/INTERFACE-GAPS.md +6 -0
- package/src/core/sleep/NOTES.md +101 -0
- package/src/core/sleep/births.ts +7 -1
- package/src/core/sleep/consolidate.ts +11 -2
- package/src/core/sleep/cycle.ts +140 -9
- package/src/core/sleep/index.ts +4 -0
- package/src/core/sleep/lease.ts +187 -0
- package/src/core/sleep/tags.ts +62 -0
- package/src/core/sleep/tunables.ts +20 -0
- package/src/core/sleep/types.ts +46 -0
- package/src/core/store/CONTRACT.md +23 -6
- package/src/core/store/NOTES.md +116 -0
- package/src/core/store/errors.ts +6 -0
- package/src/core/store/index.ts +464 -14
- package/src/core/store/marks.ts +6 -2
- package/src/core/store/operational.ts +331 -7
- package/src/core/store/owner-op-seam.ts +50 -1
- package/src/core/store/reads-marks.ts +7 -0
- package/src/core/store/reads-memories.ts +57 -1
- package/src/core/store/shapes.ts +16 -1
- package/src/core/store/tag-reads.ts +226 -0
- package/src/core/store/wave2.ts +380 -0
- package/src/core/tag-screen.ts +51 -0
- package/src/core/types.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,95 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.31 — 2026-10-22
|
|
4
|
+
|
|
5
|
+
This release changes the store's format (v13 to v14), so **after installing, quit the dashboard and every open Claude Code session, then start them again**: one left running from before the update keeps the old code against the upgraded store and stops working on it (the dashboard answers with errors) until it is restarted; an older version that opens the store afresh refuses it plainly. The first open saves a copy of your store before upgrading it, and doctor gains one green line saying what the upgrade did. Going back to 0.3.30 is `counterparts rollback` (it puts that copy back; anything written since is set aside, not deleted), then 0.3.30's install and `counterparts connect` as it prints. What you will see: the dashboard has a subjects tab, a page for every person, project, place and topic your memories name, under a tag cloud. Memories can carry a few tags, and each night tidies them and, in a short separate step on a small model, tags memories that have none and sorts cards into person, project, place or topic. The night's reflection and dream start forming beliefs from real memories; nothing shows them in sessions, the wake or the core yet. Related folders can be one project (`counterparts project join`, or a yes when the morning share asks), and craft learned in one folder takes turns in every folder's "Work here"; work from another project needs a slightly stronger match to come up while you talk. Two fixes: one nightly cycle at a time per store, and a name no longer gets two cards (cards already doubled stay doubled for now). The night's tag work and the beliefs are each one switch in the tunables (`schemas.TAGS_NIGHT`, `schemas.BELIEFS_BIRTH`), both on. Store v14, cache v7 unchanged; no wiring change, so `counterparts connect` is not needed after upgrading.
|
|
6
|
+
|
|
7
|
+
- **The store moves to schema v14, room for what comes next.** The first open after the
|
|
8
|
+
upgrade saves a copy of your store first, as every upgrade does, then adds empty places
|
|
9
|
+
for tags, beliefs and what supports them, which project a folder belongs to, and what
|
|
10
|
+
each recall showed; nothing uses them yet. People and places among your cards are marked
|
|
11
|
+
as such, and so are new ones as they are made. The old confidential column is removed,
|
|
12
|
+
after the memories still marked are counted (the count `counterparts doctor` already
|
|
13
|
+
shows). Doctor has one green line saying what the upgrade did.
|
|
14
|
+
- **Restart what was left running across this update.** An older version refuses the
|
|
15
|
+
upgraded store when it opens it, but one that already had it open does not: a dashboard
|
|
16
|
+
or a Claude Code session started before the update stops working on it (the dashboard
|
|
17
|
+
answers with errors) until it is restarted. The way back to the older version is the
|
|
18
|
+
saved copy (`counterparts rollback`).
|
|
19
|
+
- **Memories can carry a few tags.** `remember` and each `session_end` entry take an
|
|
20
|
+
optional `tags` list — a few words for what the memory is about (a topic, a person, a
|
|
21
|
+
project). They are stored with the memory; a revision keeps its memory's tags unless it
|
|
22
|
+
sends its own. Nothing about recall changes yet: the tags are the start of topics that
|
|
23
|
+
grow into subjects.
|
|
24
|
+
- **A subjects tab on the dashboard.** Every person, project, place and topic your memories
|
|
25
|
+
name has a page: its kind, name and other names, what I believe about it (each belief with
|
|
26
|
+
how strongly it is held, how many memories hold it up and those memories, one tap away),
|
|
27
|
+
what it often comes up with, and the newest memories that mention it. `#subjects/me` is the
|
|
28
|
+
page of what I believe about myself and about us, linked from the self tab. Above them, an
|
|
29
|
+
old-school tag cloud: subjects in bright type (tap to open the page), tags beside them (tap
|
|
30
|
+
to see their memories), each sized by the memories behind it; point at a word to light up
|
|
31
|
+
the words it comes up with. Until memories carry tags, the cloud is the subjects alone. A
|
|
32
|
+
memory card for a subject, or a belief about one, links to the page. Nothing here writes.
|
|
33
|
+
- **Beliefs can be earned.** A belief now starts weak, whoever writes it, and grows only
|
|
34
|
+
as lived memories back it: your own words about it, my real choices, use at work, and
|
|
35
|
+
older memories a reflection connects (a little less, until life echoes them). Each memory
|
|
36
|
+
counts once per belief, and memories from the same day, conversation or folder count less.
|
|
37
|
+
A memory that goes against a belief presses on it the way a correction always has. Nothing
|
|
38
|
+
writes beliefs yet, and none are shown anywhere: not in recall, not in the wake, not in
|
|
39
|
+
the core.
|
|
40
|
+
- **Folders can be one project, and craft follows you.** `counterparts project join <folder>
|
|
41
|
+
<project>` puts related folders (say a product and its website) in one project, and each
|
|
42
|
+
one's wake then shows the work of all of them under "Work here" — the folder you are in
|
|
43
|
+
keeps at least half the lines; a folder set off or paused shares nothing. A skill written
|
|
44
|
+
from now on with no mark (or marked world) is craft: a couple of places in every folder's
|
|
45
|
+
"Work here" take turns showing craft learned elsewhere, saying where, from folders whose
|
|
46
|
+
setting is on. Skills written before keep their folder. `counterparts project list` and `leave` read
|
|
47
|
+
and undo it. Off: `PROJECTS_TRAVEL` in the self tunables.
|
|
48
|
+
- **The night tidies tags and grows topics from them.** Each night, memories linked to a
|
|
49
|
+
person's or project's card carry its name as a tag; tags that are the same word in another
|
|
50
|
+
form are merged; and a short separate step on a small model tags memories that have none,
|
|
51
|
+
asks whether two look-alike tags are one topic, and sorts cards into person, project,
|
|
52
|
+
place or topic. A tag that keeps coming up — on several days, in several sessions, more
|
|
53
|
+
so when it was used or felt — becomes a topic of its own. Recall and the wake don't use
|
|
54
|
+
tags or topics yet.
|
|
55
|
+
- **Another project's work comes to mind a little less readily.** While you talk, a memory
|
|
56
|
+
that is work from a folder outside this folder's project needs a slightly stronger match
|
|
57
|
+
to come up (`CROSS_PROJECT_BAR_LIFT`, 1.25; 1 turns it off). Personal things and craft
|
|
58
|
+
are not affected, and a folder joined to this one's project counts as here. The recall
|
|
59
|
+
record counts what the higher bar held back, for a review after a week. A stricter
|
|
60
|
+
switch that leaves such work out entirely (`RECALL_BY_PROJECT`) is built and off.
|
|
61
|
+
- **The night may ask whether two folders are one project.** When two folders were worked
|
|
62
|
+
in on the same days and their memories name the same things, the morning share asks once
|
|
63
|
+
whether to treat them as one project; a yes joins them (as `counterparts project join`
|
|
64
|
+
would), a no is left alone for a week. Off: `PROJECT_JOIN_ASK` in the dream tunables.
|
|
65
|
+
- **The night's reflection starts forming beliefs.** After a dream, the reflection is shown
|
|
66
|
+
what I hold about the people and things in play, and about me and us, and may back a
|
|
67
|
+
belief with a memory that fits, note a memory that goes against one, or write a few new
|
|
68
|
+
ones, each resting on real memories and starting weak. A belief that met more against
|
|
69
|
+
it than for it can be let go. Beliefs are still not shown in sessions, the wake or the
|
|
70
|
+
core. The owner can turn this off with one setting.
|
|
71
|
+
- **Beliefs from the dream, from the moment, and the owner's word.** The dream may now
|
|
72
|
+
suggest a belief it sees across several memories; it never makes one, and the morning's
|
|
73
|
+
reflection keeps it or lets it go. A session can write one in the moment, rarely, from
|
|
74
|
+
the owner's own words, a real choice, or a strongly felt moment. And when the owner says
|
|
75
|
+
a belief is wrong, it is let go at once, its history kept. Beliefs are still not shown in
|
|
76
|
+
sessions, the wake or the core.
|
|
77
|
+
- **One nightly cycle at a time.** When a session closed, its two end-of-session workers
|
|
78
|
+
could both run the night's cycle at once: the card births ran twice (the doubled cards)
|
|
79
|
+
and the wake was rendered twice. The cycle now holds the memory while it runs, and a
|
|
80
|
+
second worker that arrives meanwhile still saves its associations, then leaves the cycle
|
|
81
|
+
to the first, at once, and says so in the log. A worker that died mid-cycle gives way
|
|
82
|
+
after ten minutes, and the next cycle finishes its work.
|
|
83
|
+
- **A name no longer gets two cards.** When a session closed, its two end-of-session
|
|
84
|
+
workers could both run the night's card births at once, and each gave the same names a
|
|
85
|
+
card of its own: Google and Google, Bash and Bash, all with the same birth day. A card is
|
|
86
|
+
now born only after checking, with the store locked, that no other process has just made
|
|
87
|
+
it. Cards already doubled stay doubled for now; merging them comes separately.
|
|
88
|
+
- **For code that embeds Counterparts:** new exports, nothing removed. `counterparts`
|
|
89
|
+
adds `SLEEP_CYCLE_HELD_EVENT`; `counterparts/store` adds `BIRTH_ROUTES`,
|
|
90
|
+
`CRAFT_BORN_META`, `SUBJECT_KINDS`, `V14_UPGRADE_KEY`, `backfillSubjectKinds`,
|
|
91
|
+
`normalizeTag` and `retireConfidentialColumn`.
|
|
92
|
+
|
|
3
93
|
## 0.3.30 — 2026-10-21
|
|
4
94
|
|
|
5
95
|
Nothing is held back from your sessions any more. Confidential memories are gone: nothing in Counterparts could set that mark, so on most stores nothing changes on screen; a memory marked that way through the store directly now reads like any other everywhere, and doctor shows one amber line with how many remain only if your store had any. The split between your sessions and guest ones is gone too: any session, a Claude Desktop chat and the nightly run included, can close a thread or a reminder by its id from any folder (a protected memory still never closes), and every session gets its folder's "Last said here"; observer stays read-only. The nightly run no longer leaves a Claude Code transcript under `~/.claude/projects/`; transcripts from earlier nights are left to Claude Code's own cleanup, or you can delete the folder named after your memory store. The `owner` line in your configuration is now ignored and doctor names it under "Old settings" (you may delete it); `export --include-confidential`, the memory server's `--owner` and `COUNTERPARTS_OWNER` are accepted and ignored for this release. Code that embeds Counterparts loses the confidential fields and options listed below. No store-format change (store v13, cache v7) and no wiring change: nothing to run after upgrading from 0.3.29, and `counterparts connect` is not needed.
|
package/docs/module-map.md
CHANGED
|
@@ -67,7 +67,8 @@ boundary, the sweep fallback and the deposit in `counterpart-boundary.ts`,
|
|
|
67
67
|
`counterpart-sweep.ts` and `counterpart-deposit.ts`. `core/store/index.ts` keeps the class
|
|
68
68
|
and every write; `marks.ts`, `shapes.ts` and `index-text.ts` hold its marks, shapes and
|
|
69
69
|
index text, and `reads-memories.ts`, `reads-marks.ts` and `reads-history.ts` the bodies of
|
|
70
|
-
its public reads
|
|
70
|
+
its public reads; `wave2.ts` holds the bodies of the v14 tables' reads and writes (each write
|
|
71
|
+
entered through the class's `mutate`). `mcp/server.ts` keeps the class; `server-words.ts`, `server-options.ts`
|
|
71
72
|
and `server-args.ts` hold its words, options and argument readers, and
|
|
72
73
|
`server-session-end.ts` and `server-self-tools.ts` the bodies of five of its tools.
|
|
73
74
|
`cli/commands.ts` keeps the dispatcher, the help, and the repair that reads through the
|
package/package.json
CHANGED
|
@@ -463,11 +463,18 @@ export async function runOnce(input: {
|
|
|
463
463
|
} catch {
|
|
464
464
|
/* the held page stays on its refusal row for the next boundary */
|
|
465
465
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
466
|
+
// NOT WHEN THE CYCLE STOOD ASIDE (`sleep/lease.ts`, review of #581): the
|
|
467
|
+
// cycle holding the store renders the wake, and this worker's refresh
|
|
468
|
+
// would render it a second time beside it.
|
|
469
|
+
if (report.cycle.held === undefined) {
|
|
470
|
+
try {
|
|
471
|
+
const wake = counterpart.refreshWake({ at: today });
|
|
472
|
+
if (wake.reason !== "current") emit("runner.wake", { reason: wake.reason, triggers: wake.triggers.join(","), bytes: wake.bytes });
|
|
473
|
+
} catch (err) {
|
|
474
|
+
noteFailure(counterpart, emit, err instanceof Error ? err.name : "UNKNOWN", "wake", today);
|
|
475
|
+
}
|
|
476
|
+
} else {
|
|
477
|
+
emit("runner.wake", { reason: "held-elsewhere", triggers: "", bytes: 0 });
|
|
471
478
|
}
|
|
472
479
|
result = {
|
|
473
480
|
ran: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** `doctor`'s findings on the store upgrades v8 to v11, read from what each upgrade recorded (moved out of `doctor.ts`, 2026-10-11). */
|
|
2
|
-
import { CONFIDENTIAL_RETIRED_KEY, Store, rowTombstoned } from "../../core/store/index.js";
|
|
1
|
+
/** `doctor`'s findings on the store upgrades v8 to v11 and v14, read from what each upgrade recorded (moved out of `doctor.ts`, 2026-10-11). */
|
|
2
|
+
import { CONFIDENTIAL_RETIRED_KEY, Store, V14_UPGRADE_KEY, rowTombstoned } from "../../core/store/index.js";
|
|
3
3
|
import { finding } from "./doctor-finding.js";
|
|
4
4
|
import type { Finding } from "./doctor-finding.js";
|
|
5
5
|
|
|
@@ -234,6 +234,41 @@ export function upgradeV11Findings(store: Store): Finding[] {
|
|
|
234
234
|
];
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
/**
|
|
238
|
+
* WHAT THE v14 UPGRADE DID (2026-10-21, wave 2's one bump), informational:
|
|
239
|
+
* the retired confidential column was dropped (after its count, when no
|
|
240
|
+
* open had taken it), the new tables for tags, belief support, projects and
|
|
241
|
+
* recall turns are there and empty, and the cards whose kind of subject is
|
|
242
|
+
* not a judgement have theirs. Silent on a store born at v14.
|
|
243
|
+
*/
|
|
244
|
+
export function upgradeV14Findings(store: Store): Finding[] {
|
|
245
|
+
const upgrade = metaJson(store, V14_UPGRADE_KEY);
|
|
246
|
+
if (upgrade === null) return [];
|
|
247
|
+
const dropped = upgrade["confidentialDropped"] === true;
|
|
248
|
+
const counted = typeof upgrade["confidentialCounted"] === "number" ? upgrade["confidentialCounted"] : null;
|
|
249
|
+
const raw = upgrade["subjects"];
|
|
250
|
+
const subjects: Record<string, number> = {};
|
|
251
|
+
if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
|
|
252
|
+
for (const [k, v] of Object.entries(raw as Record<string, unknown>)) subjects[k] = metaNum(v);
|
|
253
|
+
}
|
|
254
|
+
const people = subjects["person"] ?? 0;
|
|
255
|
+
const places = subjects["place"] ?? 0;
|
|
256
|
+
const given = `${String(people)} ${people === 1 ? "card" : "cards"} marked a person, ${String(places)} a place; the rest wait for the night`;
|
|
257
|
+
const column = dropped
|
|
258
|
+
? `the retired confidential column dropped${counted === null ? "" : ` (${String(counted)} marked ${counted === 1 ? "memory" : "memories"} counted first)`}`
|
|
259
|
+
: "no confidential column to drop";
|
|
260
|
+
return [
|
|
261
|
+
finding(
|
|
262
|
+
"upgrade-v14",
|
|
263
|
+
"green",
|
|
264
|
+
"Upgrade",
|
|
265
|
+
`Upgrade to v14: room for tags, beliefs and their support, projects and what recall showed (empty until they are used) — ${column}; ${given}`,
|
|
266
|
+
"",
|
|
267
|
+
{ confidentialDropped: dropped, confidentialCounted: counted ?? -1, people, places },
|
|
268
|
+
),
|
|
269
|
+
];
|
|
270
|
+
}
|
|
271
|
+
|
|
237
272
|
/**
|
|
238
273
|
* THE CONFIDENTIAL MARK, RETIRED (2026-10-21): the memories that carried it
|
|
239
274
|
* when this build first opened the store (`CONFIDENTIAL_RETIRED_KEY`, counted
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
RUNNER_FAILED_EVENT,
|
|
57
57
|
SELF_BRIEFING_EVENT,
|
|
58
58
|
SLEEP_CYCLE_EVENT,
|
|
59
|
+
SLEEP_CYCLE_HELD_EVENT,
|
|
59
60
|
SNAPSHOT_FAILED_EVENT,
|
|
60
61
|
SNAPSHOT_TAKEN_EVENT,
|
|
61
62
|
SPAWN_FAILED_EVENT,
|
|
@@ -74,7 +75,7 @@ import {
|
|
|
74
75
|
} from "../../core/store/index.js";
|
|
75
76
|
import { heldCorrections } from "../../core/reconsolidation.js";
|
|
76
77
|
import { bundledModelDir } from "../runtime.js";
|
|
77
|
-
import { TUNABLES as SLEEP_TUNABLES, acceptsReflectedFeeling, laterFeelingWasAwake, laterFeelingWasReflections, selfRelevantFeeling } from "../../core/sleep/index.js";
|
|
78
|
+
import { CYCLE_LEASE_KEY, leaseStale, readLease, TUNABLES as SLEEP_TUNABLES, acceptsReflectedFeeling, laterFeelingWasAwake, laterFeelingWasReflections, selfRelevantFeeling } from "../../core/sleep/index.js";
|
|
78
79
|
import { TUNABLES as ASSOCIATE_TUNABLES, isDead, pairKey } from "../../core/associate/index.js";
|
|
79
80
|
import type { EventRow } from "../../core/store/index.js";
|
|
80
81
|
// The ask allowance the amber hint names, read rather than retyped: a number in
|
|
@@ -131,6 +132,7 @@ import {
|
|
|
131
132
|
upgradeV9Findings,
|
|
132
133
|
upgradeV10Findings,
|
|
133
134
|
upgradeV11Findings,
|
|
135
|
+
upgradeV14Findings,
|
|
134
136
|
confidentialRetiredFindings,
|
|
135
137
|
} from "./doctor-upgrades.js";
|
|
136
138
|
import {
|
|
@@ -166,6 +168,7 @@ export {
|
|
|
166
168
|
upgradeV9Findings,
|
|
167
169
|
upgradeV10Findings,
|
|
168
170
|
upgradeV11Findings,
|
|
171
|
+
upgradeV14Findings,
|
|
169
172
|
confidentialRetiredFindings,
|
|
170
173
|
} from "./doctor-upgrades.js";
|
|
171
174
|
export {
|
|
@@ -1004,6 +1007,22 @@ function boundaryAge(store: Store, today: string): "never" | "today" | "earlier"
|
|
|
1004
1007
|
: "today";
|
|
1005
1008
|
}
|
|
1006
1009
|
|
|
1010
|
+
/**
|
|
1011
|
+
* A CYCLE LEASE THAT IS STUCK (review of #581, `sleep/lease.ts`): a boundary
|
|
1012
|
+
* stood aside after the newest cycle row (its `sleep.cycle.held` row is newer),
|
|
1013
|
+
* and the lease it stood aside for no longer holds — run out, its holder's pid
|
|
1014
|
+
* gone, or taken "in the future" / further ahead than a lease lasts (a clock that
|
|
1015
|
+
* jumped). The next cycle takes such a lease over by itself; this says that one
|
|
1016
|
+
* is due. Null: nothing stuck, or nothing to tell.
|
|
1017
|
+
*/
|
|
1018
|
+
function stuckLease(store: Store, livedDay: number, cycle: EventRow): string | null {
|
|
1019
|
+
const held = newestRows(store, SLEEP_CYCLE_HELD_EVENT, 1, livedDay).rows[0];
|
|
1020
|
+
if (held === undefined || held.seq < cycle.seq) return null;
|
|
1021
|
+
const lease = readLease(store.getMeta(CYCLE_LEASE_KEY));
|
|
1022
|
+
if (lease === null) return null;
|
|
1023
|
+
return leaseStale(lease, store.now());
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1007
1026
|
/** The newest row of each family the background half leaves behind. */
|
|
1008
1027
|
function rowFindings(input: DoctorInput, store: Store): Finding[] {
|
|
1009
1028
|
const livedDay = store.livedDay();
|
|
@@ -1097,12 +1116,22 @@ function rowFindings(input: DoctorInput, store: Store): Finding[] {
|
|
|
1097
1116
|
// `reason` is "ran" | "clock-failed" | "threw" (`counterpart.ts#recordSleepCycle`),
|
|
1098
1117
|
// so anything but "ran" is a night that did not happen, not a cadence.
|
|
1099
1118
|
const data = { reason, failed, date: rowDate(cycle), budgetTruncated: truncated.length };
|
|
1119
|
+
const stuck = reason === "ran" && failed === 0 ? stuckLease(store, livedDay, cycle) : null;
|
|
1100
1120
|
out.push(
|
|
1101
1121
|
reason !== "ran"
|
|
1102
1122
|
? finding("sleep", "red", "Sleep", detail, "The nightly cycle is not completing — decay, prune, dedup and consolidate are not running.", data)
|
|
1103
1123
|
: failed > 0
|
|
1104
1124
|
? finding("sleep", "amber", "Sleep", detail, "A phase failed; the row names it.", data)
|
|
1105
|
-
:
|
|
1125
|
+
: stuck !== null
|
|
1126
|
+
? finding(
|
|
1127
|
+
"sleep",
|
|
1128
|
+
"amber",
|
|
1129
|
+
"Sleep",
|
|
1130
|
+
`${detail}; since then a cycle stood aside for a lease that no longer holds (${stuck})`,
|
|
1131
|
+
"The next cycle takes a stale lease over by itself; if this stays, the store's sleep.lease row is what is stuck.",
|
|
1132
|
+
{ ...data, lease: stuck },
|
|
1133
|
+
)
|
|
1134
|
+
: finding("sleep", "green", "Sleep", detail, "", data),
|
|
1106
1135
|
);
|
|
1107
1136
|
}
|
|
1108
1137
|
|
|
@@ -3384,6 +3413,8 @@ export function doctorFindings(input: DoctorInput): Finding[] {
|
|
|
3384
3413
|
// v10 (2026-09-29): what the upgrade carried, and the week's contradictions.
|
|
3385
3414
|
["upgrade-v10", () => upgradeV10Findings(store)],
|
|
3386
3415
|
["upgrade-v11", () => upgradeV11Findings(store)],
|
|
3416
|
+
// v14 (2026-10-21): the drop, the new tables, the cards' subject kinds.
|
|
3417
|
+
["upgrade-v14", () => upgradeV14Findings(store)],
|
|
3387
3418
|
// 2026-10-21: memories that carried the retired confidential mark, counted once. Silent at 0.
|
|
3388
3419
|
["confidential-retired", () => confidentialRetiredFindings(store)],
|
|
3389
3420
|
// v12 (2026-10-03): the writer's three fields, and the subject links. Two aggregates.
|
|
@@ -84,7 +84,8 @@ import { randomUUID } from "node:crypto";
|
|
|
84
84
|
|
|
85
85
|
import { Counterpart, MCP_SPILLED_EVENT, seatAsk } from "../../core/counterpart.js";
|
|
86
86
|
import type { CounterpartEvent, Seat, SeatAnswer, SeatAsk, SeatTool } from "../../core/counterpart.js";
|
|
87
|
-
import { CATCH_UP_ONLY_REASONS } from "../../core/dream/index.js";
|
|
87
|
+
import { CATCH_UP_ONLY_REASONS, tagsBundle, tagsPrompt } from "../../core/dream/index.js";
|
|
88
|
+
import { TUNABLES as SCHEMAS_TUNABLES } from "../../core/schemas/index.js";
|
|
88
89
|
import type { CatchUpOnlyReason, NightChildRun, NightPart, NightRun } from "../../core/dream/index.js";
|
|
89
90
|
import { CONFIG_ENV as CONFIG_PATH_ENV } from "../config-path.js";
|
|
90
91
|
import { entryScript, scriptArgs } from "../runtime.js";
|
|
@@ -286,7 +287,11 @@ export function nightTimeoutMs(config: AdapterConfig): number {
|
|
|
286
287
|
*/
|
|
287
288
|
export function nightChildrenTimeoutMs(config: AdapterConfig, kind: NightKind["kind"]): number {
|
|
288
289
|
const one = nightTimeoutMs(config);
|
|
289
|
-
|
|
290
|
+
if (kind !== "night") return one;
|
|
291
|
+
// A whole night's third child, the tagging (2026-10-21), under its own
|
|
292
|
+
// short watchdog — only while the night's tag work is on (read at use).
|
|
293
|
+
const tags = SCHEMAS_TUNABLES.TAGS_NIGHT ? TUNABLES.NIGHT_TAGS_MS + KILL_GRACE_MS + REAP_GRACE_MS : 0;
|
|
294
|
+
return 2 * one + KILL_GRACE_MS + REAP_GRACE_MS + tags;
|
|
290
295
|
}
|
|
291
296
|
|
|
292
297
|
/**
|
|
@@ -376,6 +381,8 @@ export interface NightChildInput {
|
|
|
376
381
|
/** Its turn ceiling and watchdog; absent, the night's own (`nightMaxTurns`, `nightTimeoutMs`). */
|
|
377
382
|
readonly maxTurns?: number;
|
|
378
383
|
readonly timeoutMs?: number;
|
|
384
|
+
/** The model it runs on; absent, the night's (`dreaming.model`), else the host's default. The tagging child's is `NIGHT_TAGS_MODEL`. */
|
|
385
|
+
readonly model?: string;
|
|
379
386
|
/**
|
|
380
387
|
* The child's OWN session id, a fresh UUID (`--session-id`, 2026-10-09).
|
|
381
388
|
* Absent, the host mints one (the catch-up child and the plain retry).
|
|
@@ -400,7 +407,7 @@ export function planNightChild(input: NightChildInput): NightChildPlan {
|
|
|
400
407
|
const command = input.command ?? DEFAULT_HOST_COMMAND;
|
|
401
408
|
const env: Record<string, string> = {};
|
|
402
409
|
for (const [k, v] of Object.entries(input.baseEnv ?? process.env)) if (v !== undefined) env[k] = v;
|
|
403
|
-
const model = input.config.dreaming?.model;
|
|
410
|
+
const model = input.model ?? input.config.dreaming?.model;
|
|
404
411
|
const dataDir = input.config.dataDir ?? "";
|
|
405
412
|
const args = [
|
|
406
413
|
"-p",
|
|
@@ -657,6 +664,14 @@ export async function runNight(input: NightRunInput): Promise<NightRun> {
|
|
|
657
664
|
}
|
|
658
665
|
}
|
|
659
666
|
}
|
|
667
|
+
// THE TAGGING, A THIRD CHILD (2026-10-21, wave 2 lane B): after the
|
|
668
|
+
// reflection, small and on a small model, outside the dream's room. Its
|
|
669
|
+
// exit never becomes the run's: a night is its dream and its reflection.
|
|
670
|
+
// Nothing to ask is no child and no line on the row.
|
|
671
|
+
if (input.kind.kind === "night") {
|
|
672
|
+
const tags = await tagsAfter(input.open, seat, (text) => seatAsk("tags", { prompt: text, run: input.run, session: input.session, scope: input.scope, limits: { turns: TUNABLES.NIGHT_TAGS_MAX_TURNS, ms: TUNABLES.NIGHT_TAGS_MS } }), input.session);
|
|
673
|
+
if (tags !== null) children.push(tags);
|
|
674
|
+
}
|
|
660
675
|
const ms = now() - startedAt;
|
|
661
676
|
// THE RUN'S EXIT, from its children: stopped if any was stopped; the first
|
|
662
677
|
// non-zero exit, else the last child's. Its code is that child's own (a
|
|
@@ -877,6 +892,8 @@ export function claudeCodeSeat(input: ClaudeCodeSeatInput): Seat<ClaudeCodeAnswe
|
|
|
877
892
|
tools: ask.tools.map(hostToolName),
|
|
878
893
|
...(ask.withhold.length === 0 ? {} : { deny: ask.withhold.map(hostToolName) }),
|
|
879
894
|
...(ask.act === "catch-up" ? {} : { child: ask.act }),
|
|
895
|
+
// The tagging child on the host's fastest model (read at use).
|
|
896
|
+
...(ask.act === "tags" ? { model: TUNABLES.NIGHT_TAGS_MODEL } : {}),
|
|
880
897
|
...(ask.limits?.turns === undefined ? {} : { maxTurns: ask.limits.turns }),
|
|
881
898
|
...(ask.limits?.ms === undefined ? {} : { timeoutMs: ask.limits.ms }),
|
|
882
899
|
...(input.configPath === undefined ? {} : { configPath: input.configPath }),
|
|
@@ -1000,6 +1017,39 @@ async function runNightChild(
|
|
|
1000
1017
|
return { result, ms, neverStarted, spill };
|
|
1001
1018
|
}
|
|
1002
1019
|
|
|
1020
|
+
/**
|
|
1021
|
+
* THE TAGGING CHILD (2026-10-21, wave 2 lane B), decided and run. Not
|
|
1022
|
+
* started, and no line on the row, when the night's tag work is switched off
|
|
1023
|
+
* (`schemas.TAGS_NIGHT`, read at use) or there is nothing to ask (no untagged
|
|
1024
|
+
* memory, no look-alike pair, no card without a kind — no tokens spent): a
|
|
1025
|
+
* night's row reads as it did before the child existed. Skipped and said when
|
|
1026
|
+
* the store will not open. Otherwise one ask to the seat. Never throws.
|
|
1027
|
+
*/
|
|
1028
|
+
async function tagsAfter(open: () => Counterpart, seat: Seat<NightAnswer>, ask: (prompt: string) => SeatAsk, session: string): Promise<NightChildRun | null> {
|
|
1029
|
+
if (!SCHEMAS_TUNABLES.TAGS_NIGHT) return null;
|
|
1030
|
+
let prompt: string;
|
|
1031
|
+
try {
|
|
1032
|
+
const c = open();
|
|
1033
|
+
try {
|
|
1034
|
+
const b = tagsBundle(c.store);
|
|
1035
|
+
if (b.memories.length === 0 && b.pairs.length === 0 && b.cards.length === 0) return null;
|
|
1036
|
+
prompt = tagsPrompt({ session });
|
|
1037
|
+
} finally {
|
|
1038
|
+
c.close();
|
|
1039
|
+
}
|
|
1040
|
+
} catch {
|
|
1041
|
+
return { child: "tags", code: null, ms: 0, skipped: "unread" };
|
|
1042
|
+
}
|
|
1043
|
+
try {
|
|
1044
|
+
const out = await seat.answer(ask(prompt));
|
|
1045
|
+
if (out.refused !== null) return { child: "tags", code: null, ms: 0, skipped: out.refused };
|
|
1046
|
+
if (!out.started) return { child: "tags", code: null, ms: 0, skipped: out.spawnCode === "ENOENT" ? "no-claude" : "spawn-failed" };
|
|
1047
|
+
return childRunOf("tags", out);
|
|
1048
|
+
} catch {
|
|
1049
|
+
return { child: "tags", code: null, ms: 0, skipped: "spawn-failed" };
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1003
1053
|
/**
|
|
1004
1054
|
* THE REFLECTION'S CHILD, DECIDED (2026-10-11), after the dream's child
|
|
1005
1055
|
* ended: its prompt, on tonight's journaled dream or (none journaled — the
|
|
@@ -651,6 +651,18 @@ unknown id or mark is refused by name; an archived memory is marked and said to
|
|
|
651
651
|
earlier version's id marks the current one. Reading works under observer; the change
|
|
652
652
|
refuses there. The dashboard's `about` action runs this command.
|
|
653
653
|
|
|
654
|
+
## 6b″. `project` (2026-10-21, wave 2 lane G)
|
|
655
|
+
|
|
656
|
+
**[M]** `counterparts project [list]` prints each project with a folder row and its folders;
|
|
657
|
+
`project join <folder> <project>` puts the folder in a project named by a word (a project
|
|
658
|
+
card of that name, or a new one — never another kind of card) or in another folder's project
|
|
659
|
+
(that folder is the project's first, `via: default`); `project leave <folder>` makes it its
|
|
660
|
+
own again. The whole disk and the store's own folder are refused, in the words typed; a
|
|
661
|
+
folder that does not exist yet is joined with a note. Typed folders resolve as the folder setting resolves them
|
|
662
|
+
(`scopes.ts#canonicalScopePath`, `~` expanded, no trailing slash), so they match the folder a
|
|
663
|
+
memory records. Through `Counterpart.joinProject` / `leaveProject`
|
|
664
|
+
(`core/counterpart-projects.ts`). Reading works under observer; join and leave refuse there.
|
|
665
|
+
|
|
654
666
|
## 6c. Claude Desktop (2026-09-30, host groundwork PR B)
|
|
655
667
|
|
|
656
668
|
**[M]** `install --host claude-desktop` makes the store and configuration exactly as the
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `project` — which folders are one piece of work (2026-10-21, wave 2 lane G,
|
|
3
|
+
* design §8). A folder is its own project until the owner joins it to another
|
|
4
|
+
* (`counterparts project join <folder> <project>`); then each folder's "Work
|
|
5
|
+
* here" in the wake reads every folder of the project (`core/self/work.ts`).
|
|
6
|
+
* With no words, or `list`, it reads; `join` and `leave` change it as the
|
|
7
|
+
* owner, through `Counterpart.joinProject` / `leaveProject`, and refuse under
|
|
8
|
+
* observer. A typed folder is resolved to the real directory the way the
|
|
9
|
+
* folder setting resolves it (`scopes.ts#canonicalScopePath`), so it matches
|
|
10
|
+
* the folder the hooks record a memory in.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
|
|
14
|
+
import { storeExists } from "../../core/store/index.js";
|
|
15
|
+
import { canonicalScopePath, shortPath } from "../scopes.js";
|
|
16
|
+
import { EXIT, openCounterpart } from "./commands-shared.js";
|
|
17
|
+
import type { Io, Parsed } from "./commands-shared.js";
|
|
18
|
+
|
|
19
|
+
/** A typed project argument that names a folder rather than a project by name. */
|
|
20
|
+
function looksLikeFolder(word: string): boolean {
|
|
21
|
+
return word.startsWith("/") || word.startsWith("~") || word.startsWith(".") || word.includes("/");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The folder as the hooks record it: resolved, real, no trailing slash. */
|
|
25
|
+
function folderOf(word: string, home: string): string {
|
|
26
|
+
const typed = word.startsWith("~/") || word === "~" ? `${home}${word.slice(1)}` : word;
|
|
27
|
+
return canonicalScopePath(typed).replace(/\/+$/, "") || "/";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function projectCommand(dir: string, io: Io, parsed: Parsed, observer: boolean, namedDir: boolean, home: string): number {
|
|
31
|
+
if (!storeExists(dir)) {
|
|
32
|
+
io.err(`No store at ${dir}. Run 'counterparts init${namedDir ? ` --dir ${dir}` : ""}' to create one.`);
|
|
33
|
+
return EXIT.usage;
|
|
34
|
+
}
|
|
35
|
+
const [verb = "list", ...args] = parsed.positional;
|
|
36
|
+
if (verb === "list") {
|
|
37
|
+
if (args.length > 0) {
|
|
38
|
+
io.err(`refused: list takes no words — "${args.join(" ")}" is more.`);
|
|
39
|
+
return EXIT.usage;
|
|
40
|
+
}
|
|
41
|
+
const counterpart = openCounterpart(dir, true);
|
|
42
|
+
try {
|
|
43
|
+
const projects = counterpart.projects();
|
|
44
|
+
if (projects.length === 0) {
|
|
45
|
+
io.out("Every folder is its own project. Join two with: counterparts project join <folder> <project or folder>");
|
|
46
|
+
return EXIT.ok;
|
|
47
|
+
}
|
|
48
|
+
for (const p of projects) {
|
|
49
|
+
io.out(`${p.name} (${p.id})`);
|
|
50
|
+
for (const f of p.folders) io.out(` ${shortPath(f.folder, home)}${f.via === "default" ? "" : ` — joined by ${f.via === "owner" ? "you" : "the night, on your yes"}`}`);
|
|
51
|
+
}
|
|
52
|
+
io.out("Any other folder is its own project.");
|
|
53
|
+
return EXIT.ok;
|
|
54
|
+
} finally {
|
|
55
|
+
counterpart.close();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (verb !== "join" && verb !== "leave") {
|
|
59
|
+
io.err(`refused: "${verb}" is not list, join or leave.`);
|
|
60
|
+
return EXIT.usage;
|
|
61
|
+
}
|
|
62
|
+
if (observer) {
|
|
63
|
+
io.err(`refused: this console is an observer; it reads and changes nothing. Nothing was ${verb === "join" ? "joined" : "changed"}.`);
|
|
64
|
+
return EXIT.refused;
|
|
65
|
+
}
|
|
66
|
+
if (verb === "leave") {
|
|
67
|
+
const [folder, ...rest] = args;
|
|
68
|
+
if (folder === undefined || rest.length > 0) {
|
|
69
|
+
io.err("refused: name one folder: counterparts project leave <folder>.");
|
|
70
|
+
return EXIT.usage;
|
|
71
|
+
}
|
|
72
|
+
const counterpart = openCounterpart(dir, observer);
|
|
73
|
+
try {
|
|
74
|
+
const out = counterpart.leaveProject(folderOf(folder, home));
|
|
75
|
+
io.out(
|
|
76
|
+
out.left === null
|
|
77
|
+
? `${shortPath(out.folder, home)} belonged to no project; it is its own, as before.`
|
|
78
|
+
: `${shortPath(out.folder, home)} left its project (${out.left}); it is its own project again.`,
|
|
79
|
+
);
|
|
80
|
+
return EXIT.ok;
|
|
81
|
+
} finally {
|
|
82
|
+
counterpart.close();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const [folder, project, ...rest] = args;
|
|
86
|
+
if (folder === undefined || project === undefined || rest.length > 0) {
|
|
87
|
+
io.err('refused: name a folder and a project: counterparts project join <folder> <project name or folder> (a name with spaces goes in quotes).');
|
|
88
|
+
return EXIT.usage;
|
|
89
|
+
}
|
|
90
|
+
const counterpart = openCounterpart(dir, observer);
|
|
91
|
+
try {
|
|
92
|
+
const where = folderOf(folder, home);
|
|
93
|
+
const anchor = looksLikeFolder(project) ? folderOf(project, home) : null;
|
|
94
|
+
const out = counterpart.joinProject({ folder: where, project: anchor ?? project, by: "owner" });
|
|
95
|
+
if (!out.ok) {
|
|
96
|
+
// In the words that were typed, with the folder they resolved to (review of #572).
|
|
97
|
+
const resolved = where === folder ? "" : ` (${shortPath(where, home)})`;
|
|
98
|
+
io.err(`refused: counterparts project join ${folder}${resolved} ${project} — ${out.detail.replaceAll(`"${where}"`, `"${folder}"`).replaceAll(`"${anchor ?? ""}"`, `"${project}"`)} Nothing was joined.`);
|
|
99
|
+
return EXIT.refused;
|
|
100
|
+
}
|
|
101
|
+
// A folder that is not there yet is joined all the same (it may be made
|
|
102
|
+
// later), and said (review of #572).
|
|
103
|
+
for (const f of [where, ...(anchor === null ? [] : [anchor])]) {
|
|
104
|
+
if (!existsSync(f)) io.err(`note: ${shortPath(f, home)} does not exist (yet); its row is kept.`);
|
|
105
|
+
}
|
|
106
|
+
const shown = shortPath(out.folder, home);
|
|
107
|
+
io.out(
|
|
108
|
+
out.changed
|
|
109
|
+
? `Joined ${shown} to ${out.project.name} (${out.project.id})${out.born ? ", a new project" : ""}.`
|
|
110
|
+
: `${shown} already belongs to ${out.project.name} (${out.project.id}).`,
|
|
111
|
+
);
|
|
112
|
+
if (out.left !== null) io.out(` It left ${out.left}.`);
|
|
113
|
+
io.out(` ${out.project.name}: ${out.project.folders.map((f) => shortPath(f.folder, home)).join(", ")}. Each one's wake shows the work of all of them.`);
|
|
114
|
+
return EXIT.ok;
|
|
115
|
+
} finally {
|
|
116
|
+
counterpart.close();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -117,6 +117,7 @@ import {
|
|
|
117
117
|
settleCommand,
|
|
118
118
|
aboutCommand,
|
|
119
119
|
} from "./commands-self.js";
|
|
120
|
+
import { projectCommand } from "./commands-project.js";
|
|
120
121
|
import {
|
|
121
122
|
installCommand,
|
|
122
123
|
installDesktop,
|
|
@@ -236,6 +237,10 @@ export const COMMANDS = [
|
|
|
236
237
|
// owner. Reads and writes, like `settle`; the write refuses under observer
|
|
237
238
|
// at the core's own door (`Counterpart.markAbout`).
|
|
238
239
|
"about",
|
|
240
|
+
// Which folders are one piece of work (2026-10-21, wave 2 lane G): list,
|
|
241
|
+
// and the owner's join and leave. Reads and writes, like `about`; the
|
|
242
|
+
// write refuses under observer at the store's seam.
|
|
243
|
+
"project",
|
|
239
244
|
// What is written up and what is not yet, for one date (2026-09-30,
|
|
240
245
|
// `core/coverage/`). Read-only.
|
|
241
246
|
"coverage",
|
|
@@ -583,6 +588,7 @@ export const COMMAND_FLAGS: Record<Command, readonly string[]> = {
|
|
|
583
588
|
core: ["list", "demote", "reaffirm", "reason", "reflected-feeling"],
|
|
584
589
|
settle: ["list", "pair", "holds", "against", "how", "why", "undo"],
|
|
585
590
|
about: ["why"],
|
|
591
|
+
project: [],
|
|
586
592
|
coverage: ["date"],
|
|
587
593
|
// `--config` because the store it opens is the one the configuration names,
|
|
588
594
|
// and the child's memory server reads the same file.
|
|
@@ -666,7 +672,9 @@ export const COMMAND_BLURB: Record<Command, string> = {
|
|
|
666
672
|
settle:
|
|
667
673
|
"Two memories that disagree. With no flags (or --list), the pairs nobody has settled — a dream flags them — and the ones settled lately: how, which holds, who settled it and why; and the corrections held in the last 7 lived days (a memory said it changes or corrects one that didn't look related, so nothing was settled) that nobody has settled since, each with the command that settles it. --pair <id> --holds <memory id> --how changed|corrected|open --why \"...\" settles one as you (or --holds <id> --against <id> for two memories no dream flagged): changed — both were true at their time, the older fades once and is shown as earlier; corrected — the older was wrong, it leaves recall and stays readable by its id; open — a real disagreement, both kept and shown together. No memory is rewritten. --undo <pair> reverses a settle: the strength comes back, a corrected memory comes back into recall, and the pair is unsettled again. Reading works under observer; the two changes refuse there.",
|
|
668
674
|
about:
|
|
669
|
-
"What a memory is about — me (who I am), us (the two of us), owner (you, as a person), work (
|
|
675
|
+
"What a memory is about — me (who I am), us (the two of us), owner (you, as a person), work (one project's own) or world (anything else). With an id alone, its mark and who set it; with an id and a mark, it changes the mark as you, keeps --why with it, and records it the way a nightly reflection's re-mark is recorded. Unmarked, a fact written in a project counts as that project's work and is shown only there (and in the folders joined to it), while an unmarked skill is craft and may show in any folder; me, us and owner are shown everywhere and can become part of who I am. An archived memory can be marked too (the mark counts if it comes back); an earlier version's id marks the current one. Reading works under observer; the change refuses there.",
|
|
676
|
+
project:
|
|
677
|
+
"Which folders are one piece of work. A folder is its own project until you join it to another: join <folder> <project> puts the folder in a project named by a word (found by its name, or made) or in another folder's project, and from then on each folder's wake shows the work of all of them under \"Work here\" — a skill nobody marked work is craft and may show in any folder. leave <folder> makes it its own project again. With no words (or list), the projects and their folders. Reading works under observer; join and leave refuse there.",
|
|
670
678
|
coverage:
|
|
671
679
|
"What is written up, and what is not yet, for one date (default today): each session that captured something that day, how much of it is written up, and what is not yet written up — how many pieces, over how long, since when — and whether that is owed (the nightly run catches it up, or counterparts catch-up does now), lapsed (let go unwritten after fourteen days of use — lost to memory; its text is deleted with the rest, never more than 14 days after the session), under the floor, or still at work. Read-only.",
|
|
672
680
|
"catch-up":
|
|
@@ -700,6 +708,7 @@ const COMMAND_ARGS: Partial<Record<Command, string>> = {
|
|
|
700
708
|
core: " [--demote <id> --reason \"...\" | --reaffirm <id> --reason \"...\" | --reflected-feeling on|off]",
|
|
701
709
|
settle: " [--list | --pair <id> --holds <id> --how changed|corrected|open --why \"...\" | --undo <pair>]",
|
|
702
710
|
about: " <id> [me|us|owner|work|world] [--why \"...\"]",
|
|
711
|
+
project: " [list | join <folder> <project name or folder> | leave <folder>]",
|
|
703
712
|
coverage: " [--date YYYY-MM-DD]",
|
|
704
713
|
};
|
|
705
714
|
|
|
@@ -1705,6 +1714,8 @@ export async function run(argv: readonly string[], opts: RunOptions): Promise<nu
|
|
|
1705
1714
|
return settleCommand(dir, io, parsed, observer, typeof parsed.flags["dir"] === "string");
|
|
1706
1715
|
case "about":
|
|
1707
1716
|
return aboutCommand(dir, io, parsed, observer, typeof parsed.flags["dir"] === "string");
|
|
1717
|
+
case "project":
|
|
1718
|
+
return projectCommand(dir, io, parsed, observer, typeof parsed.flags["dir"] === "string", opts.home ?? homedir());
|
|
1708
1719
|
case "coverage":
|
|
1709
1720
|
return coverageCommand(dir, io, parsed, now, typeof parsed.flags["dir"] === "string");
|
|
1710
1721
|
}
|
package/src/adapters/cli/help.ts
CHANGED
|
@@ -134,6 +134,7 @@ export const SHORT: Record<string, string | readonly string[]> = {
|
|
|
134
134
|
core: "What became part of who I am — and send one back",
|
|
135
135
|
settle: "Two memories that disagree: which holds — and undo one",
|
|
136
136
|
about: "What a memory is about — and change it",
|
|
137
|
+
project: "Which folders are one piece of work — join or leave",
|
|
137
138
|
coverage: "What is written up, and what is not yet, for a date",
|
|
138
139
|
"catch-up": "Write up, now, sessions that ended unwritten (the night does it too)",
|
|
139
140
|
init: "Make a second, separate memory store — a scratch one",
|
|
@@ -190,6 +191,7 @@ export const ADVANCED: readonly string[] = [
|
|
|
190
191
|
"core",
|
|
191
192
|
"settle",
|
|
192
193
|
"about",
|
|
194
|
+
"project",
|
|
193
195
|
"coverage",
|
|
194
196
|
"catch-up",
|
|
195
197
|
"init",
|
package/src/adapters/config.ts
CHANGED
|
@@ -77,6 +77,16 @@ export const TUNABLES = {
|
|
|
77
77
|
* this is generous. `dreaming.maxTurns` overrides it.
|
|
78
78
|
*/
|
|
79
79
|
NIGHT_MAX_TURNS: 60,
|
|
80
|
+
/**
|
|
81
|
+
* THE NIGHT'S TAGGING CHILD (2026-10-21, wave 2 lane B): after the
|
|
82
|
+
* reflection, a small child of its own (`core/dream/tags.ts`) on the host's
|
|
83
|
+
* fastest model — its work is short labels, and Mike watches the night's
|
|
84
|
+
* tokens. Two tool calls and a line; the ceilings are generous for that.
|
|
85
|
+
* Whether it runs at all is `schemas.TAGS_NIGHT`.
|
|
86
|
+
*/
|
|
87
|
+
NIGHT_TAGS_MODEL: "haiku",
|
|
88
|
+
NIGHT_TAGS_MAX_TURNS: 8,
|
|
89
|
+
NIGHT_TAGS_MS: 5 * 60_000,
|
|
80
90
|
/**
|
|
81
91
|
* THE CATCH-UP (2026-10-01, build 3; unbounded 2026-10-11): before the page
|
|
82
92
|
* writer, the nightly run writes up EVERYTHING owed in any directory, and
|