fix(daemon): resume a retry whose worktree is gone

prepareWorkspace chose between Manager.Prepare (refresh onto base) and a
separate Manager.Resume, and Manager.Resume only opened an
already-prepared clone. A remediation whose local worktree the terminal
cleanup removed, an expired volume dropped, or a different host never had
could therefore never be resumed, and the retry path had no way to select
the mode that continues pushed work.

Unify the two matched methods into Prepare(..., Target): Fresh resets onto
origin/<base>, a non-empty Target resets onto origin/<that branch>, and
either target clones a missing worktree. The daemon's retry path selects
the target from the task row and passes the persisted branch, so a resume
lands on the branch the open PR lives on and fails closed when it is not
on the remote.

Delete the container-mode no-op resume (hybridTrees.Resume and the
resumableTrees capability) now that the daemon owns it. The remediate
workflow no longer stages a resume, and the retired remediate.resume step
word stays resolvable as an inert stage: a stored definition is validated
as a whole collection, so a removed word would fail every workflow to
decode, not just its own.
This commit is contained in:
sam committed 2026-10-02 10:24:52 +10:00
1 parent c70b144782
commit 6ff239ee70
22 files changed
+363 -246

No files matched your search

+11
View File
@@ -28,6 +28,17 @@ vocabulary it registers, so both must see the same step types.
6. Add a parse test (settings accepted and refused) and a run test with fake
`Trees` and agent runner.
## Retiring a step type
A step word cannot simply be deleted. A stored or pinned definition is
validated as a whole collection, so one unknown word fails EVERY workflow's
definition to decode and the workflow-definitions resource becomes unreadable.
Retire a stage by removing it from its workflow's `Stages` and adding it to
`retiredSteps` in `definition.go`, which keeps the word resolving as an inert
stage. The retired stage must do nothing: the behaviour it used to perform now
belongs to whatever layer took it over (the remediate workflow's in-container
resume moved to daemon worktree preparation, `archie-core-866m`).
## Changing the definition format
- The fields a caller needs without the engine (inputs, repository, profile)