Skip to content

Cache unchanged AI review verdicts - #36

Merged
pierrick-fonquerne merged 1 commit into
mainfrom
feat/ai-review-verdict-cache
Aug 12, 2026
Merged

Cache unchanged AI review verdicts#36
pierrick-fonquerne merged 1 commit into
mainfrom
feat/ai-review-verdict-cache

Conversation

@pierrick-fonquerne

Copy link
Copy Markdown
Contributor

What changed

  • store a versioned, invisible and 16 KB-bounded verdict cache in the team review comment
  • skip every Mistral call when the diff and reviewer workflow revision are unchanged
  • reuse three-lens verdicts for unchanged findings whose exact identity and lens context still match
  • ignore corrupt or obsolete cache payloads and avoid caching incomplete model runs
  • trust cache markers only when they come from the configured workflow-bot author

Why

Team review reruns currently repeat all specialist, synthesis and lens calls even when the review input is unchanged. This adds latency and API cost, and needlessly recomputes stable per-finding verification.

Impact

Identical reruns return after the GitHub diff/comment lookup. Partial changes can reuse safe per-finding verdicts while changed context is reverified. Existing visible review formatting is unchanged because the cache is stored in an HTML comment.

Validation

  • cargo +1.88.0 fmt --all -- --check
  • cargo +1.88.0 clippy --workspace --all-targets --all-features -- -D warnings
  • cargo +1.88.0 test --workspace --all-features --no-fail-fast
  • cargo +1.88.0 check --workspace --all-features --all-targets

Closes #11

@pierrick-fonquerne

Copy link
Copy Markdown
Contributor Author

Implementation review complete: no blocking findings.

Validation evidence:

  • all repository CI checks pass, including Rust 1.88 MSRV
  • real smoke: first run wrote the trusted hidden cache after agents/synthesis/lenses
  • identical rerun kept comment ID 5269995677, logged Identical diff and reviewer revision, and made no specialist calls
  • corrupt/version/context/identity/size invalidation paths are covered by tests
  • transient agent, synthesis, or insufficient-lens results are never cached

Temporary smoke PR: nubster-opensources/lightshuttle#317 (closed without merge).

@pierrick-fonquerne
pierrick-fonquerne marked this pull request as ready for review August 12, 2026 17:14
@pierrick-fonquerne
pierrick-fonquerne merged commit d99c7fa into main Aug 12, 2026
4 checks passed
@pierrick-fonquerne
pierrick-fonquerne deleted the feat/ai-review-verdict-cache branch August 12, 2026 17:15
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.

team: cache lens verdicts across runs of an unchanged diff

1 participant