From ac4c3b7a01cb4eaa0c4088ebf762bda9d609c1a0 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Sun, 28 Jun 2026 09:59:57 -0700 Subject: [PATCH] FN-7192: Document custom workflow capacity dispatch Clarify the custom workflow migration boundary and lock dispatch behavior with tests. - Document that pure-v1 custom workflows keep trait-less default columns for rollback compatibility. - Show the v2 hold(capacity) and wip traits required for custom workflow capacity dispatch. - Add core and engine regression coverage for pure-v1 stranding and authored-v2 release behavior. Files changed: docs/workflow-editor.md | 34 +++++ docs/workflow-steps.md | 40 ++++++ .../__tests__/custom-v1-workflow-dispatch.test.ts | 154 +++++++++++++++++++++ packages/engine/src/__tests__/hold-release.test.ts | 81 ++++++++++- 4 files changed, 306 insertions(+), 3 deletions(-) Fusion-Task-Id: FN-7192 Fusion-Task-Lineage: ff7af258-c0cb-4b81-8919-9e076c3ac1df Co-authored-by: Fusion (runfusion.ai) --- docs/workflow-editor.md | 34 ++++ docs/workflow-steps.md | 40 +++++ .../custom-v1-workflow-dispatch.test.ts | 154 ++++++++++++++++++ .../engine/src/__tests__/hold-release.test.ts | 81 ++++++++- 4 files changed, 306 insertions(+), 3 deletions(-) create mode 100644 packages/core/src/__tests__/custom-v1-workflow-dispatch.test.ts diff --git a/docs/workflow-editor.md b/docs/workflow-editor.md index d013ab6216..3912438b2c 100644 --- a/docs/workflow-editor.md +++ b/docs/workflow-editor.md @@ -74,6 +74,40 @@ The editor prevents ordinary cycles while connecting nodes. If a graph branches The **Columns** panel edits workflow-defined swimlanes. A column has an id, name, ordered position, and composable traits. The panel can add, rename, reorder, and remove columns for custom workflows; built-ins show the same data read-only. + + +For task dispatch, the queue column that holds ready work must carry a `hold` trait with `release: "capacity"`, and the downstream active column must carry a `wip` trait. Pure-v1 custom graphs still upgrade to the legacy default column ids with empty trait sets for rollback compatibility, so a task selecting that workflow can remain in `todo` until the workflow is migrated to v2 columns. When authoring or migrating a custom coding workflow, mirror this minimum shape: + +```json +{ + "version": "v2", + "columns": [ + { + "id": "todo", + "name": "todo", + "traits": [ + { "trait": "hold", "config": { "release": "capacity" } }, + { "trait": "reset-on-entry" } + ] + }, + { + "id": "in-progress", + "name": "in-progress", + "traits": [ + { "trait": "wip", "config": { "limit": "settings.maxConcurrent" } }, + { "trait": "abort-on-exit" }, + { "trait": "timing" } + ] + } + ] +} +``` + +Copying a selectable built-in workflow is the easiest way to inherit the full canonical trait set (`todo`, `in-progress`, `in-review`, `done`, `archived`) before customizing nodes or prompts. + When column-agent support is enabled by the required experimental features, a column can also assign a permanent agent with one of two modes: - **defer:** use the column agent only when the work has no more specific agent/model setting. diff --git a/docs/workflow-steps.md b/docs/workflow-steps.md index a7a0c11a02..d08e5295eb 100644 --- a/docs/workflow-steps.md +++ b/docs/workflow-steps.md @@ -69,6 +69,46 @@ Skill-backed prompt/gate nodes run through the same workflow-step session builde Use the dashboard [Workflow Editor](./workflow-editor.md) to inspect built-ins, tune built-in prompts, duplicate workflows, or author custom workflows. Custom workflows can declare graph nodes and edges, columns/traits, task fields, typed workflow settings, model lanes, optional workflow-step templates, and author-time validation. Use this page for runtime semantics; use the editor guide for the visual authoring surface. + + +#### Capacity dispatch for custom workflows + +After the workflow-columns cutover, the only automatic queued-work dispatcher is the engine's hold/release sweep. It releases a task from `todo` only when that column resolves as a `hold` column and its hold config uses `release: "capacity"`; it then moves the card to the nearest downstream `wip` column with available capacity. + +Pure-v1 custom workflow definitions (`start` / `prompt` / `script` / `gate` / `end` nodes with default columns) still parse and upgrade by synthesizing the legacy column ids with empty trait sets. That shape is intentional for FN-5769 / issue #1405 rollback compatibility: it can be downgraded back to v1 for older binaries. The tradeoff is that a pure-v1 custom workflow's `todo` column is not a hold column, so tasks can sit in `todo` instead of dispatching to `in-progress`. + +For capacity-dispatched custom workflows, author or migrate the workflow as IR v2 and give `todo` and `in-progress` the canonical dispatch traits (the same minimum used by the built-in coding workflow): + +```json +{ + "version": "v2", + "columns": [ + { + "id": "todo", + "name": "todo", + "traits": [ + { "trait": "hold", "config": { "release": "capacity" } }, + { "trait": "reset-on-entry" } + ] + }, + { + "id": "in-progress", + "name": "in-progress", + "traits": [ + { "trait": "wip", "config": { "limit": "settings.maxConcurrent" } }, + { "trait": "abort-on-exit" }, + { "trait": "timing" } + ] + } + ] +} +``` + +If you need the full lifecycle behavior, duplicate `builtin:coding` (or another selectable built-in) and edit the copy so `in-review`, `done`, and `archived` keep their merge/review/completion traits. FN-7190 keeps selectable built-ins on canonical traits; FN-7192 documents and tests the custom-v1 migration boundary. + ### Workflow graph integrity validation