provident-storeroom 1.0.1 → 1.2.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/README.guide.md +166 -0
- package/index.d.ts +65 -0
- package/index.mjs +68 -12
- package/package.json +6 -6
- package/src/entry/constraints.mjs +941 -109
- package/src/entry/delivery.mjs +19 -4
- package/src/entry/frame.mjs +2 -1
- package/src/entry/kernel-attempt.mjs +151 -16
- package/src/entry/kernel-commit.mjs +2 -2
- package/src/entry/kernel-foundations.mjs +94 -3
- package/src/entry/kernel-registration.mjs +64 -10
- package/src/entry/state.mjs +377 -5
package/src/entry/delivery.mjs
CHANGED
|
@@ -5,7 +5,8 @@ import { withAddon, boundaryReject } from './artefact.mjs';
|
|
|
5
5
|
import { arrayClass, classSpelling, hasLoneSurrogate, isPlainObjectValue, targetSpelling } from './class-decision.mjs';
|
|
6
6
|
import { encodeAddress, encodeOpId, handleWire, inDomainHandle } from './carrier.mjs';
|
|
7
7
|
import { decodeSegments, spellConstraintAddress } from './frame.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import { addressSpelling } from './kernel-foundations.mjs';
|
|
9
|
+
import { entryOf, carryRefusal, commitFile, homeAddressKey, externalCall, SETTLED_ON_THE_PASSING_ARM, SAVE_FAILED_AT_THE_TERMINAL_ARM } from './state.mjs';
|
|
9
10
|
|
|
10
11
|
/// `PAR-JS-13`: the returned record is `{op, watched, triggered}` — fresh on every call, never a view.
|
|
11
12
|
///
|
|
@@ -182,7 +183,21 @@ export function deliver(state, triggered, triggeringAddress) {
|
|
|
182
183
|
// `crossing.md §1.1` clause 2's deep copy OUT, at the invocation: **each invocation is handed a FRESH
|
|
183
184
|
// dense address array** (`JS-19`), so one listener's mutation of its own argument cannot be observed
|
|
184
185
|
// by the next — no shared object crosses into the caller's own functions.
|
|
185
|
-
|
|
186
|
+
//
|
|
187
|
+
// **⟶ AND THE INVOCATION NAMES NO COMMIT, 2026-10-27 — THIS IS THE SITE BOTH RULINGS ARE ABOUT.** **THE
|
|
188
|
+
// ARCHITECT, VERBATIM: *"A listener should be operating at the surface and opening a new commit"*** and
|
|
189
|
+
// *"how is a listener supposed to be able to reuse the outer verb's commit? The listener is an
|
|
190
|
+
// externally-passed function and should be making calls at the package surface. It should be opening a new
|
|
191
|
+
// commit by default of entering at the surface"*** (`strata/decisions.md` · `D-46` item `1`; `D-45`).
|
|
192
|
+
// **AND IT IS NOT AN EXCEPTION TO `D-46`'S RULE BUT ITS ABSENT ARM: A LISTENER BODY HAS NO COMMIT TO
|
|
193
|
+
// NAME** — it is handed the triggering address and nothing else (`PAR-JS-12`), so `externalCall` hands the
|
|
194
|
+
// channel no commit and **a verb it calls at this surface OPENS ITS OWN**: its check has a window of its
|
|
195
|
+
// own, the pairs standing over the addresses it writes to are asked by ITS pass, and the count rises by one
|
|
196
|
+
// for it and falls by one when it ends, **the outer verb's count unchanged across the call**
|
|
197
|
+
// (`tests/e2e/external-commit.test.mjs` prints both figures). **NOTHING IS INFERRED FROM THE FRAME ANY
|
|
198
|
+
// MORE**: the name is set here, restored when the body returns or throws, and every internal step of the
|
|
199
|
+
// listener's own write names the commit that write opened.
|
|
200
|
+
externalCall(state.receiver, () => listener(decodeSegments(address)));
|
|
186
201
|
}
|
|
187
202
|
}
|
|
188
203
|
}
|
|
@@ -291,8 +306,8 @@ export function registerOn(state, handle, listener) {
|
|
|
291
306
|
if (conflicted !== null) {
|
|
292
307
|
boundaryReject(
|
|
293
308
|
'AddressMalformed',
|
|
294
|
-
|
|
295
|
-
`the listener '${handle}' cannot be registered at ${
|
|
309
|
+
addressSpelling(conflicted.address),
|
|
310
|
+
`the listener '${handle}' cannot be registered at ${addressSpelling(conflicted.address)}: the constraint `
|
|
296
311
|
+ `'${conflicted.id}' stands at that address, and a listener and a constraint do not share one`,
|
|
297
312
|
);
|
|
298
313
|
}
|
package/src/entry/frame.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { types } from 'node:util';
|
|
3
3
|
import { boundaryReject } from './artefact.mjs';
|
|
4
4
|
import { appendOwn } from './refusal.mjs';
|
|
5
|
+
import { addressSpelling } from './kernel-foundations.mjs';
|
|
5
6
|
import { arrayClass, classSpelling, hasLoneSurrogate, isAdmittedArray, isLawfulListenerElement, isPlainObjectValue, valueTargetSpelling } from './class-decision.mjs';
|
|
6
7
|
import { encodeAddress, encodeFilePath, encodeJournalLength } from './carrier.mjs';
|
|
7
8
|
|
|
@@ -309,7 +310,7 @@ export function admittedConstraintBatch(cfg) {
|
|
|
309
310
|
'ConstraintListInvalid',
|
|
310
311
|
segment,
|
|
311
312
|
`the batch element at position ${position} names the handle '${element.id}', and this construction `
|
|
312
|
-
+ `adopts a listener under that handle at ${
|
|
313
|
+
+ `adopts a listener under that handle at ${addressSpelling(adoptedAddresses[adoptedAt])}: a listener `
|
|
313
314
|
+ 'and a constraint do not share one',
|
|
314
315
|
['constraints'],
|
|
315
316
|
);
|
|
@@ -1,10 +1,125 @@
|
|
|
1
1
|
// `D-13` (`docs/L1/kernel-subdivision.md` §1 part `9d`) — the pass: bytes moved from `bindings/js/src/constraint-kernel.mjs`; no logic changed.
|
|
2
|
-
import { KC, KC_TOKENS, SETTLED_ON_THE_PASSING_ARM, SAVE_FAILED_AT_THE_TERMINAL_ARM, TERMINAL_ARM, markBodyThrow, refuse, isKernelRefusal, pairSpelling, sameAddress, kernelFor, append, appendOwn, ownMember, withdraw, landedOp, landedOpDefect, pairsAtAddress } from './kernel-foundations.mjs';
|
|
2
|
+
import { KC, KC_TOKENS, SETTLED_ON_THE_PASSING_ARM, SAVE_FAILED_AT_THE_TERMINAL_ARM, TERMINAL_ARM, markBodyThrow, refuse, isKernelRefusal, pairSpelling, addressSpelling, sameAddress, kernelFor, append, appendOwn, ownMember, withdraw, landedOp, landedOpDefect, pairsAtAddress, externalCall } from './kernel-foundations.mjs';
|
|
3
3
|
import { commitAttemptIdOf, terminal, close } from './kernel-terminal.mjs';
|
|
4
4
|
// ---------------------------------------------------------------------------------------------
|
|
5
5
|
// `K-3` `runAttempt(store, commit) -> AttemptReport`
|
|
6
6
|
// ---------------------------------------------------------------------------------------------
|
|
7
|
+
/// **`D-44`'s CHANNEL, SPELLED ON THIS SIDE TOO** — `state.mjs`'s `installAttemptSeam` installs it and this
|
|
8
|
+
/// module reads it, **and neither side imports the other**: the key is a `Symbol.for` spelling, the same device
|
|
9
|
+
/// `SETTLED_ON_THE_PASSING_ARM`, `SAVE_FAILED_AT_THE_TERMINAL_ARM` and `TERMINAL_ARM` already cross this boundary
|
|
10
|
+
/// by (`kernel-surface.md §1` item 1: this module's import footprint is EMPTY, so it cannot import `state.mjs`
|
|
11
|
+
/// and must not).
|
|
12
|
+
///
|
|
13
|
+
/// **THE INVARIANT IS THE ARCHITECT'S, VERBATIM: *"There should be no state where a constraint is being checked
|
|
14
|
+
/// without an open commit. Any action that would cause a constraint check should open a commit before
|
|
15
|
+
/// beginning"*** (`strata/decisions.md` · `D-44`) — **and it is enforced HERE, at the one frame where a check
|
|
16
|
+
/// runs, and not at the frame that called it**: a bracket taken in `constraintWrite` would be bypassed by every
|
|
17
|
+
/// direct `K-2`/`K-3` drive, and *"a seam a driver can bypass is not an invariant."* **SO THE PASS OPENS ITS OWN
|
|
18
|
+
/// SCOPE, AND A STORE THAT CARRIES NO CHANNEL IS REFUSED RATHER THAN RUN UNCOMMITTED** — the invariant fails
|
|
19
|
+
/// closed, `KC-2` (the kernel's own argument token, the one its other two store-mismatch arms answer with; no
|
|
20
|
+
/// ninth token is minted, `fail-surface.md §2`).
|
|
21
|
+
const COMMIT_SCOPE = Symbol.for('provident-storeroom.commit-scope');
|
|
22
|
+
|
|
23
|
+
/// **⟶ `D-42`'s RESTART CONSUMER, REACHED ON THE SAME SEAM AND INSIDE THE SAME SCOPE — 2026-10-27.**
|
|
24
|
+
///
|
|
25
|
+
/// **`D-44`'s OWN TERMS DECLARED THIS OWED AND ITS IMPLEMENTATION DID NOT DELIVER IT**: *"If every check has a
|
|
26
|
+
/// commit, every request has a consumer, and the consumer stops being a property of one call site."* **The
|
|
27
|
+
/// request was still consumed by `constraintWrite`'s frame**, so a constraint body's `rollback` inside a pass
|
|
28
|
+
/// driven straight through `K-2`/`K-3` — the window `D-44` itself emptied — raised a request no frame above it
|
|
29
|
+
/// would ever consume, and the pair the reversal invalidated was never asked at the state the action left.
|
|
30
|
+
///
|
|
31
|
+
/// **THE REQUEST IS A STORE-SIDE FACT, SO ITS CONSUMER IS THE STORE'S OWN COMMIT SCOPE — ONE MECHANISM, NOT
|
|
32
|
+
/// TWO.** `runAttempt` is, since `D-44`, THE universal caller of a pass (every check runs inside its scope), so
|
|
33
|
+
/// it is the one frame every driver reaches; after its pass it asks the store to drain what the pass recorded,
|
|
34
|
+
/// **inside the scope it already owns** — so the restarted check is itself a check with a commit open.
|
|
35
|
+
/// **THE CHANNEL IS A `Symbol.for` KEY** (`state.mjs` installs it; this module spells it and imports nothing of
|
|
36
|
+
/// the entry — `kernel-surface.md §1` item 1's empty import footprint), **and NO KERNEL ITEM IS MINTED**
|
|
37
|
+
/// (`§1` item 2: `K-1`–`K-5` and no sixth name).
|
|
38
|
+
const RESTART_DRAIN = Symbol.for('provident-storeroom.restart-drain');
|
|
39
|
+
|
|
40
|
+
/// **⟶ ADDED 2026-10-27 — `D-46`'s NAME ON AN INVOCATION'S OWN ENTRY, AND IT IS THIS PASS'S ONE USE OF THE
|
|
41
|
+
/// SEAM'S SIXTH CHANNEL.** **THE RULING, THE ARCHITECT, VERBATIM: *"A constraint's repair needs to stay as part
|
|
42
|
+
/// of the same commit so that it can be tracked as part of the commit process … The original way of maintaining
|
|
43
|
+
/// this was to accept an optional parameter on entry for the commit id, so that a constraint can identify which
|
|
44
|
+
/// open commit it is repairing"*** (`strata/decisions.md` · `D-46`). **SO THE KERNEL NAMES THE ATTEMPT'S COMMIT
|
|
45
|
+
/// WHEN IT INVOKES A REPAIR**, and the write that repair body makes — at `write`'s THREE positions, supplying
|
|
46
|
+
/// nothing — **JOINS the attempt's commit instead of opening a second one**: its op is the attempt's op, the
|
|
47
|
+
/// attempt's log carries the `repair-run` entry naming it, and **`attempt-opened` fires no second time for it,
|
|
48
|
+
/// because a repair is not a new act** (`tests/e2e/repair-in-commit.test.mjs` prints both).
|
|
49
|
+
///
|
|
50
|
+
/// **AND THE TWO HALVES `D-45` MARKED AS OWNERS ARE UN-MARKED HERE, BY NAME**: this file's arm (b) and
|
|
51
|
+
/// `kernel-registration.mjs`'s state `3` invoked the repair body through the entry's `externalCall`, which names
|
|
52
|
+
/// nothing and is therefore the OPENS arm; the body is now reached through the channel with the commit at its
|
|
53
|
+
/// second position. **A REPAIR IS NOT EXTERNAL CODE CLAIMING A COMMIT OF ITS OWN — IT IS PART OF THE ATTEMPT
|
|
54
|
+
/// BEING TRACKED**, which is the one thing `D-45`'s authorship rule had wrong (`D-46` item `2`).
|
|
55
|
+
///
|
|
56
|
+
/// **THE KEY IS A `Symbol.for` SPELLING AND NEITHER SIDE IMPORTS THE OTHER** (`kernel-surface.md §1` item 1's
|
|
57
|
+
/// empty import footprint; the device `COMMIT_SCOPE` and `RESTART_DRAIN` are declared under above), **NO MEMBER
|
|
58
|
+
/// IS ADDED TO ANY RECORD AND NONE TO THE PRODUCT** (`A117` (D6)), and **no kernel item is minted** (`§1`
|
|
59
|
+
/// item 2: `K-1`–`K-6` and no seventh name). **A STORE THAT CARRIES NO SUCH CHANNEL ANSWERS THE INVOCATION WITH
|
|
60
|
+
/// NOTHING NAMED**, so the repair's write opens its own commit — the rule's absent arm and the conservative
|
|
61
|
+
/// side, never a commit nobody named.
|
|
62
|
+
const EXTERNAL_CALL = Symbol.for('provident-storeroom.external-call');
|
|
63
|
+
|
|
64
|
+
/// **THE INVOCATION OF A REPAIR BODY, WITH THE ATTEMPT'S COMMIT NAMED ON ITS ENTRY** — one call, its answer the
|
|
65
|
+
/// body's own, and a throwable crosses unchanged.
|
|
66
|
+
function repairInCommit(store, commit, run) {
|
|
67
|
+
const channel = store !== null && typeof store === 'object' ? store[EXTERNAL_CALL] : undefined;
|
|
68
|
+
if (typeof channel === 'function') return channel(run, commit);
|
|
69
|
+
return run();
|
|
70
|
+
}
|
|
71
|
+
|
|
7
72
|
export function runAttempt(store, commitRecord) {
|
|
73
|
+
// THE SEAM, READ BEFORE ANY STATE MOVES: **a store this package did not build carries no such channel, so it
|
|
74
|
+
// is not this package's store and no pass of this kernel may run against it.** The refusal is thrown BEFORE
|
|
75
|
+
// `status` moves, before an entry is appended and before a body is invoked, so a caller's attempt stands
|
|
76
|
+
// exactly as it stood and nothing is evaluated outside a commit.
|
|
77
|
+
const scope = store !== null && typeof store === 'object' ? store[COMMIT_SCOPE] : undefined;
|
|
78
|
+
if (typeof scope !== 'function') {
|
|
79
|
+
refuse(KC.arg,
|
|
80
|
+
'the store this constraint attempt would be run against carries no commit-scope channel, so there is no '
|
|
81
|
+
+ 'open commit a constraint could be checked in',
|
|
82
|
+
[]);
|
|
83
|
+
}
|
|
84
|
+
// **THE PASS, ITS WHOLE TERMINAL ACT AND THE RESTART, ALL TAKEN INSIDE THE ONE COMMIT WINDOW** — and the
|
|
85
|
+
// drain is reached ONLY where the pass answered a report: a failing pass throws out of the thunk below, so
|
|
86
|
+
// `D-42` item `2`'s *"the restart runs on the passing arm of the terminal call alone"* is now the shape of
|
|
87
|
+
// this function rather than a `catch` in a caller.
|
|
88
|
+
// **⟶ AND THE SCOPE IS HANDED THE PASS'S OWN COMMIT, 2026-10-27 (`D-46`): THE NAME IS THE RECORD `K-2` BUILT,
|
|
89
|
+
// so the pass's window JOINS the commit the attempt is tracked in** on the production path (the caller's
|
|
90
|
+
// `write` opened it and its kernel leg joined it) **and OPENS the one commit the pass owes** where nothing is
|
|
91
|
+
// open — a direct `K-2`/`K-3` drive, `D-44`'s window. **NO COUNT IS MINTED EITHER WAY**: the channel is
|
|
92
|
+
// `openCommit`/`closeCommit` composed, and the count moves only where this call's own opening is the one that
|
|
93
|
+
// took it.
|
|
94
|
+
return scope(() => {
|
|
95
|
+
const report = passInCommitScope(store, commitRecord);
|
|
96
|
+
return drainRestart(store, report);
|
|
97
|
+
}, commitRecord);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/// **THE DRAIN, TAKEN INSIDE THE SCOPE THE PASS JUST ENDED IN.** It hands the store **the report the pass
|
|
101
|
+
/// answered with** and answers the report the kernel returns: unchanged where no request stood or the
|
|
102
|
+
/// restarted check passed, and amended — `outcome` `'failed'` and the refusal's entry in the log — where the
|
|
103
|
+
/// restarted check refused. **THE REFUSAL IS NOT THROWN OUT OF HERE**: it is a later check's, not this pass's,
|
|
104
|
+
/// and a driver that is not the entry (a direct `K-3`) learns it from the report. `constraintWrite` — the
|
|
105
|
+
/// entry — is the frame that refuses on the write's path, with the very value the report carries.
|
|
106
|
+
///
|
|
107
|
+
/// **A STORE THAT CARRIES NO DRAIN CHANNEL ANSWERS ITS REPORT UNCHANGED**, which is also a store no pass of
|
|
108
|
+
/// this package could have raised a request on: the channel is installed by the same seam the scope above is.
|
|
109
|
+
function drainRestart(store, report) {
|
|
110
|
+
const drain = store !== null && typeof store === 'object' ? store[RESTART_DRAIN] : undefined;
|
|
111
|
+
if (typeof drain !== 'function') return report;
|
|
112
|
+
return drain(report);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/// **THE PASS AND ITS WHOLE TERMINAL ACT, TAKEN INSIDE THE COMMIT WINDOW `D-44` REQUIRES.** The scope covers
|
|
116
|
+
/// everything a check reaches — the landing's pass, every re-run, the residue's delivery and the `file`-tier save
|
|
117
|
+
/// — so a body of a delivered set, a repair and a pair body are all invoked in a window. **ON THE PRODUCTION PATH
|
|
118
|
+
/// THE SCOPE JOINS THE VERB'S OWN COMMIT AND MOVES NOTHING** (`state.mjs`'s `openCommit` answers `false` where the
|
|
119
|
+
/// count already stands above zero, which is `§4.1`'s join rule); **on a DIRECT `K-2`/`K-3` DRIVE IT OPENS THE ONE
|
|
120
|
+
/// THE PASS OWES AND CLOSES ONLY THAT**, so the state *"no open commit, one open attempt"* — `D-44`'s direct-pass
|
|
121
|
+
/// window — no longer exists on any path.
|
|
122
|
+
function passInCommitScope(store, commitRecord) {
|
|
8
123
|
const kernel = kernelFor(store);
|
|
9
124
|
const id = commitAttemptIdOf(commitRecord);
|
|
10
125
|
const attempt = kernel.live.get(id);
|
|
@@ -29,7 +144,7 @@ export function runAttempt(store, commitRecord) {
|
|
|
29
144
|
if (attempt.status === 'running') {
|
|
30
145
|
// THE RE-ENTRANT `K-3`, refused by the SAME `KC-7` member a live address answers with.
|
|
31
146
|
refuse(KC.attemptOpen,
|
|
32
|
-
`the constraint attempt at ${
|
|
147
|
+
`the constraint attempt at ${addressSpelling(attempt.address)} is already running`, []);
|
|
33
148
|
}
|
|
34
149
|
|
|
35
150
|
attempt.status = 'running';
|
|
@@ -127,7 +242,7 @@ export function runAttempt(store, commitRecord) {
|
|
|
127
242
|
terminal(kernel, attempt, KC.violated,
|
|
128
243
|
typeof saveFailure.message === 'string'
|
|
129
244
|
? saveFailure.message
|
|
130
|
-
: `the attempt's own save at ${
|
|
245
|
+
: `the attempt's own save at ${addressSpelling(attempt.address)} failed`);
|
|
131
246
|
throw saveFailure;
|
|
132
247
|
}
|
|
133
248
|
// **THE `commit` ENTRY: THE ATTEMPT'S SUCCESS ARM, APPENDED ONCE, ON THIS ARM ALONE**
|
|
@@ -143,7 +258,7 @@ export function runAttempt(store, commitRecord) {
|
|
|
143
258
|
// before this line and reach this attempt's log by no act (`§2.7` item 6), the record this attempt's
|
|
144
259
|
// report carries being the same list this line closes.
|
|
145
260
|
append(attempt, 'commit', null, attempt.ops[attempt.ops.length - 1].opId,
|
|
146
|
-
`every constraint registered at ${
|
|
261
|
+
`every constraint registered at ${addressSpelling(attempt.address)} passed; the commit stands`);
|
|
147
262
|
return closed;
|
|
148
263
|
}
|
|
149
264
|
|
|
@@ -272,7 +387,15 @@ function evaluate(kernel, attempt, landing) {
|
|
|
272
387
|
const check = attempt.log[attempt.log.length - 1];
|
|
273
388
|
let outcome;
|
|
274
389
|
try {
|
|
275
|
-
|
|
390
|
+
// **⟶ AND THE BODY IS INVOKED WITH NOTHING NAMED, 2026-10-27 (`D-45`, `D-46` item `1`).** A constraint
|
|
391
|
+
// body is EXTERNALLY-SUPPLIED FUNCTION code entering the surface, **and it has no commit in hand to
|
|
392
|
+
// name** — it is handed the five-member `AttemptContext` and no commit at all (`kernel-surface.md §2.3`
|
|
393
|
+
// item 1) — so **a verb it calls OPENS ITS OWN COMMIT** rather than joining the one this pass runs in:
|
|
394
|
+
// *"It should be opening a new commit by default of entering at the surface"*. **THE NAME IS AN
|
|
395
|
+
// INVOCATION'S AND NOTHING ELSE'S**: it is set before the call and restored after it, on the throwing arm
|
|
396
|
+
// too, and the kernel's own acts of this pass name the pass's commit through `COMMIT_SCOPE` — so an
|
|
397
|
+
// ordinary write still opens ONE commit and a callback's verb is still an act of its own.
|
|
398
|
+
outcome = externalCall(attempt.store, () => pair.constraint(context));
|
|
276
399
|
} catch (body) {
|
|
277
400
|
// A body that threw returned nothing, so no `constraint-check` entry stands and the attempt is
|
|
278
401
|
// closed (`PAR-C-6`; `NX-2`; `composition-and-states.md §2.7` item 13).
|
|
@@ -300,7 +423,7 @@ function evaluate(kernel, attempt, landing) {
|
|
|
300
423
|
let text;
|
|
301
424
|
let repair = null;
|
|
302
425
|
if (outcome === true) {
|
|
303
|
-
text = `the constraint ${pair.id} passed at ${
|
|
426
|
+
text = `the constraint ${pair.id} passed at ${addressSpelling(attempt.address)}`;
|
|
304
427
|
} else if (outcome !== null && typeof outcome === 'object' && Object.hasOwn(outcome, 'message')) {
|
|
305
428
|
const outcomeMessage = ownMember(outcome, 'message');
|
|
306
429
|
text = typeof outcomeMessage === 'string' && outcomeMessage.length > 0
|
|
@@ -367,13 +490,12 @@ function evaluate(kernel, attempt, landing) {
|
|
|
367
490
|
append(attempt, 'repair-run', pair.id, op.opId, 'the pair\'s repair was attempted');
|
|
368
491
|
const entry = attempt.log[attempt.log.length - 1];
|
|
369
492
|
let result;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
value: context.value,
|
|
493
|
+
const repairContext = {
|
|
494
|
+
address: attempt.address.slice(),
|
|
495
|
+
id: pair.id,
|
|
496
|
+
op,
|
|
497
|
+
tier: context.tier,
|
|
498
|
+
value: context.value,
|
|
377
499
|
// **⟶ ADDED 2026-10-15 (`surface.md §2.11` clause 6; the architect's ruling of 2026-10-15;
|
|
378
500
|
// `kernel-surface.md §2.3` item 2).** **THE REPAIR IS PASSED THE COMMIT IT IS PART OF**, and it is
|
|
379
501
|
// passed THE ONE OBJECT THIS CALL HANDS IT — the context itself — *"so that they can make their
|
|
@@ -394,7 +516,20 @@ function evaluate(kernel, attempt, landing) {
|
|
|
394
516
|
// THE DECLARED FIVE IS MOVED**: `address` · `id` · `op` · `tier` · `value` stand as `§2.3` item 2
|
|
395
517
|
// prints them, and the commit is carried beside them.
|
|
396
518
|
pending: attempt.record === undefined ? [] : attempt.record.pending.slice(),
|
|
397
|
-
|
|
519
|
+
};
|
|
520
|
+
try {
|
|
521
|
+
// **⟶ RE-DERIVED 2026-10-27 — THE REPAIR BODY NAMES THE ATTEMPT'S COMMIT AND IS NO LONGER MARKED AS AN
|
|
522
|
+
// OWNER OF ITS OWN (`D-46` item `2`).** `D-45` invoked it through the entry's `externalCall`, so the
|
|
523
|
+
// write it made OPENED a second commit and the commit's own record no longer described the repair it
|
|
524
|
+
// performed. **THE RULING, VERBATIM: *"A constraint's repair needs to stay as part of the same commit so
|
|
525
|
+
// that it can be tracked as part of the commit process"*** — **so `repairInCommit` above hands the
|
|
526
|
+
// channel THE ATTEMPT'S OWN RECORD as the invocation's name, and the repair's write JOINS the commit it
|
|
527
|
+
// is part of.** **THE REPAIR'S CONTEXT CARRIES THAT SAME COMMIT AT ITS `pending` MEMBER** — the vehicle
|
|
528
|
+
// `surface.md §2.11` clause 6 declares, *"so that they can make their own write call use that commit"* —
|
|
529
|
+
// so a repair that supplies it at `write`'s fourth position names the same commit by its own hand, and
|
|
530
|
+
// the two spellings cannot disagree: **the entry's position wins where it is supplied, and this name is
|
|
531
|
+
// the fallback where it is not** (`state.mjs`'s `openCommit`).
|
|
532
|
+
result = repairInCommit(attempt.store, attempt.record, () => repair(repairContext));
|
|
398
533
|
} catch (body) {
|
|
399
534
|
// THE REPAIR-RUN ENTRY IS APPENDED BEFORE THE THROW, and the attempt's outcome entry carries
|
|
400
535
|
// `KC-4` (`ck_states_a_repair_body_that_throws_reaches_the_caller_unconverted`).
|
|
@@ -477,7 +612,7 @@ function evaluate(kernel, attempt, landing) {
|
|
|
477
612
|
: okMember === false
|
|
478
613
|
&& typeof messageMember === 'string' && messageMember.length > 0
|
|
479
614
|
? messageMember
|
|
480
|
-
: `the repair ${pair.id} produced no op at ${
|
|
615
|
+
: `the repair ${pair.id} produced no op at ${addressSpelling(attempt.address)}`;
|
|
481
616
|
entry.message = carried;
|
|
482
617
|
return { terminal: { status: KC.repairFailed, message: carried }, rerun: false };
|
|
483
618
|
}
|
|
@@ -622,6 +757,6 @@ function publishCheckedOff(attempt) {
|
|
|
622
757
|
* read off a member the row really holds, and no member of the sentence moves. */
|
|
623
758
|
function unrecognized(pair) {
|
|
624
759
|
return `the constraint ${pair.id} returned a value outside the three declared outcome arms at `
|
|
625
|
-
+ `${
|
|
760
|
+
+ `${addressSpelling(pair.addresses[0])}`;
|
|
626
761
|
}
|
|
627
762
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `D-13` (`docs/L1/kernel-subdivision.md` §1 part `9c`) — the commit act: bytes moved from `bindings/js/src/constraint-kernel.mjs`; no logic changed.
|
|
2
|
-
import { KC, refuse, inDomainAddress, kernelFor, attemptHeldAt, appendOwn } from './kernel-foundations.mjs';
|
|
2
|
+
import { KC, refuse, inDomainAddress, kernelFor, attemptHeldAt, appendOwn, addressSpelling } from './kernel-foundations.mjs';
|
|
3
3
|
// ---------------------------------------------------------------------------------------------
|
|
4
4
|
// `K-2` `commit(store, address, tier, value) -> CommitRecord`
|
|
5
5
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -20,7 +20,7 @@ export function commit(store, address, tier, value) {
|
|
|
20
20
|
// HELD address WITHIN the instance is refused exactly as it stood. **THE ADDRESS COMPARISON ITSELF IS UNMOVED.**
|
|
21
21
|
if (held && attemptHeldAt(kernel, address)) {
|
|
22
22
|
refuse(KC.attemptOpen,
|
|
23
|
-
`a constraint attempt is already open at ${
|
|
23
|
+
`a constraint attempt is already open at ${addressSpelling(address)}; it is disposed of by its own `
|
|
24
24
|
+ 'K-3 and by no other act',
|
|
25
25
|
[]);
|
|
26
26
|
}
|
|
@@ -316,8 +316,32 @@ export function inDomainId(id) {
|
|
|
316
316
|
* being the tuple.
|
|
317
317
|
*/
|
|
318
318
|
export function pairSpelling(pair, address) {
|
|
319
|
-
return `${(address === undefined ? pair.addresses[0] : address).
|
|
320
|
-
|
|
319
|
+
return `${addressSpelling(address === undefined ? pair.addresses[0] : address)}#${pair.id}`;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* **THE ADDRESS, SPELLED FOR THE KERNEL'S OWN SENTENCES — ONE RENDERING, DECLARED ONCE, AND THIS IS IT.**
|
|
324
|
+
*
|
|
325
|
+
* **`D-48`'s `DEF-AB` ROW IS THE MEASUREMENT THIS FUNCTION CLOSES: THE SAME ADDRESS WAS PRINTED TWO WAYS
|
|
326
|
+
* ACROSS TWO MESSAGES OF ONE RECORD.** `pairSpelling` above spells an address's segments joined by `/`
|
|
327
|
+
* (`a/b#x`); every other sentence the kernel built spelled the very same address through
|
|
328
|
+
* `JSON.stringify(address)` — `["a"]` — so one attempt's log carried *"the constraint `x` passed at
|
|
329
|
+
* `["a"]`"* beside *"the pair `a#x` violated a re-run …"*. **THE `DEF-Q` DEFECT CLASS AT ANOTHER SITE**, and
|
|
330
|
+
* the rendering that fixes it is the one `pairSpelling` already carried: **the address's segments joined by
|
|
331
|
+
* `/`, and never a JSON array.** There is now ONE spelling, ONE home, and both readers take it here.
|
|
332
|
+
*
|
|
333
|
+
* **IT TAKES THE SEGMENTS AS THE REGISTRY ROW AND THE JOURNAL OP CARRY THEM** — strings and non-negative
|
|
334
|
+
* integers — and renders a segment through `String` alone, exactly as `pairSpelling` always has: **no
|
|
335
|
+
* quoting, no bracketing and no second escaping rule is introduced, and no member of any sentence moves.**
|
|
336
|
+
* A local index loop is used, so no `Array.prototype.map`/`join` is read off a mutable prototype on a refusal
|
|
337
|
+
* path (`contract.md §2.1`'s clause of 2026-10-24 on `F7-1`).
|
|
338
|
+
*/
|
|
339
|
+
export function addressSpelling(address) {
|
|
340
|
+
let spelled = '';
|
|
341
|
+
for (let position = 0; position < address.length; position += 1) {
|
|
342
|
+
spelled += position === 0 ? `${String(address[position])}` : `/${String(address[position])}`;
|
|
343
|
+
}
|
|
344
|
+
return spelled;
|
|
321
345
|
}
|
|
322
346
|
|
|
323
347
|
/// **⟶ DELETED 2026-10-24 (`D-29`): `pairRowCarrying` HAD NO SUBJECT LEFT.** Its doc read: *"THE ROW A PAIR
|
|
@@ -478,6 +502,73 @@ export function kernelFor(store) {
|
|
|
478
502
|
return kernel;
|
|
479
503
|
}
|
|
480
504
|
|
|
505
|
+
// ---------------------------------------------------------------------------------------------
|
|
506
|
+
// ⟶ `D-45`'S MARKER, SPELLED ON THIS SIDE TOO — 2026-10-27
|
|
507
|
+
//
|
|
508
|
+
// **THE RULING IS THE ARCHITECT'S, VERBATIM: *"For 43, how is a listener supposed to be able to reuse the outer
|
|
509
|
+
// verb's commit? The listener is an externally-passed function and should be making calls at the package
|
|
510
|
+
// surface. It should be opening a new commit by default of entering at the surface"*** (`strata/decisions.md` ·
|
|
511
|
+
// `D-45`). **SO A CALL ENTERING THE SURFACE FROM AN EXTERNALLY-SUPPLIED FUNCTION OPENS A NEW COMMIT BY DEFAULT,
|
|
512
|
+
// AND ONLY THE PACKAGE'S OWN INTERNAL CONTINUATION JOINS.** The marker's implementation is `state.mjs`'s — the
|
|
513
|
+
// depth, the per-window record and the join rule are that file's — and THIS module reaches it the way it reaches
|
|
514
|
+
// every entry side: **a `Symbol.for` key, spelled on both sides, neither side importing the other**
|
|
515
|
+
// (`kernel-surface.md §1` item 1's empty import footprint; `A110`; the same device `SETTLED_ON_THE_PASSING_ARM`,
|
|
516
|
+
// `TERMINAL_ARM` and `COMMIT_SCOPE` cross this boundary by).
|
|
517
|
+
//
|
|
518
|
+
// **AND WHAT THIS MODULE OWES IT IS THE SITES: THE THREE FRAMES THAT INVOKE A CALLER-AUTHORED CONSTRAINT BODY**
|
|
519
|
+
// (`registrationEvaluation`, `registrationRerun`, `kernel-attempt.mjs`'s `evaluate`) **AND THE ONE THAT INVOKES
|
|
520
|
+
// A REPAIR BODY** (`kernel-attempt.mjs`'s arm (b) and `kernel-registration.mjs`'s state 3). **IT MARKS NOTHING
|
|
521
|
+
// ELSE**: a store verb the kernel calls, a record it appends and a crossing it takes are the package's own acts
|
|
522
|
+
// and run at the depth the enclosing commit was opened at, which is what keeps an ordinary write's count at
|
|
523
|
+
// ONE for its whole length. **A STORE THAT CARRIES NO SUCH CHANNEL ANSWERS THE INVOCATION UNMARKED** (the
|
|
524
|
+
// `state.mjs` fallback, byte for byte): a store this package never installed the seam on, whose call then joins
|
|
525
|
+
// as it joined before `D-45` — the conservative side, and never a commit the mark did not ask for.
|
|
526
|
+
//
|
|
527
|
+
// **⟶ AMENDED 2026-10-27 — THE COMMIT A CALL NAMES DECIDES, AND AUTHORSHIP IS ONLY THE FALLBACK WHERE NONE CAN BE
|
|
528
|
+
// NAMED (`D-46`).** **The clause above — *"A CALL ENTERING THE SURFACE FROM AN EXTERNALLY-SUPPLIED FUNCTION OPENS
|
|
529
|
+
// A NEW COMMIT BY DEFAULT, AND ONLY THE PACKAGE'S OWN INTERNAL CONTINUATION JOINS"* — stands BYTE-FOR-BYTE and is
|
|
530
|
+
// read THROUGH this one**, which states the operative rule and names the one sentence of that clause the shipped
|
|
531
|
+
// tree no longer implements. **THE ARCHITECT, VERBATIM: *"A listener should be operating at the surface and opening a
|
|
532
|
+
// new commit"* · *"A constraint's repair needs to stay as part of the same commit so that it can be tracked as
|
|
533
|
+
// part of the commit process"* · *"The original way of maintaining this was to accept an optional parameter on
|
|
534
|
+
// entry for the commit id, so that a constraint can identify which open commit it is repairing"***
|
|
535
|
+
// (`strata/decisions.md` · `D-46`). **SO: A CALL THAT NAMES A COMMIT ON ITS OWN ENTRY JOINS THAT COMMIT, AND A
|
|
536
|
+
// CALL THAT NAMES NONE OPENS A NEW ONE.** **THE POSITION IS `write`'s FOURTH**, whose domain is a RECORD (an object
|
|
537
|
+
// carrying an own, present `pending`) and never an id token; **and where the package itself invokes caller code,
|
|
538
|
+
// the name is the one that invocation was handed** (`state.mjs`'s `EXTERNAL_COMMIT`): **the kernel names the
|
|
539
|
+
// attempt's commit when it invokes a REPAIR, and names nothing when it invokes a listener body or a constraint
|
|
540
|
+
// body.** **AUTHORSHIP — THE MARK THIS BLOCK DECLARES — IS THE FALLBACK OF THE FALLBACK: it decides ONLY where
|
|
541
|
+
// neither position stands** (`state.mjs`'s `openCommit` reads the entry's name first, the invocation's name
|
|
542
|
+
// second, and the depth mark only where neither exists).
|
|
543
|
+
//
|
|
544
|
+
// **AND THE SITES SENTENCE ABOVE IS CORRECTED AT ITS REPAIR-BODY HALF, BY NAME.** The two frames that invoke a
|
|
545
|
+
// REPAIR body — `kernel-attempt.mjs`'s arm (b) and `kernel-registration.mjs`'s state 3 — **NO LONGER CALL THIS
|
|
546
|
+
// MODULE'S `externalCall`**: each reaches the same `Symbol.for` channel at its SECOND position with the attempt's
|
|
547
|
+
// commit named (that file's own local `repairInCommit`, the same key spelled again), because **A REPAIR IS NOT AN
|
|
548
|
+
// ACT AT THE SURFACE CLAIMING A COMMIT OF ITS OWN — IT IS PART OF THE ATTEMPT BEING TRACKED**, so the write its
|
|
549
|
+
// body makes must join the attempt's window and the attempt's record must describe the repair it performed. **THE
|
|
550
|
+
// THREE FRAMES THAT INVOKE A CALLER-AUTHORED CONSTRAINT BODY STILL CALL `externalCall`, WHICH NAMES NOTHING AND
|
|
551
|
+
// IS THEREFORE THE OPENS ARM** (`registrationEvaluation`, `registrationRerun`, and `kernel-attempt.mjs`'s
|
|
552
|
+
// `evaluate`), **and *"IT MARKS NOTHING ELSE"* STANDS**: what moved is the answer this module's one call site
|
|
553
|
+
// gives, not the set of frames it is reached from. **A STORE THAT CARRIES NO SUCH CHANNEL STILL ANSWERS THE
|
|
554
|
+
// INVOCATION UNMARKED** — `run()` at this frame, and a repair's own write then opening its own commit — which is
|
|
555
|
+
// the rule's absent arm and never a commit nobody named.
|
|
556
|
+
// ---------------------------------------------------------------------------------------------
|
|
557
|
+
const EXTERNAL_CALL = Symbol.for('provident-storeroom.external-call');
|
|
558
|
+
|
|
559
|
+
/// **THE INVOCATION OF A CALLER-SUPPLIED FUNCTION, THROUGH THE CHANNEL** — one argument, the thunk that makes
|
|
560
|
+
/// the call; the answer is the invocation's own and a throwable crosses unchanged. **AND IT NAMES NO COMMIT, ON
|
|
561
|
+
/// PURPOSE: A CALL THROUGH THIS HELPER IS `D-46`'S ABSENT ARM.** A caller-authored constraint body is handed a
|
|
562
|
+
/// context carrying no commit (`kernel-surface.md §2.3` item 1) and a listener body is handed the triggering
|
|
563
|
+
/// address and nothing else, so neither has a name to supply and the call opens its own commit. **A REPAIR is
|
|
564
|
+
/// the one invocation that DOES have a name, and it is made by the invoking file's own channel call at the second
|
|
565
|
+
/// position — never here** (`D-46` item 2; the amendment beside this block above).
|
|
566
|
+
export function externalCall(store, run) {
|
|
567
|
+
const channel = store !== null && typeof store === 'object' ? store[EXTERNAL_CALL] : undefined;
|
|
568
|
+
if (typeof channel === 'function') return channel(run);
|
|
569
|
+
return run();
|
|
570
|
+
}
|
|
571
|
+
|
|
481
572
|
// ---------------------------------------------------------------------------------------------
|
|
482
573
|
// THE LAWFUL APPEND — ADDED 2026-10-25 ON THE BLIND PASS'S `F8-2` WRITE VECTOR, AND IT IS A LOCAL COPY ON
|
|
483
574
|
// PURPOSE: THIS MODULE'S OWN HEADER DECLARES AN EMPTY IMPORT FOOTPRINT (`§1` item 1; `A110`), so the kernel
|
|
@@ -636,7 +727,7 @@ export function landedOp(attempt, returned, invokedFor) {
|
|
|
636
727
|
* — and never the attempt's address alone.
|
|
637
728
|
*/
|
|
638
729
|
export function landedOpDefect(attempt, pair, returned) {
|
|
639
|
-
const where =
|
|
730
|
+
const where = addressSpelling(attempt.address);
|
|
640
731
|
// **⟶ THE MEMBER IS READ AS THE RETURN'S OWN HERE TOO** (`D-35`'s read half): the arm that names *"carried no
|
|
641
732
|
// op"* and the arm that spells the op must agree with `landedOp`'s own answer, and a chain read would let a
|
|
642
733
|
// prototype decide which of the two sentences the caller is handed.
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
// `D-13` (`docs/L1/kernel-subdivision.md` §1 part `9b`) — the registration act, its evaluation, and the registry's removal: bytes moved from `bindings/js/src/constraint-kernel.mjs`; no logic changed.
|
|
2
|
-
import { KC, KERNEL_REFUSAL, markBodyThrow, refuse, inDomainAddress, inDomainId, pairRowAt, sameAddress, kernelFor, append, appendOwn, landedOp, pairsAtAddress } from './kernel-foundations.mjs';
|
|
2
|
+
import { KC, KERNEL_REFUSAL, markBodyThrow, refuse, inDomainAddress, inDomainId, pairRowAt, sameAddress, kernelFor, append, appendOwn, landedOp, pairsAtAddress, externalCall } from './kernel-foundations.mjs';
|
|
3
|
+
|
|
4
|
+
/// **⟶ ADDED 2026-10-27 — `D-46`'s NAME ON A REPAIR INVOCATION'S OWN ENTRY, SPELLED HERE AS
|
|
5
|
+
/// `kernel-attempt.mjs` SPELLS IT.** **THE RULING, THE ARCHITECT, VERBATIM: *"A constraint's repair needs to stay
|
|
6
|
+
/// as part of the same commit so that it can be tracked as part of the commit process … The original way of
|
|
7
|
+
/// maintaining this was to accept an optional parameter on entry for the commit id, so that a constraint can
|
|
8
|
+
/// identify which open commit it is repairing"*** (`strata/decisions.md` · `D-46`). **SO STATE `3`'S REPAIR NAMES
|
|
9
|
+
/// THE SYNTHETIC ATTEMPT'S OWN COMMIT** — the record `3-bis` (a) declares *"the `CommitRecord` of the
|
|
10
|
+
/// registration act"*, which is the same object the repair's context carries at its `pending` member — **and the
|
|
11
|
+
/// write that repair body makes JOINS it instead of opening a second**: the op it lands is the synthetic
|
|
12
|
+
/// attempt's op, and the commit the registration opened still describes the repair it performed.
|
|
13
|
+
///
|
|
14
|
+
/// **AND `D-45`'S MARKING OF THIS SITE IS UN-MARKED BY NAME.** This frame invoked the repair body through the
|
|
15
|
+
/// entry's `externalCall`, which names nothing and is therefore the OPENS arm; `D-46` item `2` reverses it: **a
|
|
16
|
+
/// repair is part of the attempt being tracked and is not external code claiming a commit of its own.**
|
|
17
|
+
///
|
|
18
|
+
/// **THE KEY IS A `Symbol.for` SPELLING AND NEITHER SIDE IMPORTS THE OTHER** (`kernel-surface.md §1` item 1's
|
|
19
|
+
/// empty import footprint; the device `COMMIT_SCOPE` and `RESTART_DRAIN` cross by), **NO MEMBER IS ADDED TO ANY
|
|
20
|
+
/// RECORD AND NONE TO THE PRODUCT** (`A117` (D6)), and **no kernel item is minted** (`§1` item 2). **A STORE THAT
|
|
21
|
+
/// CARRIES NO SUCH CHANNEL ANSWERS THE INVOCATION WITH NOTHING NAMED**, and the repair's write opens its own
|
|
22
|
+
/// commit — the rule's absent arm, never a commit nobody named.
|
|
23
|
+
const EXTERNAL_CALL = Symbol.for('provident-storeroom.external-call');
|
|
24
|
+
|
|
25
|
+
/// **THE INVOCATION OF A REPAIR BODY, WITH THE SYNTHETIC ATTEMPT'S COMMIT NAMED ON ITS ENTRY** — one call, its
|
|
26
|
+
/// answer the body's own, and a throwable crosses unchanged. **THE SECOND COPY OF THE FIVE-LINE FORM
|
|
27
|
+
/// `kernel-attempt.mjs` DECLARES**, because the two part files share no import and neither may reach the entry
|
|
28
|
+
/// (`kernel-surface.md §1` item 1) or the other's private bytes.
|
|
29
|
+
function repairInCommit(store, commit, run) {
|
|
30
|
+
const channel = store !== null && typeof store === 'object' ? store[EXTERNAL_CALL] : undefined;
|
|
31
|
+
if (typeof channel === 'function') return channel(run, commit);
|
|
32
|
+
return run();
|
|
33
|
+
}
|
|
3
34
|
// ---------------------------------------------------------------------------------------------
|
|
4
35
|
// `K-1` `register(store, address, id, constraint) -> Handle`
|
|
5
36
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -223,8 +254,15 @@ function registrationEvaluation(kernel, store, address, id, constraint) {
|
|
|
223
254
|
// `registrationCrossing` converts A MARKED VALUE ONLY into this surface's one failure form, and an
|
|
224
255
|
// unmarked throw is still the caller's own (`markBodyThrow`, `kernel-foundations.mjs`).
|
|
225
256
|
let outcome;
|
|
257
|
+
const context = registrationContext(store, address, null);
|
|
226
258
|
try {
|
|
227
|
-
|
|
259
|
+
// **⟶ AND THE BODY IS INVOKED WITH NOTHING NAMED, 2026-10-27 (`D-45`, `D-46` item `1`).** A constraint body
|
|
260
|
+
// is EXTERNALLY-SUPPLIED FUNCTION code entering the surface **and it has no commit in hand to name** — its
|
|
261
|
+
// five-member context carries none (`kernel-surface.md §2.3` item 1) — so **a verb it calls OPENS ITS OWN
|
|
262
|
+
// COMMIT** rather than joining the registering verb's (*"It should be opening a new commit by default of
|
|
263
|
+
// entering at the surface"*). **THE CONTEXT IS BUILT ABOVE THE INVOCATION**, so the store read the context
|
|
264
|
+
// owes is this verb's own act and not the body's.
|
|
265
|
+
outcome = externalCall(store, () => constraint(context));
|
|
228
266
|
} catch (body) {
|
|
229
267
|
throw markBodyThrow(body, address, null);
|
|
230
268
|
}
|
|
@@ -378,8 +416,19 @@ function registrationAttempt(kernel, store, pair) {
|
|
|
378
416
|
append(attempt, 'repair-run', pair.id, null, 'the pair\'s repair was attempted at registration');
|
|
379
417
|
|
|
380
418
|
let result;
|
|
419
|
+
const repairContext = registrationRepairContext(store, address, pair.id, attempt.commit);
|
|
381
420
|
try {
|
|
382
|
-
|
|
421
|
+
// **⟶ RE-DERIVED 2026-10-27 — STATE `3`'S REPAIR NAMES THE SYNTHETIC ATTEMPT'S COMMIT AND IS NO LONGER
|
|
422
|
+
// MARKED AS AN OWNER OF ITS OWN (`D-46` item `2`).** `D-45` invoked it through the entry's `externalCall`,
|
|
423
|
+
// so the write it made OPENED a second commit and the registration act's own commit record no longer
|
|
424
|
+
// described the repair it performed. **THE RULING: *"A constraint's repair needs to stay as part of the same
|
|
425
|
+
// commit so that it can be tracked as part of the commit process"*** — so `repairInCommit` hands the channel
|
|
426
|
+
// **the record `3-bis` (a) declares as *"the `CommitRecord` of the registration act"***, **which is the very
|
|
427
|
+
// object `registrationRepairContext` copy-carries at the repair's `pending` member**: a repair that supplies
|
|
428
|
+
// that context at `write`'s fourth position names the same commit by its own hand, and the two spellings
|
|
429
|
+
// cannot disagree (the entry's position wins where it is supplied, and the invocation's name is the fallback
|
|
430
|
+
// where it is not — `state.mjs`'s `openCommit`).
|
|
431
|
+
result = repairInCommit(store, attempt.commit, () => pair.repair(repairContext));
|
|
383
432
|
} catch (body) {
|
|
384
433
|
// A REPAIR WHOSE BODY THROWS IS A FAILED REPAIR AND THE REGISTRATION IS REFUSED — the caller's act is
|
|
385
434
|
// the registration, so the refusal is this module's one form (`3-bis` (d); the `KC` boundary at (e)).
|
|
@@ -444,14 +493,19 @@ function registrationRerun(kernel, attempt, produced) {
|
|
|
444
493
|
const pair = kernel.pairs.get(key);
|
|
445
494
|
if (pair === undefined) continue;
|
|
446
495
|
let outcome;
|
|
496
|
+
const context = {
|
|
497
|
+
address: attempt.address.slice(),
|
|
498
|
+
tier: produced.tier === undefined ? null : produced.tier,
|
|
499
|
+
value: produced.after === undefined ? undefined : produced.after.value,
|
|
500
|
+
attempt: attempt.ref,
|
|
501
|
+
op: produced,
|
|
502
|
+
};
|
|
447
503
|
try {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
op: produced,
|
|
454
|
-
});
|
|
504
|
+
// **⟶ AND THIS BODY IS INVOKED WITH NOTHING NAMED TOO, 2026-10-27 (`D-45`, `D-46` item `1`)** — the
|
|
505
|
+
// re-run's frame is the third of the three that invoke a caller-authored constraint body, and it names no
|
|
506
|
+
// commit exactly as the registration evaluation and the landing's pass do. The context is built ABOVE the
|
|
507
|
+
// invocation.
|
|
508
|
+
outcome = externalCall(attempt.store, () => pair.constraint(context));
|
|
455
509
|
} catch (body) {
|
|
456
510
|
// **⟶ ADDED 2026-10-26 (`DEF-S`, the same ruling): a body thrown at the synthetic attempt's re-run is
|
|
457
511
|
// marked at this frame too — the mark carries the attempt's own log and address, and the entry's
|