Repository navigation
Conversation
nc9
force-pushed
the
feat/ignore-1262
branch
2 times, most recently
from
October 30, 2026 08:22
6109afe to
0649638
Compare
nc9
force-pushed
the
feat/ignore-1262
branch
2 times, most recently
from
October 31, 2026 03:22
803670e to
4f89ca1
Compare
…ing a rule (#1262) Signed-off-by: Nik Cubrilovic <[email protected]>
4 tasks done
3 tasks done
Merged
Contributor
Author
|
Landed in v0.0.148 as nik |
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.
Refs #1262 (first PR of the plan in the spec comment; not complete against the AC, see "Not in this PR").
What
One engine-level
[[ignore]]table insquirrel.toml, applied to every rule's results. Decisions recorded on the issue (Nik, 2026-10-30):ignorable: falseonly forintegrity/*; a fully waived check is a pass with an "N waived" note;reasonoptional; AND within an entry, OR across entries;--no-ignorein the first PR.packages/config/src/ignore.ts):IgnoreEntrySchema(rule or glob, optionalchecks,items,urls,reason; items or urls required;selectorsrefused as "not supported yet"; caps of 200 entries, 100 matchers, 200/512 characters),Config.ignoreoptional so an absent list changes nothing.packages/rules/src/ignore.ts, hook inRuleRunner.runOneRule): the one place every result passes (page rules, site rules, fanned template verdicts, after the fan-out clone so a URL waiver is judged against this page). Items match exactly by default,glob:andregex:by prefix, against item id then label; urls use theexcludePatternsforms. Regexes over 200 characters, with nested quantifiers or invalid are refused (reported, never run); glob and regex inputs are clamped to 1000 characters.(N ignored)(rules withmeta.messageCountsItems,security/cookie-flagsfirst, show the remaining count); all items waived: the check becomes a passN waived by squirrel.toml: ...;urlsalone on a page rule: the rule is not run on a matching page and a visible skipped check (skipReason: "ignored", excluded from the score) says why; items AND urls prunesourcePagesand waive an item left with none; pass and skipped checks are never touched.pageRuleSignature()carries the entries that name a rule, andcomputeRunContextHashnow includes it (it previously projected only id and options, so an edited waiver would have replayed stale results). Only the named rules' keys move; with no list every key is unchanged.urlsis disqualified from fan-out (likeskipOnSoft404/skipOnNoindex), because its verdict is no longer a property of the template.ignorable: falseon the nineintegrity/*rules; an entry naming one is asquirrel config validateerror and the engine never applies it.report.ignored(meta.ignoredin JSON): waived items and pages, per rule, per entry with its reason, entries that matched nothing,disabledfor--no-ignore,carriedStale. AIgnored by squirrel.toml: ...line plus anIgnore entry N (...) matched nothing.line in console, text, markdown and HTML;<ignored>elements in LLM and XML; slim-JSON round trip with validation (a stored report is untrusted: control characters stripped, counts made safe). The per-check record lives indetails.ignored(already persisted with a check, no storage migration), and the summary is rebuilt from the stored checks plus the entries stamped onscanScope.ignore, sosquirrel reportshows the same.squirrel audit --no-ignore, completions (bash, zsh, fish),squirrel config validateand the audit preflight report unknown rules (with a suggestion), non-ignorable rules, unsafe patterns, and pointrule_optionskeys namedignore*at[[ignore]].docs/configuration/ignore.mdx(nav entry),docs/cli/audit.mdx,docs/configuration/rule-options.mdx,docs/configuration/output.mdx; CHANGELOG bullet under Unreleased.make validatepasses.Smart-audit carry path (the open question in the spec): verified
Findings carried from pages a run did not crawl are replayed from the per-page store (
carriedFindingToCheckand its SQL twin for untouched pages) and never pass throughrunOneRule, so a list edited since the earlier audit cannot reach them. Filtering the store-side twin is not feasible in this PR. Instead the audit stamps a fingerprint of the list on the crawl's scan scope; when the previous audit's differs and this run carried findings, the report setsignored.carriedStaleand the line says carried findings may still include waived items, with the fix (re-run without a page limit, or--refresh). An unchanged list says nothing. Tested end to end (three real audits withsmart_audits = true: changed list givescarriedStale, same list again does not). Findings recorded after the list existed are already filtered, so the stale case is only "the list changed since".Tests (failing first where noted)
packages/rules/tests/ignore-1262.test.ts(21): thesecurity/cookie-flagscase from the issue (localizationandcart_currencywaived,merchant_prefstill reported with counts and(2 ignored)), all-waived pass, no-list byte identity,checksscoping, page waiver (rule not run, skipped check), items AND urls, site-rulesourcePagespruning, every matcher form, entry OR/AND, unsafe regex refused, a 5 MB id compared in bounded time, non-ignorable rule, signature behaviour, everyintegrity/*ruleignorable: false. With the runner hook reverted 9 fail.packages/audit-engine/tests/ignore-rule-cache-1262.test.ts(4; 3 fail withrule-cache.tsreverted) andignore-template-fanout-1262.test.ts(3; 1 fails with the fan-out change reverted).packages/config/tests/ignore-1262.test.ts(7),packages/report/tests/ignored-1262.test.ts(20, including hostile stored values),apps/cli/tests/commands/config-validate.test.ts(+4),apps/cli/tests/controllers/report.test.ts(+1 round trip),apps/cli/tests/cli/audit-ignore-e2e.test.ts(5 realsquirrel auditruns against a local site setting Shopify-style cookies: waived,--no-ignore, no list, text output with the unmatched entry, the carry case).make validate. Not run here:scripts/test-suites.ts --run rulesand--run rest(left to CI).Not in this PR (the AC checklist is not complete, so Refs, not Fixes)
meta.ignored.byRuleand the check messages for now.ignorecolumn, API, MCP, dashboard editor and report line (private follow-up). Published reports do not carryignoredyet (slimForPublishis unchanged).squirrel config show --cloud.security/cookie-flagshave not opted intomessageCountsItems; they keep their message and gain the(N ignored)suffix.Skill
The squirrelscan agent skill needs a change (an agent must know a report can be filtered and read
ignoredbefore proposing fixes for a waived finding). A private issue labelledskillsis filed.Rebased onto main 5387823 (head 803670e; was approved at e2667df). Conflicts resolved with behaviour unchanged:
template-fanout.tsnow builds its set from main'sfannableRules(...)and keeps the[[ignore]]per-page disqualification as an extra filter (!runner.ignoresByPage(id)); theignoreTimedOutreport fields sit beside main'spagesTooLargeandtooLargePagesin the cli and audit-engine adapters and the controller;output.mdxis main's text plus themeta.ignoredsentences; CHANGELOG has the entry under Unreleased. Re-run: the PR's 9 test files (rules, config, report, audit-engine, cli e2e, config-validate, report controller) all pass, plustemplate-fanout-gates-841andcookie-flags; tsgo clean in rules, audit-engine, report, core-contracts, config and cli; cli lint and format,make validateand the changelog guard pass.