provident-storeroom 1.12.0 → 2.0.1
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 +234 -12
- package/README.md +24 -6
- package/RELEASE-NOTES.md +266 -1
- package/index.d.ts +271 -13
- package/index.mjs +78 -2095
- package/package.json +6 -6
- package/src/entry/addon-slot.mjs +484 -0
- package/src/entry/artefact-node.mjs +327 -0
- package/src/entry/artefact.mjs +55 -394
- package/src/entry/carrier.mjs +15 -6
- package/src/entry/class-decision.mjs +82 -18
- package/src/entry/class-instrument.mjs +186 -0
- package/src/entry/constraints.mjs +164 -11
- package/src/entry/delivery.mjs +658 -12
- package/src/entry/frame.mjs +125 -13
- package/src/entry/instance.mjs +2312 -0
- package/src/entry/kernel-attempt.mjs +5 -1
- package/src/entry/kernel-foundations.mjs +79 -2
- package/src/entry/kernel-loader.mjs +53 -0
- package/src/entry/kernel-registration.mjs +70 -5
- package/src/entry/kernel-terminal.mjs +91 -8
- package/src/entry/state.mjs +189 -21
package/index.d.ts
CHANGED
|
@@ -245,8 +245,37 @@ export interface StoreConfig {
|
|
|
245
245
|
* throws there refuses the act at rank `21` `ListenerBodyThrew`.
|
|
246
246
|
*/
|
|
247
247
|
readonly listeners: readonly unknown[];
|
|
248
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* The file the file tier is backed by, where one is declared (`PAR-JS-2`; ABSENT is in domain).
|
|
250
|
+
*
|
|
251
|
+
* **⟦ THIS MEMBER IS THE DECLARATION'S ONE REALM-CONDITIONAL BYTE** (`D-155` item 2; the marker's home is
|
|
252
|
+
* `docs/L3/wasm-realm/design.md` §6). **THE TWO COMMENT LINES THAT BRACKET THE MEMBER BELOW — both at this
|
|
253
|
+
* member's own two-space depth, and neither carrying a member's name-and-colon or name-and-paren shape —
|
|
254
|
+
* DELIMIT THE ONE REGION `scripts/emit-declarations.mjs` READS.** They are comment lines at that depth on
|
|
255
|
+
* purpose: neither the member read a battery file performs on this interface nor the `StoreStatus` union's
|
|
256
|
+
* census read can see them, so the marker stands in this file without moving a member census, a status
|
|
257
|
+
* count or a rank.
|
|
258
|
+
*
|
|
259
|
+
* **WHAT THE SCRIPT EMITS FROM THAT REGION: TWO DECLARATIONS, AND NO SECOND HAND-AUTHORED SURFACE.** The
|
|
260
|
+
* **NODE** arm's declaration is **this file's own bytes with the region unchanged** — the script asserts
|
|
261
|
+
* that identity byte for byte — and the **WASM** arm's is the same bytes with **exactly the region's body**
|
|
262
|
+
* replaced by `readonly filePath?: never;`. **So the WASM arm's emission replaces the region's body with
|
|
263
|
+
* `filePath?: never`** (`D-155` item 2), **and nothing outside the region differs between the two arms.**
|
|
264
|
+
*
|
|
265
|
+
* **AND THE MEMBER'S PRESENCE AND ITS OPTIONALITY ARE IDENTICAL ON BOTH ARMS.** `never` narrows the
|
|
266
|
+
* **value's** type; it does not remove the member, and it does not make the member required — `filePath` is
|
|
267
|
+
* a DECLARED and OPTIONAL member on either arm, and only a `string` supplied in that position is refused
|
|
268
|
+
* (as a compile error) on the WASM arm. **That is what keeps `StoreConfig`'s census cell byte-identical
|
|
269
|
+
* across the arms**: the six members read in the same order with the same optional markers, so one cell
|
|
270
|
+
* serves both emissions unchanged.
|
|
271
|
+
*
|
|
272
|
+
* **THE WASM ARM'S FILE PATH IS NOT DECLARED HERE**: a second package, a second artefact or a subpath is
|
|
273
|
+
* the publish shape's question (`D-4`; `wasm-realm.md §3(b)`, `SILENT` in this pass), so the script takes
|
|
274
|
+
* its output directory from its own argument and defaults to a build directory it creates.
|
|
275
|
+
*/
|
|
276
|
+
// ⟦realm:filePath:begin⟧
|
|
249
277
|
readonly filePath?: string;
|
|
278
|
+
// ⟦realm:filePath:end⟧
|
|
250
279
|
/**
|
|
251
280
|
* **⟶ ADDED 2026-10-15 (`parameter-semantics.md §2.21`; `surface.md §2.1`'s `cfg` block dated
|
|
252
281
|
* 2026-10-15; `contract.md §8.1` #16) — THE FOURTH DECLARED KEY: THE CONSTRUCTION'S CONSTRAINT LIST**,
|
|
@@ -316,6 +345,62 @@ export interface StoreConfig {
|
|
|
316
345
|
readonly id: string;
|
|
317
346
|
readonly constraint: Constraint;
|
|
318
347
|
}[];
|
|
348
|
+
/**
|
|
349
|
+
* **⟶ ADDED 2026-11-17 — `D-144` ITEM 1, VERBATIM: *"Change response to object, success(bool) and message
|
|
350
|
+
* (string[])"*** (`strata/decisions.md` · `D-144`), read with `D-153` item 2 (*"Add third arm"*) for the thenable's own
|
|
351
|
+
* arm. **THE CALLER'S OWN SAVER: the store's JSON image goes OUT here instead of to a file**, the one position is that
|
|
352
|
+
* image text, and the answer is the verdict `SC-2` was closed on — `success` is the verdict and `message` is the reason,
|
|
353
|
+
* **a LIST by declaration, so several messages are ONE answer**.
|
|
354
|
+
*
|
|
355
|
+
* **It is optional and its absence is the ordinary store** — absent, the `file` tier saves through the store's own
|
|
356
|
+
* writer exactly as it always did. **A non-function `saveCall` is broken config and is refused before any filesystem act**
|
|
357
|
+
* with the status a bad `cfg` already answers (`AddressMalformed`; `D-144` item 2), **and `filePath` and `saveCall` are
|
|
358
|
+
* mutually exclusive**: a `cfg` carrying both is refused at that same gate, naming `cfg` (`D-144` item 7). **The function
|
|
359
|
+
* never crosses into Rust at any depth**: the package holds it, invokes it at ONE position, and tells the store the verdict
|
|
360
|
+
* through the addon's own `saveSucceeded`/`saveFailed` entries.
|
|
361
|
+
*
|
|
362
|
+
* **The answer may be a thenable** — `D-144` item 1's *"(async optional)"*, kept in domain by `D-153` item 2: the
|
|
363
|
+
* write's answer is then withheld until the saver settles, the delivered set is started after the save on that arm too, and
|
|
364
|
+
* a failed save answers rank `15` `FileCommitFailed` with these `message` strings carried as log entries. **Every answer
|
|
365
|
+
* that is not `{success: true}` is a failed save**, and `message` is read only where it is an array. **A save that fails
|
|
366
|
+
* rolls the commit back before the caller hears of it**, **and a `saveCall` store never reconstructs state from a file** —
|
|
367
|
+
* its recovery is the client's, fed back through the seed key `U-STOREROOM-05` lands.
|
|
368
|
+
*
|
|
369
|
+
* **The duty `D-145` item 5 declares is documentary, not a refusal**: two stores must not be doubled on one `saveCall`
|
|
370
|
+
* function, and a store that boots empty and then saves will persist an empty image over whatever the backend held.
|
|
371
|
+
*/
|
|
372
|
+
readonly saveCall?: (image: string) =>
|
|
373
|
+
| { readonly success: boolean; readonly message: readonly string[] }
|
|
374
|
+
| Promise<{ readonly success: boolean; readonly message: readonly string[] }>;
|
|
375
|
+
/**
|
|
376
|
+
* **⟶ ADDED 2026-11-17 — `D-137` ITEM 4, VERBATIM: *"THE SEED IS IMAGE TEXT ONLY, AND ITS KEY IS `initialImage`"***
|
|
377
|
+
* (`strata/decisions.md` · `D-137`), read with `D-147` items 1–4. **THE CONSTRUCTION BEGINS WITH CONTENT: this is
|
|
378
|
+
* THIS STORE'S OWN IMAGE TEXT**, exactly as `saveCall` is handed it and as `exportImage` answers it — the saver speaks
|
|
379
|
+
* JSON, so the image is the currency of both halves — and **the store decodes it with its own decoder tail at
|
|
380
|
+
* construction and installs every admitted member at `file` tier**, so a `saveCall`-backed or a `filePath`-backed store
|
|
381
|
+
* starts life holding the caller's data.
|
|
382
|
+
*
|
|
383
|
+
* **It is in domain on every arm** (`D-147` item 1): a `filePath` store may be seeded, a plain `mem` store may be
|
|
384
|
+
* seeded, and a `saveCall` store is seeded as its BOOTSTRAP — its recovery, because such a store never reconstructs
|
|
385
|
+
* state from a file (`D-144` item 4). **Guidance, not a refusal, carries the danger**: a seeded `filePath` store's bytes
|
|
386
|
+
* are in danger of being overwritten by the next `file`-tier write, so seeding is discouraged where the overwrite is not
|
|
387
|
+
* intended.
|
|
388
|
+
*
|
|
389
|
+
* **No save is performed at a seeded construction** (`D-147` item 2: *"a seed is not an act"*): the store and the
|
|
390
|
+
* caller's backend agree at instant zero because the caller just supplied the state, and **the construction stays
|
|
391
|
+
* synchronous**.
|
|
392
|
+
*
|
|
393
|
+
* **Provenance is declared and left** (`D-147` item 3): the loader's filter is the store's own admission test and nothing
|
|
394
|
+
* else, so **the image carries no identity** — a stale, foreign or hand-assembled image of admissible values installs
|
|
395
|
+
* silently — and **the client is responsible for passing its own store's image**. The format is the store's private
|
|
396
|
+
* composition: opaque, transported verbatim, never hand-edited.
|
|
397
|
+
*
|
|
398
|
+
* **An empty string is broken config and is refused at `cfg`'s class gate** under `AddressMalformed`, the seat
|
|
399
|
+
* `filePath: ''` already takes (`D-147` item 4) — **absence alone means *no seed* and the creation state stands** — and
|
|
400
|
+
* a value that is not a string is the same gate. **An image the store cannot read is refused at rank `22`
|
|
401
|
+
* `FileImageRefused` with no instance returned** (`D-135` item 3).
|
|
402
|
+
*/
|
|
403
|
+
readonly initialImage?: string;
|
|
319
404
|
}
|
|
320
405
|
|
|
321
406
|
/**
|
|
@@ -441,6 +526,7 @@ export type StoreStatus =
|
|
|
441
526
|
| 'ConstraintPassRefused'
|
|
442
527
|
| 'ListenerBodyThrew'
|
|
443
528
|
| 'FileImageRefused'
|
|
529
|
+
| 'ListenerBodyRejected'
|
|
444
530
|
| (string & {});
|
|
445
531
|
|
|
446
532
|
/**
|
|
@@ -452,8 +538,10 @@ export type StoreStatus =
|
|
|
452
538
|
* message log entries are the KERNEL'S records, carried VERBATIM, and no flattening is declared — a client
|
|
453
539
|
* that reads one reads the kernel's own entry.
|
|
454
540
|
*
|
|
455
|
-
* `kind` is the kernel's closed
|
|
456
|
-
*
|
|
541
|
+
* `kind` is the kernel's closed FIVE-member `LogKind` set — **⟶ the fifth is `'save'`, minted `2026-11-17` by `D-153`
|
|
542
|
+
* item 1 (`strata/decisions.md`: *"1. take first option"*) so the caller's `saveCall` `message[]` has a lawful seat as one
|
|
543
|
+
* entry per string (`D-145` item 2)** — and `state` is the kernel's own `KC` token on the one `outcome` entry and `null`
|
|
544
|
+
* on the four non-`outcome` kinds.
|
|
457
545
|
*
|
|
458
546
|
* **⟶ AND THE LIST IT STANDS IN IS THE COMMIT'S, NOT THE ATTEMPT'S — 2026-10-28 (`D-53`).** **THE ARCHITECT,
|
|
459
547
|
* VERBATIM: *"If it's part of the same commit, then it uses the same message log. If it opens a new commit, it
|
|
@@ -484,7 +572,7 @@ export type StoreStatus =
|
|
|
484
572
|
* never `status`, exactly as every `KC` token does, so the closed status set keeps its `20` members and its ranks.
|
|
485
573
|
*/
|
|
486
574
|
export interface LogEntry {
|
|
487
|
-
readonly kind: 'constraint-check' | 'repair-run' | 'commit' | 'outcome';
|
|
575
|
+
readonly kind: 'constraint-check' | 'repair-run' | 'commit' | 'outcome' | 'save';
|
|
488
576
|
readonly id: string | null;
|
|
489
577
|
readonly message: string;
|
|
490
578
|
readonly opId: string | null;
|
|
@@ -585,15 +673,30 @@ export interface BaseState {
|
|
|
585
673
|
|
|
586
674
|
/**
|
|
587
675
|
* **THE STORE'S OWN JOURNAL OP, CROSSED MEMBER FOR MEMBER AND IN THE STORE'S OWN SPELLINGS** — `DD-39`'s
|
|
588
|
-
*
|
|
589
|
-
* after, seq
|
|
676
|
+
* **SEVEN** declared names (`distribution.md §5.2` item 1; `P-PUB-7`): `{ opId, kind, address, tier, before,
|
|
677
|
+
* after, seq }`.
|
|
590
678
|
*
|
|
591
679
|
* **`opId` IS A `string`** — the store's own op-id domain is a non-empty string (`PAR-JS-9`), and the id a
|
|
592
680
|
* `write` returns is the id a `rollback` takes. **`kind` is the store's own token** (`'write'` and
|
|
593
681
|
* `'delete'` today) **and its membership is the STORE'S to close, so it is typed as `string` and this
|
|
594
682
|
* package mints no union over it.** **`tier` is one of the store's own three tokens, or `null` where the op
|
|
595
|
-
* carries none**; **`seq` is the journal's own sequence number
|
|
596
|
-
*
|
|
683
|
+
* carries none**; **`seq` is the journal's own sequence number**, carried verbatim.
|
|
684
|
+
*
|
|
685
|
+
* **★ AND THE EIGHTH MEMBER — `readonly compacted: boolean` — IS REMOVED, 2026-11-17. IT IS GONE: NOT
|
|
686
|
+
* RENAMED, NOT DEPRECATED, NOT TYPED `false`.** The architect, VERBATIM (`strata/decisions.md` · `D-189`
|
|
687
|
+
* item 2): *"If .compacted is always false drop it"*. **The directive was a conditional and the tree answered
|
|
688
|
+
* it**: the store set the flag `false` at both of its producers, **so a member that can hold one value
|
|
689
|
+
* carried nothing**, and the distinction it once shared — *an op this store compacted* against *an op this
|
|
690
|
+
* store never held* — **is carried by the store's `journal_floor` watermark instead** (`D-160` item 3), which
|
|
691
|
+
* answers `RollbackCompacted` and `JournalOpUnknown` as two different refusals without a per-op bit. **WHAT
|
|
692
|
+
* THIS COSTS A CONSUMER: `record.op.compacted` no longer type-checks and no longer exists at run time** — the
|
|
693
|
+
* read returns `undefined` because the key is absent, and it is absent from the write's record, the delete's
|
|
694
|
+
* record and every op the kernel's repair leg copies. **THE CLASS IS `MAJOR` (`2.0.0`, `D-190`) for exactly
|
|
695
|
+
* this reason**: a PUBLISHED declaration member left the surface, which no `MINOR` absorbs — **`D-158`'s
|
|
696
|
+
* `MINOR` at `1.13.0` is SUPERSEDED and this declaration describes `2.0.0`.** **⟶ AND THE LINE THAT NAMES THE VERSION IS RE-CUT, 2026-11-20 — the
|
|
697
|
+
* sentence above is `2.0.0`'s own reading and stands; **what a reader needs is that this declaration now describes `2.0.1`**, whose class is a `PATCH` because
|
|
698
|
+
* `D-203`'s fix changes the ARM's emitted declaration and no runtime byte** (`D-203` item 5: *"a patch on the arm at most … could not construct at all"*).
|
|
699
|
+
* **The `MAJOR` reading above is not withdrawn: it is `2.0.0`'s, and this file has carried two classes since.**
|
|
597
700
|
*/
|
|
598
701
|
export interface JournalOp {
|
|
599
702
|
readonly opId: string;
|
|
@@ -603,7 +706,6 @@ export interface JournalOp {
|
|
|
603
706
|
readonly before: BaseState;
|
|
604
707
|
readonly after: BaseState;
|
|
605
708
|
readonly seq: number;
|
|
606
|
-
readonly compacted: boolean;
|
|
607
709
|
}
|
|
608
710
|
|
|
609
711
|
/**
|
|
@@ -615,8 +717,47 @@ export interface JournalOp {
|
|
|
615
717
|
*/
|
|
616
718
|
export interface WriteRecord {
|
|
617
719
|
readonly op: JournalOp;
|
|
720
|
+
/**
|
|
721
|
+
* **THE WATCHED ADDRESSES — THE ADDRESS PROJECTION OF `triggered`, AND FROM `P-3` IT NARROWS WITH IT.**
|
|
722
|
+
* `strata/decisions.md` · `D-195` item 1 (*"Take the default on the blocker and proceed"*) settles what
|
|
723
|
+
* `D-193` left open: the store's own projection law says the two lists are produced by ONE predicate, so
|
|
724
|
+
* **a write that changes nothing at its address answers `[]` here TOO** — see `triggered`'s clause below,
|
|
725
|
+
* which is the one that carries the rule.
|
|
726
|
+
*/
|
|
618
727
|
readonly watched: readonly Address[];
|
|
619
|
-
/**
|
|
728
|
+
/**
|
|
729
|
+
* **THE TRIGGER'S PAIRS** (`contract.md §2.4` item 1; `PAR-HL-38`): the pair REPLACES a bare handle list.
|
|
730
|
+
*
|
|
731
|
+
* **★ AND FROM `P-3` A `write` FIRES ONLY REGISTRATIONS THE ACT'S OWN VALUE REACHES — `strata/decisions.md` ·
|
|
732
|
+
* `D-193` item 1, the architect, VERBATIM: *"P-3 checks literal equivalence, not reference equality"*.** **A
|
|
733
|
+
* `write` whose literal is the literal the address already answers answers `triggered: []`** — the prefix
|
|
734
|
+
* arm gains the act's value condition, **while the TOUCHED arm does not**: a registration at a node the act
|
|
735
|
+
* created or purged below it is still told (`D-66`; `Q-6`'s default, which no later pass may narrow).
|
|
736
|
+
* **THE COMPARISON IS ON ONE LITERAL AND NOT ON THE PER-TIER LIST** (`D-193` item 1: at an address standing
|
|
737
|
+
* at two tiers the compared literal is the one an unqualified read answers), **the relation is the store's own
|
|
738
|
+
* value equality** (class-strict and key-order-blind), **and two prices are DECLARED rather than repaired**:
|
|
739
|
+
* `file 'V'` then `mem 'V'` **fires nothing** although `readTiered` moves, and `0` over a standing `-0`
|
|
740
|
+
* **fires nothing** although a constraint's `sameStanding` would call the pair moved (`D-193` items 3 and 4:
|
|
741
|
+
* *"a later pass must not 'fix' this as a defect"*). **The suppression reaches a CONSTRAINT PAIR at that
|
|
742
|
+
* address too** (`D-193` item 5's `Q-5`): the pass evaluates this list, so an empty list asks no pair.
|
|
743
|
+
*
|
|
744
|
+
* **⟶ AND THE `D-78` SENTENCE THIS MEMBER OWES, WHICH IS NOT `D-78`'s SHAPE — WHAT YOU MAY CONCLUDE FROM
|
|
745
|
+
* `[]`.** `docs/specs/storeroom-js/surface.md:235`'s device (`D-78`) draws its axis between an ABSENT member
|
|
746
|
+
* and an EMPTY list — *"this act cannot discard a raise"* versus *"it can, and this time nothing was
|
|
747
|
+
* discarded"* — and its remedy is to make the member present so it can say so. **HERE THE MEMBER IS PRESENT IN
|
|
748
|
+
* BOTH READINGS AND THE AMBIGUITY IS INSIDE ONE ARRAY**, so the declared reading is the one the architect's
|
|
749
|
+
* default leaves (`D-195` item 2's `O-4`): **`[]` carries TWO claims and CANNOT TELL THEM APART** — **(A)**
|
|
750
|
+
* *"no registration stood at a prefix of this act's address, and the act touched no registered address"*, and
|
|
751
|
+
* **(B)** *"registrations stood, and the literal the act landed is the literal the address already
|
|
752
|
+
* answered."* **BOTH ARE TRUE OF IT, AND `[]` ALONE DOES NOT SAY WHICH.** **What you may rely on therefore:** a
|
|
753
|
+
* listener you registered at a prefix of a `write`'s address was **not** invoked, and **nothing in the record
|
|
754
|
+
* says why** — **`op` is present on both arms** (a no-change write still mints its op and its `opId` still
|
|
755
|
+
* resolves through `rollback`), and **a `file`-tier no-change write still saves**, so `[]` never means *"the
|
|
756
|
+
* act did not happen"*. **`op.before` beside `op.after` is a SECOND reading and a PARTIAL one**: where an
|
|
757
|
+
* address stood at two tiers `op.before.value` is the per-tier LIST, so the two disagree with the rule at
|
|
758
|
+
* exactly the address the rule's price lives at (`D-193` item 3). **A typed `changed` flag is NOT on this
|
|
759
|
+
* surface and was not minted** (`O-4`'s default (i), declared rather than added).
|
|
760
|
+
*/
|
|
620
761
|
readonly triggered: readonly TriggerPair[];
|
|
621
762
|
/**
|
|
622
763
|
* **THE DISCARD'S WITNESS — PRESENT ON THIS RECORD AT RUNTIME, AND DECLARED HERE RATHER THAN AS A TYPED
|
|
@@ -678,6 +819,85 @@ export interface WriteRecord {
|
|
|
678
819
|
* would redden a green leg without moving the runtime at all. **A future pass that owns the census owes it the
|
|
679
820
|
* typed line.**
|
|
680
821
|
*/
|
|
822
|
+
/**
|
|
823
|
+
* **⟶ ADDED 2026-11-17 — THE DELIVERED SET'S FAILURES: PRESENT ON THIS RECORD AT RUNTIME, AND DECLARED HERE RATHER
|
|
824
|
+
* THAN AS A TYPED MEMBER** (`U-STOREROOM-06 DELIVERY-SETTLE`; `strata/decisions.md` · `D-138` items 1 and 2; `D-150`
|
|
825
|
+
* items 1 and 2). `D-138` item 2 is the ruling, verbatim: *"the write resolves, and the status rides on the receipt … its
|
|
826
|
+
* CARRIER is the write's answer — a datum the caller reads"* — because by the instant a body can reject, the act has
|
|
827
|
+
* ALREADY COMMITTED (`D-138` item 1), so a rejection of the awaited answer would report a DURABLE SUCCESS as a FAILURE.
|
|
828
|
+
*
|
|
829
|
+
* **`record.bodyFailures` IS AN OBJECT AT RUNTIME — ONE ENTRY PER REJECTING LISTENER BODY, KEYED BY THE HANDLE THAT BODY
|
|
830
|
+
* WAS DELIVERED UNDER** (`D-138`'s plurality: *"`N` rejections become `N` entries"*), each entry `{status, message,
|
|
831
|
+
* address}`. **`status` IS `'ListenerBodyRejected'`** — rank `23`, `D-137` item 5's own mint: the promise pair's other
|
|
832
|
+
* half, whose sibling at rank `21` is `ListenerBodyThrew` and **rank `21` is NOT widened by it**. **`message` is the
|
|
833
|
+
* GENERATED sentence and never the body's own words**, `D-137` item 5's form over that item's declared subject:
|
|
834
|
+
* *"<address> was refused by a listener body that rejected, a fired listener body's rejection refuses the act that fired
|
|
835
|
+
* it"* — **its subject is the WATCHED ADDRESS'S SPELLING**, so **the body's own reason is never read, stored or
|
|
836
|
+
* rendered** (`D-137` item 5; `PIN-5`; `D-58`) — and `address` is the binding's own address.
|
|
837
|
+
*
|
|
838
|
+
* **IT IS A NON-ENUMERABLE, `configurable` OWN GETTER OVER A SYMBOL-KEYED DATUM** — `constraints.mjs`'s
|
|
839
|
+
* `defineBodyFailures` defines it at this name, over the datum `state.mjs` spells `BODY_FAILURES` and `delivery.mjs`'s
|
|
840
|
+
* `settledAnswer` installs after the one `Promise.allSettled`. **A getter by necessity and not by taste**: the record is
|
|
841
|
+
* built BEFORE the set settles, so a datum captured at the build would answer `{}` about a body that then rejects — the
|
|
842
|
+
* same reason `discarded` above is a read. **So `Object.keys(write(...))` is still the three declared members above and
|
|
843
|
+
* every deep-equality over a write's answer is unmoved**, and `Object.getOwnPropertyNames` reads **SEVEN** with this name
|
|
844
|
+
* among them (`D-150` item 1). **A spread or an `Object.assign` copy loses it, as it loses `discarded`.**
|
|
845
|
+
*
|
|
846
|
+
* **IT IS PRESENT ON EVERY ARM AND ANSWERS ONE SHARED FROZEN `{}` WHERE NOTHING STANDS** — `state.mjs`'s
|
|
847
|
+
* `BODY_FAILURES_EMPTY`, the same constant on the plain synchronous arm and on a settled arm that found no rejection, so
|
|
848
|
+
* no reader can tell *"no settle ran"* from *"the settle found no rejection"*. **Never absent, never `undefined`, never a
|
|
849
|
+
* fresh `{}` per call** (`D-77`'s rule), on `D-138`'s unsettled item 3.
|
|
850
|
+
*
|
|
851
|
+
* **IT IS NOT THE CALLER'S OWN COMMIT'S FAILURE.** A listener runs in its own commit and its refusal does not fail the
|
|
852
|
+
* write that fired it (`D-71`) — **the write RESOLVES**, and this member reports beside the record and never in place of
|
|
853
|
+
* it. **A body that THROWS synchronously is the other arm and stays an error in the caller's own frame** (`D-73`;
|
|
854
|
+
* `D-138` item 4's declared asymmetry), and `D-153` item 2 keeps the distinction this member lives on: a failure here is
|
|
855
|
+
* a datum the settle RESOLVES INTO and never a rejection of the promise (`PIN-5`).
|
|
856
|
+
*
|
|
857
|
+
* **AND WHY IT IS A DOCBLOCK AND NOT A TYPED LINE — the same sentence `discarded` and `log` above carry, for the same
|
|
858
|
+
* reason:** the census that asserts this record's declared member set at three (`tests/e2e/blind-entry-module.test.mjs`'s
|
|
859
|
+
* `WriteRecord` cell and `tests/e2e/surface.test.mjs`) is outside this pass's write scope, **so a typed member would
|
|
860
|
+
* redden a green leg without moving the runtime at all.** **A future pass that owns the census owes it the typed line.**
|
|
861
|
+
*/
|
|
862
|
+
/**
|
|
863
|
+
* **⟶ ADDED 2026-11-17 — THE DELIVERED SET'S SETTLED RETURN VALUES: PRESENT ON THIS RECORD AT RUNTIME, AND DECLARED
|
|
864
|
+
* HERE RATHER THAN AS A TYPED MEMBER** (`U-STOREROOM-08 RETURN-VALUES`; `strata/decisions.md` · `D-149` item 2; `D-150`
|
|
865
|
+
* items 1–3). `D-149` item 2 is the ruling, verbatim: *"answer gains a datum keyed by handle, one entry per listener
|
|
866
|
+
* that RETURNED A VALUE"* — and `D-150` item 1 is its name and its device.
|
|
867
|
+
*
|
|
868
|
+
* **`record.returnedValues` IS AN OBJECT AT RUNTIME — ONE ENTRY PER HANDLE WHOSE BODY RETURNED A VALUE, KEYED BY THAT
|
|
869
|
+
* HANDLE, AND THE ENTRY IS THE VALUE.** **An `undefined`-RETURNER CONTRIBUTES NO ENTRY and its silence is the caller's to
|
|
870
|
+
* read** (`D-148` item 1(c), the architect, verbatim: *"A listener that returns nothing should be assumed to only perform
|
|
871
|
+
* backend code that does not need the channel pass"*), so a handle absent from the map either returned nothing or was not
|
|
872
|
+
* in the delivered set. **A body that REJECTED contributes no entry here** — its failure is `bodyFailures`' above, and
|
|
873
|
+
* its reason is never read, stored or rendered. **THE VALUE IS THE SETTLED VALUE AND NEVER THE PROMISE** (`D-149`
|
|
874
|
+
* item 3: the answer is withheld until the delivered set settles, so a promise a body returned is already settled into a
|
|
875
|
+
* value or into `bodyFailures`).
|
|
876
|
+
*
|
|
877
|
+
* **IT IS A NON-ENUMERABLE, `configurable` OWN GETTER OVER A SYMBOL-KEYED DATUM — `bodyFailures`' own device, member for
|
|
878
|
+
* member** (`constraints.mjs`'s `defineReturnedValues`), over the datum `state.mjs` spells `RETURNED_VALUES` and
|
|
879
|
+
* `settledAnswer` installs from `returnedValues(settled, invoked)` after the one `Promise.allSettled` — so the read
|
|
880
|
+
* answers at the read, for the reason the record is built before the set settles. **So `Object.keys(write(...))` is still
|
|
881
|
+
* the three declared members above and every deep-equality over a write's answer is unmoved**, and
|
|
882
|
+
* `Object.getOwnPropertyNames` reads **SEVEN** with this name among them (`D-150` item 1). **A spread or an
|
|
883
|
+
* `Object.assign` copy loses it, as it loses `discarded` and `bodyFailures`.**
|
|
884
|
+
*
|
|
885
|
+
* **IT IS PRESENT ON EVERY ARM AND ANSWERS ONE SHARED FROZEN `{}` WHERE NOTHING STANDS** — `state.mjs`'s
|
|
886
|
+
* `RETURNED_VALUES_EMPTY`, one frozen constant meaning *"no body returned a value"*, which is the same fact whether no
|
|
887
|
+
* settle ran at all or a settle found none. **Never absent, never `undefined`, never a fresh `{}` per call** (`D-150`
|
|
888
|
+
* item 2, verbatim: *"present always, never absent, never `undefined`"*), on `D-77`'s rule.
|
|
889
|
+
*
|
|
890
|
+
* **IT IS NOT A SECOND `triggered`, AND IT CARRIES NO HANDLE→ADDRESS RELATION.** The map's keys are HANDLES and nothing
|
|
891
|
+
* here names an address: the `{handle, address}` pairs stay `triggered`'s above. **Nor is it the channel it replaced** —
|
|
892
|
+
* `D-149` item 1 dissolved the external `channel`, and item 4 makes the receipt the answer on every arm, so this datum is
|
|
893
|
+
* read off the record the caller already holds.
|
|
894
|
+
*
|
|
895
|
+
* **AND WHY IT IS A DOCBLOCK AND NOT A TYPED LINE — the same sentence `discarded`, `log` and `bodyFailures` above carry,
|
|
896
|
+
* for the same reason:** the census that asserts this record's declared member set at three
|
|
897
|
+
* (`tests/e2e/blind-entry-module.test.mjs`'s `WriteRecord` cell and `tests/e2e/surface.test.mjs`) is outside this pass's
|
|
898
|
+
* write scope, so a typed member would redden a green leg without moving the runtime at all. **The member is declared by
|
|
899
|
+
* NAME, SHAPE and SEMANTICS here and carried at runtime.** **A future pass that owns the census owes it the typed line.**
|
|
900
|
+
*/
|
|
681
901
|
}
|
|
682
902
|
|
|
683
903
|
/**
|
|
@@ -709,7 +929,9 @@ export interface DeleteRecord {
|
|
|
709
929
|
* reversible"*).
|
|
710
930
|
*
|
|
711
931
|
* **IT IS THE MEMBER `WriteRecord` CARRIES, AT THE SAME NAME AND THE SAME TYPE** (`WriteRecord.op` above,
|
|
712
|
-
* the store's own
|
|
932
|
+
* the store's own seven-member `JournalOp` — **⟶ SEVEN AND NOT EIGHT FROM 2026-11-17, `D-189` item 2:
|
|
933
|
+
* `compacted` is removed from the record and the declaration** (`JournalOp` above states it at its own
|
|
934
|
+
* docblock)), so a caller has **one spelling for "the op this act landed"**
|
|
713
935
|
* and one route to reversing it: `store.rollback(record.op.opId)` restores every version the delete
|
|
714
936
|
* removed, **at its own tier**, exactly as a write's reversal restores what the write replaced.
|
|
715
937
|
*
|
|
@@ -956,8 +1178,9 @@ export interface AttemptRef {
|
|
|
956
1178
|
*
|
|
957
1179
|
* **`triggered` and `pending` are the store's own returned handle set and the kernel's own member
|
|
958
1180
|
* respectively, each read as a SET** (`§2.1` item 2; `Handle` above is this file's opaque-handle spelling);
|
|
959
|
-
* **`op` is the op the store's write returned, VERBATIM** (`JournalOp` above, the store's own
|
|
960
|
-
* record — `§2.1` item 2: *"the op the store's
|
|
1181
|
+
* **`op` is the op the store's write returned, VERBATIM** (`JournalOp` above, the store's own seven-member
|
|
1182
|
+
* record — **⟶ SEVEN AND NOT EIGHT FROM 2026-11-17, `D-189` item 2** — `§2.1` item 2: *"the op the store's
|
|
1183
|
+
* write returned, VERBATIM"*).
|
|
961
1184
|
*/
|
|
962
1185
|
export interface CommitRecord {
|
|
963
1186
|
/** The attempt this commit opened — its identity (`attempt-lifecycle.md §2.4` item 1). */
|
|
@@ -1426,7 +1649,42 @@ export interface StoreInstance {
|
|
|
1426
1649
|
* runtime first, this checkout's own module-relative addon second, and answers the declared absent form
|
|
1427
1650
|
* when neither yields a loadable artefact.
|
|
1428
1651
|
*/
|
|
1652
|
+
/**
|
|
1653
|
+
* **⟦ THE FACTORY'S POSITION IS THE DECLARATION'S SECOND REALM-CONDITIONAL BYTE, ADDED 2026-11-20 — `D-203`, WHOSE
|
|
1654
|
+
* OWN THREE ROWS THIS REGION EXISTS FOR.** *"the arm's runtime takes TWO positions"*
|
|
1655
|
+
* (`bindings/js/platforms/wasm/index.mjs`'s own docblock: *"`storeCreate(bindings, cfg)` takes the initialised module
|
|
1656
|
+
* at its FIRST position"*) · *"the guide teaches TWO"* (`docs/guides/package-use.md` §13.1: *"THE FACTORY TAKES TWO
|
|
1657
|
+
* POSITIONS — `storeCreate(bindings, cfg)` — and the first is the module"*) · *"the arm's SHIPPED declaration takes
|
|
1658
|
+
* ONE"* — which is what this region removes: the arm's emission was the Node arm's signature byte for byte, so **a
|
|
1659
|
+
* TypeScript consumer of `@auspicion/provident-storeroom-js-wasm` could not spell the construction its runtime and its
|
|
1660
|
+
* guide require** (`D-203` item 3: *"`storeCreate(bindings, cfg)` fails the declared signature; `storeCreate(cfg)`
|
|
1661
|
+
* compiles and cannot carry the injected module"*).
|
|
1662
|
+
*
|
|
1663
|
+
* **THE TWO COMMENT LINES THAT BRACKET THE DECLARATION BELOW — both at this file's marker depth of two spaces, and
|
|
1664
|
+
* neither carrying a member's name-and-colon or name-and-paren shape — DELIMIT THE SECOND REGION
|
|
1665
|
+
* `scripts/emit-declarations.mjs` READS**, exactly as the `filePath` markers above delimit the first (`D-155` item 2;
|
|
1666
|
+
* `docs/L3/wasm-realm/design.md` §6). **The form is the reason the region can stand here at all**: no member read a
|
|
1667
|
+
* battery file performs on an interface block matches a line whose first two characters after the indentation are
|
|
1668
|
+
* `//`, and the one read this file's module level is subject to — the count of lines beginning `export function` —
|
|
1669
|
+
* is a count of lines that begin at column zero, which a marker at two spaces is not. **So this region moves no member
|
|
1670
|
+
* census, no status count, no export count and no rank.**
|
|
1671
|
+
*
|
|
1672
|
+
* **WHAT THE WASM ARM'S EMISSION PUTS INSIDE IT IS ONE LINE, AND ITS FIRST TYPE IS `unknown` BECAUSE THAT IS THE
|
|
1673
|
+
* HONEST TYPE OF A HOST-SUPPLIED MODULE**: `export function storeCreate(bindings: unknown, cfg: StoreConfig):
|
|
1674
|
+
* StoreInstance;`. **A NAMED TYPE IN THAT POSITION WOULD BE THIS PACKAGE CLAIMING THE HOST'S SHAPE** — the module is
|
|
1675
|
+
* the host's, the package instantiates nothing (`D-155` item 3), and the runtime validates what arrives
|
|
1676
|
+
* (`bindings/js/src/entry/addon-slot.mjs`'s `installAddon`, which refuses `null`, `undefined`, a primitive, a function
|
|
1677
|
+
* and an object carrying no callable `storeCreate`) — **so the declaration admits every value and the runtime is what
|
|
1678
|
+
* says which values are a module.**
|
|
1679
|
+
*
|
|
1680
|
+
* **AND THE NODE ARM'S SIGNATURE DOES NOT MOVE**, byte for byte: the region's Node body is the line below, the
|
|
1681
|
+
* emission of the Node arm is this file's own bytes with the region unchanged, and the script asserts that identity
|
|
1682
|
+
* before it writes either file. **A reader who opened this declaration to find the ONE name and the ONE position the
|
|
1683
|
+
* Node arm has still finds them, one marker pair down.**
|
|
1684
|
+
*/
|
|
1685
|
+
// ⟦realm:factory:begin⟧
|
|
1429
1686
|
export function storeCreate(cfg: StoreConfig): StoreInstance;
|
|
1687
|
+
// ⟦realm:factory:end⟧
|
|
1430
1688
|
|
|
1431
1689
|
/**
|
|
1432
1690
|
* **THE POST-CREATION CONSTRAINT PAIR — `parameter-semantics.md §2.24` (`PAR-JS-24`)**: the key the three
|