@auspicion/provident-storeroom-js-wasm 0.0.0-stage → 2.0.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/BUILD-INFO.txt +3 -0
- package/LICENSE +662 -0
- package/README.md +424 -2
- package/index.d.ts +2029 -0
- package/index.mjs +132 -0
- package/package.json +40 -4
- package/src/constraint-kernel.mjs +4 -0
- package/src/entry/addon-slot.mjs +484 -0
- package/src/entry/artefact-node.mjs +327 -0
- package/src/entry/artefact.mjs +57 -0
- package/src/entry/carrier.mjs +1011 -0
- package/src/entry/class-decision.mjs +1278 -0
- package/src/entry/class-instrument.mjs +186 -0
- package/src/entry/constraints.mjs +3953 -0
- package/src/entry/delivery.mjs +1697 -0
- package/src/entry/frame.mjs +616 -0
- package/src/entry/instance.mjs +2312 -0
- package/src/entry/kernel-attempt.mjs +1392 -0
- package/src/entry/kernel-commit.mjs +384 -0
- package/src/entry/kernel-foundations.mjs +1565 -0
- package/src/entry/kernel-loader.mjs +53 -0
- package/src/entry/kernel-registration.mjs +1377 -0
- package/src/entry/kernel-terminal.mjs +593 -0
- package/src/entry/refusal.mjs +216 -0
- package/src/entry/state.mjs +1484 -0
- package/storeroom_js_binding.d.ts +350 -0
- package/storeroom_js_binding.js +813 -0
- package/storeroom_js_binding_bg.wasm +0 -0
- package/storeroom_js_binding_bg.wasm.d.ts +28 -0
package/README.md
CHANGED
|
@@ -1,3 +1,425 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `provident-storeroom` — the published Node ESM binding for the native Rust store
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**THE CLAIMED REALM IS THE ES MODULE ITSELF — ONE FILE, ONE NAMESPACE, ONE DECLARED MEMBER SET — AND IT IS
|
|
4
|
+
REACHED BY EITHER OF NODE'S TWO SPECIFIERS FOR THAT ONE MODULE** (`A70`, `package.md §1.1`; `docs/specs/storeroom-js/contract.md §3.1`'s
|
|
5
|
+
re-derivation of 2026-11-17, `D-128`/`D-129`): you `import` this package as an ES module, and a CommonJS host
|
|
6
|
+
`require`s the SAME entry through the package's own `require` condition, from a Node runtime whose ABI carries a
|
|
7
|
+
Node-API addon and whose version is at or above the declared `engines` floor, `>=22.12.0`. **Every other realm is
|
|
8
|
+
UNCLAIMED and each owes its declared answer** (`package.md §2`: Node CJS as a module *format*, Electron `main`,
|
|
9
|
+
`preload` and `renderer`, the browser, `worker_threads` and any IPC route). **No other realm is described here as
|
|
10
|
+
supported.**
|
|
11
|
+
|
|
12
|
+
**⟶ AND ONE OF THOSE REALMS IS NOW SUPPORTED AS A BUILD, IN ITS OWN PACKAGE — 2026-11-17** (`D-154` item 1, the
|
|
13
|
+
architect's *"Lift the realm claim restriction and plan for the change"*; `D-157` item 1). **`@auspicion/provident-storeroom-js-wasm`
|
|
14
|
+
carries the same store on a WebAssembly host**, its bindings handed in instead of looked for: no Node-API addon, no
|
|
15
|
+
`filePath` (the key is not in domain there — a browser cannot write one), the `file` tier meaning *durable with no
|
|
16
|
+
path*, saved through a caller's `saveCall` and seeded through an `initialImage`. **IT IS A SECOND PACKAGE AND NOT A
|
|
17
|
+
SECOND ARM OF THIS ONE, AND NOTHING ABOVE MOVES FOR IT**: this package's realm claim, its one `exports` arm, its one
|
|
18
|
+
module name and its `require` condition stand byte-for-byte. **AND THE SENTENCE THIS PARAGRAPH SITS UNDER REMAINS
|
|
19
|
+
TRUE OF THIS PACKAGE**: what ships here reaches Node ESM and nothing else.
|
|
20
|
+
|
|
21
|
+
**Node CJS stays UNCLAIMED as a module format: the package publishes NO CJS arm — no `.cjs` artefact, no `main`
|
|
22
|
+
field and no second build — and it DOES publish a `require` condition on its one ESM entry, so a CJS host's
|
|
23
|
+
`require` is supported at or above the floor.** **What remains your side of the boundary is the runtime feature
|
|
24
|
+
and the floor: below it the loader refuses the module and the package publishes no second answer.**
|
|
25
|
+
|
|
26
|
+
**THE LICENCE OF RECORD IS `AGPL-3.0`** (`DD-43`): it is the repository's own `LICENSE`, and no clause of this
|
|
27
|
+
package changes it. **AND THE LICENCE COPY TRAVELS WITH EVERY ARTEFACT, THIS PACKAGE'S OWN INCLUDED: each of
|
|
28
|
+
the SEVEN artefacts — this package, the five native platform packages and the WebAssembly package (`D-157` item 1,
|
|
29
|
+
2026-11-17) — carries a copy of the repository's own
|
|
30
|
+
`LICENSE` as the licence TEXT travelling with it, copied BYTE-FOR-BYTE at the release's own assembly step**
|
|
31
|
+
(`docs/specs/storeroom-publish/contract.md §2.3` item 2; `distribution.md §4.3` item 2; `PUB-DD-11`; `Q3-5`).
|
|
32
|
+
**The copy is an ARTEFACT-LEVEL fact and not a crate-level file**: no `LICENSE` byte is written under
|
|
33
|
+
`bindings/js/` (`§2.3` item 4), the manifest's `files` allowlist names no `LICENSE` row, and **a tarball's own
|
|
34
|
+
copy is not a fifth declaration site** — four AUTHORED sites stay four, while seven artefacts CARRY a notice.
|
|
35
|
+
|
|
36
|
+
**★ AND THIS FILE IS THE SHIPPED HALF OF A TWO-PART STORY: the long-form consumer guide — every member, every
|
|
37
|
+
refusal, every file-tier reading and the measured behaviour behind each — **TRAVELS WITH THIS PACKAGE at
|
|
38
|
+
`README.guide.md`, beside this file**, so an installed copy reads it at
|
|
39
|
+
`node_modules/provident-storeroom/README.guide.md`.** **IT REACHES THE TARBALL BY THE RELEASE'S OWN ASSEMBLY
|
|
40
|
+
STEP**: that step copies its one authored home, `docs/guides/package-use.md`, byte-for-byte to this package's
|
|
41
|
+
root as `README.guide.md` — the same mechanism that lands the `LICENSE` copy, and not a `files` row pointing
|
|
42
|
+
outside the package root (npm omits such a row SILENTLY, which is the one hazard worse than a missing
|
|
43
|
+
document) — and the manifest's `files` allowlist names the landed copy, so the text ships. **THE CANONICAL
|
|
44
|
+
TEXT IS `docs/guides/package-use.md` AND IS NEVER EDITED IN TWO PLACES: `README.guide.md` is a generated
|
|
45
|
+
landing, and the release runbook's preflight (`scripts/publish.sh`) refuses when the two differ
|
|
46
|
+
byte-for-byte.** The same guide is readable in this
|
|
47
|
+
package's repository at
|
|
48
|
+
`https://github.com/LittleKingsguard/Provident-Storeroom/blob/main/docs/guides/package-use.md`, which is where
|
|
49
|
+
an edit belongs.
|
|
50
|
+
|
|
51
|
+
**⟶ AND THE ONE FIGURE THIS PAGE CAN BE RIGHT ABOUT IS GENERATED AND ASSERTED, 2026-10-28 — `DEF-AC`'s third part, and `D-57`'s one surviving figure.** `RCA-8(g)` ANNOTATE-BESIDE: **every clause above stands BYTE-FOR-BYTE and is read THROUGH this one; nothing above moves.** **THE DEFECT THIS CLOSES: THIS PAGE DECLARED NO VERSION AT ALL** — a shipped document a consumer reads first, saying nothing about which release it describes — **so `scripts/publish.sh --figures` now GENERATES the line below from `bindings/js/package.json`'s `version` and REFUSES when it disagrees, exactly as it does at the guide's and the change list's own marked lines: three shipped documents, three version lines, one generator, one assertion.** **AND THE CUT-STATE IS NOT STATED HERE, OR ANYWHERE ELSE IN THIS PACKAGE'S DOCUMENTS** (`D-57`, the architect verbatim: *"Drop the cut-state"*): a document is sealed before the tag that would make its cut-state true, so **the cut-state is not a document's to state**; the record of what has been cut is the change list's, and it is past tense. **EVERY OTHER CLAIM OF THIS PAGE STANDS EXACTLY AS IT STOOD.**
|
|
52
|
+
|
|
53
|
+
PUBLISH-README-VERSION-LINE: THE VERSION THIS README DESCRIBES IS `2.0.0`.
|
|
54
|
+
|
|
55
|
+
## The one entry
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { storeCreate } from 'provident-storeroom';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**That is the whole module namespace: ONE name, `storeCreate`** (`surface.md §2.9` item 1's `A127` clause; the
|
|
62
|
+
namespace's `8 → 1`). There is no module-level `read`, `write`, `listen` or any other verb — every other name
|
|
63
|
+
you will use is a method of the instance `storeCreate` returns.
|
|
64
|
+
|
|
65
|
+
**The `exports` map publishes EXACTLY ONE arms-bearing entry — the ESM one** (`package.md §1.3`, `DD-24`), and its
|
|
66
|
+
whole content is THREE conditions: `types` names the declaration, and `import` and `require` name the SAME
|
|
67
|
+
`./index.mjs`. **So the package publishes no wildcard export, no deep import to the addon and no CJS arm** — no
|
|
68
|
+
`.cjs` artefact, no `main` field and no second build exists beside the entry — **and `require` IS A SUPPORTED
|
|
69
|
+
ROUTE INTO THE CLAIMED REALM: a CommonJS host needs no interop of its own.** **The addon is reached INTERNALLY by
|
|
70
|
+
the package's own resolution step and is not an entry point.**
|
|
71
|
+
|
|
72
|
+
## The surface
|
|
73
|
+
|
|
74
|
+
**`storeCreate(cfg)` answers an instance carrying exactly FOURTEEN own members** — `10 + 1 + 1 + 2 = 14` ✓ —
|
|
75
|
+
**and they are these fourteen and no others** (`bindings/js/index.d.ts`, `StoreInstance`;
|
|
76
|
+
`docs/specs/storeroom-held-listener-identity/contract.md §2.7` item 9):
|
|
77
|
+
|
|
78
|
+
| The member | Its answer |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `read(address, tier?)` | a leaf's literal, a branch's assembled value, or the empty address's whole register |
|
|
81
|
+
| `readLiteral(address, tier?)` | the same, narrowed to a leaf (`ReadTargetIsBranch` on a branch) |
|
|
82
|
+
| `write(address, tier, value, commit?)` | `{op, watched, triggered}` — **four positions, `commit` the fourth and optional** |
|
|
83
|
+
| `delete(address, tier?)` | `{address, op, tiers, triggered}`, plus a non-enumerable `discarded` witness |
|
|
84
|
+
| `rollback(opId)` | `{opId, undoneOps, restoredTo}` |
|
|
85
|
+
| `listen(handle, addresses)` | **the handle it watches under** (`Handle`) — **you spell it**, and position `2` is a SET |
|
|
86
|
+
| `unlisten(handle)` | `undefined` — the withdrawal: the store-side entry and this package's registry entry |
|
|
87
|
+
| `register(handle, listener)` | `undefined` — one handle, one function; a second registration replaces the first |
|
|
88
|
+
| `removeListener(handle)` | `undefined` — the entry removed whole and its store entries withdrawn |
|
|
89
|
+
| `addConstraint(pair, constraint)` | the constraint's identity — the ADD route, which CARRIES the function and OVERWRITES at a held pair |
|
|
90
|
+
| `constraintOn(pair, constraint)` | `undefined` — enable, idempotent; throws at a pair the store does not carry |
|
|
91
|
+
| `constraintOff(pair, constraint)` | `undefined` — disable, idempotent, **not a removal** |
|
|
92
|
+
| `removeConstraint(pair)` | `undefined` — **the one act that deletes an identity** |
|
|
93
|
+
| `constraints()` | the registered pairs, `{address, id}` only — **no function, no order, no `enabled`** |
|
|
94
|
+
|
|
95
|
+
**⟶ AND THE `delete` ROW'S ANSWER HAS A SECOND NON-ENUMERABLE MEMBER, 2026-10-29 — ITS COMMIT RECORD.** The row above
|
|
96
|
+
names the `discarded` witness and stops there; **a `delete` is an editing verb with its own attempt, its own pass and
|
|
97
|
+
its own commit, so the receipt ALSO carries `commit`, a NON-ENUMERABLE own member holding the same four-member
|
|
98
|
+
`CommitRecord` a `K-2` returns — `attempt` · `op` · `triggered` · `pending` — and `null` on the arm that removed
|
|
99
|
+
nothing.** **Measured on this checkout: `Object.keys(receipt)` reads `["address","tiers","triggered","op"]` — four —
|
|
100
|
+
while `Object.getOwnPropertyNames(receipt)` reads six, `commit` and `discarded` being the two it does not list** — so
|
|
101
|
+
a spread or `Object.assign` copy of a receipt loses BOTH, and nothing throws when it does. **Read either off the
|
|
102
|
+
receipt itself.** **No member is added to the FOURTEEN and no enumerable shape moves.** (`D-57`; `D-55` item `3`;
|
|
103
|
+
`index.d.ts`'s `DeleteRecord.commit`; the long-form reading — the adoption, the `pending` residue, the `file`-tier
|
|
104
|
+
save and `K-4`/`K-5` by reference — is the shipped guide's `§7.8`, which is where those four follow-ons are stated.)
|
|
105
|
+
|
|
106
|
+
**★ AND `discarded` IS PRESENT OR ABSENT BY A RULE, NOT BY LUCK — `undefined` IS NOT `[]`** (`D-78`, 2026-10-29).
|
|
107
|
+
**`discarded` is carried by the three acts that can discard a raise — `delete`'s receipt, `write`'s record and
|
|
108
|
+
`rollback`'s own record — and by nothing else.** **On all three it is PRESENT on every return, `0` included:**
|
|
109
|
+
**`[]` means this act's delivery discarded nothing — present, empty and true.** **A member that is `undefined` means
|
|
110
|
+
this act CANNOT discard a raise, so the question does not arise** — a `read` or a `readLiteral` answers a value and
|
|
111
|
+
carries no such member — **and absence must not be read as "nothing was discarded": it is "not reported, because
|
|
112
|
+
this act cannot have that outcome."** **So `if (record.discarded === undefined)` and
|
|
113
|
+
`if (record.discarded.length === 0)` are DIFFERENT QUESTIONS — "can this act discard?" and "did it, this run?" — and
|
|
114
|
+
`record.discarded?.length` tested for truthiness answers both with one falsy reading, which is the collapse this
|
|
115
|
+
rule exists to prevent.** **CHECK PRESENCE FIRST, THEN LENGTH;** and because the member is non-enumerable, **a spread
|
|
116
|
+
or `Object.assign` copy of a receipt does not carry it and reads `undefined` whatever the original said** — read it
|
|
117
|
+
off the record itself. **Measured on this checkout through the published entry: `delete`, `write` and `rollback` each
|
|
118
|
+
answer `1` entry where a raise was discarded and `[]` where none was, and `read`'s answer carries the member
|
|
119
|
+
nowhere.** (`D-78`; `D-75`; `D-49`; the long-form section is the shipped guide's `§12.6b`.)
|
|
120
|
+
|
|
121
|
+
**★ AND `log` IS CARRIED BY THE THREE RECORDS A PASSING CALL ANSWERS — `D-119`, 2026-11-02, AND IT IS THE RULE
|
|
122
|
+
ABOVE READ FOR A THIRD MEMBER.** **`log` is carried by `write`'s record, by `delete`'s receipt and by `rollback`'s
|
|
123
|
+
record, NON-ENUMERABLY and PRESENT ON EVERY PASSING ANSWER** — the commit's own entries, in the order the commit
|
|
124
|
+
appended them: the `constraint-check` entry for each pair the pass asked, the `repair-run` entry for every repair
|
|
125
|
+
that landed an edit, and the `commit` entry that closes the arm. **`[]` means this act appended nothing it can
|
|
126
|
+
report and never "nothing happened"**: a nested call inside a constraint or repair body answers `[]` because the
|
|
127
|
+
commit it joined has not crossed**, and the act that owns that commit reports the entries. **A passing write over
|
|
128
|
+
a store carrying no pair answers ONE entry, `kind === 'commit'`.** **A spread or `Object.assign` copy loses `log`
|
|
129
|
+
exactly as it loses `discarded`** — read it off the record itself. **The FOURTEEN and the enumerable shapes are
|
|
130
|
+
unmoved**, and what you gain is the audit `D-119` exists for: on a `write` or a `delete` it is **the same list, the
|
|
131
|
+
same entries and the same positions a refusal about that commit carries**, so a pass and a later refusal on one
|
|
132
|
+
commit cannot disagree — while a `rollback`'s list is its JUDGEMENT's, where a repair it ran leaves its entry.
|
|
133
|
+
(`D-119`; `D-53`; `D-58`; the long-form section is the shipped guide's `§9.2`, and the `[]` arms are `§8.0a`'s
|
|
134
|
+
clause of this date.)
|
|
135
|
+
|
|
136
|
+
**THE RECEIVER IS THE STORE, SO NO CALL CARRIES AN `instance` POSITION** (`surface.md §2.1` (e) item 3):
|
|
137
|
+
`store.write(address, tier, value)` is the shape every method takes, and a leading `instance` is a SUPERSEDED
|
|
138
|
+
SPELLING — wrong, not redundant. **AND NO OWN MEMBER IS A DATA MEMBER:** there is no `store.data`, no `state`
|
|
139
|
+
field and no getter over the register; `store.read(address)` is the route to state. **There is no release
|
|
140
|
+
verb** — construct one store and keep it for the process's life.
|
|
141
|
+
|
|
142
|
+
**⟶ AND THAT SECOND SENTENCE IS NOW BEHAVIOUR RATHER THAN ADVICE, 2026-11-19 — `D-171` ITEMS 1–3.** **THERE IS STILL NO RELEASE VERB AND NO MEMBER MOVES.** What changed is that **a store you DROP is now released**: the package holds the store's own index in a `FinalizationRegistry` and hands it to the addon's `storeRelease` when the instance is collected, and that entry drops the store and empties its slot in one act — **before this landing a constructed-and-dropped store stayed in the addon's table for the process's life (`~573,112` bytes per construct-and-drop against `~42,000` after it)**, and **the WebAssembly artefact carries the same entry** (`bindings/js/src/facade.rs`; `bindings/js/src/wasm.rs`; `tests/e2e/store-retirement.test.mjs`). **So one store per process is still the shape the register wants, and it is no longer a rule you keep in order not to leak.**
|
|
143
|
+
|
|
144
|
+
### The construction's six keys
|
|
145
|
+
|
|
146
|
+
**⟶ AND THE COUNT IS SIX FROM 2026-11-17 — THE HEADING SAID FOUR AND THE TREE TAKES SIX.** `saveCall` and `initialImage` joined `filePath` and the two
|
|
147
|
+
required keys (`journalLength`, `listeners`) along with `constraints`; **the heading and every sentence that counts them read six.** **The two newest are the
|
|
148
|
+
ones a path-less store needs** (`saveCall` is how such a store saves and `initialImage` is the only way it can start with state), **and `§13` of the guide is
|
|
149
|
+
where they are described.**
|
|
150
|
+
|
|
151
|
+
**`cfg` carries FOUR declared keys and no fifth: `filePath` · `journalLength` · `listeners` · `constraints`**
|
|
152
|
+
(`parameter-semantics.md §2.21`; `docs/specs/storeroom-native/contract.md §7.1`). `journalLength` and
|
|
153
|
+
`listeners` are REQUIRED; `filePath` and `constraints` are OPTIONAL and absent-in-domain. **The constraint list
|
|
154
|
+
is YOURS and is NEVER persisted** — you supply it from your own information at every startup, and it is
|
|
155
|
+
validated at two instants: at construction, and at a boot over an existing file. **A caller-supplied fifth key
|
|
156
|
+
is IGNORED and produces no code** — it is a constraint on this package's own passing, not a refusal of your
|
|
157
|
+
extra key.
|
|
158
|
+
|
|
159
|
+
### The `write`'s fourth position
|
|
160
|
+
|
|
161
|
+
**THE DECLARED ORDER IS `write(address, tier, value, commit?)` — three required arguments and the optional one
|
|
162
|
+
last, at the FOURTH position** (`surface.md §2.2` clause 1; `index.d.ts`, the `write` member). **AN ABSENT
|
|
163
|
+
`commit` IS IN DOMAIN**: the write opens or joins a commit all the same, no default record is fabricated for
|
|
164
|
+
it, and leaving the position out is the supported form for an external caller. **The position is the KERNEL's
|
|
165
|
+
own** — an object carrying a `pending` member present and not `undefined` — and **every other form there
|
|
166
|
+
throws the class test's own `TypeError`, whose `status` member is ABSENT and whose message names the
|
|
167
|
+
position**. A refused position stops the write: no store call is reached and no byte moves.
|
|
168
|
+
|
|
169
|
+
## The failure form is ONE
|
|
170
|
+
|
|
171
|
+
**Every refusal is THROWN as a plain object carrying exactly `{status, message, log, address}`** — never an `Error`
|
|
172
|
+
subclass, never a returned tagged union and never a `Promise` rejection, so `try`/`catch` is the whole error
|
|
173
|
+
model (`index.d.ts`, `StoreRefusal`; `surface.md §2.5`).
|
|
174
|
+
|
|
175
|
+
**⟶ AND THE CROSSED FORM IS FOUR MEMBERS FROM 2026-10-29 — `D-77`, THE ARCHITECT'S RULING, ONE WORD: *"New member"*.** Every figure above and below that prints that form as THREE is read THROUGH this clause and stands as the reading of its own date. **THE FOURTH MEMBER IS *WHICH ACT WAS REFUSED* — `address`, the ADDRESS the refusal is about**: a segment array in the caller's own domain, or the declared `null` where there is nothing to name. The measurement it answers: **a caller's OWN act refused and a caller's act that PASSED while a LISTENER's was refused cross with the same `status`, the same `message`, the same keys and the same two log entries** — only the `opId` differs, and a refused act answers no `op` to key against — so the caller read `ConstraintPassRefused` and concluded its own write did not happen while the store says it did. **Compare the member with the address you wrote: `equal` means your own act, `different` means a listener's, and a retry is then a decision rather than a guess.** **IT IS PRESENT ON EVERY REFUSAL, `null` WHERE NOTHING IS NAMEABLE** (*"a member absent on some arm is the `DEF-AH` defect wearing a new name"*), so `Object.keys(caught)` reads exactly `["status","message","log","address"]`, length `4`, on EVERY arm. **THE CLOSED STATUS SET IS NOT REACHED — twenty stays twenty — and the member is no heuristic a consumer has to reproduce.** The form's one home is `docs/specs/storeroom-js/surface.md §2.5` item `4-ter`.
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
try {
|
|
179
|
+
store.write(['users', 0, 'name'], 'mem', 'ada');
|
|
180
|
+
} catch (e) {
|
|
181
|
+
// The FOUR members, in the form's own order (`D-77`: `address` is the act the refusal is about).
|
|
182
|
+
const { status, message, log, address } = e; // Object.keys(e) is ["status","message","log","address"] on EVERY arm
|
|
183
|
+
// equal to the address you wrote ⇒ YOUR OWN act was refused; different ⇒ a LISTENER's was and your write stands.
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**★ AND `log` IS NEVER ABSENT.** It is an ordinary own enumerable data member of that same object — written
|
|
188
|
+
with an object literal, not `defineProperty`, not a getter, not on a prototype and not behind a `Symbol` — and
|
|
189
|
+
**`Object.keys(caught)` reads exactly its FOUR members in the form's own order, `["status","message","log","address"]`,
|
|
190
|
+
length `4`, on EVERY arm.** **`[]` is its declared value where the failure's cause has no attempt at all, and
|
|
191
|
+
every failure whose attempt exists carries that attempt's own entries — the kernel's FIVE-member `LogEntry`
|
|
192
|
+
records, with the `outcome` entry's `state` carrying the `KC` token where the constraint pass produced one** **⟶ AND IT IS
|
|
193
|
+
FIVE SINCE `D-65`: `kind` · `id` · `opId` · `message` · `state` — the `seq` member is GONE, because a log entry's position
|
|
194
|
+
IS its array index and a member restating the index was a second copy of a fact the array already carried.**
|
|
195
|
+
(`index.d.ts`, `LogEntry`; `surface.md §2.5` items 3–4). **The `message` is generated from the code and the
|
|
196
|
+
failing trigger's arguments**, never hand-authored at a call site.
|
|
197
|
+
|
|
198
|
+
**★ AND TWO THINGS ABOUT THAT LIST THAT A CONSUMER COUNTING IT NEEDS — DECLARED HERE BECAUSE THE SURFACE DOES NOT
|
|
199
|
+
TELL YOU EITHER BY ITSELF.** **ONE: THE LIST BELONGS TO THE COMMIT, NOT TO THE ATTEMPT.** One write is one commit,
|
|
200
|
+
and everything the commit does — the passes that judged its value, a repair's own write, the re-run after that
|
|
201
|
+
repair, the terminal arm's `outcome` entry — appends to **one** array, **so a crossed report carries the entries of
|
|
202
|
+
EVERY attempt in the commit, including a write a constraint body makes** (a listener's write opens a commit of its
|
|
203
|
+
own, so its entries are that new commit's). **`log.length` is therefore every entry of the commit and not "how many
|
|
204
|
+
constraints were evaluated".** **TWO: AN ENTRY'S `seq` IS THE POSITION OF THE ENTRY IN THAT LIST — NOT THE STORE'S
|
|
205
|
+
JOURNAL ORDINAL.** `JournalOp.seq` orders the store's own record; this `seq` orders the commit's message log, and
|
|
206
|
+
the two differ by design (a refusal's entry can carry `seq` `1` while the store's journal counter reads `41`). **The
|
|
207
|
+
kernel's `state` token set is `KC-1`…`KC-9`, `KC-9` being the save arm's own; the store's status set has not moved.**
|
|
208
|
+
|
|
209
|
+
**⟶ AND THE SECOND OF THOSE TWO THINGS IS WITHDRAWN AT THE MEMBER, 2026-10-28 — `D-65`: `LogEntry` CARRIES NO `seq`,
|
|
210
|
+
AND AN ENTRY'S POSITION IS ITS ARRAY INDEX.** `RCA-8(g)` ANNOTATE-BESIDE: **every byte above stands BYTE-FOR-BYTE as
|
|
211
|
+
the reading of its own date and is read THROUGH this clause — the withdrawn sentence is *"AN ENTRY'S `seq` IS THE
|
|
212
|
+
POSITION OF THE ENTRY IN THAT LIST … the two differ by design"*, and it described a member that no longer exists.**
|
|
213
|
+
**THE RULING, THE ARCHITECT, ONE WORD: *"Drop it"*** — `seq: log.length + 1` WAS the index of the entry being
|
|
214
|
+
appended, a second copy of a fact the array already carries. **WHAT YOU READ NOW: FIVE members, `kind` · `id` ·
|
|
215
|
+
`opId` · `message` · `state`** (declared at the same place the clause above declares them, and stated there beside
|
|
216
|
+
its `seq` retirement), **and the position of an entry is `log.indexOf(entry)` or the index of the loop you are
|
|
217
|
+
already in.** **`JournalOp.seq` IS STILL THE STORE'S OWN APPEND ORDINAL, so the distinction the sentence above drew
|
|
218
|
+
has not disappeared — only the member that could be confused with it has**, and the two are now impossible to
|
|
219
|
+
confuse for that reason. **So do not read `entry.seq` for an ordering, and do not read its absence as an entry that
|
|
220
|
+
lost its place: the list's order is the commit's append order and the index is the place.**
|
|
221
|
+
|
|
222
|
+
## The status set is TWENTY, and open by design
|
|
223
|
+
|
|
224
|
+
**`StoreStatus` carries TWENTY members, ranked `1`…`20`, plus the open escape arm `(string & {})`** — the union
|
|
225
|
+
in `index.d.ts` and the array in `src/error.rs` (`CODES`, `[&str; 20]`) are the same members in the same rank
|
|
226
|
+
order, and the algebra reads `11 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 20` ✓
|
|
227
|
+
(`docs/specs/storeroom-native/contract.md §8.1`).
|
|
228
|
+
|
|
229
|
+
| rank | status |
|
|
230
|
+
| --- | --- |
|
|
231
|
+
| 1–11 | `AddressMalformed` · `AddressNotFound` · `LeafHasNoDownstream` · `TierNotFound` · `OutOfDomainTier` · `ParentAnchorMonotonicityViolation` · `ContainerKindConflict` · `ReadTargetIsBranch` · `WriteParentNotLink` · `JournalOpUnknown` · `RollbackCompacted` |
|
|
232
|
+
| 12–16 | `ConstructionArgumentMissing` · `FilePathUnreachable` · `ValueNotAdmitted` · `FileCommitFailed` · `ConstraintListInvalid` |
|
|
233
|
+
| 17 | `ValueRefusedAtBoundary` — the package's own boundary refusal, decided at the value walk |
|
|
234
|
+
| 18 | `ConstraintBodyThrew` — a constraint BODY threw |
|
|
235
|
+
| 19 | `ConstraintRefusedAtRegistration` — a well-formed pair whose body answered non-`true` at registration |
|
|
236
|
+
| 20 | `ConstraintPassRefused` — a registered constraint refused: the write's attempt, or a reversal's terminal state |
|
|
237
|
+
| escape | `(string & {})` |
|
|
238
|
+
|
|
239
|
+
**THE ESCAPE ARM IS LOAD-BEARING RATHER THAN LOOSENESS.** The set has moved four times, and an
|
|
240
|
+
immutably-enumerated union would mis-type a LAWFUL refusal the moment the set moves again. **So do not `switch`
|
|
241
|
+
on these without a `default`, and NEVER treat an unknown `status` as success.** The set is the STORE's to
|
|
242
|
+
close; **this package mints no member, widens no set and renames none.**
|
|
243
|
+
|
|
244
|
+
**`FileCommitFailed` IS THE SAVE'S CODE** — a failing `file`-tier save and nothing else — **and
|
|
245
|
+
`ConstraintPassRefused` is the CONSTRAINT PASS's**: a constraint refusal no longer answers a save code, so a
|
|
246
|
+
handler can branch on which layer failed. **`ValueRefusedAtBoundary` is the one you will meet on the value
|
|
247
|
+
route**: the walk decides a value's class **before any store verb is called** and answers that member with the
|
|
248
|
+
failing target's spelling. **`ValueNotAdmitted` stays at rank `14` and is the STORE's own answer on the native
|
|
249
|
+
route — a pass that reads rank `17` as a rename of rank `14` has destroyed a member.**
|
|
250
|
+
|
|
251
|
+
## Watching for changes
|
|
252
|
+
|
|
253
|
+
**Listeners fire on `write` and `delete`, and never on a read.** The store invokes nothing: it returns the
|
|
254
|
+
triggered handle set and this package's own registry matches handle to function (`A57`, `A77`).
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
const handle = store.listen('greeting-watch', [['greeting']]); // you spell the handle, the addresses are a SET
|
|
258
|
+
store.register(handle, (address) => { /* the ONE argument is the triggering address */ });
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**`listen(handle, addresses)` has an arity of TWO, position `1` a non-empty `string` and position `2` a SET of
|
|
262
|
+
addresses** — an array of addresses, **with the empty array `[]` in the domain**. **A REPEATED CALL AT A HELD
|
|
263
|
+
HANDLE IS SET-ASSIGNMENT AND NOT UNION**: `listen(h, S2)` after `listen(h, S1)` purges `S1` wholesale and
|
|
264
|
+
installs `S2`, with no intermediate state observable. **The call ANSWERS THE HANDLE on success** (`D-22`) — the
|
|
265
|
+
success signal that carries the identity, and every failure remains the one thrown form. `unlisten(handle)` is
|
|
266
|
+
the withdrawal. **AND A HANDLE MUST NOT be carried across a process reload**: handle identity is this
|
|
267
|
+
process's own, so a prior session's token names no registration and `register` over it is a refusal.
|
|
268
|
+
|
|
269
|
+
## Constraining writes
|
|
270
|
+
|
|
271
|
+
**A constraint is addressed by a PAIR `{address, id}`**, where the `id` is a non-empty `string` that IS the
|
|
272
|
+
pair's handle — you name it, it is instance-scoped and unique, and a repeated `id` at the same kind is an
|
|
273
|
+
overwrite. **There are exactly TWO population routes**: the batch at creation (`cfg.constraints`, elements
|
|
274
|
+
`{address, id, constraint}`) and the post-creation `addConstraint` route. **A registered pair stays registered
|
|
275
|
+
until `removeConstraint`** — `constraintOff` is not a removal, and a disabled pair still appears in
|
|
276
|
+
`constraints()`. **Toggles are idempotent and throw at a pair the store does not carry. A cross-kind duplicate
|
|
277
|
+
is REJECTED in both directions** — a listener and a constraint do not share one handle.
|
|
278
|
+
|
|
279
|
+
**★ AND READS CHECK NO CONSTRAINT** (`D-1-bis`, reading (a)): the mechanism is unconditional on the
|
|
280
|
+
**write/commit** path over the triggered handle set, and a `read`, a `readLiteral` and a branch's assembly
|
|
281
|
+
**consult no constraint, refuse nothing on a constraint's verdict and filter nothing on one.** No read-side
|
|
282
|
+
constraint arm is declared, and none is owed.
|
|
283
|
+
|
|
284
|
+
**What a refusal costs you:** a write whose registered constraint refuses it **throws
|
|
285
|
+
`{status: 'ConstraintPassRefused', message, log}`** — rank `20` — with the failure's `log` carrying the entries of
|
|
286
|
+
the write's whole commit (the attempt's own among them, and every attempt the commit held) and the kernel's `KC`
|
|
287
|
+
token on the `outcome` entry's `state`. **The value is not written
|
|
288
|
+
and a failed attempt leaves the store exactly as it found it**, whether the constraint refused outright or its
|
|
289
|
+
repair failed on the re-run (`D-40`).
|
|
290
|
+
|
|
291
|
+
**⟶ AND ONE ARM OF THAT STATUS IS NOT YOURS, DECLARED HERE 2026-10-29 — `D-76` ITEMS 1 AND 2, ON THE DOWNSTREAM'S
|
|
292
|
+
`DEF-AU`.** `RCA-8(g)` ANNOTATE-BESIDE: **the paragraph above stands BYTE-FOR-BYTE and is the reading of its own
|
|
293
|
+
date; what it cannot say is whose act the status names.** **`ConstraintPassRefused` ALSO CROSSES WHEN THE REFUSED
|
|
294
|
+
ACT WAS A LISTENER'S AND YOUR OWN WRITE HAD ALREADY LANDED** — **a listener's act is in the listener's own commit,
|
|
295
|
+
and its throw is the channel by which your code logs that violation, because you are the only party positioned to**
|
|
296
|
+
— **and the answer does not tell the two apart: `status`, `message`, the three own members, the log's length and
|
|
297
|
+
every entry's `kind` · `id` · `message` · `state` are EQUAL, the log's `opId` the only differing byte, and that byte
|
|
298
|
+
cannot be keyed against anything, because a refused act answers no `op`.** **SO DO NOT RETRY ON THE STATUS ALONE:
|
|
299
|
+
READ THE ADDRESS YOU WROTE.** **Your value stands ⇒ the refusal was a listener's and your data landed, so a retry
|
|
300
|
+
re-applies it; your value does not stand ⇒ it was your own act's and nothing was written.** **NO STATUS, MEMBER OR
|
|
301
|
+
RANK MOVES FOR THIS: the distinction is a closed set's business (`D-38`) and the architect's call** (the guide's
|
|
302
|
+
`§6.5a` and its `§8.1` row `20` carry both arms measured, and `D-73` carries the throw's rule; `D-76`.)
|
|
303
|
+
|
|
304
|
+
**⟶ AND THE MEMBER THAT PARAGRAPH SAID WOULD NOT MOVE HAS MOVED, 2026-10-29 — `D-77` MINTS `address`, SO THE TWO ARMS IT MEASURED ARE TOLD APART BY THE FORM ITSELF.** `RCA-8(g)` ANNOTATE-BESIDE: **the paragraph above stands BYTE-FOR-BYTE as the reading of its own date and is read THROUGH this clause; its RULE — *"do not retry on the status alone: read the address you wrote"* — STANDS, and the two sentences this clause supersedes are named rather than overwritten: *"the three own members"* and *"NO STATUS, MEMBER OR RANK MOVES FOR THIS"*.** **WHAT A CONSUMER GETS: the fourth member, `address` — the ADDRESS the refusal is about, a segment array in your own domain or `null` where nothing is nameable — present on EVERY arm, `Object.keys` reading `["status","message","log","address"]` at length `4`** (the clause below prints the same form, and it is this page's one shipped sentence about it). **SO THE COMPARISON IS THE ANSWER: `address` equal to the address you wrote ⇒ YOUR OWN act was refused and your write did not happen; different ⇒ a LISTENER's act was and your write STANDS, so a retry would apply it twice.** **THE CLOSED STATUS SET IS NOT REACHED — twenty stays twenty — and no rank moves.** (`D-77`; `bfe844a`; the form's own clause below, and the guide's `§6.5a` and `§8`.)
|
|
305
|
+
|
|
306
|
+
## The `file` tier, and what actually persists
|
|
307
|
+
|
|
308
|
+
**Durability is a SAVE's, and the file saves after ANY action that changes the `file`-tier data** (`strata/decisions.md` · `D-106`, which reads `DD-28`'s *"`file`-tier durability is produced by a successful `file`-tier write ONLY"* as a statement about the acts that OWE a save and no longer as a closed list of them). **So a bare `file`-tier write persists**: `store.write(['k'], 'file', 1)` is saved by the **write's terminal arm on its passing arm** — the package routes a three-position write through the kernel's commit and its attempt, and the addon's `write` verb performs no file I/O on any arm — and a fresh `storeCreate` over the same `filePath` resolves the address. **AND THREE MORE INSTANTS SAVE, EACH FROM 2026-11-02:** **a `delete`'s terminal arm**, at any tier scope — `delete(['k'], 'file')` and `delete(['k'])` both leave the removal standing after a fresh boot, the whole-target one because the act removed a version standing at the `file` tier; **the CLOSE of a registration on its PASSING arm** — a `file`-tier write a repair lands through the registration's own route is saved when the registration's attempt closes, whether it came from `cfg.constraints`, from a boot, from `addConstraint` or from a re-arm, **and a registration that REFUSES saves nothing at the close because it ROLLS BACK what it landed on any of its refusing arms — a constraint body that throws at the re-run included — and leaves the store where the call found it**; and **a reversal** — a `rollback` that puts a `file`-tier version back is saved by the PACKAGE at the end of its constraint JUDGEMENT, on the state the reversal left (`strata/decisions.md` · `D-112` item 2: **the store's own `rollback` performs no write**), so a version a reversal restored does **NOT** stand again after a re-boot. **A `mem`- or `temp`-tier act that leaves every `file`-tier version standing saves nothing, because it moves no byte of the file — which a SCALAR write does at an address it shadows and a CONTAINER write does only where no durable version stood there to be replaced; a container write that REPLACES a `file`-tier version owes its save like any other.**
|
|
309
|
+
|
|
310
|
+
**A SAVE THAT FAILS ANSWERS `FileCommitFailed` AFTER the store's own journal rollback has already run**, so the caller receives the failure and never the half-applied state; the package compensates for nothing. **At a reversal's own save there is no journal entry to roll back — a reversal appends none — so the refusal tells you two things and both are true at once: the reversal stands in memory, and the bytes were not updated; the reversion is never a condition on the save.** **AND A ROLLBACK THAT MEETS A COMPACTED ENTRY NO LONGER FAILS AND UNDOES NOTHING: from 2026-11-02 it regenerates the last valid state from the `file` tier's own image — and from the state the store was created with where no image stands, an image its own loader cannot read being no image at all (`D-118`) — and then saves it** (`strata/decisions.md` · `D-108`, `D-118`), **so a refused registration leaves the store where the call found it on every arm, and the only version a regeneration cannot put back is one the compaction had already swallowed, whose sole record no file image carries.** **⟶ AND ONE SENTENCE THIS PAGE CARRIED IS WITHDRAWN, 2026-11-02: a kernel-driven write's save is NOT *"a different save of a different scope"* from a bare write's, and the same bytes are not *"lawfully committed by both acts"* — there is ONE save, at the terminal arm or at the reversal, and a reader who counted two was counting one act twice.**
|
|
311
|
+
|
|
312
|
+
## The value domain
|
|
313
|
+
|
|
314
|
+
**A value crosses by deep copy in both directions and must be structured-clone-compatible**: strings,
|
|
315
|
+
booleans, finite numbers, plain objects and arrays. **If it cannot cross IPC it cannot be stored.** **The walk
|
|
316
|
+
refuses a value whose nesting depth exceeds `126`, and one whose visited-node count exceeds `1,000,000`, with
|
|
317
|
+
no configuration knob for either.** `126` is the deepest depth a `file`-tier value ADMITS, COMMITS and
|
|
318
|
+
RE-BOOTS; `127` and beyond is refused at the walk, before any store verb, as `ValueRefusedAtBoundary` (`A149`;
|
|
319
|
+
`docs/specs/storeroom-json-crossing/contract.md §4`).
|
|
320
|
+
|
|
321
|
+
## How the addon is resolved — three rungs
|
|
322
|
+
|
|
323
|
+
**THE ENTRY RESOLVES ITS ARTEFACT IN THE DECLARED ORDER** (`docs/specs/storeroom-publish/resolution.md §2`;
|
|
324
|
+
`docs/specs/storeroom-publish/contract.md §1.1`):
|
|
325
|
+
|
|
326
|
+
1. **RUNG ONE — THE SCOPED PLATFORM PACKAGE FOR THIS RUNTIME'S KEY.** The entry requires THE ONE NAME the
|
|
327
|
+
closed key set declares for the `process.platform` × `process.arch` pair, and no other name. The five
|
|
328
|
+
declared names are
|
|
329
|
+
|
|
330
|
+
**`@auspicion/provident-storeroom-js-linux-x64-gnu`** · **`@auspicion/provident-storeroom-js-linux-arm64-gnu`** ·
|
|
331
|
+
**`@auspicion/provident-storeroom-js-darwin-x64`** · **`@auspicion/provident-storeroom-js-darwin-arm64`** ·
|
|
332
|
+
**`@auspicion/provident-storeroom-js-win32-x64-msvc`**
|
|
333
|
+
|
|
334
|
+
— five names, three carrying a toolchain suffix (`-gnu` twice, `-msvc` once) and two carrying none. **The
|
|
335
|
+
name is SELECTED from this table and never built by concatenating tokens**, so no sixth name is computed.
|
|
336
|
+
These five are the registry's own per-target optional dependencies, and this package's
|
|
337
|
+
`optionalDependencies` pins each of them at this package's own version, exactly.
|
|
338
|
+
2. **RUNG TWO — THE MODULE-RELATIVE ADDON.** Failing rung one, the entry requires
|
|
339
|
+
`build/Release/storeroom_js_binding.node` beside the entry module, constructed from the entry module's own
|
|
340
|
+
location and from no other source — no environment variable, no configuration key, no path relative to the
|
|
341
|
+
working directory and no search of a parent directory.
|
|
342
|
+
3. **RUNG THREE — THE DECLARED ABSENT-ADDON FORM.** Failing rung two, the load path answers the single failure
|
|
343
|
+
form with `FilePathUnreachable` and no instance is returned.
|
|
344
|
+
|
|
345
|
+
**IN A PUBLISHED INSTALL, RUNG ONE IS THE RUNG THAT FIRES**, because rung two's path is the checkout's own and
|
|
346
|
+
a tarball of this package carries **no binary at any key, on any target**. **AND THE FIVE PLATFORM ARTEFACTS
|
|
347
|
+
EACH CARRY THEIR OWN TARGET'S BINARY**: each one's allowlist names the `.node` beside its manifest, which is
|
|
348
|
+
what gives rung one a declared source to load at that key at all (`PAR-PUB-21`; `distribution.md §3.2` item 5).
|
|
349
|
+
**RUNG TWO IS THE CHECKOUT-ONLY RUNG** — the in-place developer loop — and building it is a step of a checkout
|
|
350
|
+
rather than of an install:
|
|
351
|
+
|
|
352
|
+
```sh
|
|
353
|
+
cargo build --release --manifest-path bindings/js/Cargo.toml
|
|
354
|
+
mkdir -p bindings/js/build/Release
|
|
355
|
+
cp target/release/libstoreroom_js_binding.so bindings/js/build/Release/storeroom_js_binding.node
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**No binary is ever committed** (`package.md §3.2`): `build/` and `target/` are ignored, and the artefacts are
|
|
359
|
+
built and published, never stored in the tree. **The prebuild matrix is five targets** (`linux-x64`,
|
|
360
|
+
`linux-arm64`, `darwin-x64`, `darwin-arm64`, `win32-x64`), one runner per target, by the release's own workflow
|
|
361
|
+
`/.github/workflows/publish.yml`.
|
|
362
|
+
|
|
363
|
+
**AND THE UNCOVERED-TARGET ANSWER IS A DECLARED LIMITATION, WITH ITS CONSEQUENCE STATED RATHER THAN
|
|
364
|
+
DISCOVERED** (`docs/specs/storeroom-publish/contract.md §2.1` item 3; `distribution.md §2.2`; `PUB-DD-1`,
|
|
365
|
+
`PUB-DD-2`): **a consumer whose `process.platform` × `process.arch` pair is not one of the five covered keys
|
|
366
|
+
gets no binary** — rung one is not attempted for that pair, rung two is not carried by a published install, and
|
|
367
|
+
the load path answers the declared absent-addon form. **No `build.rs`, no `Cargo.toml`, no Rust `src/**` and no
|
|
368
|
+
`postinstall` build-on-install step is shipped**: the only route for an uncovered consumer is to build the
|
|
369
|
+
store crate from its source themselves, which is a LIMITATION and not a promise. **A covered consumer needs no
|
|
370
|
+
Rust toolchain; an uncovered consumer needs one.** **And a covered key whose C library differs from its
|
|
371
|
+
artefact's gets the same answer**: `os` and `cpu` cannot express a C library, so no C library is read, detected
|
|
372
|
+
or measured anywhere on this load path.
|
|
373
|
+
|
|
374
|
+
## The manifest
|
|
375
|
+
|
|
376
|
+
**This package's `files` allowlist is a consequence of REACHABILITY and not of a declared count** (`D-3`,
|
|
377
|
+
`D-4`): **whatever the entry requires by path must ship in the tarball**, and the release's shape is determined
|
|
378
|
+
empirically by `delivery` together with the e2e/install instruments. **No declared arity and no declared
|
|
379
|
+
exclusivity binds the allowlist** — a hand-maintained count in its place would re-create the constraint those
|
|
380
|
+
rulings lifted. **ONE DOCUMENTATION ROW IS ADDITIVE AND DECLARED AS SUCH:** `README.guide.md` names no module and
|
|
381
|
+
imports nothing, so it travels in the reachability rule's own declared non-code class (`README*` at the package
|
|
382
|
+
root) and no limb of that rule moves for it. **AND A SECOND: `RELEASE-NOTES.md` is the change list, staged
|
|
383
|
+
byte-for-byte at the packaging root by the release's assembly, names no module and imports nothing, and is likewise
|
|
384
|
+
admitted and declared** — so the manifest's `files` allowlist reads **seven rows** and the packed set reads **`20`
|
|
385
|
+
members bare / `21` assembled** (`1` manifest + `5` root files + `13` entry modules + `1` kernel `= 20`, plus the
|
|
386
|
+
licence at assembly). **The prohibitions are unmoved:** no `.node`, no `build/Release` path and no `postinstall`
|
|
387
|
+
route in this package's own tarball, and no `LICENSE` row.
|
|
388
|
+
|
|
389
|
+
## Tests — a REPOSITORY instruction, not a consumer one
|
|
390
|
+
|
|
391
|
+
**EVERY COMMAND BELOW IS FOR A CHECKOUT OF THIS REPOSITORY.** The root manifest is PRIVATE and is not shipped,
|
|
392
|
+
and a consumer's install carries no `tests/` directory at all, so a consumer cannot run these and is promised
|
|
393
|
+
nothing by them. **A consumer's own tests are the consumer's.**
|
|
394
|
+
|
|
395
|
+
```sh
|
|
396
|
+
cargo test --manifest-path tests/Cargo.toml -p storeroom-tests --no-fail-fast # THE BATTERY'S LEG — 235 cells, 0 fail
|
|
397
|
+
cargo test --offline -p storeroom-native # THE STORE'S LEG — 434 cells, 0 fail
|
|
398
|
+
cargo test # BOTH — 669 cells, 0 fail
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**AND THE THIRD COMMAND IS NOT A FOURTH LEG:** a bare `cargo test` runs `default-members = [".", "tests"]`, so
|
|
402
|
+
it is EXACTLY the store's `434` plus the battery's `235` — `434 + 235 = 669` ✓ — in one run (`D-34`: one
|
|
403
|
+
workspace at the repository root, `members = [".", "bindings/js", "tests"]`). **`-p` IS NOT DECORATION ON THE
|
|
404
|
+
BUILD SIDE EITHER:** the store's leg keeps `--offline`, and a workspace-root `cargo build --offline` would pull
|
|
405
|
+
this crate's `napi` crates and `--offline` would refuse them.
|
|
406
|
+
|
|
407
|
+
**AND THE JS LEG RUNS ONLY AFTER THE ADDON IS BUILT** (`docs/specs/storeroom-js-proposal.md §17` · `A75`: *"the
|
|
408
|
+
JS leg of the acceptance layer acquires A BUILD STEP (a `.node` must exist for those cells)"*):
|
|
409
|
+
|
|
410
|
+
```sh
|
|
411
|
+
# 1. THE BUILD STEP, AT THE REPOSITORY ROOT, BEFORE ANY JS CELL RUNS:
|
|
412
|
+
cargo build --release --manifest-path bindings/js/Cargo.toml
|
|
413
|
+
mkdir -p bindings/js/build/Release
|
|
414
|
+
cp target/release/libstoreroom_js_binding.so bindings/js/build/Release/storeroom_js_binding.node
|
|
415
|
+
# 2. THE JS LEG, AFTER IT — the repository's own battery, from the REPOSITORY ROOT:
|
|
416
|
+
npm test
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**THERE IS NO FALLBACK AND NO JS-SIDE STORE** (`A75`): an addon that is ABSENT or FAILS TO LOAD is a DECLARED
|
|
420
|
+
FAILURE — `storeCreate` answers the single failure form with `FilePathUnreachable` and NO instance is returned.
|
|
421
|
+
**The message is not a placeholder**: it is the store's generator rendering THAT subject, reached through the
|
|
422
|
+
addon's `errorMessage` where the artefact loaded far enough to carry the generator, and reproduced
|
|
423
|
+
BYTE-FOR-BYTE from the generator's own clause where the generator is the thing that failed to load. **The Rust
|
|
424
|
+
leg needs no addon at all**: the conversion core is the crate's `rlib` half, so the battery is drivable with no
|
|
425
|
+
Node runtime present (`package.md §4.1` item 3, `§4.5` item 7).
|