Skip to content

Unify base fork-point resolution in auto-fix and review watch - #9682

Merged
orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-25021-60afd1d3
Nov 15, 2026
Merged

orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-25021-60afd1d3

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

Task

ORB-25021 — Unify base fork-point resolution in auto-fix and review watch

Description

Outcome. One helper resolves a pull request's base: input base → base_sync_mode_from_input → resolve_worktree_start_point → commit_sha (tip) → optional git merge-base <head> <tip> → branch name with origin/ stripped. All four copies call it; each keeps its own error policy.

Evidence (pinned agent-main 046958492249).

  • crates/orbit-engine/src/executor/automation/vcs/landing/review_watch.rs:276-300 fork_point → (fork, branch, tip); errors "base '…' could not be resolved: …" and "the fork point of … could not be read: …".
  • crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:91-110 evaluate_red_base: the same steps with byte-identical error strings; strips origin/ at :109.
  • crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:137-170 recover_ci_rerun: the same steps with ?; strips origin/ at :170 and :198.
  • crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:392-408 base_tip_checks: the steps without merge-base; strips at :408.

Behavioural differences and resolution.

Aspect review_watch fork_point evaluate_red_base recover_ci_rerun base_tip_checks Resolution
Base source status.base_branch first, then input base input only input only input only Kept: the helper takes the base name as a parameter; each caller chooses it as today
Missing base error string error "the input names no base" Ok(NotEligible) Ok(None) Kept at call sites (resolved before calling the helper)
Resolution/tip/merge-base failure Err(String) with the two messages same strings propagated OrbitError via ? Ok(None); no merge-base Kept: helper returns Result<_, String> (the shared messages) with a flag or a separate tip-only function for base_tip_checks; recover_ci_rerun maps to OrbitError::Execution — stop and report if any existing test pins its current error text
Fork SHA trimmed trimmed at use trimmed at use n/a Unified: helper returns it trimmed

Scope and non-goals. Only the base/tip/fork resolution. required_failures, the CI rerun planner and unmoved_red_base stay as they are. The CiRerunStep → CiRerunRecovery double mapping in recover_ci_rerun (checks.rs:173-186 and :204-219) may be folded in the same edit since it is in the same function, as a mechanical change.

Estimated net: about −25 lines.

Conventions

  • Behaviour-preserving. CLI, MCP, HTTP API, plugin protocol, goldens and
    persisted serde shapes stay identical unless this task names the change.
  • Delete dead code together with its tests, docs and config entries. Leave no
    allow(dead_code) behind.
  • Unify duplicates into the lowest crate that owns the concept per
    ARCHITECTURE.md. A new crate edge updates ARCHITECTURE.md and
    scripts/check-dependency-direction.sh in the same change.
  • A behavioural difference between copies that this task does not list is a
    stop-and-report, not a judgement call.
  • No layout-only moves; code-org-sweep owns those. Narrow visibility in
    code you touch.

Acceptance Criteria

  • The four copies (landing/review_watch.rs fork_point, pr/auto_fix/checks.rs evaluate_red_base, recover_ci_rerun, base_tip_checks) resolve the base through one shared helper; the two shared error strings exist once.
  • Every listed behavioural difference is handled exactly as the description's table specifies; no other behaviour changes.
  • The focused tests for each affected surface pass (the listed engine/runtime test targets), Clippy is clean on the touched crates, and make goldens passes with goldens unchanged (the required PR checks gate the full suite; AGENTS.md Gates).
  • A word-boundary grep for each deleted identifier finds nothing in crates/, plugin/ or scripts/.
  • The execution summary reports the net line delta and lists every non-mechanical edit with its reason.

Execution Summary

Click to expand

Outcome: success
Changes: Consolidated the four base-resolution paths in git::resolve_pr_base, keeping the existing caller-specific base selection, missing-base handling, read order, tip-only behavior and error handling. Each shared error string now occurs once. Fork SHAs are trimmed by the helper. Non-mechanical edit: recover_ci_rerun now maps resolution errors to OrbitError::Execution with the shared message, as specified; InvalidInput and ExecutionTimeout variants can consequently collapse to Execution. Its two downstream consumers do not match those variants. No tests pin the former error text. No identifiers were deleted, so the deleted-identifier word-boundary grep is vacuous; the shared error strings were checked repository-wide and each occurs once. Net diff: 41 insertions, 44 deletions, -3 lines.
Validation passed: scripts/build-budget.py -- cargo test -p orbit-engine -p orbit-cli --test engine pr_landing::review_watch (1); same command with pr_landing::auto_fix (34), and pr_landing::ci_rerun (39); make goldens (goldens unchanged); make ci-guards; cargo fmt --all -- --check; scripts/build-budget.py -- cargo clippy -p orbit-engine --lib --bins -- -D warnings -A clippy::disallowed_methods; scripts/build-budget.py -- cargo clippy -p orbit-engine --all-targets -- -D warnings -A clippy::disallowed_methods; RUSTDOCFLAGS="-D warnings" scripts/with-test-build-lint.sh scripts/build-budget.py -- cargo doc --no-deps -p orbit-engine; git diff --check. Manual QA not run: the refactor is covered by existing integration scenarios and does not change a user interface. No additional runtime target was identified in the pilot's focused validation approach.
Reconciliation: baseline HEAD 8c83993 and clean status; only git/mod.rs, landing/review_watch.rs and pr/auto_fix/checks.rs are changed, all inside existing selectors. Scratch logs remain under .orbit/tmp; no other run-owned leftovers. No generated golden changes. Assessment: no known outstanding risks beyond the explicitly specified error-variant change.

Validation

  • Not reported

Branch Freshness

  • Base ref: refs/remotes/origin/agent-main
  • Head ref: orbit/ORB-25021-60afd1d3
  • Behind base: 0
  • Ahead of base: 1

@orbit-agent-01 orbit-agent-01 added the orbit orbit related label Nov 15, 2026
@orbit-agent-01
orbit-agent-01 merged commit 1120c1a into agent-main Nov 15, 2026
19 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-25021-60afd1d3 branch November 15, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orbit orbit related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant