Files
fusion/scripts/lib
Fusion Agent 26f2a2080a FN-207: contain lifecycle moves within valid workflow paths
Contain task lifecycle movement within the workflow graph so cards cannot wander between columns.

- Enforce directional transition and containment policies across task, recovery, merge, and workspace flows.
- Centralize lifecycle move execution, provenance, reason logging, and live-column rebound handling.
- Add regression, forbidden-path, remediation-placement, and workspace reuse coverage.

Files changed:
 .changeset/fn-207-lifecycle-containment.md         |   7 +
 AGENTS.md                                          |   2 +
 docs/architecture.md                               |   1 +
 docs/workflow-steps.md                             |   2 +
 .../__tests__/lifecycle-direction-policy.test.ts   |  88 ++++++
 .../lifecycle-move-provenance-emit.test.ts         | 107 +++++++
 .../__tests__/remediation-step-placement.test.ts   |  51 ++++
 packages/core/src/index.gate.ts                    |  11 +-
 packages/core/src/index.ts                         |  21 +-
 packages/core/src/store.ts                         |  25 +-
 packages/core/src/task-store/lifecycle-ops.ts      |  21 +-
 packages/core/src/task-store/moves.ts              |  28 +-
 .../core/src/task-store/remediation-step-ops.ts    |  19 +-
 .../core/src/tasks/remediation-step-placement.ts   |  43 +++
 .../src/workflows/workflow-lifecycle-direction.ts  | 167 +++++++++++
 .../src/workflows/workflow-lifecycle-traits.ts     |  32 +++
 .../src/workflows/workflow-transition-policy.ts    |  56 +++-
 .../auto-recovery-branch-worktree.test.ts          |  25 +-
 .../executor-browser-verification.test.ts          |   6 +-
 ...ecutor-execution-policy-renamed-columns.test.ts |  19 +-
 .../__tests__/executor-graph-requeue-gate.test.ts  |  16 +-
 .../src/__tests__/executor-step-session.test.ts    |  20 +-
 .../__tests__/fix-steps-from-failed-gates.test.ts  |  66 ++++-
 .../__tests__/lifecycle-containment-resume.test.ts | 142 +++++++++
 .../__tests__/lifecycle-forbidden-paths.test.ts    | 319 +++++++++++++++++++++
 .../__tests__/lifecycle-move-legibility.test.ts    | 157 ++++++++++
 .../__tests__/lifecycle-move-reason-census.test.ts | 101 +++++++
 .../__tests__/merger-ai-renamed-columns.test.ts    |  28 +-
 packages/engine/src/__tests__/merger-ai.test.ts    |  22 +-
 .../merger-finalize-unproven.real-git.test.ts      |  26 +-
 .../auto-revive-and-watchdog.test.ts               |  10 +-
 .../merge-node-paused-abort-retryable.test.ts      |  14 +-
 .../worktree-incomplete-session-start.test.ts      |  13 +-
 .../engine/src/__tests__/replan-target.test.ts     |  48 +++-
 .../__tests__/restart-recovery-coordinator.test.ts |   9 +-
 .../__tests__/review-history-preservation.test.ts  |  32 ++-
 .../src/__tests__/reviewer-workspace.test.ts       |   6 +-
 .../src/__tests__/self-healing-trait-rekey.test.ts |  15 +-
 packages/engine/src/__tests__/self-healing.test.ts | 163 ++++++++++-
 .../verification-failure-named-remediation.test.ts |  54 ++--
 .../workflow-graph-optional-step-fix.test.ts       |  62 +++-
 .../workflow-merge-rebound-live-e2e.pg.test.ts     |   2 +-
 .../engine/src/__tests__/workspace-merger.test.ts  |   6 +-
 .../workspace-node-worktree-reuse.test.ts          | 188 ++++++++++++
 .../src/auto-recovery-handlers/branch-worktree.ts  |  28 +-
 .../src/auto-recovery-handlers/contamination.ts    |  30 +-
 .../engine/src/execution/lifecycle-move-log.ts     |  77 +++++
 packages/engine/src/execution/lifecycle-move.ts    |  63 ++++
 packages/engine/src/execution/replan-target.ts     |  51 +++-
 .../executor/append-review-remediation-steps.ts    |  72 ++++-
 ...block-outer-dispatch-when-ephemeral-disabled.ts |   1 +
 .../src/executor/bounce-verification-failure.ts    |  53 ++--
 .../engine/src/executor/completion-finalization.ts |   1 +
 .../engine/src/executor/create-task-done-tool.ts   |  29 +-
 .../src/executor/dependency-dispatch-gate.ts       |   1 +
 .../executor/ensure-graph-custom-node-worktree.ts  |  19 +-
 .../engine/src/executor/handle-graph-failure.ts    |   7 +-
 .../engine/src/executor/recover-completed-task.ts  |   4 +-
 .../request-pre-merge-optional-step-fix.ts         |  40 ++-
 .../src/executor/required-artifact-recovery.ts     |   7 +-
 .../src/executor/review-convergence-ladder.ts      |   5 +-
 .../route-graph-failure-to-execution-resume.ts     |  28 +-
 .../engine/src/executor/run-graph-custom-node.ts   |  30 +-
 packages/engine/src/executor/run-implementation.ts |   6 +-
 .../engine/src/executor/workflow-rerun-bounce.ts   |  54 ++--
 .../engine/src/executor/workflow-rerun-watchdog.ts |   6 +-
 .../src/healing/restart-recovery-coordinator.ts    |  30 +-
 packages/engine/src/merge/merger-ai.ts             |  66 +++--
 packages/engine/src/merger.ts                      |  46 +--
 .../__tests__/notification-service.test.ts         |  13 +-
 packages/engine/src/project-engine.ts              |   7 +-
 .../src/recovery/foreign-only-contamination.ts     |  30 +-
 packages/engine/src/scheduler.ts                   |   4 +-
 packages/engine/src/self-healing.ts                | 120 +++++---
 .../self-healing/auto-recover-worktree-session.ts  |  32 ++-
 .../engine/src/workflow-column-boundary-hooks.ts   |   1 +
 .../workflow-node-runners/parse-steps-runner.ts    |  10 +-
 scripts/lib/lifecycle-column-census-baseline.json  |   3 +-
 78 files changed, 2750 insertions(+), 474 deletions(-)

Fusion-Task-Id: FN-207

Fusion-Task-Lineage: a64a49f7-e06b-4b33-94c6-d43a4b027610

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-08-28 05:12:39 +00:00
..