From 6a9e1c0e71e3031756980d4104269612f5c84cf5 Mon Sep 17 00:00:00 2001 From: Fusion Date: Thu, 14 May 2026 04:53:48 -0700 Subject: [PATCH] =?UTF-8?q?feat(FN-4086):=20complete=20Step=205=20?= =?UTF-8?q?=E2=80=94=20docs=20and=20changeset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fusion-Task-Id: FN-4086 Fusion-Task-Lineage: b2338fbc-960c-4540-9c19-216462525f0c --- .changeset/fn-4086-auto-promote-completed-todo.md | 8 ++++++++ docs/task-management.md | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .changeset/fn-4086-auto-promote-completed-todo.md diff --git a/.changeset/fn-4086-auto-promote-completed-todo.md b/.changeset/fn-4086-auto-promote-completed-todo.md new file mode 100644 index 000000000..5e79deb12 --- /dev/null +++ b/.changeset/fn-4086-auto-promote-completed-todo.md @@ -0,0 +1,8 @@ +--- +"@runfusion/fusion": patch +--- + +Self-healing now auto-promotes tasks with all steps completed out of the `todo` +column to `in-review` (or `done` for Review Level 0 tasks), preventing finished +work from being stranded after stuck-task timeouts, ghost-review bounces, or +merge-failure re-queues. diff --git a/docs/task-management.md b/docs/task-management.md index 5ba576a9a..32a981e3c 100644 --- a/docs/task-management.md +++ b/docs/task-management.md @@ -100,6 +100,16 @@ Fusion task columns: - Repeated engine merge-queue drops now escalate to an explicit recoverable review failure: if auto-recovery hits `Auto-merge starvation:` in the task `error`, Fusion has already seen three consecutive enqueue attempts rejected by the engine merge queue. Operators can recover by clearing the failed state from the dashboard, which lets the usual unpause/clear flow re-attempt merge once the underlying queue wedge is resolved. - Non-recoverable state-machine errors during finalization (for example `Invalid transition: 'todo' → 'done'`) are treated as terminal review failures: recovery must not re-enqueue these tasks for merge unless task state changes prove they are recoverable. +#### Self-healing: stranded-completed-todo recovery + +Fusion now enforces a recovery invariant for completed work that is accidentally returned to `todo`: + +- `todo` tasks with all steps terminal (`done`/`skipped`), no active execution, and no unrecoverable error are auto-promoted by self-healing. +- Promotion always respects the transition table (`todo → in-progress → in-review`) via `TaskStore.moveTask()`; no direct `todo → in-review` mutation is used. +- Review Level `0` tasks are finalized to `done` by the existing no-op review finalization flow after promotion to `in-review`; Review Level `>0` tasks remain in `in-review` for normal review/merge handling. + +This is a forward-safety guard for stranded completed tasks. See FN-4055/FN-4079 for deeper lifecycle root-cause and operational repair work. + #### In-review stall signal Fusion now derives `task.inReviewStall` for non-paused `in-review` tasks when a known stuck-state shape is detected. This signal is state-based (not log-heuristic) and is computed server-side on task hydration.