docs(worker): document company mode (fetch, push, draft PR) and its open smoke tests

This commit is contained in:
mika kuns
2026-10-01 12:18:07 +02:00
parent 674db27f6e
commit 93fd6740a1
3 changed files with 72 additions and 6 deletions
+15 -2
View File
@@ -1,8 +1,8 @@
# Review, merge & conflict resolution
> **Explore-note — verify before trusting.** Distilled map of a subsystem, not authoritative.
> Last verified against `44d94caa` (2026-10-01), which made the parent's worktree the unit
> branch (children fast-forwarded into it).
> Last verified against `0e6a48e2` (2026-10-01): parent's worktree is the unit branch (children
> fast-forwarded into it); in a company repo approve ends in a pushed branch + draft PR.
> Planning mode renders per file and `DiffLinesView` is retired.
> Drift check: `git log --oneline 20bce9b..HEAD -- src/ClaudeDo.Worker/Lifecycle src/ClaudeDo.Worker/State src/ClaudeDo.Worker/Planning src/ClaudeDo.Ui/ViewModels/Conflicts src/ClaudeDo.Worker/External`
> Stable structure only (no line numbers). See docs/explore-notes/README.md.
@@ -28,6 +28,19 @@ There is no separate "Merge all" entry.
- **Child of a unit** (parent has an `Active` worktree) → `ApproveAndMergeAsync` absorbs it into
the unit branch (`UnitBranchService.AbsorbChildAsync`, ff-only) instead of merging to the target.
- **No active worktree** (sandbox run) → straight to `Done`.
- **Company repo** (`PullRequestPublisher.IsCompanyRepoAsync`, origin matches
`company_remote_pattern`, checked live) with an `Active` worktree → `ApproveCompanyAsync`
instead of a merge, after the planning-parent gate and the child absorb: missing PAT / non-ADO
remote is `blocked` before anything runs, then the verify command in the **worktree**
(`skipVerify` ignored — no local merge to defer it to; red = `verify_failed`, nothing pushed),
then `PullRequestPublisher.PublishAsync`: `git push -u origin <branch>` (PAT via `GIT_CONFIG_*`
env, `AzureDevOpsClient.GitAuthEnv`), find-or-create the draft PR, store
`worktrees.pull_request_url`, `WorktreeUpdated`. Result `pr_created` / `pr_updated` + URL
(`MergeResult.PullRequestUrl`; MCP puts it in `mergeMessage`). Task stays `WaitingForReview`,
worktree `Active`, ticket `InBearbeitung`; `Done` is the user's manual toggle after the ADO
merge. A PR failure after a successful push is `blocked` with `gepusht, PR fehlgeschlagen: …`.
⚠️ Only approve branches — `merge_task`/the merge modal and the legacy-unit orchestrator still
merge locally in a company repo.
Review transitions all live in `TaskStateService`: `SubmitForReviewAsync`,
`SubmitForChildrenAsync`, `ApproveReviewAsync`, `RejectToQueueAsync`, `RejectToIdleAsync`,