Skip to content

Stop obsolete Delivery and Repair work on PR lifecycle changes - #760

Merged
JacobStephens2 merged 3 commits into
mainfrom
issue-730
Oct 17, 2026
Merged

JacobStephens2 merged 3 commits into
mainfrom
issue-730

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

 Delivery / Repair / CI polling
+  reobserve the captured PR before further work
+  merged or closed → stop, report state, retain local work without pushing
+  draft during Repair or CI → fail the existing readiness gate
+  origin already has this commit → skip the push

Session stop guidance and generated prompts use the same lifecycle contract. Real changes and reconciled history still reach origin. An external merge remains a stopped Delivery, never a factory Self-merge.

Closes #730

Evidence

  • Before: cargo test --test pr_lifecycle lifecycle_changes_stop_pending_ci_without_recreating_a_deleted_branch -- --exact --nocapture failed: CI kept polling to green, then failed-run preservation recreated the deleted branch.
    After: the lifecycle regression passes for merged, closed, and draft transitions. Opening-session and Repair cases retain unpublished work, avoid stale body edits, and preserve session failures.
  • Before: cargo test --test ci a_ci_fix_repair_that_makes_no_commit_gets_one_check_re_run_and_green_is_success -- --exact --nocapture observed three pushes for an unchanged Repair.
    After: one necessary publication, no empty Repair commit, and the Check re-run still delivers the unchanged head.
  • Validation: cargo check; cargo fmt --check; cargo clippy --all-targets -- -D warnings; focused CI, merge, readiness, lifecycle and ownership tests; generated-prompt checks; cargo test (full suite); release-script unit tests; site browser tests (npm test, 4 passed). All passed.
  • The Spec reviewer’s publication-race reproduction also failed before the fix and now passes. Expected-ref publication protects against branch deletion both during normal Delivery and failed-run preservation, while refusing divergent history.

Test seams

  • The thirdshift CLI with real Git repositories and scripted GitHub/session executables: lifecycle changes during CI polling, opening sessions, and Repairs; remote branch survival, PR mutations, failure output, and retained local work.
  • Generated session prompts and their checked-in artifacts.

Unaddressed findings

Standards

None.

Spec

None.

Standards: 0 findings. Spec: 1 finding reproduced, fixed, and retained as a regression test. Both reviewers read all 26 changed files; unread changed files: none.

Security

None. Guidance review covered all 26 changed files against pinned merge base 5ac7005f07cb2f20c9dc65879509d612169d67f1, plus supporting code for PR identity, lifecycle gates, conditional publication, checkout ownership, and prompt/action binding. No introduced Security finding was established; no source changes were made.

Validation in an isolated, network-disabled sandbox: 73 tests passed across cargo test --offline --locked --test pr_lifecycle --test spec_push_race, cargo test --offline --locked --bin thirdshift worktree::synchronization_tests, and cargo test --offline --locked --bin thirdshift pull_request:: (each with -- --test-threads=2).

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Blast Radius: Delivery

Adds lifecycle reads during Delivery and CI polling. When the PR is terminal or preservation cannot establish its lifecycle, work stays in the acquired checkout for the Day shift instead of being pushed.

Built with codex · gpt-6.1-sol · high

@JacobStephens2
JacobStephens2 merged commit ed01f04 into main Oct 17, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-730 branch October 17, 2026 15:13
JacobStephens2 added a commit that referenced this pull request Oct 17, 2026
2026-10-17T15:23:25Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 17, 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.

Stop Delivery and Repair work when the PR is merged, closed, or drafted

1 participant