@blamejs/core 0.11.6 → 0.11.17

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/lib/audit.js CHANGED
@@ -74,8 +74,8 @@ var log = boot("audit");
74
74
  // audit critical path — b.audit.record() must return, emit/safeEmit
75
75
  // drains must not stall behind it. On timeout the shadow record is
76
76
  // dropped (audit.shadow_timeout observability event) and the
77
- // framework chain row remains committed. CLAUDE.md rule §5 drop-
78
- // silent posture for hot-path observability sinks.
77
+ // framework chain row remains committed audit emission MUST NOT
78
+ // crash or stall the request that triggered it.
79
79
  var EXTERNAL_STORE_TIMEOUT_MS = C.TIME.seconds(30);
80
80
 
81
81
  // External shadow store registered via `b.audit.useStore({ record })`.
@@ -88,11 +88,11 @@ var EXTERNAL_STORE_TIMEOUT_MS = C.TIME.seconds(30);
88
88
  // the operator's record receives the fully-formed row (logical fields +
89
89
  // `_id` + `recordedAt` + `monotonicCounter` + `prevHash` + `rowHash`).
90
90
  //
91
- // Shadow failures are drop-silent (rule §5 — hot-path observability
92
- // sinks must not crash the path that emitted them). An audit-shadow
93
- // failure surfaces via `b.observability` as `audit.shadow_failed`; the
94
- // framework chain row still committed and downstream verifyChain still
95
- // works against the framework store.
91
+ // Shadow failures are drop-silent — hot-path observability sinks
92
+ // must not crash the path that emitted them. An audit-shadow
93
+ // failure surfaces via `b.observability` as `audit.shadow_failed`;
94
+ // the framework chain row still committed and downstream
95
+ // verifyChain still works against the framework store.
96
96
  var _externalStore = null;
97
97
 
98
98
  // Per-operation timeout for framework-state SQL. A misbehaving
@@ -481,8 +481,9 @@ async function record(event) {
481
481
  var appended = await _chainWriter.append(logical);
482
482
  // Operator-registered shadow store: replicate the fully-formed
483
483
  // row to an immutable external destination. Drop-silent on
484
- // failure (rule §5) — the framework chain is authoritative and
485
- // already committed; the shadow is a best-effort archival.
484
+ // failure — the framework chain is authoritative and already
485
+ // committed; the shadow is a best-effort archival, and an
486
+ // unreachable destination must not crash the audit caller.
486
487
  // The operator's record receives the SAME object the framework
487
488
  // returns to its caller, so external consumers see identical
488
489
  // hashes / counters / ids for cross-store reconciliation.
@@ -547,10 +548,10 @@ async function record(event) {
547
548
  * or `audit.shadow_timeout` (cap exceeded) with `{ action,
548
549
  * monotonicCounter, error, timeoutMs }` metadata, and the framework
549
550
  * chain append still succeeds (the row is durable in the framework's
550
- * own table; the shadow is a best-effort archival). This is the
551
- * rule §5 drop-silent posture for hot-path observability sinks — an
552
- * unreachable / hanging shadow MUST NOT crash or stall the request
553
- * path that triggered the audit attempt.
551
+ * own table; the shadow is a best-effort archival). Hot-path
552
+ * observability sinks emit drop-silent an unreachable / hanging
553
+ * shadow MUST NOT crash or stall the request path that triggered
554
+ * the audit attempt.
554
555
  *
555
556
  * Call this once at boot, BEFORE the first `b.audit.record` /
556
557
  * `b.audit.emit` / `b.audit.safeEmit`. Switching stores on a running
@@ -451,10 +451,11 @@ function create(opts) {
451
451
  "exchangePreAuthorizedCode: tx_code required (offer mandates it)");
452
452
  }
453
453
  var txHash = sha3Hash("oid4vci-tx:" + eopts.txCode);
454
- // Constant-time compare on the hashed tx_code (audit 2026-05-11
455
- // was `!==` on fixed-width sha3 hex; per CLAUDE.md rule §5
456
- // every framework-internal compare against attacker-controlled
457
- // input routes through timingSafeEqual).
454
+ // Constant-time compare on the hashed tx_code `===` on a
455
+ // hex digest leaks per-byte timing under attacker-controlled
456
+ // input. Every framework compare against attacker-influenced
457
+ // bytes routes through timingSafeEqual regardless of the
458
+ // operand length being fixed.
458
459
  if (!timingSafeEqual(txHash, entry.txCodeHash)) {
459
460
  // Don't consume on failure — wallet may be retrying. Operator
460
461
  // attaches their own attempt counter / lockout via b.auth.lockout.
package/lib/compliance.js CHANGED
@@ -1087,8 +1087,9 @@ var POSTURE_DEFAULTS = Object.freeze({
1087
1087
  // being certified for the ML-KEM / ML-DSA primitives upstream.
1088
1088
  //
1089
1089
  // Conflict resolution: PQC-first remains the framework default
1090
- // (CLAUDE.md rule §2 never weaken security middleware), but
1091
- // operators in a FedRAMP boundary opt into `fipsMode: true` to
1090
+ // the framework refuses to weaken security middleware to fit a
1091
+ // posture flag. Operators in a FedRAMP boundary opt into
1092
+ // `fipsMode: true` to
1092
1093
  // switch `b.audit.sign` from SLH-DSA-SHAKE-256f to FIPS-validated
1093
1094
  // AES-GCM + SHA-384 for the audit-chain signing path. The runtime
1094
1095
  // emits a `compliance.posture.fips_conflict` audit warning when
package/lib/crypto.js CHANGED
@@ -52,7 +52,9 @@ var C = require("./constants");
52
52
  // Circular: audit imports b.crypto for sha3Hash + envelope sign. Lazy-
53
53
  // load the audit module so the legacy-envelope decrypt path can emit
54
54
  // `system.crypto.decrypt.allow_legacy` events without an inline
55
- // require() inside setImmediate (top-of-file requires per rule §3).
55
+ // require() inside setImmediate. (The framework's convention is
56
+ // top-of-file require() except where a documented circular-load
57
+ // reason forces lazy-load; this is one of those reasons.)
56
58
  var lazyRequire = require("./lazy-require");
57
59
  var audit = lazyRequire(function () { return require("./audit"); });
58
60
  // safe-buffer hosts the canonical hasCrlf(s) helper used by every
@@ -266,7 +266,7 @@ function safeDecompress(input, opts) {
266
266
  return out;
267
267
  }
268
268
 
269
- // Drop-silent audit emission per rule §5: refuse-emit is best-effort,
269
+ // Drop-silent audit emission refuse-emit is best-effort,
270
270
  // failures here don't crash the operator's path. Then throw the typed
271
271
  // error so the caller's catch block decides downstream.
272
272
  function _refuse(opts, code, message, originalError) {
@@ -283,7 +283,7 @@ function _refuse(opts, code, message, originalError) {
283
283
  reason: message,
284
284
  },
285
285
  });
286
- } catch (_e) { /* drop-silent per rule §5 */ }
286
+ } catch (_e) { /* drop-silent observability is itself hot-path */ }
287
287
  }
288
288
  var err = new SafeDecompressError(code, message);
289
289
  if (originalError) err.cause = originalError;
@@ -59,7 +59,7 @@
59
59
  * Composes:
60
60
  * - lib/safe-decompress / lib/audit — operator-supplied audit
61
61
  * handle receives `system.safe_mount_info.refused` events on
62
- * read-failed and parse-failed (drop-silent per rule §5).
62
+ * read-failed and parse-failed (drop-silent observability emission must not crash the hot path that emitted the event).
63
63
  *
64
64
  * RFC / kernel-doc citations:
65
65
  * - [Linux Documentation/filesystems/proc.rst §3.5 — /proc/<pid>/mountinfo](https://www.kernel.org/doc/Documentation/filesystems/proc.txt)
@@ -292,7 +292,7 @@ function _refuseEmit(opts, code, message) {
292
292
  outcome: "denied",
293
293
  metadata: { code: code, reason: message },
294
294
  });
295
- } catch (_e) { /* drop-silent per rule §5 */ }
295
+ } catch (_e) { /* drop-silent observability emission must not crash the hot path that emitted the event */ }
296
296
  }
297
297
  }
298
298
 
package/lib/subject.js CHANGED
@@ -634,9 +634,9 @@ function _subjectHash(subjectId) {
634
634
  }
635
635
 
636
636
  function _writeAudit(action, subjectId, outcome, metadata) {
637
- // recordSafe — audit failure must not roll back the subject mutation
638
- // that already touched the database. Drop-silent per CLAUDE.md rule
639
- // §5 (hot-path audit sinks): swallow any throw from audit.emit so a
637
+ // recordSafe — audit failure must not roll back the subject
638
+ // mutation that already touched the database. Hot-path audit
639
+ // sinks are drop-silent: swallow any throw from audit.emit so a
640
640
  // misconfigured sink doesn't crash a partially-committed subject
641
641
  // mutation. Errors surface via the audit sink's own logger.
642
642
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/core",
3
- "version": "0.11.6",
3
+ "version": "0.11.17",
4
4
  "description": "The Node framework that owns its stack.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "blamejs contributors",
package/sbom.cdx.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
3
3
  "bomFormat": "CycloneDX",
4
- "specVersion": "1.6",
5
- "serialNumber": "urn:uuid:47f41007-66d3-47f2-ba7e-e47db1d7370f",
4
+ "specVersion": "1.5",
5
+ "serialNumber": "urn:uuid:977499c0-aee7-4197-9b4d-c7af9fd7fda5",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-05-20T00:03:39.026Z",
8
+ "timestamp": "2026-05-20T16:28:06.450Z",
9
9
  "lifecycles": [
10
10
  {
11
11
  "phase": "build"
@@ -19,14 +19,14 @@
19
19
  }
20
20
  ],
21
21
  "component": {
22
- "bom-ref": "@blamejs/core@0.11.6",
23
- "type": "library",
22
+ "bom-ref": "@blamejs/core@0.11.17",
23
+ "type": "application",
24
24
  "name": "blamejs",
25
- "version": "0.11.6",
25
+ "version": "0.11.17",
26
26
  "scope": "required",
27
27
  "author": "blamejs contributors",
28
28
  "description": "The Node framework that owns its stack.",
29
- "purl": "pkg:npm/%40blamejs/core@0.11.6",
29
+ "purl": "pkg:npm/%40blamejs/core@0.11.17",
30
30
  "properties": [],
31
31
  "externalReferences": [
32
32
  {
@@ -54,8 +54,8 @@
54
54
  "components": [],
55
55
  "dependencies": [
56
56
  {
57
- "ref": "@blamejs/core@0.11.6",
57
+ "ref": "@blamejs/core@0.11.17",
58
58
  "dependsOn": []
59
59
  }
60
60
  ]
61
- }
61
+ }