Skip to content

feat(engine): count a shared chrome component once in the issue-density penalty #2256 - #2288

Merged
nc9 merged 3 commits into
mainfrom
boat/score-chrome-density-2256
Nov 24, 2026
Merged

nc9 merged 3 commits into
mainfrom
boat/score-chrome-density-2256

Conversation

@nc9

@nc9 nc9 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The issue-density penalty now caps what findings marked as ONE shared component (observed, groupable component evidence) can weigh: pooled, at most ISSUE_PENALTY_SHARED_CAP (2.0, one failing element). Same defect on 2 pages or 25 moves the overall equally. Per-page findings and uncertain/page-scoped evidence still scale. Chosen approach is the cap option of criterion 1 (the tally is additive and streamed per page, so exact cross-page keys cannot be carried).

Closes #2256

Acceptance criteria

  • Counted once or capped, cap documented: calculateIssueDensityPenalty in packages/audit-engine/src/scoring.ts, constant in packages/utils/src/constants.ts, docs in docs/reports.mdx. Shared units ride IssueTally.sharedWarnUnits/sharedFailUnits and CheckTally (so the cloud rescore from checkTallies sees them too).
  • Fixture test: shared-component-density-2256.test.ts "a shared finding moves the density penalty the same on 2 pages as on 25" (exact equality); "still scales with page count" for non-shared and for uncertain evidence.
  • Breakdown: healthScore.debug.sharedComponentUnits and issueDensityShared; the report adjustment line adds it (score-adjustment-3915.test.ts).
  • docs/reports.mdx describes the rule.

Verification

format:check, lint, typecheck clean in audit-engine, report, core-contracts, utils. CI suites via scripts/test-suites.ts: report 1426 pass 0 fail; audit-engine 2447 pass 3 skip 0 fail; rest 3962 pass 0 fail. bun scripts/changelog.ts check OK. make validate in docs/ not run (docs change is one prose paragraph).

Limits

  • Only rules that emit componentOccurrences (today a11y/link-text, content/stale-copyright) are covered. aria-command-name and label-content-name-mismatch from the issue emit no evidence yet: follow-up needed.
  • Cross-page promoted repeated-subtree groups are not counted as shared.
  • Sampled-store carried-side estimates do not carry shared units, so a smart re-audit's carried part counts as before.

Agent skill: no change needed. Scores move for audits with repeated chrome findings (changelog entry added).

@nc9
nc9 force-pushed the boat/score-chrome-density-2256 branch from 7ee8712 to 3788eb4 Compare November 24, 2026 02:39
@nc9
nc9 marked this pull request as ready for review November 24, 2026 03:02
@nc9
nc9 merged commit 4e26f44 into main Nov 24, 2026
10 checks passed
@nc9
nc9 deleted the boat/score-chrome-density-2256 branch November 24, 2026 03:32
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.

Score: issue-density adjustment over-penalises one shared chrome element repeated on every page

1 participant