provident-storeroom 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +124 -6
- package/index.mjs +476 -26
- package/package.json +6 -6
- package/src/constraint-kernel.mjs +429 -6
package/index.d.ts
CHANGED
|
@@ -17,7 +17,22 @@
|
|
|
17
17
|
// `constraintOn(pair, constraint)` · `constraintOff(pair, constraint)`, **PLUS `register(handle, listener)
|
|
18
18
|
// -> undefined` and `settle(record) -> undefined`** — the last being THE ORDERING SEAM the kernel calls and
|
|
19
19
|
// the entry implements; and (3) the failure surface, a thrown plain object with exactly
|
|
20
|
-
// `{status, message}
|
|
20
|
+
// `{status, message, log}` — **THREE MEMBERS FROM 2026-10-16, `2 → 3`, on the architect's ruling *"Bubble
|
|
21
|
+
// the message log to the client on failure, override any clauses that forbid this."*** (`surface.md §2.5`'s
|
|
22
|
+
// clause of that date, the crossing form's ONE home; **the ONE figure that moves is the arity, and
|
|
23
|
+
// `storeCreate` remains the namespace's one name and the product its twelve own members**).
|
|
24
|
+
//
|
|
25
|
+
// **⟶ AND THE MEMBER-SET FIGURE ABOVE IS SUPERSEDED AND IS READ THROUGH THIS CLAUSE, 2026-10-17: THE
|
|
26
|
+
// OPERATIVE SET IS THIRTEEN OWN MEMBERS, `10 + 1 + 1 + 1 = 13` ✓, THE THIRTEENTH BEING `constraints()`** —
|
|
27
|
+
// the registered-pair read, declared at `surface.md §2.4` item 9 (f)'s `constraints` clause of that date and
|
|
28
|
+
// at `§2.12` item 2-bis, on the architect's ruling verbatim *"Add surface methods for reading registered
|
|
29
|
+
// constraints."* **THE BYTES ABOVE STAND AS THE `A127` PASS'S READING (`DEF-2026-10-02`: no whole-file
|
|
30
|
+
// rewrite) and every "twelve own members" figure in this file is read through this sentence as THIRTEEN.**
|
|
31
|
+
// **SO A DECLARATION FILE THAT STILL READS TWELVE OWN MEMBERS AFTER THAT DATE IS A FINDING** (`surface.md
|
|
32
|
+
// §2.4` item 9 (f)'s item 10, which names the declaration file among the cells that go red; item 13; its own
|
|
33
|
+
// mark at `§2.9` item 1). **THE TWO ROUTES THAT WOULD HAVE MOVED THE SET EARLIER ARE STILL REFUSED BY NAME
|
|
34
|
+
// AND THIS ONE IS NOT ONE OF THEM** (`§2.5`'s clause of 2026-10-16: a `constraintLog(commit)` reader and a
|
|
35
|
+
// second module-namespace name) — and the second `1` above is `settle`, the third `1` being `constraints`.
|
|
21
36
|
//
|
|
22
37
|
// **THE TEN METHODS TAKE THE RECEIVER'S OWN POSITION AWAY: `8 → 1` ✓ AND `4 → 12` ✓** (`surface.md §2.9`
|
|
23
38
|
// item 1's and `§2.4` item 9 (f)'s `A127` clauses). The seven verbs that reach the store are METHODS of the
|
|
@@ -188,14 +203,46 @@ export type StoreStatus =
|
|
|
188
203
|
| (string & {});
|
|
189
204
|
|
|
190
205
|
/**
|
|
191
|
-
* **THE
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
206
|
+
* **THE KERNEL'S OWN LOG ENTRY** — *"exactly six members — `seq` · `kind` · `id` · `message` · `opId` ·
|
|
207
|
+
* `state`"* (`docs/specs/storeroom-constraints/kernel-surface.md §2.5` item 1, whose member set is CLOSED:
|
|
208
|
+
* *"a seventh member of `LogEntry` … is not a variation, it is a different shape"*). **DECLARED HERE ONLY
|
|
209
|
+
* AS THE ELEMENT SHAPE OF THE FAILURE'S `log` MEMBER, AND MINTED BY NO CLAUSE OF THIS UNIT**: an attempt's
|
|
210
|
+
* message log entries are the KERNEL'S records, carried VERBATIM, and no flattening is declared — a client
|
|
211
|
+
* that reads one reads the kernel's own entry.
|
|
212
|
+
*
|
|
213
|
+
* `kind` is the kernel's closed four-member `LogKind` set, and `state` is the kernel's own `KC` token on the
|
|
214
|
+
* one `outcome` entry and `null` on the three non-`outcome` kinds.
|
|
215
|
+
*/
|
|
216
|
+
export interface LogEntry {
|
|
217
|
+
readonly seq: number;
|
|
218
|
+
readonly kind: 'constraint-check' | 'repair-run' | 'commit' | 'outcome';
|
|
219
|
+
readonly id: string | null;
|
|
220
|
+
readonly message: string;
|
|
221
|
+
readonly opId: string | null;
|
|
222
|
+
readonly state: string | null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* **THE SINGLE FAILURE SURFACE** (`contract.md §1.4`; `distribution.md §5.2` item 3) — **AND ITS MEMBER SET
|
|
227
|
+
* MOVES `2 → 3` FROM 2026-10-16 ON THE ARCHITECT'S RULING *"Bubble the message log to the client on failure,
|
|
228
|
+
* override any clauses that forbid this."*** (`surface.md §2.5`'s clause of that date, whose items 1–10 are
|
|
229
|
+
* the crossing form's ONE home). A THROWN plain object carrying exactly `{status, message, log}` — never an
|
|
230
|
+
* `Error` subclass, never a returned tagged union and never a `Promise` rejection. **The status is carried
|
|
231
|
+
* VERBATIM from the store's own closed set and the message is the store's own generated string**; this
|
|
232
|
+
* package mints neither.
|
|
233
|
+
*
|
|
234
|
+
* **`log` IS AN ORDINARY OWN ENUMERABLE DATA MEMBER OF THAT SAME PLAIN OBJECT** (item 9): *"written with an
|
|
235
|
+
* object literal, not `Object.defineProperty`, not a getter, not on a prototype and not behind a `Symbol`"* —
|
|
236
|
+
* so `Object.keys(caught)` reads exactly `["log","message","status"]` and its length is `3` on EVERY arm. **IT
|
|
237
|
+
* IS NEVER ABSENT, NEVER `null` AND NEVER A NON-ARRAY** (item 9), **and `[]` is its declared value where the
|
|
238
|
+
* failure's cause has no attempt at all** (item 4: the empty array, never an absent member and never a
|
|
239
|
+
* placeholder entry) — **while every failure whose attempt exists carries that attempt's own entries, taken
|
|
240
|
+
* BEFORE the attempt is disposed of** (item 10 (iii)).
|
|
195
241
|
*/
|
|
196
242
|
export interface StoreRefusal {
|
|
197
243
|
readonly status: StoreStatus;
|
|
198
244
|
readonly message: string;
|
|
245
|
+
readonly log: LogEntry[];
|
|
199
246
|
}
|
|
200
247
|
|
|
201
248
|
/** The opaque handle a listener registration is keyed by: the package's own value for one registration. */
|
|
@@ -340,7 +387,9 @@ export interface CommitRecord {
|
|
|
340
387
|
*
|
|
341
388
|
* **THE STATE IS PRIVATE AND NONE OF THE TWELVE IS A RELEASE VERB** (`surface.md §2.1` (e) item 1; `A74`):
|
|
342
389
|
* 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.
|
|
390
|
+
* and no finalizer is declared here. **⟶ AND `"THE TWELVE"` READS AS `THIRTEEN` FROM 2026-10-17, the
|
|
391
|
+
* thirteenth being `constraints()`** (this interface's own clause for it below; the file's header carries the
|
|
392
|
+
* member-set mark and the two still-refused routes).
|
|
344
393
|
*/
|
|
345
394
|
export interface StoreInstance {
|
|
346
395
|
/**
|
|
@@ -510,6 +559,66 @@ export interface StoreInstance {
|
|
|
510
559
|
* `storeCreate`'s own product alone.
|
|
511
560
|
*/
|
|
512
561
|
settle(record: CommitRecord): void;
|
|
562
|
+
/**
|
|
563
|
+
* **THE REGISTERED-PAIR READ — `constraints() -> ConstraintPair[]`** (`surface.md §2.4` item 9 (f)'s
|
|
564
|
+
* `constraints` clause of 2026-10-17, items 2–9; `§2.12` item 2-bis; `parameter-semantics.md §2.27` =
|
|
565
|
+
* `PAR-JS-27`) — **the THIRTEENTH own member** (`10 + 1 + 1 + 1 = 13` ✓, the third `1` being this member),
|
|
566
|
+
* added on the architect's ruling of that date, verbatim: *"Add surface methods for reading registered
|
|
567
|
+
* constraints."*
|
|
568
|
+
*
|
|
569
|
+
* **THE RECEIVER IS THE STORE, THE CALL TAKES NO ARGUMENT (arity `0`) AND IT THROWS NOTHING**: there is no
|
|
570
|
+
* outside argument for the class test to refuse, and the call makes NO STORE CALL, MINTS NO CODE, APPENDS
|
|
571
|
+
* NO JOURNAL ENTRY AND CHANGES NO NODE — so this member is one of the product's NON-STORE-REACHING members
|
|
572
|
+
* beside `register` and `settle`, and `§2.4` item 9 (f)'s rule (ii) has no subject at it.
|
|
573
|
+
*
|
|
574
|
+
* **WHAT IS RETURNED, EXACTLY — THE PAIRS AND NOT THE FUNCTIONS:** a **FRESH JS ARRAY on every call**,
|
|
575
|
+
* whose **every element is a FRESH plain object carrying EXACTLY TWO MEMBERS** — `address` (a fresh array of
|
|
576
|
+
* the store's own segments) and `id` (the constraint's own BARE `id`, a `string`) — the same two data the
|
|
577
|
+
* kernel's own registry is keyed by. **The empty array `[]` is the declared value where the instance carries
|
|
578
|
+
* no pair at all** (`PAR-JS-27`'s `domain` cell).
|
|
579
|
+
*
|
|
580
|
+
* **THE FOUR DECLARED EXCLUSIONS, EACH STATED SO A DECLARATION THAT VIOLATED ONE WOULD BE VISIBLE AT ITS OWN
|
|
581
|
+
* BYTES:**
|
|
582
|
+
* 1. **NO CONSTRAINT FUNCTION IS RETURNED** (item 3, four named grounds — the operative one being the
|
|
583
|
+
* anti-pattern rulings' *do not hand out a value whose later use the contract cannot bound*). The
|
|
584
|
+
* `Constraint` type below is that function and **NO MEMBER OF THIS RETURN CARRIES ONE**; a disabled pair
|
|
585
|
+
* makes the hazard sharp, since `constraintOff` parks a stub in the kernel while the caller's function is
|
|
586
|
+
* kept in the entry.
|
|
587
|
+
* 2. **NO OPAQUE IDENTITY IS EXPOSED** (item 4): `ConstraintIdentity` is NOT reachable through this return —
|
|
588
|
+
* `PAR-JS-25`'s opacity would break the moment a consumer read one out of the array. **The pair is the
|
|
589
|
+
* caller's own datum; the identity is this unit's opaque handle for it, and the two are NOT the same
|
|
590
|
+
* datum.**
|
|
591
|
+
* 3. **NO ORDER IS PROMISED** (item 6): the returned array's order is **UNDECLARED** and a consumer compares
|
|
592
|
+
* the pairs **as a SET and never as a sequence** (`DD-22`; `§2.7` item 3). **Nothing in this declaration
|
|
593
|
+
* may be read as a registration order, an address order or a `seq`-like ordinal.**
|
|
594
|
+
* 4. **A DISABLED PAIR DOES APPEAR** (item 5): `constraintOff` is a TOGGLE and NOT A REMOVAL, so a pair it
|
|
595
|
+
* disabled is STILL REGISTERED and still enumerated — **and therefore there is NO `enabled` member on an
|
|
596
|
+
* element and NO way to read a pair's state off this return**; the state is read at the toggles' own
|
|
597
|
+
* clauses. **No removal route exists**, so an absence here means nothing was ever registered.
|
|
598
|
+
*
|
|
599
|
+
* **THE COVERAGE, BOTH POPULATION ROUTES ON ONE FOOTING** (item 7): a pair the batch registered at
|
|
600
|
+
* `storeCreate` (`cfg.constraints`) and a pair `addConstraint` registered appear alike, because *"the entry
|
|
601
|
+
* carries a pair if and only if a function stands registered at that pair in the kernel's own pair-keyed
|
|
602
|
+
* registry"*. **The two declared exclusions are therefore structural**: a well-formed `cfg.constraints`
|
|
603
|
+
* element that carried no function is **not** a carried pair and does not appear, and a REFUSED
|
|
604
|
+
* registration — at the batch loop or at `addConstraint` — leaves the entry exactly as it stood and does not
|
|
605
|
+
* appear. **An overwrite changes no membership**: a second `addConstraint` at a held pair replaces the
|
|
606
|
+
* function at the SAME pair and returns the SAME identity, so the pair is carried ONCE before and after.
|
|
607
|
+
*
|
|
608
|
+
* **IT ADDS NO POPULATION ROUTE** (`§2.12` item 2-bis): the two routes stand at TWO, and a read closes none
|
|
609
|
+
* and opens none. **It is NOT a `pending()` reader, NOT an `attempts()` enumerator and NOT a live view of a
|
|
610
|
+
* running commit**; it announces no identity, no function and no order.
|
|
611
|
+
*
|
|
612
|
+
* **AND IT MOVES NO OTHER FIGURE**: the module namespace keeps its ONE name `storeCreate` (`§2.9` item 1's
|
|
613
|
+
* `A127` clause, `11 → 1` ✓), the kernel's extent stays FIVE with no `K-6` proposed (`§2.4` item 9 (f),
|
|
614
|
+
* item 8 — the pairs are read from the entry's OWN registry, which is keyed exactly as the kernel's is), the
|
|
615
|
+
* store's closed `16`-member set is not reached, the kernel's `KC` set stands closed at `8`, and the register
|
|
616
|
+
* keeps its `8` rows.
|
|
617
|
+
*
|
|
618
|
+
* **It is NOT a named export of this entry** (`package.md §1.3` item 3): it is reached through
|
|
619
|
+
* `storeCreate`'s own product alone.
|
|
620
|
+
*/
|
|
621
|
+
constraints(): ConstraintPair[];
|
|
513
622
|
}
|
|
514
623
|
|
|
515
624
|
/**
|
|
@@ -530,6 +639,15 @@ export function storeCreate(cfg: StoreConfig): StoreInstance;
|
|
|
530
639
|
* `string`** — **and NOT the whole of a batch element**, which is this pair PLUS its constraint function.
|
|
531
640
|
* **Every outside form of the pair throws the three methods' one `TypeError`**, and **a well-formed pair
|
|
532
641
|
* the entry does not carry is outside the two toggles' domain**: it is NOT a third population route.
|
|
642
|
+
*
|
|
643
|
+
* **⟶ AND THIS SHAPE IS ALSO THE ELEMENT OF THE FOURTH MEMBER'S RETURN, ADDED 2026-10-17**
|
|
644
|
+
* (`surface.md §2.4` item 9 (f)'s `constraints` clause; `parameter-semantics.md §2.27` = `PAR-JS-27`,
|
|
645
|
+
* `return-field`): `a.constraints()`'s every element carries **exactly these TWO members and no third** —
|
|
646
|
+
* the `address` a pair was registered under and its bare `id` — **and NEITHER the constraint function nor the
|
|
647
|
+
* opaque identity** (`PAR-JS-25`'s opacity, unmoved). **THE TWO ROLES ARE ONE SHAPE AND NOT TWO**: this is the
|
|
648
|
+
* caller's own datum entering at `addConstraint` (and at `cfg.constraints`' elements, which are this pair
|
|
649
|
+
* PLUS a `constraint`) and coming back out at the read. **`Row 27`'s `alt` cell refuses an `enabled` member on
|
|
650
|
+
* the element**, so no third member is declared here and this interface is left exactly as it stood.
|
|
533
651
|
*/
|
|
534
652
|
export interface ConstraintPair {
|
|
535
653
|
readonly address: Address;
|