Skip to content

feat(report): list scan-truncated skips in the JSON report - #554

Merged
nc9 merged 2 commits into
mainfrom
claude/sharp-curie-3iatw2
Oct 8, 2026
Merged

nc9 merged 2 commits into
mainfrom
claude/sharp-curie-3iatw2

Conversation

@nc9

@nc9 nc9 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #518

A page where content/hidden-text or content/dev-leakage hit a scan limit is recorded as a skipped check, but the JSON renderer drops everything that is not a fail or warn. A consumer reading "no issue" then treats the page as clean. This follows the maintainer's triage on the issue.

  • New top-level skippedChecks list, each entry { ruleId, name, check, reason, pages, pagesCount, pagesHasMore }. Version one lists only scan-truncated skips. reason is on every entry so other reasons can be added later.
  • Folded skips (aggregates carrying pages[]) are expanded, so every page is listed. A clipped fold keeps the true total in pagesCount and sets pagesHasMore.
  • summary.skipped is the sum of pagesCount. passed, warnings, failed and every other key keep their names and values.
  • Skips never appear in issues. skippedChecks is omitted when empty, so a report with no skips has the same top-level keys as before.
  • Saved JSON loads as before: the CLI ignores the new key and rebuilds the same issues.
  • docs/configuration/output.mdx now documents the real shape (meta, status, score, summary, issues, skippedChecks and the optional keys). The invented project, stats, health and pages shape is removed, and the jq examples now use .score.overall. One matching jq path in docs/configuration/examples.mdx is fixed too.

Notes for review:

  • Re-exporting JSON from a loaded saved JSON does not carry skippedChecks forward, because skips are not findings and are not rebuilt into the report. Reports rendered from an audit or the project database do carry it.
  • summary.skipped counts skipped pages (the same unit as the per-page check counts), not list entries.

Verification

  • bun test packages/report/tests/json-skipped.test.ts packages/report/tests/json-status.test.ts: 9 pass
  • bun test apps/cli/tests/reports/output/json.test.ts apps/cli/tests/controllers/report.test.ts packages/report/tests/severity-and-groups.test.ts packages/report/tests/authoritative-counts-1023.test.ts packages/report/tests/editor-summary-malformed.test.ts: 92 pass
  • bun run typecheck in packages/report and apps/cli: clean
  • make validate in docs/: all checks passed

Follow-up for squirrelscan/skills

Cloud runners cannot push to the skills repo, so this issue needs filing there. Proposed text:

Title: Update JSON output notes for the new skippedChecks key and summary.skipped

squirrelscan added a top-level skippedChecks list and summary.skipped to the JSON report (squirrelscan/squirrelscan, issue 518). The agent skill's JSON output notes should be updated:

  • Document skippedChecks: entries of { ruleId, name, check, reason, pages, pagesCount, pagesHasMore }, present only when a check was skipped. Version one reason is scan-truncated (a page hit a rule's scan limit); more reasons may follow, so unknown values should be treated as a skip.
  • Document summary.skipped (skipped page count, not part of passed, warnings or failed).
  • Tell agents that a rule not reporting an issue on a page listed in skippedChecks does not mean the page is clean. Do not close or mark a finding fixed on those pages.
  • Correct any notes that describe issues as including skipped checks. They never do.
  • Point to the JSON schema section in the docs (docs/configuration/output.mdx) as the reference.

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Add a top-level skippedChecks list (rule id, check, reason, pages) and a
summary.skipped count to the JSON report, so a page where
content/hidden-text or content/dev-leakage hit a scan limit is no longer
indistinguishable from a clean one. Folded skips are expanded from pages[].
Skips stay out of issues. Correct docs/configuration/output.mdx to the real
JSON shape.

Refs #518

Signed-off-by: Nik Cubrilovic <[email protected]>
@claude

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Reviewed the diff. The import, skipReason and the ./resolution export all resolve. I didn't run the tests.

  • (low) packages/report/src/skipped.ts: the comment says group.total can only overstate across overlapping checks. When one check carries pagesTruncated and another lists some of the same pages, listed is computed from the set delta, so overlap undercounts rather than overstates. This only affects the comment's accuracy, not the output.
  • (nit) docs/configuration/output.mdx: the example meta.version is hard-coded to 0.0.105. It will go stale.
  • (nit) jq '.score.overall' is compared with -lt in the docs. If overall can be a non-integer or N/A, the shell test breaks. Consider mentioning that.

Test coverage for per-page, folded and clipped skips looks good. The docs rewrite fixes a stale schema.

@claude

claude Bot commented Oct 8, 2026

Copy link
Copy Markdown

Review of #554 (skippedChecks in JSON report)

I read the diff and confirmed that skipReason and SCAN_TRUNCATED_SKIP_REASON exist in core-contracts. I did not run the tests. CI was still pending when I looked.

  • (low) packages/report/src/skipped.ts: the fold-total logic relies on details.pagesTruncated being the true total. If a fold ever stamps it as "extra pages beyond the list" rather than the total, pagesCount is wrong. The truncated > listed guard and the Math.max with pages.length limit the damage. A comment or test naming the producer's contract would help.
  • (nit) The group.total comment says it "can only overstate". Two checks that list overlapping pages would double-count the truncated remainder. That is unlikely, and the comment already says so.
  • (nit) apps/cli/src/controllers/report.ts: skippedChecks?: unknown[] is fine for a read-back type. Importing SkippedCheck would keep it in sync.
  • (nit) The docs fix of the stale .health.score to .score.overall is correct and welcome. jq '.score.overall' can return a non-integer, and [ "$SCORE" -lt 80 ] would then fail. That was already true before this PR.

Test coverage looks good: per-page skips, folded skips, clipped folds, and the check that issues and the existing counts are unchanged.

No blocking issues found.

nc9 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Re the (low) pagesTruncated semantics note: skipped deliberately. Folds stamp pagesTruncated as the true total today, and the clipped-fold test pins that; a different stamping would be a contract change caught there.

@nc9
nc9 merged commit 711c8c1 into main Oct 8, 2026
15 checks passed
@nc9
nc9 deleted the claude/sharp-curie-3iatw2 branch October 8, 2026 03:06
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.

JSON report: expose skipped checks per rule and page

1 participant