Repository navigation
Unload finished scopes and prevent PID reuse collisions - #1910
Merged
Merged
Conversation
…/actions/runs?head_sha=362c2018c07cdafb1d941ad48f3a80e4c922d2eb&per_page=100 failed: gh: API rate limit exceeded for user ID 53905376. If you reach out to GitHub Support for help, please include the request ID D810:105010:1393FFE:3E7768B:6AF260DB and timestamp 2026-11-10 00:10:03 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) (HTTP 403)) 2026-11-10T00:10:04Z, host dev.etadventures.com. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
November 10, 2026 00:10
JacobStephens2
marked this pull request as ready for review
November 10, 2026 18:15
…/actions/runs?head_sha=07c8c5a201bba001c14c84ac0ea490c62ffdc162&per_page=100 failed: gh: API rate limit exceeded for user ID 53905376. If you reach out to GitHub Support for help, please include the request ID AAAC:2BCE1:DCEF4E:2AF6BD0:6AF37848 and timestamp 2026-11-10 20:02:16 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) (HTTP 403)) 2026-11-10T20:02:16Z, host stephens. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
November 10, 2026 20:02
JacobStephens2
marked this pull request as ready for review
November 10, 2026 20:59
This was referenced Nov 11, 2026
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1895.
Session, Trial and Grader owners unload retained empty units without relying on manager notifications. Already-collected units are silent, including collection racing with
stop. Borrowed Trial membership retains its owner; survivor handling, memory caps and--collectare preserved.Evidence
Execution evidence
Reproduced at the supplied merge base,
02c96545737cbd35efb69dd1ef93594f218ba9f2, in a detached worktree. Only the branch's unchanged regression file and its test-module declaration were added there; production code stayed at the merge base. The fake manager successfully runs the command, requires--collect, reports no processes, and retains the empty unit until explicitly stopped. No host systemd state was changed.Commands used
CARGO_BUILD_JOBS=2andCARGO_TARGET_DIR=/tmp/thirdshift-1895-repro.ZTQmtu/target. The baseline package was cleaned before rebuilding the Issue branch to prevent reuse of baseline build artifacts. After results are from branch headf12ba6fba17bbdc11fe8bb0efbd364455b7a3e45.cargo test --manifest-path /tmp/thirdshift-1895-repro.ZTQmtu/baseline/Cargo.toml --bin thirdshift scope::lifecycle_tests::finished_scopes_are_unloaded -- --exact --nocapturefailed with
finished Session scope remains loaded: thirdshift-session-1078883-0-harness.scopeand0 passed; 1 failed.After: the same test,
cargo test --bin thirdshift scope::lifecycle_tests::finished_scopes_are_unloaded -- --exact --nocapture, passed:1 passed; 0 failed, checking Session, Trial and Grader disposal.cargo test --bin thirdshift scope::lifecycle_tests::reused_pid_and_counter_do_not_reuse_unit_names -- --exact --nocapturein the baseline worktree failed withPID reuse must not collide with a retained unit; both names werethirdshift-session-1079746-0-harness.scope(0 passed; 1 failed).After: the identical command on the Issue branch passed:
1 passed; 0 failed.cargo test --bin thirdshift scope:: -- --nocapture: 9 passed; 0 failed, including already-gone units, collection racing stop, cap arguments and OOM evidence retained until owner disposal.cargo test --bin thirdshift evals::experiment::execution::tests::scope_cap_evidence_preserves_explicit_voids_and_unexplained_kills_fail -- --exact --nocapture: 1 passed; 0 failed. Scope cap-kill evidence still produces a Void Trial withmemory_cap; explicit Void causes and unexplained-kill failures remain intact.Confirmed cause: scope owners left disposal entirely to manager collection; PID plus a restarting counter could then collide with a retained unit. The regressions exercise
session_command,trial_commandandgrader_commandthrough shared process supervision against isolated fake systemd commands.The exact head's Rust, Console and site CI passed. This Continuation needed no source changes; successful exact-head full-suite CI was reused per
docs/testing.mdrather than repeated locally.Review coverage
Independent
thirdshift-code-reviewagainstrefs/remotes/origin/main, pinned at84c5856e6846f5c1f6cd8c1c80722341e2e267bf: Standards 0 findings, Spec 0 findings. Both reviewers fully read both changed files,src/scope.rsandsrc/scope/lifecycle_tests.rs. Unread changed files: none. Generated-output exclusions: none. Reports, each axis's final files-read list, finding counts and reproduction notes are retained in this Session's.thirdshift-review-vXiIWx/directory.Unaddressed findings
Standards
None.
Spec
None.
Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
Reverting restores the earlier behavior. Existing leftover host units require separate operator cleanup.
Blast Radius: Execution
Scope disposal affects Session, Trial and Grader completion. It stops empty owned scopes after existing survivor handling and OOM inspection. Disposal errors produce warnings without changing command outcomes.
Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh