perf: parallelise rivet head oracle and base validate runs#45
Open
perf: parallelise rivet head oracle and base validate runs#45
Conversation
## Why Wave-1 Performance engineer flagged this as Bug #20 in `docs/agent-fleet/bugs.md`. The rivet oracle path in `reviewPullRequest` ran two independent `withTempRepoCheckout` calls serially: 1. head oracle (validate + impact at PR head) 2. base validate (for `subtractFindings` delta filter) Each tarball is ~50 MB on the rivet repo, extract takes seconds, `rivet validate` is another 1-3 s. Sequential wall-time was conservatively 15-40 s, fully blocking the webhook handler. The two operations have zero data dependency: separate tarballs, separate tempdirs, separate rivet invocations. Trivially parallelisable. ## What `Promise.all` over the two `withTempRepoCheckout` calls. Each side keeps its own error handler — base-ref failures (e.g. force-push lost the base commit, or schema drift between base and head) gracefully degrade to head-only oracle findings, same behaviour as before. ## Source Bug #20, wave-1 Performance engineer (`docs/agent-fleet/bugs.md`). ## Test plan - [x] 834 tests pass — existing oracle tests cover both head and base paths via the injected `runner` mock; concurrency doesn't change the assertions - [x] eslint clean - [ ] After deploy: wall-time of an AI review on a rivet repo drops by ~50% of the rivet-oracle component. Visible in the bot's "Rivet oracle complete" log line timing. ## Risk & rollout - Risk: low. Same calls, same args, same downstream consumers, just scheduled concurrently. Each side's failure is still locally caught. - Rollout: self-update on merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Bug #20 from
docs/agent-fleet/bugs.md(wave-1 Performance engineer).The two
withTempRepoCheckoutcalls (head oracle + base validate forsubtractFindings) are independent — different tarballs, different tempdirs, different rivet invocations. Promise.all'd them. Each side keeps its own error handler so base-ref failures still degrade to head-only.🤖 Generated with Claude Code