Skip to content

fix(report): squirrel report --input reads skippedChecks back #518 - #1394

Closed
nc9 wants to merge 3 commits into
mainfrom
fix/report-input-skipped-518
Closed

nc9 wants to merge 3 commits into
mainfrom
fix/report-input-skipped-518

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #518 (the report side shipped in v0.0.144 with #554 and #1344/#1356; this is the read-back that was left).

squirrel report --input <file> dropped skippedChecks (the type said "Not read back"), so a saved JSON report that was re-rendered or re-exported lost the list and summary.skipped: the pages a rule never finished checking read as a clean audit again, the exact false "fixed" #518 describes.

  • parseSkippedChecks(value) (packages/report/src/skipped.ts): validates the list from the untrusted file. A listed reason only (scan-truncated, rule-timed-out, rule-errored), string rule id and check, string pages (capped at 5,000 a entry, 1,000 entries), whole counts; a bad entry is dropped, a non-list reads as none.
  • restoreSkippedChecks(ruleResults, skipped, metaFor): rebuilds one skip row per entry (the page list as pages, the true total in details.pagesTruncated, details.pages for a timed-out or errored rule, details.errored for rule-errored), which is exactly what collectSkippedChecks reads, so the round trip is lossless. A skipped-only rule gets a meta stub (category from the id prefix). Skips stay out of issues.
  • convertSlimReport in controllers/report.ts calls both.

Tests (apps/cli/tests/reports/report-input-skipped-518.test.ts, 7; 3 fail on main): re-export keeps skippedChecks and summary.skipped identical for per-page, folded (40 pages, 2 listed), timed-out and errored skips; the folded entry keeps its total and clipped list; skips never become issues; no skips stays no key; hostile entries (unlisted reason, non-string pages, negative or huge counts, wrong types) are dropped; a non-list reads as none. Gates: tsgo in apps/cli and packages/report, cli format:check and lint, report skipped/status/timeouts tests (21), make validate, released-changelog guard.

Docs: docs/configuration/output.mdx (read-back paragraph under Skipped checks). CHANGELOG under Unreleased / Fixed. Skill: no change needed (the JSON shape is unchanged).

nik

Review round: a skip entry is kept only for a category/name rule id (__proto__, constructor and similar are dropped, and Object.hasOwn guards the lookup), a forged page count over 10,000,000 falls back to the pages listed, and names, check names and pages have terminal escapes, C1 controls, bidi overrides and newlines removed (stripUnsafeLineText, new in core-contracts, with tests) because they reach the console. The output.mdx sentence now states what is dropped and what falls back. convertSlimReport still builds issues into a plain object by id (pre-existing, not changed here).

nc9 added 2 commits October 31, 2026 10:57
…ted, so a re-render and re-export keep summary.skipped #518

Signed-off-by: Nik Cubrilovic <[email protected]>
…, strips terminal controls #518

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9 nc9 mentioned this pull request Oct 31, 2026
@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.147 as 961b6c2b 8c777601 286628e5 via #1412. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.147. Closing this original.

nik

@nc9 nc9 closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant