Skip to content

Recover orphaned origin reservations and surface manual release - #2261

Merged
JacobStephens2 merged 4 commits into
mainfrom
issue-1959
Nov 17, 2026
Merged

JacobStephens2 merged 4 commits into
mainfrom
issue-1959

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

scheduled Pass → inventory origin reservations before choosing work
  local proof of death → exact-SHA lease release → Activity + stderr
  untestable + blocked work + held over 24h → Needs you
status / Console → owner, age, blocked work, release command, Dismiss / Undo
  ref gone or SHA replaced → clear the observation

Covers issue/legacy PR, ci-red, PR and Release reservations on Linux and macOS. A Fix Pass can free ci-red and check Base branch CI immediately. ADR 0033 records the proof-of-death exception to ADR 0017; the manual and hand-written site pages describe recovery.

Closes #1959

Evidence

Execution evidence

  • Before: cargo test --test reservations a_pass_releases_dead_local_owners_of_every_reservation_kind_and_logs_the_blocked_work -- --exact failed with dead owner still holds refs/heads/thirdshift/pickup/7.
    After: the same command passes: 1 passed; 0 failed.
  • The Spec review's exact reproduction, node /tmp/issue-1959-age-boundary.cjs, failed with Reservation crossed 24 hours but did not appear until page reload. The same command now exits 0. The regression stays in console/tests/reservations.test.cjs.
  • Formatting and Clippy passed: cargo fmt --check and cargo clippy --all-targets -- -D warnings. RUST_TEST_THREADS=3 scripts/affected-tests refs/remotes/origin/main passed all 72 site and 260 Console checks. Full Rust validation after correcting the sandbox's Python setup uses RUST_TEST_THREADS=6 cargo test --no-fail-fast.
  • The full Rust run completed every target with two local OOM-evidence failures: review_a_cap_killed_tool_cannot_leave_a_successful_trial and a_scoped_hog_leaves_journal_oom_evidence. This host is Rocky Linux 9.8, which the supported-platforms policy covers for release smoke checks; the full CI suite targets Ubuntu. A clean build of pinned base ec313210, verified to exclude the new recovery code, reproduced the first failure on its fourth isolated run. The journal failure also occurs with a bare capped Python process, without invoking thirdshift. The OOM classifier and both tests are unchanged by this PR.
  • Relevant Rust integration targets passed: reservations 8, Pickup 153, Fix Base branch CI 21, Release 149. All other Rust targets passed apart from the two host controls above.
  • The existing Fleet target check intermittently read visibility during live refresh (390px remote review-explicit: visible PR target, false !== true). node --test console/tests/working-targets.test.cjs now waits for visibility and passes, while still failing if the PR link remains absent.
  • Pickup model checking passes claimed-dispatch safety; both safeguard mutations produce their expected counterexamples. Its documented pre-Claim dispatch counterexample remains outside this change.

Seams tested: scheduled CLI commands against a bare origin and fake GitHub; native process/boot probes with conservative failure cases; shared status/Console output, observation refresh and Dismissal. Regressions cover lease races, PID reuse, reboot, all reservation kinds, same-Pass Base branch CI, malformed retained observations and the idle Console reporting deadline.

Native probes were executed on Linux. The macOS sysctl/libproc path is implemented but was not executed on this host.

Visual evidence

Needs you, 1440×900 desktop:

Before
After

Needs you, 390×844 mobile:

Before
After

Review

Independent Standards and Spec reviews used refs/remotes/origin/main (ec3132103bad062117651d9e43fd1378eba2bd6c) as the fixed point. Standards: 0 findings. Spec: 1 finding, reproduced and fixed with its regression retained. Both axes read 31 of the final 32 changed files, including the generated manual hunks. Generated-output exclusions: none.

Unread by both axes: console/tests/working-targets.test.cjs. Its late test-only change replaces an immediate visibility snapshot with a bounded visibility wait. It was added after each axis's permitted single follow-up and verified by its exact browser test.

Security review covered ec3132103bad062117651d9e43fd1378eba2bd6c...HEAD and supporting code in one session, using guidance mode. No introduced Security findings were identified. Checks covered reservation ownership, native process probes, exact-SHA release leases, command construction, retained observations, Console escaping and Dismissal authorization. Existing compiled Linux test targets passed in a network-isolated, resource-limited sandbox: target/debug/deps/reservations-fb256949e56cd8cc --test-threads=1 (8 passed, 2 fixture entry points ignored) and target/debug/deps/thirdshift-ef581c9738b72b20 reservation::recovery::tests --test-threads=1 (2 passed). No source changes were needed. macOS probes were source-reviewed only.

Unaddressed findings

  • Standards: none.
  • Spec: none.
  • Security: none.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: one-way

Automatic recovery deletes origin reservation refs when their recorded local owner is provably dead. An exact observed-SHA lease protects a concurrent retake; uncertain probes preserve the reservation.

Blast Radius: Fleet

Every scheduled Pass inspects its repository's reservations. Host ownership uses the recorded OS hostname and the host's PID namespace, as specified by the Day shift decision.

Built with codex codex-cli 0.169.0 · gpt-6.1-sol · xhigh

CI notes

  • api::release_url_keeps_api_openapi_and_cli_parity is unchanged by this PR and races the Console's background GitHub refresh (github_failure: null versus an unauthenticated gh api rate_limit error); the identical failure occurred on main at c58b4bfc, attempt 1. The exact targeted test passed locally, then reproduced the same mismatch on the second run with GitHub credentials removed. test and rust-x86 / complete only reflect this partition failure; no code changes or CI re-runs were made.

@JacobStephens2
JacobStephens2 merged commit 90c42a1 into main Nov 17, 2026
35 of 38 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1959 branch November 17, 2026 17:04
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notice a reservation whose owning process has died

1 participant