counterparts 0.1.0
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/CONSTITUTION.md +68 -0
- package/LICENSE +21 -0
- package/README.md +348 -0
- package/docs/ELI5.md +84 -0
- package/docs/QUICKSTART.md +1258 -0
- package/docs/module-map.md +81 -0
- package/package.json +63 -0
- package/src/adapters/claude-code/CONTRACT.md +606 -0
- package/src/adapters/claude-code/INTERFACE-GAPS.md +655 -0
- package/src/adapters/claude-code/NOTES.md +1055 -0
- package/src/adapters/claude-code/bin/hook.ts +820 -0
- package/src/adapters/claude-code/bin/runner.ts +522 -0
- package/src/adapters/claude-code/config.ts +778 -0
- package/src/adapters/claude-code/credentials.ts +199 -0
- package/src/adapters/claude-code/doctor.ts +2557 -0
- package/src/adapters/claude-code/embed-client.ts +617 -0
- package/src/adapters/claude-code/hooks.ts +2240 -0
- package/src/adapters/claude-code/index.ts +224 -0
- package/src/adapters/claude-code/interpret-client.ts +395 -0
- package/src/adapters/claude-code/page-writer.ts +462 -0
- package/src/adapters/claude-code/primacy.ts +162 -0
- package/src/adapters/claude-code/spawn.ts +241 -0
- package/src/adapters/claude-code/standdown.ts +536 -0
- package/src/adapters/claude-code/transcript.ts +661 -0
- package/src/adapters/claude-code/vectors.ts +415 -0
- package/src/adapters/cli/CONTRACT.md +255 -0
- package/src/adapters/cli/INTERFACE-GAPS.md +350 -0
- package/src/adapters/cli/NOTES.md +936 -0
- package/src/adapters/cli/bin/counterparts.ts +74 -0
- package/src/adapters/cli/commands.ts +6095 -0
- package/src/adapters/cli/export.ts +766 -0
- package/src/adapters/cli/index.ts +103 -0
- package/src/adapters/cli/install.ts +670 -0
- package/src/adapters/cli/removal.ts +1186 -0
- package/src/adapters/cli/repair-dates.ts +659 -0
- package/src/adapters/cli/self-page.ts +229 -0
- package/src/adapters/cli/snapshot.ts +279 -0
- package/src/adapters/cli/start-fresh.ts +1228 -0
- package/src/adapters/config-path.ts +342 -0
- package/src/adapters/dashboard/CONTRACT.md +67 -0
- package/src/adapters/dashboard/INTERFACE-GAPS.md +139 -0
- package/src/adapters/dashboard/NOTES.md +474 -0
- package/src/adapters/dashboard/activity.ts +121 -0
- package/src/adapters/dashboard/ansi.ts +82 -0
- package/src/adapters/dashboard/bin/dashboard.ts +479 -0
- package/src/adapters/dashboard/browse.ts +298 -0
- package/src/adapters/dashboard/identity.ts +182 -0
- package/src/adapters/dashboard/index.ts +183 -0
- package/src/adapters/dashboard/layout.ts +149 -0
- package/src/adapters/dashboard/registries.ts +291 -0
- package/src/adapters/dashboard/resolve.ts +206 -0
- package/src/adapters/dashboard/source.ts +48 -0
- package/src/adapters/dashboard/status.ts +327 -0
- package/src/adapters/dashboard/stories.ts +194 -0
- package/src/adapters/dashboard/web/app.html +1731 -0
- package/src/adapters/dashboard/web/brain.html +463 -0
- package/src/adapters/dashboard/web/fired.ts +31 -0
- package/src/adapters/dashboard/web/flow.ts +457 -0
- package/src/adapters/dashboard/web/narrate.ts +1042 -0
- package/src/adapters/dashboard/web/reveal.ts +135 -0
- package/src/adapters/dashboard/web/server.ts +287 -0
- package/src/adapters/dashboard/web/views.ts +1744 -0
- package/src/adapters/expansions.ts +569 -0
- package/src/adapters/fired.ts +1580 -0
- package/src/adapters/mcp/CONTRACT.md +240 -0
- package/src/adapters/mcp/INTERFACE-GAPS.md +271 -0
- package/src/adapters/mcp/NOTES.md +205 -0
- package/src/adapters/mcp/bin/serve.ts +349 -0
- package/src/adapters/mcp/deliberate.ts +619 -0
- package/src/adapters/mcp/index.ts +101 -0
- package/src/adapters/mcp/protocol.ts +170 -0
- package/src/adapters/mcp/server.ts +1740 -0
- package/src/adapters/mcp/stdio.ts +56 -0
- package/src/adapters/mcp/tools.ts +779 -0
- package/src/adapters/scopes.ts +657 -0
- package/src/adapters/sessions.ts +402 -0
- package/src/adapters/snapshots.ts +1069 -0
- package/src/adapters/stance-env.ts +137 -0
- package/src/core/associate/CONTRACT.md +118 -0
- package/src/core/associate/INTERFACE-GAPS.md +173 -0
- package/src/core/associate/NOTES.md +194 -0
- package/src/core/associate/buffer.ts +66 -0
- package/src/core/associate/edges.ts +188 -0
- package/src/core/associate/index.ts +570 -0
- package/src/core/associate/pending.ts +383 -0
- package/src/core/associate/spread.ts +149 -0
- package/src/core/associate/tunables.ts +123 -0
- package/src/core/bridge.ts +272 -0
- package/src/core/briefing.ts +67 -0
- package/src/core/counterpart.ts +3855 -0
- package/src/core/encode/CONTRACT.md +151 -0
- package/src/core/encode/INTERFACE-GAPS.md +135 -0
- package/src/core/encode/NOTES.md +146 -0
- package/src/core/encode/aliases.ts +71 -0
- package/src/core/encode/battery.ts +284 -0
- package/src/core/encode/chunk.ts +265 -0
- package/src/core/encode/emotion.ts +119 -0
- package/src/core/encode/floor.ts +76 -0
- package/src/core/encode/index.ts +100 -0
- package/src/core/encode/precision.ts +162 -0
- package/src/core/encode/preselect.ts +269 -0
- package/src/core/encode/salience.ts +108 -0
- package/src/core/encode/secrets.ts +265 -0
- package/src/core/encode/tunables.ts +99 -0
- package/src/core/encode/types.ts +286 -0
- package/src/core/encode/words.ts +75 -0
- package/src/core/handoff/CONTRACT.md +199 -0
- package/src/core/handoff/INTERFACE-GAPS.md +166 -0
- package/src/core/handoff/NOTES.md +206 -0
- package/src/core/handoff/index.ts +957 -0
- package/src/core/mint.ts +279 -0
- package/src/core/observer.ts +28 -0
- package/src/core/physics/CONTRACT.md +341 -0
- package/src/core/physics/NOTES.md +155 -0
- package/src/core/physics/clock.ts +51 -0
- package/src/core/physics/index.ts +1054 -0
- package/src/core/prospective/CONTRACT.md +137 -0
- package/src/core/prospective/INTERFACE-GAPS.md +112 -0
- package/src/core/prospective/NOTES.md +160 -0
- package/src/core/prospective/derive.ts +188 -0
- package/src/core/prospective/index.ts +1030 -0
- package/src/core/prospective/tunables.ts +72 -0
- package/src/core/prospective/windows.ts +187 -0
- package/src/core/recall/CONTRACT.md +326 -0
- package/src/core/recall/INTERFACE-GAPS.md +163 -0
- package/src/core/recall/NOTES.md +472 -0
- package/src/core/recall/activate.ts +521 -0
- package/src/core/recall/cues.ts +275 -0
- package/src/core/recall/gate.ts +441 -0
- package/src/core/recall/index.ts +692 -0
- package/src/core/recall/probe.ts +239 -0
- package/src/core/recall/reference.ts +201 -0
- package/src/core/recall/render.ts +285 -0
- package/src/core/recall/session.ts +403 -0
- package/src/core/recall/tunables.ts +329 -0
- package/src/core/remember/CONTRACT.md +293 -0
- package/src/core/remember/INTERFACE-GAPS.md +189 -0
- package/src/core/remember/NOTES.md +373 -0
- package/src/core/remember/fallback.ts +452 -0
- package/src/core/remember/index.ts +103 -0
- package/src/core/remember/owner-strike-seam.ts +479 -0
- package/src/core/remember/proposals.ts +609 -0
- package/src/core/remember/spans.ts +1310 -0
- package/src/core/remember/tunables.ts +111 -0
- package/src/core/remember/updates.ts +198 -0
- package/src/core/retrieval.ts +96 -0
- package/src/core/revision.ts +441 -0
- package/src/core/schemas/CONTRACT.md +190 -0
- package/src/core/schemas/INTERFACE-GAPS.md +172 -0
- package/src/core/schemas/NOTES.md +260 -0
- package/src/core/schemas/aliases.ts +160 -0
- package/src/core/schemas/index.ts +1459 -0
- package/src/core/schemas/tunables.ts +44 -0
- package/src/core/schemas/types.ts +387 -0
- package/src/core/self/CONTRACT.md +459 -0
- package/src/core/self/INTERFACE-GAPS.md +284 -0
- package/src/core/self/NOTES.md +1057 -0
- package/src/core/self/briefing.ts +980 -0
- package/src/core/self/episodes.ts +483 -0
- package/src/core/self/freeze.ts +103 -0
- package/src/core/self/identity.ts +604 -0
- package/src/core/self/index.ts +2130 -0
- package/src/core/self/journal-file.ts +760 -0
- package/src/core/self/page.ts +404 -0
- package/src/core/self/tunables.ts +244 -0
- package/src/core/self/writer.ts +714 -0
- package/src/core/sleep/CONTRACT.md +298 -0
- package/src/core/sleep/INTERFACE-GAPS.md +262 -0
- package/src/core/sleep/NOTES.md +770 -0
- package/src/core/sleep/briefing.ts +86 -0
- package/src/core/sleep/consolidate.ts +241 -0
- package/src/core/sleep/cycle.ts +598 -0
- package/src/core/sleep/decay.ts +237 -0
- package/src/core/sleep/dedup.ts +373 -0
- package/src/core/sleep/index.ts +112 -0
- package/src/core/sleep/log.ts +116 -0
- package/src/core/sleep/markers.ts +164 -0
- package/src/core/sleep/prune.ts +170 -0
- package/src/core/sleep/strength-cache.ts +176 -0
- package/src/core/sleep/tunables.ts +135 -0
- package/src/core/sleep/types.ts +542 -0
- package/src/core/store/CONTRACT.md +446 -0
- package/src/core/store/NOTES.md +1068 -0
- package/src/core/store/cache.ts +709 -0
- package/src/core/store/db.ts +275 -0
- package/src/core/store/errors.ts +134 -0
- package/src/core/store/index.ts +2450 -0
- package/src/core/store/operational.ts +610 -0
- package/src/core/store/owner-op-seam.ts +428 -0
- package/src/core/store/paths.ts +494 -0
- package/src/core/store/prose.ts +165 -0
- package/src/core/store/render.ts +87 -0
- package/src/core/store/walk-seam.ts +78 -0
- package/src/core/types.ts +68 -0
- package/tools/install-loop/run.sh +1063 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The REVISION seam — SEAMS.md item O closes here.
|
|
3
|
+
*
|
|
4
|
+
* `mint.ts` is where a proposal becomes a memory. This file is where a memory
|
|
5
|
+
* that ARGUES WITH ANOTHER ONE actually lands. The two are deliberately
|
|
6
|
+
* separate: minting is unconditional (the memory exists either way), and
|
|
7
|
+
* revising is a dispatch on what the declaration hit.
|
|
8
|
+
*
|
|
9
|
+
* **The gap this closes, measured 2026-09-04 on the live store.** The surprise
|
|
10
|
+
* pipeline dissented and the dissent went nowhere. The sweep declared a revision
|
|
11
|
+
* against a shown card; `remember/` resolved it; `mint.ts` wrote
|
|
12
|
+
* `doc.meta["updates"]` and routed the claim through the freeze seam — and then
|
|
13
|
+
* nothing. `encode/chunk.ts` emits a `revision.challenge` DurableEffect that no
|
|
14
|
+
* consumer applied, and `Schemas.challengeBelief` — the pressure accumulator,
|
|
15
|
+
* the durable `revision.pressure` events, the supersede past the bar — had
|
|
16
|
+
* callers only in test files. Store-wide, for the store's whole life: zero rows
|
|
17
|
+
* with pressure, zero `last_challenged_day`, zero `superseded_by`, zero
|
|
18
|
+
* `versions` rows, zero `revision.pressure` events. `self/freeze.ts` says a
|
|
19
|
+
* softening leaves "the revision path (physics' pressure accumulator) ... the
|
|
20
|
+
* caller's next stop, unimpeded". The caller was never written. This is it.
|
|
21
|
+
*
|
|
22
|
+
* **The dispatch table (owner ruling, Mike, 2026-09-04).** What a resolved
|
|
23
|
+
* `updates:` may do depends entirely on WHAT IT HIT:
|
|
24
|
+
*
|
|
25
|
+
* | target | what happens |
|
|
26
|
+
* |------------------------------------------|---------------------------------|
|
|
27
|
+
* | schema BELIEF element | PRESSURE (`challengeBelief`) |
|
|
28
|
+
* | identity element (band identity / | PRESSURE, same arithmetic, same |
|
|
29
|
+
* | `promoted_identity`) | durable event shape |
|
|
30
|
+
* | schema CURRENT-STATE element ("now" fact) | REPLACE now, with lineage |
|
|
31
|
+
* | schema ENTITY row | link only — an entity dies by |
|
|
32
|
+
* | | decay and no model rewrites one |
|
|
33
|
+
* | any other memory | link only (`meta.updates`) |
|
|
34
|
+
* | protected element | REFUSED, on every path |
|
|
35
|
+
*
|
|
36
|
+
* "One declaration adds pressure; the element is superseded only when the bar is
|
|
37
|
+
* crossed; the old version is retained with lineage" (constitution 7) — that is
|
|
38
|
+
* the slow half. A current-state row is the fast half by construction: a "now"
|
|
39
|
+
* fact that is corrected is simply wrong now, and world-state should flip on one
|
|
40
|
+
* clear correction (§4.3). Everything else links and moves nothing, because
|
|
41
|
+
* `meta.updates` already records the relation and a supersede would be a claim
|
|
42
|
+
* the declaration did not make.
|
|
43
|
+
*
|
|
44
|
+
* **Three rules this file states, all of them inherited, none of them new:**
|
|
45
|
+
*
|
|
46
|
+
* 1. **A CONFIRMATION IS NOT A CHALLENGE.** The direction is read off the
|
|
47
|
+
* matcher's own verdict through `mint.directionOf` — the same function, not
|
|
48
|
+
* a second reading — and only a `soften` reaches the pressure path. Without
|
|
49
|
+
* this, the engine matching a RESTATEMENT by content (`content` /
|
|
50
|
+
* `content+hint`) would push a belief toward being superseded by its own
|
|
51
|
+
* paraphrase, and `physics.dedupVerdict`'s first check and this dispatch
|
|
52
|
+
* would disagree about what a declaration means (SEAMS N, scar §2.10).
|
|
53
|
+
* 2. **Authored beats swept, through the physics and not through a second
|
|
54
|
+
* weighting.** Force is `strength(challenger) x sal(challenger)`, and a
|
|
55
|
+
* fallback challenger's claimed salience was already cut to
|
|
56
|
+
* `SWEEP_CLAIM_CEILING` at the minting seam. A sweep therefore pushes less
|
|
57
|
+
* hard than the experiencer, arithmetically, and nothing here re-weights it.
|
|
58
|
+
* 3. **Refusals are RETURNED and EVENTED, never thrown.** A door that mints
|
|
59
|
+
* must not fail because a declaration pointed at nothing (§5 G10). Every
|
|
60
|
+
* outcome names its ground; the declaration itself is author content and is
|
|
61
|
+
* logged as a HASH (schemas NOTES §11).
|
|
62
|
+
*
|
|
63
|
+
* **Effect/apply agreement (encode §5 G3).** `encode/chunk.ts` emits one
|
|
64
|
+
* `revision.challenge` effect per accepted proposal whose declaration was
|
|
65
|
+
* non-null — BEFORE resolution, because encode resolves nothing. So this
|
|
66
|
+
* function is called once per such declaration, resolved or not: an address that
|
|
67
|
+
* resolves to nothing produces a countable `target-unresolvable` refusal rather
|
|
68
|
+
* than silence, and the effect list and the applies stand one for one. A fully
|
|
69
|
+
* gated chunk produces no accepted proposals, hence no effects and no applies;
|
|
70
|
+
* an observer's chunk produces neither, and this function stands down on its own
|
|
71
|
+
* besides.
|
|
72
|
+
*/
|
|
73
|
+
import { hashText } from "./store/index.js";
|
|
74
|
+
import type { MemoryRow, Store } from "./store/index.js";
|
|
75
|
+
import { applyChallenge, successorSeed, supersedeRecord } from "./physics/index.js";
|
|
76
|
+
import { directionOf } from "./mint.js";
|
|
77
|
+
import type { Schemas } from "./schemas/index.js";
|
|
78
|
+
import type { PressureIncrement, RevisionReason } from "./schemas/index.js";
|
|
79
|
+
|
|
80
|
+
/** Which arm of the dispatch table ran. */
|
|
81
|
+
export type RevisionPath = "belief" | "identity" | "current-state" | "link-only" | "none";
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Every ground an application can name. The pressure paths speak `schemas/`'s
|
|
85
|
+
* and `physics/`' own vocabulary so the two cannot drift; the rest are this
|
|
86
|
+
* dispatch's own, and each is a DISTINCT record (scar §2.4).
|
|
87
|
+
*/
|
|
88
|
+
export type RevisionApplyReason =
|
|
89
|
+
| RevisionReason
|
|
90
|
+
| "replaced"
|
|
91
|
+
| "target-not-current-state"
|
|
92
|
+
| "linked-only"
|
|
93
|
+
| "target-is-an-entity"
|
|
94
|
+
| "confirmation-not-a-challenge"
|
|
95
|
+
| "observer";
|
|
96
|
+
|
|
97
|
+
export interface RevisionInput {
|
|
98
|
+
/**
|
|
99
|
+
* The address as the door has it: the RESOLVED id when `remember/` resolved
|
|
100
|
+
* one, else the raw declaration. Resolution of TEXT to a candidate id is
|
|
101
|
+
* `remember/`'s matching problem; walking an id through the supersede chain is
|
|
102
|
+
* the store's, and it happens here (schemas INTERFACE-GAPS §8).
|
|
103
|
+
*/
|
|
104
|
+
updates: string;
|
|
105
|
+
/** The minted memory that is doing the arguing. Must be in the store. */
|
|
106
|
+
challengerId: string;
|
|
107
|
+
day: number;
|
|
108
|
+
/**
|
|
109
|
+
* The matcher's verdict, passed through so `mint.directionOf` decides the
|
|
110
|
+
* direction ONCE for both the freeze seam and this one.
|
|
111
|
+
*/
|
|
112
|
+
method?: string;
|
|
113
|
+
/** The successor's prose. Defaults to the challenger's own body. */
|
|
114
|
+
statement?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface RevisionOptions {
|
|
118
|
+
/** Telemetry: ids, hashes, counts, reasons. Never a statement, never a name. */
|
|
119
|
+
onEvent?: (name: string, data: Record<string, string | number | boolean | null>) => void;
|
|
120
|
+
/**
|
|
121
|
+
* SEAMS item E, for the paths this file owns: a successor inherits the old
|
|
122
|
+
* head's live edges. `schemas/` has its own injected copy for the element
|
|
123
|
+
* paths; an identity memory has no module of its own, so the callback arrives
|
|
124
|
+
* here too. A retarget that THROWS must not undo a revision that landed.
|
|
125
|
+
*/
|
|
126
|
+
retarget?: (oldId: string, newId: string, day: number) => void;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface RevisionApplication {
|
|
130
|
+
path: RevisionPath;
|
|
131
|
+
reason: RevisionApplyReason;
|
|
132
|
+
/** True when durable state moved: pressure credited, or a supersede landed. */
|
|
133
|
+
moved: boolean;
|
|
134
|
+
/** Did the pressure field on the target row actually move? */
|
|
135
|
+
credited: boolean;
|
|
136
|
+
verdict: "revise" | "replace" | "hold" | "none";
|
|
137
|
+
/** The id the declaration resolved to after the supersede chain. */
|
|
138
|
+
targetId: string | null;
|
|
139
|
+
/** True when the declaration named a superseded element and was forwarded. */
|
|
140
|
+
retargeted: boolean;
|
|
141
|
+
successorId: string | null;
|
|
142
|
+
force: number;
|
|
143
|
+
pressureBefore: number;
|
|
144
|
+
pressureAfter: number;
|
|
145
|
+
bar: number;
|
|
146
|
+
increment: PressureIncrement | null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const NOTHING = {
|
|
150
|
+
moved: false,
|
|
151
|
+
credited: false,
|
|
152
|
+
verdict: "none",
|
|
153
|
+
retargeted: false,
|
|
154
|
+
successorId: null,
|
|
155
|
+
force: 0,
|
|
156
|
+
pressureBefore: 0,
|
|
157
|
+
pressureAfter: 0,
|
|
158
|
+
bar: 0,
|
|
159
|
+
increment: null,
|
|
160
|
+
} as const;
|
|
161
|
+
|
|
162
|
+
/** The durable increment's event name — one spelling, owned by `schemas/`. */
|
|
163
|
+
export const PRESSURE_EVENT = "revision.pressure";
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* One declared revision, applied to whatever it hit. Called from EVERY mint
|
|
167
|
+
* door (`deposit` for the session-end dump and the note, `applySweep` for the
|
|
168
|
+
* crash fallback), once per declaration.
|
|
169
|
+
*/
|
|
170
|
+
export function applyRevision(
|
|
171
|
+
store: Store,
|
|
172
|
+
schemas: Schemas,
|
|
173
|
+
input: RevisionInput,
|
|
174
|
+
opts: RevisionOptions = {},
|
|
175
|
+
): RevisionApplication {
|
|
176
|
+
const declared = input.updates.trim();
|
|
177
|
+
const declaredHash = hashText(declared);
|
|
178
|
+
|
|
179
|
+
const settle = (
|
|
180
|
+
path: RevisionPath,
|
|
181
|
+
reason: RevisionApplyReason,
|
|
182
|
+
targetId: string | null,
|
|
183
|
+
extra: Partial<RevisionApplication> = {},
|
|
184
|
+
): RevisionApplication => {
|
|
185
|
+
const out: RevisionApplication = { ...NOTHING, path, reason, targetId, ...extra };
|
|
186
|
+
// FOUR DISTINCT records, never one string for two facts (scar §2.4): state
|
|
187
|
+
// moved; the link was the whole effect; the engine matched a restatement and
|
|
188
|
+
// there was nothing to challenge; or the declaration was refused, and why.
|
|
189
|
+
// A confirmation is not a refusal — filing it as one would make the refusal
|
|
190
|
+
// distribution unreadable, which is the shape of v1's ambiguous zeroes.
|
|
191
|
+
const name = out.moved
|
|
192
|
+
? "revision.applied"
|
|
193
|
+
: path === "link-only"
|
|
194
|
+
? "revision.linked"
|
|
195
|
+
: reason === "confirmation-not-a-challenge"
|
|
196
|
+
? "revision.confirmed"
|
|
197
|
+
: "revision.refused";
|
|
198
|
+
opts.onEvent?.(name, {
|
|
199
|
+
path,
|
|
200
|
+
reason,
|
|
201
|
+
target: targetId,
|
|
202
|
+
declaredHash,
|
|
203
|
+
challenger: input.challengerId,
|
|
204
|
+
day: input.day,
|
|
205
|
+
credited: out.credited,
|
|
206
|
+
successor: out.successorId,
|
|
207
|
+
retargeted: out.retargeted,
|
|
208
|
+
});
|
|
209
|
+
return out;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// An instrument leaves the world as it found it (docs/observer-mode.md, scar
|
|
213
|
+
// E7). The doors stand down before they mint, so nothing should reach here —
|
|
214
|
+
// this is the second lock, not the first, and it says so rather than letting
|
|
215
|
+
// the store's write guard throw inside a deposit.
|
|
216
|
+
if (store.observer) return settle("none", "observer", null);
|
|
217
|
+
if (declared.length === 0) return settle("none", "no-declared-target", null);
|
|
218
|
+
|
|
219
|
+
// RESOLUTION FIRST, and deliberately before the direction: `remember/` reports
|
|
220
|
+
// `method: "content"` both when it MATCHED a restatement and when it found no
|
|
221
|
+
// candidate at all, so reading the direction first would file every dangling
|
|
222
|
+
// address under "confirmation" and the countable refusal would disappear —
|
|
223
|
+
// which is the failure this whole seam exists to stop being invisible.
|
|
224
|
+
let targetId: string;
|
|
225
|
+
try {
|
|
226
|
+
targetId = store.resolve(declared);
|
|
227
|
+
} catch {
|
|
228
|
+
return settle("none", "target-unresolvable", null);
|
|
229
|
+
}
|
|
230
|
+
const retargeted = targetId !== declared;
|
|
231
|
+
const row = store.row(targetId);
|
|
232
|
+
if (row === undefined) return settle("none", "target-unresolvable", null, { retargeted });
|
|
233
|
+
|
|
234
|
+
// A CONFIRMATION IS NOT A CHALLENGE (rule 1 in the header). The engine matched
|
|
235
|
+
// a restatement; saying the same thing again must never push the thing it
|
|
236
|
+
// restates toward being replaced by its own paraphrase.
|
|
237
|
+
if (directionOf(input.method) === "confirm") {
|
|
238
|
+
return settle("none", "confirmation-not-a-challenge", targetId, { retargeted });
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (!store.has(input.challengerId)) {
|
|
242
|
+
return settle("none", "challenger-unknown", targetId, { retargeted });
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const target = store.physicsOf(targetId);
|
|
246
|
+
// Protected elements refuse EVERY revision path, always (schemas §5 G11), and
|
|
247
|
+
// the check is BEFORE the arithmetic on every arm — permanence that quietly
|
|
248
|
+
// accumulated a case against itself is a different, worse guarantee (NOTES
|
|
249
|
+
// §10). The belief path refuses it again on its own terms; this is not a
|
|
250
|
+
// substitute for that, it is the same rule stated where the dispatch is.
|
|
251
|
+
if (target.protected) {
|
|
252
|
+
return settle("none", "protected-refuses-revision", targetId, { retargeted });
|
|
253
|
+
}
|
|
254
|
+
// A superseded row resolved away above, so an archived row HERE is archived on
|
|
255
|
+
// purpose — a distinct fact from "not a belief" and from "gone".
|
|
256
|
+
if (row.archived === 1) return settle("none", "target-archived", targetId, { retargeted });
|
|
257
|
+
|
|
258
|
+
const element = schemas.element(targetId);
|
|
259
|
+
|
|
260
|
+
// ── a schema BELIEF: pressure, and supersede only past the bar ─────────────
|
|
261
|
+
if (element?.role === "belief") {
|
|
262
|
+
const out = schemas.challengeBelief({
|
|
263
|
+
updates: targetId,
|
|
264
|
+
challengerId: input.challengerId,
|
|
265
|
+
day: input.day,
|
|
266
|
+
...(input.statement === undefined ? {} : { statement: input.statement }),
|
|
267
|
+
});
|
|
268
|
+
return settle("belief", out.reason, out.targetId, {
|
|
269
|
+
moved: out.credited || out.successorId !== null,
|
|
270
|
+
credited: out.credited,
|
|
271
|
+
verdict: out.verdict,
|
|
272
|
+
retargeted: retargeted || out.retargeted,
|
|
273
|
+
successorId: out.successorId,
|
|
274
|
+
force: out.force,
|
|
275
|
+
pressureBefore: out.pressureBefore,
|
|
276
|
+
pressureAfter: out.pressureAfter,
|
|
277
|
+
bar: out.bar,
|
|
278
|
+
increment: out.increment,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// ── a CURRENT-STATE row: a "now" fact, replaced now ────────────────────────
|
|
283
|
+
if (element?.role === "current-state") {
|
|
284
|
+
const out = schemas.replaceCurrentState({
|
|
285
|
+
updates: targetId,
|
|
286
|
+
challengerId: input.challengerId,
|
|
287
|
+
day: input.day,
|
|
288
|
+
...(input.statement === undefined ? {} : { statement: input.statement }),
|
|
289
|
+
});
|
|
290
|
+
return settle("current-state", out.reason, out.targetId, {
|
|
291
|
+
moved: out.successorId !== null,
|
|
292
|
+
verdict: out.successorId === null ? "none" : "replace",
|
|
293
|
+
retargeted: retargeted || out.retargeted,
|
|
294
|
+
successorId: out.successorId,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// An ENTITY is not a claim: it is the place claims attach to. It dies by decay
|
|
299
|
+
// and by nothing else (schemas §5 G7), so a declaration against one links and
|
|
300
|
+
// stops. The link already exists — `mint.ts` wrote `meta.updates`.
|
|
301
|
+
if (schemas.entity(targetId) !== undefined) {
|
|
302
|
+
return settle("link-only", "target-is-an-entity", targetId, { retargeted });
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ── an IDENTITY element: the same arithmetic, on a memory row ──────────────
|
|
306
|
+
// The store's own notion of identity, not a second one: the band column, or
|
|
307
|
+
// the promotion flag the counted crossing sets (`sleep/consolidate.ts` writes
|
|
308
|
+
// both). An identity claim is exactly the case the slow-kind daily force cap
|
|
309
|
+
// exists for — three lived days of pressure, not one loud sentence.
|
|
310
|
+
if (row.type === "memory" && (row.band === "identity" || target.promotedIdentity)) {
|
|
311
|
+
return identityChallenge(store, row, input, opts, settle, retargeted);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Everything else: the link is the whole effect (owner ruling 2026-09-04).
|
|
315
|
+
return settle("link-only", "linked-only", targetId, { retargeted });
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The identity arm. `physics.applyChallenge` is the same function the belief
|
|
320
|
+
* path calls, the durable event is the SAME name with the SAME
|
|
321
|
+
* `(target, day, challenger)` dedup latch, and the supersede carries no entity
|
|
322
|
+
* meta — an identity memory belongs to no schema, and inventing one here would
|
|
323
|
+
* make it appear in a slice it was never part of.
|
|
324
|
+
*/
|
|
325
|
+
function identityChallenge(
|
|
326
|
+
store: Store,
|
|
327
|
+
row: MemoryRow,
|
|
328
|
+
input: RevisionInput,
|
|
329
|
+
opts: RevisionOptions,
|
|
330
|
+
settle: (
|
|
331
|
+
path: RevisionPath,
|
|
332
|
+
reason: RevisionApplyReason,
|
|
333
|
+
targetId: string | null,
|
|
334
|
+
extra?: Partial<RevisionApplication>,
|
|
335
|
+
) => RevisionApplication,
|
|
336
|
+
retargeted: boolean,
|
|
337
|
+
): RevisionApplication {
|
|
338
|
+
const targetId = row.id;
|
|
339
|
+
const target = store.physicsOf(targetId);
|
|
340
|
+
const challenger = store.physicsOf(input.challengerId);
|
|
341
|
+
const outcome = applyChallenge(
|
|
342
|
+
targetId,
|
|
343
|
+
target,
|
|
344
|
+
// The RESOLVED id is what physics is told; the raw declaration never leaves
|
|
345
|
+
// the event (scar §2.5 — the model proposes semantics, the engine resolves
|
|
346
|
+
// references).
|
|
347
|
+
{ id: input.challengerId, declaredUpdates: targetId, physics: challenger },
|
|
348
|
+
input.day,
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
let increment: PressureIncrement | null = null;
|
|
352
|
+
if (outcome.credited) {
|
|
353
|
+
store.updatePhysics(targetId, outcome.next);
|
|
354
|
+
const log = outcome.log;
|
|
355
|
+
if (log !== null) {
|
|
356
|
+
increment = {
|
|
357
|
+
event: PRESSURE_EVENT,
|
|
358
|
+
targetId,
|
|
359
|
+
day: log.day,
|
|
360
|
+
challengerId: log.challengerId,
|
|
361
|
+
force: log.force,
|
|
362
|
+
pressureAfter: log.pressureAfter,
|
|
363
|
+
bar: log.bar,
|
|
364
|
+
};
|
|
365
|
+
store.appendEvent({
|
|
366
|
+
name: PRESSURE_EVENT,
|
|
367
|
+
day: log.day,
|
|
368
|
+
ref: targetId,
|
|
369
|
+
dedupKey: `${PRESSURE_EVENT}:${targetId}:${log.day}:${log.challengerId}`,
|
|
370
|
+
payload: {
|
|
371
|
+
targetId,
|
|
372
|
+
day: log.day,
|
|
373
|
+
challengerId: log.challengerId,
|
|
374
|
+
force: log.force,
|
|
375
|
+
pressureAfter: log.pressureAfter,
|
|
376
|
+
bar: log.bar,
|
|
377
|
+
},
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
let successorId: string | null = null;
|
|
383
|
+
if (outcome.verdict === "revise") {
|
|
384
|
+
const statement = (input.statement ?? store.readProse(input.challengerId).body).trim();
|
|
385
|
+
successorId = store.supersede(
|
|
386
|
+
targetId,
|
|
387
|
+
{
|
|
388
|
+
type: "memory",
|
|
389
|
+
kind: row.kind,
|
|
390
|
+
body: statement,
|
|
391
|
+
meta: { revisedFrom: targetId, groundedIn: [input.challengerId] },
|
|
392
|
+
// Identity is entered by INHERITING it through a declared revision or by
|
|
393
|
+
// the counted promotion crossing, and never otherwise (physics §5.3).
|
|
394
|
+
// This is the first of those two, so the band travels with the successor
|
|
395
|
+
// and `successorSeed` carries the promotion flag.
|
|
396
|
+
band: row.band,
|
|
397
|
+
salience: challenger.salience,
|
|
398
|
+
physics: {
|
|
399
|
+
birthDay: input.day,
|
|
400
|
+
lastUsedDay: input.day,
|
|
401
|
+
...successorSeed(store.physicsOf(targetId)),
|
|
402
|
+
},
|
|
403
|
+
source: "accommodation",
|
|
404
|
+
origin: { ref: input.challengerId },
|
|
405
|
+
},
|
|
406
|
+
"revised-by-pressure",
|
|
407
|
+
);
|
|
408
|
+
if (opts.retarget !== undefined) {
|
|
409
|
+
try {
|
|
410
|
+
opts.retarget(targetId, successorId, input.day);
|
|
411
|
+
} catch (err) {
|
|
412
|
+
opts.onEvent?.("revision.edges.retarget.failed", {
|
|
413
|
+
target: targetId,
|
|
414
|
+
successor: successorId,
|
|
415
|
+
day: input.day,
|
|
416
|
+
error: err instanceof Error ? err.name : "UNKNOWN",
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const record = supersedeRecord(targetId, successorId, input.day);
|
|
421
|
+
opts.onEvent?.("memory.superseded", {
|
|
422
|
+
target: targetId,
|
|
423
|
+
successor: successorId,
|
|
424
|
+
day: record.day,
|
|
425
|
+
resolvableUntilDay: record.resolvableUntilDay,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return settle("identity", outcome.reason as RevisionReason, targetId, {
|
|
430
|
+
moved: outcome.credited || successorId !== null,
|
|
431
|
+
credited: outcome.credited,
|
|
432
|
+
verdict: outcome.verdict,
|
|
433
|
+
retargeted,
|
|
434
|
+
successorId,
|
|
435
|
+
force: outcome.force,
|
|
436
|
+
pressureBefore: outcome.pressureBefore,
|
|
437
|
+
pressureAfter: outcome.pressureAfter,
|
|
438
|
+
bar: outcome.bar,
|
|
439
|
+
increment,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# `schemas/` — CONTRACT
|
|
2
|
+
|
|
3
|
+
## 1. Purpose
|
|
4
|
+
|
|
5
|
+
Semantic memory: the entities experience organizes itself around — people, places, skills,
|
|
6
|
+
projects, systems — and the beliefs held about them, born by mention and revised by
|
|
7
|
+
physics.
|
|
8
|
+
|
|
9
|
+
## 2. Brain analog
|
|
10
|
+
|
|
11
|
+
Schema formation and semantic memory: repeated episodes abstract into a structure that new
|
|
12
|
+
experience is compared against, which is what makes prediction error possible. **Named
|
|
13
|
+
deviation** (constitution line 12): beliefs never blend into each other. Generalization is
|
|
14
|
+
only ever an explicit, provenance-carrying revision — biology's interference and source
|
|
15
|
+
confusion are the bugs, not the architecture (owner ratification 2026-08-08).
|
|
16
|
+
|
|
17
|
+
## 3. Keeps
|
|
18
|
+
|
|
19
|
+
- **The entity schema as the organizing unit** — a person, a place, a skill, a
|
|
20
|
+
project/system, the self. Sectioned prose: stable core; current state; relations; beliefs
|
|
21
|
+
with provenance and confidence; protected elements; lineage of everything superseded.
|
|
22
|
+
[v1] behavioral-spec §4.2(b).
|
|
23
|
+
- **Project state does not live in identity; entities get their own homes.** [v1]
|
|
24
|
+
earned-mechanism #5 — v1 measured ~72 KB of dated project status rendered verbatim into
|
|
25
|
+
every self-keyed prompt, and 14 of self's 19 active beliefs were about projects with no
|
|
26
|
+
retrieval key. **v2 decides where status lives on day one.**
|
|
27
|
+
- **Revision bars differ by kind, and a loosening is chosen out loud.** [v1] §4.3, §6.2 G3
|
|
28
|
+
— world-state should flip on one clear correction; identity should not. The inertia
|
|
29
|
+
table lives in `physics/` §5.3.
|
|
30
|
+
- **A newborn schema is empty except its names.** [v1] §14.3 — "birth creates a place for
|
|
31
|
+
memories to attach, never a claim about what is true of the thing."
|
|
32
|
+
- **Whole-name matching, one definition, shared with preselection.** [v1] §8 G3 — birth
|
|
33
|
+
must test a proposed name by *exactly* the rule preselection uses, or a name that "was in
|
|
34
|
+
the span" for one is not for the other.
|
|
35
|
+
- **Near collisions refuse loudly rather than merging.** [v1] §14.3 — the engine has no
|
|
36
|
+
evidence that "Mike Chen" is the "Mike" it already knows, and silently deciding either
|
|
37
|
+
way is worse than declining and saying so.
|
|
38
|
+
- **Never a second self.** [v1] §14.3 — "one identity core; a second is a category error no
|
|
39
|
+
evidence could justify," refused structurally.
|
|
40
|
+
- **Beliefs and current state render verbatim to the encoder; core renders compressed.**
|
|
41
|
+
[v1] §8 G7 — a paraphrase of a belief cannot be honestly confirmed or contradicted.
|
|
42
|
+
- **Elements carry stable, immutable handles; prose is the content, the handle is the
|
|
43
|
+
identity.** [v1] §4.2 G1–G2.
|
|
44
|
+
- **Archive is a state, not a deletion** — an archived element keeps its id and stays
|
|
45
|
+
resolvable; it simply never surfaces. [v1] §4.2 G3.
|
|
46
|
+
- **Aliases are first-class and change only through explicit alias operations**, never as a
|
|
47
|
+
side effect of editing prose. [v1] §4.2 G4.
|
|
48
|
+
- **Revision keeps its reason**: the old element is retained as superseded with lineage.
|
|
49
|
+
[v1] §16 G3, earned-mechanism #14 — earned live 2026-08-24, when accommodation's
|
|
50
|
+
forensics needed the retained element.
|
|
51
|
+
|
|
52
|
+
## 4. Drops / simplifies
|
|
53
|
+
|
|
54
|
+
- **Entities are born by mention and die by decay; there is no approval gate** (owner
|
|
55
|
+
decision 2026-08-25, settled). v1's autonomous-birth gate is not ported: zero births
|
|
56
|
+
*and* zero refusals across 89 interpreter runs recorded the gate as unexercised, not
|
|
57
|
+
proven — "a gate with no knocks is unmeasured." What survives from it are the *mechanical*
|
|
58
|
+
grounds that are cheap and still true: an allowed kind, the name occurring in the span as
|
|
59
|
+
a whole name, no exact-or-near collision, aliases verified individually and **dropped
|
|
60
|
+
rather than fatal**, never a second self.
|
|
61
|
+
- **The accommodation subsystem — invitations, authorized single core edits, repair-only
|
|
62
|
+
unreachability, per-invitation caps, decline half-lives, refusal cooldowns, forensics
|
|
63
|
+
holds — is replaced by strength-weighted revision** (owner decision 2026-08-25, settled).
|
|
64
|
+
The property it protected survives whole and is now cheaper: a belief changes only when a
|
|
65
|
+
challenger's force exceeds its kind's inertia times its current strength (`physics/`
|
|
66
|
+
§5.6), and the old version is retained with lineage. **The guardrail that made
|
|
67
|
+
accommodation work — no model may edit a belief directly — is preserved by construction:
|
|
68
|
+
no model-facing operation edits a belief at all; models write memories, and revision is
|
|
69
|
+
arithmetic.**
|
|
70
|
+
- **`protected.add`'s second-signature queue is dropped; protection itself is kept.**
|
|
71
|
+
**PROPOSED** — owner call at check-in. The evidence: zero `protected.queued` events ever,
|
|
72
|
+
and the 2026-08-24 identity review replaced the corrective with **legibility** — every
|
|
73
|
+
standing protected element enumerable on demand, a list rather than a cadence — which is
|
|
74
|
+
the half that shipped and works. The risk if this is wrong is scar §2.19's exactly:
|
|
75
|
+
permanent, unfalsifiable ink with the lowest write bar. Counter-argument for the owner:
|
|
76
|
+
protection is now proposed only by the experiencer at session end, which is the highest-
|
|
77
|
+
context author the system has, not a sweep model reading a transcript.
|
|
78
|
+
- **Belief confidence as a separate stored number is dropped in favour of strength.**
|
|
79
|
+
**PROPOSED** — owner call at check-in. v1 held both, and the ledger's evidence weight
|
|
80
|
+
multiplied by `(1 − confidence)`; `physics/` §5.6 gets the same "weakly-held beliefs fall
|
|
81
|
+
easier" behaviour out of `strength(old)` alone. Simpler, one number, and it cannot go
|
|
82
|
+
inert unnoticed.
|
|
83
|
+
- **Threads as a schema section are dropped** — an open loop is an ordinary memory with an
|
|
84
|
+
`unresolved` flag (v1's own recorded v2 direction, §6.3). Settled by the harvest, not by
|
|
85
|
+
this contract.
|
|
86
|
+
|
|
87
|
+
## 5. Contract
|
|
88
|
+
|
|
89
|
+
**Inputs** — accepted proposals with their kinds, scopes, names, and aliases; revision
|
|
90
|
+
verdicts from `physics/`; the lived day; cue queries from `recall/` and `encode/`.
|
|
91
|
+
**Outputs** — schema slices for encode-time preselection; entity and belief rows; lineage;
|
|
92
|
+
name/alias resolution; birth and death telemetry.
|
|
93
|
+
|
|
94
|
+
**Guarantees** — **[M]** mechanized, **[A]** advisory:
|
|
95
|
+
|
|
96
|
+
1. **[M] No model-facing operation edits a belief.** There is no such verb. Revision is
|
|
97
|
+
`physics/` §5.6 applied to a declared `updates:`; a belief's text changes only as the
|
|
98
|
+
result of that arithmetic, and the prior text is retained.
|
|
99
|
+
**1b. [M] A resolved `updates:` does what its TARGET allows, and the dispatch is the
|
|
100
|
+
engine's** (owner ruling 2026-09-04; wired at `src/core/revision.ts`, SEAMS item O).
|
|
101
|
+
A **belief** and an **identity element** accumulate PRESSURE and are superseded only
|
|
102
|
+
past the bar. A **current-state** row — a "now" fact — is REPLACED immediately with
|
|
103
|
+
lineage (`replaceCurrentState`), because world-state flips on one clear correction
|
|
104
|
+
(§4.3) and a stale status has no reason to climb a bar. An **entity** row and any
|
|
105
|
+
**ordinary memory** are LINKED and nothing else (`meta.updates` already records the
|
|
106
|
+
relation). A **protected** element refuses every one of those paths. Authored
|
|
107
|
+
declarations count for more than swept ones through the PHYSICS alone — a fallback
|
|
108
|
+
challenger's claim was already cut at the minting seam — and no second weighting
|
|
109
|
+
exists here. A CONFIRMATION (the engine matched a restatement rather than an author
|
|
110
|
+
addressing an id) enters none of it. Found as a gap on 2026-09-04: the pressure
|
|
111
|
+
accumulator had no live caller, and the running store held zero pressure, zero
|
|
112
|
+
`superseded_by` and zero `revision.pressure` events for its whole life.
|
|
113
|
+
2. **[M] Birth requires the name to occur in the source as a whole name**, by the same
|
|
114
|
+
whole-word function preselection uses — a schema whose name the source never said is a
|
|
115
|
+
hallucinated entity.
|
|
116
|
+
3. **[M] At most one birth per chunk, counted by the engine.** A span that appears to
|
|
117
|
+
introduce five new entities is far more likely to be one confused chunk than five
|
|
118
|
+
discoveries.
|
|
119
|
+
4. **[M] Exact and near name collisions refuse, loudly**, and the refusal is a distinct
|
|
120
|
+
record from "not proposed" (scar §2.4 — v1's zero births were ambiguous precisely
|
|
121
|
+
because the two were indistinguishable). **The proposal is logged, not only the
|
|
122
|
+
outcome.**
|
|
123
|
+
5. **[M] Never a second self**, refused independently of the birth path's other checks.
|
|
124
|
+
6. **[M] A newborn schema asserts nothing** — names and aliases only.
|
|
125
|
+
7. **[M] Death is decay, not deletion by decision.** An entity with no live memories
|
|
126
|
+
attached and no reinforcement for `D_floor` lived days fades out of preselection and is
|
|
127
|
+
archived, keeping its id resolvable. No model can kill an entity.
|
|
128
|
+
**7b. [M] The OWNER can, and this index survives it.** `counterparts remove` accepts a
|
|
129
|
+
schema target, and after the chase the row is still listed with its pointer blanked. The
|
|
130
|
+
REMOVED ROW is SKIPPED — by `load`, by `entity` and by `element` — so it is in no slice,
|
|
131
|
+
no alias lookup, no preselection and no schema context, and nothing built on this index
|
|
132
|
+
can render it. (A long-lived process that has not reopened can still *match* a
|
|
133
|
+
dark-marked entity through its cached alias index; it cannot surface it — `recall/`
|
|
134
|
+
filters denied ids before candidates are formed. NOTES §13.)
|
|
135
|
+
Until 2026-09-18 it was not skipped: reading it threw out of `Schemas.open`, out of
|
|
136
|
+
`Counterpart.open`, and the hook caught that and exited 0, so the owner's next session
|
|
137
|
+
simply had no memory and said nothing about it.
|
|
138
|
+
**Removal does NOT cascade, and the consequence is visible.** Elements hanging off a
|
|
139
|
+
removed entity keep their rows: they are orphaned, not destroyed. They vanish from every
|
|
140
|
+
path that STARTS AT AN ENTITY — the four above — and remain ordinary rows to every path
|
|
141
|
+
that does not. The proved example is the dashboard's identity view, whose band and
|
|
142
|
+
protected lists enumerate `store.list({ band, archived })` and read the prose directly
|
|
143
|
+
(`adapters/dashboard/identity.ts` over `self/identity.ts#enumerate`): a promoted belief
|
|
144
|
+
about a removed person still prints there, in full, while `browse --id <entity>` says
|
|
145
|
+
`[removed by the owner]`. `Schemas.element(id)` and `Store.read(id)` answer for them too,
|
|
146
|
+
by design — they were not removed. **Whether removal should cascade to what hangs off its
|
|
147
|
+
target is the owner's open question**, and it is `cli/removal.ts`'s to implement, not this
|
|
148
|
+
module's: the difference between "forget this person" and "forget everything I ever
|
|
149
|
+
concluded about her".
|
|
150
|
+
8. **[M] Beliefs and current state render verbatim in every schema slice**; elided items
|
|
151
|
+
are announced as a count, never silently omitted.
|
|
152
|
+
9. **[M] Every element has a stable handle, and compression may shorten a statement but
|
|
153
|
+
must preserve the handle a later revision names** — shorter, never unfalsifiable
|
|
154
|
+
(§1 G6, §7 G3).
|
|
155
|
+
10. **[M] Referential integrity on supersede is the store's job, not this module's** —
|
|
156
|
+
inherited at one retarget site every write path crosses (scar §2.2).
|
|
157
|
+
11. **[M] Protected elements refuse every revision path**, and their permanence is
|
|
158
|
+
disclosed: permanent-includes-permanently-wrong is doctrine, and the corrective is that
|
|
159
|
+
the owner can list every unfalsifiable anchor at will (§14.1 G9, earned 2026-08-24).
|
|
160
|
+
12. **[A] What belongs in "core" versus "current state" is a preference** stated to the
|
|
161
|
+
author. That current state is timestamped and that status does not accumulate on the
|
|
162
|
+
self schema is mechanized — see `self/` guarantee 4.
|
|
163
|
+
13. **[M] Every kind reports created-versus-exited counts.** A kind whose exit count is
|
|
164
|
+
zero after the bake-in window is a **defect to investigate, not a base rate to accept**
|
|
165
|
+
(scar §2.17).
|
|
166
|
+
|
|
167
|
+
## 6. Scars honored
|
|
168
|
+
|
|
169
|
+
**§2.2** (supersede is a graph operation) · **§2.4** (log the proposal, not only the
|
|
170
|
+
outcome; three distinct records per gate) · **§2.5** (the model proposes semantics; the
|
|
171
|
+
engine resolves references — names and aliases are content-matched, never
|
|
172
|
+
model-addressed) · **§2.8** (the near-collision similarity bar is measured, not intuited) ·
|
|
173
|
+
**§2.9** (the encoder must see the beliefs its output can affect) · **§2.16** (every
|
|
174
|
+
declarable field carries an admission test and a named negative example) · **§2.17** (write
|
|
175
|
+
paths ship, curation paths starve — every entity kind names its exit) · **§2.19**
|
|
176
|
+
(permanence and write bar scale together — the live question behind the protected-queue
|
|
177
|
+
PROPOSED drop).
|
|
178
|
+
|
|
179
|
+
## 7. Open questions
|
|
180
|
+
|
|
181
|
+
1. **What kills an entity, precisely?** "Death by decay" is settled; the predicate is not.
|
|
182
|
+
Zero live attached memories is the obvious rule, but a person with one faded memory is
|
|
183
|
+
not the same as a project that ended.
|
|
184
|
+
2. **Does a belief need provenance beyond its lineage chain?** v1 carried provenance and
|
|
185
|
+
confidence as separate fields; dropping confidence (above) leaves provenance doing more
|
|
186
|
+
work.
|
|
187
|
+
3. **Where does *status* live now that it is off the self schema** — a current-state
|
|
188
|
+
section on the project entity, or ordinary memories with an event date that expire on
|
|
189
|
+
their own? The second is more brain-faithful and has no cleanup pass; the first is what
|
|
190
|
+
a wake briefing can render.
|