Skip to content

fix(rules): an unconfirmed control resolves the prior fail it replaced #935 - #936

Merged
nc9 merged 3 commits into
mainfrom
fix/935-unconfirmed-counts-as-evaluated
Oct 19, 2026
Merged

nc9 merged 3 commits into
mainfrom
fix/935-unconfirmed-counts-as-evaluated

Conversation

@nc9

@nc9 nc9 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #935.

Problem

Since #921 the hidden-control a11y rules report a control a <style> rule may hide as a <check>-unconfirmed warn row instead of the <check> fail. A page whose only finding moved from <check> to <check>-unconfirmed never reported <check> this run, so the resolution signal listed it as not evaluated for <check>, and computeMerge carried the previous audit's fail forever, beside the new unconfirmed warn.

Fix

In collectResolutionEvidence (packages/rules/src/resolution.ts), shared by both signal encoders:

  • a page with a <check>-unconfirmed row counts as evaluated for an existing <check> key (no key is created), so its prior <check> fail resolves unless the page still fails <check>;
  • the other way round, a page evaluated for <check> counts as evaluated for an existing <check>-unconfirmed key, so a prior unconfirmed warn resolves once the control is named and the page passes;
  • a page the rule said nothing about (no row, or scan-truncated) is still in notEvaluated and keeps carrying.

The suffix is a shared constant, UNCONFIRMED_CHECK_SUFFIX in core-contracts, used by unconfirmedRow (static-hidden) and aria-hidden-focus.

The seven rules' solution text still said squirrel does not read <style> blocks. It now says decidable <style> rules count and the rest are reported as unconfirmed. The private bump regenerates the rules catalog for this.

Acceptance criteria

  • With the a11y: after #921 a page whose <check> becomes <check>-unconfirmed keeps the previous audit's <check> fail carried forever #935 fixture, run 1's open aria-command-name fail on A, merged with a run that emits only aria-command-name-unconfirmed on A, resolves. Covered by audit-engine/tests/unconfirmed-resolves-prior-935.test.ts, which uses the real rules, buildResolutionSignal and the cloud merge.
  • The same for every rule that emits an unconfirmed row: 8 rule/check pairs, aria-command-name, button-name, aria-input-field-name, aria-labels/aria-buttons, form-labels, aria-dialog-name (aria-dialog-name and dialog-name), and aria-hidden-focus.
  • Page C, which the rule did not evaluate, stays in notEvaluated and its prior fail stays open, in every case.
  • The test runs the fixture through buildResolutionSignal and the merge and covers both cases, plus a direct signal assertion. It failed 0/9 before the fix.

Unit tests are in rules/tests/resolution-compact.test.ts, legacy and compact shapes. They cover:

  • unconfirmed-only;
  • mixed fail and unconfirmed stays failing;
  • no base key is created;
  • folded aggregate;
  • scan-truncated still not evaluated;
  • the symmetric case.

Checks

  • rules: resolution (70) and a11y (426) tests pass.
  • audit-engine: merge suites (115), the new test (10) and every *golden* suite (198) pass.
  • tsgo is clean in core-contracts, rules and audit-engine.
  • docs: tangly --strict and check-links pass.
  • codex delta review: no P1/P2.

squirrel skill impact

None. No CLI flags, output format or report fields change.

…#935

A page whose only finding moved from <check> to <check>-unconfirmed
(pub#921) never reported <check>, so the resolution signal listed it as
not evaluated and the merge carried the old fail forever. The signal now
counts a <check>-unconfirmed page as evaluated for an existing <check>
key, and a page evaluated for <check> as evaluated for an existing
<check>-unconfirmed key. Pages the rule said nothing about still carry.

Also refresh the seven rules' solution text: <style> rules squirrel can
decide count, the rest are reported as unconfirmed.

Signed-off-by: Nik Cubrilovic <[email protected]>
@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Reviewed the source changes in packages/core-contracts and packages/rules. I did not read the new tests or the docs and CHANGELOG edits closely, and I did not run anything.

  • (low) packages/rules/src/resolution.ts: a prior <check> failure now resolves as soon as the same page reports <check>-unconfirmed. That follows the PR's stated design, but "unconfirmed" is not the same as "fixed". If a style really doesn't hide the control, the real failure disappears from the report and a warning replaces it. Make sure the docs and CHANGELOG say plainly that the failure is resolved, not fixed.
  • (low) packages/rules/src/resolution.ts: the logic that links base and unconfirmed keys depends on the -unconfirmed suffix and slice(0, -suffix.length). Another check whose name ends in -unconfirmed would be linked to a base check by accident. The shared constant helps. I'd still add a test for a check that has the suffix but no base key. The comment says this "never creates a key of its own", and the test would pin that down.
  • (nit) The solution strings in several a11y rules and the docs were extended with long sentences. Check that they don't conflict with the line-length or lint conventions in CONTRIBUTING.md.

I found no critical or high-severity issues. The change is small and consistent, and the suffix constant now has a single definition.

@nc9

nc9 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Review triage. None of these points needs a code change:

  • (low) "unconfirmed is not fixed": agreed. The page still carries the new -unconfirmed warning for that control. The CHANGELOG and both rule docs say the earlier failure is closed and the control is now reported as unconfirmed. They never say fixed.
  • (low) suffix without a base key: packages/rules/tests/resolution-compact.test.ts, test "no page reports c itself: the unconfirmed row creates no c key", already pins this. With only a <check>-unconfirmed row and no <check> row anywhere, the signal has no <check> key, failing or not evaluated.
  • (nit) solution length: format, lint and typecheck pass (local CI replay below).

@nc9

nc9 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Local CI evidence while GitHub Actions is billing-locked; merge pending. Every ci.yml and dco.yml step was replayed at 45b128a on bun 1.4.0, and all pass. That covers quality, all 6 test suites (13,883 tests), engine goldens 209, docs check, build and validate, CLI compile with the embedded rules version, dependency audit, detect-secrets 1.5.0, DCO and the CHANGELOG duplicate check.
One apps/cli test (request-deadline, which connects to 127.0.0.2) fails only on macOS, where loopback has no 127.0.0.2 alias. It passes 9/9 in Linux oven/bun:1.4.0.
CodeQL and claude-review were green at e99afad; the only change since is a 3-line test-only edit.

@claude

claude Bot commented Oct 19, 2026

Copy link
Copy Markdown

Reviewed the diff. I didn't run the tests.

I found no correctness, security or performance problems. The change to collectResolutionEvidence in packages/rules/src/resolution.ts does what the PR describes:

The new UNCONFIRMED_CHECK_SUFFIX constant replaces the duplicated string literals.

  • (nit) packages/rules/src/a11y/*.ts solution text: the new copy says "A element" in the aria-command-name rule and uses "a element" in the same string. It should be "An element". The catalog regeneration will pick up the fix.
  • (nit) packages/rules/src/resolution.ts: check.name.endsWith(UNCONFIRMED_CHECK_SUFFIX) also matches a check whose name is only the suffix, which would give an empty base. No rule does this today. A one-line length guard would make it safe against future rules.
  • (low) Tests: unconfirmed-resolves-prior-935.test.ts and resolution-compact.test.ts cover the main cases. Please confirm there is also a case for a page that has both a <check> fail and an unconfirmed row. The fail should stay open for that page.

@claude

claude Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review of PR 936 (pub#935: an unconfirmed row resolves the prior base-check fail). I read the diff only and did not run the tests.

  • (medium) packages/rules/src/resolution.ts (the merge loop over evaluated): the new evidence is only attached to a base key that some page emitted this run. The code comment says it 'never creates a key of its own'. Suppose every page that had the prior <check> fail now emits only <check>-unconfirmed, and no page emits <check>, not even a pass. Then <check> is not in evaluated, so the prior fails still carry, which is the bug being fixed. The tests hide this because page B always passes and creates the base key. Consider creating the base key from unconfirmedOf, which seems safe because the rule did evaluate <check>. Alternatively, add a test where every page is unconfirmed and document the limit.
  • (low) resolution.ts: key.slice(0, -UNCONFIRMED_CHECK_SUFFIX.length) strips the suffix from the whole ruleId|check key. This works, but it would treat any unrelated check whose name ends in -unconfirmed as a derived check. A short note, or a registry of the rules that emit the suffix, would make that explicit.
  • (low) packages/audit-engine/tests/unconfirmed-resolves-prior-935.test.ts: the a11y/aria-dialog-name fixture is the only one that covers two checks, and a11y/aria-labels is exercised only through aria-buttons. If aria-labels emits other checks that can go unconfirmed, add cases for them.
  • (nit) The rules/src/a11y/*.ts changes are mostly edits to the solution strings plus the suffix constant. Consider using the constant in every rule that emits the check name, so the string and the signal can't drift apart.

The overall approach is sound and the tests are thorough. I'd resolve the first point before merging.

@nc9

nc9 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Triage of the review at 6e942cd. None of these points needs a code change:

  • (medium) every page only unconfirmed: this case already resolves. When no page emits <check> this run, the signal has no <check> key at all. computeMerge then takes its key-absent path (packages/audit-engine/src/merge-core.ts, the branch after the failingSet check), and a crawled page's prior <check> finding resolves, as it did before docs(rules): fix rule option tables #1185. I probed it on this head: run 1 aria-command-name fails on A and B; run 2 emits only aria-command-name-unconfirmed on both, with no base row anywhere. The signal keys are aria-command-name-unconfirmed only. After the merge, both prior aria-command-name findings are resolved and the two unconfirmed warns are open. The pub#935 bug needs the base key to exist, which takes a page that still reports <check>; that is what the tests cover.
  • (low) suffix match: every -unconfirmed check comes from unconfirmedRow (static-hidden) or aria-hidden-focus, and both use UNCONFIRMED_CHECK_SUFFIX. No other check name in the rules ends in it.
  • (low) aria-labels checks: aria-buttons is the only check aria-labels reports as unconfirmed, and aria-dialog-name covers both of its checks.
  • (nit) constant everywhere: button-name still spells button-name-unconfirmed literally. It moves to unconfirmedRow in the a11y: a :root custom-property block makes every control on the page unconfirmed (since #921) #938 follow-up, which touches the same file.

@nc9
nc9 merged commit 1ec372d into main Oct 19, 2026
15 checks passed
@nc9
nc9 deleted the fix/935-unconfirmed-counts-as-evaluated branch October 19, 2026 22:20
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.

a11y: after #921 a page whose <check> becomes <check>-unconfirmed keeps the previous audit's <check> fail carried forever

1 participant