Skip to content

docs: update worktree divergence reconcile description [doc-updater] - #2365

Merged
jwbron merged 2 commits into
mainfrom
egg/doc-update-sync-worktree-rebase
Apr 30, 2026
Merged

docs: update worktree divergence reconcile description [doc-updater]#2365
jwbron merged 2 commits into
mainfrom
egg/doc-update-sync-worktree-rebase

Conversation

@james-in-a-box

Copy link
Copy Markdown
Contributor

Update documentation to reflect changes from 69b2a18 (Fix #2337):

  • The _sync_worktree_with_remote() divergence case now uses _rebase_with_agent_output_autoresolve instead of --ff-only merge. The old doc described the stale fast-forward-merge behavior; the new description names the rebase helper, explains the base_branch=None contamination-risk fallback, and corrects the trigger context to include phase boundaries (not just orchestrator restarts).

Triggered by: #2352

Authored-by: egg

Update the _sync_worktree_with_remote() section in orchestrator.md
to reflect that diverged worktrees are now reconciled via rebase
(using the same _rebase_with_agent_output_autoresolve helper as the
gateway-side push-reject path) rather than the old --ff-only merge
attempt. Also notes the base_branch=None fallback warning.

Authored-by: egg

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No agent-mode design concerns — docs-only update describing the worktree divergence reconcile path in _sync_worktree_with_remote().

— Authored by egg

@james-in-a-box

This comment has been minimized.

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Documentation-only PR. Two lines updated in docs/architecture/orchestrator.md to align with the post-#2337 behavior of _sync_worktree_with_remote(). I verified each claim against orchestrator/routes/pipelines.py:5232-5519 and orchestrator/gateway_client.py:1998-2277.

Verified accurate

  • Trigger context ("orchestrator restarts and phase boundaries"): matches the function's own docstring at orchestrator/routes/pipelines.py:5242-5243 ("After an orchestrator restart or a phase boundary, the local worktree branch may be behind the remote").
  • Helper name _rebase_with_agent_output_autoresolve: matches the call site at orchestrator/routes/pipelines.py:5493. Lives in orchestrator/gateway_client.py:1998 and is the same helper invoked by the gateway-side push-reject reconcile path, as the doc claims.
  • Failure handling ("the error is logged and the function returns"): matches orchestrator/routes/pipelines.py:5509-5519divergence_rebase_failed is logged at error level and the function returns without falling through to the step-4 reset.
  • base_branch=None fallback: the warning emit at orchestrator/routes/pipelines.py:5479-5485 and the actual bare-form fallback in _build_rebase_cmd at orchestrator/gateway_client.py:2261-2262 confirm both the warning and the contamination risk. The #2222 reference matches the in-code comment at orchestrator/routes/pipelines.py:5466-5478 and orchestrator/gateway_client.py:2253-2254.

Both real callers (orchestrator/routes/pipelines.py:14169 and :15396) thread pipeline.base_branch, so the base_branch=None path is a defensive corner case. Documenting it is appropriate — the warning is real and an operator hitting that log line will want to know what it means.

Non-blocking suggestion

The summary sentence directly above the bullet list (unchanged by this PR) still reads:

"then resolves divergence and resets the local branch to origin/<branch> via git reset --hard when needed."

After #2337, the divergence case no longer resets — it rebases. The "when needed" hedge covers it loosely, and the bullet list directly below is accurate, so this isn't wrong, just slightly imprecise. If you wanted to tighten in a follow-up:

"then reconciles divergence (rebasing local commits) or resets the local branch to origin/<branch> depending on the case described below."

Not blocking — the bullets carry the load.

Verdict

No blocking issues. The PR is a faithful, scoped doc-sync for #2337. Approving.

— Authored by egg

@james-in-a-box

This comment has been minimized.

@james-in-a-box

This comment has been minimized.

Per non-blocking review suggestion on #2365: the summary sentence above
the bullet list still described 'reset the local branch to origin/<branch>
via git reset --hard when needed', which is imprecise after #2337 — the
diverged case now rebases. Replace with a phrasing that covers both
reconcile paths (rebase or reset) and points at the bullets for specifics.
@james-in-a-box

Copy link
Copy Markdown
Contributor Author

Review feedback disposition

egg-reviewer (review bot) — APPROVED with one non-blocking suggestion:

egg-reviewer (agent-mode-design bot) — APPROVED, no concerns.

No other actionable feedback from authorized reviewers.

— Authored by egg

@james-in-a-box

This comment has been minimized.

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No agent-mode design concerns — delta since the prior review is a single-sentence wording tightening in docs/architecture/orchestrator.md to address a non-blocking suggestion. Still a pure docs-only PR.

— Authored by egg

@james-in-a-box

This comment has been minimized.

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review

Delta since the prior review (fc8943f1e79d24d1) is the single-commit follow-up that applies my own non-blocking suggestion verbatim. Re-verified against the current code:

  • Summary sentence at docs/architecture/orchestrator.md:234: now reads "then reconciles divergence (rebasing local commits) or resets the local branch to origin/<branch> depending on the case described below." This faithfully captures both control-flow branches in _sync_worktree_with_remote():
    • The diverged-case rebase at orchestrator/routes/pipelines.py:5493 (rebases local commits).
    • The reset-to-origin step covering the succeeded-ahead/push-fail-fallback, failed-ahead, and behind-remote cases.
    • The "depending on the case described below" hedge correctly defers to the bullets, including the in-sync early-return.
  • The previous summary's git reset --hard implementation detail dropped out of the top-line, but the bullets carry the same "reset" language uniformly, so no information is lost in context.
  • Code references still match: _sync_worktree_with_remote at :5232, _rebase_with_agent_output_autoresolve at :5493, divergence_rebase_failed log path at :5513. base_branch=None warning emit and bare-form fallback unchanged from the prior review.

No new concerns. The original feedback was addressed exactly as suggested. Pure docs-only change with no functional risk.

Verdict

Approving.

— Authored by egg

@james-in-a-box

Copy link
Copy Markdown
Contributor Author

egg review completed. View run logs

5 previous review(s) hidden.

@jwbron
jwbron merged commit f99a513 into main Apr 30, 2026
29 checks passed
james-in-a-box Bot added a commit that referenced this pull request Apr 30, 2026
…2365)

* docs: update worktree divergence reconcile description

Update the _sync_worktree_with_remote() section in orchestrator.md
to reflect that diverged worktrees are now reconciled via rebase
(using the same _rebase_with_agent_output_autoresolve helper as the
gateway-side push-reject path) rather than the old --ff-only merge
attempt. Also notes the base_branch=None fallback warning.

Authored-by: egg

* docs: tighten summary sentence above divergence bullets

Per non-blocking review suggestion on #2365: the summary sentence above
the bullet list still described 'reset the local branch to origin/<branch>
via git reset --hard when needed', which is imprecise after #2337 — the
diverged case now rebases. Replace with a phrasing that covers both
reconcile paths (rebase or reset) and points at the bullets for specifics.

---------

Co-authored-by: jwbron <8340608+jwbron@users.noreply.github.com>
Co-authored-by: egg-reviewer[bot] <261018737+egg-reviewer[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant