Skip to content

feat(report): infoChecks in json and llm; rule-timed-out in skippedChecks #669 #518 - #1344

Closed
nc9 wants to merge 1 commit into
mainfrom
feat/info-checks-time-budget-skips-669-518
Closed

nc9 wants to merge 1 commit into
mainfrom
feat/info-checks-time-budget-skips-669-518

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #669
Fixes #518

Decisions from the maintainer: include info checks (additive, unscored) and add the time-budget skip to skippedChecks; one shared design.

What

  • infoChecks (JSON, always) and <info-checks> (LLM, opt-in with --include-info on audit and report) list checks with status info: ruleId, name, check, message, pages (up to 10, sorted), pagesCount, pagesHasMore, the same shape as skippedChecks (new packages/report/src/info-checks.ts). Never in issues, never in passed/warnings/failed, no effect on the score. Present only when non-empty, so a report without them keeps today's keys. The slim-JSON reader ignores the key like skippedChecks (not read back).
  • skippedChecks gains rule-timed-out (the existing runner skip reason; the PR text asked for "time-budget" but the constant already in core-contracts is rule-timed-out, so that is the value). The runner records a timeout once per audit and counts pages in details.pages, so pagesCount uses it and pages may be shorter or empty. summary.skipped includes them.
  • Docs: output.mdx (info checks section, reason values), reports.mdx (<info-checks>), robots-meta-conflict.mdx (the info check is not a finding). CHANGELOG under Unreleased / Added.

Worth knowing

On a small real audit this produced 130 info checks, most of them "No X found" notes. So the LLM block is opt-in (--include-info, completions and docs updated) and, when on, lists 25 checks with 3 pages each and a <more count>; the JSON always has all of them, capped at 10 pages per check.

Tests

packages/report/tests/info-checks-and-timeouts-669-518.test.ts (listing, never an issue, score unchanged, no key when empty, llm block and caps, timed-out skip with page count and summary.skipped); json-skipped and json-status still pass. packages/report tsgo, apps/cli format, lint, tsgo, controllers/report test, make validate.

Consistency with #1325 (pages in the JSON report): no shared fields, both are additive top-level keys.

Skill (squirrelscan/skills): its JSON output notes should mention infoChecks and the rule-timed-out reason; not filed from here.

Review follow-ups: info check messages are cut at 500 characters; squirrel report --input ... --include-info prints a note and lists nothing (like --include-passed), documented in cli/report.mdx; a rule that threw (#1342's skipped row with details.errored) is reported in skippedChecks as rule-errored, apart from rule-timed-out, and the <rule>-errors and <rule>-timeouts run summaries are kept out of infoChecks. No code change needed to compose with #1342 (it only reads details.errored).

@nc9
nc9 marked this pull request as ready for review October 30, 2026 08:03
@claude

claude Bot commented Oct 30, 2026

Copy link
Copy Markdown

Review of #1344 (info checks + rule-timed-out skips).

  • (medium) packages/report/src/info-checks.ts message and page URLs come from site-derived data and go into the JSON and LLM output unclamped. The LLM path escapes XML, but JSON message has no length clamp and URLs aren't canonicalized (canonicalizeReportUrl in coverage.ts; see AGENTS.md "Strings and URLs"). skipped.ts has the same gap, so this follows precedent. A clamp from core-contracts/src/clamp.ts would be cheap, though. Please confirm message can't carry site text, or clamp it.
  • (low) The LLM block lists info checks in rule-id order. With --include-info, the 25-item cap can hide the few informative ones (e.g. redundant-noindex) behind "No X found" notes from rules that sort earlier. Consider ranking checks that have pages first.
  • (low) The new skipped.ts group.total Math.max expression is equivalent to the old logic for scan-truncated, but harder to read. A short comment or a small helper would help. Tests only cover the timed-out case, so add a regression test for scan-truncated with pagesTruncated across repeated checks.
  • (nit) pagesHasMore and pagesCount are 0 for site-level info checks with no pages. That is fine, but the docs could say so.
  • (nit) The LLM test only checks <more count> and doesn't assert that the 3-page cap shows ....

Completions, docs and CHANGELOG look consistent. I didn't run the tests or CI checks.

@nc9
nc9 force-pushed the feat/info-checks-time-budget-skips-669-518 branch from e24fec5 to 3555a6f Compare October 30, 2026 10:54
@claude

claude Bot commented Oct 30, 2026

Copy link
Copy Markdown

Reviewed the diff only. I did not run the tests or checks.

  • (medium) packages/report/src/skipped.ts: this PR also adds a rule-errored skip reason (runner: a rule that throws on every page reports one fail per page and lowers the score; report it once as not evaluated #1291). It is a new public reason value in skippedChecks. It is not in the PR description or the output.mdx reason list as far as I could see, and the change is separate from report: info-level checks never appear in the JSON or LLM output #669/JSON report: expose skipped checks per rule and page #518. Please either document it and add a CHANGELOG bullet and a test, or split it out. If it is already documented, say where.
  • (medium) packages/report/src/skipped.ts: the group.total = Math.max(group.total + listed, truncated ? group.total + truncated : 0, timedOutPages) rewrite changes the scan-truncated arithmetic. Before, each check added truncated or listed, whichever was larger. The new expression still adds truncated when it exceeds listed, but only when group.total is compared against 0 in the other branch. It also takes a max against timedOutPages. That mixes a running sum with a max across entries. Two timed-out entries for the same check (different details.pages) would not sum. Please add a test for multiple entries in one group and for a scan-truncated regression.
  • (low) packages/report/src/info-checks.ts: page URLs come from the website and go straight into JSON and the LLM block. The LLM block escapes them as XML. The AGENTS.md guidance is to canonicalize with new URL(v).href (see canonicalizeReportUrl in coverage.ts) before printing, so control and bidi characters are encoded. collectSkippedChecks may do the same. Please check this against it. The message is clipped to 500 characters, but its length and bytes are not otherwise clamped.
  • (low) packages/report/src/skipped.ts: the /** Skip reasons listed in the report... */ doc comment now sits above RULE_ERRORED_REASON instead of LISTED_SKIP_REASONS. The header comment is also overlong and runs the "two reasons" and "three reasons" wording together.
  • (low) apps/cli/src/cli/commands/audit.ts: --include-info is silently ignored for formats other than llm. --input in report gets a warning, but --include-info with -f console or -f json does not. Consider a note, or say so in the flag description. It already says "in the llm format".
  • (nit) info-checks.ts and llm.ts: several lines are well over 100 characters, such as the <check ...> template string and the collectInfoChecks signature. packages/report is not format-checked in CI, but changed files should match the formatter.
  • (nit) Test coverage: there is no test for the <rule>-errors and <rule>-timeouts exclusion in collectInfoChecks, for XML escaping of messages and pages in <info-checks>, or for the pagesTruncated path. completion.test.ts should be run, since three shells changed.

Otherwise the design is sound. The block is opt-in in the LLM output, additive and unscored in the JSON, and capped in size. The docs and completions are updated.

@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.144 as 57c9d854 18199477 57622e74 via #1356. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.144. Closing this original.

nik

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.

report: info-level checks never appear in the JSON or LLM output JSON report: expose skipped checks per rule and page

1 participant