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
|
@@ -174,6 +174,20 @@ export interface RecallTunables {
|
|
|
174
174
|
* A high-salience wound must not light up every turn. [v1: 2] CAL. */
|
|
175
175
|
AFFECT_REFRACTORY_TURNS: number;
|
|
176
176
|
|
|
177
|
+
// ── mood-matching (recall G18, emotion part A — WORKING DEFAULTS) ─────────────
|
|
178
|
+
/** How far back a recorded feeling still counts as how someone feels NOW, in
|
|
179
|
+
* hours of the store's clock. No classifier reads the turn: the mood is only
|
|
180
|
+
* what was recorded. CAL. */
|
|
181
|
+
MOOD_WINDOW_HOURS: number;
|
|
182
|
+
/** A recorded feeling weaker than this does not set a mood. CAL. */
|
|
183
|
+
MOOD_MIN_STRENGTH: number;
|
|
184
|
+
/** Salience a memory gains when it carried the SAME person's matching feeling,
|
|
185
|
+
* times that feeling's softened strength. Modulates the relative bar only —
|
|
186
|
+
* never activation, never an uncued memory. CAL. */
|
|
187
|
+
MOOD_SAME_WEIGHT: number;
|
|
188
|
+
/** The same for the OTHER person's matching feeling: the light cross-link. CAL. */
|
|
189
|
+
MOOD_CROSS_WEIGHT: number;
|
|
190
|
+
|
|
177
191
|
// ── render ───────────────────────────────────────────────────────────────
|
|
178
192
|
/** Composed byte budget for the WHOLE injection, sentinel included. The host
|
|
179
193
|
* owns the real ceiling (scar §2.18) and passes it in; this is the default. CAL. */
|
|
@@ -374,6 +388,18 @@ export const TUNABLES: RecallTunables = {
|
|
|
374
388
|
AFFECT_MIN_EMOTION: 0.7,
|
|
375
389
|
AFFECT_REFRACTORY_TURNS: 2,
|
|
376
390
|
|
|
391
|
+
// Emotion part A (2026-09-26). The window is "this sitting": long enough to
|
|
392
|
+
// span a working session's feelings, short enough that yesterday's mood is
|
|
393
|
+
// not today's. The weights are sized against SAL_BAR_WEIGHT = 0.5: a fresh
|
|
394
|
+
// same-person match at strength 0.9 adds 0.27 to salience, which lowers that
|
|
395
|
+
// candidate's relative bar by ~27%; the cross-link at 0.1 moves it ~9%. A
|
|
396
|
+
// match a month old has softened to ~0.2 of its strength (S_FEELING = 20)
|
|
397
|
+
// and moves the bar by ~6%. Unmeasured — recorded as a working default.
|
|
398
|
+
MOOD_WINDOW_HOURS: 3,
|
|
399
|
+
MOOD_MIN_STRENGTH: 0.3,
|
|
400
|
+
MOOD_SAME_WEIGHT: 0.3,
|
|
401
|
+
MOOD_CROSS_WEIGHT: 0.1,
|
|
402
|
+
|
|
377
403
|
BUDGET_BYTES: 2048,
|
|
378
404
|
GIST_BYTES: 240,
|
|
379
405
|
FOOTNOTE_TITLE_BYTES: 150,
|
|
@@ -64,6 +64,11 @@ is that the ask is ambient (constitution line 8) and its coverage is measured, n
|
|
|
64
64
|
happened to us. Both refusals are COUNTED in `CaptureResult.excluded`, so a boundary
|
|
65
65
|
that captured nothing because everything was excluded is distinguishable from a boundary
|
|
66
66
|
where nothing happened.
|
|
67
|
+
- **A DREAM's words never enter either** (2026-09-26, `dream/`) — the bundle a dreamer
|
|
68
|
+
was shown and the hand-back its background agent sends home carry `DREAM_MARK`
|
|
69
|
+
(`dream/mark.ts`), and `enters()` refuses any turn that carries it, by source (`dream`,
|
|
70
|
+
the Claude Code reader's tag) and by the mark itself, so no host's reader can let one
|
|
71
|
+
through. What was dreamed is not what happened.
|
|
67
72
|
- **Boundaries are appenders, not thinkers.** Capture completes in microseconds; the host
|
|
68
73
|
never waits on a model call at a boundary. [v1] §2 G1, [engram E4].
|
|
69
74
|
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { Kind, Salience } from "../types.js";
|
|
23
23
|
import { hashText } from "../store/prose.js";
|
|
24
|
+
import { parseCalendarDate } from "../time.js";
|
|
24
25
|
import { randomBytes } from "node:crypto";
|
|
25
26
|
|
|
26
27
|
// TYPE-ONLY, and the only edge this module has to `encode/`. The gate itself
|
|
@@ -61,10 +62,30 @@ export interface ProposalDraft {
|
|
|
61
62
|
updates?: string;
|
|
62
63
|
/** An open loop is an ordinary memory with a flag, not a special structure (§4). */
|
|
63
64
|
unresolved?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The calendar date this memory is ABOUT, when it is about a future one
|
|
67
|
+
* (schema v7's `event_date`; 2026-09-26): a day `2026-10-15`, a month
|
|
68
|
+
* `2026-10`, a year `2026`, or a range `2026-10-20..2026-10-31`. An explicit
|
|
69
|
+
* FIELD — the author converts "late October" itself, and nothing here reads
|
|
70
|
+
* prose for a date. Unreadable is malformed, never guessed.
|
|
71
|
+
*/
|
|
72
|
+
eventDate?: string;
|
|
73
|
+
/** Plain or quiet (`prospective/` `CUE_MODE_META`). Only meaningful beside an
|
|
74
|
+
* `eventDate`; without one it is dropped and counted. Default quiet. */
|
|
75
|
+
remind?: "plain" | "quiet";
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export type ProposalSource = "session-end" | "jot";
|
|
67
79
|
|
|
80
|
+
/** What a draft said about its reminder date (`Proposal.dateIntent`). */
|
|
81
|
+
export interface DateIntent {
|
|
82
|
+
/** `set`: a readable date was sent; `cleared`: `eventDate: null` was sent;
|
|
83
|
+
* `absent`: the field was left out. */
|
|
84
|
+
readonly eventDate: "set" | "cleared" | "absent";
|
|
85
|
+
/** The `remind` the author sent, or null when none was (the draft's quiet is a default). */
|
|
86
|
+
readonly remind: "plain" | "quiet" | null;
|
|
87
|
+
}
|
|
88
|
+
|
|
68
89
|
/** What the engine mints. Memory objects only — no operations, by construction. */
|
|
69
90
|
export interface Proposal {
|
|
70
91
|
id: string;
|
|
@@ -79,6 +100,24 @@ export interface Proposal {
|
|
|
79
100
|
aliases: string[];
|
|
80
101
|
updates: UpdatesResolution | null;
|
|
81
102
|
unresolved: boolean;
|
|
103
|
+
/** The reminder date as the author wrote it (already read by `time.ts`), or null. */
|
|
104
|
+
eventDate: string | null;
|
|
105
|
+
/** Plain or quiet — null exactly when `eventDate` is. */
|
|
106
|
+
remind: "plain" | "quiet" | null;
|
|
107
|
+
/**
|
|
108
|
+
* What the author SAID about the date, as opposed to what defaulted — read
|
|
109
|
+
* only when this proposal revises a memory (`updates:`), where a date the
|
|
110
|
+
* author left out is carried over from the one it revises rather than lost
|
|
111
|
+
* (review N7, 2026-09-26; `Counterpart#carryReminder`). Absent on a proposal
|
|
112
|
+
* no author wrote (the sweep), which therefore carries nothing.
|
|
113
|
+
*/
|
|
114
|
+
dateIntent?: DateIntent;
|
|
115
|
+
/**
|
|
116
|
+
* The memory this proposal takes its reminder over from, set by
|
|
117
|
+
* `Counterpart#carryReminder` only (never by an author): written to
|
|
118
|
+
* `meta.reminderFrom` at the minting seam (prospective `DATE_FROM_META`).
|
|
119
|
+
*/
|
|
120
|
+
reminderFrom?: string;
|
|
82
121
|
at: number;
|
|
83
122
|
day: number;
|
|
84
123
|
/** Identity for idempotency: CONTENT, not span text (§4.1 G9). */
|
|
@@ -102,7 +141,11 @@ export type MalformedReason =
|
|
|
102
141
|
| "TITLE_NOT_STRING"
|
|
103
142
|
| "UPDATES_NOT_STRING"
|
|
104
143
|
| "ALIASES_NOT_STRINGS"
|
|
105
|
-
| "FEELING_MALFORMED"
|
|
144
|
+
| "FEELING_MALFORMED"
|
|
145
|
+
/** `eventDate` is not a day, month, year or `a..b` range `time.ts` can read. */
|
|
146
|
+
| "EVENT_DATE_UNREADABLE"
|
|
147
|
+
/** `remind` is not `plain` or `quiet`. */
|
|
148
|
+
| "REMIND_UNKNOWN";
|
|
106
149
|
|
|
107
150
|
const KIND_SET: Record<Kind, true> = {
|
|
108
151
|
self: true,
|
|
@@ -129,10 +172,18 @@ export const DRAFT_FIELDS = [
|
|
|
129
172
|
"aliases",
|
|
130
173
|
"updates",
|
|
131
174
|
"unresolved",
|
|
175
|
+
"eventDate",
|
|
176
|
+
"remind",
|
|
132
177
|
] as const;
|
|
133
178
|
|
|
134
179
|
export type IntakeResult =
|
|
135
|
-
| {
|
|
180
|
+
| {
|
|
181
|
+
ok: true;
|
|
182
|
+
draft: Required<Pick<ProposalDraft, "content">> & ProposalDraft;
|
|
183
|
+
dropped: string[];
|
|
184
|
+
/** What the draft said about its date, before any default (`DateIntent`). */
|
|
185
|
+
dateIntent: DateIntent;
|
|
186
|
+
}
|
|
136
187
|
| { ok: false; reason: MalformedReason; text: string | null; dropped: string[] };
|
|
137
188
|
|
|
138
189
|
/**
|
|
@@ -204,7 +255,29 @@ export function intake(raw: unknown): IntakeResult {
|
|
|
204
255
|
}
|
|
205
256
|
}
|
|
206
257
|
|
|
258
|
+
// THE REMINDER DATE (2026-09-26): read by `time.ts`, the one module that
|
|
259
|
+
// reads dates, and refused when it cannot be read — the same answer
|
|
260
|
+
// `Store#revise` gives (schema v7). Never guessed, never parsed from prose.
|
|
261
|
+
let eventDate: string | undefined;
|
|
262
|
+
if (rec["eventDate"] !== undefined && rec["eventDate"] !== null) {
|
|
263
|
+
const v = rec["eventDate"];
|
|
264
|
+
const read = typeof v === "string" ? parseCalendarDate(v) : null;
|
|
265
|
+
if (read === null) return bad("EVENT_DATE_UNREADABLE");
|
|
266
|
+
eventDate = read.text;
|
|
267
|
+
}
|
|
268
|
+
if (rec["remind"] !== undefined && rec["remind"] !== null) {
|
|
269
|
+
if (rec["remind"] !== "plain" && rec["remind"] !== "quiet") return bad("REMIND_UNKNOWN");
|
|
270
|
+
}
|
|
271
|
+
|
|
207
272
|
const draft: ProposalDraft = { content: rec["content"] as string };
|
|
273
|
+
if (eventDate !== undefined) {
|
|
274
|
+
draft.eventDate = eventDate;
|
|
275
|
+
draft.remind = rec["remind"] === "plain" ? "plain" : "quiet";
|
|
276
|
+
} else if (rec["remind"] !== undefined && rec["remind"] !== null) {
|
|
277
|
+
// Plain or quiet says HOW a date comes back; with no date there is nothing
|
|
278
|
+
// to come back, so it is dropped and counted like any field with nowhere to go.
|
|
279
|
+
dropped.push("remind");
|
|
280
|
+
}
|
|
208
281
|
if (rec["kind"] !== undefined) draft.kind = rec["kind"] as Kind;
|
|
209
282
|
if (typeof rec["title"] === "string") draft.title = rec["title"];
|
|
210
283
|
if (rec["claimed"] !== undefined) draft.claimed = rec["claimed"] as number | null;
|
|
@@ -215,7 +288,14 @@ export function intake(raw: unknown): IntakeResult {
|
|
|
215
288
|
if (rec["aliases"] !== undefined) draft.aliases = rec["aliases"] as string[];
|
|
216
289
|
if (typeof rec["updates"] === "string") draft.updates = rec["updates"];
|
|
217
290
|
draft.unresolved = rec["unresolved"] === true;
|
|
218
|
-
|
|
291
|
+
// What was SAID, before the quiet default above: a revision carries over
|
|
292
|
+
// whatever its author left out (review N7), so "left out" and "said quiet"
|
|
293
|
+
// must stay two different answers. `eventDate: null` is the explicit drop.
|
|
294
|
+
const dateIntent: DateIntent = {
|
|
295
|
+
eventDate: eventDate !== undefined ? "set" : rec["eventDate"] === null ? "cleared" : "absent",
|
|
296
|
+
remind: rec["remind"] === "plain" || rec["remind"] === "quiet" ? rec["remind"] : null,
|
|
297
|
+
};
|
|
298
|
+
return { ok: true, draft: draft as Required<Pick<ProposalDraft, "content">> & ProposalDraft, dropped, dateIntent };
|
|
219
299
|
}
|
|
220
300
|
|
|
221
301
|
// ── the gate seam (INJECTED — see INTERFACE-GAPS.md #2) ──────────────────────
|
|
@@ -527,6 +607,9 @@ export async function submitProposal(
|
|
|
527
607
|
aliases: [...(verdict.aliases ?? draft.aliases ?? [])],
|
|
528
608
|
updates,
|
|
529
609
|
unresolved: draft.unresolved === true,
|
|
610
|
+
eventDate: draft.eventDate ?? null,
|
|
611
|
+
remind: draft.eventDate === undefined ? null : draft.remind ?? "quiet",
|
|
612
|
+
dateIntent: parsed.dateIntent,
|
|
530
613
|
at: buffer.now(),
|
|
531
614
|
day: buffer.day(),
|
|
532
615
|
contentHash,
|
|
@@ -50,6 +50,7 @@ import { basename, join } from "node:path";
|
|
|
50
50
|
|
|
51
51
|
import { grantSpanStrike } from "./owner-strike-seam.js";
|
|
52
52
|
import { grantWriteUp } from "./write-up-seam.js";
|
|
53
|
+
import { carriesDreamMark } from "../dream/mark.js";
|
|
53
54
|
import { hashText } from "../store/prose.js";
|
|
54
55
|
import { dataDir } from "../store/paths.js";
|
|
55
56
|
import { isObserver } from "../observer.js";
|
|
@@ -80,7 +81,11 @@ export type TurnSource =
|
|
|
80
81
|
| "file"
|
|
81
82
|
| "image"
|
|
82
83
|
| "foreign"
|
|
83
|
-
| "ritual"
|
|
84
|
+
| "ritual"
|
|
85
|
+
/** A DREAM's words (2026-09-26, `dream/`): the bundle a dreamer was shown or
|
|
86
|
+
* its hand-back, read back off a transcript. What was dreamed is not what
|
|
87
|
+
* happened; it enters nothing, and it is counted like `ritual`. */
|
|
88
|
+
| "dream";
|
|
84
89
|
|
|
85
90
|
export interface Turn {
|
|
86
91
|
role: "user" | "assistant";
|
|
@@ -1332,6 +1337,11 @@ export function enters(turn: Turn): boolean {
|
|
|
1332
1337
|
// wording become a memory of having thought it, and the ask already has a
|
|
1333
1338
|
// durable record of its own (`adapter.authorship.ask`). Refused, and counted.
|
|
1334
1339
|
if (source === "ritual") return false;
|
|
1340
|
+
// THE DREAM EXCLUSION (2026-09-26), by source AND by the mark itself, so a
|
|
1341
|
+
// host whose reader never learned the `dream` tag still cannot let a dream's
|
|
1342
|
+
// bundle or hand-back through: the sweep mints from these turns, and a dream
|
|
1343
|
+
// is never a lived event (`dream/mark.ts`).
|
|
1344
|
+
if (source === "dream" || carriesDreamMark(turn.text)) return false;
|
|
1335
1345
|
return source === "conversation" || source === "injected";
|
|
1336
1346
|
}
|
|
1337
1347
|
|
|
@@ -410,6 +410,9 @@ of them a budget. The composed budget is the caller's and lives nowhere in this
|
|
|
410
410
|
| `CRAFT_MAX` | 8 | Craft (skill-kind) elements considered. |
|
|
411
411
|
| `THREADS_MAX` | 12 | Open threads considered. Dark on a migrated store — INTERFACE-GAPS §8, and no cap can fix a missing source. |
|
|
412
412
|
| `HINTS_MAX` | 8 | Warm-shelf hints considered. |
|
|
413
|
+
| `HINT_STEP` | 1 | What one published showing in the hints ("Nearby") lane adds to a memory's habituation load — used while shown or not (2026-09-26). |
|
|
414
|
+
| `HINT_RECOVERY_DAYS` | 3 | Lived days for that load to fall to 1/e once the memory stops being shown. |
|
|
415
|
+
| `HINT_HABITUATION` | 1 | The pull a load leaves: `1 / (1 + HINT_HABITUATION × load)`. |
|
|
413
416
|
| `HORIZON_MAX` | 6 | Arriving occasions considered (source borrowed — INTERFACE-GAPS §3). |
|
|
414
417
|
| `WARM_FLOOR` | 0.35 | Decayed strength a non-identity element must reach to be craft or a hint. Identity faces no floor. |
|
|
415
418
|
| `BUDGET_PRESSURE` | 0.9 | Fraction of the budget that fires the pressure event (scar §2.4). |
|
|
@@ -299,3 +299,10 @@ Recorded against the store, where it would be declared: `store/CONTRACT.md` §7
|
|
|
299
299
|
|
|
300
300
|
**What does not need it:** correctness. `journal` was classified before anything
|
|
301
301
|
wrote it (scar §2.11) and a test asserts a snapshot carries the copies.
|
|
302
|
+
|
|
303
|
+
## 12. The hints lane is ranked once a day, for every directory — 2026-09-26
|
|
304
|
+
|
|
305
|
+
The wake is composed at the first boundary of a lived day and read from every directory,
|
|
306
|
+
so "Nearby" cannot prefer what was learned HERE (#238 tried a scope boost that followed
|
|
307
|
+
the boundary's scope, not the reader's, and it was dropped). Choosing per directory at
|
|
308
|
+
wake time would put ranking on the wake path, which is meant to compute nothing. Open.
|
package/src/core/self/NOTES.md
CHANGED
|
@@ -1208,3 +1208,33 @@ proving it). For the nights either side of the change, rows written before carry
|
|
|
1208
1208
|
no caller moved. The self page and each chapter's episode row also record their writer in
|
|
1209
1209
|
the store's `model` column (store NOTES 2026-09-25) beside `meta.models`.
|
|
1210
1210
|
|
|
1211
|
+
## 26. "Nearby" rotates: organic strength × habituation (2026-09-26)
|
|
1212
|
+
|
|
1213
|
+
*The owner's "rich get richer" (2026-09-25), harvested from the held #238 and reworked
|
|
1214
|
+
after its review. `identity.ts#hintReading`; physics §5.11 for the other half.*
|
|
1215
|
+
|
|
1216
|
+
One strong memory held the hints lane nearly every session: shown, mentioned by the
|
|
1217
|
+
assistant, credited, still strongest, shown again. #238's review measured its fix
|
|
1218
|
+
slowing the loop without breaking it — the strong memory was back every day by ~day 20
|
|
1219
|
+
of a 60-day simulation — because a use while shown still reset `lastUsedDay`, still
|
|
1220
|
+
added to `uses`, and was only half a habituation step. Now:
|
|
1221
|
+
|
|
1222
|
+
- **The lane ranks on ORGANIC strength** — the memory decayed from its last organic use,
|
|
1223
|
+
with the uses it had when it was FIRST EVER shown plus its awake returns (each return
|
|
1224
|
+
is a use the display did not prompt). A use while it was showing moves neither. Its
|
|
1225
|
+
own strength still rises (the use credits, as always): the warm floor, recall and the
|
|
1226
|
+
bands read that.
|
|
1227
|
+
- **Habituation**: each published showing adds `HINT_STEP` (1, used or not), recovering
|
|
1228
|
+
as `exp(−days / 3)`; the pull is `1 / (1 + load)`. A return AFTER it left the lane — a
|
|
1229
|
+
memory reached for without the prompt — resets the load.
|
|
1230
|
+
- **What was shown is a store table** (`wake_display`, schema v8), written by `boundary`
|
|
1231
|
+
on a real publish (kept ids, not ranked ones; every other open showing closed that
|
|
1232
|
+
day), because the store needs it too: a use while a memory is showing is not a return.
|
|
1233
|
+
- **Dropped from #238**: the scope/session context boost (it followed the scope of the
|
|
1234
|
+
boundary that triggered the render, not the reader's — its own named approximation),
|
|
1235
|
+
and the `self.hinted.*` meta keys (a table is chased by removal; meta keys were not).
|
|
1236
|
+
|
|
1237
|
+
Measured (`tools/sim/consolidation.ts`, 60 lived days, HINTS_MAX 8, a strong memory
|
|
1238
|
+
used every time it is shown, two new facts a day): shown on 34 of 60 days, longest run 8,
|
|
1239
|
+
99 distinct memories shown, 0 returns. `test/hints-nearby.test.ts` pins the rotation, the
|
|
1240
|
+
recovery, the organic reset, the same-day re-render, and a 60-day loop at the defaults.
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
* no index for — INTERFACE-GAPS #2) and text arrives at render time through the
|
|
18
18
|
* `Resolve` seam.
|
|
19
19
|
*/
|
|
20
|
+
import { createHash } from "node:crypto";
|
|
20
21
|
import type { Band, Kind, MemoryPhysics } from "../types.js";
|
|
21
22
|
import { strength } from "../physics/index.js";
|
|
22
|
-
import type { ProseDoc, ReadOnlyStore, Store } from "../store/index.js";
|
|
23
|
+
import type { ProseDoc, ReadOnlyStore, Store, WakeDisplayRow } from "../store/index.js";
|
|
23
24
|
import type { SelfTunables } from "./tunables.js";
|
|
24
25
|
|
|
25
26
|
export type LaneName = "identity" | "craft" | "threads" | "hints" | "horizon";
|
|
@@ -33,10 +34,91 @@ export interface Ranked {
|
|
|
33
34
|
readonly strength: number;
|
|
34
35
|
readonly protected: boolean;
|
|
35
36
|
readonly bornDay: number;
|
|
37
|
+
/**
|
|
38
|
+
* The last tie-break before the id: a hash of the memory's words, so two
|
|
39
|
+
* memories tied on everything else order the same way in every store that
|
|
40
|
+
* holds them. Ids are random (`store/index.ts#newId`), so an id tie-break is
|
|
41
|
+
* stable within one store but not across two built alike (the demo seed's
|
|
42
|
+
* two runs). A hash, not the text: this stays an ids-and-numbers structure.
|
|
43
|
+
* Absent on a line with no memory behind it (the horizon lane).
|
|
44
|
+
*/
|
|
45
|
+
readonly tieKey?: string;
|
|
36
46
|
/** Threads only: person-scoped debts trim last (behavioral-spec §1 G4). */
|
|
37
47
|
readonly personScoped: boolean;
|
|
38
48
|
/** Lived day this element last rendered in a wake; -1 never. Identity only. */
|
|
39
49
|
readonly lastRendered: number;
|
|
50
|
+
/** Hints only: why it ranked where it did (`hintReading`). */
|
|
51
|
+
readonly hint?: HintReading;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* HOW A HINT RANKS (2026-09-26, the owner's "rich get richer"; harvested from
|
|
56
|
+
* #238 and reworked after its review). The hints ("Nearby, if it helps:")
|
|
57
|
+
* lane used to be "strongest first", so one strong memory held it nearly
|
|
58
|
+
* every session: it was shown, mentioned, credited, still strongest, shown
|
|
59
|
+
* again. Two changes break the loop, and both are here:
|
|
60
|
+
*
|
|
61
|
+
* - **ORGANIC strength.** A hint is scored on its strength decayed since its
|
|
62
|
+
* last ORGANIC use — its last counted awake return, or any use from before
|
|
63
|
+
* it was ever shown — not since its last use of any kind. A use while it
|
|
64
|
+
* was showing is exactly the use the display may have prompted, so it
|
|
65
|
+
* keeps the memory's own strength up (it credits, as always) but buys it
|
|
66
|
+
* no advantage here, and it is not a return (physics §5.11).
|
|
67
|
+
* - **HABITUATION.** Each published showing adds `HINT_STEP` to a load that
|
|
68
|
+
* recovers as `exp(-days / HINT_RECOVERY_DAYS)` once it stops showing; the
|
|
69
|
+
* pull left is `1 / (1 + HINT_HABITUATION x load)`. Used or not while it
|
|
70
|
+
* was shown, the step is the same. A return AFTER it left the wake — the
|
|
71
|
+
* memory reached for without the prompt — resets the load outright.
|
|
72
|
+
*
|
|
73
|
+
* The score is `organic x habituation`; the warm floor still reads the
|
|
74
|
+
* memory's own strength. Pure: the caller hands in the display row.
|
|
75
|
+
*/
|
|
76
|
+
export interface HintReading {
|
|
77
|
+
readonly score: number;
|
|
78
|
+
/** Strength decayed from the last organic use. */
|
|
79
|
+
readonly organic: number;
|
|
80
|
+
/** The load as it stands on `day`, before this render. */
|
|
81
|
+
readonly load: number;
|
|
82
|
+
readonly habituation: number;
|
|
83
|
+
readonly habit: "fresh" | "habituated" | "reset";
|
|
84
|
+
/** The load to record if this render keeps it. */
|
|
85
|
+
readonly nextLoad: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function hintReading(
|
|
89
|
+
physics: MemoryPhysics,
|
|
90
|
+
display: WakeDisplayRow | undefined,
|
|
91
|
+
day: number,
|
|
92
|
+
t: Pick<SelfTunables, "HINT_STEP" | "HINT_RECOVERY_DAYS" | "HINT_HABITUATION">,
|
|
93
|
+
): HintReading {
|
|
94
|
+
const lastReturn = physics.lastReturnDay ?? null;
|
|
95
|
+
// What came back unprompted. Before it was ever shown, every use; after that,
|
|
96
|
+
// only the uses it had then plus its awake returns (each return is one
|
|
97
|
+
// referenced use the display did not prompt) — so a use while showing moves
|
|
98
|
+
// neither the anchor nor the stability this score decays by.
|
|
99
|
+
const organicUses =
|
|
100
|
+
display === undefined ? physics.uses : Math.min(physics.uses, display.ever_uses + (physics.returnDays ?? 0));
|
|
101
|
+
const anchor =
|
|
102
|
+
display === undefined
|
|
103
|
+
? physics.lastUsedDay
|
|
104
|
+
: Math.max(physics.birthDay, display.ever_last_used, lastReturn ?? -Infinity);
|
|
105
|
+
const organic = strength({ ...physics, uses: organicUses, lastUsedDay: anchor }, day);
|
|
106
|
+
let load = 0;
|
|
107
|
+
let habit: HintReading["habit"] = "fresh";
|
|
108
|
+
if (display !== undefined && display.lane === "hints") {
|
|
109
|
+
const leftOn = display.closed_day;
|
|
110
|
+
if (leftOn !== null && lastReturn !== null && lastReturn > leftOn) {
|
|
111
|
+
habit = "reset";
|
|
112
|
+
} else {
|
|
113
|
+
load = display.load * Math.exp(-Math.max(0, day - display.shown_day) / t.HINT_RECOVERY_DAYS);
|
|
114
|
+
habit = load > 0 ? "habituated" : "fresh";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const habituation = 1 / (1 + t.HINT_HABITUATION * load);
|
|
118
|
+
// A same-day re-render is one showing, not two.
|
|
119
|
+
const sameDay = display !== undefined && habit !== "reset" && display.shown_day === day;
|
|
120
|
+
const nextLoad = sameDay ? display.load : load + t.HINT_STEP;
|
|
121
|
+
return { score: organic * habituation, organic, load, habituation, habit, nextLoad };
|
|
40
122
|
}
|
|
41
123
|
|
|
42
124
|
/**
|
|
@@ -69,6 +151,10 @@ export interface Scanned {
|
|
|
69
151
|
* dates a MIGRATED element differently — its encode date is an upper bound. */
|
|
70
152
|
readonly source: string | null;
|
|
71
153
|
readonly lastRendered: number;
|
|
154
|
+
/** What the wake's hints lane last did with it (v8 `wake_display`), if anything. */
|
|
155
|
+
readonly display?: WakeDisplayRow;
|
|
156
|
+
/** The lived day this scan read strength at. */
|
|
157
|
+
readonly day?: number;
|
|
72
158
|
}
|
|
73
159
|
|
|
74
160
|
/**
|
|
@@ -78,6 +164,7 @@ export interface Scanned {
|
|
|
78
164
|
export function scanActive(store: Store, day: number): Scanned[] {
|
|
79
165
|
const out: Scanned[] = [];
|
|
80
166
|
const rendered = lastRenderedOf(store);
|
|
167
|
+
const displays = store.wakeDisplays();
|
|
81
168
|
for (const id of store.list({ type: "memory", archived: false })) {
|
|
82
169
|
const row = store.row(id);
|
|
83
170
|
if (row === undefined) continue;
|
|
@@ -102,6 +189,8 @@ export function scanActive(store: Store, day: number): Scanned[] {
|
|
|
102
189
|
unresolved: doc.meta["unresolved"] === true,
|
|
103
190
|
source: row.source,
|
|
104
191
|
lastRendered: rendered.get(id) ?? -1,
|
|
192
|
+
...(displays.has(id) ? { display: displays.get(id) as WakeDisplayRow } : {}),
|
|
193
|
+
day,
|
|
105
194
|
});
|
|
106
195
|
}
|
|
107
196
|
return out;
|
|
@@ -110,6 +199,14 @@ export function scanActive(store: Store, day: number): Scanned[] {
|
|
|
110
199
|
function byStrength(a: Ranked, b: Ranked): number {
|
|
111
200
|
if (b.strength !== a.strength) return b.strength - a.strength;
|
|
112
201
|
if (a.bornDay !== b.bornDay) return a.bornDay - b.bornDay;
|
|
202
|
+
return byContentThenId(a, b);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** The final tie-break: the words' hash (`tieKey`), then the id. */
|
|
206
|
+
function byContentThenId(a: Ranked, b: Ranked): number {
|
|
207
|
+
const ka = a.tieKey ?? "";
|
|
208
|
+
const kb = b.tieKey ?? "";
|
|
209
|
+
if (ka !== kb) return ka < kb ? -1 : 1;
|
|
113
210
|
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
114
211
|
}
|
|
115
212
|
|
|
@@ -137,11 +234,20 @@ function byRotation(a: Ranked, b: Ranked): number {
|
|
|
137
234
|
function byThreadAge(a: Ranked, b: Ranked): number {
|
|
138
235
|
if (a.personScoped !== b.personScoped) return a.personScoped ? -1 : 1;
|
|
139
236
|
if (a.bornDay !== b.bornDay) return a.bornDay - b.bornDay;
|
|
140
|
-
return a
|
|
237
|
+
return byContentThenId(a, b);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Hints order: the hint score (organic strength x habituation), then as `byStrength`. */
|
|
241
|
+
function byHint(a: Ranked, b: Ranked): number {
|
|
242
|
+
const sa = a.hint?.score ?? a.strength;
|
|
243
|
+
const sb = b.hint?.score ?? b.strength;
|
|
244
|
+
if (sb !== sa) return sb - sa;
|
|
245
|
+
return byStrength(a, b);
|
|
141
246
|
}
|
|
142
247
|
|
|
143
|
-
function rank(s: Scanned, lane: LaneName): Ranked {
|
|
248
|
+
function rank(s: Scanned, lane: LaneName, hint?: HintReading): Ranked {
|
|
144
249
|
return {
|
|
250
|
+
...(hint === undefined ? {} : { hint }),
|
|
145
251
|
id: s.id,
|
|
146
252
|
lane,
|
|
147
253
|
kind: s.kind,
|
|
@@ -149,6 +255,7 @@ function rank(s: Scanned, lane: LaneName): Ranked {
|
|
|
149
255
|
strength: s.strength,
|
|
150
256
|
protected: s.physics.protected,
|
|
151
257
|
bornDay: s.doc.bornDay,
|
|
258
|
+
tieKey: createHash("sha256").update(s.doc.body).digest("hex"),
|
|
152
259
|
personScoped: s.kind === "person",
|
|
153
260
|
lastRendered: s.lastRendered,
|
|
154
261
|
};
|
|
@@ -176,7 +283,9 @@ export interface Lanes {
|
|
|
176
283
|
* craft — skill-kind, not already in identity, above the warm floor. The
|
|
177
284
|
* procedural self is rendered as CONTENT, never a pointer (§1).
|
|
178
285
|
* threads — `unresolved` memories: person-scoped first, oldest-opened first.
|
|
179
|
-
* hints — everything else warm enough to be worth a nudge,
|
|
286
|
+
* hints — everything else warm enough to be worth a nudge, by `hintReading`:
|
|
287
|
+
* organic strength x habituation, so one strong memory cannot
|
|
288
|
+
* hold the lane every day (2026-09-26).
|
|
180
289
|
* horizon — the caller's arriving occasions, in the order supplied
|
|
181
290
|
* (`prospective/` owns the ordering — INTERFACE-GAPS #3).
|
|
182
291
|
*
|
|
@@ -207,13 +316,13 @@ export function rankLanes(
|
|
|
207
316
|
craft.push(rank(s, "craft"));
|
|
208
317
|
continue;
|
|
209
318
|
}
|
|
210
|
-
hints.push(rank(s, "hints"));
|
|
319
|
+
hints.push(rank(s, "hints", hintReading(s.physics, s.display, s.day ?? s.doc.bornDay, t)));
|
|
211
320
|
}
|
|
212
321
|
|
|
213
322
|
identity.sort(byRotation);
|
|
214
323
|
craft.sort(byStrength);
|
|
215
324
|
threads.sort(byThreadAge);
|
|
216
|
-
hints.sort(
|
|
325
|
+
hints.sort(byHint);
|
|
217
326
|
|
|
218
327
|
return {
|
|
219
328
|
identity: identity.slice(0, t.IDENTITY_MAX),
|
package/src/core/self/index.ts
CHANGED
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
RENDERED_PREFIX,
|
|
51
51
|
enumerate,
|
|
52
52
|
findIdentityCore,
|
|
53
|
+
hintReading,
|
|
53
54
|
identityCoreName,
|
|
54
55
|
rankLanes,
|
|
55
56
|
scanActive,
|
|
@@ -1306,6 +1307,22 @@ export class Self {
|
|
|
1306
1307
|
);
|
|
1307
1308
|
}
|
|
1308
1309
|
this.emit("self.briefing.published", undefined, { bytes: briefing.bytes, hash });
|
|
1310
|
+
// WHAT THE HINTS LANE SHOWED (v8, 2026-09-26): the kept hint ids, each with
|
|
1311
|
+
// the habituation load this showing leaves (`identity.ts#hintReading`), so
|
|
1312
|
+
// the next render rotates, and so a use while a memory is showing is known
|
|
1313
|
+
// not to be a return (physics §5.11). Kept, not ranked — as for identity.
|
|
1314
|
+
// Every other open showing is closed today. After the publish, and never
|
|
1315
|
+
// allowed to fail it.
|
|
1316
|
+
try {
|
|
1317
|
+
const displays = this.store.wakeDisplays();
|
|
1318
|
+
const kept = briefing.kept.hints.map((id) => ({
|
|
1319
|
+
id,
|
|
1320
|
+
load: hintReading(this.store.physicsOf(id), displays.get(id), req.day, this.tunables).nextLoad,
|
|
1321
|
+
}));
|
|
1322
|
+
this.store.recordHintDisplay(req.day, kept);
|
|
1323
|
+
} catch (err) {
|
|
1324
|
+
this.emit("self.hints.display.failed", undefined, { error: err instanceof Error ? err.name : "UNKNOWN" });
|
|
1325
|
+
}
|
|
1309
1326
|
// THE JOURNAL'S BACKFILL (F6), and this is the only place it runs.
|
|
1310
1327
|
//
|
|
1311
1328
|
// A store whose `journal/` was deleted — or one whose episodes predate this
|
|
@@ -50,6 +50,19 @@ export interface SelfTunables {
|
|
|
50
50
|
* "identity is re-inhabited, not retrieved"). CAL. */
|
|
51
51
|
WARM_FLOOR: number;
|
|
52
52
|
|
|
53
|
+
// ── the hints ("Nearby") lane's rotation (2026-09-26, harvested from #238) ─
|
|
54
|
+
/**
|
|
55
|
+
* What one published showing in the hints lane adds to a memory's
|
|
56
|
+
* habituation load — the SAME whether or not it was used while shown (#238's
|
|
57
|
+
* review: a half step for "used on display" barely habituated, and a use the
|
|
58
|
+
* display may have prompted is not evidence the hint was wanted). CAL.
|
|
59
|
+
*/
|
|
60
|
+
HINT_STEP: number;
|
|
61
|
+
/** Lived days for the load to fall to 1/e once it stops being shown. CAL. */
|
|
62
|
+
HINT_RECOVERY_DAYS: number;
|
|
63
|
+
/** The pull a load leaves: `1 / (1 + HINT_HABITUATION x load)`. CAL. */
|
|
64
|
+
HINT_HABITUATION: number;
|
|
65
|
+
|
|
53
66
|
// ── the self page (plan 2026-09-18, S1) ───────────────────────────────────
|
|
54
67
|
/**
|
|
55
68
|
* Bytes of the WAKE the page may take. A page longer than this renders cut, at
|
|
@@ -185,6 +198,10 @@ export const SELF_TUNABLES: SelfTunables = {
|
|
|
185
198
|
HORIZON_MAX: 6,
|
|
186
199
|
WARM_FLOOR: 0.35,
|
|
187
200
|
|
|
201
|
+
HINT_STEP: 1,
|
|
202
|
+
HINT_RECOVERY_DAYS: 3,
|
|
203
|
+
HINT_HABITUATION: 1,
|
|
204
|
+
|
|
188
205
|
PAGE_WAKE_BYTES: 6_144,
|
|
189
206
|
PAGE_MAX_BYTES: 16_384,
|
|
190
207
|
PAGE_STALE_DAYS: 14,
|
|
@@ -71,7 +71,10 @@ alone.
|
|
|
71
71
|
- **Over-budget is measured at full membership, not on the rendered output** — a renderer
|
|
72
72
|
that demotes until it fits *by construction never reports being over budget*. [v1 §7]
|
|
73
73
|
- **Auto-consolidation on a cycle** (v0: every 3 days) — the pass that links a memory to its
|
|
74
|
-
schemas and sets the consolidation bonus in `physics/` §5.2. [v0]
|
|
74
|
+
schemas and sets the consolidation bonus in `physics/` §5.2. [v0] **Since 2026-09-26 the
|
|
75
|
+
bonus is LEGACY** (rows born before schema v8 only; physics §5.11): a memory made since
|
|
76
|
+
stays strong by returning, credited at the moment it returns, and this pass decides the
|
|
77
|
+
CORE — by two lanes, for memories about me or about us, at most three a night (below).
|
|
75
78
|
|
|
76
79
|
## 4. Drops / simplifies
|
|
77
80
|
|
|
@@ -118,6 +121,19 @@ store, measured at four rows crossing on master and none under the wider guard.
|
|
|
118
121
|
belief should cross at all is a real question with a one-query answer against the live
|
|
119
122
|
store that nobody has; it is not this change's to take. The identity core is not exempted
|
|
120
123
|
either, for the same reason.*
|
|
124
|
+
*THE CORE'S LANES, from 2026-09-26 (owner decisions, dreaming + consolidation).* The
|
|
125
|
+
consolidate phase is still the ONE place a memory is promoted, and every crossing is
|
|
126
|
+
still an explicit, counted record — now carrying its LANE. What changed: physics decides
|
|
127
|
+
the lanes (`promotionEligibility(m, { aboutMe, demoted })`); this phase decides who is
|
|
128
|
+
ABOUT ME (`consolidate.ts#aboutMe`: `self` kind, or a `person` memory naming the owner,
|
|
129
|
+
read off the identity core's name and aliases), honours the owner's demotions
|
|
130
|
+
(`store.coreDemoted`), and caps the night at `CORE_MAX_PER_SLEEP` (3), strongest first —
|
|
131
|
+
the rest are counted `promotion:cap` and wait for the next consolidation. The legacy
|
|
132
|
+
consolidation marking runs first, for legacy rows only; a post-upgrade row is counted
|
|
133
|
+
`not-legacy`. The first decay pass after the v8 upgrade runs a one-time census
|
|
134
|
+
(`upgrade.ts`): every live row's band and projected prune day, old arithmetic vs new, into
|
|
135
|
+
`physics.v8.census` and one durable `physics.upgrade.census` row. Arithmetic only: no
|
|
136
|
+
phase calls a model; dreaming, which does, is `dream/`'s and is asked for.
|
|
121
137
|
**Outputs** — a refreshed strength cache; dedup merges; consolidation links; prune verdicts
|
|
122
138
|
and their records; the next session's briefing, written last; a per-cycle summary vector
|
|
123
139
|
(content-by-reference).
|
|
@@ -260,3 +260,22 @@ Two smaller notes that ride along:
|
|
|
260
260
|
latched row, so the symmetry sample is untouched by it. The rolled-up total
|
|
261
261
|
remains the thing to build when latched volume is the problem; unlatched
|
|
262
262
|
volume no longer is.)*
|
|
263
|
+
|
|
264
|
+
## 10. The core's lanes read words the port does not promise — 2026-09-26
|
|
265
|
+
|
|
266
|
+
`aboutMe` and `ownerNames` read prose through the port's `read` (the identity core's
|
|
267
|
+
names; a person memory's words). Measured cheap — only `self` and `person` rows pay —
|
|
268
|
+
but it is the first time the consolidate phase reads a body. If "about me" ever needs
|
|
269
|
+
more than a name match (a person card for the owner, an embedding), that is a
|
|
270
|
+
`schemas/` question, and this phase should receive the verdict rather than compute it.
|
|
271
|
+
The owner's demotions arrive through the optional `coreDemoted`; a port without it
|
|
272
|
+
cannot be told "not this one".
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
## Demotion has no way back (2026-09-26, working default)
|
|
276
|
+
|
|
277
|
+
`counterparts core --demote` is permanent: `coreDemoted` reads the latest promoted/demoted
|
|
278
|
+
event, and nothing writes a "restored" one. The owner's call after the review of #251 is
|
|
279
|
+
to leave it so for now. If a way back is wanted, it is one more `core_events` action
|
|
280
|
+
(`restored`) that `coreDemoted` reads as clearing the demotion, plus a console flag. The
|
|
281
|
+
lanes would then decide as for any memory.
|