provident-storeroom 0.2.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.
- package/README.md +65 -25
- package/index.d.ts +215 -76
- package/index.mjs +908 -296
- package/package.json +9 -7
- package/src/constraint-kernel.mjs +1330 -0
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
|
|
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
|
-
**
|
|
36
|
-
member set is the
|
|
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(
|
|
42
|
-
| `readLiteral(
|
|
43
|
-
| `write(
|
|
44
|
-
| `delete(
|
|
45
|
-
| `rollback(
|
|
46
|
-
| `listen(
|
|
47
|
-
| `unlisten(
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
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
|
|
61
|
-
*"`write(instance, address, tier, value)`"* READS *"`write(
|
|
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
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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.d.ts
CHANGED
|
@@ -6,21 +6,31 @@
|
|
|
6
6
|
// banner, no build-time code generator produces it, and it is the file the package's own `types` field
|
|
7
7
|
// reaches and the package's own `files` allowlist ships.
|
|
8
8
|
//
|
|
9
|
-
// **IT DECLARES THREE THINGS AND NOTHING ELSE** (`distribution.md §5.2`): (1) the
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
9
|
+
// **IT DECLARES THREE THINGS AND NOTHING ELSE** (`distribution.md §5.2`): (1) the claimed entry's OWN
|
|
10
|
+
// NAMED EXPORT SET — **ONE NAME, `storeCreate`, AND NOTHING ELSE** (`surface.md §2.9` item 1's `A127`
|
|
11
|
+
// clause; `docs/decisions.md` · `A127`/`A128`, 2026-10-16: the module-level count is `11 → 1` ✓, the
|
|
12
|
+
// deprecation window of `A128`'s fiat being declared away at that clause); (2) the instance's own member
|
|
13
|
+
// set, **TWELVE OWN MEMBERS AND NOTHING ELSE — `10 + 1 + 1 = 12` ✓** (`distribution.md §5.2` item 2 read
|
|
14
|
+
// with `surface.md §2.4` item 9 (f)'s `A127` clause): **THE TEN METHODS** `read(address, tier?)` ·
|
|
15
|
+
// `readLiteral(address, tier?)` · `write(address, tier, value, commit?)` · `delete(address, tier?)` ·
|
|
16
|
+
// `rollback(opId)` · `listen(address)` · `unlisten(handle)` · `addConstraint(pair, constraint)` ·
|
|
17
|
+
// `constraintOn(pair, constraint)` · `constraintOff(pair, constraint)`, **PLUS `register(handle, listener)
|
|
18
|
+
// -> undefined` and `settle(record) -> undefined`** — the last being THE ORDERING SEAM the kernel calls and
|
|
19
|
+
// the entry implements; and (3) the failure surface, a thrown plain object with exactly
|
|
17
20
|
// `{status, message}`.
|
|
18
21
|
//
|
|
19
|
-
// **
|
|
22
|
+
// **THE TEN METHODS TAKE THE RECEIVER'S OWN POSITION AWAY: `8 → 1` ✓ AND `4 → 12` ✓** (`surface.md §2.9`
|
|
23
|
+
// item 1's and `§2.4` item 9 (f)'s `A127` clauses). The seven verbs that reach the store are METHODS of the
|
|
24
|
+
// object `storeCreate` returned, so **NO DECLARED SIGNATURE CARRIES A LEADING `instance` POSITION** — the
|
|
25
|
+
// receiver is not a position — and the module namespace's own spelling, not a second name at any layer,
|
|
26
|
+
// is what a consumer reaches them through. **`on` AND `off` ARE MERGED AWAY BY `A127` AND ARE NOT
|
|
27
|
+
// MEMBERS**: the listener registration route is `listen` + `register` and its withdrawal is `unlisten`.
|
|
28
|
+
//
|
|
29
|
+
// **AND THE RECORDS THOSE METHODS ANSWER WITH ARE DECLARED BESIDE THEM, WHICH IS STILL PART (1) AND NOT A
|
|
20
30
|
// FOURTH THING**: `Address` · `Tier` · `TierSet` · `StoreConfig` · `BaseState` · `JournalOp` ·
|
|
21
31
|
// `WriteRecord` · `DeleteRecord` · `RollbackRecord` · `Handle` · `Listener` are the SHAPES OF THE
|
|
22
32
|
// ARGUMENTS AND OF THE ANSWERS, in `DD-39`'s own member spellings (the sibling directory's `contract.md
|
|
23
|
-
// §0.2`), and a declaration that did not carry them would declare
|
|
33
|
+
// §0.2`), and a declaration that did not carry them would declare one name and no surface. **None of
|
|
24
34
|
// them is a STORE type**: no register, no anchor, no tier tree, no journal and no store verb is declared
|
|
25
35
|
// here (`§5.2` item 4).
|
|
26
36
|
//
|
|
@@ -39,6 +49,28 @@
|
|
|
39
49
|
// (`distribution.md §5.2` item 4): **it declares NO store type, NO store verb, NO `findAddress`, NO
|
|
40
50
|
// release verb and NO constraint or repair seam** — each of those is a declaration the sibling directory
|
|
41
51
|
// refuses, and a declaration file carrying one would declare a surface the package does not publish.
|
|
52
|
+
//
|
|
53
|
+
// **⟶ AND THE LIMITS OF THIS FILE ARE STATED RATHER THAN IMPLIED, ADDED 2026-10-17** (`DEF-2026-10-16-Q`:
|
|
54
|
+
// *"`bindings/js/index.d.ts` IS TYPE-CHECKED NOWHERE, AND THE TYPES SHIP TO CONSUMERS"*). **NOTHING IN THIS
|
|
55
|
+
// REPOSITORY TYPE-CHECKS THIS FILE — no `tsc`, no `tsd`, no `checkJs` and no type-test file anywhere in the
|
|
56
|
+
// tree — so EVERY CHANGE MADE HERE IS TEXTUAL: it is a claim read by a HUMAN and by a consumer's own
|
|
57
|
+
// compiler, never a claim this repository's own suite can fail on.** **THE THREE CLAIMS A `TypeScript`
|
|
58
|
+
// DECLARATION CANNOT ENFORCE, EACH NAMED SO NO READER READS THEM AS ENFORCED:**
|
|
59
|
+
// 1. **`tier?: TierSet` CANNOT EXPRESS SUPPLIED-VERSUS-OMITTED `undefined`** (`PAR-JS-6`: a SUPPLIED
|
|
60
|
+
// `undefined` at the tier position is PRESENT and takes the store's `AddressMalformed`, while the call
|
|
61
|
+
// that supplied NOTHING there folds to the ABSENT row). An optional parameter admits both spellings
|
|
62
|
+
// identically and no type can separate them; the distinction is a RUNTIME one, driven at
|
|
63
|
+
// `a127-surface.test.mjs`.
|
|
64
|
+
// 2. **`Address = readonly (string | number)[]` CANNOT EXPRESS NON-NEGATIVE INTEGER** (`PAR-JS-5`). The
|
|
65
|
+
// domain is a string key or a non-negative integer a `u64` can carry exactly; `number` admits `-1`,
|
|
66
|
+
// `1.5`, `NaN` and `Infinity`, each of which the boundary REFUSES with the store's own
|
|
67
|
+
// `AddressMalformed`. The narrowest lawful widening a declaration can make is `number`, and this file
|
|
68
|
+
// makes it.
|
|
69
|
+
// 3. **THE INSTANCE'S *"TWELVE OWN MEMBERS AND NOTHING ELSE"* IS NOT STRUCTURALLY ENFORCEABLE HERE**
|
|
70
|
+
// (`§2.4` item 9 (f)'s `A127` clause; `§2.9` item 1's). An interface declares the members a value HAS
|
|
71
|
+
// and constrains no excess member, so a product carrying a thirteenth own member still satisfies
|
|
72
|
+
// `StoreInstance`. The count is driven at the boundary instead (`a127-surface.test.mjs`'s
|
|
73
|
+
// `Object.getOwnPropertyNames` cell, which exists precisely because this declaration cannot fail on it).
|
|
42
74
|
|
|
43
75
|
/**
|
|
44
76
|
* A position in the register: the address a verb is called at, as a sequence of path segments.
|
|
@@ -76,9 +108,9 @@ export type TierSet = Tier | readonly Tier[];
|
|
|
76
108
|
* `contract.md` `DD-36` as amended 2026-10-15; `parameter-semantics.md §2.21` = `PAR-JS-21`): this cell as
|
|
77
109
|
* filed read *"the store's THREE declared keys and no fourth"* and is re-spelled IN PLACE to the four-key,
|
|
78
110
|
* no-FIFTH reading — the fourth declared key is `constraints`, whose own declaration stands below, and the
|
|
79
|
-
* set's declared arity is `4`.** **NO OTHER CELL OF THIS FILE MOVES** (`distribution.md §5.2
|
|
80
|
-
* `
|
|
81
|
-
*
|
|
111
|
+
* set's declared arity is `4`.** **NO OTHER CELL OF THIS FILE MOVES** (`distribution.md §5.2`), **READ AT
|
|
112
|
+
* THE FIGURES `A127` MOVED** — the entry's `1` named export (`11 → 1` ✓), the addon's `5`, the instance's
|
|
113
|
+
* `12` own members (`4 → 12` ✓), the kernel's `5` and the store's `8` register rows.
|
|
82
114
|
*/
|
|
83
115
|
export interface StoreConfig {
|
|
84
116
|
/** The journal's declared length: a positive integer (`PAR-JS-3`). */
|
|
@@ -294,18 +326,143 @@ export interface CommitRecord {
|
|
|
294
326
|
}
|
|
295
327
|
|
|
296
328
|
/**
|
|
297
|
-
* **THE INSTANCE `storeCreate` RETURNS —
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
329
|
+
* **THE INSTANCE `storeCreate` RETURNS — THE TWELVE OWN MEMBERS OF `surface.md §2.4` item 9 (f)'s `A127`
|
|
330
|
+
* clause, `10 + 1 + 1 = 12` ✓: THE TEN METHODS, `register` AND `settle`.** Each is reached through the
|
|
331
|
+
* factory's own product alone (`package.md §1.3` item 3) — **NO member below is a named export**, because
|
|
332
|
+
* the module namespace carries ONE name, `storeCreate` (`§2.9` item 1's `A127` clause; `11 → 1` ✓).
|
|
333
|
+
*
|
|
334
|
+
* **THE TEN METHODS ARE THE DECLARED POSITIONS OF `§2.2`, `§2.4`, `§2.10` AND `§2.12` WITH THE LEADING
|
|
335
|
+
* `instance` POSITION DROPPED** (`A127`): `a.read(address, tier?)` is the declared `read`, `a.write(address,
|
|
336
|
+
* tier, value, commit?)` the declared `write`, and so on — **the receiver IS the instance, so the position
|
|
337
|
+
* is not a position and the arity every one of them is judged by is the arity of the method's OWN call.**
|
|
338
|
+
* **`on` and `off` are merged away and are NOT members**: registration is `listen` + `register`, and
|
|
339
|
+
* withdrawal is `unlisten`.
|
|
340
|
+
*
|
|
341
|
+
* **THE STATE IS PRIVATE AND NONE OF THE TWELVE IS A RELEASE VERB** (`surface.md §2.1` (e) item 1; `A74`):
|
|
342
|
+
* the instance's own state is released with the instance and by nothing else — no `dispose()`, no `close()`
|
|
343
|
+
* and no finalizer is declared here.
|
|
301
344
|
*/
|
|
302
345
|
export interface StoreInstance {
|
|
303
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Read a leaf's literal, a branch's assembled value, or the empty address's whole register.
|
|
348
|
+
*
|
|
349
|
+
* **`tier` IS THE READER'S ARITY** (`PAR-JS-6`): absent, ONE token, or an ARRAY of tokens read as an
|
|
350
|
+
* ANY-MATCH set — **so the earlier `tier?: Tier` spelling refused, as a type error, a lawful call
|
|
351
|
+
* spelling a set**.
|
|
352
|
+
*
|
|
353
|
+
* **AND `undefined` AT THIS POSITION IS NOT THE SAME CALL AS NO POSITION AT ALL** (`parameter-semantics.md
|
|
354
|
+
* §2.6`, read with `acceptance.md §4.1` item 7): **a SUPPLIED `undefined` is PRESENT and the store answers
|
|
355
|
+
* `AddressMalformed` for it**, while ONLY the call that spells NO tier folds to absent. **THE DECLARATION
|
|
356
|
+
* CANNOT TELL THE TWO APART** — `tier?: TierSet` admits both spellings, which is why `TierSet` carries no
|
|
357
|
+
* `undefined` member — and the distinction is a RUNTIME one at this member (`a127`'s
|
|
358
|
+
* `read_the_absent_tier_position_is_in_domain`).
|
|
359
|
+
*/
|
|
360
|
+
read(address: Address, tier?: TierSet): unknown;
|
|
361
|
+
/** The same read, narrowed to a leaf — a branch answers `ReadTargetIsBranch`; `tier` is `TierSet`, with the same SUPPLIED-`undefined` reading as `read`. */
|
|
362
|
+
readLiteral(address: Address, tier?: TierSet): unknown;
|
|
363
|
+
/**
|
|
364
|
+
* Write `value` at `address` on `tier` — EXACTLY ONE token, never an array (`PAR-JS-7`).
|
|
365
|
+
*
|
|
366
|
+
* **THE DECLARED ORDER IS `write(address, tier, value, commit?)`** (`surface.md §2.2`'s dated clause of
|
|
367
|
+
* 2026-10-15; `parameter-semantics.md §2.20`), read with `§2.4` item 9 (f)'s `A127` clause: **THREE
|
|
368
|
+
* REQUIRED ARGUMENTS AND THE OPTIONAL ONE LAST — the commit, at the FOURTH position of the METHOD**,
|
|
369
|
+
* which is the position the `instance`-leading spelling made FIVE (`A124`).
|
|
370
|
+
*
|
|
371
|
+
* **AN ABSENT `commit` IS IN DOMAIN** (§2.2 clause 3: *"the write opens or joins a commit all the
|
|
372
|
+
* same"*) and **NO DEFAULT RECORD IS FABRICATED FOR IT**; **the admitted form is the kernel's own
|
|
373
|
+
* `CommitRecord`** (`surface.md §2.4` item 9 (g) item 1: an object carrying a `pending` member present
|
|
374
|
+
* and not `undefined`), and **every other form at this position — absent, `undefined`, `null`, a
|
|
375
|
+
* primitive, a function, a `Proxy`, an object whose `pending` member is absent or `undefined` — throws
|
|
376
|
+
* THE CLASS TEST'S OWN `TypeError`, whose `status` member is ABSENT and whose STRING `message` member is
|
|
377
|
+
* REQUIRED** (`surface.md` §2.4 item 9 (g) item 1's discriminator, landed 2026-10-15 on `A116` (D1); the
|
|
378
|
+
* operative predicate is `file-tier-save.test.mjs`'s `positionRefusal`, which asserts exactly those two
|
|
379
|
+
* halves). **A REFUSED POSITION STOPS THE WRITE**: no verb is reached and no byte moves.
|
|
380
|
+
*
|
|
381
|
+
* **⟶ CORRECTED 2026-10-17 — THIS CELL ATTRIBUTED THAT `TypeError` TO *"the registration site's own"*
|
|
382
|
+
* FORM, AND THE ATTRIBUTION WAS FALSE** (`DEF-2026-10-16-Q`; `surface.md` §2.5 item 5 (g), THE OPERATIVE
|
|
383
|
+
* READING). **THE REGISTRATION SITE THROWS NO `TypeError` AT ALL**: its refusal *"IS a rejection under
|
|
384
|
+
* `A76` and travels in THIS section's single form, with its `status` drawn from the store's closed set —
|
|
385
|
+
* the store's own `AddressMalformed`"*, `message` generated as clause (d) declares, so `register`'s
|
|
386
|
+
* outside argument answers a plain `{status, message}` (driven at `register.test.mjs`'s
|
|
387
|
+
* `isRegistrationRefusal`, which counts a `TypeError` as a FAILURE). **A `TypeError` thrown by any
|
|
388
|
+
* STORE-REACHING VERB is itself a FINDING** (`a127-surface.test.mjs`'s
|
|
389
|
+
* `a127_no_store_reaching_verb_throws_the_class_test_form`). The two forms are DIFFERENT forms of
|
|
390
|
+
* DIFFERENT sites, and this position's is the class test's own, declared at `§2.4` item 9 (g) —
|
|
391
|
+
* beside, and not drawn from, the registration site's `§2.4` item 5.
|
|
392
|
+
*
|
|
393
|
+
* **AND A SUPPLIED `undefined` AT THE `tier` POSITION IS PRESENT HERE TOO** (`parameter-semantics.md
|
|
394
|
+
* §2.6`; `PAR-JS-6`): it is not the absent tier and the store answers `AddressMalformed` for it.
|
|
395
|
+
*/
|
|
396
|
+
write(address: Address, tier: Tier, value: unknown, commit?: CommitRecord): WriteRecord;
|
|
397
|
+
/**
|
|
398
|
+
* Remove the versions the address names, and answer the operation's record.
|
|
399
|
+
*
|
|
400
|
+
* **THE NAME IS `delete` AND IT IS A METHOD NAME, WHICH IS WHY THIS DECLARATION PARSES**: `delete` is a
|
|
401
|
+
* RESERVED WORD, so under the superseded module-level spelling the function had to be declared as
|
|
402
|
+
* `deleteOp` and re-exported (`export { deleteOp as delete }`). **A METHOD NAME IS NOT AN IDENTIFIER
|
|
403
|
+
* BINDING, so the member is declared under the one name the surface publishes** (`A127`).
|
|
404
|
+
*/
|
|
405
|
+
delete(address: Address, tier?: Tier): DeleteRecord;
|
|
406
|
+
/**
|
|
407
|
+
* Roll the journal back to `opId`, and answer what the rollback restored.
|
|
408
|
+
*
|
|
409
|
+
* **`opId` IS A NON-EMPTY `string` AND NOT A NUMBER** (`PAR-JS-9`'s own unit: *"the `JournalOp.opId`
|
|
410
|
+
* string"*): a number is an OUTSIDE value the store answers `AddressMalformed` for, and the ordinary
|
|
411
|
+
* call `a.rollback(w.op.opId)`, whose id is the string `write` returned, is a correct call.
|
|
412
|
+
*/
|
|
413
|
+
rollback(opId: string): RollbackRecord;
|
|
414
|
+
/**
|
|
415
|
+
* Begin watching an address, and answer the fresh opaque handle it is keyed by.
|
|
416
|
+
*
|
|
417
|
+
* **AND IT IS AN ADDRESS SITE THAT DECLARES ITS ARGUMENT POSITION** (`parameter-semantics.md §2.17`'s
|
|
418
|
+
* dated clause; `surface.md §2.5` item 5 (b)'s position half): the address is `1` of `1`, so a CLASS
|
|
419
|
+
* refusal here — a `Proxy` over an array included — carries `a Proxy` AND `first argument` inside the one
|
|
420
|
+
* failure form's message, and NO trap is run (`NG-JS-I`).
|
|
421
|
+
*
|
|
422
|
+
* **A REPEATED CALL AT A HELD ADDRESS MINTS NOTHING AND ANSWERS THE ADDRESS'S EXISTING ENTRY'S HANDLE**
|
|
423
|
+
* (`write-and-read.md §6.5` item 12 (c); `§0.4` clause 2), so the two calls answer ONE opaque value.
|
|
424
|
+
*/
|
|
425
|
+
listen(address: Address): Handle;
|
|
426
|
+
/**
|
|
427
|
+
* Withdraw a watching, and answer `undefined` — a no-op success for every value outside the domain.
|
|
428
|
+
*
|
|
429
|
+
* **AND THE WITHDRAWAL CARRIES THE PACKAGE'S OWN HALF TOO** (`surface.md §2.4` item 7 (b)'s
|
|
430
|
+
* VALIDATE · UNLISTEN · DEREGISTER step list, MERGED INTO THIS ONE MEMBER by `A127`'s receiver ruling;
|
|
431
|
+
* `contract.md §5.5`'s fourth added entry): **the store-side home entry named by this call is withdrawn,
|
|
432
|
+
* and the registry's entry for the identity is REMOVED where the identity no longer stands anywhere** — so
|
|
433
|
+
* the registered function is unreachable afterwards and a re-`listen` at the withdrawn address answers a
|
|
434
|
+
* DIFFERENT handle. **AT `DD-39`'s CONSTRUCTION DUPLICATE — ONE caller-spelled token naming MORE THAN ONE
|
|
435
|
+
* entry at ONE address — ONE entry is withdrawn per call while the address still holds the identity, and
|
|
436
|
+
* the registry's entry STANDS: a later trigger there STILL returns that identity and the function fires
|
|
437
|
+
* for it ONCE, never once per entry** (`contract.md §5.5`'s third added entry; `§2.4` rule 4's *"never the
|
|
438
|
+
* function"*).
|
|
439
|
+
*/
|
|
440
|
+
unlisten(handle: Handle): void;
|
|
441
|
+
/**
|
|
442
|
+
* **THE POST-CREATION ADD ROUTE — `addConstraint(pair, constraint) -> constraint identity`**
|
|
443
|
+
* (`surface.md §2.12` item 2 (a) and item 3's ADD row; `parameter-semantics.md §2.25` = `PAR-JS-25`):
|
|
444
|
+
* **the pair's element IS the supplied `constraint` from this call on, whether the pair was HELD or
|
|
445
|
+
* NOT**, and at a pair already held the supplied constraint OVERWRITES the held one under **THE SAME
|
|
446
|
+
* IDENTITY** the pair was already added under, so the call throws nothing for the mere fact that the
|
|
447
|
+
* pair was held.
|
|
448
|
+
*
|
|
449
|
+
* **Every outside form of either position throws ONE `TypeError`, whose `status` member is ABSENT, and
|
|
450
|
+
* nothing is added, enabled, disabled or otherwise changed.**
|
|
451
|
+
*/
|
|
452
|
+
addConstraint(pair: ConstraintPair, constraint: Constraint): ConstraintIdentity;
|
|
453
|
+
/** **THE ENABLE HALF** (`§2.12` item 2 (a) and item 3's `constraintOn` row): `undefined`. **The
|
|
454
|
+
* `constraint` position is REQUIRED and is a NO-OP on every success** — the caller supplies as a function
|
|
455
|
+
* the identity it holds at that pair, the entry never substitutes one, and it is the element the entry
|
|
456
|
+
* carried at that pair that is evaluated at the next write. **Idempotent success where the pair already
|
|
457
|
+
* stands ENABLED.** */
|
|
458
|
+
constraintOn(pair: ConstraintPair, constraint: Constraint): void;
|
|
459
|
+
/** **THE DISABLE HALF** (`§2.12` item 2 (a) and item 3's `constraintOff` row): `undefined`; the pair's
|
|
460
|
+
* element is NOT evaluated on a subsequent write, and **a write the disabled constraint would have
|
|
461
|
+
* refused is ACCEPTED**. The `constraint` position's rule is `constraintOn`'s, clause for clause.
|
|
462
|
+
* **Idempotent success where the pair already stands DISABLED.** */
|
|
463
|
+
constraintOff(pair: ConstraintPair, constraint: Constraint): void;
|
|
464
|
+
/** Register `listener` under the opaque `handle`, and answer `undefined` (`surface.md §2.4` item 5 (b)). */
|
|
304
465
|
register(handle: Handle, listener: Listener): void;
|
|
305
|
-
/** Register a listener at `address` and answer the fresh opaque handle it is keyed by. */
|
|
306
|
-
on(address: Address, listener: Listener): Handle;
|
|
307
|
-
/** Withdraw the store-side home entry the `handle` names, and answer `undefined`. */
|
|
308
|
-
off(handle: Handle): void;
|
|
309
466
|
/**
|
|
310
467
|
* **THE ORDERING SEAM — `settle(record) -> undefined`** (`surface.md §2.4` item 9; `A116` (D1)–(D2);
|
|
311
468
|
* `PAR-JS-19`): the one member THE KERNEL CALLS and the entry implements, at the two instants of a
|
|
@@ -315,7 +472,19 @@ export interface StoreInstance {
|
|
|
315
472
|
* record's own `pending` member is delivered through this instance's own registry, one invocation per
|
|
316
473
|
* handle, each with the triggering address as its single argument). **Every other form at the record
|
|
317
474
|
* position — absent, `undefined`, `null`, a primitive, a function, a `Proxy`, an identity this instance
|
|
318
|
-
* never adopted — throws
|
|
475
|
+
* never adopted — throws THE ORDERING SEAM'S OWN `TypeError`, whose `status` member is ABSENT and whose
|
|
476
|
+
* STRING `message` member is REQUIRED, and changes nothing.**
|
|
477
|
+
*
|
|
478
|
+
* **⟶ CORRECTED 2026-10-17 — THIS CELL ATTRIBUTED THAT `TypeError` TO *"the registration site's own"*
|
|
479
|
+
* FORM AND THAT ATTRIBUTION WAS FALSE** (`DEF-2026-10-16-Q`; `surface.md` §2.5 item 5 (g), the operative
|
|
480
|
+
* reading of the registration site; `§2.4` item 9 (b), landed 2026-10-15 on `A116` (D1), which re-spells
|
|
481
|
+
* the re-spelling this position takes). **THE REGISTRATION SITE ANSWERS A PLAIN `{status, message}` with
|
|
482
|
+
* `status` `AddressMalformed` — a `TypeError` there is a FAILURE** (`register.test.mjs`'s
|
|
483
|
+
* `isRegistrationRefusal`), and **the seam's own form is declared at `§2.4` item 9 (b) and not at item
|
|
484
|
+
* 5**: *"a `TypeError` with its `status` member ABSENT and a STRING `message` member REQUIRED AND NOT
|
|
485
|
+
* FORBIDDEN"* (`§2.5` item 5 (g)'s own record of that re-spelling, whose two dated readings of one
|
|
486
|
+
* phrase it reports and settles by no clause). **SO THE TWO SITES' FORMS ARE NOT ONE FORM, and this
|
|
487
|
+
* member's is the seam's.**
|
|
319
488
|
*
|
|
320
489
|
* **THE RECORD POSITION TAKES THE KERNEL'S OWN `CommitRecord` — `{ attempt, op, triggered, pending }`,
|
|
321
490
|
* FOUR MEMBERS — AND NOT THE STORE'S `WriteRecord`** (`surface.md` `§2.4` item 9 (f)'s *"each with its
|
|
@@ -323,7 +492,7 @@ export interface StoreInstance {
|
|
|
323
492
|
* *"the carrier `CommitRecord.pending` and its two removal rules unchanged"*). **THE INSTANTS' OWN TABLE
|
|
324
493
|
* NAMES IT: the record is *"the `CommitRecord` `commit` is building"* at instant (a) and *"the SAME record
|
|
325
494
|
* identity"* at instant (b)** (`surface.md` `§2.4` item 9 (a)–(b)). **AND THE STORE'S RECORD IS NOT ONE:
|
|
326
|
-
* `WriteRecord` above is the three-member `{op, watched, triggered}` the `write`
|
|
495
|
+
* `WriteRecord` above is the three-member `{op, watched, triggered}` the `write` member answers with and
|
|
327
496
|
* carries NO `pending` member, `PAR-JS-13` is that record's returned `op` field (`parameter-semantics.md
|
|
328
497
|
* §2.13`) and not the record's own shape, and the kernel's record carries TWO of the store's members
|
|
329
498
|
* VERBATIM beside its own `attempt` identity and its own `pending` member** (`kernel-surface.md §2.1` item
|
|
@@ -356,62 +525,32 @@ export interface StoreInstance {
|
|
|
356
525
|
export function storeCreate(cfg: StoreConfig): StoreInstance;
|
|
357
526
|
|
|
358
527
|
/**
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
|
|
364
|
-
export function read(instance: StoreInstance, address: Address, tier?: TierSet): unknown;
|
|
365
|
-
|
|
366
|
-
/** The same read, narrowed to a leaf — a branch answers `ReadTargetIsBranch`; `tier` is `TierSet`. */
|
|
367
|
-
export function readLiteral(instance: StoreInstance, address: Address, tier?: TierSet): unknown;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Write `value` at `address` on `tier` — EXACTLY ONE token, never an array (`PAR-JS-7`).
|
|
371
|
-
*
|
|
372
|
-
* **⟶ AMENDED 2026-10-15 (`surface.md §2.2`'s dated clause of 2026-10-15; `parameter-semantics.md §2.20`):
|
|
373
|
-
* THE DECLARED ORDER IS `write(instance, address, tier, value, commit?)`** — **FOUR REQUIRED ARGUMENTS
|
|
374
|
-
* AND THE OPTIONAL ONE AT POSITION FIVE** (`proposal-review.md §22.5` item 5) — and this is the published
|
|
375
|
-
* declaration file `surface.md §2.4` item 9 (f) names.
|
|
376
|
-
*
|
|
377
|
-
* **AN ABSENT `commit` IS IN DOMAIN** (§2.2 clause 3: *"the write opens or joins a commit all the same"*)
|
|
378
|
-
* and **NO DEFAULT RECORD IS FABRICATED FOR IT**; **the admitted form is the kernel's own `CommitRecord`**
|
|
379
|
-
* (`surface.md §2.4` item 9 (g) item 1: an object carrying a `pending` member present and not `undefined`),
|
|
380
|
-
* and **every other form at this position throws the registration site's own `TypeError`**, whose `status`
|
|
381
|
-
* member is ABSENT. **A REFUSED POSITION STOPS THE WRITE**: no verb is reached and no byte moves.
|
|
528
|
+
* **THE POST-CREATION CONSTRAINT PAIR — `parameter-semantics.md §2.24` (`PAR-JS-24`)**: the key the three
|
|
529
|
+
* constraint methods name — **an `address` inside `§1.5`'s segment array, and an `id` that is a NON-EMPTY
|
|
530
|
+
* `string`** — **and NOT the whole of a batch element**, which is this pair PLUS its constraint function.
|
|
531
|
+
* **Every outside form of the pair throws the three methods' one `TypeError`**, and **a well-formed pair
|
|
532
|
+
* the entry does not carry is outside the two toggles' domain**: it is NOT a third population route.
|
|
382
533
|
*/
|
|
383
|
-
export
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
value: unknown,
|
|
388
|
-
commit?: CommitRecord,
|
|
389
|
-
): WriteRecord;
|
|
534
|
+
export interface ConstraintPair {
|
|
535
|
+
readonly address: Address;
|
|
536
|
+
readonly id: string;
|
|
537
|
+
}
|
|
390
538
|
|
|
391
539
|
/**
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* `
|
|
397
|
-
*
|
|
398
|
-
*
|
|
540
|
+
* **THE CONSTRAINT FUNCTION — `parameter-semantics.md §2.22` (`PAR-JS-22`)**: a JS function, supplied by THE
|
|
541
|
+
* CALLER at whichever of the three methods it takes — **the ADD route's own argument** or the batch
|
|
542
|
+
* element's own — **invoked by the KERNEL with ONE argument, the attempt's own context** (`PAR-C-16`: *"the
|
|
543
|
+
* attempt context — the constraint's ONE argument"*), and read for its answer (`kernel-surface.md §2.3`
|
|
544
|
+
* item 1: `true` is the only pass value). **Every non-function is outside the position AT EVERY ONE OF THE
|
|
545
|
+
* THREE METHODS**, and a non-function at the toggle's position is refused on the ARGUMENT's ground and
|
|
546
|
+
* never on the pair's.
|
|
399
547
|
*/
|
|
400
|
-
|
|
401
|
-
export { deleteOp as delete };
|
|
548
|
+
export type Constraint = (context: unknown) => unknown;
|
|
402
549
|
|
|
403
550
|
/**
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
* store answers `AddressMalformed` for — and made the ordinary call `rollback(i, w.op.opId)`, whose id is
|
|
409
|
-
* the string `write` returned, a type error.
|
|
551
|
+
* **THE CONSTRAINT IDENTITY — `parameter-semantics.md §2.25` (`PAR-JS-25`)**: ONE OPAQUE VALUE THE PACKAGE
|
|
552
|
+
* OWNS, minted once per pair, **equal to itself on a second `addConstraint` at the SAME pair** (the
|
|
553
|
+
* overwrite arm) **and distinguishable from every other pair's**. **No spelling for it is declared, no
|
|
554
|
+
* accessor reaches a member of it, and a consumer compares identities and never contents.**
|
|
410
555
|
*/
|
|
411
|
-
export
|
|
412
|
-
|
|
413
|
-
/** Begin watching an address, and answer the fresh opaque handle it is keyed by. */
|
|
414
|
-
export function listen(instance: StoreInstance, address: Address): Handle;
|
|
415
|
-
|
|
416
|
-
/** Withdraw a watching, and answer `undefined` — a no-op success for every value outside the domain. */
|
|
417
|
-
export function unlisten(instance: StoreInstance, handle: Handle): void;
|
|
556
|
+
export type ConstraintIdentity = object;
|