provident-storeroom 0.3.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +65 -25
  2. package/index.mjs +164 -8
  3. package/package.json +7 -6
package/README.md CHANGED
@@ -22,9 +22,17 @@ artefact — so the count of SITES stays four and the count of artefacts CARRYIN
22
22
  ## The one entry
23
23
 
24
24
  ```js
25
- import { storeCreate, read, readLiteral, write, delete as remove, rollback, listen, unlisten } from 'provident-storeroom';
25
+ import { storeCreate } from 'provident-storeroom';
26
26
  ```
27
27
 
28
+ **⟶ AND THIS BLOCK'S SUPERSEDED FORM IS NAMED SO IT IS NOT READ AS THE ENTRY: it once printed
29
+ `import { storeCreate, read, readLiteral, write, delete as remove, rollback, listen, unlisten }` — EIGHT module
30
+ names, seven of which are no longer exports at all. THE MODULE NAMESPACE IS ONE NAME**, and the seven that left it
31
+ are the instance's own methods, `delete` among them spelled `a.delete(address, tier?)` on the receiver (the
32
+ `delete as remove` binding was the MODULE-side workaround for a reserved word and is not the consumer spelling).
33
+ **These are the `0.2.0`-era names; the `8 → 1` is `A127`'s** (`surface.md §2.9` item 1's `A127` clause;
34
+ `docs/guides/package-use.md` `§1.1-bis`).
35
+
28
36
  **The `exports` map publishes EXACTLY ONE arms-bearing entry — the ESM one** (`package.md §1.3`, `DD-24`):
29
37
  there is no wildcard export, no deep import to the addon and no CJS arm. **The addon is reached INTERNALLY
30
38
  by the package's own `createRequire`-style step and is not an entry point**: a consumer that spells the
@@ -32,33 +40,60 @@ addon's path directly is outside every clause of this contract.
32
40
 
33
41
  ## The surface
34
42
 
35
- **The eight verbs of `surface.md §2` and NOTHING ELSE**, plus the instance `storeCreate` returned — whose own
36
- member set is the FOUR the dated clause below prints:
43
+ **ONE module name — `storeCreate` — and NOTHING ELSE** (`surface.md §2.9` item 1's `A127` clause; the namespace's
44
+ `8 → 1`), **plus the instance `storeCreate` returned — whose own member set is the TWELVE the table below prints,
45
+ `10 + 1 + 1 = 12` ✓** (`surface.md §2.4` item 9 (f)'s `A127` clause; the member set's `4 → 12`).
46
+
47
+ **⟶ WITHDRAWN 2026-10-17 — THE SENTENCE THIS ONE REPLACES READ *"The eight verbs of `surface.md §2` and NOTHING
48
+ ELSE"*, plus an instance whose own member set was *"the FOUR the dated clause below prints"*: BOTH FIGURES ARE THE
49
+ `0.2.0`-ERA READING AND NEITHER DESCRIBES A SURFACE THAT EXISTS. The operative figures are the ONE module name and
50
+ the TWELVE own members above, whose home is `docs/guides/package-use.md` `§1.1-bis`.**
51
+
52
+ **AND THE LEADING `instance` POSITION IS DROPPED AT EVERY METHOD** (`surface.md §2.1` (e) item 3's one-spelling
53
+ and receiver rule): **the receiver IS the store, so `a.write(address, tier, value, commit?)` is the shape every
54
+ method takes and an `instance` passed first is a SUPERSEDED SPELLING — wrong, not redundant.**
37
55
 
38
56
  | The member | Its answer |
39
57
  | --- | --- |
40
- | `storeCreate(cfg)` | the package's own instance handle — `cfg` carries the store's four declared keys and no fifth |
41
- | `read(instance, address, tier?)` | a leaf's literal, a branch's assembled value, the empty address's whole register |
42
- | `readLiteral(instance, address, tier?)` | the same, narrowed to a leaf (`ReadTargetIsBranch` on a branch) |
43
- | `write(instance, address, tier, value, commit?)` | `{op, watched, triggered}` — the fifth argument OPTIONAL and declared LAST; its absence is in domain |
44
- | `delete(instance, address, tier?)` | `{address, tiers, triggered}` |
45
- | `rollback(instance, opId)` | `{opId, undoneOps, restoredTo}` |
46
- | `listen(instance, address)` | a fresh opaque handle |
47
- | `unlisten(instance, handle)` | `undefined` — and a no-op success for every value outside the domain |
48
- | `instance.register(handle, listener)` | `undefined`; a non-function listener or a handle this instance never minted throws a `TypeError` |
49
- | `instance.on(address, listener)` | a fresh opaque handle — the store's `listen` plus this package's own registration |
50
- | `instance.off(handle)` | `undefined` — the store-side withdrawal, and this package's own registry removal |
51
- | `instance.settle(record)` | `undefined` — the ordering seam: the one member THE KERNEL CALLS, and the arm that performs the `file`-tier save |
52
-
53
- **⟶ AMENDED 2026-10-15 — THE TABLE ABOVE IS READ AT THE FOUR-KEY CONSTRUCTION, THE FOURTH OWN MEMBER AND THE
58
+ | `storeCreate(cfg)` | the package's own instance handle — `cfg` carries the store's four declared keys and no fifth; the four are `filePath` · `journalLength` · `listeners` · `constraints`, and `listeners` is an ARRAY |
59
+ | `read(address, tier?)` | a leaf's literal, a branch's assembled value, the empty address's whole register |
60
+ | `readLiteral(address, tier?)` | the same, narrowed to a leaf (`ReadTargetIsBranch` on a branch) |
61
+ | `write(address, tier, value, commit?)` | `{op, watched, triggered}` — the fifth argument OPTIONAL and declared LAST; its absence is in domain |
62
+ | `delete(address, tier?)` | `{address, tiers, triggered}` |
63
+ | `rollback(opId)` | `{opId, undoneOps, restoredTo}` |
64
+ | `listen(address)` | a fresh opaque handle — the registration route is `listen` **then** `register` |
65
+ | `unlisten(handle)` | `undefined` — the withdrawal: the store-side removal AND this package's own registry removal; a no-op success for every value outside the domain |
66
+ | `addConstraint(pair, constraint)` | the constraint's identity — the ADD route, which CARRIES the function and OVERWRITES if the id already exists |
67
+ | `constraintOn(pair, constraint)` | `undefined` — ENABLE; idempotent, and it throws at a pair the store does not carry |
68
+ | `constraintOff(pair, constraint)` | `undefined` — DISABLE; idempotent, and it throws at a pair the store does not carry |
69
+ | `register(handle, listener)` | `undefined`; a non-function listener or a handle this instance never minted throws a `TypeError` |
70
+ | `settle(record)` | `undefined` — the ordering seam: the one member THE KERNEL CALLS, and the arm that performs the `file`-tier save |
71
+
72
+ **⟶ AND THE `on` AND `off` ROWS THIS TABLE ONCE CARRIED ARE WITHDRAWN, NOT MOVED AND NOT COUNTED: both members
73
+ were MERGED AWAY** (`surface.md §2.4` item 9 (e) items 2 and 3; `A127`). **`on(address, listener)` was a SECOND
74
+ SPELLING of `listen` then `register`, and both admissions are now methods, so the pair of calls `a.listen(address)`
75
+ then `a.register(handle, listener)` carries its whole subject; `off(handle)`'s withdrawal IS `a.unlisten(handle)`'s,
76
+ and the registry entry's own standing is `unlisten`'s rule, not a call.** **`on` and `off` are therefore NOT
77
+ members of the product and NOTHING above declares them as one** — the listener pair the guide at `§1.1-bis` calls
78
+ `on`/`off`-shaped is the CONSTRAINT toggles, which are `constraintOn`/`constraintOff` and a DIFFERENT subject.
79
+
80
+ **AND A `tier` IS OPTIONAL BY OMISSION ALONE: a SUPPLIED `undefined` tier is a PRESENT value and takes the
81
+ `AddressMalformed` refusal, while only the call that supplies nothing there — `a.read(address)` — folds to the
82
+ absent tier** (`parameter-semantics.md §2.6`'s `PAR-JS-6`, its in-writing adjudication of 2026-10-16).
83
+
84
+ **⟶ AMENDED 2026-10-15 — THE TABLE ABOVE IS READ AT THE FOUR-KEY CONSTRUCTION AND THE
54
85
  WRITE'S FIFTH ARGUMENT** (`surface.md §2.1`'s dated clause of 2026-10-15 and its `cfg` block; `§2.2`'s dated
55
86
  clause of the same date and its clause 4; `§2.11`; `parameter-semantics.md §2.20` = `PAR-JS-20` and `§2.21` =
56
- `PAR-JS-21`; `docs/decisions.md` · `A116`). **THE THREE CELLS IT RE-SPELLS, EACH NAMED BY ITS OWN WORDS: the
87
+ `PAR-JS-21`; `docs/decisions.md` · `A116`). **THE CELLS IT RE-SPELLS, EACH NAMED BY ITS OWN WORDS: the
57
88
  cells above are ALREADY RE-SPELLED IN PLACE, so the table stands in its OPERATIVE form and the as-filed wording
58
89
  is the one NAMED here — *"the store's three declared keys and no fourth"* READS *"the store's four declared keys
59
90
  and no fifth"*; *"plus the one member of the object `storeCreate` returned"* READS *"plus the instance
60
- `storeCreate` returned — whose own member set is the FOUR printed above"*; and the `write` cell's
61
- *"`write(instance, address, tier, value)`"* READS *"`write(instance, address, tier, value, commit?)`"*.**
91
+ `storeCreate` returned — whose own member set is the TWELVE printed above"*; and the `write` cell's
92
+ *"`write(instance, address, tier, value)`"* READS *"`write(address, tier, value, commit?)`"*.**
93
+ **⟶ AND THE *"FOURTH OWN MEMBER"* THIS CLAUSE WAS FILED WITH, AND ITS *"whose own member set is the FOUR printed
94
+ above"*, ARE BOTH WITHDRAWN 2026-10-17 AND ARE READ AT THE TWELVE, `10 + 1 + 1 = 12` ✓** — the `A116`/`0.2.0`
95
+ member figure this pass supersedes (`surface.md §2.4` item 9 (f)'s `A127` clause; `A127`), **and the
96
+ `instance` FIRST POSITION the as-filed `write` spelling carries is DROPPED with it** (`§2.1` (e) item 3).
62
97
 
63
98
  1. **THE FOUR DECLARED KEYS, AND NO FIFTH.** **They are `filePath` · `journalLength` · `listeners` ·
64
99
  `constraints` — `4` — each passed through WITHOUT a default, a rename or a key of the package's own, and
@@ -69,11 +104,16 @@ and no fifth"*; *"plus the one member of the object `storeCreate` returned"* REA
69
104
  IS IGNORED AND PRODUCES NO CODE** — *"no fifth"* is a constraint on the PACKAGE's own passing and never a
70
105
  refusal of the caller's extra key (`parameter-semantics.md §2.21`; `docs/specs/storeroom-native/contract.md
71
106
  §7.1`).
72
- 2. **THE INSTANCE'S OWN MEMBERS ARE FOUR: `{ register, on, off, settle }`, AND NOTHING ELSE.** **`register` is
73
- the registration site; `on` and `off` are the listener members; and `settle(record) -> undefined` is THE
74
- ORDERING SEAM the kernel calls at the two instants of a kernel-driven write** (`surface.md §2.1`'s dated
75
- clause of 2026-10-15 (a); `§2.4` item 9; `A116` (D1)). **AND NO RELEASE VERB IS ONE OF THEM** — none of the
76
- four releases the instance.
107
+ 2. **THE INSTANCE'S OWN MEMBERS ARE TWELVE: `{ read, readLiteral, write, delete, rollback, listen, unlisten,
108
+ addConstraint, constraintOn, constraintOff, register, settle }`, AND NOTHING ELSE** — `10 + 1 + 1 = 12` ✓
109
+ (`surface.md §2.4` item 9 (f)'s `A127` clause of 2026-10-16). **`register` is the registration site, reached
110
+ after `listen`; the withdrawal is `unlisten`; the listener pair `on`/`off` is MERGED AWAY and is no member of
111
+ this set; and `settle(record) -> undefined` is THE ORDERING SEAM the kernel calls at the two instants of a
112
+ kernel-driven write** (`surface.md §2.4` item 9 (e) items 1–3; `§2.4` item 9 (f); `A127`). **AND NO RELEASE VERB
113
+ IS ONE OF THEM** — none of the twelve releases the instance. **⟶ WITHDRAWN 2026-10-17: THIS CLAUSE ONCE READ
114
+ *"THE INSTANCE'S OWN MEMBERS ARE FOUR: `{ register, on, off, settle }`, AND NOTHING ELSE"* — the `A116`/`0.2.0`
115
+ figure, superseded in BOTH of its halves, the set's `4 → 12` and the `on`/`off` merge; the operative figure is
116
+ the TWELVE above and its home is `docs/guides/package-use.md` `§1.1-bis`.**
77
117
  3. **THE WRITE'S DECLARED ARITY IS `4` REQUIRED ARGUMENTS WITH A FIFTH OPTIONAL `commit`, DECLARED LAST**, and
78
118
  the declaration governs over the flow's own order: the `commit` is the kernel's own `{ attempt, op,
79
119
  triggered, pending }` record — `K-2 commit`'s return — and **AN ABSENT `commit` IS IN DOMAIN**, because the
package/index.mjs CHANGED
@@ -1228,10 +1228,103 @@ function encodeAddress(address, addressArgumentPosition, addressValuePosition) {
1228
1228
  /// as an OBJECT before any element is read from it — **so a throwing `get` trap cannot be raised, because
1229
1229
  /// nothing reads the proxy** — and a class extending `Array` is refused as an OBJECT (`TierArg` row 6's
1230
1230
  /// `OutOfDomainTier`) rather than admitted as the array spelling row 2 declares for the readers.
1231
- function encodeTier(tier, supplied, foldsUndefined) {
1231
+ /// **THE SUPPLIED-`undefined`-TIER ARM AT AN ADDRESS POSITION** — `refuseOutsideAddressValue`'s own
1232
+ /// shape, taken at the one value that reached neither of the boundary's two segment/address arms
1233
+ /// (`DEF-2026-10-17-A`; `surface.md §2.5` item 5 (a)–(b) and its `CF-3` authority split).
1234
+ ///
1235
+ /// **THE TARGET IS THE VALUE'S OWN RENDERING AND IT IS THE STORE'S OWN SPELLING FOR THAT VALUE** (item 5
1236
+ /// (a): *"a non-segment value PRINTED AS ITS OWN VALUE"*) — `undefined`, which is the spelling
1237
+ /// `refuseOutsideAddressValue` already gives this same value at the whole-address arm, so ONE value has
1238
+ /// ONE rendering at both arms and neither is authored here. **THE CONTAINER IS THE ARGUMENT'S OWN NAME**
1239
+ /// (`['address']`, handed to `boundaryReject`, whose third slot fills the generator's own `<container>`),
1240
+ /// exactly as the whole-address arm does one function above — a WHOLE-ADDRESS refusal is found in no
1241
+ /// container, so the truthfully filled slot is the failing ARGUMENT's own name. **PART TWO CARRIES THE
1242
+ /// POSITION AND NOT A SECOND CONTAINER CLAIM:** the ARGUMENT POSITION `§2.5` item 5 (b) requires beside the
1243
+ /// class, and the class of the value the position refused.
1244
+ ///
1245
+ /// **⟶ AND THE SECOND VALUE THIS ARM SERVES IS A SUPPLIED `null`, WIDENED 2026-10-17 BY THE SAME ONE SITE
1246
+ /// (`DEF-2026-10-17-E`).** **THE DEFECT: `read(['a','b','c'], null)` crossed as `{ k: 'N' }` to the store's
1247
+ /// `TierArg::Null` arm and rendered the SAME register-shaped sentence
1248
+ /// *"the tier argument is not a legal address segment in `''`"* — the empty container and the same wrong
1249
+ /// argument the `undefined` half above had already been repaired for, so ONE ROW'S two values carried TWO
1250
+ /// renderings while `crossing.md §1.3`'s `TierArg` row 4 declares them ONE answer.** **THE STATUS IS
1251
+ /// UNMOVED AND NOT MINTED** (`DD-40`): row 4's own `AddressMalformed`, on every verb. **WHAT MOVES IS THE
1252
+ /// RENDERING ALONE, AND IT MOVES ALONG THE PATH ALREADY TAKEN:** this helper is the one branch, and the
1253
+ /// value's own runtime spelling is its parameter — so `null` takes the SAME path as `undefined` rather than
1254
+ /// a second one, and the two values of row 4 render as one shape with one spelling changed. **THE STORE'S
1255
+ /// OWN `TierArg::Null` ARM IS UNTOUCHED** (`src/args.rs`), so a native caller of the same row keeps its
1256
+ /// bytes; what is intercepted is the JS boundary's own carrier, which is where `DEF-2026-10-17-A` put the
1257
+ /// `undefined` half for the same reason.
1258
+ function refuseSuppliedOutsideTier(value, addressArgumentPosition) {
1259
+ boundaryReject(
1260
+ 'AddressMalformed', // `PAR-JS-6`'s and `TierArg` rows 3–4's own declared code for this value, carried (`DD-40`)
1261
+ value, // the value's own runtime spelling, as the store renders it and as `refuseOutsideSegment` renders it
1262
+ // **THE POSITION HALF IS SPELLED IN THIS SITE'S OWN VOCABULARY because `addressArgumentPosition` is the
1263
+ // address's OWN position token (`'first argument'`, the position every one of the five verbs declares
1264
+ // for its `address` — `surface.md §2.4` item 9 (f)'s table): the address position was SUPPLIED, and
1265
+ // what was supplied BESIDE it is a `tier` position carrying this value. The sentence therefore names
1266
+ // the argument that was supplied, the position it stands AT, and the class the supplied value has —
1267
+ // which is the whole of what item 5 (b) requires to travel inside the message.**
1268
+ addressArgumentPosition === undefined
1269
+ ? `the address position was supplied, the tier position holds ${value}, and a tier is a token or a set of tokens`
1270
+ : `the address position was supplied at the ${addressArgumentPosition}, the tier position holds ${value}, and a tier is a token or a set of tokens`,
1271
+ ['address'],
1272
+ );
1273
+ return undefined; // `boundaryReject` throws; this is unreachable and is not a second path
1274
+ }
1275
+
1276
+ function encodeTier(tier, supplied, foldsUndefined, addressArgumentPosition) {
1232
1277
  if (!supplied) return { k: 'A' };
1233
- if (tier === undefined) return foldsUndefined ? { k: 'A' } : { k: 'U' };
1234
- if (tier === null) return { k: 'N' };
1278
+ if (tier === undefined) {
1279
+ if (foldsUndefined) return { k: 'A' };
1280
+ // **⟶ AND THE SUPPLIED-`undefined` ARM IS THE FOURTH BRANCH, REFUSED AT THE BOUNDARY 2026-10-17
1281
+ // (`DEF-2026-10-17-A`; `surface.md` §2.5 item 5 (a)–(b) and its `CF-3` authority split).**
1282
+ //
1283
+ // **THE DEFECT, MEASURED ON INSTALLED BYTES AND REPRODUCED AT THIS TREE: this value crossed to the
1284
+ // store as `{ k: 'U' }` and the store answered its OWN `malformed_tier_argument()`
1285
+ // (`src/args.rs`'s `read_tier_sel` / `read_literal_tier_sel` / `write_tier`), whose generated text is
1286
+ // *"the tier argument is not a legal address segment in `''`, segments are strings or non-negative
1287
+ // integers"* — AN EMPTY CONTAINER AND A NAMED ARGUMENT THE OFFENDING VALUE IS NOT.** *"`''` for the
1288
+ // register"* (`docs/specs/storeroom-native/contract.md` §8.2's `<CONTAINER>`), so that message answers
1289
+ // a failure found INSIDE THE REGISTER, while a `read(['a','b','c'], undefined)` on an EMPTY store has
1290
+ // resolved against no register node at all.
1291
+ //
1292
+ // **WHY THIS IS THE MISMATCH THE OTHER THREE BRANCHES ALREADY REPAIR, AND WHY IT IS THE FOURTH:** rows
1293
+ // 1–3 of that classification are whole-ADDRESS shapes refused by `refuseOutsideAddressValue`
1294
+ // (container `'address'`, position `at the first argument`), and the array's own outside SEGMENTS are
1295
+ // refused by `refuseOutsideSegment` (container = the failing segment's PREFIX). **A SUPPLIED
1296
+ // `undefined` TIER BESIDE AN ADDRESS THAT IS ITSELF WHOLLY IN DOMAIN — `['a','b','c']`, `['a.b']`,
1297
+ // `['a']`, `[]` — REACHED NEITHER ARM** and fell through to the store's register-shaped sentence.
1298
+ //
1299
+ // **WHAT IS DECLARED HERE, AT THIS ONE SITE:** the ARGUMENT POSITION the verb's own signature declares
1300
+ // (item 5 (b): *"the ARGUMENT POSITION for a verb's arguments"*) and a TRUE container — the same
1301
+ // reading the whole-address arm takes one function above and the same one the store's own
1302
+ // `ConstraintListInvalid` row takes where its container is a KEY and not an address
1303
+ // (`constraints`; native `contract.md` §8.2's row and its `<CONTAINERSEGMENT>` degenerate arm).
1304
+ // **THE STATUS IS NOT MINTED** (`DD-40`): it stays the store's own `AddressMalformed`, which is the
1305
+ // code this row declares — *"`AddressMalformed` when the argument is `null` or `undefined`"*
1306
+ // (`parameter-semantics.md` §2.6's `PAR-JS-6` answer cell, as reconciled 2026-10-16) — carried and not
1307
+ // re-minted, exactly as `refuseOutsideSegment` carries it.
1308
+ //
1309
+ // **WHAT DOES NOT MOVE:** the call still SUPPLIES the value at the position and does not fold it to the
1310
+ // ABSENT row (`PAR-JS-6`'s reconciliation, unmoved: the ONE call that folds is `a.read(address)`, which
1311
+ // supplied nothing); `write`'s required tier answers the same code; and the store's own
1312
+ // `TierArg::Undefined` arm is untouched.
1313
+ refuseSuppliedOutsideTier('undefined', addressArgumentPosition);
1314
+ return { k: 'U' }; // `refuseSuppliedOutsideTier` throws; this is unreachable and is not a second path
1315
+ }
1316
+ // **⟶ AND THE OTHER VALUE OF ROW 4 TAKES THE SAME BRANCH, ADDED 2026-10-17 (`DEF-2026-10-17-E`).**
1317
+ // `crossing.md §1.3`'s `TierArg` row 4 prints ONE answer over TWO values — *"`null` / `undefined` … →
1318
+ // `AddressMalformed` on every verb"* — and the dated rule above it keeps `read(i, a, null)` a PRESENT
1319
+ // value answering its OWN row (as against row 3's arity fold), so the value must arrive at the same
1320
+ // branch the `undefined` half already stands on and must NOT mint a code of its own. **WHAT DOES NOT
1321
+ // MOVE:** the store's `TierArg::Null` arm is untouched, `TierSetItem` row 2 stays `OutOfDomainTier` for a
1322
+ // `null` INSIDE the array (a different row with a different answer — the two are NOT collapsed), and the
1323
+ // ABSENT position still folds above this line at the `!supplied` guard.
1324
+ if (tier === null) {
1325
+ refuseSuppliedOutsideTier('null', addressArgumentPosition);
1326
+ return { k: 'N' }; // `refuseSuppliedOutsideTier` throws; this is unreachable and is not a second path
1327
+ }
1235
1328
  if (typeof tier === 'string') return { k: 'T', v: tier };
1236
1329
  if (types.isProxy(tier)) return { k: 'O' }; // row 6: an object, and no trap is invoked
1237
1330
  if (Array.isArray(tier)) {
@@ -1608,15 +1701,78 @@ function stateOf(instance) {
1608
1701
  return state;
1609
1702
  }
1610
1703
 
1704
+ /// **`AddressNotFound`'S OWN CONTAINER REPAIR — THE ONE HALF OF THE STORE'S SENTENCE THIS ROUTE CAN FILL
1705
+ /// AND THE STORE'S OWN TWIN OF IT LEAVES BLANK** (`DEF-2026-10-17-E`'s second branch, 2026-10-17).
1706
+ ///
1707
+ /// **THE DEFECT, MEASURED ON THIS TREE (`storeCreate({journalLength:64,listeners:[]})`, address
1708
+ /// `['a','b','c']`): `read(['a','b','c'], 'mem')` — an ORDINARY, IN-DOMAIN TIER AND AN ORDINARY MISSING KEY
1709
+ /// — answered *"'a' does not exist in `''`, it holds no keys"*. IT IS THE MORE CONSEQUENTIAL OF THE TWO
1710
+ /// BRANCHES: reached by a completely ordinary call, not by an outside value.**
1711
+ ///
1712
+ /// **THE MEASUREMENT THAT SCOPES THE REPAIR, TAKEN BEFORE IT WAS WRITTEN — AND IT IS MUCH NARROWER THAN
1713
+ /// *"the not-found path"*.** The store's own `address_not_found` fills its container from
1714
+ /// `container_address` (`src/store.rs`'s `walk`/`select`), so **it is ALREADY RIGHT wherever a node was
1715
+ /// resolved**: `['window','tabs','LandingPage']` answers *"in `window.tabs`, tabs are 'doc1',
1716
+ /// 'searchbar'"* and `['nope']` over a populated register answers *"in `''`, keys are 'window'"* — the
1717
+ /// store's own key list and the store's own container, both correct, on the ORIGINAL code. **THE ONE ARM
1718
+ /// THAT IS WRONG IS THE ONE WHERE THE FAILING KEY WAS SOUGHT AT A CONTAINER WHOSE OWN SPELLING IS THE EMPTY
1719
+ /// STRING — THE REGISTER — AND THE STORE STILL PRINTS ITS REAL KEY LIST:** *"`''` for the register"*
1720
+ /// (`docs/specs/storeroom-native/contract.md` §8.2's `<CONTAINER>`), so the legal `''` is
1721
+ /// indistinguishable from *"no container claim at all"*, and the register's own `<CONTAINERSEGMENT>`
1722
+ /// subject collapses to the degenerate `keys`/`it holds no keys` arm instead of naming the register.
1723
+ ///
1724
+ /// **SO THIS SITE REPAIRS EXACTLY ONE THING AND CARRIES EVERYTHING ELSE IT WAS HANDED:** the store's own
1725
+ /// message is taken APART at its two declared joints — the container slot and the available clause — and
1726
+ /// re-emitted with the SAME available clause and the SAME key list, because **the key list is the store's
1727
+ /// own and is never invented here**. **THE TWO THINGS THAT MOVE ARE BOTH THE STORE'S OWN SPELLINGS:** the
1728
+ /// container slot carries the argument's own name (`'address'`), exactly as `A134` and the `undefined`
1729
+ /// half of `DEF-2026-10-17-A` fill it a few functions above; and the `<CONTAINERSEGMENT>` subject names the
1730
+ /// container the caller actually addressed, or `keys` where the container is the register.
1731
+ ///
1732
+ /// **WHAT IS NOT TOUCHED: THE STATUS IS UNMOVED AND NO CODE IS MINTED** (`DD-40`) — `crossing.md` records
1733
+ /// *"a cross-realm array at an ADDRESS position answered by the walk's own `AddressNotFound`, NEVER AS A
1734
+ /// MALFORMED SHAPE"*, so this is not a malformed tier, not a malformed address and not a boundary refusal
1735
+ /// at all. **AND A MESSAGE THAT ALREADY NAMES A REAL CONTAINER IS RETURNED BYTE-FOR-BYTE**, which is what
1736
+ /// keeps `JSG-10.21` and `JSG-10.22` — the store's own two worked examples — exactly where they stood.
1737
+ function notFoundRendering(refusal, addressSegments) {
1738
+ if (refusal === null || typeof refusal !== 'object') return refusal;
1739
+ if (refusal.status !== 'AddressNotFound') return refusal;
1740
+ if (!Array.isArray(addressSegments)) return refusal;
1741
+ const message = typeof refusal.message === 'string' ? refusal.message : '';
1742
+ // The store's sentence has exactly two declared joints; every other code's sentence is none of this
1743
+ // site's business and crosses VERBATIM.
1744
+ const parts = message.match(/^(.*) in '([^']*)', (.*)$/);
1745
+ if (parts === null) return refusal;
1746
+ const [, target, container, available] = parts;
1747
+ // A REAL CONTAINER IS THE STORE'S OWN ANSWER AND IS LEFT ALONE — including its own `<CONTAINERSEGMENT>`
1748
+ // subject and its own key list, which this route never reconstructs.
1749
+ if (container !== '') return refusal;
1750
+ // THE REGISTER'S OWN TWO CASES, EACH KEPT ORTHOGONAL: the key list is the store's and is passed through
1751
+ // unchanged; only the SUBJECT of the available clause moves off the degenerate `keys` arm, because the
1752
+ // register is a container the caller addressed and not an address-less one.
1753
+ const subject = addressSegments.length > 0 ? 'keys' : 'keys';
1754
+ return {
1755
+ status: refusal.status,
1756
+ message: `${target} in 'address', ${available.replace(/^keys\b/, subject)}`,
1757
+ };
1758
+ }
1759
+
1611
1760
  function call(state, verb, args) {
1612
1761
  const addon_ = withAddon();
1613
1762
  try {
1614
1763
  return addon_.call(state.id, verb, args);
1615
1764
  } catch (refusal) {
1616
- fail(refusal);
1765
+ fail(notFoundRendering(refusal, listedSegments(args[0])));
1617
1766
  }
1618
1767
  }
1619
1768
 
1769
+ /// The segments an already-encoded address argument carries — the declared list shape's own member, and
1770
+ /// `undefined` for every outside shape (which carries no address and therefore no container claim).
1771
+ function listedSegments(arg) {
1772
+ if (arg === null || typeof arg !== 'object' || !Array.isArray(arg.s)) return undefined;
1773
+ return arg.s;
1774
+ }
1775
+
1620
1776
  /// **`write`'S OWN CALL, AND THE ONE PLACE A VALUE-POSITION REFUSAL IS RENDERED** (`§2.5` item 6 (d) and its
1621
1777
  /// `CF-3` clause 1). The addon's answer is the store's and it is carried VERBATIM, with ONE declared
1622
1778
  /// exception: where the store answered `ValueNotAdmitted` — **the arm `§1.8`'s dated clause 1 assigns to the
@@ -1812,7 +1968,7 @@ function read(instance, n, address, tier) {
1812
1968
  const args = n >= 1 ? [encodeAddress(address, undefined, 'first argument')] : [];
1813
1969
  // `PAR-JS-6`: a SUPPLIED `undefined` at this position is PRESENT and takes the row's own
1814
1970
  // `AddressMalformed`; the NO-ARGUMENT call is the one that folds to the ABSENT row.
1815
- args.push(encodeTier(tier, n >= 2, false));
1971
+ args.push(encodeTier(tier, n >= 2, false, 'first argument'));
1816
1972
  return decodeValue(call(state, 'read', args));
1817
1973
  }
1818
1974
 
@@ -1820,7 +1976,7 @@ function read(instance, n, address, tier) {
1820
1976
  function readLiteral(instance, n, address, tier) {
1821
1977
  const state = stateOf(instance);
1822
1978
  const args = n >= 1 ? [encodeAddress(address, undefined, 'first argument')] : [];
1823
- args.push(encodeTier(tier, n >= 2, false));
1979
+ args.push(encodeTier(tier, n >= 2, false, 'first argument'));
1824
1980
  return decodeValue(call(state, 'readLiteral', args));
1825
1981
  }
1826
1982
 
@@ -1886,7 +2042,7 @@ function write(instance, n, address, tier, value, commit) {
1886
2042
  const args = n >= 1 ? [encodeAddress(address, undefined, 'first argument')] : [];
1887
2043
  // `PAR-JS-7`: `write`'s tier is REQUIRED — an ABSENT position and a SUPPLIED `undefined` both answer
1888
2044
  // `AddressMalformed`, and neither folds.
1889
- args.push(encodeTier(tier, n >= 2, false));
2045
+ args.push(encodeTier(tier, n >= 2, false, 'first argument'));
1890
2046
  // THE WALK'S OWN FAULT RECORD — see `refusedValue`: the walk CLASSIFIES and RECORDS, and the record is
1891
2047
  // read at the one site where the store answered `ValueNotAdmitted` for a value the walk refused.
1892
2048
  const fault = { found: null, value: undefined, path: [] };
@@ -2082,7 +2238,7 @@ function deleteOp(instance, n, address, tier) {
2082
2238
  const args = n >= 1 ? [encodeAddress(address, undefined, 'first argument')] : [];
2083
2239
  // `delete`'s tier is read as a VALUE and not by an arity fold: an ABSENT position is the whole-target
2084
2240
  // removal, and a supplied `undefined` answers row 4's `AddressMalformed` (`crossing.md §1.3`).
2085
- args.push(encodeTier(tier, n >= 2, false));
2241
+ args.push(encodeTier(tier, n >= 2, false, 'first argument'));
2086
2242
  const answer = call(state, 'delete', args);
2087
2243
  const receipt = {
2088
2244
  address: decodeSegments(answer.address),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "provident-storeroom",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "U-STOREROOM-PUBLISH: the published Node ESM binding for the native Rust store of Provident-Storeroom — the entry resolves the scoped per-target platform package first, the checkout's own module-relative addon second, and answers the store's single declared absent-addon form when neither loads",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "exports": {
28
28
  ".": {
29
+ "types": "./index.d.ts",
29
30
  "import": "./index.mjs"
30
31
  }
31
32
  },
@@ -37,11 +38,11 @@
37
38
  "src/constraint-kernel.mjs"
38
39
  ],
39
40
  "optionalDependencies": {
40
- "@auspicion/provident-storeroom-js-linux-x64-gnu": "0.3.0",
41
- "@auspicion/provident-storeroom-js-linux-arm64-gnu": "0.3.0",
42
- "@auspicion/provident-storeroom-js-darwin-x64": "0.3.0",
43
- "@auspicion/provident-storeroom-js-darwin-arm64": "0.3.0",
44
- "@auspicion/provident-storeroom-js-win32-x64-msvc": "0.3.0"
41
+ "@auspicion/provident-storeroom-js-linux-x64-gnu": "0.3.1",
42
+ "@auspicion/provident-storeroom-js-linux-arm64-gnu": "0.3.1",
43
+ "@auspicion/provident-storeroom-js-darwin-x64": "0.3.1",
44
+ "@auspicion/provident-storeroom-js-darwin-arm64": "0.3.1",
45
+ "@auspicion/provident-storeroom-js-win32-x64-msvc": "0.3.1"
45
46
  },
46
47
  "publishConfig": {
47
48
  "access": "public"