counterparts 0.3.11 → 0.3.13
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 +326 -0
- package/docs/QUICKSTART.md +5 -0
- package/docs/README.md +2 -2
- package/docs/module-map.md +3 -3
- package/package.json +1 -1
- package/src/adapters/claude-code/CONTRACT.md +36 -10
- package/src/adapters/claude-code/INTERFACE-GAPS.md +116 -16
- package/src/adapters/claude-code/NOTES.md +182 -0
- package/src/adapters/claude-code/bin/hook.ts +46 -12
- package/src/adapters/claude-code/bin/runner.ts +7 -1
- package/src/adapters/claude-code/doctor.ts +632 -18
- package/src/adapters/claude-code/hooks.ts +61 -16
- package/src/adapters/claude-code/index.ts +11 -0
- package/src/adapters/claude-code/night-run.ts +150 -14
- package/src/adapters/claude-code/transcript.ts +268 -1
- package/src/adapters/cli/CONTRACT.md +5 -0
- package/src/adapters/cli/INTERFACE-GAPS.md +8 -4
- package/src/adapters/cli/NOTES.md +111 -0
- package/src/adapters/cli/commands.ts +134 -92
- package/src/adapters/cli/dream-core.ts +57 -42
- package/src/adapters/cli/export.ts +320 -21
- package/src/adapters/cli/help.ts +2 -1
- package/src/adapters/cli/index.ts +1 -0
- package/src/adapters/cli/install.ts +39 -7
- package/src/adapters/cli/mechanisms.ts +7 -1
- package/src/adapters/cli/uninstall.ts +13 -5
- package/src/adapters/cli/wire.ts +189 -63
- package/src/adapters/config.ts +2 -0
- package/src/adapters/dashboard/INTERFACE-GAPS.md +10 -1
- package/src/adapters/dashboard/NOTES.md +79 -0
- package/src/adapters/dashboard/registries.ts +34 -2
- package/src/adapters/dashboard/web/README.md +19 -14
- package/src/adapters/dashboard/web/actions.ts +23 -1
- package/src/adapters/dashboard/web/flow.ts +14 -0
- package/src/adapters/dashboard/web/lanes.ts +10 -0
- package/src/adapters/dashboard/web/narrate.ts +88 -2
- package/src/adapters/dashboard/web/pages/flow/sections/fired.js +1 -0
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +2 -0
- package/src/adapters/dashboard/web/pages/health/sections/wake.js +3 -1
- package/src/adapters/dashboard/web/pages/memories/memories.css +17 -4
- package/src/adapters/dashboard/web/pages/memories/row.js +37 -21
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +279 -60
- package/src/adapters/dashboard/web/pages/memories/state.js +2 -1
- package/src/adapters/dashboard/web/server.ts +0 -5
- package/src/adapters/dashboard/web/shared/memory-marks.css +7 -0
- package/src/adapters/dashboard/web/shared/memory-marks.js +33 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +5 -3
- package/src/adapters/dashboard/web/views/health.ts +21 -3
- package/src/adapters/dashboard/web/views/search.ts +4 -45
- package/src/adapters/dashboard/web/views.ts +2 -2
- package/src/adapters/fired.ts +430 -28
- package/src/adapters/host-wiring.ts +300 -0
- package/src/adapters/hosts.ts +11 -0
- package/src/adapters/lifecycle.ts +42 -2
- package/src/adapters/log/index.ts +9 -0
- package/src/adapters/mcp/CONTRACT.md +151 -11
- package/src/adapters/mcp/INTERFACE-GAPS.md +24 -2
- package/src/adapters/mcp/NOTES.md +313 -1
- package/src/adapters/mcp/bin/serve.ts +74 -1
- package/src/adapters/mcp/deliberate.ts +169 -651
- package/src/adapters/mcp/facts.ts +1094 -0
- package/src/adapters/mcp/index.ts +25 -7
- package/src/adapters/mcp/meaning.ts +1610 -0
- package/src/adapters/mcp/server.ts +835 -150
- package/src/adapters/mcp/stdio.ts +3 -1
- package/src/adapters/mcp/stood-down.ts +51 -0
- package/src/adapters/mcp/tools.ts +167 -41
- package/src/adapters/plugin-run.sh +133 -0
- package/src/adapters/plugin.ts +329 -0
- package/src/adapters/sessions.ts +18 -4
- package/src/core/associate/CONTRACT.md +2 -1
- package/src/core/associate/INTERFACE-GAPS.md +6 -1
- package/src/core/associate/NOTES.md +45 -0
- package/src/core/briefing.ts +12 -3
- package/src/core/contradictions.ts +184 -0
- package/src/core/counterpart.ts +797 -51
- package/src/core/dream/CONTRACT.md +36 -4
- package/src/core/dream/INTERFACE-GAPS.md +29 -6
- package/src/core/dream/NOTES.md +107 -0
- package/src/core/dream/feeling-weeks.ts +198 -0
- package/src/core/dream/index.ts +109 -18
- package/src/core/dream/reflect.ts +346 -87
- package/src/core/dream/tunables.ts +24 -4
- package/src/core/encode/INTERFACE-GAPS.md +3 -1
- package/src/core/encode/NOTES.md +7 -0
- package/src/core/encode/words.ts +45 -0
- package/src/core/fit/INTERFACE-GAPS.md +8 -2
- package/src/core/fit/NOTES.md +39 -1
- package/src/core/fit/index.ts +40 -0
- package/src/core/handoff/CONTRACT.md +37 -2
- package/src/core/handoff/INTERFACE-GAPS.md +10 -0
- package/src/core/handoff/NOTES.md +72 -0
- package/src/core/handoff/index.ts +214 -12
- package/src/core/handoff/last-here.ts +6 -4
- package/src/core/mint.ts +12 -2
- package/src/core/physics/CONTRACT.md +14 -2
- package/src/core/physics/NOTES.md +33 -1
- package/src/core/physics/index.ts +28 -5
- package/src/core/prospective/CONTRACT.md +45 -6
- package/src/core/prospective/INTERFACE-GAPS.md +4 -0
- package/src/core/prospective/NOTES.md +138 -0
- package/src/core/prospective/derive.ts +33 -5
- package/src/core/prospective/index.ts +90 -5
- package/src/core/prospective/windows.ts +72 -1
- package/src/core/recall/CONTRACT.md +31 -12
- package/src/core/recall/INTERFACE-GAPS.md +28 -4
- package/src/core/recall/NOTES.md +70 -1
- package/src/core/recall/feeling-ask.ts +10 -1
- package/src/core/recall/index.ts +3 -1
- package/src/core/recall/probe.ts +58 -0
- package/src/core/recall/session.ts +46 -2
- package/src/core/recall/time-ask.ts +487 -0
- package/src/core/remember/CONTRACT.md +4 -1
- package/src/core/remember/INTERFACE-GAPS.md +9 -1
- package/src/core/remember/NOTES.md +8 -0
- package/src/core/remember/proposals.ts +47 -5
- package/src/core/revision.ts +18 -1
- package/src/core/schemas/CONTRACT.md +21 -1
- package/src/core/schemas/INTERFACE-GAPS.md +20 -2
- package/src/core/schemas/NOTES.md +144 -0
- package/src/core/schemas/aliases.ts +55 -5
- package/src/core/schemas/index.ts +93 -1
- package/src/core/schemas/types.ts +2 -0
- package/src/core/self/CONTRACT.md +32 -5
- package/src/core/self/INTERFACE-GAPS.md +7 -2
- package/src/core/self/NOTES.md +102 -1
- package/src/core/self/behind.ts +43 -3
- package/src/core/self/briefing.ts +12 -2
- package/src/core/self/chapter-address.ts +254 -0
- package/src/core/self/episodes.ts +27 -0
- package/src/core/self/index.ts +83 -8
- package/src/core/self/page.ts +88 -0
- package/src/core/self/tunables.ts +5 -0
- package/src/core/self/work.ts +35 -2
- package/src/core/self/writer.ts +30 -0
- package/src/core/sleep/INTERFACE-GAPS.md +22 -3
- package/src/core/sleep/NOTES.md +20 -1
- package/src/core/sleep/consolidate.ts +59 -7
- package/src/core/sleep/index.ts +3 -0
- package/src/core/sleep/prune.ts +6 -2
- package/src/core/sleep/types.ts +7 -0
- package/src/core/store/CONTRACT.md +16 -0
- package/src/core/store/NOTES.md +66 -0
- package/src/core/store/feelings.ts +14 -1
- package/src/core/store/index.ts +483 -16
- package/src/core/store/operational.ts +95 -2
- package/src/core/store/owner-op-seam.ts +23 -0
- package/src/core/time.ts +152 -0
- package/tools/install-loop/run.sh +48 -12
- package/src/adapters/dashboard/web/pages/memories/fold.js +0 -53
package/src/core/revision.ts
CHANGED
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
* `how` and stays a link: a retelling of a transcript does not settle what
|
|
48
48
|
* the experiencer did not.
|
|
49
49
|
*
|
|
50
|
+
* **An authored `changed` or `corrected` arrives here already read**
|
|
51
|
+
* (2026-10-09): `Counterpart#guardUpdate` checks the pair before the mint,
|
|
52
|
+
* and one that looks unrelated is minted with no `updates` at all, so this
|
|
53
|
+
* seam is never called for it (`contradictions.ts#updateRelatedness`).
|
|
54
|
+
*
|
|
50
55
|
* "One declaration adds pressure; the element is superseded only when the bar is
|
|
51
56
|
* crossed; the old version is retained with lineage" (constitution 7) — that is
|
|
52
57
|
* the slow half. A current-state row is the fast half by construction: a "now"
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
* an observer's chunk produces neither, and this function stands down on its own
|
|
85
90
|
* besides.
|
|
86
91
|
*/
|
|
87
|
-
import { hashText } from "./store/index.js";
|
|
92
|
+
import { hashText, occurredOnOf, saidByOf, statusOf } from "./store/index.js";
|
|
88
93
|
import type { MemoryRow, Store } from "./store/index.js";
|
|
89
94
|
import { applyChallenge, successorSeed, supersedeRecord } from "./physics/index.js";
|
|
90
95
|
import { directionOf } from "./mint.js";
|
|
@@ -439,12 +444,24 @@ function identityChallenge(
|
|
|
439
444
|
let successorId: string | null = null;
|
|
440
445
|
if (outcome.verdict === "revise") {
|
|
441
446
|
const statement = (input.statement ?? store.readProse(input.challengerId).body).trim();
|
|
447
|
+
// v12: the successor's words are the CHALLENGER's statement, so its three
|
|
448
|
+
// fields are the challenger's too (which already carry over what its
|
|
449
|
+
// writer left out of the target's, `Counterpart#carryFacts`). Without them
|
|
450
|
+
// the supersede's carry would stamp the target's — the old fact's date,
|
|
451
|
+
// speaker and kind — onto the new fact's words.
|
|
452
|
+
const said = store.row(input.challengerId);
|
|
453
|
+
const occurredOn = occurredOnOf(said?.occurred_on ?? null);
|
|
454
|
+
const saidBy = saidByOf(said?.said_by ?? null);
|
|
455
|
+
const status = statusOf(said?.status ?? null);
|
|
442
456
|
successorId = store.supersede(
|
|
443
457
|
targetId,
|
|
444
458
|
{
|
|
445
459
|
type: "memory",
|
|
446
460
|
kind: row.kind,
|
|
447
461
|
body: statement,
|
|
462
|
+
...(occurredOn === null ? {} : { occurredOn }),
|
|
463
|
+
...(saidBy === null ? {} : { saidBy }),
|
|
464
|
+
...(status === null ? {} : { status }),
|
|
448
465
|
meta: { revisedFrom: targetId, groundedIn: [input.challengerId] },
|
|
449
466
|
// Identity is entered by INHERITING it through a declared revision or by
|
|
450
467
|
// the counted promotion crossing, and never otherwise (physics §5.3).
|
|
@@ -106,7 +106,19 @@ name/alias resolution; birth and death telemetry.
|
|
|
106
106
|
SETTLED when an author declared it (2026-09-29, `src/core/contradictions.ts`): `how` is
|
|
107
107
|
`changed` (the default — one strength cut, labelled earlier), `corrected` (archived:
|
|
108
108
|
out of recall, readable by its id) or `open` (both kept); a SWEPT declaration carries no
|
|
109
|
-
`how` and stays a link.
|
|
109
|
+
`how` and stays a link. **Before any of it, an authored `changed` or `corrected` declared
|
|
110
|
+
by id is read against the memory it names** (2026-10-09, the update guard,
|
|
111
|
+
`Counterpart#guardUpdate` → `contradictions.ts#updateRelatedness`): by meaning through the
|
|
112
|
+
embedder (cosine under `UPDATE_COSINE`, 0.30 CAL, looks unrelated), by shared content words
|
|
113
|
+
when there is no embedder. A pair that looks unrelated is HELD — the new memory lands with
|
|
114
|
+
no `updates`, so nothing is linked, carried, closed, settled or pressed; the writer is
|
|
115
|
+
shown the old memory's title and text and asked to settle it itself (`note` settle) if it
|
|
116
|
+
meant to; a `contradiction.held` row records it; no pair is written. A CLOSE OR A REDATE
|
|
117
|
+
goes straight through: the memory named is an open thread, or the write sends a reminder
|
|
118
|
+
field (`eventDate`, a date or null, or `remind`) and it holds a date, or the write sends a
|
|
119
|
+
`status` and it has a different one. `open`, a content match the engine made itself and a
|
|
120
|
+
swept declaration are not read. A batch writer (a write-up, the nightly catch-up) has
|
|
121
|
+
nobody to read the reply, so its hold stays a hold. A **protected** element refuses every one of those paths. Authored
|
|
110
122
|
declarations count for more than swept ones through the PHYSICS alone — a fallback
|
|
111
123
|
challenger's claim was already cut at the minting seam — and no second weighting
|
|
112
124
|
exists here. A CONFIRMATION (the engine matched a restatement rather than an author
|
|
@@ -166,6 +178,14 @@ name/alias resolution; birth and death telemetry.
|
|
|
166
178
|
13. **[M] Every kind reports created-versus-exited counts.** A kind whose exit count is
|
|
167
179
|
zero after the bake-in window is a **defect to investigate, not a base rate to accept**
|
|
168
180
|
(scar §2.17).
|
|
181
|
+
14. **[M] A memory's subjects are the live cards its words name** (v12, 2026-10-03; working
|
|
182
|
+
default). `subjectsIn` reads them by `creditNamedIn`'s rules — the one whole-word rule
|
|
183
|
+
with a trailing possessive read as the name ("Han's" names Han; `words.ts#nameRegex`,
|
|
184
|
+
2026-10-03), `NAME_MIN_CHARS`, exactly one live holder — and the store links them at every memory
|
|
185
|
+
write through the finder `Counterpart` installs. A card's birth (a revival too) links
|
|
186
|
+
the memories already naming it. The backfill's reading goes through
|
|
187
|
+
`AliasIndex#scanner`, which gives exactly `matchesIn`'s hits (a test holds them equal).
|
|
188
|
+
`addAliases` does not look back.
|
|
169
189
|
|
|
170
190
|
## 6. Scars honored
|
|
171
191
|
|
|
@@ -27,7 +27,13 @@ Three symbols are imported from `encode/`, all leaf files, no cycle:
|
|
|
27
27
|
never become an entity the store indexes. Birth refuses the name outright
|
|
28
28
|
(`name-is-secret`), because unlike an alias, a name has no drop-and-continue.
|
|
29
29
|
|
|
30
|
-
## 1. `store/` has no durable event log — the revision story is session-scoped
|
|
30
|
+
## 1. `store/` has no durable event log — the revision story is session-scoped — CLOSED 2026-08-25 (noted 2026-10-09)
|
|
31
|
+
|
|
32
|
+
**Closed by the wave-3 seam pass** (`d88f957`, SEAMS item K): box 2 has an `events` table
|
|
33
|
+
with its own retention sweep, every pressure increment is appended as a
|
|
34
|
+
`revision.pressure` row with a dedup key, and `story()` reads them back through
|
|
35
|
+
`Store#eventLog` before this session's own ring, so a restart keeps the story. The text
|
|
36
|
+
below is the gap as filed.
|
|
31
37
|
|
|
32
38
|
**Owner:** `store/` (box 2), with `dashboard/` as the consumer.
|
|
33
39
|
**Needed:** contract §5 says every pressure increment is logged and the
|
|
@@ -63,7 +69,7 @@ moment two adapters open the store concurrently it is stale-cache territory.
|
|
|
63
69
|
on write, or first-class `schema_element` columns. A `Store.listByMeta(key,
|
|
64
70
|
value)` is the smallest useful shape.
|
|
65
71
|
|
|
66
|
-
## 3. `recall/` should take its alias map from here — SEAMS §6 wiring
|
|
72
|
+
## 3. `recall/` should take its alias map from here — SEAMS §6 wiring — CLOSED 2026-08-25 (noted 2026-10-09)
|
|
67
73
|
|
|
68
74
|
**Owner:** the coordinator. **Do not edit `recall/`.**
|
|
69
75
|
`recall/INTERFACE-GAPS.md` §2 records that `Turn.aliases?: ReadonlyMap<string,
|
|
@@ -86,6 +92,12 @@ because the shared whole-word matcher is case-insensitive without an option;
|
|
|
86
92
|
**The gap stays open until a test in the composed pipeline proves the map is
|
|
87
93
|
actually passed** — the safety half is unreachable from inside either module.
|
|
88
94
|
|
|
95
|
+
**CLOSED 2026-08-25 (noted 2026-10-09)** by the wave-3 seam pass (`d88f957`):
|
|
96
|
+
`core/retrieval.ts#composeTurn` sets `aliases` from `schemas.aliasMap()`, and
|
|
97
|
+
`test/seams.test.ts` proves it in the composed pipeline ("composed, an ambiguous handle
|
|
98
|
+
sets trains:false and resolveUse REFUSES the credit", and the same turn without the
|
|
99
|
+
wiring trains).
|
|
100
|
+
|
|
89
101
|
## 4. `encode/`'s `SchemaSlice` has no elision count
|
|
90
102
|
|
|
91
103
|
**Owner:** `encode/`.
|
|
@@ -101,6 +113,12 @@ by `renderSchemaContext` the way it already announces the identity-core
|
|
|
101
113
|
truncation. Until then the field is carried and ignored, which is honest but not
|
|
102
114
|
enforced anywhere.
|
|
103
115
|
|
|
116
|
+
*(Noted 2026-10-09: a slice does elide now. Since 2026-08-29 (`e5e6cea`, #6)
|
|
117
|
+
`slices({ excludeProtected: true })` drops protected elements and counts them in
|
|
118
|
+
`elided`, and the composition root emits `counterpart.sweep.cards.elided` with the sum.
|
|
119
|
+
`SchemaSlice` still has no `elided` field and the prompt does not announce it, so the
|
|
120
|
+
real fix above is still open.)*
|
|
121
|
+
|
|
104
122
|
## 5. `self/` must mint the identity core in this module's shape
|
|
105
123
|
|
|
106
124
|
**Owner:** `self/`.
|
|
@@ -390,3 +390,147 @@ one of them is reported as not applied rather than bent to fit. A swept declarat
|
|
|
390
390
|
(`applySweep`) sends no `how`: a retelling of a transcript does not settle what the
|
|
391
391
|
experiencer did not, so it stays a link. A journal chapter (`type` episode) stays a link
|
|
392
392
|
too: it is not a claim.
|
|
393
|
+
|
|
394
|
+
## 2026-10-03 — subjects: what a memory names (schema v12)
|
|
395
|
+
|
|
396
|
+
- **`subjectsIn(text)`** is the finder the store links with at every memory write
|
|
397
|
+
(`Store#findSubjectsWith`, installed by `Counterpart`): the live cards a text names, by
|
|
398
|
+
`creditNamedIn`'s rules — the one whole-word rule, `NAME_MIN_CHARS`, exactly one live
|
|
399
|
+
holder (a handle two cards hold links neither). A faded card is not a subject: a mention
|
|
400
|
+
revives it through `creditNamedIn`, and the rebirth looks back.
|
|
401
|
+
- **A birth looks back** (`linkNamingMemories`, from `birth`, so a revival too): the
|
|
402
|
+
memories already written that name the new card are linked `via: birth`. One read of the
|
|
403
|
+
memories' words and one regex per term; fail-open. `addAliases` does not look back for
|
|
404
|
+
the memories naming a new alias — the brief asked for creation; an alias added later
|
|
405
|
+
links the memories written after it, and a re-run of the backfill would catch the rest.
|
|
406
|
+
- **The backfill's reading** (`subjectLinksForAll`) goes through `AliasIndex#scanner`, the
|
|
407
|
+
same hits as `matchesIn` with a word-token prefilter (`encode/words.ts#wordTokens`, the
|
|
408
|
+
matcher's own word class) and every candidate confirmed by the one rule — so the
|
|
409
|
+
prefilter can skip work without changing an answer (`test/recall-write-side.test.ts`).
|
|
410
|
+
|
|
411
|
+
## 2026-10-09 — the update guard: a `changed` or `corrected` is read before it moves anything
|
|
412
|
+
|
|
413
|
+
**Why.** §16's arm settles on the writer's word. A 10-02 benchmark read (counterparts-87,
|
|
414
|
+
LongMemEval, a Haiku 4.5 writer) found the `updates` pointing at an unrelated memory in
|
|
415
|
+
about two thirds of 149 sampled pairs — one memory about a mole removal retired a passport
|
|
416
|
+
name change. On the owner's store (Opus) all 10 checked were right. The risk is the weaker
|
|
417
|
+
host model, and the bad moment. The bench harness had dropped such links on its own side
|
|
418
|
+
(`plausiblyRelated`, `tools/longmemeval/store.ts` on `bench/longmemeval`); it drops that
|
|
419
|
+
once this lands.
|
|
420
|
+
|
|
421
|
+
**What.** Contract §5 1b states the rule. `Counterpart#guardUpdate` runs between intake
|
|
422
|
+
and mint, so a hold is a proposal with no `updates`: no `meta.updates` link, no reminder
|
|
423
|
+
carried or moved, no facts inherited, no thread closed, no settle, no pressure, and an
|
|
424
|
+
unrelated pair is never shown as a disagreement. The writer gets the old memory's words
|
|
425
|
+
and the neighbours' ask (`HELD_HINT`); `settle` with `holds`/`over` needs no new code. The
|
|
426
|
+
record is a durable `contradiction.held` row (ids and numbers, no text) and its reader
|
|
427
|
+
`heldCorrections`, which no line calls yet (mcp INTERFACE-GAPS §12).
|
|
428
|
+
|
|
429
|
+
**The calibration** (scratch script, not committed; potion-base-8M, the full index text
|
|
430
|
+
of each memory, cosine). 120 labelled pairs: 31 related and 29 unrelated from the demo
|
|
431
|
+
store's script (the challenges against their beliefs, the current-state correction, later
|
|
432
|
+
notes that change earlier ones on the same subject; unrelated = two notes on different
|
|
433
|
+
subjects, in one tight domain where "rota", "ward" and "shift" are everywhere), and 30 and
|
|
434
|
+
30 hand-written life and work facts (related ones worded differently on purpose — "lives
|
|
435
|
+
in Austin" / "Colorado is home now", "Postgres on RDS" / "migrated the main DB to
|
|
436
|
+
Aurora"; unrelated ones like the mole and the passport). Counts are related passed /
|
|
437
|
+
related held | unrelated passed / unrelated held:
|
|
438
|
+
|
|
439
|
+
| rule | related | unrelated |
|
|
440
|
+
|---|---|---|
|
|
441
|
+
| shared content word (the bench rule) | 46 / 15 | 12 / 47 |
|
|
442
|
+
| meaning ≥ 0.30 (**chosen**) | 50 / 11 | 1 / 58 |
|
|
443
|
+
| meaning ≥ 0.35 | 44 / 17 | 1 / 58 |
|
|
444
|
+
| meaning ≥ 0.40 | 38 / 23 | 0 / 59 |
|
|
445
|
+
| word AND meaning ≥ 0.30 (the brief's "both pass") | 41 / 20 | 1 / 58 |
|
|
446
|
+
| word OR meaning ≥ 0.40 | 50 / 11 | 12 / 47 |
|
|
447
|
+
|
|
448
|
+
The unrelated pairs topped out at 0.29 but one: two demo notes about reading (a solver's
|
|
449
|
+
constraint list, a printed rota) at 0.37, arguably related. Meaning alone holds the fewest
|
|
450
|
+
related pairs at the same one false pass; the words, as a second requirement, only add
|
|
451
|
+
held corrections, and as a second way in they let through every pair that shares a
|
|
452
|
+
common word ("back", "because", "staff"). So meaning decides when there are two vectors
|
|
453
|
+
and the words only when there are not. That is a departure from the brief's "both clearly
|
|
454
|
+
pass", named and held lightly.
|
|
455
|
+
|
|
456
|
+
**Limits seen.** Mean-pooled static vectors dilute: "Mike moved to Denver." / "Mike lives
|
|
457
|
+
in Colorado now." reads 0.68, but "Mike lives in Austin, Texas, in a rented house near
|
|
458
|
+
Zilker Park." / "Moved to Denver last month; Colorado is home now." reads 0.23 and is held.
|
|
459
|
+
Short texts lean on their function words: "The user changed her name on her passport." /
|
|
460
|
+
"The user had a mole removed." reads 0.28 — under the bar, not by much. Renames of a
|
|
461
|
+
technology (React → Svelte 0.17, GitHub Actions → Buildkite 0.27) read as unrelated. A
|
|
462
|
+
writer that is reading its replies settles those itself; a batch writer leaves them held,
|
|
463
|
+
both memories live, which costs a stale memory staying at full strength, never a wrong one
|
|
464
|
+
archived.
|
|
465
|
+
|
|
466
|
+
**Where it does not apply.** `open` (moves nothing). A content match (`content`,
|
|
467
|
+
`content+hint`): the engine's own reading, already held to a score floor. A sweep (no
|
|
468
|
+
`how`). And a close or a redate: an open thread (both documented roads close one, and an
|
|
469
|
+
answer rarely shares its question's words — "which cache?" / "Redis" reads −0.08), a
|
|
470
|
+
reminder field at a memory holding a date, a status unlike the one it had. A field the
|
|
471
|
+
memory has nothing for — `eventDate` on an undated memory, `status` where it had none —
|
|
472
|
+
dates or describes the new memory, so the pair is read. The cost of the open-thread rule:
|
|
473
|
+
a wrong id that happens to name an open thread closes it, `corrected` included — the
|
|
474
|
+
wake's "Still open" lane hands those ids out, so a writer pointing there is usually
|
|
475
|
+
pointing on purpose, and an unanswered thread held open by the guard would be the quieter
|
|
476
|
+
failure (the coordinator's call, 10-09).
|
|
477
|
+
|
|
478
|
+
### Review of #340 (2026-10-09): the false holds, the batch writers, and three ways to hold fewer
|
|
479
|
+
|
|
480
|
+
**Which writers are batch.** The nightly catch-up's child may call `session_end` and
|
|
481
|
+
nothing else (`night-catch-up.ts#CATCH_UP_TOOLS`): it cannot recall, so the only memory
|
|
482
|
+
ids it ever sees are the neighbours its own `session_end` replies list, and it cannot
|
|
483
|
+
`note` a settle even when it reads a hold. So on the owner's store few of its corrections
|
|
484
|
+
are declared by id at all, and those that are point at a neighbour, close to something it
|
|
485
|
+
just wrote. The SessionStart write-up and a live session's `session_end` are written by a
|
|
486
|
+
session that has `recall` and `note` and reads its replies. The benchmark writer calls
|
|
487
|
+
`submitSessionEnd` directly and today drops unrelated links on its own side, by the
|
|
488
|
+
shared-word rule. `writeUp` in the deposit context is not a batch signal: the SessionStart
|
|
489
|
+
write-up sends it too. The only crisp night signal is the runner's `writeup-` session
|
|
490
|
+
prefix, an adapter fact.
|
|
491
|
+
|
|
492
|
+
**The three ways to hold fewer, measured** (the builder's 120 pairs with real subject
|
|
493
|
+
cards: the demo store seeded into a temp dir, and a card for each person, pet, place,
|
|
494
|
+
project and product the hand set names; plus 20 pairs written for this review BEFORE
|
|
495
|
+
scoring, in the owner's style: ten corrections — a PR merged, a default turned on, a
|
|
496
|
+
decision dropped, a release changing hands, a role changing, a vendor replaced — and ten
|
|
497
|
+
wrong pointers between memories of the same project). Related held | unrelated passed:
|
|
498
|
+
|
|
499
|
+
| rule | 120 labelled | owner-style 20 |
|
|
500
|
+
|---|---|---|
|
|
501
|
+
| meaning ≥ 0.30 (the PR) | 11/61 (18%) · 1/59 (2%) | 0/10 · 0/10 |
|
|
502
|
+
| meaning OR a shared subject card | 11/61 · 1/59 | 0/10 · 1/10 |
|
|
503
|
+
| meaning OR a shared content word | 6/61 (10%) · 12/59 (20%) | 0/10 · 1/10 |
|
|
504
|
+
| a shared content word alone (the bench harness today) | 15/61 (25%) · 12/59 | 1/10 · 1/10 |
|
|
505
|
+
|
|
506
|
+
- **A shared subject card rescues none of the eleven.** Thirteen related demo pairs name a
|
|
507
|
+
card in common, and every one already clears 0.30: a rare name weighs heavily in a
|
|
508
|
+
static vector, so a pair that shares one is close in meaning anyway. The held eleven are
|
|
509
|
+
substitutions (React to Svelte, Postgres to Aurora, Austin to Denver), which name no card
|
|
510
|
+
in common. What the pass adds is a way through for two memories that name a hub card
|
|
511
|
+
("Counterparts", 0.27). And on the benchmark stores, 9 cards in 498 stores: idle where
|
|
512
|
+
the weak writer is. Not built.
|
|
513
|
+
- **Guarding only `corrected` lets the default through.** `changed` is what a write gets
|
|
514
|
+
when it sends no `how`, and facts mode folds a `changed`-settled memory under the new
|
|
515
|
+
one as its earlier version (`mcp/facts.ts`), so a wrong `changed` is a wrong answer,
|
|
516
|
+
not a harmless fade. Not built.
|
|
517
|
+
- **Meaning OR words for batch writers** (the coordinator's proposal) halves the false
|
|
518
|
+
holds and lets a fifth of the wrong pointers through ("third", "doctor", "staff",
|
|
519
|
+
"because"). For a writer wrong two times in three (the 10-02 Haiku read), wrong outcomes
|
|
520
|
+
per declared update are about 0.07 under meaning alone and 0.17 under OR; for a writer
|
|
521
|
+
almost always right, 0.17 and 0.10. OR is the better rule only for a strong batch
|
|
522
|
+
writer, and core knows neither which writer is batch nor how strong it is. Not built;
|
|
523
|
+
an owner question on the PR.
|
|
524
|
+
|
|
525
|
+
**Overfit?** The bar sits at the top edge of the unrelated pairs (the highest held one
|
|
526
|
+
reads 0.293), and five related pairs sit within 0.04 above it, so a fresh set will move
|
|
527
|
+
both counts. The owner-style twenty were not tuned to it: all ten corrections passed
|
|
528
|
+
(lowest 0.324, a contractor replaced) and all ten wrong pointers were held (highest
|
|
529
|
+
0.271). The hand-written related pairs were worded to share no word on purpose, so 18% is
|
|
530
|
+
likely the pessimistic end for the owner's own corrections. `heldCorrections`'
|
|
531
|
+
`settledAfter / held` is the number that will say.
|
|
532
|
+
|
|
533
|
+
**Terse closes.** A thread closes on the real table with a "done" the guard would
|
|
534
|
+
otherwise hold, through `note` and through `session_end`
|
|
535
|
+
(`test/update-guard.test.ts`). The tersest a write can be is the content floor's (20
|
|
536
|
+
characters, 3 words): "Done." alone is refused before the guard, as it was before it.
|
|
@@ -10,12 +10,17 @@
|
|
|
10
10
|
* measured 21% false-positive rate on the self schema. A copy of that rule here
|
|
11
11
|
* would drift from it in exactly one release.
|
|
12
12
|
*
|
|
13
|
+
* What a text NAMES (`matchesIn`, `scanner`) reads the rule through
|
|
14
|
+
* `nameRegex` (2026-10-03, review of #322): the same rule, with a trailing
|
|
15
|
+
* possessive read as the name, so "Han's birthday" names Han. Birth's
|
|
16
|
+
* name-in-source test keeps the strict rule.
|
|
17
|
+
*
|
|
13
18
|
* Aliases are first-class and change only through explicit alias operations,
|
|
14
19
|
* never as a side effect of editing prose (§4.2 G4) — which is why this index
|
|
15
20
|
* has `register` / `unregister` and no "sync from body text" path.
|
|
16
21
|
*/
|
|
17
22
|
|
|
18
|
-
import {
|
|
23
|
+
import { nameRegex, occursAsName, unpossessed, wordTokens } from "../encode/words.js";
|
|
19
24
|
|
|
20
25
|
export interface AliasHit {
|
|
21
26
|
id: string;
|
|
@@ -103,15 +108,16 @@ export class AliasIndex {
|
|
|
103
108
|
|
|
104
109
|
/**
|
|
105
110
|
* Every registered term occurring in `text` AS A WHOLE WORD, by the one shared
|
|
106
|
-
* definition
|
|
107
|
-
*
|
|
111
|
+
* definition — a trailing possessive ("Han's", "James'") read as the name
|
|
112
|
+
* (`encode/words.ts#nameRegex`). Subject links and the crediting of a card a
|
|
113
|
+
* memory names both read this.
|
|
108
114
|
*/
|
|
109
115
|
matchesIn(text: string): AliasHit[] {
|
|
110
116
|
const hits: AliasHit[] = [];
|
|
111
117
|
for (const [id, reg] of this.byId) {
|
|
112
|
-
if (
|
|
118
|
+
if (occursAsName(text, reg.name)) hits.push({ id, term: reg.name, source: "name" });
|
|
113
119
|
for (const alias of reg.aliases) {
|
|
114
|
-
if (
|
|
120
|
+
if (occursAsName(text, alias)) hits.push({ id, term: alias, source: "alias" });
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
return hits.sort((a, b) => a.id.localeCompare(b.id) || a.term.localeCompare(b.term));
|
|
@@ -120,6 +126,50 @@ export class AliasIndex {
|
|
|
120
126
|
size(): number {
|
|
121
127
|
return this.byId.size;
|
|
122
128
|
}
|
|
129
|
+
|
|
130
|
+
/** Every registered card and its terms, by id (v12: the backfill's term table). */
|
|
131
|
+
entries(): { id: string; name: string; aliases: string[] }[] {
|
|
132
|
+
return [...this.byId.entries()].map(([id, r]) => ({ id, name: r.name, aliases: [...r.aliases] }));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* `matchesIn` FOR MANY TEXTS (v12, 2026-10-03): the same hits, by the same
|
|
137
|
+
* rule, without testing every term against every text. Built once over the
|
|
138
|
+
* index as it stands; each text is cut into its whole words
|
|
139
|
+
* (`encode/words.ts#wordTokens`), only the terms whose first word is among
|
|
140
|
+
* them are tried, and every one tried is CONFIRMED by the one whole-word
|
|
141
|
+
* rule — so the scanner can skip work, never add a hit or lose one
|
|
142
|
+
* (`test/subjects.test.ts` holds it equal to `matchesIn`). A term with no
|
|
143
|
+
* word characters at all is tried against every text. For the v12 backfill
|
|
144
|
+
* and anything else that reads the whole store at once.
|
|
145
|
+
*/
|
|
146
|
+
scanner(): (text: string) => AliasHit[] {
|
|
147
|
+
const byFirst = new Map<string, { id: string; term: string; source: "name" | "alias"; re: RegExp }[]>();
|
|
148
|
+
const always: { id: string; term: string; source: "name" | "alias"; re: RegExp }[] = [];
|
|
149
|
+
for (const [id, reg] of this.byId) {
|
|
150
|
+
const terms: [string, "name" | "alias"][] = [[reg.name, "name"], ...reg.aliases.map((a): [string, "alias"] => [a, "alias"])];
|
|
151
|
+
for (const [term, source] of terms) {
|
|
152
|
+
if (term.trim().length === 0) continue;
|
|
153
|
+
const entry = { id, term, source, re: nameRegex(term) };
|
|
154
|
+
const first = wordTokens(term)[0];
|
|
155
|
+
if (first === undefined) always.push(entry);
|
|
156
|
+
else {
|
|
157
|
+
const list = byFirst.get(first) ?? [];
|
|
158
|
+
list.push(entry);
|
|
159
|
+
byFirst.set(first, list);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return (text: string): AliasHit[] => {
|
|
164
|
+
const tried = new Set<(typeof always)[number]>(always);
|
|
165
|
+
// A possessive's token ("han's") tries the name it ends ("han") too.
|
|
166
|
+
const tokens = new Set(wordTokens(text).flatMap((t) => [t, unpossessed(t)]));
|
|
167
|
+
for (const token of tokens) for (const e of byFirst.get(token) ?? []) tried.add(e);
|
|
168
|
+
const hits: AliasHit[] = [];
|
|
169
|
+
for (const e of tried) if (e.re.test(text)) hits.push({ id: e.id, term: e.term, source: e.source });
|
|
170
|
+
return hits.sort((a, b) => a.id.localeCompare(b.id) || a.term.localeCompare(b.term));
|
|
171
|
+
};
|
|
172
|
+
}
|
|
123
173
|
}
|
|
124
174
|
|
|
125
175
|
// ---------------------------------------------------------------------------
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import type { MemoryPhysics } from "../physics/index.js";
|
|
48
48
|
import { gateAliases } from "../encode/aliases.js";
|
|
49
49
|
import { containsSecret, redactSecrets } from "../encode/secrets.js";
|
|
50
|
-
import { occursAsWholeWord } from "../encode/words.js";
|
|
50
|
+
import { nameRegex, occursAsWholeWord } from "../encode/words.js";
|
|
51
51
|
import { Store, hashText } from "../store/index.js";
|
|
52
52
|
// The WALKING read — not a `Store` method on purpose (`store/walk-seam.ts`): it
|
|
53
53
|
// skips the archived-read telemetry AND the deny-list, and this module is one of
|
|
@@ -132,6 +132,10 @@ export const PUBLIC_SURFACE = [
|
|
|
132
132
|
"story",
|
|
133
133
|
"lifecycle",
|
|
134
134
|
"events",
|
|
135
|
+
// v12 (2026-10-03): what a memory names — the store's finder, and the
|
|
136
|
+
// backfill's reading (both reads; the links are the store's to write).
|
|
137
|
+
"subjectsIn",
|
|
138
|
+
"subjectLinksForAll",
|
|
135
139
|
] as const;
|
|
136
140
|
|
|
137
141
|
const EVENT_RING = 500;
|
|
@@ -605,6 +609,9 @@ export class Schemas {
|
|
|
605
609
|
this.remember(id, { role: "entity", name, aliases: kept });
|
|
606
610
|
this.index.register(id, name, kept);
|
|
607
611
|
this.birthsPerChunk.set(input.chunkRef, (this.birthsPerChunk.get(input.chunkRef) ?? 0) + 1);
|
|
612
|
+
// v12: A NEW CARD LOOKS BACK — the memories already written that name it
|
|
613
|
+
// are linked to it now, as a memory written after it would be at its write.
|
|
614
|
+
this.linkNamingMemories(id);
|
|
608
615
|
const priorlyFaded = this.fadedNamed(name, id);
|
|
609
616
|
if (priorlyFaded !== undefined) {
|
|
610
617
|
this.emit("schema.birth.after-fade", id, { nameHash, priorId: priorlyFaded, day: input.day });
|
|
@@ -1558,6 +1565,91 @@ export class Schemas {
|
|
|
1558
1565
|
});
|
|
1559
1566
|
}
|
|
1560
1567
|
|
|
1568
|
+
// ── what a memory names (v12, 2026-10-03) ─────────────────────────────────
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* THE LIVE CARDS A TEXT NAMES — a memory's SUBJECTS — by `creditNamedIn`'s
|
|
1572
|
+
* rules: a registered name or alias occurring as a whole word, at least
|
|
1573
|
+
* `NAME_MIN_CHARS` long, held by exactly one live card (a handle two cards
|
|
1574
|
+
* hold names neither). A faded card is not a subject here: a mention
|
|
1575
|
+
* brings one back through `creditNamedIn`, and its rebirth links what
|
|
1576
|
+
* names it (`linkNamingMemories`). Sorted ids. The store calls this at every
|
|
1577
|
+
* memory write (`Store#findSubjectsWith`, installed by `Counterpart`).
|
|
1578
|
+
*/
|
|
1579
|
+
subjectsIn(text: string): string[] {
|
|
1580
|
+
if (text.trim().length === 0) return [];
|
|
1581
|
+
return this.subjectsFromHits(this.index.matchesIn(text));
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
private subjectsFromHits(hits: readonly { term: string }[]): string[] {
|
|
1585
|
+
const out = new Set<string>();
|
|
1586
|
+
const seen = new Map<string, string | null>();
|
|
1587
|
+
for (const hit of hits) {
|
|
1588
|
+
const key = handleKey(hit.term);
|
|
1589
|
+
if (key.length < TUNABLES.NAME_MIN_CHARS) continue;
|
|
1590
|
+
let holder = seen.get(key);
|
|
1591
|
+
if (holder === undefined) {
|
|
1592
|
+
const live = this.liveHolders(hit.term);
|
|
1593
|
+
holder = live.length === 1 ? (live[0] as string) : null;
|
|
1594
|
+
seen.set(key, holder);
|
|
1595
|
+
}
|
|
1596
|
+
if (holder !== null) out.add(holder);
|
|
1597
|
+
}
|
|
1598
|
+
return [...out].sort();
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* A card's birth looks back (v12): every memory already written whose title
|
|
1603
|
+
* or body names it — by its own unambiguous terms — is linked to it, `via:
|
|
1604
|
+
* birth`. One read of the memories' words and one regex per term. Fail-open:
|
|
1605
|
+
* the card is born whatever this does, and an event says so when it fails.
|
|
1606
|
+
*/
|
|
1607
|
+
private linkNamingMemories(cardId: string): number {
|
|
1608
|
+
try {
|
|
1609
|
+
const terms = this.index.termsFor(cardId);
|
|
1610
|
+
if (terms === undefined) return 0;
|
|
1611
|
+
const res = [terms.name, ...terms.aliases]
|
|
1612
|
+
.filter((t) => handleKey(t).length >= TUNABLES.NAME_MIN_CHARS)
|
|
1613
|
+
.filter((t) => {
|
|
1614
|
+
const live = this.liveHolders(t);
|
|
1615
|
+
return live.length === 1 && live[0] === cardId;
|
|
1616
|
+
})
|
|
1617
|
+
.map((t) => nameRegex(t));
|
|
1618
|
+
if (res.length === 0) return 0;
|
|
1619
|
+
const links: { memoryId: string; subjectId: string }[] = [];
|
|
1620
|
+
for (const m of this.store.memoryTexts()) {
|
|
1621
|
+
const text = m.title === null || m.title.length === 0 ? m.body : `${m.title}\n${m.body}`;
|
|
1622
|
+
if (res.some((re) => re.test(text))) links.push({ memoryId: m.id, subjectId: cardId });
|
|
1623
|
+
}
|
|
1624
|
+
const added = links.length === 0 ? 0 : this.store.linkSubjects(links, "birth");
|
|
1625
|
+
if (added > 0) this.emit("schema.subjects.linked", cardId, { via: "birth", links: added });
|
|
1626
|
+
return added;
|
|
1627
|
+
} catch (err) {
|
|
1628
|
+
this.emit("schema.subjects.failed", cardId, { via: "birth", reason: String((err as { code?: string }).code ?? "UNKNOWN") });
|
|
1629
|
+
return 0;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* THE v12 BACKFILL'S READING: every memory with words, against every live
|
|
1635
|
+
* card, by `subjectsIn`'s rules — through the index's `scanner`, which
|
|
1636
|
+
* gives `matchesIn`'s hits without trying every term on every text. Returns
|
|
1637
|
+
* the links to write; writes nothing (`Counterpart` writes them, once).
|
|
1638
|
+
*/
|
|
1639
|
+
subjectLinksForAll(): { links: { memoryId: string; subjectId: string }[]; memories: number; cards: number } {
|
|
1640
|
+
const scan = this.index.scanner();
|
|
1641
|
+
const links: { memoryId: string; subjectId: string }[] = [];
|
|
1642
|
+
let memories = 0;
|
|
1643
|
+
for (const m of this.store.memoryTexts()) {
|
|
1644
|
+
const text = m.title === null || m.title.length === 0 ? m.body : `${m.title}\n${m.body}`;
|
|
1645
|
+
const subjects = this.subjectsFromHits(scan(text)).filter((s) => s !== m.id);
|
|
1646
|
+
if (subjects.length === 0) continue;
|
|
1647
|
+
memories += 1;
|
|
1648
|
+
for (const s of subjects) links.push({ memoryId: m.id, subjectId: s });
|
|
1649
|
+
}
|
|
1650
|
+
return { links, memories, cards: this.index.size() };
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1561
1653
|
/** The index recall borrows (SEAMS §6). Live object; treat it as read-only. */
|
|
1562
1654
|
aliasIndex(): AliasIndex {
|
|
1563
1655
|
return this.index;
|
|
@@ -301,6 +301,8 @@ export type FadeReason =
|
|
|
301
301
|
| "band-not-episodic"
|
|
302
302
|
| "protected"
|
|
303
303
|
| "in-live-revision-chain"
|
|
304
|
+
/** Physics' sixth gate (a repeating reminder date). The card fade never asks it. */
|
|
305
|
+
| "recurring"
|
|
304
306
|
| "has-live-attached-elements"
|
|
305
307
|
/** The identity core is not a card that fades. */
|
|
306
308
|
| "identity-core"
|
|
@@ -92,7 +92,10 @@ counted by doctor, and said in the next morning share).
|
|
|
92
92
|
- **Ingestion is ordinary and the gates apply**: a first-person reflection is not exempt from
|
|
93
93
|
never durably encoding a credential. [v1 §13 G8]
|
|
94
94
|
- **Add-first regrowth within a bounded window that CLOSES** — a deliberate deviation from
|
|
95
|
-
human reconsolidation, which reopens on every retrieval. [v1 §13 G11–G12]
|
|
95
|
+
human reconsolidation, which reopens on every retrieval. [v1 §13 G11–G12] The new copy
|
|
96
|
+
inherits the links the archived one had learned, through the injected `retarget`
|
|
97
|
+
(`associate.retargetOnSupersede`, 2026-10-09); without it they were stranded on a row
|
|
98
|
+
that conducts nothing.
|
|
96
99
|
- **Named handles are aliases, not a second lookup path** — "the lighthouse conversation" enters
|
|
97
100
|
through the ordinary rarity-weighted name channel. [v1 §9.2]
|
|
98
101
|
- **Lived salience is the only legitimate identity input.** [v1 §14.2, earned 2026-08-24]
|
|
@@ -229,7 +232,8 @@ proposals and their archive; render and delivery telemetry.
|
|
|
229
232
|
with the date it was learned** — `- YYYY-MM-DD · statement`, and
|
|
230
233
|
`- YYYY-MM-DD (of YYYY-MM-DD) · statement` when the content date differs (neutral,
|
|
231
234
|
because the horizon lane's dates are in the future), `- YYYY-MM-DD (due YYYY-MM-DD) ·
|
|
232
|
-
statement` for an arriving occasion (2026-10-01)
|
|
235
|
+
statement` for an arriving occasion (2026-10-01) — `(due YYYY-MM-DD, every May 14)`
|
|
236
|
+
when its date repeats (2026-10-09) — and no prefix when the statement
|
|
233
237
|
already opens with that same date. Leading, not trailing: the age is
|
|
234
238
|
read before the claim, the element's own text still ends the line, and it costs 14 bytes
|
|
235
239
|
at day precision against 21 for a trailing form — counted in the composed budget and in
|
|
@@ -294,7 +298,11 @@ proposals and their archive; render and delivery telemetry.
|
|
|
294
298
|
written and a write-up accepted through `session_end` mark it behind (`behind.ts`), and
|
|
295
299
|
`Counterpart.refreshWake` — the same render, with a budget or not at all — republishes
|
|
296
300
|
it at the next turn-end worker; the nightly process calls it when its child returns,
|
|
297
|
-
with no mark, naming `run-end` as the trigger.
|
|
301
|
+
with no mark, naming `run-end` as the trigger. A wake another build published (its
|
|
302
|
+
`self.wake.build` stamp differs from the running package version, or is absent) is
|
|
303
|
+
behind too, under `version` (2026-10-02), so the first turn-end after an install
|
|
304
|
+
re-renders it; the first session start after the install still reads the old one.
|
|
305
|
+
Either way the row records
|
|
298
306
|
`reason: "refresh"` and the triggers. So the bundle is no longer
|
|
299
307
|
rendered once per lived day; it is rendered at the day's first boundary and again when
|
|
300
308
|
one of those writes lands. A same-day re-render is stable: a hint an earlier render
|
|
@@ -319,7 +327,11 @@ proposals and their archive; render and delivery telemetry.
|
|
|
319
327
|
ifVersion? })` is the only door — the MCP tool, the owner's console and the nightly
|
|
320
328
|
writer all arrive there — and it crosses the same gate battery the journal does, so a
|
|
321
329
|
credential cannot land in the one piece of prose every session reads. **A redaction is
|
|
322
|
-
reported**: accepted is not the same as unaltered, and both doors say so.
|
|
330
|
+
reported**: accepted is not the same as unaltered, and both doors say so. A line of
|
|
331
|
+
the page's own that is a dateline — "Last revised" and a date, standing alone — is left
|
|
332
|
+
out before the caps and the gate see the body (2026-10-09, `page.ts#stripRevisedLines`):
|
|
333
|
+
the wake dates the page, and the revision row counts what went (`datelines`). Prose, a
|
|
334
|
+
list entry, a page's own history and a code block that open with the words stay. Every
|
|
323
335
|
accepted revision leaves a version (`store.revise` archives the prior one first) and a
|
|
324
336
|
durable `self.page.revised` row; every refusal leaves a `self.page.refused` row and a
|
|
325
337
|
named reason; an observer writes neither. The page is `type: "schema"`,
|
|
@@ -332,7 +344,10 @@ proposals and their archive; render and delivery telemetry.
|
|
|
332
344
|
VERSIONS take the ordinary retention, deliberately un-special-cased (owner ruling 1).
|
|
333
345
|
Proved by a test that runs a full cycle and the prune over a store holding a page with
|
|
334
346
|
two versions.
|
|
335
|
-
16. **[M]** **The page is what "Who I am" prints, first and as is
|
|
347
|
+
16. **[M]** **The page is what "Who I am" prints, first and as is** — less any
|
|
348
|
+
dateline of its own ("Last revised" and a date, standing alone), since the wake's
|
|
349
|
+
under it is the page's date (2026-10-09; a page stored before the write-side strip
|
|
350
|
+
printed two) — under
|
|
336
351
|
`PAGE_WAKE_BYTES` clamped to the caller's budget **less `PAGE_FLOOR_RESERVE_BYTES`, the
|
|
337
352
|
furniture the wake wraps it in** — the page is furniture the trim loop cannot pop, so a
|
|
338
353
|
page sized against the whole ceiling puts the composition over it with nothing left to
|
|
@@ -476,6 +491,7 @@ of them a budget. The composed budget is the caller's and lives nowhere in this
|
|
|
476
491
|
| `CRAFT_MAX` | 8 | Craft (skill-kind) elements considered — only while `CRAFT_AT_DELIVERY` is off. |
|
|
477
492
|
| `CRAFT_AT_DELIVERY` | true | Craft is the session's directory's work, composed at delivery (`work.ts`); the stored bundle has no craft lane and Nearby leaves work out. Off: craft is skill-kind above the warm floor, store-wide. |
|
|
478
493
|
| `WORK_HERE_MAX` | 4 | Work lines one delivery shows for its directory. |
|
|
494
|
+
| `WORK_HERE_POOL` | 8 | Work lines ranked for the day's rotation to choose `WORK_HERE_MAX` from (2026-10-02): the newest stays first, the others take turns by lived day (`work.ts#rotateWork`). |
|
|
479
495
|
| `WORK_HERE_EXCERPT` | 60 | Characters of a work line's excerpt after its title. |
|
|
480
496
|
| `THREADS_MAX` | 5 | Open threads considered (12 until 2026-10-01). `note` and `session_end` set the flag since then, and `updates` with `unresolved: false` clears it — INTERFACE-GAPS §8. |
|
|
481
497
|
| `HINTS_MAX` | 8 | Warm-shelf hints considered. |
|
|
@@ -506,6 +522,17 @@ second is the smallest room worth rendering a page into rather than a fragment.
|
|
|
506
522
|
the host's ceiling because delivery will add exactly that line, and one test bounds the
|
|
507
523
|
preface at its widest plausible day, date and store size against the same constant.
|
|
508
524
|
|
|
525
|
+
**Chapter addresses (v12, 2026-10-03; working default).** **[M]** `epi_…#N` (N from 1)
|
|
526
|
+
names one chapter and `chapter-address.ts#resolveChapter` resolves it — derived from the
|
|
527
|
+
engine headings, not stored — to its heading, text, calendar date, span and the
|
|
528
|
+
session's live memories written in that span (chapter copies left out). **[M]** Each
|
|
529
|
+
chapter's written moment is kept in the episode's meta (`CHAPTER_AT_META`); an episode from
|
|
530
|
+
before is read from its `episode-chapter` versions while they last, and past them the
|
|
531
|
+
resolver says the moment is unknown and lists nothing. **[A]** The span's edges are shifted
|
|
532
|
+
by `CHAPTER_MOMENT_GRACE_MS` so a stretch's memories written just after its chapter are the
|
|
533
|
+
chapter's. **[M]** `chapterTimesOf` and `chapterAt` give the same placement for many memories
|
|
534
|
+
at once (one read of an episode's moments; recall's meaning mode).
|
|
535
|
+
|
|
509
536
|
## 6. Scars honored
|
|
510
537
|
|
|
511
538
|
**E7** (observers receive but deposit nothing) · **E8** (episode pacing and the regrow
|
|
@@ -173,7 +173,7 @@ and neither wires it today. Recorded here so the freeze does not become v1's
|
|
|
173
173
|
"documented in three places, enforced in one, consumed by nobody" (scar §2.6). The
|
|
174
174
|
guarantee that this seam is reachable is the coordinator's, not this module's.
|
|
175
175
|
|
|
176
|
-
## 8. The threads lane has no source on a migrated store — nothing carries `unresolved`
|
|
176
|
+
## 8. The threads lane has no source on a migrated store — nothing carries `unresolved` — CLOSED FOR (1) AND (2) 2026-10-01 (`52384b0`, #313)
|
|
177
177
|
|
|
178
178
|
**Owner:** `remember/` (who mints and revises memories) plus `tools/migrate` (what came
|
|
179
179
|
across from v1).
|
|
@@ -210,6 +210,9 @@ ask says to close what got done. `THREADS_MAX` is 5 now. (3) is not built.
|
|
|
210
210
|
the machine's LOCAL calendar day (`calendar.ts`, NOTES §22). What survives is the other
|
|
211
211
|
half named below and in NOTES §22: provenance dates — `learned_on`, the `date` on every
|
|
212
212
|
`adapter.ask` row — are still UTC, and they are `store/`'s and the hooks' to move.
|
|
213
|
+
**That half CLOSED 2026-09-25 by #231 (`ab9b6eb`), noted 2026-10-09:** `Store#today` is
|
|
214
|
+
the person's local date, so `learned_on` is too, and the hook stamps its rows with the
|
|
215
|
+
local date (`bin/hook.ts`). Rows written before then keep their UTC dates.
|
|
213
216
|
|
|
214
217
|
*The entry as it stood before, for the record:*
|
|
215
218
|
|
|
@@ -314,4 +317,6 @@ wake time would put ranking on the wake path, which is meant to compute nothing.
|
|
|
314
317
|
|
|
315
318
|
- **The page writer's `off` mode does not reach the reflection** (2026-09-27): the
|
|
316
319
|
reflection writes the page from the MCP server, which does not read the host
|
|
317
|
-
configuration. Named in dream INTERFACE-GAPS §7.
|
|
320
|
+
configuration. Named in dream INTERFACE-GAPS §7. *(CLOSED 2026-09-27 by #256
|
|
321
|
+
(`39ca6d0`), noted 2026-10-09: the server reads `pageWriter.mode` from the host's
|
|
322
|
+
config, and with `off` the reflection writes no page.)*
|