counterparts 0.3.2 → 0.3.4
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 +153 -0
- package/docs/module-map.md +3 -2
- package/package.json +1 -1
- package/src/adapters/claude-code/NOTES.md +28 -0
- package/src/adapters/claude-code/bin/hook.ts +85 -22
- package/src/adapters/claude-code/config.ts +7 -0
- package/src/adapters/claude-code/doctor.ts +166 -4
- package/src/adapters/claude-code/hooks.ts +185 -6
- package/src/adapters/claude-code/index.ts +3 -0
- package/src/adapters/claude-code/transcript.ts +7 -0
- package/src/adapters/cli/CONTRACT.md +11 -0
- package/src/adapters/cli/INTERFACE-GAPS.md +16 -0
- package/src/adapters/cli/NOTES.md +25 -0
- package/src/adapters/cli/commands.ts +184 -4
- package/src/adapters/cli/dream-core.ts +126 -0
- package/src/adapters/cli/help.ts +17 -0
- package/src/adapters/cli/mechanisms.ts +199 -106
- package/src/adapters/dashboard/CONTRACT.md +5 -0
- package/src/adapters/dashboard/INTERFACE-GAPS.md +12 -0
- package/src/adapters/dashboard/NOTES.md +38 -0
- package/src/adapters/dashboard/registries.ts +35 -1
- package/src/adapters/dashboard/web/README.md +63 -26
- package/src/adapters/dashboard/web/app.html +2 -0
- package/src/adapters/dashboard/web/flow.ts +14 -0
- package/src/adapters/dashboard/web/lanes.ts +141 -0
- package/src/adapters/dashboard/web/mechanisms/association/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +8 -5
- package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +7 -7
- package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/dreaming/index.js +19 -0
- package/src/adapters/dashboard/web/mechanisms/emotional/index.js +9 -6
- package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +4 -5
- package/src/adapters/dashboard/web/mechanisms/index.js +5 -3
- package/src/adapters/dashboard/web/mechanisms/interference/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/prospective/index.js +7 -5
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/regions.js +1 -1
- package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/salience/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/schema/index.js +1 -2
- package/src/adapters/dashboard/web/narrate.ts +76 -13
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +17 -1
- package/src/adapters/dashboard/web/pages/home/home.css +29 -13
- package/src/adapters/dashboard/web/pages/home/index.js +2 -0
- package/src/adapters/dashboard/web/pages/home/sections/explorer.js +22 -7
- package/src/adapters/dashboard/web/pages/home/sections/hero.js +15 -3
- package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +15 -9
- package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +6 -2
- package/src/adapters/dashboard/web/pages/home/sections/tiles.js +35 -18
- package/src/adapters/dashboard/web/pages/memories/index.js +30 -36
- package/src/adapters/dashboard/web/pages/memories/memories.css +97 -72
- package/src/adapters/dashboard/web/pages/memories/row.js +51 -0
- package/src/adapters/dashboard/web/pages/memories/sections/feel.js +176 -0
- package/src/adapters/dashboard/web/pages/memories/sections/hold.js +67 -0
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +65 -43
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +26 -23
- package/src/adapters/dashboard/web/pages/memories/state.js +12 -5
- package/src/adapters/dashboard/web/pages/self/index.js +57 -16
- package/src/adapters/dashboard/web/pages/self/sections/dreams.js +76 -0
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +75 -19
- package/src/adapters/dashboard/web/pages/self/sections/page.js +108 -65
- package/src/adapters/dashboard/web/pages/self/sections/settling.js +129 -104
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +31 -15
- package/src/adapters/dashboard/web/pages/self/self.css +122 -59
- package/src/adapters/dashboard/web/pages/self/state.js +21 -0
- package/src/adapters/dashboard/web/server.ts +9 -0
- package/src/adapters/dashboard/web/shared/memory-marks.css +17 -0
- package/src/adapters/dashboard/web/shared/memory-marks.js +81 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +240 -53
- package/src/adapters/dashboard/web/shared/modal.css +67 -0
- package/src/adapters/dashboard/web/shared/tip.js +1 -1
- package/src/adapters/dashboard/web/shared/widgets/feed.css +4 -0
- package/src/adapters/dashboard/web/shared/widgets/feed.js +56 -14
- package/src/adapters/dashboard/web/shared/widgets/light.css +1 -0
- package/src/adapters/dashboard/web/shared/widgets/light.js +7 -5
- package/src/adapters/dashboard/web/shared/widgets/tips.css +19 -0
- package/src/adapters/dashboard/web/shared/widgets/tips.js +56 -0
- package/src/adapters/dashboard/web/views/activity.ts +18 -2
- package/src/adapters/dashboard/web/views/archive-words.ts +27 -10
- package/src/adapters/dashboard/web/views/dreams.ts +199 -0
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +116 -35
- package/src/adapters/dashboard/web/views/mechanisms.ts +81 -255
- package/src/adapters/dashboard/web/views/memories.ts +245 -43
- package/src/adapters/dashboard/web/views/memory-words.ts +133 -0
- package/src/adapters/dashboard/web/views/memory.ts +226 -4
- package/src/adapters/dashboard/web/views/mind.ts +261 -61
- package/src/adapters/dashboard/web/views/overview.ts +80 -42
- package/src/adapters/dashboard/web/views/search.ts +35 -1
- package/src/adapters/dashboard/web/views/shared.ts +14 -0
- package/src/adapters/dashboard/web/views.ts +2 -0
- package/src/adapters/feelings-line.ts +74 -0
- package/src/adapters/fired.ts +163 -23
- package/src/adapters/mcp/CONTRACT.md +8 -0
- package/src/adapters/mcp/NOTES.md +56 -0
- package/src/adapters/mcp/server.ts +254 -6
- package/src/adapters/mcp/tools.ts +180 -5
- package/src/adapters/mechanism-evidence.ts +465 -0
- package/src/core/bridge.ts +21 -16
- package/src/core/counterpart.ts +422 -10
- package/src/core/dream/CONTRACT.md +143 -0
- package/src/core/dream/INTERFACE-GAPS.md +24 -0
- package/src/core/dream/NOTES.md +84 -0
- package/src/core/dream/index.ts +1067 -0
- package/src/core/dream/mark.ts +14 -0
- package/src/core/dream/tunables.ts +56 -0
- package/src/core/encode/CONTRACT.md +7 -1
- package/src/core/feelings-wheel.ts +171 -13
- package/src/core/mint.ts +9 -0
- package/src/core/physics/CONTRACT.md +132 -21
- package/src/core/physics/NOTES.md +233 -0
- package/src/core/physics/index.ts +419 -50
- package/src/core/prospective/CONTRACT.md +35 -6
- package/src/core/prospective/INTERFACE-GAPS.md +10 -5
- package/src/core/prospective/NOTES.md +175 -4
- package/src/core/prospective/derive.ts +32 -3
- package/src/core/prospective/index.ts +362 -39
- package/src/core/prospective/tunables.ts +18 -1
- package/src/core/prospective/windows.ts +104 -46
- package/src/core/recall/CONTRACT.md +28 -0
- package/src/core/recall/NOTES.md +55 -0
- package/src/core/recall/activate.ts +32 -5
- package/src/core/recall/gate.ts +7 -1
- package/src/core/recall/index.ts +28 -2
- package/src/core/recall/mood.ts +106 -0
- package/src/core/recall/tunables.ts +26 -0
- package/src/core/remember/CONTRACT.md +5 -0
- package/src/core/remember/index.ts +1 -0
- package/src/core/remember/proposals.ts +86 -3
- package/src/core/remember/spans.ts +11 -1
- package/src/core/self/CONTRACT.md +3 -0
- package/src/core/self/INTERFACE-GAPS.md +7 -0
- package/src/core/self/NOTES.md +30 -0
- package/src/core/self/identity.ts +115 -6
- package/src/core/self/index.ts +17 -0
- package/src/core/self/tunables.ts +17 -0
- package/src/core/sleep/CONTRACT.md +17 -1
- package/src/core/sleep/INTERFACE-GAPS.md +19 -0
- package/src/core/sleep/NOTES.md +36 -0
- package/src/core/sleep/consolidate.ts +149 -96
- package/src/core/sleep/decay.ts +11 -0
- package/src/core/sleep/index.ts +4 -1
- package/src/core/sleep/tunables.ts +9 -0
- package/src/core/sleep/types.ts +17 -0
- package/src/core/sleep/upgrade.ts +168 -0
- package/src/core/store/CONTRACT.md +21 -2
- package/src/core/store/NOTES.md +68 -0
- package/src/core/store/feelings.ts +23 -6
- package/src/core/store/index.ts +716 -17
- package/src/core/store/operational.ts +329 -4
- package/src/core/store/owner-op-seam.ts +79 -1
- package/src/core/types.ts +37 -0
- package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +0 -178
- package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +0 -42
|
@@ -8,18 +8,21 @@
|
|
|
8
8
|
* alarms when they are good news. This view is the page a regular user reads;
|
|
9
9
|
* `--all` still prints the full `fired` report, unchanged, for the diagnosis.
|
|
10
10
|
*
|
|
11
|
-
* **
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* **Whether a mechanism fired is not this file's call** (2026-09-26, an
|
|
12
|
+
* experiment). It asks `mechanism-evidence.ts`, the one judgement the dashboard's
|
|
13
|
+
* lights ask too, so the two can no longer disagree about which rows count. The
|
|
14
|
+
* WORDS and the WINDOW stay this console's own: seven calendar days, the same
|
|
15
|
+
* window the `fired` report counts over, and its own phrasing.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
* for now. The site and the dashboard have their own lists and are all still
|
|
17
|
-
* moving, so nothing here is shared with them or tested against them — the
|
|
18
|
-
* only coupling is to `MECHANISMS`, whose ids this table names.
|
|
17
|
+
* The plumbing line still reads the `fired` report's rows.
|
|
19
18
|
*
|
|
20
19
|
* The truth per mechanism is `docs/research/mechanism-audit-2026-09-24.md`.
|
|
21
20
|
*/
|
|
21
|
+
import type { EventRow, ReadOnlyStore } from "../../core/store/index.js";
|
|
22
|
+
import { FIRED_DAYS, daysBefore, rowDate } from "../fired.js";
|
|
22
23
|
import type { FiredReport, FiredRow } from "../fired.js";
|
|
24
|
+
import { mechanismEvidence, payloadOf } from "../mechanism-evidence.js";
|
|
25
|
+
import type { EvidenceWindow, Verdict } from "../mechanism-evidence.js";
|
|
23
26
|
|
|
24
27
|
/** The three lights. */
|
|
25
28
|
export const LIGHT = {
|
|
@@ -31,22 +34,25 @@ export type Light = (typeof LIGHT)[keyof typeof LIGHT];
|
|
|
31
34
|
|
|
32
35
|
export type Group = "Encoding" | "Storage" | "Retrieval" | "Transformation";
|
|
33
36
|
|
|
34
|
-
/** The
|
|
37
|
+
/** The `fired` report's rows, by `MECHANISMS` id — for totals the words carry. */
|
|
35
38
|
type Rows = (id: string) => FiredRow | undefined;
|
|
36
39
|
|
|
37
40
|
export interface MemoryMechanism {
|
|
38
41
|
readonly name: string;
|
|
39
42
|
readonly group: Group;
|
|
40
|
-
/** `
|
|
43
|
+
/** The `mechanism-evidence.ts` id whose verdict decides the light. */
|
|
44
|
+
readonly id: string;
|
|
45
|
+
/** `MECHANISMS` ids this line accounts for — kept off the plumbing line. */
|
|
41
46
|
readonly evidence: readonly string[];
|
|
42
|
-
/** The light and one plain line, from the
|
|
43
|
-
|
|
47
|
+
/** The light and one plain line, from the shared verdict (and the report's
|
|
48
|
+
* totals, for the words only). */
|
|
49
|
+
readonly read: (v: Verdict, rows: Rows) => { light: Light; says: string };
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
/**
|
|
47
|
-
function
|
|
52
|
+
/** A proof's count inside the window, summed over the named keys. */
|
|
53
|
+
function part(v: Verdict, ...keys: string[]): number {
|
|
48
54
|
let n = 0;
|
|
49
|
-
for (const
|
|
55
|
+
for (const p of v.parts) if (keys.includes(p.key)) n += p.count;
|
|
50
56
|
return n;
|
|
51
57
|
}
|
|
52
58
|
|
|
@@ -60,18 +66,50 @@ const NOT_BUILT = (why: string) => (): { light: Light; says: string } => ({
|
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
/**
|
|
63
|
-
* THE
|
|
64
|
-
*
|
|
69
|
+
* THE CONSOLE'S WINDOW: seven CALENDAR days, today included, in the store's
|
|
70
|
+
* zone — the same window the `fired` report counts over. The lived-day bound
|
|
71
|
+
* only keeps the read cheap (a lived day is never longer than a calendar day).
|
|
72
|
+
*/
|
|
73
|
+
export function calendarWindow(store: ReadOnlyStore, today: string): EvidenceWindow {
|
|
74
|
+
let livedDay = 0;
|
|
75
|
+
try {
|
|
76
|
+
livedDay = store.livedDay();
|
|
77
|
+
} catch {
|
|
78
|
+
livedDay = 0;
|
|
79
|
+
}
|
|
80
|
+
const from = daysBefore(today, FIRED_DAYS - 1);
|
|
81
|
+
const zone = store.zone();
|
|
82
|
+
return {
|
|
83
|
+
sinceDay: Math.max(0, livedDay - FIRED_DAYS),
|
|
84
|
+
today: livedDay,
|
|
85
|
+
contains: (row: EventRow) => {
|
|
86
|
+
const date = rowDate(row, payloadOf(row), zone);
|
|
87
|
+
return date >= from && date <= today;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** The shared verdicts over the console's window. */
|
|
93
|
+
export function consoleVerdicts(store: ReadOnlyStore, today: string): Verdict[] {
|
|
94
|
+
return mechanismEvidence(store, calendarWindow(store, today)).verdicts;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* THE TWELVE (Dreaming joined the eleven on 2026-09-26, beside Consolidation),
|
|
99
|
+
* in the site's four groups and its order. Whether each one fired
|
|
100
|
+
* is `mechanism-evidence.ts`'s call, shared with the dashboard; the words are
|
|
101
|
+
* this console's own.
|
|
65
102
|
*/
|
|
66
103
|
export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
|
|
67
104
|
// ── Encoding ──
|
|
68
105
|
{
|
|
69
106
|
name: "Salience",
|
|
70
107
|
group: "Encoding",
|
|
108
|
+
id: "salience",
|
|
71
109
|
evidence: ["deposit", "chunk-gate"],
|
|
72
|
-
read: (
|
|
73
|
-
const n =
|
|
74
|
-
return
|
|
110
|
+
read: (v) => {
|
|
111
|
+
const n = part(v, "deposit", "chunk");
|
|
112
|
+
return v.fired
|
|
75
113
|
? { light: LIGHT.working, says: `${plural(n, "memory", "memories")} written and scored` }
|
|
76
114
|
: { light: LIGHT.idle, says: "built, not firing yet: no memories written this week" };
|
|
77
115
|
},
|
|
@@ -79,49 +117,54 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
|
|
|
79
117
|
{
|
|
80
118
|
name: "Emotion",
|
|
81
119
|
group: "Encoding",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
120
|
+
id: "emotional",
|
|
121
|
+
evidence: ["feelings", "emotion-weight", "mood-match"],
|
|
122
|
+
// Emotion part A (2026-09-26): a memory's strongest feeling lifts it and
|
|
123
|
+
// slows its fading, and a recorded mood lifts matching memories in recall.
|
|
124
|
+
read: (v, rows) => {
|
|
125
|
+
const weighted = rows("emotion-weight")?.total ?? 0;
|
|
126
|
+
const withFeelings = rows("feelings")?.total ?? 0;
|
|
127
|
+
const newWeighted = part(v, "weighted");
|
|
128
|
+
const matched = part(v, "moodMatched");
|
|
129
|
+
const held = `${plural(weighted, "memory", "memories")} held higher and fading slower (${String(withFeelings)} with recorded feelings)`;
|
|
130
|
+
if (v.fired) {
|
|
131
|
+
const parts: string[] = [];
|
|
132
|
+
if (newWeighted > 0) parts.push(`${plural(newWeighted, "new memory", "new memories")} carrying feeling`);
|
|
133
|
+
if (matched > 0) parts.push(`${plural(matched, "memory", "memories")} a matching mood brought closer`);
|
|
134
|
+
return { light: LIGHT.working, says: `${parts.join("; ")}; ${held}` };
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
light: LIGHT.idle,
|
|
138
|
+
says:
|
|
139
|
+
weighted > 0
|
|
140
|
+
? `built, not firing yet this week: ${held}`
|
|
141
|
+
: "built, not firing yet: no memory carries a feeling",
|
|
142
|
+
};
|
|
143
|
+
},
|
|
92
144
|
},
|
|
93
145
|
// ── Storage ──
|
|
94
146
|
{
|
|
95
147
|
name: "Forgetting",
|
|
96
148
|
group: "Storage",
|
|
149
|
+
id: "decay",
|
|
97
150
|
evidence: ["decay", "prune", "fade", "sleep-cycle"],
|
|
98
|
-
read: (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const faded = week(rows, "fade");
|
|
104
|
-
const cycles = week(rows, "sleep-cycle");
|
|
151
|
+
read: (v) => {
|
|
152
|
+
if (!v.fired) return { light: LIGHT.idle, says: "built, not firing yet: nothing faded this week" };
|
|
153
|
+
const letGo = part(v, "pruned");
|
|
154
|
+
const dropped = part(v, "faded");
|
|
155
|
+
const cards = part(v, "cards");
|
|
105
156
|
const parts: string[] = [];
|
|
106
157
|
if (letGo > 0) parts.push(`${plural(letGo, "memory", "memories")} let go at the floor`);
|
|
107
158
|
if (dropped > 0) parts.push(`${plural(dropped, "memory", "memories")} faded a band`);
|
|
108
|
-
if (
|
|
109
|
-
if (parts.
|
|
110
|
-
|
|
111
|
-
return { light: LIGHT.working, says: parts.join("; ") };
|
|
112
|
-
}
|
|
113
|
-
if (cycles > 0) {
|
|
114
|
-
return {
|
|
115
|
-
light: LIGHT.working,
|
|
116
|
-
says: `decay ran in ${plural(cycles, "sleep cycle")}; nothing at the floor yet`,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return { light: LIGHT.idle, says: "built, not firing yet: no sleep cycle ran this week" };
|
|
159
|
+
if (cards > 0) parts.push("unused names faded");
|
|
160
|
+
if (letGo === 0) parts.push("nothing at the floor yet");
|
|
161
|
+
return { light: LIGHT.working, says: parts.join("; ") };
|
|
120
162
|
},
|
|
121
163
|
},
|
|
122
164
|
{
|
|
123
165
|
name: "Interference",
|
|
124
166
|
group: "Storage",
|
|
167
|
+
id: "interference",
|
|
125
168
|
evidence: [],
|
|
126
169
|
read: NOT_BUILT("only exact duplicates are merged"),
|
|
127
170
|
},
|
|
@@ -129,35 +172,34 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
|
|
|
129
172
|
{
|
|
130
173
|
name: "Retrieval",
|
|
131
174
|
group: "Retrieval",
|
|
175
|
+
id: "retrieval",
|
|
132
176
|
evidence: ["recall-decision", "credit"],
|
|
133
|
-
read: (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const credited =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
};
|
|
177
|
+
read: (v) => {
|
|
178
|
+
if (!v.fired) return { light: LIGHT.idle, says: "built, not firing yet: nothing came to mind this week" };
|
|
179
|
+
const turns = part(v, "turns");
|
|
180
|
+
const lookups = part(v, "lookups");
|
|
181
|
+
const credited = part(v, "credited");
|
|
182
|
+
const parts: string[] = [];
|
|
183
|
+
if (turns > 0) parts.push(`${plural(turns, "turn")} brought memories to mind`);
|
|
184
|
+
if (lookups > 0) parts.push(plural(lookups, "deliberate look-up"));
|
|
185
|
+
parts.push(
|
|
186
|
+
credited > 0
|
|
187
|
+
? `${plural(credited, "memory", "memories")} used and strengthened`
|
|
188
|
+
: "nothing used yet, so nothing strengthened",
|
|
189
|
+
);
|
|
190
|
+
return { light: LIGHT.working, says: parts.join("; ") };
|
|
147
191
|
},
|
|
148
192
|
},
|
|
149
193
|
{
|
|
150
194
|
name: "Association",
|
|
151
195
|
group: "Retrieval",
|
|
196
|
+
id: "association",
|
|
152
197
|
evidence: ["association-saved", "association"],
|
|
153
|
-
read: (rows) => {
|
|
154
|
-
const saved =
|
|
198
|
+
read: (v, rows) => {
|
|
199
|
+
const saved = part(v, "links");
|
|
155
200
|
const held = rows("association")?.total ?? 0;
|
|
156
|
-
if (
|
|
157
|
-
return {
|
|
158
|
-
light: LIGHT.working,
|
|
159
|
-
says: `links saved after ${plural(saved, "session")}; ${plural(held, "link")} held`,
|
|
160
|
-
};
|
|
201
|
+
if (v.fired) {
|
|
202
|
+
return { light: LIGHT.working, says: `${plural(saved, "link")} written this week; ${plural(held, "link")} held` };
|
|
161
203
|
}
|
|
162
204
|
return {
|
|
163
205
|
light: LIGHT.idle,
|
|
@@ -171,60 +213,95 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
|
|
|
171
213
|
{
|
|
172
214
|
name: "Prospective",
|
|
173
215
|
group: "Retrieval",
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
//
|
|
177
|
-
//
|
|
178
|
-
read: (rows) => {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
216
|
+
id: "prospective",
|
|
217
|
+
evidence: ["prospective-dated", "prospective-fired", "prospective-plain"],
|
|
218
|
+
// Built end to end since 2026-09-26. With nothing dated it is still built,
|
|
219
|
+
// just holding nothing — so it is idle, never "not built" (2026-09-26).
|
|
220
|
+
read: (v, rows) => {
|
|
221
|
+
const dated = v.held ?? rows("prospective-dated")?.total ?? 0;
|
|
222
|
+
const quiet = part(v, "quiet");
|
|
223
|
+
const plain = part(v, "plain");
|
|
224
|
+
const held = `${plural(dated, "dated memory", "dated memories")} held`;
|
|
225
|
+
if (v.fired) {
|
|
226
|
+
const parts: string[] = [];
|
|
227
|
+
if (plain > 0) parts.push(`${String(plain)} said plainly`);
|
|
228
|
+
if (quiet > 0) parts.push(`${String(quiet)} as quiet footnotes`);
|
|
229
|
+
return {
|
|
230
|
+
light: LIGHT.working,
|
|
231
|
+
says: `${plural(quiet + plain, "reminder")} came back (${parts.join(", ")}); ${held}`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return dated > 0
|
|
235
|
+
? { light: LIGHT.idle, says: `built, nothing due this week: ${held}` }
|
|
236
|
+
: { light: LIGHT.idle, says: "built, nothing dated yet: a note with a date comes back around that day" };
|
|
186
237
|
},
|
|
187
238
|
},
|
|
188
239
|
// ── Transformation ──
|
|
189
240
|
{
|
|
190
241
|
name: "Consolidation",
|
|
191
242
|
group: "Transformation",
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (
|
|
196
|
-
|
|
243
|
+
id: "consolidation",
|
|
244
|
+
evidence: ["sleep-cycle", "promotion", "dedup", "returns", "dream-replays", "core-demote", "upgrade-census"],
|
|
245
|
+
read: (v) => {
|
|
246
|
+
if (v.fired) {
|
|
247
|
+
const parts: string[] = [];
|
|
248
|
+
const returns = part(v, "returns");
|
|
249
|
+
const promoted = part(v, "promoted");
|
|
250
|
+
const merged = part(v, "merged") + part(v, "dreamMerged");
|
|
251
|
+
const rose = part(v, "rose");
|
|
252
|
+
if (returns > 0) parts.push(`${plural(returns, "return")} made memories fade more slowly`);
|
|
253
|
+
if (promoted > 0) parts.push(`${plural(promoted, "memory", "memories")} became core`);
|
|
254
|
+
if (merged > 0) parts.push(`${plural(merged, "near-copy", "near-copies")} merged`);
|
|
255
|
+
if (rose > 0) parts.push(`${plural(rose, "memory", "memories")} settled a band higher`);
|
|
256
|
+
return { light: LIGHT.working, says: parts.join("; ") };
|
|
257
|
+
}
|
|
258
|
+
const s = v.schedule;
|
|
259
|
+
if (s !== null && s.onTime && s.lastRanDay !== null) {
|
|
260
|
+
const next = s.nextInDays <= 0 ? "at the next session's end" : `in ${plural(s.nextInDays, "lived day")}`;
|
|
261
|
+
return { light: LIGHT.idle, says: `built, ran on schedule with nothing to change; next run ${next}` };
|
|
262
|
+
}
|
|
263
|
+
return { light: LIGHT.idle, says: "built, not firing yet: nothing consolidated this week" };
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "Dreaming",
|
|
268
|
+
group: "Transformation",
|
|
269
|
+
id: "dreaming",
|
|
270
|
+
evidence: ["dream", "dream-changes", "dream-ask"],
|
|
271
|
+
read: (v) => {
|
|
272
|
+
const dreams = part(v, "dreams");
|
|
273
|
+
const changes = part(v, "changes");
|
|
274
|
+
if (v.fired) {
|
|
275
|
+
return {
|
|
276
|
+
light: LIGHT.working,
|
|
277
|
+
says: `${plural(dreams, "dream")} this week${changes > 0 ? ` (${plural(changes, "change")})` : ""}`,
|
|
278
|
+
};
|
|
197
279
|
}
|
|
198
|
-
const promoted = week(rows, "promotion");
|
|
199
|
-
const merged = week(rows, "dedup");
|
|
200
|
-
const extra: string[] = [];
|
|
201
|
-
if (promoted > 0) extra.push(`${plural(promoted, "memory", "memories")} became core`);
|
|
202
|
-
if (merged > 0) extra.push(`${plural(merged, "duplicate")} merged`);
|
|
203
280
|
return {
|
|
204
|
-
light: LIGHT.
|
|
205
|
-
says:
|
|
281
|
+
light: LIGHT.idle,
|
|
282
|
+
says:
|
|
283
|
+
v.lastFiredDay === null
|
|
284
|
+
? "built, not firing yet: no dream yet (a session asks, once a day, and you say yes or not today)"
|
|
285
|
+
: `built, not firing this week: the last dream was on lived day ${String(v.lastFiredDay)}`,
|
|
206
286
|
};
|
|
207
287
|
},
|
|
208
288
|
},
|
|
209
289
|
{
|
|
210
290
|
name: "Reconsolidation",
|
|
211
291
|
group: "Transformation",
|
|
292
|
+
id: "reconsolidation",
|
|
212
293
|
evidence: ["revision", "accommodation"],
|
|
213
|
-
read: (
|
|
214
|
-
const pressed =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (replaced > 0) parts.push(`${plural(replaced, "memory", "memories")} corrected, old version kept`);
|
|
219
|
-
if (pressed > 0) parts.push(`${plural(pressed, "belief")} challenged`);
|
|
220
|
-
return { light: LIGHT.working, says: parts.join("; ") };
|
|
221
|
-
}
|
|
222
|
-
return { light: LIGHT.idle, says: "built, not firing yet: nothing corrected this week" };
|
|
294
|
+
read: (v) => {
|
|
295
|
+
const pressed = part(v, "pressure");
|
|
296
|
+
return v.fired
|
|
297
|
+
? { light: LIGHT.working, says: `${plural(pressed, "correction")} weighed against old memories` }
|
|
298
|
+
: { light: LIGHT.idle, says: "built, not firing yet: nothing corrected this week" };
|
|
223
299
|
},
|
|
224
300
|
},
|
|
225
301
|
{
|
|
226
302
|
name: "Schemas",
|
|
227
303
|
group: "Transformation",
|
|
304
|
+
id: "schema",
|
|
228
305
|
// Entity cards are built; beliefs about them have no live producer.
|
|
229
306
|
evidence: ["entity-birth"],
|
|
230
307
|
read: NOT_BUILT("nothing forms beliefs about people and projects yet"),
|
|
@@ -232,11 +309,27 @@ export const MEMORY_MECHANISMS: readonly MemoryMechanism[] = [
|
|
|
232
309
|
{
|
|
233
310
|
name: "Gist",
|
|
234
311
|
group: "Transformation",
|
|
312
|
+
id: "episodic-semantic",
|
|
235
313
|
evidence: ["gist"],
|
|
236
|
-
|
|
314
|
+
// PARTLY (2026-09-26): a dream can write the pattern it sees as a gist.
|
|
315
|
+
read: (v) =>
|
|
316
|
+
v.fired
|
|
317
|
+
? { light: LIGHT.working, says: `${plural(part(v, "gist"), "pattern")} dreamed into a memory of its own` }
|
|
318
|
+
: { light: LIGHT.idle, says: "partly built, not firing this week: only a dream writes a gist so far" },
|
|
237
319
|
},
|
|
238
320
|
];
|
|
239
321
|
|
|
322
|
+
/** One line's reading: the shared verdict for its id, in the console's words. */
|
|
323
|
+
export function readMechanism(
|
|
324
|
+
m: MemoryMechanism,
|
|
325
|
+
verdicts: readonly Verdict[],
|
|
326
|
+
rows: Rows,
|
|
327
|
+
): { light: Light; says: string } {
|
|
328
|
+
const v = verdicts.find((x) => x.id === m.id);
|
|
329
|
+
if (v === undefined) return { light: LIGHT.notBuilt, says: "not built yet" };
|
|
330
|
+
return m.read(v, rows);
|
|
331
|
+
}
|
|
332
|
+
|
|
240
333
|
/**
|
|
241
334
|
* THE PLUMBING ROWS WHOSE FIRING MEANS SOMETHING FAILED, with the words to say
|
|
242
335
|
* it in. Every other plumbing row — a failure that never happened, an owner
|
|
@@ -273,7 +366,7 @@ export function plumbingLine(report: FiredReport): string {
|
|
|
273
366
|
|
|
274
367
|
/** The whole short view, as plain lines: one per mechanism in the site's four
|
|
275
368
|
* groups and order, then the plumbing in one line. */
|
|
276
|
-
export function mechanismsLines(report: FiredReport): string[] {
|
|
369
|
+
export function mechanismsLines(report: FiredReport, verdicts: readonly Verdict[]): string[] {
|
|
277
370
|
const byId = new Map(report.rows.map((r) => [r.id, r]));
|
|
278
371
|
const rows: Rows = (id) => byId.get(id);
|
|
279
372
|
const width = Math.max(...MEMORY_MECHANISMS.map((m) => m.name.length)) + 2;
|
|
@@ -282,7 +375,7 @@ export function mechanismsLines(report: FiredReport): string[] {
|
|
|
282
375
|
lines.push("This memory is new, so most of these have had nothing to do yet.", "");
|
|
283
376
|
}
|
|
284
377
|
for (const m of MEMORY_MECHANISMS) {
|
|
285
|
-
const { light, says } = m
|
|
378
|
+
const { light, says } = readMechanism(m, verdicts, rows);
|
|
286
379
|
lines.push(`${light} ${m.name.padEnd(width)}${says}`);
|
|
287
380
|
}
|
|
288
381
|
lines.push(
|
|
@@ -33,6 +33,11 @@ Legibility is the product's answer to the trust question a brain never has to fa
|
|
|
33
33
|
content hash. For now that is what it prints; until 2026-09-18 it printed the markdown
|
|
34
34
|
file's path instead, which named a filesystem layout rather than the memory, and which
|
|
35
35
|
the bodies-in-rows work takes away.
|
|
36
|
+
- **The dream journal, and what crossed into the core.** [new, 2026-09-26] Each dream
|
|
37
|
+
with its journal and every change it made (the memories it touched, clickable; an undone
|
|
38
|
+
change struck through), and the core's recent history — the crossings with their lane,
|
|
39
|
+
the owner's demotions with his reason, a dream's nominations. A dream is shown as a
|
|
40
|
+
dream: its journal is read from the `dreams` table and never presented as a memory.
|
|
36
41
|
|
|
37
42
|
## 4. Drops / simplifies
|
|
38
43
|
|
|
@@ -153,3 +153,15 @@ appends a raw string name would go unlisted without failing `tsc`.
|
|
|
153
153
|
small by construction. Negligible today; wrong at a hundred names.
|
|
154
154
|
|
|
155
155
|
**Owner:** `store/`.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## §6 — Returns are kept by moment, the lights' window by lived day (2026-09-26)
|
|
159
|
+
|
|
160
|
+
**Have:** `store.returnCounts(sinceAt)` counts the `returns` table from a UTC
|
|
161
|
+
moment; the mechanism window is seven LIVED days. A light that wants "returns in
|
|
162
|
+
the window" has to find the window's opening moment some other way (the earliest
|
|
163
|
+
durable row on or after the window's first lived day is the honest proxy).
|
|
164
|
+
|
|
165
|
+
**Want:** `returnCounts({ sinceDay })` — the table already carries `day`.
|
|
166
|
+
|
|
167
|
+
**Owner:** `store/`.
|
|
@@ -473,3 +473,41 @@ preload's temp `HOME`, read until `ctrl-c to stop.`, then killed — the shape
|
|
|
473
473
|
preload.ts names as safe for a spawned child. The install loop's `serve` step asserts
|
|
474
474
|
both refusals under its `perl alarm`, in the same step, so the step count QUICKSTART
|
|
475
475
|
quotes did not move.
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
## 2026-09-26 — dreaming and the core lanes, shown
|
|
479
|
+
|
|
480
|
+
The dreaming + consolidation build (`core/dream/`, physics §5.3/§5.11) gave the
|
|
481
|
+
dashboard three things to show, all read-only:
|
|
482
|
+
|
|
483
|
+
- **The dream journal** (`views/dreams.ts#dreamsView`, `/api/dreams`, and the
|
|
484
|
+
`dreams` part of `/api/mind`; drawn by `pages/self/sections/dreams.js` under
|
|
485
|
+
the journal). Each dream: date, state (`begun` → "dreaming", `journaled` →
|
|
486
|
+
"woke", `undone`), title, the journal entry rendered as markdown, and every
|
|
487
|
+
change in order. A merge names the memory it made and then its originals
|
|
488
|
+
through `revealHere`, so they read as they stood rather than as what they
|
|
489
|
+
became; everything else goes through `reveal`, so a confidential memory a
|
|
490
|
+
dream touched is withheld as everywhere. The journal is the owner's to read in
|
|
491
|
+
full — it lives in the `dreams` table and is never a memory.
|
|
492
|
+
- **What crossed lately** (`views/dreams.ts#coreHistory`, `settling.history`,
|
|
493
|
+
drawn at the top of the settling section): the newest crossings into the core
|
|
494
|
+
with the lane that carried each (fast: strongly felt and came back; slow: kept
|
|
495
|
+
coming back over weeks), the owner's demotions with his reason, and a dream's
|
|
496
|
+
nominations — which are only that; a lane promotes.
|
|
497
|
+
- **The seven new durable names** (`dream.begun`, `dream.changed`,
|
|
498
|
+
`dream.journaled`, `dream.undone`, `dream.ask`, `band.demoted`,
|
|
499
|
+
`physics.upgrade.census`) are in `DURABLE_EVENTS` with a gloss, a narrator, a
|
|
500
|
+
flow node (a dream is a kind of sleep, so `sleep`; the ask is put to a
|
|
501
|
+
`session`; a demotion is the owner reaching into the `store`) and a ref kind
|
|
502
|
+
(a dream's rows point at the DREAM, not at a memory, so `none`). The
|
|
503
|
+
`band.promoted` narrator now names the lane when the row carries one.
|
|
504
|
+
|
|
505
|
+
Two small things the build learned. The candidates on the settling section are
|
|
506
|
+
now memories about me or about us, measured by the lanes (`views/mind.ts`), and a
|
|
507
|
+
place or a plain fact is counted apart as "not for the core" rather than "out of
|
|
508
|
+
reach by use". And the adapter's import scan reads a quote right after the word
|
|
509
|
+
`from` as a module path, so `d["from"]` in a view is written as a destructure.
|
|
510
|
+
|
|
511
|
+
The Consolidation and Dreaming LIGHTS are deliberately not here: master moved the
|
|
512
|
+
mechanism lights into `src/adapters/mechanism-evidence.ts` (#250), and the
|
|
513
|
+
builder wires those two there after the rebase.
|
|
@@ -64,8 +64,10 @@ import { BAND_TRANSITION_EVENT } from "../../core/sleep/index.js";
|
|
|
64
64
|
// Prospective memory's two (2026-09-20, E2). The module had no durable row at
|
|
65
65
|
// all: `fires` is a column, so the store could say a window had ever fired and
|
|
66
66
|
// never when, or why one did not.
|
|
67
|
+
// And a third (2026-09-26): a PLAIN item told to the person on its day.
|
|
67
68
|
import {
|
|
68
69
|
PROSPECTIVE_FIRE_EVENT,
|
|
70
|
+
PROSPECTIVE_PLAIN_EVENT,
|
|
69
71
|
PROSPECTIVE_REFUSED_EVENT,
|
|
70
72
|
} from "../../core/prospective/index.js";
|
|
71
73
|
// The self page's two, from `self/` itself (2026-09-18, S1): a written page is
|
|
@@ -91,6 +93,16 @@ import { RETENTION_EVENT } from "../../core/remember/index.js";
|
|
|
91
93
|
// The vector cache's identity check (2026-09-23, #190): the one durable row the
|
|
92
94
|
// store writes when an open changed what box 3's vectors are filed under.
|
|
93
95
|
import { EMBEDDER_RECONCILED_EVENT } from "../../core/store/index.js";
|
|
96
|
+
// Dreaming (2026-09-26, `dream/`): the five rows a dream leaves, from the module
|
|
97
|
+
// itself; the v8 upgrade's one-time census, from `sleep/`.
|
|
98
|
+
import {
|
|
99
|
+
DREAM_ASK_EVENT,
|
|
100
|
+
DREAM_BEGUN_EVENT,
|
|
101
|
+
DREAM_CHANGED_EVENT,
|
|
102
|
+
DREAM_JOURNALED_EVENT,
|
|
103
|
+
DREAM_UNDONE_EVENT,
|
|
104
|
+
} from "../../core/dream/index.js";
|
|
105
|
+
import { V8_CENSUS_EVENT } from "../../core/sleep/index.js";
|
|
94
106
|
|
|
95
107
|
/** Display order for the bands, weakest commitment first. EXHAUSTIVE BY TYPE. */
|
|
96
108
|
const BAND_ORDER = {
|
|
@@ -176,11 +188,21 @@ export type DurableEventName =
|
|
|
176
188
|
| typeof SNAPSHOT_ROTATED_EVENT
|
|
177
189
|
| typeof PROSPECTIVE_FIRE_EVENT
|
|
178
190
|
| typeof PROSPECTIVE_REFUSED_EVENT
|
|
191
|
+
| typeof PROSPECTIVE_PLAIN_EVENT
|
|
179
192
|
| typeof JOURNAL_COPY_WRITTEN_EVENT
|
|
180
193
|
| typeof JOURNAL_COPY_FAILED_EVENT
|
|
181
194
|
| typeof STORE_EXPORT_EVENT
|
|
182
195
|
| typeof RETENTION_EVENT
|
|
183
|
-
| typeof EMBEDDER_RECONCILED_EVENT
|
|
196
|
+
| typeof EMBEDDER_RECONCILED_EVENT
|
|
197
|
+
| typeof DREAM_BEGUN_EVENT
|
|
198
|
+
| typeof DREAM_CHANGED_EVENT
|
|
199
|
+
| typeof DREAM_JOURNALED_EVENT
|
|
200
|
+
| typeof DREAM_UNDONE_EVENT
|
|
201
|
+
| typeof DREAM_ASK_EVENT
|
|
202
|
+
// The owner's demotion (`Counterpart.demoteCore`) writes this name as a
|
|
203
|
+
// literal; it is the mirror of `band.promoted`.
|
|
204
|
+
| "band.demoted"
|
|
205
|
+
| typeof V8_CENSUS_EVENT;
|
|
184
206
|
|
|
185
207
|
export const DURABLE_EVENTS = {
|
|
186
208
|
"adapter.ask": "the Stop ask was evaluated (asked, paced out, or capped for the day)",
|
|
@@ -265,6 +287,7 @@ export const DURABLE_EVENTS = {
|
|
|
265
287
|
// counted as a firing.
|
|
266
288
|
"prospective.fire": "a future date arrived and the reminder was offered into the turn (which window, and how much of its budget is left)",
|
|
267
289
|
"prospective.fire.refused": "a reminder was NOT offered (which brake held — one row per window per reason per lived day)",
|
|
290
|
+
"prospective.plain": "a reminder its author marked plain was told to the person on its day (which window, which beat — its day, a month or range opening, or its last day — and the date)",
|
|
268
291
|
// The journal's markdown copy and the hand export (2026-09-20, F6 and F7):
|
|
269
292
|
// the two places the constitution's "prose the owner can view" is kept now
|
|
270
293
|
// that every body is a column.
|
|
@@ -278,6 +301,17 @@ export const DURABLE_EVENTS = {
|
|
|
278
301
|
// The vector cache's identity check (2026-09-23, #190). Written only when an
|
|
279
302
|
// open CHANGED something — never for a match — so a quiet week is no rows.
|
|
280
303
|
"store.embedder.reconciled": "an open changed which model the stored vectors are filed under (reset to a new table and refilled, a paid model's vectors held until somebody chooses, a hold released, untagged vectors adopted, a decision deferred, or vectors dropped by a rebuild)",
|
|
304
|
+
// Dreaming (2026-09-26). Five rows, each ids and counts only: the journal's
|
|
305
|
+
// words live in the `dreams` table, never in the log.
|
|
306
|
+
"dream.begun": "a dream began: the dreamer was shown what was lived since the last one (how many new memories, how many shown in all, how many chapters)",
|
|
307
|
+
"dream.changed": "a dream changed memories (how many changes landed and were refused, by kind: merges, links, replays, gists, contradictions, feelings, nominations)",
|
|
308
|
+
"dream.journaled": "a dream ended with its journal entry written (how long, and what it changed)",
|
|
309
|
+
"dream.undone": "the owner reversed a whole dream (how many of its changes were put back)",
|
|
310
|
+
"dream.ask": "the day's dream ask was put to a session, or the owner said not today",
|
|
311
|
+
// The owner's door out of the core (2026-09-26).
|
|
312
|
+
"band.demoted": "the owner sent a core memory back to ordinary fading (and why is kept beside it)",
|
|
313
|
+
// The v8 upgrade's one-time proof (2026-09-26).
|
|
314
|
+
"physics.upgrade.census": "after the v8 upgrade, every memory was measured by the old arithmetic and the new (how many moved a band, down or up, and how many would be let go sooner or later)",
|
|
281
315
|
} as const satisfies Record<DurableEventName, string>;
|
|
282
316
|
|
|
283
317
|
export const DURABLE_EVENT_NAMES: readonly DurableEventName[] = Object.keys(
|