Skip to content

Hold auto-fix when workflow prerequisite evidence is not a failed attempt - #9178

Merged
orbit-agent-01 merged 2 commits into
agent-mainfrom
orbit/ORB-24232-5b37b61a
Nov 12, 2026
Merged

orbit-agent-01 merged 2 commits into
agent-mainfrom
orbit/ORB-24232-5b37b61a

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

Task

ORB-24232 — Hold auto-fix when workflow prerequisite evidence is not a failed attempt

Description

pr_complete records a designed auto-fix stop as a failed run when workflow prerequisite evidence is not a failed attempt. The pull request stays open and the task stays in review, but the pipeline counts the run as a failure.

Evidence

Field Value
Signature pr_complete auto_fix_stopped: workflow prerequisite evidence is unavailable (running, superseded or non-failed attempt)
Job task_pr_pipeline
7-day occurrences 2
30-day occurrences 2 (both inside the 7-day window)
Distinct runs 2
Share of the job's folded 7-day failures 2/74 (0.027)
Host dk-server-2
First seen 2026-11-08T11:54:57Z
Last seen 2026-11-08T12:09:20Z
New since prior cursor 0
Run ids jrun-20261108-1142-c3, jrun-20261108-1138-c5

Excerpt (redacted): auto_fix_stopped: pull request #8661 cannot be repaired automatically (execution failed: workflow prerequisite evidence is unavailable (running, superseded or non-failed attempt)); no repair agent runs, the pull request stays open and the task stays in review

Mechanism

At HEAD f234743, evidence in crates/orbit-engine/src/executor/automation/vcs/operations/prerequisite.rs returns unreadable("running, superseded or non-failed attempt"). recover in crates/orbit-engine/src/executor/automation/vcs/pr/infrastructure.rs maps that read with stopped_by, which wraps stopped:

let response = host.run_private_vcs_operation(operations::CI_PREREQUISITE_EVIDENCE, ...)
    .map_err(|error| stopped_by(pr, &error.to_string(), &error))?;

stopped builds OrbitError::Execution (auto_fix_stopped: ...). The same function already sends deadline and head-changed stops through hold_auto_fix_stop. This evidence-unavailable path does not.

Category

Misclassified hold. The stop is deliberate (no repair agent, PR stays open, task stays in review) and is stored as a run failure.

Change

Route this evidence-unavailable stop through hold_auto_fix_stop with a typed delivery refusal, the same way the neighboring stops in recover are held.

Expected effect

Removes this signature from task_pr_pipeline's folded failure rate. It was 2 of 74 folded failures in the last 7 days (about 0.12 percentage points of that job's 4.6% rate).

Acceptance Criteria

  • A deterministic test drives recover (crates/orbit-engine/src/executor/automation/vcs/pr/infrastructure.rs) through the CI prerequisite evidence read when that read returns workflow prerequisite evidence unavailable because the attempt is running, superseded, or not failed.
  • Before the fix, that path returns an Execution auto_fix_stopped error and the run is failed. After the fix, the same path returns a delivery hold (hold_auto_fix_stop or an equivalent typed hold) and is not a failed run.
  • The test passes on this host in one leaf, with no dependency on another machine or a post-deploy measurement.

Execution Summary

Click to expand

Base 85b767d, worktree clean at start (no pre-existing edits). Baseline git status --short: empty.

Root cause: in recover (crates/orbit-engine/src/executor/automation/vcs/pr/infrastructure.rs), the ci.prerequisite_evidence read mapped its error with stopped_by, which builds OrbitError::Execution. Deliberate holds in the same function use hold_auto_fix_stop, so this stop was recorded as a run failure while the PR stayed open and the task stayed in review.

Change:

  • infrastructure.rs: new unreadable_prerequisite_evidence_stop helper. A WorkflowEvidenceUnavailable read error is held with DeliveryRefusal::CheckEvidenceInconclusive (existing refusal, documented as "an auto-fix stop whose check evidence could not be read conclusively"); every other read error keeps its previous class via stopped_by. The evidence read call now uses the helper.
  • Scope choice: the hold applies to the whole WorkflowEvidenceUnavailable class from this read, not only the "running, superseded or non-failed attempt" text. Other unreadable reasons from the same read (for example "superseded workflow run", "truncated jobs") are now also held instead of failed. Their messages are unchanged. Disclosed as a deliberate, conservative-to-review broadening; narrowing would need matching on message text.
  • tests/engine/pr_landing/infrastructure.rs: new missing_required_prerequisite_holds_unreadable_evidence drives pr_complete (auto_fix) through the real provider adapter and fake gh for cases "running" and "superseded". It asserts DeliveryRefused { CheckEvidenceInconclusive }, the auto_fix_stopped message, no merge, task in review, no auto-fix attempt, and no rerun.

Acceptance criteria:

  1. Met. The test drives recover through the ci.prerequisite_evidence read, which returns the unavailable evidence for the running and superseded cases.
  2. Met. Before the fix the test failed: execution failed: auto_fix_stopped: pull request #42 cannot be repaired automatically (execution failed: workflow prerequisite evidence is unavailable (running, superseded or non-failed attempt)) (log: .orbit/tmp/test-before.log). After the fix it passes and returns DeliveryRefused/CheckEvidenceInconclusive (.orbit/tmp/test-after.log).
  3. Met. Single host, deterministic, no machine dependency, no post-deploy measurement. Test time about 0.2s in isolation.

Validation (run on this host, owner worktree):

  • passed: scripts/build-budget.py -- cargo test -p orbit-engine --test engine missing_required_prerequisite_holds_unreadable_evidence (fail before, pass after)
  • passed: cargo test -p orbit-engine --test engine -- pr_landing auto_fix handoff_landing (200 passed)
  • passed: cargo test -p orbit-engine (90 lib + 4 + 414 engine, 0 failed, 3 ignored in lib)
  • passed: rustfmt --edition 2024 --check on both changed .rs files; cargo fmt --all -- --check
  • passed: scripts/build-budget.py -- cargo clippy -p orbit-engine --lib --bins -- -D warnings -D clippy::disallowed_methods
  • passed: scripts/build-budget.py -- cargo clippy -p orbit-engine --all-targets -- -D warnings -A clippy::disallowed_methods
  • passed: RUSTDOCFLAGS="-D warnings" scripts/build-budget.py -- cargo doc --no-deps -p orbit-engine
  • passed: make ci-guards
  • passed: git diff --check
  • not run: make goldens (no CLI help, MCP text or golden surface changed), screenshots (no UI change), CodeQL (not security-tagged), task.final_validation_commands (pipeline runs them after commit).

Reconciliation: git status --short shows exactly two modified files, both deliverable: crates/orbit-engine/src/executor/automation/vcs/pr/infrastructure.rs and crates/orbit-engine/tests/engine/pr_landing/infrastructure.rs. The only new files are logs under .orbit/tmp/ (gitignored, scratch). No context_files widening was needed: both paths are already selectors (symbol recover, and the infrastructure test file).

Risks: the broadened hold changes the outcome for other evidence-unavailable reasons from the same read; they now hold for the next pass instead of recording a failed run. Confirm this is the intended class for the pipeline's failure-rate metric.

Validation

  • Not reported

Branch Freshness

  • Base ref: origin/agent-main
  • Head ref: orbit/ORB-24232-5b37b61a
  • Behind base: 0
  • Ahead of base: 1

…d … [ORB-24232]

Hold auto-fix when workflow prerequisite evidence is not a failed attempt
@orbit-agent-01 orbit-agent-01 added the orbit orbit related label Nov 12, 2026
…fest checks passed: attempt_id matches, HEAD equals candidate.commit, base is an ancestor of HEAD, and required_validation_commands is present (empty). The production fix routes the CI prerequisite evidence read's WorkflowEvidenceUnavailable error through hold_auto_fix_stop as DeliveryRefusal::CheckEvidenceInconclusive; carry_class keeps the Execution class for that cause, so the hold converts it, and the read happens before any reservation or mutation. The hold covers every WorkflowEvidenceUnavailable reason from that read, not only the running, superseded or non-failed text. This matches the typed contract (the error's reason is diagnostic only and callers branch on the type), so it is not a finding; the failure-rate metric will also stop counting permanent unreadable reasons from the same read, which the owner should know. One finding: the regression test drove only the running and superseded cases that AC1 names, and omitted the not-failed case. I added that case (run conclusion cancelled) to the same test and updated its doc comment; it passes through the same hold. The pre-fix failure is evidenced by the implementer's retained .orbit/tmp/test-before.log, which shows the running case failing with the Execution auto_fix_stopped message; I did not rerun a pre-fix reproduction. Docs checked: the delivery_check_evidence_inconclusive row in CONFIG.md and the stuck-job-runs runbook do not claim this stop fails the run, so no doc change was needed. On the final tree, all required checks passed: make ci-guards, cargo fmt check, rustfmt check on both changed .rs files, the focused regression test, clippy for lib and bins and for all targets, cargo doc, and the pr_landing infrastructure (12) and auto_fix (34) modules. Not run: make ci-lint and make ci-test-affected (baseline, excluded because the workspace guide forbids them as blanket gates); make goldens, screenshots and CodeQL do not apply. [ORB-24232]

Findings: F1
Paths: crates/orbit-engine/tests/engine/pr_landing/infrastructure.rs
Orbit-Review-Attempt: rvw-96e670e28e76-1
Orbit-Review-Crew: haiku@‍xhigh
@orbit-agent-01
orbit-agent-01 merged commit 5a54d9f into agent-main Nov 12, 2026
20 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-24232-5b37b61a branch November 12, 2026 11:20
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