b557cf442c
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
3.0 KiB
3.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-fail-closed-stale-workspace | Fail closed on stale executor-transition workspaces | in_progress | 1 | plan.md | ../../specs/tasks/system-design/additional-session-workspace-reuse.md |
Task 01: Fail Closed on Stale Executor-Transition Workspaces
Acceptance
- An executor-type mismatch cannot forward or later recover the previous task environment's workspace path, repository inventory, or runtime handles.
- A repo-backed local/worktree launch admits only a workspace tied to the selected environment with complete canonical inventory and a matching Git checkout.
- Missing, non-Git, and path-mismatched workspaces return a typed recoverable error before execution creation and agent startup.
- Valid same-executor additional sessions and repository-less tasks retain current behavior.
- Failure leaves filesystem contents, Git state, environment rows, session history, and canonical repositories unchanged.
- Current task file/change projections cannot select the rejected workspace.
Implementation outline
- Add a launch-scoped validated-environment identity/admission result rather than inferring validity from a non-empty path.
- Make executor mismatch drive fresh environment selection/materialization or typed failure before lifecycle launch.
- Add a lifecycle defense-in-depth guard before
createExecutionfor repo-backed local/worktree sessions. - Keep typed failure projection bounded and path-free.
- Add regression tests before changing behavior, then run focused package tests and the spec linter.
Verification
cd apps/backend && go test ./internal/orchestrator/executor -run 'Test.*Executor.*Mismatch|Test.*Workspace.*Reuse|Test.*Executor.*Transition'
cd apps/backend && go test ./internal/agent/runtime/lifecycle -run 'Test.*Workspace.*Execution|Test.*Workspace.*Ready'
python3 scripts/lint-spec-files.py --all
Files likely touched
apps/backend/internal/orchestrator/executor/executor_environment_reuse.goapps/backend/internal/orchestrator/executor/executor_environment_test.goapps/backend/internal/orchestrator/executor/executor_execute.goapps/backend/internal/orchestrator/executor/executor_execute_test.goapps/backend/internal/agent/runtime/lifecycle/manager_execution.goapps/backend/internal/agent/runtime/lifecycle/manager_execution_test.go- workspace-info provider and task-status projection tests selected during the regression-first implementation.
Output contract
Report the exact commit/tree, regression tests, focused test receipts, spec
lint receipt, residual risks, and the runtime rebind verification result. Mark
this task and plan.md done only after the implementation and verification
both pass.
Current receipt
Implementation and focused verification pass on 2026-08-29. The source build
passes. The task stays in_progress until an isolated v0.92.1 runtime proves a
fresh local session binds the canonical repository and the rejected legacy path
is never projected or started.