Repository navigation
Description
Summary
We consume squirrel audit -f json in a pipeline that tracks which pages and rules a run actually covered, so a finding that disappears can be marked fixed only when the page was really checked. The JSON report has no list of crawled pages with their HTTP outcome and no list of the rules that ran, so we reconstruct both ourselves:
- Page statuses: we stream-parse the entity map and infer rate-limited or errored pages from
links/broken-linksitems (meta.statusCode). Pages without entities are invisible, and a run with rate-limited pages cannot attribute them to URLs, so we have to treat the whole run as unattributed. - Executed rules: we re-read our own
squirrel.toml, apply[rules].disablepatterns to the bundled catalog and subtractnotChecked, which drifts whenever a rule is skipped for a reason we do not model (time budget, local host, missing input).
Request
Add two top-level fields to the JSON report (and report -f json):
pages: one entry per URL the crawl requested, withurl,finalUrl,status(HTTP code or null), and an outcome such asok,http-error,rate-limited,error(with reason),skipped(excluded, robots, out of scope).executedRules: the rule ids that actually ran on this audit, soissues+passedRules+notChecked+skippedCheckscan be checked against it.
Why
Both are known inside the CLI at report time. With them we could delete our entity-map parser and the coverage inference (about 250 lines) and stop guessing which absent findings are real fixes.
Tested with v0.0.139 (audit <url> --http -m 30 -f json): top-level keys are meta, status, score, summary, issues, skippedChecks, notChecked, technologies, structure, entities.
Related: #701 (page map export) and #518 (skipped checks per rule and page) cover neighbouring parts; this asks only for page outcomes and the executed rule list.
Triage
The JSON report (packages/report/src/output/json.ts) has skippedChecks, notChecked, technologies, structure and entities, so the reporter's key list is accurate. passedRules also exists (json.ts, {ruleId, name, category, scope, pages}) but is emitted only with --include-passed, which the reporter did not use. structure (ReportStructure in packages/core-contracts/src/index.ts) holds aggregates only (pages is a count, plus link sections and page-type counts), so there is no per-URL list; the claim that pages are not listed is accurate. There is no pages array and no executedRules field today. Overlap: #701 (page map export, per-page metadata) and #518 (skipped checks per rule and page) are adjacent; #669 (info checks missing from JSON) is unrelated to coverage. The two asks are distinct and cheap because both are known at report time: a per-URL crawl outcome list (url, finalUrl, status, outcome with reason) and the ids of rules that ran. Recommend building both as additive, optional top-level fields, with pages capped and flagged when truncated (reports can be large and publish payloads are size-capped), and defining executedRules as rules that produced at least one non-skipped check so it composes with issues + passedRules + notChecked + skippedChecks. Do not fold this into #701's table export; share the page-outcome type with it.
Acceptance Criteria
Restated on 2026-10-30 to the maintainer decision of 2026-10-29 (opt-in --include-pages):
-
squirrel audit -f json --include-pagesandsquirrel report -f json --include-pagesadd a top-levelpagesarray withurl,finalUrl,status,outcome(ok,http-error,rate-limited,error) andruleCountfor every page with a stored response. Off by default: nopageskey without the flag. - A stored 429 response is listed with outcome
rate-limited; a URL whose fetch never stored a response is not a page (rate-limited hosts are counted inrateLimited). - A redirected URL keeps the URL asked for in
urland names where it was served from infinalUrl. - The list is capped at 2,000 entries with
pagesTotalandpagesTruncated; the fields are optional additions (meta.schemaVersion1.2 when this shipped). - Docs for the schema are updated and
make validatepasses indocs/. - Tests cover a 404 page, a redirected page, a 429 row and the cap.
Split out to #1396 (closed): executedRules, and a reason plus skipped outcome for URLs that never answered (connection error, excluded, robots).
Activity
nc9 commentedon Oct 29, 2026
Thanks @deniskern, this is a clear request and the data is already known at report time. We will add a per-URL
pagesoutcome list and anexecutedRuleslist to the JSON report, kept optional and size-bounded, and queue it.nc9 commentedon Oct 30, 2026
Decision (Nik, 2026-10-29): opt-in. The per-page list is off by default so existing consumers and report size do not change. With the flag, pages[] carries url, status and ruleCount, capped with a
truncatedmarker beyond a documented limit, and the report schema gets a minor version bump. Queued with the CLI audit-controls group (#1271, #1258).fix(cli,crawler): per-page rule counts only computed for --include-pa…
feat(cli): --include-pages adds crawled pages with status and rule co…
fix(cli,crawler): per-page rule counts only computed for --include-pa…
fix(cli,crawler): per-page rule counts only computed for --include-pa…
feat(cli): --include-pages adds crawled pages with status and rule co…
fix(cli,crawler): per-page rule counts only computed for --include-pa…
feat(cli): --include-pages adds crawled pages with status and rule co…
fix(cli,crawler): per-page rule counts only computed for --include-pa…
nc9 commentedon Oct 30, 2026
Checked against main (23a34c1, v0.0.144). The 2026-10-29 maintainer decision made the list opt-in as
--include-pageswithurl,statusandruleCountper row, with truncation bounded and marked. Open against the written criteria: nofinalUrloroutcome, noreasonon skipped or errored entries, norate-limitedoutcome, noexecutedRules, and no tests for errored, rate-limited or excluded pages. Restate the criteria to the decided scope or split the rest.nik
nc9 commentedon Oct 31, 2026
Restated acceptance criteria, matching the maintainer decision of 2026-10-29 (opt-in
--include-pages) and what shipped plus pub PR for this round:squirrel audit -f json --include-pagesandsquirrel report -f json --include-pagesadd a top-levelpagesarray withurl,finalUrl,status,outcome(ok,http-error,rate-limited,error) andruleCountfor every page with a stored response. Off by default: nopageskey without the flag.rate-limited; a URL whose fetch never stored a response is not a page (rate-limited hosts are counted inrateLimited).urland names where it was served from infinalUrl.pagesTotalandpagesTruncated; the fields are optional additions (meta.schemaVersion1.2).make validatepasses indocs/.Split out to #1396:
executedRules, and areasonplusskippedoutcome for URLs that never answered (connection error, excluded, robots).nik
docs(report): pages outcome mapping, rare rate-limited, schemaVersion…
docs(report): pages row wording #1260
feat(report): --include-pages rows carry finalUrl and outcome; schema…
docs(report): pages outcome mapping, rare rate-limited, schemaVersion…
docs(report): pages row wording #1260
nc9 commentedon Oct 31, 2026
Re-checked against main after v0.0.147. The six restated criteria in the last maintainer comment are all met (opt-in
--include-pages,finalUrlandoutcomeon each row, 429 asrate-limited, redirect keepsurlandfinalUrl, the 2,000-entry cap withpagesTotalandpagesTruncated, docs and tests). The checklist in the issue body still lists the original criteria, three of which (executedRules,reasonand theskippedoutcome) were split out to #1396. Leaving this open until the body checklist is edited to the restated list, then it can close.nik
nc9 commentedon Nov 2, 2026
Edited the body checklist to the restated list from the 2026-10-30 comment, all six ticked, with the split to #1396 noted. Verified on main (
e86767ff):packages/report/tests/json-pages-1260.test.tspasses 8/8 (nopageskey by default, url/finalUrl/status/outcome/ruleCount rows including a 404, 429 as rate-limited, the cap at the limit and one over with the real total, an empty crawl), anddocs/cli/audit.mdxdocuments--include-pagesunder "Pages list".executedRulesand the unstored-pagereasonshipped under #1396 (closed).meta.schemaVersionis 1.5 on main now (the test pins it), a superset of the 1.2 the criterion named. Closing.nik