Skip to content

perf: report review context budget ledger#69

Open
stainlu wants to merge 1 commit into
openclaw:mainfrom
stainlu:stainlu/perf-review-context-ledger
Open

perf: report review context budget ledger#69
stainlu wants to merge 1 commit into
openclaw:mainfrom
stainlu:stainlu/perf-review-context-ledger

Conversation

@stainlu
Copy link
Copy Markdown
Contributor

@stainlu stainlu commented May 12, 2026

Summary

  • Add a deterministic review-context budget ledger to generated ClawSweeper reports.
  • Record per-section prompt JSON chars plus retained/hydrated/total counts and truncation state.
  • Keep the ledger report-only so review prompts and model behavior do not change.
  • Include dashboard/ in CI sparse checkout so existing dashboard worker tests can run on PRs.
  • Add unit coverage for ledger ordering, section accounting, and rendered budget text.

Why

ClawSweeper is now doing real context compaction, but maintainers still need durable per-run numbers to see which prompt sections dominate cost. This turns review reports into a cheap measurement surface before we make more aggressive token/time optimizations.

The CI sparse checkout already included test/, but omitted tracked dashboard/, so test/dashboard-worker.test.ts failed to import dashboard/worker.js on GitHub. This branch includes the minimal workflow fix needed for CI parity.

Validation

  • pnpm run build
  • pnpm run format:check
  • pnpm run test:unit
  • git diff --check

Note

Local runs are on Node 22 and show the repo engine warning (>=24). I kept validation to the changed source/unit surface locally and expect GitHub CI to run the full Node 24 pnpm check lane.

@stainlu stainlu force-pushed the stainlu/perf-review-context-ledger branch from bdac129 to 0761ce0 Compare May 12, 2026 15:44
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