Uh oh!
There was an error while loading. Please reload this page.
fix(devx): the driver-conformance coverage scan reads code, not prose - #12321
Conversation
`coveringFiles` answered "does this driver drive this case-set" from raw file text, so a marker named only in a comment satisfied it. Route the read through `scripts/js-comment-mask.mjs` (`stripComments`, on the module's documented discriminator: this axis reports FILES, never a line or an offset) and pin the hole with a self-test case whose fixture is first proven to be one the unmasked rule accepts. Measured over 5 drivers x 9 case-sets: no cell changes hands and the headline stays 45 covered / 0 DEBT / 0 exempt. Two per-file answers flip, both driver implementations that name FILTER_LOGIC_CASES in prose only — driver-sql/src/sql-driver.ts and driver-mongodb/src/mongodb-filter.ts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjM2ia8Av1v5NqfqQEQmC6
…verage-scan-comment-mask
yinlianghui
commented
Aug 25, 2026
ACCEPT — PM review of #12135. Three claims re-measured here on 1. The second covering file — the one my brief did not nameMy dispatch named Both mentions in 2. The |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#12135
coveringFiles()answered "does this driver drive this case-set" from raw file text, so a marker named only in a comment satisfied the import-and-reference rule. The dialect axis that landed in #12134 already routes throughscripts/js-comment-mask.mjsfor exactly this reason, and the two axes disagreed with each other inside one file: the dialect axis refused a mention, the coverage axis accepted one.The change
One line of behaviour:
coveringFilesreads through a newcodeOf()helper that strips comments beforedrivenFromsees the text. Declared surface held toscripts/check-driver-conformance.mjs— no driver source, no driver test, no change tojs-comment-mask.mjs.stripComments, notmaskComments— chosen on the discriminatorjs-comment-mask.mjsdocuments, not becausestripCommentswas already imported. That module's rule is: reports a LINE or a byte offset into the original text →maskComments; feeds a scanner and reports neither →stripComments. This axis reports files —consumesreturns a path, and the CONSUMED and RECONCILED messages quote a path — so nothing downstream can be made wrong by offsets moving, and the deleting form is the one that stays cheap (the same module records a gate that ran 51x slower onmaskComments, because scanning the whitespace runs blanking leaves is quadratic in the comment bytes).Measured: the headline does not move, and no cell changes hands
Swept 5 drivers x 9 case-sets, raw vs masked, with
drivenFromcopied verbatim:The number asked for: 0 of 45 cells move. The gate's headline is
45 covered cell(s), 0 in the DEBT ledger, 0 exemptbefore and after. No cell moves into the DEBT ledger, so no published number changes and no measured ledger entry is owed.Two per-file covering answers flip, and both are driver implementations rather than suites:
packages/drivers/driver-sql/src/sql-driver.tsFILTER_LOGIC_CASESpackages/drivers/driver-mongodb/src/mongodb-filter.tsFILTER_LOGIC_CASESBoth cells stay green because each is genuinely covered by a real suite as well — which is precisely why the defect had to be fixed on a day it was harmless. Neither cell's evidence file moves either: walk order already put a real suite first, so no
consumes()path quoted back to an author changes.The card's specific example holds, and the PM had not verified it.
sql-driver.tswas not merely matched internally — the gate printed it:That note is the only line of gate output this PR changes: it is gone, because the driver implementation is no longer scored as a covering file.
mongodb-filter.tswas never printed —driver-mongodbis single-backend, so the dialect axis never reaches it. It was found by measurement, not by reading the report.Ablation — direction predicted in writing first, then observed
Leg A — revert the masking. Predicted: the two new self-test cases turn red; the precondition case stays green because it asserts raw behaviour. On-disk proof anchored to the changed text (
stripComments-form before=1 after=0; raw-form after=1), not to a baregit diff --stat. Observed, exactly:Leg B — a real covering file's reference made comment-only.
memory-aggregation-conformance.test.tsis the sole covering file fordriver-memory x AGGREGATION_CASES; its two livefor (const c of AGGREGATION_CASES)lines were commented out, leaving the import and two docblock mentions — the exact shape found onsql-driver.ts. On-disk proof: live code refs 2 → 0, injected comment refs = 2, import line kept = 1. Predicted: covered → MISSING, gate red. Observed:The last two lines are the defect itself: identical bytes, opposite verdicts. Both legs ran under a
trap … EXIT INT TERMrestore. Restores proved byte-identical — thegit hash-objectof the restored file equals itsgit rev-parseblob id at HEAD, for both files, andgit status --porcelainis empty. No rebuild leg applies: this gate is a.mjsscript run directly from source, with nodist/between the edit and the measurement.Self-test
Three cases added, and the first is what keeps the others falsifiable. A fixture the old detector would also have rejected pins nothing — it would go green the day someone reverts
codeOf. So the raw text is first asserted to be a case the unmasked rule accepts, and only then is the real detector asserted to refuse it:#12135 — the prose-only fixture IS accepted by the unmasked rule (else the case below pins nothing …)#12135 — a marker mentioned only in a comment must not count as coverage#12135 — and the file is not returned as a covering file either (the dialect axis scores these …)a real driving reference still counts when the same file also discusses the marker in proseThe fixture is the shape that was live on this tree — real imports from the case-set module, the marker in a line comment among them and again in a docblock far below — not an invented one.
Gates
Union derived at the final commit with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstackat4879d71cc2. The first derivation printed STALE TREE (3 commits behind,scripts/bump-objectui.shchanged across the range);origin/mainwas merged in and the union re-derived, which cleared it. Every family it named was run, none narrowed, each exit code captured before any pipe:check:agent-test-spelling✓ sweep is cleancheck:cli-command-ids✓ check-cli-command-ids: 276 command-id literal(s) across 99 file(s) … all resolvecheck:cross-package-test-inputsOK: 16 package(s) read outside themselves, all declared …check:driver-conformancecheck-driver-conformance: OK — 45 covered cell(s), 0 in the DEBT ledger, 0 exempt.check:entry-guard✓ check:entry-guard: 167 scripts/ file(s) — every entry guard goes through invoked-as.mjscheck:parse-guard✓ check:parse-guard: 166 scripts/ file(s) — every TypeScript parse goes through ts-parse.mjs.check:pnpm-filter-targets✓ check:pnpm-filter-targets: 136/173 --filter occurrence(s) across 28 file(s) resolvecheck-ci-filter-parity.mjsOK: all 96 declared cross-package glob(s) (81 unique) are covered …check-cross-package-test-inputs.mjsOK: 16 package(s) read outside themselves, all declared …check:driver-conformanceandcheck:entry-guard/check:parse-guard/check:pnpm-filter-targetseach run their--self-testfirst, so the new cases are inside the gate union rather than beside it. No gate reportedPREREQUISITE NOT MET. Thecheck:cli-command-idsrun carries one pre-existing baselined violation (objectstack publish, tracked as #12223) and still exits 0 — untouched by this PR.Run under
scripts/pm/os-verify-lock.sh:VERDICT command-exit 0 · held the lock 28s · waited 0s.Changeset
None — root
scripts/only, nothing user-visible is published. Carries theskip-changesetlabel.Out of scope, filed
#12320 — the card's unchosen remedy (1). The import regex is still unbounded, so it can assemble a match across two import statements: a marker imported from a local module plus any later
from '@objectstack/spec/data'scores as shared-standard coverage. Masking does not close that. Swept after this fix: 54(file, marker)import readings, 0 differ between the unbounded regex and a per-statement read — latent, not live, so it is afindingwith nopm:queue. Recorded separately because #12135 closes with this PR and the unchosen remedy would otherwise go with it.#12134is not addressed here.Generated by Claude Code