[P0] Add atomic author finalization #891

Open
opened 2026-07-24 21:36:23 -05:00 by jcwalker3 · 0 comments
Owner

Parent epic: #887
Priority: P0

Problem

Publish, PR creation, reviewer handoff, and author-lease retirement are four separate operations with no shared transaction. Interruption between any two leaves a published branch with no PR, or a PR with a live author lease, and no resume path. Observed live: #663 commit 714190e02a89636aa515320cddef9437d46dbc37 published with no PR and no way to finish forward.

Prerequisites

  • #816 (gitea_publish_unpublished_issue_branch discards the worktree_path its own preflight requires) is a hard prerequisite — the publish step cannot be made atomic while it fail-closes for every caller.
  • #871 / #872 (head refresh) and #790 / #792 (lease retirement) must be consumed by this work, not restated in it.

Acceptance criteria

  • Add a single idempotent transition covering: validated commit -> publish -> verify remote head -> create PR -> reviewer handoff -> retire author lease.
  • Recovery resumes safely after interruption at every one of those stages, including partway through the last.
  • The initial base-equivalent lock is never reused after the branch advances (renewal on base equivalence currently fails and must not be the resume path).
  • Expected branch head and ownership generation are both fenced on entry.
  • Integrates the existing #871/#872 head-refresh work and #790/#792 lease-retirement work rather than duplicating them.
  • Regression starts from the real stranded state: published #663 commit 714190e02a89636aa515320cddef9437d46dbc37 with no PR, and finishes forward without operator repair.

Duplicate verdict

PARTIAL. #816 (gitea_publish_unpublished_issue_branch discards the worktree_path its own preflight requires) is a hard prerequisite — the publish step cannot be made atomic while it fail-closes for every caller. #792 owns lease retirement; #871/#872 own head refresh. Consume all four.

Parent epic: #887 Priority: P0 ## Problem Publish, PR creation, reviewer handoff, and author-lease retirement are four separate operations with no shared transaction. Interruption between any two leaves a published branch with no PR, or a PR with a live author lease, and no resume path. Observed live: #663 commit `714190e02a89636aa515320cddef9437d46dbc37` published with no PR and no way to finish forward. ## Prerequisites - #816 (`gitea_publish_unpublished_issue_branch` discards the `worktree_path` its own preflight requires) is a hard prerequisite — the publish step cannot be made atomic while it fail-closes for every caller. - #871 / #872 (head refresh) and #790 / #792 (lease retirement) must be consumed by this work, not restated in it. ## Acceptance criteria - Add a single idempotent transition covering: validated commit -> publish -> verify remote head -> create PR -> reviewer handoff -> retire author lease. - Recovery resumes safely after interruption at every one of those stages, including partway through the last. - The initial base-equivalent lock is never reused after the branch advances (renewal on base equivalence currently fails and must not be the resume path). - Expected branch head and ownership generation are both fenced on entry. - Integrates the existing #871/#872 head-refresh work and #790/#792 lease-retirement work rather than duplicating them. - Regression starts from the real stranded state: published #663 commit `714190e02a89636aa515320cddef9437d46dbc37` with no PR, and finishes forward without operator repair. ## Duplicate verdict PARTIAL. #816 (`gitea_publish_unpublished_issue_branch` discards the `worktree_path` its own preflight requires) is a hard prerequisite — the publish step cannot be made atomic while it fail-closes for every caller. #792 owns lease retirement; #871/#872 own head refresh. Consume all four.
jcwalker3 added the type:featurestatus:readyworkflow-hardeningsafety labels 2026-07-24 21:36:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#891