Repository navigation
fix(audit-engine): fan-out signature covers html/body attrs and icon links (#614) - #621
Merged
Merged
Conversation
nc9
marked this pull request as ready for review
October 9, 2026 16:38
|
Review of #621: no blocking issues found.
The CHANGELOG entry is fine. The note that cached groups regroup on the next run is accurate. |
…links (#614) Signed-off-by: Nik Cubrilovic <[email protected]>
…read (#614) Signed-off-by: Nik Cubrilovic <[email protected]>
… on a shared chrome key Signed-off-by: Nik Cubrilovic <[email protected]>
…ctScope doc names the unkeyed ones #614 Signed-off-by: Nik Cubrilovic <[email protected]>
…ctricity after #614 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
…s comments; doc names order, noscript and placement gaps #614 Signed-off-by: Nik Cubrilovic <[email protected]>
…ibute variables #614 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/template-key-614
branch
from
October 11, 2026 03:29
1c4aa11 to
e1dbafb
Compare
|
Review of #621: I read the diff of
The change is correct and tight. It has counterexample tests, a positive control and a delimiter case, and the docs are updated. I found nothing that should block the merge. |
Contributor
Author
|
Review triage (integrator, head e1dbafb):
|
…released] entries #614 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Reviewed the diff: I found no issues.
I did not run the tests or check CI status. 🤖 Generated with Claude Code |
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #614
Three template rules read inputs the fan-out grouping key did not cover:
a11y/html-xml-lang-mismatch(lang,xml:langon<html>),a11y/aria-hidden-body(aria-hiddenon<html>and<body>) andcore/favicon(relandhrefof icon links). Two pages with the same chrome key but different values there shared a verdict.fanoutInputSignaturenow includes them (icon links as JSON[rel, href]pairs in document order, because the rule lists formats in the order it finds them).Rebased onto main (the CHANGELOG entry moved to
[Unreleased]), then the open criteria finished.Criteria
template-fanout-equivalence-golden.test.ts(anxml:langthat contradictslang, a differentlangunder onexml:lang,aria-hiddenon<html>, on<body>, a missing favicon, a favicon in another format, the same favicons in another order). Each asserts that the two pages share a chrome key, that the rule's verdict really differs, and that nothing is inherited. A/B against main'stemplate-fanout.ts: all fail on main and pass here. Signature tests add the review's positive control (a<body>class or<html dir>change leaves the signature alone) and a|-in-rel/href delimiter case.packages/rules/tests/template-verdict-inputs.test.tsscans every rule the registry fans out (cross-checked againstloadAllRules()). It sees literal selectors including the@squirrelscan/utilshelpers,getAttribute/hasAttribute/getAttrCI/hasAttrCI, selector and attribute variables by name,.matches(), rawctx.page.html,textContent,innerHTML,documentElement,doc.body,ctx.page.url, and every read in a package helper file a rule hands its document to (getCWVHints). Comments are stripped token-aware. The reads must equal a per-rule REVIEWED list, each marked KEYED or UNKEYED, so a new read fails CI and so does a stale entry. The VerdictScope doc (packages/rules/src/types.ts) now names every unkeyed input by rule, plus three things no entry captures (order of the sorted script/stylesheet/meta lists,<noscript>ancestry, head placement), and the test fails if a rule with an unkeyed read is missing from the doc. The unkeyed reads themselves (raw-HTML rules, inline script/style bodies, CWV hints, third-party-cookies images and iframes, landmark-one-main id/class) are left for perf(audit-engine): derive the template fan-out signature from what the declared rules read, with a parity test #585.benchmarks/2026-09-perf-program.mdhas a Template fan-out key misses html lang, body aria-hidden and favicon links that template rules read #614 section. Same method as the The template cluster key does not constrain every input a fanned rule reads #275 table (one pass, chrome key and both signatures, no rules run). gymshark (the 2026-09-22 crawl, 3983 auditable): previous key 52 clusters / 3931 inherited, with Template fan-out key misses html lang, body aria-hidden and favicon links that template rules read #614 72 / 3911 (20 pages, 0.5%). openelectricity (fresh--level full -m 250crawl, 2026-10-11): 11 / 239 both. On both crawls the previous key reproduces its existing row.Note: the signature hash changes for every page, so cached fan-out groups regroup on the next run.
Gates:
tsgo --noEmitclean in audit-engine and rules. Passing:template-fanout-equivalence-golden,template-fanout-parity-golden,template-cluster-key-golden(95),template-verdict-inputs,rule-verdict-scope,template-verdict-page-independence. A mutation check (an extraquerySelector("h1")incore/favicon) turns the tripwire red. Three codex passes, none open.Docs: no user-facing docs change (engine internals). Skill: no change needed.