FN-7556: auto-select review-heavy workflow for AI-undo tasks
AI-undo tasks now default to a configurable, stricter review workflow instead of always inheriting the project default.
- Add project setting `aiUndoTaskWorkflowId` (default `builtin:review-heavy`) to ProjectSettings type and DEFAULT_PROJECT_SETTINGS
- `POST /api/tasks/:id/revert` resolves and validates the configured workflow id (via `isBuiltinWorkflowId`/`getWorkflowDefinition`), falling back to inherit-with-warning on a blank/unknown value
- `createAiUndoTask` engine helper gains an optional `workflowId` param, forwarded verbatim to `createTask` only when non-blank, staying pure (no settings/store access itself)
- Add regression tests for the route resolution logic and the engine helper's workflow forwarding
- Update docs (`settings-reference.md`, `task-management.md`) and add changeset
Files changed:
.changeset/fn-7556-ai-undo-workflow.md | 7 +++
docs/settings-reference.md | 1 +
docs/task-management.md | 1 +
packages/core/src/settings-schema.ts | 4 ++
packages/core/src/types.ts | 14 +++++
.../settings-default-descriptions.test.tsx | 2 +
.../src/__tests__/task-revert-route.test.ts | 52 ++++++++++++++++-
.../src/routes/register-task-workflow-routes.ts | 31 +++++++++-
.../src/__tests__/task-revert-ai-undo.test.ts | 67 ++++++++++++++++++++++
packages/engine/src/task-revert.ts | 16 ++++++
10 files changed, 192 insertions(+), 3 deletions(-)
Fusion-Task-Id: FN-7556
Fusion-Task-Lineage: dec5603c-10a8-4780-a1b8-8a836a0de4c1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>