Repository navigation
Description
A consumer that compares two audits (a diff, an issue tracker, an agent deciding whether its fix worked) needs to know when a finding from the first audit is gone because it was fixed. The check names in rule results do not make that possible today, because rules name their outcomes inconsistently:
security/leaked-secretsreports a problem as checkleaked-secrets-criticaland a clean result as checkleaked-secrets. There is never a passingleaked-secrets-critical.content/dev-leakagereports a problem as adev-leakagewarn check and reports nothing at all when it is clean: its checks list is empty.security/hstsandsecurity/x-frame-optionsuse one name for every outcome (fix(rules): security/hsts and security/x-frame-options use one check name for every outcome, so "missing" and "present but weak" cannot be told apart #1737), which is the opposite problem.security/csphas a distinct name per outcome and a separatecsp-presentpass.
So "the same check now passes" is not a test anyone can apply across rules. Seen on the public demo site nutshop.squirrelscan.com (repo squirrelscan/nut-shop): a leaked key was removed, the site was re-audited in full, and a comparison of the two audits could not tell that the finding was fixed.
The dependable signal is: the rule ran over the same scope and did not report the finding. That needs the report to say, per rule, that it ran and what it covered, and it needs rules to be consistent about what a clean run looks like.
What is wanted
- A convention, enforced by a test over every rule: a rule that ran always emits at least one check, including when it finds nothing (a pass or an informational check), so "ran and clean" is never an empty list.
- Each rule declares, in its metadata, the check names it can emit and which of them are problem outcomes and which are clean outcomes, so a consumer can map a failing check to the clean check that supersedes it without guessing from names.
- The report records, per rule, whether it ran, was skipped or timed out, and the scope it covered, in a form the comparison and the cloud can rely on (most of this exists as
notChecked; the gap is the per-rule positive statement). - Existing check names are kept wherever possible; this is additive metadata plus a few rules gaining a clean check.
Acceptance Criteria
- Every rule that runs emits at least one check; a test runs each rule on a clean fixture and fails on an empty checks list.
- Rule metadata lists the rule's check names with their outcome class (problem or clean), and a test fails when a rule emits a check name that is not declared.
- For
security/leaked-secretsandcontent/dev-leakage, the metadata links the problem checks to the clean check, andcontent/dev-leakageemits a clean check when it finds nothing. -
squirrel report --diff(and any other comparison in this repo) treats a finding as fixed when the rule ran over the same scope and no longer reports it, using the declared linkage, and treats a rule that did not run or a page that was not crawled as not compared. - The JSON report format documentation describes the linkage and how to decide "fixed" from two reports.
- The rule docs pages list each rule's check names by outcome class (generated from the metadata).
- No existing check name is renamed without a CHANGELOG entry.
Activity
nc9 commentedon Nov 11, 2026
Sizing, measured on a real full-audit report (301 rules ran of 326 built in: 212 page, 114 site).
content/date-agreement,schema/rating-scope, and 7 inintegrity/(brand-impersonation,cloaking,fake-auth-overlay,kit-signature,known-malicious-url,obfuscated-script,seo-doorway). One report, so the real count is probably 10 to 25, not hundreds.content/dev-leakageclaim above is stale: it already emitsdev-leakage:passwhen clean.security/leaked-secretsemitsleaked-secrets:passbeside theleaked-secrets-criticalproblem check, so that one needs linkage, not a new check.squirrel report --diff(apps/cli/src/reports/diff) treats a fingerprint that is absent from the current report as removed. It never asks whether the rule ran over the same scope, so a rule that did not run reads as fixed.Plan, all additive:
meta.checks({name, outcome: problem | clean | skipped, clears}), a clean check for the empty rules, linkage for leaked-secrets, hsts, x-frame-options and csp, and a contract test with an allowlist baseline that ratchets down.report --diffdecides fixed as "the rule ran over the same scope and no longer reports it" and adds a not-compared bucket. The cloud mirror is private #3993 / #3997.nik
test: fix the tests the full suite caught: integrity rules record a c…
feat(rules): rules declare their check names by outcome class; rules …
docs(changelog): say plainly that clean passes can raise scores by ab…
test: fix the tests the full suite caught: integrity rules record a c…
nc9 commentedon Nov 12, 2026
Not closed after v0.0.179 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179).
meta.checksexists, nine silent rules emit checks and the named rules declare their linkage. Still open: a test that every rule emits a check on a clean fixture, declarations for the remaining rules, diff logic that reads the linkage, the report docs and the generated check-name lists in the rule docs. The change that shipped is 0e080dd.nik
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
test(rules): every page rule emits a check on a clean page, with a sh…
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
test(rules): every page rule emits a check on a clean page, with a sh…
test(rules): every page rule emits a check on a clean page, with a sh…
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
test(rules): every page rule emits a check on a clean page, with a sh…
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
fix(rules): security/supabase-rls declares its meta.checks so the #1741…
test(rules): every site rule emits a check on a clean site, with a sh…
Merge origin/main into boat/paste-inputs-auth-2106
Merge origin/main into boat/issues-cloud-only-2031
Merge origin/main into boat/targeted-site-rules-1778
nc9 commentedon Nov 21, 2026
Graded against current main (43e18bf). Tests run by path: rule-check-declarations, rule-clean-run-checks, rule-clean-run-site-checks (10 pass, 0 fail), diff-not-compared-1748 (31 pass, 0 fail),
bun scripts/rule-checks.ts --checkin docs (exit 0).--checkpasses.Shipped in #2179 and 0e080dd. The remaining baselines are tracked in #2218.
nik