@vantageos/backend-doctor 0.1.12 → 0.1.13

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.
@@ -179,22 +179,23 @@ const LOOP_NAMED = /\bfor\s*\(|\bfor\s+(?:const|let|var|await)\b|\.forEach\s*\(|
179
179
  const INDEPENDENCE_STATED = /no\s+invariant\s+spans|invariant\s+spans\s+no|writes?\s+are\s+independent|independently\s+atomic|no\s+cross-write\s+invariant/i;
180
180
  // Shape-(1) sub-condition (Eta REVISE #26, 2026-08-31): "a pre-I/O gate mutation
181
181
  // precedes a single atomic write" describes itself CHECKABLY — it is EXACTLY TWO
182
- // ctx.runMutation calls, the FIRST a gate (require*/assert*/ensure*/bind*). A shape-1
182
+ // ctx.runMutation calls, the FIRST a gate (require*/assert*/bind*). A shape-1
183
183
  // marker on anything else (three calls, an unbounded loop, a first call that is not a
184
184
  // gate) is INCOMPLETE and stays non-conforming, exactly as an incomplete shape-2 does
185
185
  // — otherwise eleven words in a comment remove a real violation from the #1250 prod
186
186
  // gate (abstentions do not block; mechanical_violations is the sole driver), and the
187
187
  // mechanical count that gate rests on is no longer honest.
188
- const GATE_CALLEE = /\b(require|assert|ensure|bind)\w*/i;
189
- // Shape (3) narrows the gate stems: `ensure*` is the standard prefix for an UPSERT
190
- // WRITE helper (ensureUser/ensureWorkspace/ensureRow), so on the reingest shape — whose
191
- // FIRST runMutation is the gate — accepting `ensure*` lets a first WRITE renamed the
192
- // usual way (e.g. _insertImportedMemory -> ensureImportedMemory) masquerade as the gate
193
- // and buy the exemption, removing a real violation from the #1250 prod gate (Eta REVISE
194
- // #27, probe B). `bind` STAYS (bindOrAssertStorageOwnership is kb.ts's real gate, the
195
- // case this shape exists for); `require`/`assert` are unambiguous. Shapes 1/2 keep the
196
- // broader GATE_CALLEE.
197
- const GATE_CALLEE_REINGEST = /\b(require|assert|bind)\w*/i;
188
+ // The gate stem excludes `ensure*` — the standard prefix for an UPSERT WRITE helper
189
+ // (ensureUser/ensureWorkspace/ensureRow). Both shapes whose FIRST runMutation is the gate
190
+ // (shape 1 pre-io-gate, shape 3 gate-then-idempotent-reingest) checked the callee NAME, so
191
+ // accepting `ensure*` let a first WRITE renamed the usual way (_insertImportedMemory ->
192
+ // ensureImportedMemory) masquerade as the gate and buy the exemption — removing a real
193
+ // violation from the #1250 prod gate. Fixed at the CLASS (Eta REVISE #27 probe B closed
194
+ // shape 3; this closes the same hole in shape 1, task k179fmje8vb7y0tbjdmxbzg78h8dhj3q):
195
+ // the defect was a gate sub-condition decided by a name stem that idiomatically names
196
+ // writes, so the fix is one narrowed stem set for every gate check. `bind` STAYS
197
+ // (bindOrAssertStorageOwnership is kb.ts's real gate); `require`/`assert` are unambiguous.
198
+ const GATE_CALLEE = /\b(require|assert|bind)\w*/i;
198
199
  export function scanR29(files) {
199
200
  const scan = emptyScan();
200
201
  for (const f of files) {
@@ -218,7 +219,7 @@ export function scanR29(files) {
218
219
  const shapeGate = count === 2 && GATE_CALLEE.test(firstMutCallee);
219
220
  // Shape (3) sub-conditions: a leading gate runMutation, a supersede/dedup on
220
221
  // a stable namespace, a re-insert loop, AND an explicit convergence statement.
221
- const shapeReingest = GATE_CALLEE_REINGEST.test(firstMutCallee) &&
222
+ const shapeReingest = GATE_CALLEE.test(firstMutCallee) &&
222
223
  REINGEST_SUPERSEDE.test(region) &&
223
224
  STABLE_KEY.test(region) &&
224
225
  LOOP_NAMED.test(region) &&
@@ -240,7 +241,7 @@ export function scanR29(files) {
240
241
  ? "the region names its loop and states the per-item writes are independently atomic (no invariant spans two)"
241
242
  : shape === SHAPE_GATE_REINGEST
242
243
  ? "a leading gate runMutation, a supersede/dedup keyed on a stable namespace, and a recovering re-insert loop, with the convergence stated explicitly — a re-ingest of the same stable key converges on one current set"
243
- : "exactly two runMutations, the first a gate (require*/assert*/ensure*/bind*) preceding a single atomic write, which R-29's <=1 bar has no room for"}. R-29 refuses (a reviewer verifies the claim per site) — never a silent green (Eta ruling 2026-08-31)`,
244
+ : "exactly two runMutations, the first a gate (require*/assert*/bind*) preceding a single atomic write, which R-29's <=1 bar has no room for"}. R-29 refuses (a reviewer verifies the claim per site) — never a silent green (Eta ruling 2026-08-31)`,
244
245
  });
245
246
  }
246
247
  else if (shape === SHAPE_GATE_REINGEST) {
@@ -248,7 +249,7 @@ export function scanR29(files) {
248
249
  // NOT buy could-not-judge (Eta: a shape names a checkable sub-condition, or
249
250
  // the carve-out becomes a vocabulary).
250
251
  const missing = [
251
- !GATE_CALLEE_REINGEST.test(firstMutCallee) && "a leading gate runMutation (require*/assert*/bind* — ensure* is an upsert-write stem, excluded here)",
252
+ !GATE_CALLEE.test(firstMutCallee) && "a leading gate runMutation (require*/assert*/bind* — ensure* is an upsert-write stem, excluded here)",
252
253
  !REINGEST_SUPERSEDE.test(region) && "a supersede/dedup call",
253
254
  !STABLE_KEY.test(region) && "a stable namespace key (namespace/docId/contentHash)",
254
255
  !LOOP_NAMED.test(region) && "a re-insert loop (for/for-of/.forEach/.map)",
@@ -266,7 +267,7 @@ export function scanR29(files) {
266
267
  scan.violate.push({
267
268
  rel: f.rel,
268
269
  n: firstMut || openLine,
269
- note: `action ${inAction} orchestrates ${count} ctx.runMutation calls with an atomicity-exception "${SHAPE_PRE_IO_GATE}" marker that is INCOMPLETE — this shape is EXACTLY TWO runMutations whose FIRST is a gate (require*/assert*/ensure*/bind*); here ${count !== 2
270
+ note: `action ${inAction} orchestrates ${count} ctx.runMutation calls with an atomicity-exception "${SHAPE_PRE_IO_GATE}" marker that is INCOMPLETE — this shape is EXACTLY TWO runMutations whose FIRST is a gate (require*/assert*/bind*); here ${count !== 2
270
271
  ? `there are ${count}, not two`
271
272
  : "the first runMutation is not a gate call"}. A gate-then-single-write is checkable; a marker cannot remove a >2-call or loop site from the gate`,
272
273
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vantageos/backend-doctor",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "A conformance instrument that measures the VantagePeers backend against the pinned backend standard. The THIRD doctor built ON the @vantageos/mcp-doctor engine — never a third engine. It consumes runDoctor/renderTable and adds only detectors.",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",