Skip to content

feat(cli): partial-audit marker on reports and publish payload (repo#1082) - #1949

Merged
nc9 merged 3 commits into
mainfrom
boat/partial-audit-marker-1082
Nov 17, 2026
Merged

nc9 merged 3 commits into
mainfrom
boat/partial-audit-marker-1082

Conversation

@nc9

@nc9 nc9 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds a partial-audit marker for runs narrowed with --rule-include / --rule-exclude (private issue squirrelscan/repo#1082, CLI side only).

  • PartialAudit (include, exclude, includedCategories) on the report contract, set by the audit controller for a filtered run, absent otherwise.
  • Marker in json (meta.partialAudit, schema 1.25; 1.24 is meta.discovered, feat(report): record discovered URLs split by sitemap and links (repo#3079) #2019, which merges first), text, markdown, xml and llm output; the stderr "does not mark itself as such" warning is gone.
  • The marker is saved with the crawl inside its stored scanScope (same pattern as startRedirect / maxDuration, no SQLite migration) and restored by reconstructReport, so squirrel report and squirrel report --publish of a filtered audit carry it.
  • Publish payload carries partialAudit (via slimForPublish).
  • squirrel report --publish decides through the audit's own guard, resolvePublishDecision (reportPublishDecision). The flag is always explicit there, and an explicit --publish of a filtered run publishes on the audit path too, so both paths publish a marked report, with the marker. Auto-publish of a filtered audit is still skipped.
  • computeLockedRules skips rules the filter turned off; the audit footer filters them too.
  • Docs: docs/cli/audit.mdx, docs/configuration/output.mdx; CHANGELOG entry under ## [Unreleased].

Contract: The private API does not read meta.partialAudit yet (squirrelscan/repo#4834), so a marked publish is still scored as a whole-site report in the cloud until it does.

Acceptance (CLI side):

  • Payload marker: partial-audit-1082.test.ts "publish payload carries the marker for a filtered run and none otherwise"; rebuilt report: tests/reports/partial-audit-rebuild-1082.test.ts "a marked crawl rebuilds with partialAudit and publishes it".
  • squirrel report -f json / -f text on a rule-filtered audit carries the marker: tests/cli/partial-audit-report-1082-e2e.test.ts (fails on 159fbdb, passes now).
  • report --publish uses the audit guard: tests/commands/report-publish-guard-1082.test.ts.
  • json/text/markdown/xml/llm: "output formats" describe block.
  • Excluded Pro rule not locked: "locked rules" block (computeLockedRules + footer).
  • Unfiltered run no marker anywhere: the same tests assert absence, including the rebuilt report.
  • NOT in this PR (private repo): API storing the field and dashboard badge/history.

Gates: apps/cli format:check, lint, typecheck clean; typecheck clean in packages/core-contracts, report, audit-engine. bun test (--timeout 30000, explicit paths): partial-audit-1082, reconstruct-1260, include-pages-e2e, unstored-1396-e2e, rule-filter (68 pass); publish-slim, publish-payload-parity, publish-capped-body, robots-honoured-1782, json-pages-1260 (41 pass); the three new tests, resolve-publish-decision, report-publish-non-public-host (66 pass); report-include-passed, audit-content-store-cap-wiring, completion (116 pass); 0 fail. make validate in docs: all checks passed, 62 pass.

Agent skill: no change needed.

@nc9
nc9 force-pushed the boat/partial-audit-marker-1082 branch 4 times, most recently from f465418 to 7597161 Compare November 17, 2026 15:15
nc9 added 3 commits November 18, 2026 03:11
… rules are excluded (repo#1082)

Signed-off-by: Nik Cubrilovic <[email protected]>
…t --publish through the audit guard #1082

squirrel report rebuilt a rule-filtered audit without meta.partialAudit, so
report --publish sent a partial score with no marker. The marker is now saved
in the crawl's scan scope (no migration, like startRedirect) and restored by
reconstruct; report --publish decides through resolvePublishDecision.

Renumbers this PR's schema version to 1.25 (1.24 is meta.discovered, #2019),
fixes the docs claims for the report path and adds the CHANGELOG entry.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the boat/partial-audit-marker-1082 branch from 7597161 to 2602b2d Compare November 17, 2026 16:11
@nc9
nc9 marked this pull request as ready for review November 17, 2026 16:24
@nc9
nc9 merged commit cc5cb03 into main Nov 17, 2026
16 checks passed
@nc9
nc9 deleted the boat/partial-audit-marker-1082 branch November 17, 2026 16:25
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