perf: cache report entries during scans#378
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 27, 2026, 4:52 PM ET / 20:52 UTC. Summary Reproducibility: not applicable. this is a performance refactor rather than a bug report with a failing reproduction. Source review and PR proof focus on preserving apply/dashboard output while reducing repeated reads. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused cache refactor after ordinary maintainer review, keeping apply/dashboard semantics and the flat report layout unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a performance refactor rather than a bug report with a failing reproduction. Source review and PR proof focus on preserving apply/dashboard output while reducing repeated reads. Is this the best way to solve the issue? Yes: a private report-entry helper keeps the cache local to existing scans without adding API or configuration surface. Current main does not already provide this optimization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae63b16d6c74. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
ClawSweeper's apply/report scans reread the same report markdown while filtering, sorting, and rendering dashboard state. On larger queues that repeats local disk I/O and repeats frontmatter extraction for data that belongs to the same report snapshot.
Why This Change Was Made
This adds a small private
ReportEntryreader that loads each markdown report once with its filename, number, path, repository, and markdown body. The apply queue now reuses that entry for active-repo filtering, item-number filtering, sort fields, and the initial apply-loop markdown. Dashboard stats now iterate the same parsed entries for open and archived reports, so final file counts no longer reread every markdown file.The apply loop still rereads pair-counterpart reports from disk when checking same-author pair closeability, because those checks can depend on report mutations earlier in the same apply run.
User Impact
Apply and dashboard runs do less repeated filesystem work as report queues grow, without changing close gates, review decisions, dashboard rows, or public output.
Evidence
Head proofed:
9dc7fed32df0413c46d0467f9b04ad279238d1fe.report entry cache,reportEntriesForDir, or dashboard cache work.pnpm install --frozen-lockfilecompleted and installed the pinned dev toolchain.corepack enableprinted a Windows Program Files permission warning first, butpnpmitself completed successfully.pnpm exec oxfmt --write src/clawsweeper.tspassed.pnpm run buildpassed.pnpm run build:allpassed.pnpm run lintpassed.pnpm run check:active-surfacepassed.pnpm run check:limitspassed.pnpm run format:checkpassed.node --test test/clawsweeper.test.tspassed: 58 tests, 58 pass.codex review -c service_tier='fast' --uncommittedreported no actionable correctness issues.dist/clawsweeper.jsand a realistic temp report tree with two open reports. The run exercises the cached report-entry apply scan, applies active-repo filtering and queue processing, exits 0, and the failing mockghshim was never invoked:dist/,config/, andREADME.mdso the working tree README was not touched. It used two verified open reports and one archived closed report; the mockghfallback proves the generated dashboard came from local cached report entries:Local full
pnpm run test:uniton this main-based Windows checkout is still blocked by the pre-existing Windows portability failures being handled in #376: Codex proof tests hit local config/service-tier handling, one command test observes CRLF output, and the POSIX mode test is not portable on Windows main. This branch does not depend on PR #376 and has no source-file overlap with it; GitHub CI should provide the full Linuxpnpm checkproof for this PR.