Skip to content

A held CI-red reservation skips the whole Fix run Pass, not just its Base branch CI step #1958

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From a 2026-11-10 investigation of why the Fix run Pass never repaired the Merge conflicts on #1823 and #1935.

Agent Brief

Category: bug
Summary: A held CI-red reservation (refs/heads/thirdshift/pickup/ci-red) skips the unscoped Fix run Pass entirely, before the PR search. Pickup only skips its CI actions on the same lock, then carries on. A Fix run Pass should do the same.

Current behavior:

In src/fix.rs:54, an unscoped Fix run Pass (no --author) calls base_ci::run first. If Reservation::ci_red can't take the lock, src/fix/base_ci.rs:22 returns Some(skipped("Base branch CI is reserved on origin")), and src/fix.rs:56 returns that ending. fix_candidates is never read.

A Pickup run whose crashed owner was process 966509 on stephens took ci-red on 2026-10-30 10:21 EDT and never released it. For the next 11 days every Fix run Pass in the fleet (cron on thirdshift.app, and on test from 2026-11-10) either hit the Command limit or skipped with Fix run skipped: Base branch CI is reserved on origin. #1823 and #1935 sat in Ready for review with a Merge conflict, eligible but never taken. The lock was released by hand on 2026-11-10.

docs/guide.md (section "When the Base branch stays red") already says, for Pickup: "An occupied reservation skips only these CI actions."

Desired behavior:

When the CI-red reservation is held, the Fix run Pass skips only its Base branch CI maintenance (reading the tip's CI, re-running, the fix-<base>-<sha> repair) and goes on to the PR search, reserving and fixing the first eligible PR as usual. The Activity log and stderr still say the Base branch CI step was skipped because the reservation is held.

Pending or re-running Base branch CI, and an existing repair branch or PR, still skip only that step as well, unless there's a reason they must hold back PR fixes. If there is, record it in the docs.

Key interfaces:

  • base_ci::run in src/fix/base_ci.rs: distinguishes "Base branch maintenance skipped" from "this Pass ends".
  • src/fix.rs Pass path: continues to fix_candidates after a maintenance skip.
  • docs/guide.md, Fix runs section: says a held CI-red reservation skips only the Base branch CI step, as for Pickup.

Acceptance criteria:

  • With refs/heads/thirdshift/pickup/ci-red held by another owner and an open PR with a Merge conflict, thirdshift fix base main reserves that PR and starts a Fix run.
  • stderr and the Activity log record that the Base branch CI step was skipped, with the reason.
  • With the reservation free, Base branch CI maintenance behaves as now, including starting a CI-fix session for persistent red CI.
  • --author Passes are unchanged.
  • Tests run through the CLI against the fake gh.

Out of scope:

  • Detecting or releasing a reservation whose owner has died (separate issue).
  • The Command limit starving the Fix run Pass behind Pickup runs.

Activity

  1. added
    bug
    needs-triage
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  2. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Confirmed against main at 74b072d. This is one bounded Ticket; no split is needed.

    Diagnosis: src/fix/base_ci.rs:22-56 returns Some(Ending::Skipped) for an occupied CI-red reservation, pending or re-running Base branch CI, and an existing repair branch or PR. src/fix.rs:53-58 returns that ending before calling fix_candidates. These maintenance skips therefore prevent unrelated eligible PR repairs.

    Reproduction: an isolated scratch harness under target/triage-1958 reused tests/support::Scenario, real fixture Git repositories and fake gh. Each case supplied an open Trusted-account PR with a real Merge conflict and ran thirdshift fix base main no-merge no-base-fix no-email. Held reservation, pending Base checks, a newly requested re-run, an existing repair branch, and an existing repair PR each produced zero candidate queries and zero sessions. The re-run case requested exactly one re-run. With Base CI clear and the reservation free, the same PR was selected, reserved, repaired and left ready for review. With the CI reservation held, adding --author acme also repaired the PR. Both held-reservation cases preserved the owner's exact ref SHA. Current skip reasons appeared on stderr and in the Activity log as whole-Fix-run skips.

    Implementation requirements:

    • Distinguish a skipped Base branch maintenance step from a completed maintenance Run. Continue into the existing PR selection, reservation and recheck path after reservation contention, pending/re-running Base CI, or repair deduplication. A newly requested re-run also continues to PR selection without waiting.
    • Preserve the existing persistent-red CI repair path and its terminal Run outcome. Preserve --author behavior, Command-limit admission, PR eligibility, Delivery checks, reservation ownership and error handling. Do not swallow operational errors or release another owner's reservation.
    • Record the maintenance-step skip and reason on stderr and in the repository Activity log without describing the whole Pass as skipped when it proceeds. Account for src/logs/recording.rs:420: logs::activity writes only after activity_started exists, whereas this decision precedes logs::started. Cover both subsequent PR dispatch and no eligible PR.
    • Add CLI/fake-gh regressions with an eligible conflicting PR for each maintenance-skip case. Assert dispatch and PR reservation, skip diagnostics, unchanged CI reservation ownership, and no duplicate maintenance work. Retain free-reservation persistent-red repair and author-scoped controls. Update tests/fix_base_ci.rs:27, which explicitly expects re-running CI to prevent selection; existing deduplication coverage also needs assertions that another eligible PR proceeds.
    • Update docs/guide.md's Fix runs section and regenerate site/docs/index.html with npm run docs --prefix site. Correct the pending/re-run gating descriptions in site/index.html:123, site/how-it-works/index.html:129-132 and site/architecture/index.html:559-561. Pickup already continues after contention in src/pickup.rs:212-216, consistent with docs/adr/0026-pickup-reruns-base-ci-before-filing.md.

    Validation: cargo test --test fix_base_ci --test fix_pass -- --test-threads=3 passed: 20 tests passed, two subprocess entry points ignored. After implementation, run the focused tests, generated-doc checks and scripts/affected-tests main.

    Out of scope: dead-owner detection/recovery, separately covered by #1959, and Command-limit scheduling starvation.

  3. added
    ready-for-agent
    in-progress
    and removed
    in-progress
    ready-for-agent
    on Nov 11, 2026
  4. removed
    in-progress
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions