Commit Graph

50 Commits

Author SHA1 Message Date
gsxdsm
61cbc5c3db FN-6058: improve mobile workflow node editor layout
Make the mobile workflow editor easier to use by collapsing competing panels and updating coverage.

- add a mobile inspector toggle that collapses node details and re-expands on node selection
- default the templates palette to collapsed on mobile and tighten mobile toolbar/layout styling to avoid overlap
- remove the stale workflow-id preselection path from the editor and align workflow edge/mobile regression coverage
- drop the unused modal prop wiring so the editor API matches the merged implementation

Files changed:
 packages/dashboard/app/components/AppModals.tsx    |   1 -
 .../app/components/WorkflowNodeEditor.css          |  61 +++++++++
 .../app/components/WorkflowNodeEditor.tsx          |  63 +++++++---
 .../__tests__/WorkflowNodeEditor.css.test.ts       |  21 ++++
 .../__tests__/WorkflowNodeEditor.test.tsx          | 139 +++++++++++----------
 5 files changed, 200 insertions(+), 85 deletions(-)

Fusion-Task-Id: FN-6058

Fusion-Task-Lineage: d037832f-8bd8-4e3d-b31b-e30cd9752838
2026-06-09 01:14:59 -07:00
gsxdsm
53f3638b12 FN-6037: open selected workflow editor on mobile
Open the board workflow editor directly to the selected workflow, including on mobile.

- pass the selected workflow id from the board toolbar through app modal state into the workflow editor
- preselect the requested workflow when loading workflows, while preserving settings/create entry points and mobile fallback behavior
- cover the new workflow targeting behavior in board, modal manager, and workflow editor tests and document the mobile editor flow

Files changed:
 docs/dashboard-guide.md                            |  3 +-
 packages/dashboard/app/App.tsx                     |  4 +-
 packages/dashboard/app/components/AppModals.tsx    |  1 +
 packages/dashboard/app/components/Board.tsx        |  6 +-
 packages/dashboard/app/components/WorkflowNodeEditor.tsx          | 13 ++++-
 packages/dashboard/app/components/__tests__/Board.test.tsx        |  4 ++
 packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx | 68 ++++++++++++++++++++++
 packages/dashboard/app/hooks/__tests__/useModalManager.test.ts    | 42 +++++++++++++
 packages/dashboard/app/hooks/useModalManager.ts    | 16 +++--

Fusion-Task-Id: FN-6037

Fusion-Task-Lineage: e983e699-5376-434f-af03-39ce5a300029
2026-06-09 00:27:51 -07:00
gsxdsm
5976b63fda FN-6033: fix mobile workflow editor selection and touch targets
Keep the workflow editor mobile-first selection flow usable and improve tap targets on phones.

- start the mobile workflow editor on the workflow list with no preselected workflow and show a select-a-workflow prompt
- keep mobile list/editor stage transitions in sync after create, duplicate, import, and delete actions
- increase workflow editor mobile touch targets and padding without changing desktop sizing
- add regression coverage for mobile viewport selection behavior and CSS touch-target scoping
- update the dashboard guide to document the mobile workflow editor behavior

Files changed:
docs/dashboard-guide.md                            |  2 +-
packages/dashboard/app/components/WorkflowNodeEditor.css          | 56 +++++++++++++++++-
packages/dashboard/app/components/WorkflowNodeEditor.tsx          | 24 ++++++--
packages/dashboard/app/components/__tests__/WorkflowNodeEditor.css.test.ts       | 36 ++++++++++++
packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx          | 68 ++++++++++++++++++++++

Fusion-Task-Id: FN-6033

Fusion-Task-Lineage: c9da29ef-c099-4e14-8671-24995106c78c
2026-06-08 13:32:58 -07:00
gsxdsm
c9b780217b Merge pull request #1508 from Runfusion/feature/workflow-loop-nodes
Add bounded workflow loop nodes
2026-06-08 00:33:25 -07:00
gsxdsm
75867c4002 fix(FN-0000): address workflow loop review feedback 2026-06-08 00:19:50 -07:00
gsxdsm
a504238d26 feat(FN-0000): add workflow loop nodes 2026-06-07 23:56:25 -07:00
gsxdsm
e138971030 fix: stabilize workflow board and loop recovery 2026-06-07 23:30:16 -07:00
gsxdsm
312bec674d FN-5990: start workflow editor viewport at top-left
Ensure the workflow node editor opens at the origin instead of auto-fitting away from the top-left.

- replace React Flow's fitView startup behavior with an explicit default viewport at x=0, y=0, zoom=1
- add a regression test that asserts the initial viewport transform starts at the top-left with scale 1

Files changed:
 packages/dashboard/app/components/WorkflowNodeEditor.tsx |  2 +-
 .../app/components/__tests__/WorkflowNodeEditor.test.tsx | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5990

Fusion-Task-Lineage: 682ca8f8-a698-4234-a2d6-31c8efa657db
2026-06-07 20:27:56 -07:00
gsxdsm
d521661862 fix(node-editor): auto-layout on load + viewport to top-left
Run auto-layout automatically when a workflow is loaded so nodes are
tidily positioned instead of scattered at persisted positions. Position
the viewport at (0,0) with zoom 1 so the laid-out nodes are visible in
the top-left corner.

- workflow-auto-layout.ts: change ORIGIN_X/Y from 40 to 0
- WorkflowNodeEditor.tsx: apply autoLayout on load, setViewport to top-left
- WorkflowNodeEditor.test.tsx: update test to verify layout runs on load
2026-06-06 00:56:12 -07:00
gsxdsm
1f68348441 merge: main (CLI agent interface #1446) — renumber workflow_settings migration to 112 behind main's cli_sessions(110)/adapter(111), full-workspace literal sweep, i18n union 2026-06-05 16:18:39 -07:00
gsxdsm
693ed6290a Merge remote-tracking branch 'origin/main' into gsxdsm/cli-agent-interface
# Conflicts:
#	CONCEPTS.md
#	packages/core/src/__tests__/db-migrate.test.ts
#	packages/core/src/__tests__/db.test.ts
#	packages/core/src/__tests__/goals-schema.test.ts
#	packages/core/src/__tests__/insight-store.test.ts
#	packages/core/src/__tests__/merge-request-record.test.ts
#	packages/core/src/__tests__/mission-store.test.ts
#	packages/core/src/__tests__/run-audit.test.ts
#	packages/core/src/__tests__/store-merge-queue.test.ts
#	packages/core/src/__tests__/task-documents.test.ts
#	packages/core/src/db.ts
#	packages/dashboard/src/__tests__/agent-onboarding.test.ts
#	packages/dashboard/src/__tests__/ai-refine.test.ts
#	packages/dashboard/src/__tests__/chat-attachment-routes.test.ts
#	packages/dashboard/src/__tests__/experiment-routes.finalize.test.ts
#	packages/dashboard/src/__tests__/milestone-slice-interview.test.ts
#	packages/dashboard/src/__tests__/mission-interview.test.ts
#	packages/dashboard/src/__tests__/pr-metadata-generator.test.ts
#	packages/dashboard/src/__tests__/project-pause-resume-routes.test.ts
#	packages/dashboard/src/__tests__/routes-approval-sandbox-provisioning.test.ts
#	packages/dashboard/src/__tests__/routes-approval-secrets.test.ts
#	packages/dashboard/src/__tests__/routes-approval.test.ts
#	packages/dashboard/src/__tests__/routes-worktrunk.test.ts
#	packages/dashboard/src/__tests__/session-error-recovery.test.ts
#	packages/dashboard/src/__tests__/session-persistence-roundtrip.test.ts
#	packages/dashboard/src/__tests__/session-reconnect.test.ts
#	packages/dashboard/src/__tests__/session-resume-history.test.ts
#	packages/dashboard/src/__tests__/setup-routes.test.ts
#	packages/dashboard/src/__tests__/subtask-breakdown.test.ts
#	packages/dashboard/src/routes/__tests__/agent-avatar-routes.test.ts
#	packages/dashboard/src/routes/__tests__/custom-providers.test.ts
#	packages/dashboard/src/routes/__tests__/docker-node-routes.test.ts
#	packages/i18n/locales/en/app.json
#	plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts
2026-06-05 15:30:59 -07:00
gsxdsm
6d16c07197 merge: main (editor consolidation #1433, fast-tests, learnings) — renumber workflow_settings migration to 110, settings panel joins the sidebar disclosures, full-workspace literal sweep 2026-06-05 15:23:15 -07:00
gsxdsm
11fb9f1325 merge main: per-column agent assignment (binding validation, policy-escalation handshake, override notes) into workflow editor consolidation
Resolved 4 conflicts preserving both feature sets:
- WorkflowNodeEditor.tsx: kept card-node/edge/dialog/dirty-guard/auto-layout/
  onboarding/template/AI-edit features; wired main's columnAgentsEnabled flag
  gate, override-column agent registry load, and policy-escalation save retry
  (finishSave helper wraps both update payloads).
- WorkflowNodeEditor.test.tsx: kept U2/U4/AI-design describes plus main's U6
  column-agent describe; merged api mock + import lists.
- register-workflow-routes.ts: merged import sets (design DI seam + column-agent
  validators).
- agent-tools.ts: strip-approval-flags and column-agent binding assertion now
  both run in create/update tools.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:43:02 -07:00
gsxdsm
b7fa21c25e merge: main (column-agent assignment #1432) into workflow-settings — union executor/agent-tools/routes imports, both tool-description texts, both route helpers 2026-06-05 14:41:43 -07:00
gsxdsm
60f1b7fa39 Merge remote-tracking branch 'origin/main' into gsxdsm/cli-agent-interface
# Conflicts:
#	packages/dashboard/app/components/__tests__/ListView.test.tsx
2026-06-05 14:36:42 -07:00
gsxdsm
59364e7c58 Address PR review feedback round 2 (#1432)
- R10 kill-switch: workflowColumns flag now gates the execution path (resolver
  installation + resume pass 2), making the documented rollback real
- resolver: skip parse candidates whose templateNodeId doesn't exist under the
  foreach (disambiguation guard)
- editor: reset the project-scoped agents cache on projectId change
- tests: kill-switch inertness, defer→own-settings release, candidate skip
2026-06-05 13:59:50 -07:00
gsxdsm
563cb5b372 Address PR review feedback (#1433)
- always dispose AI design session (try/finally) + rejecting-agent test
- prune expired design rate-limit entries per check
- apply workflowId precedence in createTaskWithReservedId
- compare-and-set migrated project default (no pre-transaction snapshot)
- reject fragment ids in setDefaultWorkflowId at the write boundary
- guard stripApprovalBypassFlags against malformed template nodes
- hoist duplicate stepToFragmentIr call in migration loop
- auto-layout preserves unplaced nodes (strictColumnForY)
- second same-pair connection births a failure edge for condition-capable sources
- insertFragment expands foreach templates into child nodes (lossless round-trip)
- copyIrWithFreshIds remaps namespaced foreach child layout keys
- discard stale AI-edit results after workflow switch
- i18n: returnEmptyString:false so empty locale placeholders fall back to en
- test fixes: schema-version titles, migrate idempotency assertion, TaskForm post-resolve + cross-mode regression, deterministic waits
2026-06-05 13:56:05 -07:00
gsxdsm
2a0223472e Address PR review feedback (#1432)
- delimiter-safe foreach instance-id resolution via IR-validated candidates
- restart watcher handles binding removal/defer-flip and re-keys the reverse
  heartbeat guard on agent change/delete
- governing-node stamp owned by the pass-initiating foreach instance (race fix)
- editor: policy-escalation confirm/retry handshake on save; foreach children
  inherit the override note; project-scoped agent fetches; picker disabled on
  registry fetch error; column-agent strings in the canonical i18n catalog
- tests: update-tool escalation surface, PATCH escalation route, parity bound
  to run-derived stages, try/finally cleanup, deterministic event waits,
  symmetric defer surfaces, binding-release regression
2026-06-05 09:29:04 -07:00
gsxdsm
6c9a81a05f fix(review): apply autofix feedback 2026-06-05 01:53:42 -07:00
gsxdsm
b04c11aae4 feat(dashboard): move columns and fields panels into the editor sidebar 2026-06-05 00:36:51 -07:00
gsxdsm
62c820bf99 feat(dashboard): design-with-AI affordances in the workflow editor 2026-06-05 00:32:38 -07:00
gsxdsm
243113a3cf feat: cli-agent adapter settings, autonomy approval gate, and node editor config (U15)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:30:27 -07:00
gsxdsm
0c0387264f feat(dashboard): palette templates section with fragments and step templates 2026-06-05 00:20:12 -07:00
gsxdsm
91284f516d feat(dashboard): template picker on workflow creation 2026-06-05 00:06:06 -07:00
gsxdsm
75ebe23b4f feat(dashboard): column agent picker, override visibility, write-time validation
U6: WorkflowColumnPanel agent picker + defer/override toggle with specified
interaction states (flags-off hint, loading, fetch-error, stale-agent
warning, bound-column badge); WorkflowNodeEditor overridden-by-column-agent
note + stale-id treatment; assertColumnAgentsExist + confirmPolicyEscalation
gate (R13) on workflow save routes; flowToIr now preserves column agent
bindings through the editor round-trip.
2026-06-04 23:53:22 -07:00
gsxdsm
407ce03bf2 feat(dashboard): workflow and template JSON import/export with trust-boundary stripping 2026-06-04 23:16:46 -07:00
gsxdsm
9089e18705 feat(dashboard): WorkflowSettingsPanel — definitions/values tabs, setting-value routes, flow-mapping round-trip 2026-06-04 22:57:01 -07:00
gsxdsm
d8ff8db759 feat(core,dashboard): lazy idempotent legacy-step migration into workflow templates 2026-06-04 22:33:25 -07:00
gsxdsm
7e239e257f feat(dashboard): workflow editor onboarding and empty states 2026-06-04 21:13:13 -07:00
gsxdsm
d382d51c75 feat(dashboard): one-click auto-layout respecting column bands 2026-06-04 21:00:52 -07:00
gsxdsm
5a499ea212 feat(dashboard): workflow editor dialogs, inline rename, and dirty-state guard 2026-06-04 20:51:24 -07:00
gsxdsm
f67a2542b9 feat(dashboard): node/edge deletion with safe cascade semantics 2026-06-04 19:45:44 -07:00
gsxdsm
ffc4d8a6ed feat(dashboard): success/failure edge authoring with cycle guard and interpreter-only banner 2026-06-04 19:35:34 -07:00
gsxdsm
297a00d3de feat(dashboard): redesign workflow nodes as card-style with config summaries 2026-06-04 19:26:55 -07:00
gsxdsm
6f7f6860be fix: address PR review feedback (#1424)
- restore customFields on unarchive; reconcile all occupants on field-schema edits (store.ts)
- serialize per-field saves + controlled inputs in TaskFieldsSection (race fixes)
- fn_workflow_get includes layout; Array.isArray guards in validateCodeNodeSources
- per-instance graphStepActiveContext keying; rebase in instance worktree; clear run-once memo on RETHINK
- GET /api/step-parsers + registry-backed parser select (plugin parsers reachable from editor)
- translate new workflowNodes/workflowFields strings across all 5 non-en locales

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 16:16:50 -07:00
gsxdsm
3ebaa321f8 fix(review): apply code-review fixes — runId/foreachNodeId wiring, worktree-leak cleanup, rework re-execution, instance pruning, SIGKILL fallback, type dedup, board memo split, agent-native field-schema context + fn_workflow_get
17 findings from 12-reviewer code review applied:
- P1 runId trio (pin-probe/resume/markIntegrated used placeholder runId; 4-reviewer corroboration) + production-wiring tests
- P1 worktree/branch release on instance failure/exhaustion/abort
- P2 runGraphTaskStep no longer masks step-session failures; rejected memo cleared so rework re-executes
- P2 clearStaleInstanceStates wired at run start/end (mirrors branch pruning)
- P2 code-node timeout killSignal SIGKILL; dead template-recursion removed
- P1/P2 field-type re-declarations replaced with @fusion/core imports (stale comments removed)
- P2 Board memo split + TaskCard comparator stringify guard + modal prop-driven field defs
- HIGH agent-native: executor prompt injects custom-field schema/values; self-correcting rejection text; fn_workflow_get; fn_task_update bare-call guard; integration-conflict task log

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:01:55 -07:00
gsxdsm
e87e745379 feat(dashboard): WorkflowFieldsPanel — field-definition authoring with live badge preview (U13 completion)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:44:43 -07:00
gsxdsm
ad5cd579be feat(dashboard): U8 — node editor authoring for foreach/step-review/parse-steps/code, rework edge inspector, template round-trip
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:50:45 -07:00
gsxdsm
30e2fd7b09 fix(review): apply autofix feedback 2026-06-04 02:50:54 -07:00
gsxdsm
e5a0a199ea feat(dashboard): node editor authors columns, traits, hold and split/join nodes with inline validation (U10) 2026-06-04 01:46:51 -07:00
gsxdsm
68c6702add Fix invisible workflow graph editor and bundle CE/Roadmap plugins
- WorkflowNodeEditor overlay was missing the `open` class, so the
  graph editor mounted with display:none — clicking the button just
  dismissed the steps view. Add `open` so the overlay renders.
- Add fusion-plugin-compound-engineering and fusion-plugin-roadmap to
  BUILTIN_PLUGINS so they show under Settings → Built-in Plugins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 23:25:32 -07:00
gsxdsm
d5397d3f69 fix(dashboard): inline isBuiltinWorkflowId — unbreak the app build
The dashboard app build aliases "@fusion/core" to its types-only entry
(core/src/types.ts), which doesn't re-export builtin-workflows, so the Vite/
Rollup bundle failed on `import { isBuiltinWorkflowId } from "@fusion/core"`
(tsc/vitest resolve it via source/dist, so they passed — only the production
build caught it). Inline the one-line "builtin:" prefix check in the editor
instead of pulling the eager BUILTIN_WORKFLOWS construction into the browser
bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:59:29 -07:00
gsxdsm
eb67d08213 Address PR review feedback (#1363)
Greptile + CodeRabbit findings across core/engine/dashboard. Stale findings
(written against earlier commits) verified and skipped; valid ones fixed.

Engine:
- await-input: do not clear pausedReason in the /input route (the node's
  marker must survive unpause); the node clears it after consuming input.
  Embed a colon-free epoch watermark in the marker so only post-pause steering
  comments count as the reply (ISO timestamps collided with the colon
  separator and the dashboard question parser).
- gate nodes without a registered runner now fail closed (throw) instead of
  silently passing.
- a thrown interpreter error in maybeExecuteWorkflowGraph now falls back to the
  legacy pipeline instead of stranding the task in-progress.
- approved-CLI path clears the stale awaiting-cli-approval status/marker.

Core:
- persist+cascade workflow selection: purge task_workflow_selection rows and
  compiled workflow_steps on physical task deletes; migration 105 cleans
  already-orphaned rows; catch-cleanup for materialized steps when the owner
  write fails; WF-id allocation now in a BEGIN IMMEDIATE transaction.
- compiler validates the canonical execute->review->merge seam order (rejects
  duplicate/misordered seams).
- disk-backed reopen round-trip + tightened updatedAt/list assertions.

Dashboard:
- WorkflowSelector clears stale default/options across project changes and on
  fetch failure; InlineCreateCard/NewTaskModal reset the workflow on all
  clear/discard paths and include it in dirty-state.
- WorkflowNodeEditor: config-key deletion now persists; removed an invalid
  eslint-disable that was itself a hard lint error.
- TaskCard: single status badge for awaiting-input (no duplicate).
- WorkflowResultsTab: reset paused-action UI between pauses; surface
  resume/approve failures inline.
- TaskDetailModal: treat awaiting-user-input/awaiting-cli-approval/paused as
  not-in-progress for the live-log subscription.
- workflow-flow-mapping: don't write synthetic node names back into IR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:32:12 -07:00
gsxdsm
291072446d feat(workflows): enforce node autoApprove by bypassing the CLI approval pause
The node "Auto-approve requests" toggle was captured but unused. The only
human-approval pause reachable from a custom node is the CLI first-run
trust-on-first-use gate (review-style nodes run as ephemeral readonly agents
with no permission gate), so autoApprove now bypasses that pause — a superset
of the CLI-specific cliSkipApproval flag. The inspector explains the effect
when the toggle is on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 15:26:29 -07:00
gsxdsm
bd8f0fd23c feat(dashboard): make built-in workflows read-only in the node editor
Built-in (builtin:*) workflows are read-only at the store layer; reflect
that in the editor so users aren't misled into editing changes that can't
save. For a built-in: the node palette is disabled, the inspector fields are
wrapped in a disabled fieldset, Save/Delete are replaced by a "Read-only
built-in" label, and a "Duplicate to edit" action clones it into an editable
user workflow. handleSave/handleDeleteWorkflow also early-return for built-ins
as defense-in-depth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 15:19:27 -07:00
gsxdsm
a98d14c252 feat: per-node option to skip CLI first-run approval
A CLI node can set cliSkipApproval to bypass the trust-on-first-use pause and
run its command immediately. Exposed as a checkbox in the node inspector.
2026-06-03 13:52:42 -07:00
gsxdsm
d6763e589c feat(dashboard): CLI command field + interactive input/approval banner
Node inspector: CLI executor toggles between a raw command textarea and a named
script. Task modal workflow tab: the await-input banner is now interactive
(reply textarea + Submit & resume), and a new awaiting-cli-approval banner shows
the pending command with an Approve & run action.
2026-06-03 13:48:28 -07:00
gsxdsm
5a318bfe57 feat(dashboard): execution profiles + await-input UI for workflow nodes
Inspector for prompt nodes: executor picker (model via CustomModelDropdown,
agent, skill from discovered skills, CLI named script), auto-approve toggle,
per-node max retries, and a wait-for-user-input mode with a User input palette
preset. Task card shows a 'Needs input' badge for awaiting-user-input status;
the task modal workflow tab shows the node's question as a banner.
2026-06-03 13:34:05 -07:00
gsxdsm
8dca36b56f fix(core,dashboard): code-review fixes for workflow selection
- selectTaskWorkflow: compile once, materialize the new steps and repoint the
  task before deleting prior rows, so a mid-flight failure never leaves the
  task referencing deleted step ids
- createTaskWithReservedId: inherit the project default workflow like
  createTask (imports/reserved-id creations were skipping it)
- setDefaultWorkflowId: use null (updateSettings' delete sentinel) to clear
- parseWorkflowLayout: reject JSON arrays
- editor inspector: gate-mode default display now matches the compiler
  (script/gate block by default, prompt is advisory)
2026-06-03 09:59:00 -07:00
gsxdsm
d071aecda6 feat(dashboard): visual graph node editor for workflows (U6, U7)
Add a React Flow (@xyflow/react) based WorkflowNodeEditor: a lazy-loaded modal
with a workflow list, a node palette (prompt/script/gate/merge-boundary),
drag-to-connect edges, a per-node inspector, and save with compile-validation
that surfaces non-linear graphs as a banner. Pure irToFlow/flowToIr mapping
round-trips the v1 IR plus editor layout. Reachable via a Graph editor button in
the Workflow Steps manager; mounted in AppModals behind a new modal-manager
flag. Adds a vendor-reactflow Vite chunk and a feature changeset.
2026-06-03 09:45:26 -07:00