Skip to content

feat(report): add cacheStats to audit JSON when pages were reused (repo#1981) - #1938

Merged
nc9 merged 2 commits into
mainfrom
boat/json-cache-stats-1981
Nov 15, 2026
Merged

nc9 merged 2 commits into
mainfrom
boat/json-cache-stats-1981

Conversation

@nc9

@nc9 nc9 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Closes squirrelscan/repo#1981.

squirrel audit -f json now includes cacheStats (already computed by buildCacheStats) when the audit reused any page or sub-resource, by any reason including the stale-while-revalidate free skip. It is absent (not zeroed) on a cold audit. JSON schema version bumps to 1.21 (new optional field); docs and CHANGELOG updated.

Acceptance:

  • included on reuse: json-cache-stats-1981.test.ts 'warm audit carries cacheStats'
  • absent when nothing reused: same file, cold + zero-hit tests
  • SWR reason visible: warm test uses hitsByReason {stale-while-revalidate: 10}
  • warm JSON differs from cold: asserted in the warm/cold test

Gates: report typecheck pass; bun test json-cache-stats-1981 + json-pages-1260 (10 pass), cli reconstruct-page-rule-counts-1260 (9 pass), cli lint/format run; docs make validate run.

Not done (follow-up): the audit console summary line has no reuse line; private repo gitlink bump.
Agent skill: no change needed.

@nc9
nc9 force-pushed the boat/json-cache-stats-1981 branch from 4adae0d to e5ec8ef Compare November 15, 2026 12:33
@nc9
nc9 marked this pull request as ready for review November 15, 2026 12:50
@nc9
nc9 merged commit 129fb98 into main Nov 15, 2026
16 checks passed
@nc9
nc9 deleted the boat/json-cache-stats-1981 branch November 15, 2026 12:51
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