mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
Structural cleanup of the durable pull request creation feature, from a three-agent review (reuse, quality, efficiency) of the branch: - Move the supervisor out of handler/ into server/pull_request_supervisor.rs, collapse its double bookkeeping into one task-id map, and fold the five copy-pasted failure arms into attempt_pull_request_creation. - Tag pull_request.failed events with the creation id they resolve, so a publish-stage failure can never fail an unrelated explicit creation. The reducer gains PullRequestCreation::succeed/fail transition methods. - Scan pending creations through a narrow projection-cache accessor instead of materializing every run summary, raise the scan interval to 30s (notify covers the live path), and cap retries for runs whose worker cannot even record a failure. - Answer "creation already pending" POSTs before taking the per-run create lock, which a worker can hold for the whole creation. - Replace the hand-rolled per-run lock map with fabro_store::KeyedMutex. - Reuse cheap Arc'd projections (cached_run_projection) on the poll endpoint and in the worker instead of deep-cloning run summaries and diffs. - Merge ExistingPullRequest into fabro_github::CreatedPullRequest and extract one reconcile_existing_pull_request helper for both call sites. - Give the client poll loop a 15-minute deadline; document that Retry-After and the poll interval are the same constant. - Resolve a wedged pending creation (run already has a pull request) as a durable failure instead of skipping it forever. - Tests: shared wait_for_pull_request_creation helper, a pinned generation- failure assertion, and a new pipeline test proving reconciliation adopts an existing PR without an LLM call or create request. Verified: cargo build --workspace, cargo nextest run --workspace (7,767 passed), nightly clippy -D warnings, fmt --check, insta (no pending), bun typecheck in fabro-api-client. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||