Severity: critical | Category: data-integrity | Phase: P0.3
Problem
Verified: grep merge_back shows only the definition + docstring — zero call sites. External engines write to cf/<task_id> in the worktree, then cleanup() runs git worktree remove --force + git branch -D in a finally, destroying all changes; the task is marked COMPLETED with no surviving code.
Evidence
codeframe/core/worktrees.py:80 (defined), codeframe/core/sandbox/context.py:81 + codeframe/core/runtime.py:931 (cleanup force-deletes)
Acceptance criteria
- On successful worktree run,
merge_back() (or a patch export) runs before cleanup; merge conflicts surface as blockers and the branch is preserved on failure.
- Integration test: a file created by the adapter under
--isolation worktree exists on the base branch after the run.
- (Acceptable interim: hard-reject
--isolation worktree with a clear error until merge-back ships, so no work is lost.)
Dependencies
None
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).
Severity: critical | Category: data-integrity | Phase: P0.3
Problem
Verified:
grep merge_backshows only the definition + docstring — zero call sites. External engines write tocf/<task_id>in the worktree, thencleanup()runsgit worktree remove --force+git branch -Din afinally, destroying all changes; the task is marked COMPLETED with no surviving code.Evidence
codeframe/core/worktrees.py:80(defined),codeframe/core/sandbox/context.py:81+codeframe/core/runtime.py:931(cleanup force-deletes)Acceptance criteria
merge_back()(or a patch export) runs before cleanup; merge conflicts surface as blockers and the branch is preserved on failure.--isolation worktreeexists on the base branch after the run.--isolation worktreewith a clear error until merge-back ships, so no work is lost.)Dependencies
None
Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).