Repository navigation
fix(audit-engine): group template fan-out on the rule inputs the chrome key misses - #580
Conversation
…me key misses The fan-out grouped on chrome plus origin, so two pages with the same chrome but a missing viewport meta, a second main landmark or a different script path on one host shared a verdict. Add a rule-input signature (script srcs, meta names, main count) to the fan-out grouping key only; the stored template_fp is unchanged. Pin the three counterexamples in the equivalence golden test. Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Status: waiting on the bot review. The code and tests are done and green locally. The one unmet criterion is the real-crawl measurement (criterion 1), which needs the gymshark.com and openelectricity.org.au crawls. |
|
Review of #580 (tighten fan-out grouping key, #275). The change is small and well scoped. I did not run the tests.
Test coverage is good. The three counterexamples assert both that the premise holds and that |
…ewport content Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Round 1 addressed in f59a51b:
Not changed:
|
|
Reviewed the diff. The approach is sound: the stored
Test coverage is good. The counterexample cases check that the reference results actually differ and that |
…n the fan-out signature Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Round 2 addressed:
|
|
Review of #580 (tighten fan-out grouping key). The approach is sound: the stored
No critical or high-severity issues found. |
…d test role=main Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Round 3 (final): no critical or high findings.
|
|
Review of #580 (tighten template fan-out grouping key, #275). I read the diff and checked the call sites. I did not run the tests.
No correctness blockers found: `parsed.document` is still live at the call site, and the `NUL` join stays injective. |
|
This review reports no correctness blockers, and the three review rounds are used, so I'm not pushing again. Where each point stands:
|
|
Review of #580 (fan-out grouping key tightened with The approach is sound: the stored
|
…; keep meta values case-exact Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
…ub.com/squirrelscan/squirrelscan into claude/template-cluster-key-275-aqf16i
|
Coverage measurement on synthetic estates, as requested. This is not the real-crawl measurement: the gymshark.com and openelectricity.org.au crawls are not available in this VM, and
Time: wall and CPU were within 10% between arms and between main and the branch, at about 2.5 to 2.9 s wall per run for the whole rule pass. At 360 pages the fan-out saving (about 3 to 10%) is inside that noise, so time is not a usable result here. The counts are the result. What it says:
I also tried your suggested fix, a stem key that replaces hash-like tokens in the script name with One small code change in the same push: meta names and values are no longer lowercased in the signature (the nit from the last review). This is safe, and at worst it splits groups more. Pushed as 38aa3d1 (plus a merge of the remote |
|
Review of #580 (tighter fan-out grouping key). The approach is sound, and the docs and golden tests are thorough. I found one real gap in the key.
Test coverage is good: there are 5 counterexamples, and the signature unit test checks that equal inputs still group. |
…in the fan-out signature Refs #275 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Addressed in one more push. This is past the usual three review rounds; I fixed it anyway because I confirmed it is a real correctness gap in this PR.
All seven counterexample cases fail with the signature removed and pass with it. The equivalence file (21 tests) and the parity golden (53) pass, and typecheck and |
|
Review of #580. The approach is sound: the stored
No security concerns. Overall this is a safe, conservative change. I would address the |
|
Review of #580 (tighten fan-out grouping key, #275) The design is sound. The grouping key gets tighter and the stored
No critical or high issues found. |
|
Reviewed the diff. The approach is sound: widening only the fan-out key, with
Test coverage is good: seven counterexamples are each compared against the resident reference run, plus a positive grouping check and a null-signature check. I could not run the tests in this environment. |
* origin/main: feat(core-contracts): audit levels definition (quick, surface, full) (#602) test(rules): restore the real fetch when a graphql test stubs twice (#599) chore(release): v0.0.107 (#595) docs(changelog): release notes for v0.0.107 (#594) feat(rules): add GraphQL introspection and GET mutation probing rules (#593) fix(audit-engine): keep paid cloud prefetch results when the phase is abandoned (#582)
… is named The VerdictScope doc, the streaming and template-fanout comments and the benchmark note described the signature as script srcs, meta names and the main count. It also keys stylesheet hrefs, integrity presence on both, every meta's attribute names, and the content of the metas declared rules read the value of. The CONTENT_READ_METAS test comment now says it is a tripwire for the literal meta[name] form, not a proof. Signed-off-by: Nik Cubrilovic <[email protected]>
…tricity crawls #275 Counted both keys in one pass over each crawl: gymshark (3983 auditable pages) goes from 37 clusters / 3946 inherited to 52 / 3931, and a fresh 250-page openelectricity crawl stays at 11 / 239. --verify on openelectricity is byte-identical on both keys; gymshark's --verify did not finish inside 40 minutes. Adds the CHANGELOG entry for the fix. Signed-off-by: Nik Cubrilovic <[email protected]>
|
Landing pass (pushed 6430f18): merged main (now including #575 and #606), fixed the docs drift from the last two reviews, and recorded the real-crawl numbers for criterion 1.
|
|
Review of #580 (tighten the template fan-out grouping key). I read the diff and the call sites; I did not run the tests. The change is sound and the tests are good. The counterexample tests pin the premise (
|
|
Triage of the review at 14:00 (no blockers): the CHANGELOG |
Refs #275
The fan-out grouping key is now the chrome key, the page origin and a rule-input signature (sorted
<script src>list, set of<meta>names,<main>landmark count). The storedtemplate_fpis unchanged, sotemplateClusters()and the parity gate are unaffected. The cost of the tighter key is fan-out coverage only, never output.Acceptance criteria
benchmarks/2026-09-perf-program.md. Measured at landing (2026-10-10): gymshark (3983 auditable pages) 37 clusters / 3946 inherited on main's key, 52 / 3931 on the tightened key; openelectricity (fresh 250-page crawl, because the August crawls had lost their HTML to content-store pruning) 11 / 239 on both.--verifyon openelectricity is byte-identical on both keys. Gymshark's--verifydid not finish in 40 minutes, so its byte-identity is not recorded.benchmarks/2026-09-perf-program.md. The justification is the constructed counterexamples, plus the real-crawl measurement above: the tighter key costs 0.4% of inherited pages on gymshark and nothing on openelectricity.template-fanout-equivalence-golden.test.ts(missing viewport meta, second<main>, script path differing on one host). I confirmed all three fail with the signature removed and pass with it. A unit test also coversfanoutInputSignature.VerdictScopedoc inpackages/rules/src/types.tsnow describes what the grouping key covers and what it still does not.Checks run
template-fanout-equivalence-golden,template-fanout-parity-golden,template-cluster-key-golden(audit-engine) andrule-verdict-scope(rules): all passformat:check: cleandetect-secretsis not installed here; I grepped the diff for secret-like strings and found noneAgent skill
No change needed. This is an internal grouping change. CHANGELOG has a Fixed entry, because cloud audits (and CLI runs with
SQUIRREL_RULE_CACHE=0) could inherit a wrong verdict before it.Generated by Claude Code