1.8 KiB
1.8 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 03-worktree-live-default-fallback | Worktree fallback resolves live remote default | done | 2 |
|
plan.md | ../../specs/tasks/requirements/task-launch-failure-recovery.md |
Task 03: Worktree fallback resolves live remote default
When the stored fallback is absent, refresh the live remote default through the worktree manager.
-
Acceptance:
- Exported
Manager.ResolveRemoteDefaultBranch(ctx, repoPath)first readsrefs/remotes/origin/HEAD. - If necessary, it runs
git remote set-head origin --autothrough existing Git admission. - The command uses caller cancellation,
Manager.inspectTimeout, and noninteractive Git environment. - Auth, network, cancellation, timeout, and unresolved results remain distinguishable.
resolveBaseRefWithFallbackuses the live result after the stored fallback fails.- The resolved branch and fallback warning still reach the created
Worktree. - The manager stays task-agnostic and imports no task service.
- Exported
-
Verification:
cd apps/backend && go test ./internal/worktree/... -
Files likely touched:
apps/backend/internal/worktree/manager_lifecycle.go,apps/backend/internal/worktree/manager_lifecycle_test.go. -
Dependencies: Task 02.
-
Parallelism: sequential.
-
Inputs: spec "Default-branch resolution" and "Failure modes".
Results
- Added
Manager.ResolveRemoteDefaultBranchwith localorigin/HEADinspection, bounded noninteractive refresh, typed auth/network/timeout/unresolved outcomes, and caller cancellation. - Missing stored fallbacks now try the live remote default, and the existing worktree warning/detail path receives the resolved branch.
- Verification:
go test ./internal/worktree/...passed.