provident-storeroom 1.2.0 → 1.4.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.
@@ -85,6 +85,39 @@ export const SAVE_FAILED_AT_THE_TERMINAL_ARM = Symbol.for('provident-storeroom.s
85
85
  /// ACT BRANCHES ON IT** (`PAR-JS-19`'s answer cell, whose subject is the arm's return and not a member's).
86
86
  export const TERMINAL_ARM = Symbol.for('provident-storeroom.terminal-arm');
87
87
 
88
+ /// **⟶ ADDED 2026-10-28 — THE COMMIT'S OWN MESSAGE LOG, SPELLED HERE AS THE KERNEL SPELLS IT (`D-53`).**
89
+ ///
90
+ /// **THE RULING, VERBATIM: *"If it's part of the same commit, then it uses the same message log. If it opens a new
91
+ /// commit, it uses the new commit's message log"*** (`strata/decisions.md` · `D-53`). **SO THE LIST LIVES ON THE
92
+ /// COMMIT AND IT TRAVELS ON THE COMMIT'S OWN RECORD** — `kernel-commit.mjs` defines it on the `CommitRecord` it
93
+ /// builds, under this key, and this module reads it for the ONE site that needs the commit's verdict and not an
94
+ /// attempt's: **a failed `file`-tier save.** The save is the write's LAST constraint and it fails at the terminal
95
+ /// arm, so the crossing this module builds there carries the COMMIT's entries — `D-52`'s sentence *"a save failure
96
+ /// crosses as `FileCommitFailed` with `log: []`, and its verdict stands only in the attempt's log, which the
97
+ /// crossed value does not carry"* is the defect this member closes.
98
+ ///
99
+ /// **IT IS A `Symbol.for` KEY ON THE RECORD AND NO MEMBER IS ADDED** (`A117` (D6)): `Object.keys` and
100
+ /// `Object.getOwnPropertyNames` read past it, so `CommitRecord` keeps its FOUR declared members and every census of
101
+ /// them moves by nothing — the device `SETTLED_ON_THE_PASSING_ARM` and `SAVE_FAILED_AT_THE_TERMINAL_ARM` already
102
+ /// stand on. **A RECORD CARRYING NO SUCH KEY** — a caller's own record, and every record the kernel did not build —
103
+ /// answers `undefined`, and the crossing falls back to the declared `[]`.
104
+ export const COMMIT_LOG = Symbol.for('provident-storeroom.commit-log');
105
+
106
+ /// **⟶ AND THE ONE READ OF IT — a `[[GetOwnProperty]]` and never a `[[Get]]`, `D-35`'s READ HALF.**
107
+ ///
108
+ /// The record this reads is handed through `write`'s FOURTH POSITION, which a CALLER may fill: an ordinary member
109
+ /// read would run a getter the caller installed there — user code on a refusal path, before any verdict. **The
110
+ /// descriptor's own `value` is taken only where it IS one, so an accessor answers `undefined` exactly as an absent
111
+ /// key does, and `fail`'s declared `[]` is what crosses.** A record the KERNEL built carries the list as an own
112
+ /// non-enumerable data property (`kernel-commit.mjs` defines it with `Object.defineProperty`), so the lawful arm
113
+ /// reads it and every other arm reads nothing.
114
+ export function commitLogOf(record) {
115
+ if (record === null || typeof record !== 'object') return undefined;
116
+ const descriptor = Object.getOwnPropertyDescriptor(record, COMMIT_LOG);
117
+ if (descriptor === undefined || !Object.hasOwn(descriptor, 'value')) return undefined;
118
+ return descriptor.value;
119
+ }
120
+
88
121
  /// **⟶ ADDED — `K-6`'s READ-MODEL CHANNEL, under a symbol key for the same reason every symbol above is
89
122
  /// one** (`A117` (D6): *"a symbol-keyed own property is invisible to both"* `Object.keys` and
90
123
  /// `Object.getOwnPropertyNames`, so the product's declared fourteen own members are UNMOVED by it).
@@ -879,11 +912,16 @@ export function isStoreReceiver(candidate) {
879
912
  return state !== undefined && state.receiver === candidate;
880
913
  }
881
914
 
882
- export function carryRefusal(call, args) {
915
+ export function carryRefusal(call, args, log) {
883
916
  try {
884
917
  return call();
885
918
  } catch (refusal) {
886
- fail(notFoundRendering(refusal, listedSegments(args[0])));
919
+ // **⟶ AND THE THIRD POSITION IS THE COMMIT'S LIST WHERE THE CALLER HAS ONE (`D-53`).** Every verb that
920
+ // reaches here with no third position answers exactly what it answered before (`fail`'s declared `[]`); the
921
+ // FAILED SAVE's call is the one that passes a list, and it passes `commitLogOf(record)` — the commit's own
922
+ // entries, carried beside the store's two-member form and never re-shaped (`surface.md §2.5` item 10 (ii):
923
+ // *"nothing is converted, and a member is added"*).
924
+ fail(notFoundRendering(refusal, listedSegments(args[0])), log);
887
925
  }
888
926
  }
889
927
 
@@ -945,11 +983,16 @@ function listedSegments(arg) {
945
983
  /// `[A1 bindings/js/index.mjs:2439 · :2454 · :2429 · :2432; docs/specs/storeroom-json-crossing/contract.md §6
946
984
  /// row 4; docs/specs/storeroom-addon-surface/js-unwrap.md §3; docs/specs/storeroom-native/write-and-read.md
947
985
  /// §3.4 `F-1` | requirement]`
948
- export function writeRefusal(refusal, fault) {
986
+ export function writeRefusal(refusal, fault, record) {
949
987
  if (fault.found !== null && refusal !== null && typeof refusal === 'object' && refusal.status === 'ValueNotAdmitted') {
950
988
  valueReject(fault);
951
989
  }
952
- fail(refusal);
990
+ // **⟶ AND THIS IS THE WRITE VERB'S ONE LOG BYPASS, CLOSED — `D-53`, 2026-10-28.** The store's own refusal at the
991
+ // verb crossed here with `fail`'s declared `[]`, so a write refused inside a commit whose list already carried
992
+ // entries — a nested write refused by the store from inside a constraint body or a repair — told the caller
993
+ // NOTHING of the commit's verdict. **THE LIST IS THE COMMIT'S**, handed by the member that holds the record,
994
+ // and it stays `[]` where no commit stands (a caller's own write, whose commit is the one this verb is opening).
995
+ fail(refusal, commitLogOf(record));
953
996
  }
954
997
 
955
998
  /// `docs/specs/storeroom-js/contract.md §2.10`: `listen` mints a token, populates the store's home and wraps it for JS — and its `address` is