Repository navigation
Description
Follow-up to the template fan-out (squirrelscan/repo#1951), from an adversarial review of it.
What is true today
The cluster key (#267) is the page's CHROME: external asset hosts, <body> class tokens, CSS custom-property names, stylesheet hrefs, and whether <nav>/<footer> are present. Two pages sharing that key are treated as one template, and a rule declaring verdictScope: "template" runs once for the group.
The key is an approximation on purpose. The intuitive alternative, an exact DOM skeleton, puts 224 of gymshark.com's 247 pages in a cluster of one and reduces the whole idea to a 6.5% win (#1026). So soundness rests on the DECLARATION and its falsifiers, not on the key — which is exactly what #269 says, and it is an empirical claim: a rule constant on two real crawls can vary on a third.
The gap, concretely
A review constructed page pairs that share a key and get different verdicts from a declared rule:
- The same chrome with the viewport
<meta>missing on one page:mobile/viewportpasses on one and fails on the other. - The same chrome with two
<main>elements on one page:a11y/landmark-one-mainlikewise. - The same chrome where a script's PATH differs on the same host (
/assets/a.jsvs/assets/b.js, which per-route hashed bundles produce):security/sriattributes the representative's resource url to the member, so a finding names a file that is not on that page.
None of these is reachable on gymshark.com, openelectricity.org.au, or the authored parity corpus, which is why every gate is green. They are constructible, and hashed per-route bundle names on a shared CDN host are not exotic.
Two things #1951 did NOT leave to the declaration, because they are properties of the page rather than claims about markup: the page's ORIGIN is part of the fan-out grouping key (security/sri compares it), and core/charset was demoted to page scope because its verdict can come from the Content-Type header.
What to decide
- Tighten the fan-out grouping key beyond the stored
template_fp, for example by adding the page's<script src>list and the set of<meta>names. Strictly safer: a tighter production grouping than the one the parity gate proves constancy over. The cost is fan-out coverage, and it is unmeasured. - Demote the rules whose inputs the key does not reach, which is most of the 25.
- Leave it, and rely on the declaration plus the three falsifiers, which is the current position.
Option 1 needs a number before it can be chosen: how many clusters does gymshark.com have under the tightened key, and how many pages still inherit a verdict?
Acceptance Criteria
- The cluster count and the number of pages that inherit a verdict are measured on gymshark.com and openelectricity.org.au under the current key and under at least one tightened key, and recorded in
benchmarks/2026-09-perf-program.md - A decision is recorded on which of the three options ships, with the measurement as its justification
- If the key is tightened,
template-fanout-equivalence-golden.test.tsgains a case built from one of the counterexamples above that fails under the old key and passes under the new one - If the key is left as is, the limitation is stated where a rule author declaring
verdictScope: "template"will read it (n/a: the key was tightened; theVerdictScopedoc states what it still does not cover anyway)
Activity
docs(benchmarks): record what running a rule once per template is wor…
perf(audit-engine): run a template-scoped rule once per cluster and f…
docs(benchmarks): record what running a rule once per template is wor…
perf(audit-engine): run a template-scoped rule once per cluster and f…
fix(audit-engine): make the rule cache and template fan-out mutually …
perf(audit-engine): replay an unchanged page's rule results instead o…
nc9 commentedon Oct 7, 2026
Current state (2026-10-07): criterion 4's fallback is in place. The limitation (two pages can share the key and still differ in a viewport
<meta>, a second<main>, or a script path) and the two falsifiers are documented onVerdictScope(packages/rules/src/types.ts:96-116), where a rule author declaringverdictScope: "template"reads it.Remaining: criteria 1-2. Nothing in
benchmarks/measures the cluster count under a tightened key, and no decision is recorded. 25 rules still declare template scope.nc9 commentedon Oct 8, 2026
Status: PR #580 is open. It tightens the fan-out grouping key with script srcs, meta names and the main count. The three counterexamples are pinned in
template-fanout-equivalence-golden.test.ts, and they fail under the old key.Still open: criterion 1. The gymshark.com and openelectricity.org.au crawls are not available to me, so I did not record cluster or inherited-page counts and did not invent any. Someone with the crawls needs to run
template-fanout-bench.ts --verifyand add the numbers tobenchmarks/2026-09-perf-program.md.fix(audit-engine): require the fan-out input signature and include vi…
fix(audit-engine): include content of the metas declared rules read i…
refactor(audit-engine): attach the signature JSDoc to its function an…
docs(benchmarks): record fan-out coverage on synthetic bundle estates…
fix(audit-engine): include integrity, duplicates and attribute names …
docs(benchmarks): record the fan-out key on the gymshark and openelec…
nc9 commentedon Oct 9, 2026
Real-crawl counts are now in
benchmarks/2026-09-perf-program.md(via #580). gymshark: 37 clusters / 3946 inherited on the current key, 52 / 3931 on the tightened key. openelectricity (fresh 250-page crawl): 11 / 239 on both. Template-scoped rules that still read inputs outside the key, confirmed in the rule sources:a11y/html-xml-lang-mismatch(<html lang>/xml:lang),a11y/aria-hidden-body(aria-hiddenon<html>/<body>) andcore/favicon(link[rel*=icon]hrefs). Those, plus a parity check that derives the signature from what declared rules actually read, are what's left here.fix(audit-engine): group template fan-out on the rule inputs the chro…
nc9 commentedon Oct 9, 2026
Closed by #580 (25aecef, main CI green). All four criteria were checked on main. The counts are in
benchmarks/2026-09-perf-program.md(gymshark 37/3946 -> 52/3931, openelectricity 11/239 on both), the decision and its justification are recorded there, and seven counterexamples intemplate-fanout-equivalence-golden.test.tsfail on the old key and pass on the new one. The three template rules that still read inputs outside the key are tracked in #614.