@@ -201,6 +201,8 @@ flowchart TD
201201 V -->|Failed check or Git consistency guard| VB[verifying / blocked]
202202 VB -->|Operator retries saved stage| V
203203 P --> Done[pr_opened / done with PR and publishedAt]
204+ P -->|Branch matches, PR head not yet updated| Lag[publishing / retry_wait within attempt limit]
205+ Lag -->|Backoff elapsed, reuse saved push| P
204206 P -->|Publication failure| PB[Retain publishing phase and apply error policy]
205207 PB -->|Eligible retry| P
206208 Done -->|Pending authorized feedback| Round[Increment round, move feedback and reset per-round state]
@@ -449,19 +451,27 @@ flowchart TD
449451 Find --> Follow{Follow-up round?}
450452 Follow -->|Yes| Open{Existing PR open?}
451453 Open -->|No| Block
452- Open -->|Yes| Push[Validate origin, workspace, saved HEAD and clean tree, push exact SHA]
454+ Open -->|Yes| Pushed{Saved pushedCommit matches verified SHA?}
455+ Pushed -->|Yes| Description
456+ Pushed -->|No| Push[Validate origin, workspace, saved HEAD and clean tree, push exact SHA]
453457 Follow -->|No| Exists{PR already exists?}
454458 Exists -->|Yes| Closed{PR closed?}
455459 Closed -->|Yes| Done[Record PR and publication time, pr_opened / done]
456460 Closed -->|No| Description
457461 Exists -->|No| Title[Generate title only if no saved prTitle]
458462 Title --> Issue{Issue still open?}
459463 Issue -->|No| Block
460- Issue -->|Yes| PushNew[Validate origin and workspace, push exact verified SHA]
461- PushNew --> Create[Create or reconcile signed PR against pinned base]
462- Create --> Description[Read open PR at verified SHA, reconcile managed description]
463- Push --> Description
464- Description -->|Edited managed block, changed head or oversized body| Block
464+ Issue -->|Yes| NewPushed{Saved pushedCommit matches verified SHA?}
465+ NewPushed -->|Yes| Create
466+ NewPushed -->|No| PushNew[Validate origin and workspace, push exact verified SHA]
467+ PushNew --> SaveNew[Persist pushedCommit]
468+ SaveNew --> Create[Create or reconcile signed PR against pinned base]
469+ Create --> Description[Read open PR and remote branch, reconcile managed description]
470+ Push --> SavePush[Persist pushedCommit]
471+ SavePush --> Description
472+ Description -->|Branch matches, PR head differs| Pending[Retry saved publication with backoff and attempt limit]
473+ Pending --> Retry
474+ Description -->|Closed PR, changed branch, edited managed block or oversized body| Block
465475 Description -->|Unchanged or update succeeds| Acknowledge[Persist published body checkpoint]
466476 Acknowledge --> Done
467477 Failure[Other command, model or transport error] --> Policy[Keep current phase and apply retry policy in section 8]
@@ -473,9 +483,11 @@ flowchart TD
473483```
474484
475485Resuming ` running ` validates the saved session first; retrying ` verifying ` runs
476- checks again. Retrying ` publishing ` uses the saved verified SHA and requires the
477- worktree still to match it, rather than rerunning checks implicitly. An already
478- pushed branch does not by itself make a task complete.
486+ checks again. Retrying ` publishing ` uses the saved verified SHA without rerunning
487+ checks implicitly. If a push is still required, the worktree must still match
488+ that SHA. After a checkpointed push, description reconciliation checks GitHub's
489+ branch and PR instead; it does not publish later local edits. An already pushed
490+ branch does not by itself make a task complete.
479491
480492The configured checks are command argument arrays. A failing configured check
481493produces ` blocked ` . With no configured checks, only Git consistency checks run;
@@ -498,9 +510,21 @@ follow-ups. Dispatcher checks appear separately from agent-reported tests, follo
498510by ` Closes #N ` , session, round and verified commit. Push uses
499511` COMMIT:refs/heads/TASK_BRANCH ` without force. The first publication reconciles an
500512existing branch PR without another push; follow-ups require an open PR and push
501- the new verified commit before updating its description. The title is retained.
513+ the new verified commit before updating its description. A successful push saves
514+ ` pushedCommit ` ; retries skip that push when it matches the verified SHA, including
515+ after an owner restart. New rounds clear this checkpoint. If push succeeded but
516+ its response or checkpoint was lost, normal non-force push reconciliation still
517+ applies. The title is retained.
502518An already closed first-round PR is recorded without editing its description.
503519
520+ Before reconciling the description and again before PATCH, compare the remote
521+ branch ref with the verified SHA. If the branch matches but the PR head is stale,
522+ ` PullHeadPending ` uses the normal backoff and ` maxAttempts ` policy at ` publishing ` .
523+ It does not rerun implementation, verification, or a checkpointed push. A closed
524+ PR or different branch SHA blocks with a distinct error; a stale PR view is not
525+ permission to overwrite a changed branch. The guard also checks the branch when
526+ the PR view already reports the expected SHA.
527+
504528A stable HTML marker pair encloses the bot-managed description. Notes outside
505529it are preserved; an edited or removed managed section blocks publication rather
506530than overwriting it. The last acknowledged body is checkpointed, so a lost update
@@ -666,9 +690,9 @@ flowchart TD
666690 Result -->|WaitingForAnswer| Wait[waiting, or ready if answer already arrived]
667691 Result -->|SessionStopped| Stop[running / blocked, sessionStopped true]
668692 Result -->|Other Blocked, description conflict or GitHub 401, 404, 422| Block[blocked at saved phase]
669- Result -->|Other failure below attempt limit| Retry[retry_wait at saved phase]
693+ Result -->|PR head propagation or other failure below attempt limit| Retry[retry_wait at saved phase]
670694 Retry -->|nextAt elapsed| Work
671- Result -->|Other failure at limit| Fail[failed at saved phase]
695+ Result -->|PR head propagation or other failure at limit| Fail[failed at saved phase]
672696 Stop --> Probe[On available worker pass, probe due saved session without unresolved question]
673697 Legacy[Recognized legacy timeout or outcome block] --> Probe
674698 Probe --> Complete{Matching location and task marker, succeeded outcome and valid final assistant?}
0 commit comments