Skip to content

fix(#498,#455): close two confirmed false negatives in PR #554's gates - #561

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix/contract-false-negatives-554-review
Jul 29, 2026
Merged

fix(#498,#455): close two confirmed false negatives in PR #554's gates#561
BorisTyshkevich merged 1 commit into
mainfrom
fix/contract-false-negatives-554-review

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Follow-up to a review of #554. Three claims were raised against it; all three are correct, and I verified each by experiment rather than by reading. Two are real false negatives — each gate passed while the thing it guards was removed.

1. The CSS contract accepted comment prose as a stylesheet rule (confirmed)

Both class scanners ran their selector regex over raw src/styles.css, so a class merely named in a comment counted as styled. The file already computes a comment-stripped declarations for precisely this reason — prose mentioning a px value must not read as a declaration — but selector extraction never used it.

The masking is real in the shipped stylesheet: each confirm menu's comment cross-references its siblings, so .dash-tree-confirm's prose names .qtab-close-confirm* and .dash-tile-confirm* (src/styles.css:1840), and .qtab-close-confirm's names .dash-tree-confirm* (:2010).

Experiment: deleted both real .qtab-close-confirm rules, left the comment.

before fix → Test Files 8 passed | Tests 338 passed (338)   ← rule GONE, gate green
after  fix → AssertionError: expected [ 'qtab-close-confirm' ] to deeply equal []

#498's own sabotage test missed this because its target, dash-tile-menu-danger, happens to be named in no comment — the reviewer's counterargument on that point is also exactly right.

Both scanners now share one styledClassNames() built from declarations. A second sabotage test pins the specific regression: it asserts the old raw-CSS scan would be fooled by the comment and the current one is not, so the fix cannot silently revert.

One genuine pre-existing gap fell out of this: dash-row (src/ui/dashboard.ts:2654) has no CSS rule and never has — it was only ever "covered" by the two comments naming it, so the pre-existing scanner had been leaking too. That one is correct by design: .dash-grid's own comment spells out that each row owns its column count "set inline by the flow renderer" and that the container must not impose grid-template-columns or the rows lay out side by side. A .dash-row rule would duplicate the inline style or reintroduce that bug, so it joins ALLOWED with that rationale instead.

2. The src/core boundary rule was not actually enforced (confirmed)

tests/unit/dashboard-boundaries.test.js re-implements the import walk instead of exercising build/check-boundaries.mjs.

Experiment: deleted the production src/core entry from RULES.

unit suite   → 61 passed (61)                                        ← nothing red
check:arch   → OK (105 files across 8 active rules, no violations)   ← note: 8, not 9

#455's entire deliverable was removable without a single failure. A text-read assertion now binds the mirror to the production rule, with a named failure message. Read as text rather than imported on purpose: the checker runs its whole gate at module top level and exits non-zero, so importing it would run the production gate inside the test process. With the fix, deleting that entry fails as build/check-boundaries.mjs has no 'dir: src/core' rule — #455 regressed, and check:arch is back to 9 active rules.

3. The unit test mutated src/core on disk (confirmed, minor)

The probe wrote a real .ts file into src/core and removed it in finally — which a crash or kill between the two would have left behind, and which file watchers see. The walk now accepts virtual [path, source] entries, so the probe exercises the same logic with the working tree untouched.

Verification

npm test201 files / 6661 tests passed. npm run build → OK. npm run check:arch → OK, 9 active rules. Every sabotage above was restored byte-identically (git diff --quiet checked, never git checkout --).

Refs #498, #455, #554. No behaviour change — src/styles.css and all production code are untouched; this PR only changes two test files.

Checklist

  • npm test passes (the per-file coverage gate is non-negotiable)
  • Tests added/updated in the same change as the code
  • npm run build succeeds (single-file dist/sql.html)
  • Layers kept honest: pure logic in src/core/, network in src/net/ (injected fetch), DOM in src/ui/
  • No new runtime dependency
  • README / CHANGELOG.md ([Unreleased]) updated if behavior or the deployed surface changed — n/a, test-only
  • Reconciled affected tracked work (roadmap Roadmap to 1.0.0 #68, the issue body, ADR/CHANGELOG) if this change reshaped it

🤖 Generated with Claude Code

https://claude.ai/code/session_01GiubaoqEuBzAyo5C4P8Vqr

Both gates passed while the thing they guard was removed. Verified
empirically, not by inspection.

1. The CSS contract counted comment prose as styling. Both class scanners
   (the pre-existing `class:` one and #498's new menuClass/extraClass one)
   ran their selector regex over RAW `src/styles.css`, so any class merely
   NAMED in a comment looked styled. This file already computes a
   comment-stripped `declarations` for exactly this reason — px values in
   prose must not read as declarations — but selectors never used it.

   The masking is real, not theoretical: each confirm menu's comment
   cross-references its siblings, so `.dash-tree-confirm`'s prose names
   "`.qtab-close-confirm*` and `.dash-tile-confirm*`". Deleting BOTH real
   `.qtab-close-confirm` rules while leaving that comment kept all 338
   assertions in the file green. #498's own sabotage test missed it because
   its target, `dash-tile-menu-danger`, happens to be named in no comment.

   Both scanners now share `styledClassNames()`, built from `declarations`.
   A second sabotage test pins the specific regression: it asserts the old
   raw-CSS scan WOULD be fooled by the comment and the current one is not.

   Exposing this surfaced one genuine pre-existing gap: `dash-row` has no
   rule and never has — it was only ever covered by the two comments naming
   it. Correct by design (its grid is set inline by the flow renderer,
   because the column count is dynamic, and `.dash-grid` must not impose
   columns), so it joins ALLOWED with that rationale rather than getting a
   redundant rule.

2. The `src/core` boundary rule was unenforced. The spec re-implements the
   import walk rather than exercising `build/check-boundaries.mjs`, so
   deleting the production `src/core` RULES entry left this spec at 60/60
   and `check:arch` reporting "OK ... 8 active rules" — #455's entire
   deliverable was removable with nothing red. A text-read assertion now
   binds the mirror to the production rule (text, not import: the checker
   runs its whole gate at module top level and exits non-zero, so importing
   it would run the gate inside the test process).

Also drops the on-disk probe: it wrote a real file into `src/core` and
deleted it in `finally`, which a crash between the two would have left
behind. The walk now accepts virtual `[path, source]` files instead, so the
working tree is never touched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiubaoqEuBzAyo5C4P8Vqr
@BorisTyshkevich
BorisTyshkevich merged commit 28b2ab7 into main Jul 29, 2026
8 checks passed
lesandie pushed a commit to lesandie/altinity-sql-browser that referenced this pull request Aug 2, 2026
The e2e job was gated to tags, schedule and manual dispatch, so it reported
`skipped` on every pull request and every push to `main` while the overall
run still reported success. A check that never runs is not a check.

The cost was concrete: two `tile-open-workbench` specs have been failing
deterministically on chromium, firefox AND webkit, and nothing surfaced it.
Today's `bug`/`low` batch (Altinity#554-Altinity#558, Altinity#561-Altinity#563) all merged "green"; two of
those PRs changed or added e2e specs that CI never executed. The failures only
appeared when the workflow was dispatched by hand (6 failed / 568 passed on
`main`), and a second dispatch at f68861c showed the identical 6 failures, so
they pre-date that batch. Filed as Altinity#565.

Pull requests now run **Chromium only**, path-gated on anything that can move
rendered geometry (`src/**` — which is where `styles.css` lives — plus
`tests/e2e/**`, `playwright.config.js`, `build/**`, `schemas/**`, the
manifests and the workflows). Both Altinity#565 failures reproduce on Chromium, so one
engine is enough to have caught them, and it is cheap enough to sit on every
relevant PR. Tags, nightly and manual dispatch keep the full three-engine
matrix: engine-specific breakage is real here, and that is what a release has
to clear.

The `gate` job needed no change — it already fails on any `failure` among its
needs and tolerates a legitimately skipped job.

Altinity#565's two specs are quarantined with `test.fail()` so this gate is meaningful
from the first run rather than red on arrival. Deliberately not `skip`/`fixme`:
the specs keep executing, so when the underlying bug is fixed they report
"expected to fail, but passed" and the quarantine has to be removed. Their
assertions encode Altinity#535's intended widen semantics and must not be rewritten to
match the broken output.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiubaoqEuBzAyo5C4P8Vqr
@BorisTyshkevich
BorisTyshkevich deleted the fix/contract-false-negatives-554-review branch August 6, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant