Commit Graph

3768 Commits

Author SHA1 Message Date
gsxdsm
7745c59e63 FN-8880: align shared-member recovery consent tests
Align recovery expectations with the shared-member consent policy.

- Hold non-opted-in shared members when project auto-merge is off.
- Cover explicit per-task auto-merge opt-in during startup and self-healing recovery.
- Document the project-off consent rule for branch-group members.

Files changed:
 AGENTS.md                                          |  2 +-
 docs/architecture.md                               |  4 +-
 packages/engine/src/__tests__/project-engine.test.ts    | 41 +++++++++++------
 packages/engine/src/__tests__/self-healing.test.ts | 51 +++++++++++++++++++---
 4 files changed, 75 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-8880

Fusion-Task-Lineage: 3118064d-59ca-4c2e-89a8-442ee8876cf8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:41:02 -07:00
gsxdsm
7c4b29f642 FN-8895: harden group merge coordinator store fakes
Ensure group-merge coordinator tests exercise the production store seams without warning suppression.

- Provide scoped settings and branch-group task fake methods used by promotion evaluation
- Await promotion evaluation and fail the fixture on missing-store-method warnings
- Assert branch-group task lookup is reached during the merge drain

Files changed:
 packages/engine/src/__tests__/group-merge-coordinator.test.ts | 59 ++++++++++++++++++----
 1 file changed, 49 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-8895

Fusion-Task-Lineage: 99748c07-2083-41f9-b776-da644bf1857a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:28:33 -07:00
gsxdsm
4cb7bea967 FN-8882: add merge-lane fixture drift test
Prevent unseeded ProjectEngine merge-lane fields from causing prototype fake TypeErrors.

- Inspect the auto-merge state block for declared fields
- Require fixture defaults or documented drain-path exclusions for each field

Files changed:
 ...project-engine-merge-lane-fixture-drift.test.ts | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)

Fusion-Task-Id: FN-8882

Fusion-Task-Lineage: c5cb270d-d988-43e7-a554-7f9bc8770c5c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 01:40:34 -07:00
gsxdsm
9c43736794 FN-8870: add structural approval and report mail
Add typed report and approval metadata to the mailbox contract.

- Define and validate structural mail kinds, report sections, and approval references.
- Let agents send validated reports while reserving approval mail for engine emission.
- Emit idempotent, fail-soft approval notifications and document the contract.

Files changed:
 .changeset/fn-8870-structural-mail-contract.md     |   7 ++
 docs/agents.md                                     |   2 +
 docs/architecture.md                               |   4 +
 .../message-metadata-structural-mail.test.ts       |  25 ++++
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/types.ts                         |  30 +++++
 packages/core/src/types/messaging/messages.ts      |  21 ++++
 ...gent-tools-send-message-structural-mail.test.ts |  34 +++++
 .../src/__tests__/approval-mail-emission.test.ts   | 137 +++++++++++++++++++++
 packages/engine/src/agent-heartbeat.ts             |   3 +
 packages/engine/src/agent-tools.ts                 |  28 ++++-
 packages/engine/src/agents/approval-mail.ts        |  40 ++++++
 packages/engine/src/executor.ts                    |   3 +
 14 files changed, 334 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8870

Fusion-Task-Lineage: 7d30b2f9-c004-4975-86b1-9600e2c8d76f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 00:41:18 -07:00
gsxdsm
0e8d743064 FN-8867: prevent false task wedge notifications
Prevent stale terminal snapshots and pause markers from notifying for progressing tasks.

- Reclassify the live task immediately before claiming wedge episodes.
- Require actual pause state for pause-derived wedge reasons.
- Cover resumed-task races and stale pause markers with notification tests.
- Document the wedge notification behavior and add a patch changeset.

Files changed:
 .changeset/fn-8867-wedge-false-terminal-alerts.md  |   7 ++
 docs/agents.md                                     |   2 +-
 docs/architecture.md                               |   2 +-
 .../__tests__/notification-service.test.ts         |   9 +-
 .../__tests__/task-wedge-notification.test.ts      | 102 +++++++++++++++++++--
 .../src/notification/notification-service.ts       |  22 +++--
 .../src/notification/task-wedge-notification.ts    |  22 ++++-
 7 files changed, 137 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-8867

Fusion-Task-Lineage: c92c7735-e8b9-4979-8028-10a0555810f1

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 00:01:44 -07:00
gsxdsm
0a2fe913c6 FN-8863: fix standalone pre-merge remediation holds
Allow standalone tasks to recover from failed pre-merge steps when project auto-merge is disabled.

- Add a remediation-specific auto-merge hold for shared members and explicit user holds.
- Restore Plan Review replans and Code Review fix handoffs for standalone tasks.
- Cover hold behavior and document the operator-consent policy.

Files changed:
 .changeset/fn-8863-remediation-auto-merge-hold.md  |   7 ++
 docs/dashboard-guide.md                            |   2 +-
 packages/core/src/__tests__/task-merge.test.ts     |  38 ++++++++
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/merge/task-merge.ts              |  18 ++++
 ...cutor-live-branch-group-auto-merge-hold.test.ts |  27 ++++++
 .../workflow-graph-optional-step-fix.test.ts       | 106 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  16 +++-
 9 files changed, 212 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8863

Fusion-Task-Lineage: 930bf37a-3173-4a3b-84ca-575f7f5d94b9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 23:34:41 -07:00
gsxdsm
8ee6eff9cd FN-8871: seed complete merge-lane state in coordinator tests
Ensure group-merge coordinator fakes initialize production merge-lane state.

- Add a reusable fixture for ProjectEngine merge-lane fields.
- Use the fixture in the group-merge routing integration test.
- Include capacity and PR-retry state required by the production drain.

Files changed:
 .../_project-engine-merge-lane-fixture.ts          | 62 ++++++++++++++++++++++
 .../src/__tests__/group-merge-coordinator.test.ts  | 15 +++---
 2 files changed, 69 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-8871

Fusion-Task-Lineage: 9bde0439-fa88-481b-a7f3-9feb7e663883

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 23:24:23 -07:00
gsxdsm
75796ebe6f FN-8850: capture task completion recommendations
Capture bounded, task-ready executor follow-ups at accepted completion.

- Guide executor prompts to submit recommendations or an explicit empty list at completion.
- Enforce default and disabled recommendation caps in completion handling.
- Document recommendation behavior and cover prompt and validation contracts.

Files changed:
 .../fn-8850-populate-task-recommendations.md       |  7 +++
 docs/dashboard-guide.md                            |  2 +-
 packages/core/src/agents/agent-prompts.ts          | 16 ++++--
 .../__tests__/ephemeral-task-create-gate.test.ts   |  3 +-
 .../engine/src/__tests__/executor-prompt.test.ts   | 67 ++++++++++++++++++++++
 .../executor-task-recommendations.test.ts          | 39 ++++++++++++-
 packages/engine/src/executor.ts                    | 44 ++++++++++++--
 7 files changed, 162 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-8850

Fusion-Task-Lineage: 55a99d05-33fa-464c-869c-18a9cf7e495a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 22:49:02 -07:00
gsxdsm
72623ec804 FN-8837: fix pull-request merge retry recovery
Make pull-request merge failures retry safely and report actionable terminal states.

- Persist exponential retry backoff and schedule durable retry wakeups.
- Classify policy, transient, and non-retryable GitHub merge failures correctly.
- Clear retry state on successful merges and cover notifications and recovery paths.

Files changed:
 .changeset/fn-8837-pr-merge-retries.md             |   7 +
 docs/architecture.md                               |   1 +
 .../task-update-awaiting-approval-reason.test.ts   |   9 +
 packages/core/src/store.ts                         |   2 +-
 packages/core/src/task-store/task-update.ts        |   6 +-
 packages/core/src/types/task/task-core.ts          |   7 +-
 .../src/__tests__/merge-error-recovery.test.ts     | 440 ++++++++++++++++++++-
 .../engine/src/__tests__/ntfy-provider.test.ts     |  14 +
 .../engine/src/__tests__/webhook-provider.test.ts  |  15 +
 .../__tests__/notification-service.test.ts         |  48 +++
 .../src/notification/notification-service.ts       |  15 +-
 packages/engine/src/notification/ntfy-provider.ts  |  15 +-
 .../engine/src/notification/webhook-provider.ts    |   9 +-
 packages/engine/src/project-engine.ts              | 240 +++++++++--
 14 files changed, 781 insertions(+), 47 deletions(-)

Fusion-Task-Id: FN-8837

Fusion-Task-Lineage: a39b3491-d5cb-4509-b450-3e5671e0ba2d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 22:43:45 -07:00
gsxdsm
b3504f01a4 FN-8838: refresh automated PR heads before GitHub mutations
Refresh isolated automated PR heads against their target immediately before PR creation or merge.

- Rebase and lease-publish task and group heads at every automated GitHub boundary.
- Fail closed on concurrent head updates and reconcile retained refresh worktrees.
- Add lifecycle coverage and document the configurable integration remote.

Files changed:
 .changeset/fn-8838-refresh-pr-heads.md             |   7 +
 docs/settings-reference.md                         |   6 +
 .../task-lifecycle-refresh.integration.test.ts     | 438 ++++++++++++++++
 .../src/commands/__tests__/task-lifecycle.test.ts  | 309 ++++++++++-
 packages/cli/src/commands/daemon.ts                |   4 +-
 packages/cli/src/commands/dashboard.ts             |   4 +-
 packages/cli/src/commands/serve.ts                 |   4 +-
 packages/cli/src/commands/task-lifecycle.ts        | 581 +++++++++++++++++++--
 .../src/__tests__/group-merge-coordinator.test.ts  |  43 ++
 .../engine/src/merge/group-merge-coordinator.ts    |  34 +-
 packages/engine/src/merge/pr-nodes.ts              |  35 +-
 packages/engine/src/project-engine.ts              |  16 +-
 12 files changed, 1425 insertions(+), 56 deletions(-)

Fusion-Task-Id: FN-8838
Fusion-Task-Lineage: a9b9e800-7d73-441f-bc1b-2488d244e0b1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 22:35:59 -07:00
gsxdsm
7611ce7baa FN-8841: route Plan Review no-op verdicts to terminal close
Allow validated duplicate and no-op Plan Review verdicts to complete work without implementation dispatch.

- Add terminal no-op routes to built-in coding workflows and validate reviewer evidence.
- Persist close verdicts, safely hold failed terminalizations, and guard pause races.
- Document the verdict contract and cover route, validation, and completion behavior.
- Add a patch changeset for the published Fusion package.

Files changed:
 .changeset/fn-8841-plan-review-no-op.md            |   7 +
 docs/workflow-steps.md                             |  14 +
 .../core/src/__tests__/builtin-workflows.test.ts   |  24 ++
 packages/core/src/types/task/task-review.ts        |   7 +-
 packages/core/src/types/workflow/workflow-steps.ts |   2 +-
 .../src/workflows/builtin-coding-workflow-ir.ts    |   3 +
 .../src/workflows/builtin-plan-review-group.ts     |   3 +-
 .../builtin-stepwise-coding-workflow-ir.ts         |   3 +
 packages/core/src/workflows/builtin-workflows.ts   |   5 +
 .../engine/src/__tests__/plan-review-no-op.test.ts | 289 +++++++++++++++++++
 .../workflow-step-verdict-parsing.test.ts          |  18 ++
 packages/engine/src/executor.ts                    | 318 +++++++++++++++++----
 .../src/workflows/workflow-graph-executor.ts       | 103 ++++++-
 .../src/workflows/workflow-graph-task-runner.ts    |   6 +
 14 files changed, 741 insertions(+), 61 deletions(-)

Fusion-Task-Id: FN-8841

Fusion-Task-Lineage: bde2e001-9cd0-496e-8367-36540c9ac31d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 21:04:10 -07:00
gsxdsm
b2f8b0d3fe test(quarantine): delete 27 permanently-broken quarantined tests per operator directive
Operator directed deletion of tests that test pre-refactor behavior no
longer in the codebase (removed APIs, mock shape drift, stale assertions
from the 2026-08-05 full-suite quarantine wave, run 30982276306).

All 27 entries were permanently red — not flaky — testing APIs removed
during the PG cutover and workflow peel refactors (getBuiltinWorkflow,
resolveWorkflowIrForTaskWithProvenance, layer.db.select mock shapes,
vi.mock hoist errors, stale serialization/count literals).

Kept 3 actionable entries that catch real issues:
- register-model-routes-kimi-k3-supplemental (real CI flake, rescue feature ready)
- project-engine.test.ts (catches real 60s→120s assertion drift)
- PlanningModeModal.planning-flow (second-sighting real race)

Vitest config exclusions and quarantine ledger updated in lockstep.
2026-08-08 20:51:19 -07:00
gsxdsm
f36e23848f FN-8840: recognize duplicate redirects in task titles
Recognize exact duplicate redirects in either task title or PROMPT.md while preserving conflicting decisions for operator resolution.

- Resolve duplicate markers consistently across intake, scheduling, execution, dashboard, and replication paths.
- Accept task-ID prefixes beyond FN- and expose duplicate-marker state to the UI.
- Fail closed during stale-decision recovery when prompt, title, or persisted canonical redirects disagree.
- Add regression coverage and operator documentation for title-based redirects.

Files changed:
 .changeset/fn-8840-duplicate-title-redirect.md     |   7 ++
 docs/settings-reference.md                         |   2 +-
 docs/task-management.md                            |  11 +-
 .../__tests__/explicit-duplicate-marker.test.ts    |  30 ++++-
 .../src/__tests__/mesh-task-replication.test.ts    |   6 +
 .../src/duplicates/explicit-duplicate-marker.ts    |  66 ++++++++---
 packages/core/src/index.gate.ts                    |   3 +
 packages/core/src/index.ts                         |   3 +
 packages/core/src/mesh/mesh-task-replication.ts    |   2 +-
 ...-task-workflow-routes.awaiting-planning.test.ts |  78 +++++++++++--
 .../src/routes/register-task-workflow-routes.ts    |  26 ++++-
 .../executor-explicit-duplicate-recovery.test.ts   |  75 ++++++++++++
 .../__tests__/merged-intake-hold-column.test.ts    |  19 +++
 .../scheduler-explicit-duplicate-marker.test.ts    | 130 +++++++++++++++++++++
 .../self-healing-stale-duplicate-decision.test.ts  |  67 +++++++++++
 .../triage-explicit-duplicate-marker.test.ts       |  51 ++++++++
 packages/engine/src/execution/hold-release.ts      |  10 +-
 packages/engine/src/executor.ts                    |  11 +-
 packages/engine/src/scheduler.ts                   |  15 ++-
 packages/engine/src/self-healing.ts                |  55 ++++++---
 packages/engine/src/triage.ts                      |  98 +++++++++++++---
 21 files changed, 687 insertions(+), 78 deletions(-)

Fusion-Task-Id: FN-8840

Fusion-Task-Lineage: d08a3e84-1851-4fba-bfa9-507116ad6219

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 19:58:43 -07:00
gsxdsm
fe9fe88841 FN-8847: remove retired ephemeral-agent setting
Remove the obsolete ephemeral-agent compatibility setting across configuration, persistence, UI, and localization.

- Remove the setting from schemas, scoped settings, persistence helpers, and General settings UI.
- Update translations, settings documentation, and parity coverage for the retired option.
- Adjust scheduler, executor, dashboard, and PostgreSQL tests for the unconditional behavior.
- Add a patch changeset for @runfusion/fusion.

Files changed:
 .changeset/fn-8847-remove-ephemeral-setting.md     |  7 +++
 docs/settings-reference.md                         |  3 +-
 .../postgres/settings-persistence.pg.test.ts       | 14 ++++++
 .../core/src/__tests__/settings-parity.test.ts     | 20 ++++++--
 packages/core/src/config/settings-schema.ts        |  7 ---
 packages/core/src/task-store/settings-helpers.ts   | 14 ++++--
 packages/core/src/task-store/settings-ops.ts       | 11 +++--
 packages/core/src/types/settings/settings-scope.ts |  6 ---
 .../__tests__/SettingsModal.general.test.tsx       | 41 ++++-------------
 .../settings/sections/GeneralSection.tsx           | 17 -------
 .../settings-default-descriptions.test.tsx         |  6 ---
 .../src/__tests__/mission-start-routing.test.ts    | 34 ++++++--------
 ...executor-ephemeral-disabled-dispatch-gate.test.ts | 53 ++++++++--------------
 .../__tests__/scheduler-ephemeral-toggle.test.ts   | 30 +++++-------
 packages/i18n/locales/en/app.json                  |  2 -
 packages/i18n/locales/es/app.json                  |  2 -
 packages/i18n/locales/fr/app.json                  |  2 -
 packages/i18n/locales/ko/app.json                  |  2 -
 packages/i18n/locales/zh-CN/app.json               |  2 -
 packages/i18n/locales/zh-TW/app.json               |  2 -
 packages/i18n/src/resources.d.ts                   |  2 -
 21 files changed, 105 insertions(+), 172 deletions(-)

Fusion-Task-Id: FN-8847

Fusion-Task-Lineage: 8a067ec6-0ec7-4aef-a48e-604f821f35d2

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 19:13:14 -07:00
gsxdsm
d385d01208 FN-8844: correct delegation role error assertion
Align the delegation role test with the pluralized runtime error message.

- Update the reviewer delegation rejection expectation to use the roles label.

Files changed:
 packages/engine/src/__tests__/agent-tools-delegation.test.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Fusion-Task-Id: FN-8844

Fusion-Task-Lineage: d9a34bda-71de-4b47-b93d-a27dfeb018d1

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 18:20:47 -07:00
gsxdsm
e2522ebbb0 FN-8839: rebase fresh worktrees onto integration branch
Refresh newly created worktrees against the configured integration branch without relying on ambient root HEAD.

- Resolve rebase targets through the canonical integration-branch resolver
- Log skipped refreshes, fetch failures, and successful or conflicted rebases without blocking setup
- Cover configured, remote-default, fallback, and failure rebase behavior

Files changed:
 .changeset/fn-8839-worktree-integration-rebase.md  |   7 +
 .../engine/src/__tests__/executor-worktree.test.ts | 167 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  91 ++++++-----
 3 files changed, 226 insertions(+), 39 deletions(-)

Fusion-Task-Id: FN-8839

Fusion-Task-Lineage: e104a261-39b2-4ab1-aaf5-075764162b4b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 18:08:23 -07:00
gsxdsm
d450dbe971 FN-8829: add task recommendations
Add persistent task recommendations that agents can create, resolve, and display in task details.

- Persist recommendation state and expose task recommendation API routes.
- Generate recommendations from executor task completions with duplicate suppression.
- Add localized dashboard recommendation tab and settings control with coverage.

Files changed:
 .changeset/fn-8829-recommendations.md              |   7 +
 docs/dashboard-guide.md                            |   1 +
 docs/settings-reference.md                         |   1 +
 .../postgres/settings-persistence.pg.test.ts       |  10 +
 .../postgres/task-recommendations.pg.test.ts       | 191 +++++++++
 .../core/src/__tests__/settings-parity.test.ts     |   2 +
 packages/core/src/config/settings-schema.ts        |   2 +
 packages/core/src/index.ts                         |   2 +-
 .../0047_fn_8829_task_recommendations.sql          |   3 +
 packages/core/src/postgres/schema-applier.ts       |  32 +-
 packages/core/src/postgres/schema/project.ts       |   2 +
 packages/core/src/store.ts                         |  12 +-
 packages/core/src/task-store/persistence.ts        |   4 +-
 packages/core/src/task-store/serialization.ts      |   1 +
 packages/core/src/task-store/settings-ops.ts       |  22 +
 packages/core/src/task-store/task-mutation-ops.ts  |  78 +++-
 packages/core/src/task-store/task-row-mappers.ts   |   2 +-
 packages/core/src/task-store/task-update.ts        |  51 ++-
 packages/core/src/types.ts                         |   4 +
 packages/core/src/types/settings/settings-scope.ts |   6 +
 packages/core/src/types/task/task-core.ts          |  18 +
 .../__tests__/App.openTasksInRightSidebar.test.ts  |   3 +-
 packages/dashboard/app/__tests__/api-tasks.test.ts |  31 ++
 packages/dashboard/app/api/legacy.ts               |   1 +
 packages/dashboard/app/api/tasks/tasks.ts          |  24 ++
 .../dashboard/app/components/TaskDetailModal.tsx   |  43 +-
 .../app/components/TaskRecommendationsTab.css      |  71 ++++
 .../app/components/TaskRecommendationsTab.tsx      | 127 ++++++
 .../__tests__/SettingsModal.general.test.tsx       |  11 +
 .../TaskDetailModal.recommendations.test.tsx       | 111 +++++
 .../app/components/settings/section-keys.ts        |   1 +
 .../settings/sections/GeneralSection.tsx           |  14 +
 .../settings-default-descriptions.test.tsx         |   1 +
 packages/dashboard/app/hooks/useModalManager.ts    |   6 +
 packages/dashboard/app/plugins/types.ts            |   7 +-
 .../__tests__/task-recommendation-routes.test.ts   | 472 +++++++++++++++++++++
 .../src/routes/register-task-workflow-routes.ts    | 263 +++++++++++-
 .../executor-task-recommendations.test.ts          | 128 ++++++
 packages/engine/src/executor.ts                    |  66 ++-
 packages/i18n/locales/en/app.json                  |  15 +-
 packages/i18n/locales/es/app.json                  |  16 +-
 packages/i18n/locales/fr/app.json                  |  16 +-
 packages/i18n/locales/ko/app.json                  |  16 +-
 packages/i18n/locales/zh-CN/app.json               |  16 +-
 packages/i18n/locales/zh-TW/app.json               |  16 +-
 packages/i18n/src/resources.d.ts                   |  12 +
 46 files changed, 1908 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-8829
Fusion-Task-Lineage: 5f60a1fb-9cf8-4577-9bfd-c20a2d402333
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 01:59:38 -07:00
gsxdsm
70a830d1ad FN-8830: backfill built-in workflow agent identities
Provision complete workflow-agent identities while preserving operator-owned configuration.

- Seed instructions, souls, and managed setup mirrors for canonical workflow owners.
- Repair sparse default owners and demote duplicate provenance without losing agent data.
- Cover provisioning recovery and identity preservation with PostgreSQL and engine tests.

Files changed:
 .changeset/fn-8830-workflow-agent-identities.md    |   7 +
 docs/agents.md                                     |  10 +
 ...nt-store-builtin-role-provisioning-pool.test.ts |  41 ++++
 .../postgres/agent-instructions.pg.test.ts         | 233 +++++++++++++++++++++
 packages/core/src/agents/agent-store.ts            | 167 ++++++++++++---
 .../src/agents/workflow-role-agent-defaults.ts     |  57 +++++
 packages/core/src/index.ts                         |   6 +
 .../src/__tests__/agent-instructions.test.ts       |  32 ++-
 8 files changed, 526 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-8830

Fusion-Task-Lineage: bdf75989-3282-4833-a8b6-8c2997af8363

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 23:55:08 -07:00
gsxdsm
38cdf3a589 FN-8827: repair executor workflow routing fixtures
Align executor worktree tests with mandatory workflow principal routing.

- Add durable workflow agent-store fixtures with capacity leases and checkout renewal.
- Route worktree executor fixtures through eligible executor principals.
- Cover role selection, capacity release, checkout preservation, and fixture reset behavior.

Files changed:
 packages/engine/src/__tests__/executor-test-helpers.ts |  71 ++++++
 packages/engine/src/__tests__/executor-worktree.test.ts | 246 ++++++++++++++-------
 2 files changed, 239 insertions(+), 78 deletions(-)

Fusion-Task-Id: FN-8827
Fusion-Task-Lineage: 800a5246-abf3-480e-b71d-3237164c491e
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 21:50:51 -07:00
gsxdsm
36f20f835e FN-8822: prevent worktree capacity leaks
Keep live-task capacity admission visible and consistent across all lifecycle lanes.

- Report canonical active holders when worktree or concurrent-task capacity is exhausted.
- Persist deduplicated queue reasons for merge, triage, and workflow-continuation admission.
- Cover retained worktree behavior and document the capacity model.

Files changed:
 .changeset/fn-8822-worktree-capacity-leak.md       |  7 +++
 docs/architecture.md                               |  1 +
 docs/settings-reference.md                         |  4 +-
 .../src/__tests__/agent-heartbeat-worktree.test.ts | 11 ++++-
 .../engine/src/__tests__/project-engine.test.ts    |  4 ++
 ...ecutor-no-task-done-vs-worktree-reclaim.test.ts | 55 +++++++++++++++++++---
 ...admission-worktree-ledger-renamed-lanes.test.ts |  4 ++
 .../workflow-continuation-capacity.test.ts         |  8 +++-
 .../src/__tests__/worktree-acquisition.test.ts     |  6 +--
 packages/engine/src/concurrency/concurrency.ts     | 22 +++++++++
 packages/engine/src/project-engine.ts              | 34 ++++++++++++-
 packages/engine/src/runtimes/in-process-runtime.ts | 33 ++++++++++++-
 packages/engine/src/scheduler.ts                   | 53 ++++++++++-----------
 packages/engine/src/triage.ts                      | 18 +++++++
 14 files changed, 215 insertions(+), 45 deletions(-)

Fusion-Task-Id: FN-8822

Fusion-Task-Lineage: 73eda70b-2b74-4b49-a0ff-29d41fd9aab8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 21:43:28 -07:00
gsxdsm
e78c09c6f4 FN-8825: move secrets fingerprints into private Git metadata
Store secrets environment fingerprint metadata in private Git directories so refresh-enabled worktrees remain clean.

- Reconcile and durably migrate legacy root fingerprint sidecars before strict worktree refreshes.
- Fail closed for malformed, tracked, conflicting, or non-durable fingerprint records and protect cleanup integrity.
- Add coverage and document the private fingerprint record contract.

Files changed: .changeset/fn-8825-secrets-env-fingerprint.md      |   7 +
 docs/secrets.md                                    |   5 +-
 .../secrets-env-materialization.test.ts            |  45 ++-
 .../src/__tests__/secrets-env-writer.test.ts       | 325 ++++++++++++++-
 .../worktree-acquisition-secrets-env.test.ts       |  61 ++-
 packages/engine/src/worktree/secrets-env-writer.ts | 434 ++++++++++++++++-----
 .../engine/src/worktree/worktree-acquisition.ts    |  22 +-
 7 files changed, 799 insertions(+), 100 deletions(-)

Fusion-Task-Id: FN-8825

Fusion-Task-Lineage: eb7148bd-1da7-4448-8abf-498ddaebd4c0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 21:18:24 -07:00
gsxdsm
7b010ec95f FN-8824: enforce serial mission slice advancement
Keep mission autopilot progression limited to one active, milestone-ordered slice.

- Add atomic store-level admission for the next serially eligible slice.
- Reconcile completed active slices before advancing and route scheduler activation through the shared guard.
- Cover duplicate completion signals, recovery, PostgreSQL, and API behavior; document and release the fix.

Files changed:
 .changeset/fn-8824-mission-slice-advancement.md    |   7 +
 docs/missions.md                                   |  10 +-
 .../mission-store.sync-loop-transition.test.ts     |  43 ++++++
 .../postgres/mission-autopilot.pg.test.ts          |  25 ++++
 .../core/src/async-stores/async-mission-store.ts   |  48 ++++++-
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/missions/mission-store.ts        |  37 ++++-
 packages/core/src/missions/mission-types.ts        |  35 +++++
 packages/dashboard/src/mission-routes.ts           |   9 +-
 .../__tests__/mission-autopilot-end-to-end.test.ts |  95 ++++++++++--
 .../engine/src/__tests__/mission-autopilot.test.ts |  22 +++
 .../engine/src/__tests__/mission-scheduler.test.ts | 159 +++++++++++----------
 packages/engine/src/missions/mission-autopilot.ts  |  50 +++----
 packages/engine/src/scheduler.ts                   |  42 +-----
 15 files changed, 432 insertions(+), 152 deletions(-)

Fusion-Task-Id: FN-8824

Fusion-Task-Lineage: 22638d56-a51b-424c-aa07-871f544fb7cc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 20:56:52 -07:00
gsxdsm
3dd824d04e FN-8823: respect shared member auto-merge holds
Honor project and member auto-merge consent consistently throughout shared-branch integration.

- Apply project autoMerge settings and explicit member overrides to shared-member hold decisions.
- Expose shared-member integration hold state and controls in branch-group dashboard and lifecycle APIs.
- Add regression coverage, operator documentation, and a patch changeset.

Files changed:
 .changeset/fn-8823-shared-member-consent.md        |  7 ++
 docs/dashboard-guide.md                            |  4 +-
 packages/core/src/__tests__/task-merge.test.ts     | 57 +++++++++++++++
 packages/core/src/index.gate.ts                    |  3 +
 packages/core/src/index.ts                         |  3 +
 packages/core/src/merge/task-merge.ts              | 81 ++++++++++++++++++---
 .../dashboard/app/api/tasks/tasks-lifecycle.ts     | 11 +++
 .../dashboard/app/components/BranchGroupCard.css   | 84 ++++++++++++++++++++++
 .../dashboard/app/components/BranchGroupCard.tsx   | 58 ++++++++++++++-
 packages/dashboard/app/components/ListView.tsx     | 14 +++-
 .../dashboard/app/components/TaskDetailModal.tsx   | 20 +++++-
 .../components/__tests__/BranchGroupCard.test.tsx  | 44 +++++++++++-
 .../components/__tests__/TaskDetailModal.test.tsx  | 24 ++++++-
 .../app/components/dashboard/MainContent.tsx       |  2 +-
 .../app/components/useRightDockController.tsx      |  2 +-
 packages/dashboard/app/hooks/useModalManager.ts    |  6 ++
 .../src/__tests__/routes-branch-groups.test.ts     | 42 ++++++-----
 .../src/routes/register-branch-groups-routes.ts    |  9 ++-
 ...cutor-live-branch-group-auto-merge-hold.test.ts | 21 +++---
 .../src/__tests__/group-merge-coordinator.test.ts  |  7 +-
 .../workflow-graph-executor-handlers.test.ts       | 33 ++++++---
 packages/engine/src/executor.ts                    | 27 ++++---
 packages/engine/src/project-engine.ts              |  9 ++-
 packages/engine/src/self-healing.ts                | 16 ++---
 .../src/workflow-node-runners/merge-runner.ts      | 13 ++--
 25 files changed, 503 insertions(+), 94 deletions(-)

Fusion-Task-Id: FN-8823

Fusion-Task-Lineage: 19a8ed3f-26e1-4c8e-8782-ca366718a3f2

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 20:27:04 -07:00
gsxdsm
0cce560e4a fix: stop three bookkeeping faults from terminalizing or mis-scoping a run
Found by a subsystem audit of FN-8764's work-item and role-routing design,
prompted by three production deadlocks already fixed in it.

1. executor.ts — closing out the continuation could skip handleGraphFailure.
   The two transitions that close a run's continuation sat outside the
   interpreter try/catch with no handler, unlike their siblings in the same
   function. The row is usually ALREADY terminal by then: the run's first fence
   write retires the continuation it resumed on, which is what makes the
   handover atomic. So `succeeded -> failed` hit the store's terminal guard and
   threw, escaping executeWorkflowGraph and skipping handleGraphFailure — a
   failed run's card was left sitting in its wip column, unparked, with no error
   recorded. Closing the continuation is bookkeeping and must never pre-empt the
   lifecycle action.

2. executor.ts — capacity attemptId dropped its run-id fallback.
   `resolvedRunId` is optional by construction (a definition load failure leaves
   it undefined) and this interpolated it raw, producing the literal attempt id
   `undefined:<nodeInstance>` shared by every task in the project that hit that
   failure. The lease is keyed on (projectId, attemptId) and returns "acquired"
   for a pre-existing row regardless of agent, so colliding tasks bypass both the
   project and per-agent caps and one task's release deletes another's live
   lease. The two durable writes on either side already used the fallback.

3. workflow-task-runtime.ts — failWorkItem dropped a promise bare.
   The write is deliberately fire-and-forget, but an unhandled rejection (most
   likely the terminal guard when a peer already closed the row) crossed into
   process-level unhandled-rejection territory while the caller had already
   returned "failed" as if it were persisted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 20:18:15 -07:00
gsxdsm
560256bb73 fix: resume the graph at a top-level node, not a foreach template node
A principal fence written for a node inside a foreach template stores the
TEMPLATE node id (step-execute) with the materialized instance in
nodeInstanceId (steps#0:step-execute). The template node lives under the
foreach's config.template and is never in ir.nodes, so handing it to the
interpreter as a start node resolved to nothing and threw WorkflowIrError.
executeWorkflowGraph's catch turned that into a terminal graph failure, so a
healthy card was parked on every dispatch:

  [workflow-graph] FN-8825 could not resolve workflow — parking task instead of
  legacy fallback: interpreter-error: Workflow IR missing start node

Latent since FN-8764 introduced these fences, and reachable only once a
step-execute fence could become the task's sole active continuation — which the
atomic-handover change in dd40691ca2 made routine.

The executor now passes a continuation node id as the resume point only when the
task's resolved IR actually contains it. Otherwise it falls back to the graph
entry contract: with no explicit start node the run re-enters at the card's own
column, so an in-progress card re-enters at parse, finds the foreach already
expanded, and hands control back to steps. The instance resumes from its own row
in workflow_run_step_instances, so nothing is replayed. Already-persisted
template-node continuations therefore heal on their next dispatch with no
migration.

Also splits the error message. One string covered a genuinely malformed IR and a
caller asking to resume at an unknown node, and reporting the second as "missing
start node" sends the reader to inspect a workflow definition that is fine.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 18:40:40 -07:00
gsxdsm
dd40691ca2 fix: make workflow continuation writes atomic, not conflict-recovery
Code review of ef8828f14 found the continuation handover it introduced was a
hand-rolled, non-atomic replacement for a primitive this repo already has, with
six P1 defects — two of which recreated the very deadlock it was written to fix.

The invariant: a task may hold ONE active kind="task" work item
(idx_workflow_work_items_one_active_task_continuation), and that partial unique
index is NOT what a plain upsert's ON CONFLICT targets. So a predecessor the run
has already left makes the write RAISE.

Every continuation write in the executor and triage now goes through
replaceActiveTaskWorkflowContinuation, which retires non-matching active rows
and installs the successor in ONE transaction under the task advisory lock:

- Sibling foreach instances share the template nodeId and differ only by runId,
  so the old node-identity guard released nothing and instance #1 re-deadlocked.
- Reacting to a FAILED write could not tell an index conflict from a transient
  database error, so it destroyed legitimate held continuations.
- Read-then-write across separate transactions let a concurrent engine lose a
  live claim; the lock now serializes it.
- A failed retry left the task with zero active rows and no error, because the
  hold then transitioned an already-terminal row and the throw was swallowed.
- The same unguarded write existed on the executor's hold path and at both of
  triage's planning-continuation writes; a throw there degraded a recoverable
  availability hold into a terminal graph failure.

Coverage moves from a fake store to the real index: the new PG suite proves the
bare upsert raises and that replace handles a different node, a sibling foreach
instance, a held predecessor, and re-entry, plus a drift guard tying the SQL
predicate to ACTIVE_WORKFLOW_WORK_ITEM_STATES. The hand-rolled handover is
tombstoned so it cannot return as a "conflict fix", and both new run-audit
events are documented in the AGENTS.md inventory.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 17:09:53 -07:00
gsxdsm
cdf81a2244 fix(FN-8826): retry partial workflow progress after restart
Fusion-Task-Id: FN-8826
2026-08-07 16:55:00 -07:00
gsxdsm
ef8828f145 fix: unblock workflow execution stalled by silent role-routing deadlocks
Every task sat in progress with no session, no log, and no error after the
FN-8764 role-agent rollout. Two independent deadlocks, both invisible:

1. The in-process runtime built its AgentStore but never passed it into
   TaskExecutorOptions, so the executor's fail-closed role-routing gate refused
   every classified node (execute/step-execute/review/merge).
2. A resumed run keeps the continuation work item it woke on active until the
   interpreter returns, so the next node's principal-fence upsert violated
   idx_workflow_work_items_one_active_task_continuation — a different index than
   its ON CONFLICT target — and raised. The run re-suspended on every dispatch;
   only an operator bouncing the card to the hold column cleared it.

Both refusals were swallowed as recoverable "principal holds" that write no log,
audit row, or task error, which is why a fully deadlocked board looked idle.

- Wire agentStore into the executor; assert the shared instance at every runtime
  seam in the PG composition test.
- Supersede an active work item for a node the run has already left, then retry
  the fence write once; never touch a claim on the node currently executing.
- Record task:workflow-run-suspended and task:workflow-continuation-superseded;
  log principal holds, routing-unavailable faults, and fence-write errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 16:15:39 -07:00
gsxdsm
fc2040ca84 FN-8821: retire ephemeral-agent routing branches
Keep the legacy ephemeral-agent setting compatible while making all workflow routing durable-principal-only.

- Preserve and expose the legacy setting as a routing-inert compatibility field.
- Remove scheduler, executor, and mission-start branches that honored the deprecated toggle.
- Add coverage for settings persistence and durable routing invariants.

Files changed:
 .changeset/fn-8821-retire-ephemeral-routing.md     |   7 +
 docs/settings-reference.md                         |   4 +-
 .../core/src/__tests__/settings-parity.test.ts     |   8 +-
 packages/core/src/config/settings-schema.ts        |  11 +-
 packages/core/src/task-store/settings-helpers.ts   |  15 +-
 packages/core/src/task-store/settings-ops.ts       |  12 +-
 packages/core/src/types/settings/settings-scope.ts |   5 +-
 .../__tests__/SettingsModal.general.test.tsx       |  23 ++
 .../settings/sections/GeneralSection.tsx           |  13 ++
 .../src/__tests__/mission-start-routing.test.ts    | 104 +++++++++
 ...ecutor-ephemeral-disabled-dispatch-gate.test.ts | 243 +++++++++++++++++++++
 .../__tests__/scheduler-ephemeral-toggle.test.ts   | 125 +++++++++++
 12 files changed, 542 insertions(+), 28 deletions(-)

Fusion-Task-Id: FN-8821

Fusion-Task-Lineage: e81ec9c0-f2b0-48f9-ae2b-9bbde4491447

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 02:33:35 -07:00
gsxdsm
eaadd153b1 FN-8764: route workflow stages through durable role agents
Route workflow stages through task-scoped durable role agents.

- Persist normalized multi-role agents and workflow principal fences with migrations.
- Route planning, execution, review, and merge workflow nodes through authorized permanent principals with capacity leasing and recovery.
- Retire ephemeral workflow-stage workers and expose role-aware agent configuration, workflow editing, and documentation.
- Preserve lifecycle-column ratchet coverage by centralizing workflow-role classification rather than adding test exemptions.

Files changed:
 .changeset/fn-8764-workflow-role-agents.md         |   7 +
 CONCEPTS.md                                        |   3 +
 docs/agents.md                                     |   6 +
 docs/architecture.md                               |   6 +
 docs/cli-reference.md                              |   2 +
 docs/dashboard-guide.md                            |   4 +
 docs/settings-reference.md                         |   6 +-
 docs/storage.md                                    |   2 +
 docs/workflow-steps.md                             |   6 +
 .../src/__tests__/extension-agent-update.test.ts   |  11 +-
 packages/cli/src/__tests__/extension.test.ts       |  18 +-
 packages/cli/src/extension.ts                      |  41 +-
 .../core/src/__tests__/agent-permissions.test.ts   |  12 +
 .../core/src/__tests__/agent-role-policy.test.ts   |   7 +
 packages/core/src/__tests__/agent-roles.test.ts    |  21 +
 .../legacy-column-collection-gating-ledger.test.ts |  19 +-
 .../src/__tests__/postgres/schema-applier.test.ts  |  16 +-
 .../core/src/__tests__/settings-parity.test.ts     |   9 +-
 .../workflow-agent-node-classification.test.ts     |  25 +
 .../src/__tests__/workflow-work-item-cas.test.ts   |  38 ++
 packages/core/src/agents/agent-permissions.ts      |  11 +-
 packages/core/src/agents/agent-role-policy.ts      |  39 +-
 packages/core/src/agents/agent-store.ts            | 190 ++++++-
 .../core/src/async-stores/async-agent-store.ts     |   6 +
 packages/core/src/config/settings-schema.ts        |   5 +-
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   7 +-
 .../0045_fn_8764_multi_role_workflow_agents.sql    |  20 +
 .../0046_fn_8764_workflow_principal_fence.sql      |  49 ++
 packages/core/src/postgres/schema-applier.ts       |  22 +-
 packages/core/src/postgres/schema/project.ts       |  21 +
 packages/core/src/store.ts                         |   2 +-
 .../task-store/async/async-workflow-workitems.ts   |  49 +-
 packages/core/src/task-store/row-types.ts          |   4 +
 packages/core/src/task-store/settings-helpers.ts   |  16 +-
 packages/core/src/task-store/settings-ops-2.ts     |  13 +-
 packages/core/src/task-store/settings-ops.ts       |  16 +-
 packages/core/src/task-store/task-row-mappers.ts   |   4 +
 .../src/task-store/workflow-task-create-ops.ts     |   6 +-
 .../src/task-store/workflow-workitems-ops-2.ts     |  25 +-
 packages/core/src/types.ts                         |   2 +
 packages/core/src/types/agents/agents.ts           |  45 +-
 packages/core/src/types/merge/merge-queue.ts       |  17 +
 packages/core/src/types/settings/settings-scope.ts |   9 +-
 packages/core/src/workflows/workflow-ir-types.ts   |  58 +++
 packages/core/src/workflows/workflow-ir.ts         |  19 +
 .../dashboard/app/components/AgentDetailView.css   |  14 +
 .../dashboard/app/components/AgentDetailView.tsx   |  34 +-
 .../dashboard/app/components/NewAgentDialog.tsx    |  28 +-
 .../app/components/WorkflowNodeEditor.tsx          |  19 +
 .../__tests__/AgentDetailView.core.test.tsx        |   4 +-
 .../app/components/__tests__/AgentsView.test.tsx   |   2 +-
 .../__tests__/SettingsModal.general.test.tsx       |  86 ---
 .../__tests__/SettingsModal.test-harness.tsx       |   1 -
 .../components/agent-presets/agentCreatePayload.ts |   9 +-
 .../app/components/settings/section-keys.ts        |   1 -
 .../settings/sections/GeneralSection.tsx           |   8 -
 .../settings-default-descriptions.test.tsx         |   1 -
 .../app/components/workflow-flow-mapping.ts        |   7 +
 packages/dashboard/src/mission-routes.ts           |  26 +-
 .../src/routes/__tests__/agent-core-routes.test.ts |  23 +-
 .../src/routes/register-agent-core-routes.ts       |  42 +-
 ...gister-agent-import-export-generation-routes.ts |  21 -
 .../engine/src/__tests__/agent-action-gate.test.ts |  33 ++
 .../engine/src/__tests__/agent-assignment.test.ts  | 370 -------------
 .../src/__tests__/ephemeral-worker-manager.test.ts | 575 ---------------------
 ...ecutor-ephemeral-disabled-dispatch-gate.test.ts | 223 --------
 .../__tests__/executor-fast-mode-workflows.test.ts |  58 +++
 .../engine/src/__tests__/log-severity-manifest.ts  |   1 -
 .../__tests__/log-severity-spam-contract.test.ts   |   3 -
 .../resolved-read-with-literal-filter.test.ts      |   4 -
 .../__tests__/scheduler-ephemeral-toggle.test.ts   | 175 -------
 .../__tests__/scheduler-workflow-cutover.test.ts   |  19 -
 .../src/__tests__/workflow-agent-capacity.test.ts  |  47 ++
 .../src/__tests__/workflow-agent-routing.test.ts   | 137 +++++
 .../src/__tests__/workflow-graph-foreach.test.ts   |  15 +
 .../__tests__/workflow-graph-task-runner.test.ts   |  73 +++
 .../src/__tests__/workflow-task-runtime.test.ts    |  95 ++++
 .../src/__tests__/workflow-work-scheduler.test.ts  |  20 +
 packages/engine/src/agents/agent-action-gate.ts    |  64 +++
 packages/engine/src/agents/agent-assignment.ts     | 135 -----
 packages/engine/src/agents/agent-reflection.ts     |   1 +
 .../engine/src/agents/ephemeral-worker-manager.ts  | 429 ---------------
 .../engine/src/agents/workflow-agent-capacity.ts   | 113 ++++
 .../engine/src/agents/workflow-agent-router.ts     | 185 +++++++
 packages/engine/src/execution/reviewer.ts          |  26 +-
 packages/engine/src/executor.ts                    | 501 +++++++++++++++---
 packages/engine/src/index.ts                       |   1 -
 packages/engine/src/merger.ts                      |  20 +-
 packages/engine/src/pi.ts                          |  11 +
 packages/engine/src/runtimes/in-process-runtime.ts |  37 --
 packages/engine/src/scheduler.ts                   | 114 +---
 packages/engine/src/triage.ts                      | 196 ++++++-
 .../src/workflows/workflow-graph-executor.ts       | 109 +++-
 .../engine/src/workflows/workflow-graph-loop.ts    |  13 +-
 .../src/workflows/workflow-graph-task-runner.ts    |  12 +
 .../engine/src/workflows/workflow-task-runtime.ts  | 125 ++++-
 .../src/workflows/workflow-work-scheduler.ts       |   8 +-
 98 files changed, 2722 insertions(+), 2468 deletions(-)

Fusion-Task-Id: FN-8764
Fusion-Task-Lineage: 5527fccb-342d-46f6-8108-bbf89142efec
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 01:36:34 -07:00
ischindl
f7ca14beab feat(workflow): add fn_workflow_step_resume operator escape hatch for stuck pending merge-review steps (#3339)
## Summary

Adds an **operator-only** escape hatch for a card stranded `in-review`
(or `in-progress`) with a workflow step permanently stuck in `pending`
status — the leading real-world cause being a dispatched prompt node
(e.g. `code-review`) whose verdict callback was never received (see
#1946). Transitions the stuck `pending` pre-merge step to `status:
"failed"` with resume audit metadata, so the existing
`fn_task_bypass_review` escape hatch can then clear the merge blocker.

## What changed

- **`WorkflowStepResult`** gains resume audit fields: `resumedBy`,
`resumedAt`, `resumeReason`, `resumedFromStatus`. They are pure audit
trail and **do not** participate in merge-blocking
(`getTaskMergeBlocker`).
- **`findPendingPreMergeStep`** (new helper, exported from
`@fusion/core`) summarizes the stuck-pending pre-merge state for
operator tooling. Ignores post-merge steps; returns the newest pending
pre-merge result.
- **`TaskStore.resumeWorkflowStep(id, { stepId, reason, actor })`** —
the store primitive (eligibility-gated: task must be
`in-review`/`in-progress`, not paused; step must exist and be `pending`;
a mandatory non-blank `reason` and `stepId` are required). Runs under
`withTaskLock`, writes the resume as a terminal `failed` result, appends
a task-log breadcrumb, and emits the new `task:resume-step` run-audit
event.
- **`fn_workflow_step_resume`** — new CLI/pi-extension tool registered
**only** on the operator surface (deliberately **not** wired into
executor/reviewer/triage agent tool lists). Accepts `{ id, stepId,
reason }`; the actor defaults to `cli-operator`.
- **Run-audit**: new `task:resume-step` `DatabaseMutationType` member.

## Why

A prompt-node verdict callback can be lost (dispatched prompt never
receives a verdict), leaving the step `pending` forever. Previously the
only recourse was `fn_task_bypass_review`, which requires a terminal
*failed* pre-merge step to clear the blocker — a permanently `pending`
step could not be bypassed. This PR bridges that gap: resume (pending →
failed) then bypass (failed merge-blocker cleared).

## Verification

- **Typecheck**: `@fusion/core`, `@fusion/engine`, `@runfusion/fusion`
all clean.
- **`task-merge-bypass.test.ts`**: 15/15 pass (incl. 5 new
`findPendingPreMergeStep` cases).
- **`store-resume-step.test.ts`** (new, PG-backed): 9/9 pass —
eligibility gating, resume rewrite + audit fields, run-audit event,
non-pending/non-found/blank-argument rejection, in-progress column
support, property preservation.
- **`extension.test.ts`**: 75/75 pass (expected-tool registration
includes the new tool).

## Files

- `packages/core/src/types/workflow/workflow-steps.ts`
- `packages/core/src/merge/task-merge.ts`
- `packages/core/src/store.ts`
- `packages/core/src/index.ts`
- `packages/core/src/__tests__/store-resume-step.test.ts` (new)
- `packages/core/src/__tests__/task-merge-bypass.test.ts`
- `packages/engine/src/util/run-audit.ts`
- `packages/cli/src/extension.ts`
- `packages/cli/src/__tests__/extension.test.ts`
- `.changeset/stas-032-resume-workflow-step.md` (minor, feature)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added an operator-only workflow recovery tool for permanently pending
pre-merge steps.
* Operators can mark eligible pending steps as failed by providing a
required audit reason.
* Recovery actions record operator details, timestamps, reasons, prior
status, task logs, and audit events.
* **Bug Fixes**
* Improved selection of the latest pending pre-merge workflow step while
excluding post-merge steps.
* Added validation to prevent recovery of paused, invalid, or
out-of-scope workflow steps.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: schindler <schindler@users.noreply.github.com>
Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-08-07 00:26:15 -07:00
gsxdsm
de38ead4c9 fix(ci): restore main full-suite after path peel and suite drift (#3334)
## Summary
Restores the non-blocking full suite on `main` after consistent shard
failures (latest red: [run
30982276306](https://github.com/Runfusion/Fusion/actions/runs/30982276306);
all four shards failed on `@fusion/core`, `@fusion/engine`, and
`@fusion/plugin-sdk`).

### Fixes
- **Path / import drift** after code-organization peels: update
static-guard and integration tests to new module locations (`central/`,
`board/`, `execution/`, `merge/`, `worktree/`, `plugins/`, `types/*`
barrels, etc.).
- **Inventory re-pins**:
- SQLite production `DatabaseSync` allowlist
(`central/project-identity.ts`, `db/sqlite-validation.ts`)
- Engine blocking-shellout allowlist regenerated from live source (33
audited sites)
  - Core log-severity manifest paths for peeled modules
- **Partial protocol assert update** for `isPlanReviewSatisfied` (file
also quarantined until full rescue)

### Quarantine (deletion ratchet)
Remaining behavioral reds quarantined on sight — no
timeout/retry/assertion appeasement:
- **14 core** files (incomplete unit fakes for `layer.db.select`,
ledger/census drift, 15s wedge timeout, serialization protocol drift)
- **13 engine** files (mock-hoist errors, fake-store/census/behavior
drift under suite)

Paired updates: `scripts/lib/test-quarantine.json` + package vitest
excludes. Deletion clock starts `2026-08-05`.

### Local verification
- Path-fixed core scanners: 173 passed
- Path-fixed engine scanners: 58 passed
- `@fusion/plugin-sdk` full: 16 passed
- PG smokes: mission-autopilot, research-execution, satellite,
transition-pending, workflow-sync

## Test plan
- [ ] CI PR checks green (lint/typecheck/build/gate)
- [ ] Full suite on merge to main: all 4 shards green or only
intentional non-blocking signal
- [ ] Confirm quarantined files appear in ledger + vitest excludes and
are not executed

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Updated test coverage to reflect reorganized source locations and
module paths.
* Refreshed static checks, allowlists, and source-based assertions
without changing tested behavior.
* **Chores**
* Quarantined failing core and engine test suites with documented
tracking details.
* Updated test configuration and quarantine records to improve suite
stability and reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-07 00:25:10 -07:00
gsxdsm
6bacfd74f5 fix(FN-8817): stop no-op lifecycle bounce
Honor verified intentional no-ops and preserve durable merger parks during workflow graph unwind.

Fusion-Task-Id: FN-8817
2026-08-06 16:11:05 -07:00
gsxdsm
3ed31e9907 FN-8815: retry execution after first tool failure
Retry executor work after the first terminal tool-call failure by default.

- Set the default tool-failure threshold to one while preserving explicit project overrides.
- Expose and document the first-error default in Settings, translations, and the settings reference.
- Cover threshold resolution, save lifecycle, and executor retry behavior.

Files changed: .changeset/fn-8815-retry-first-tool-failure.md     |  7 +++
 docs/settings-reference.md                         |  4 +-
 .../core/src/__tests__/settings-defaults.test.ts   |  6 +-
 packages/core/src/config/settings-schema.ts        | 10 ++-
 packages/core/src/tasks/in-review-stall.ts         | 15 ++++-
 packages/core/src/types/settings/settings-scope.ts | 10 ++-
 .../dashboard/app/components/SettingsModal.tsx     |  7 ++-
 .../SettingsModal.scheduling-merge.test.tsx        | 61 +++++++++++++++++-
 .../settings/sections/SchedulingSection.search.ts  |  2 +-
 .../settings/sections/SchedulingSection.tsx        |  4 +-
 .../settings-default-descriptions.test.tsx         | 12 ++++
 .../__tests__/executor-tool-failure-retry.test.ts  | 73 +++++++++++++++++++---
 packages/i18n/locales/en/app.json                  |  2 +-
 packages/i18n/src/resources.d.ts                   | 17 +++--
 14 files changed, 200 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-8815

Fusion-Task-Lineage: 909181e7-2da5-4a27-92ee-4182732d9695

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-06 08:35:36 -07:00
gsxdsm
4f4aef7173 FN-8811: preserve explicit shared-member review holds
Keep shared branch-group integration moving unless an operator explicitly holds the task.

- Track auto-merge provenance and distinguish explicit user holds from inherited mission policy.
- Preserve manual holds across workflow recovery, merge coordination, API updates, and dashboard status.
- Add regression coverage, document the behavior, and quarantine the observed flaky test.

Files changed:
 .changeset/fn-8811-shared-member-review-hold.md    |   7 ++
 docs/architecture.md                               |   4 +-
 docs/dashboard-guide.md                            |   1 +
 .../mission-store.sync-auto-merge.test.ts          |   7 +-
 .../__tests__/postgres/mission-store.pg.test.ts    |   1 +
 .../__tests__/postgres/store-movement.pg.test.ts   |  20 ++++
 packages/core/src/__tests__/task-merge.test.ts     |  14 +++
 .../core/src/async-stores/async-mission-store.ts   |   6 +-
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/merge/task-merge.ts              |  20 +++-
 packages/core/src/missions/mission-store.ts        |   6 +-
 packages/core/src/task-store/serialization.ts      |   2 +-
 packages/core/src/task-store/task-creation.ts      |   8 +-
 packages/core/src/types/task/task-core.ts          |  12 ++-
 .../components/__tests__/TaskDetailModal.test.tsx  |  63 ++++++++++++
 .../dashboard/src/__tests__/routes-tasks.test.ts   |  47 +++++++++
 .../src/routes/register-task-workflow-routes.ts    |  15 ++-
 ...cutor-live-branch-group-auto-merge-hold.test.ts |  87 +++++++++++++++++
 .../src/__tests__/group-merge-coordinator.test.ts  |  99 ++++++++++++++++++-
 .../engine/src/__tests__/project-engine.test.ts    |  57 ++++++++++-
 .../self-healing-paused-abort-recovery.test.ts     |  52 +++++++++-
 packages/engine/src/__tests__/self-healing.test.ts | 106 +++++++++++++++++++++
 .../workflow-graph-executor-handlers.test.ts       |  23 +++++
 packages/engine/src/executor.ts                    |  37 ++++++-
 packages/engine/src/project-engine.ts              |  25 +++--
 packages/engine/src/self-healing.ts                |  71 ++++++++++++--
 .../src/workflow-node-runners/merge-runner.ts      |  24 ++++-
 .../src/workflows/workflow-graph-executor.ts       |   4 +
 .../src/workflows/workflow-graph-task-runner.ts    |   6 ++
 .../engine/src/workflows/workflow-node-handlers.ts |   5 +-
 packages/engine/vitest.config.ts                   |  11 ++-
 scripts/lib/test-quarantine.json                   |   5 +
 33 files changed, 789 insertions(+), 58 deletions(-)

Fusion-Task-Id: FN-8811

Fusion-Task-Lineage: 5c1609bf-3132-4988-a254-fedec6c0e33d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 17:39:15 -07:00
gsxdsm
1e4c7faf68 FN-8812: fix workspace merge retry timer cleanup
Ensure workspace contention retries are canceled when the project engine stops.

- Track workspace busy re-enqueue timers separately from other merge timers
- Clear pending workspace retry callbacks during engine shutdown
- Strengthen retry ladder and timer cleanup coverage

Files changed:
 .changeset/workspace-busy-timer-cleanup.md         |  7 +++
 .../engine/src/__tests__/project-engine.test.ts    | 66 +++++++++++-----------
 packages/engine/src/project-engine.ts              | 23 +++++++-
 3 files changed, 59 insertions(+), 37 deletions(-)

Fusion-Task-Id: FN-8812

Fusion-Task-Lineage: dd4c9581-8738-4082-8d6b-d91d4c463a5a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 17:10:55 -07:00
gsxdsm
1db7adcdb0 FN-8809: preserve agent principals for secret approvals
Keep prompt-gated secret approvals bound to their calling chat-agent session.

- Resolve extension secret callers through async session identity context.
- Give anonymous engine sessions unique principals and preserve them across tool invocations.
- Surface actionable approval decision errors in the mailbox and cover approval flows.

Files changed:
 .changeset/fn-8809-secrets-chat-approval.md        |   7 +
 .../__tests__/extension-permission-gates.test.ts   | 257 ++++++++++++++++++++-
 packages/cli/src/extension.ts                      |  96 +++++---
 .../__tests__/session-identity-registry.test.ts    |  27 +++
 packages/core/src/index.ts                         |   4 +-
 packages/core/src/session-identity-registry.ts     |  47 +++-
 packages/dashboard/app/components/MailboxView.tsx  |  11 +-
 .../app/components/__tests__/MailboxView.test.tsx  |  49 ++++
 .../dashboard/src/__tests__/chat-manager.test.ts   |  28 ++-
 .../__tests__/register-approval-routes.test.ts     |  22 ++
 .../src/__tests__/pi-create-fn-agent.test.ts       | 210 ++++++++++++++++-
 packages/engine/src/pi.ts                          |  34 ++-
 12 files changed, 748 insertions(+), 44 deletions(-)

Fusion-Task-Id: FN-8809

Fusion-Task-Lineage: 2e070f78-7215-4401-bcf2-6fa25fa27066

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 16:46:53 -07:00
gsxdsm
2a0827835d FN-8810: wire secrets stores into runtime worktrees
Wire project secrets stores into runtime and dashboard heartbeat worktree acquisition.

- Inject the project secrets store into executor and heartbeat monitors.
- Cover in-process, UI-only dashboard, and secrets-env worktree materialization paths.
- Add a patch changeset for restored secrets-env files.

Files changed:
 .changeset/fn-8810-secrets-env-runtime-wiring.md   |   7 ++
 .../commands/__tests__/dashboard-supervise.test.ts |  28 ++++-
 packages/cli/src/commands/dashboard.ts             |  38 ++++++-
 .../src/__tests__/in-process-runtime.pg.test.ts    | 121 ++++++++++++++++++++-
 .../src/__tests__/secrets-env-writer.test.ts       |  35 ++++++
 .../worktree-acquisition-secrets-env.test.ts       |   4 +-
 packages/engine/src/runtimes/in-process-runtime.ts |   9 ++
 7 files changed, 233 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-8810

Fusion-Task-Lineage: a67c3fbe-7744-4898-8a56-8739caa04479

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 15:23:08 -07:00
gsxdsm
ec10411c4c FN-8795: persist structured workflow review findings
Persist normalized actionable findings from review workflow nodes.

- Normalize bounded finding IDs, text, locations, and severities in workflow results.
- Surface individual findings for Review-tab selection and same-task revision.
- Preserve findings through workflow retries and document the advisory contract.

Files changed:
 .changeset/fn-8795-structured-review-findings.md   |  7 +++
 docs/dashboard-guide.md                            |  2 +-
 docs/workflow-steps.md                             |  4 +-
 .../src/__tests__/workflow-step-results.test.ts    | 32 +++++++++++++-
 packages/core/src/index.gate.ts                    |  4 ++
 packages/core/src/index.ts                         |  6 ++-
 packages/core/src/types.ts                         |  4 ++
 packages/core/src/types/task/task-review.ts        |  5 +++
 packages/core/src/types/workflow/workflow-steps.ts | 20 +++++++++
 .../core/src/workflows/workflow-step-results.ts    | 50 +++++++++++++++++++++-
 .../dashboard/app/components/TaskReviewTab.tsx     | 12 +++++-
 .../src/routes/register-task-workflow-routes.ts    | 26 ++++++++++-
 .../workflow-malformed-verdict-gate.test.ts        | 12 ++++++
 packages/engine/src/executor.ts                    | 46 +++++++++++++++++---
 .../src/workflows/workflow-graph-executor.ts       | 11 +++++
 15 files changed, 227 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8795
Fusion-Task-Lineage: 09003b01-3f9a-4387-b6a7-f29066ce52f6
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 00:00:03 -07:00
gsxdsm
9c77788850 fix(FN-8795): refresh queued overlap blockers 2026-08-04 23:42:06 -07:00
gsxdsm
e75c788db2 FN-8794: add workflow review-kind markers
Classify workflow review nodes so review feedback can target their persisted results.

- validate and type explicit plan/code review-kind markers in workflow IR
- expose review-kind selection in the workflow editor and document the authoring contract
- persist markers through task workflow routes and graph execution with regression coverage

Files changed:
 .changeset/fn-8794-review-kind.md                  |   7 +
 docs/dashboard-guide.md                            |   4 +
 docs/workflow-steps.md                             |  10 +
 .../__tests__/workflow-ir-optional-group.test.ts   |  17 ++
 packages/core/src/__tests__/workflow-ir.test.ts    |  83 +++++++++
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/types.ts                         |   2 +
 packages/core/src/types/workflow/workflow-steps.ts |   8 +
 .../src/workflows/builtin-code-review-group.ts     |   1 +
 .../src/workflows/builtin-plan-review-group.ts     |   1 +
 packages/core/src/workflows/workflow-ir-types.ts   |   5 +
 packages/core/src/workflows/workflow-ir.ts         |  24 +++
 .../app/components/WorkflowNodeEditor.tsx          |  17 ++
 .../__tests__/WorkflowNodeEditor.test.tsx          | 206 +++++++++++++++++++++
 .../dashboard/src/__tests__/routes-tasks.test.ts   | 166 ++++++++++++++++-
 .../src/routes/register-task-workflow-routes.ts    |  82 ++++++--
 .../workflow-graph-optional-group.test.ts          | 177 +++++++++++++++++-
 .../src/workflows/workflow-graph-executor.ts       |  20 +-
 19 files changed, 801 insertions(+), 33 deletions(-)

Fusion-Task-Id: FN-8794

Fusion-Task-Lineage: a7752469-59bc-406f-82e8-6ffde6c392ef

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 23:36:32 -07:00
gsxdsm
26219b8d34 FN-8799: suppress alerts during automatic task recovery
Prevent terminal task alerts while persisted automatic recovery owns a failed task.

- Classify scheduled and transient merge recovery ownership before wedge notification claims.
- Re-read live task state before claims and deferred failure delivery to avoid recovery races.
- Add recovery suppression coverage, architecture documentation, and a patch changeset.

Files changed:
 .changeset/fn-8799-recovery-notifications.md       |  7 ++
 docs/architecture.md                               |  2 +
 .../src/errors/transient-merge-error-classifier.ts | 18 +++++
 .../__tests__/notification-service.test.ts         | 78 ++++++++++++++++++-
 .../__tests__/task-wedge-notification.test.ts      | 26 ++++++-
 .../src/notification/notification-service.ts       | 90 ++++++++++++----------
 .../src/notification/task-wedge-notification.ts    | 37 +++++++--
 packages/engine/src/project-engine.ts              |  4 +-
 8 files changed, 210 insertions(+), 52 deletions(-)

Fusion-Task-Id: FN-8799

Fusion-Task-Lineage: f8296e81-6b84-4697-8b20-63823f09d584

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 22:17:06 -07:00
gsxdsm
4167841e3c FN-8792: resume Plan Review after approval
Approved plans now seed their canonical Plan Review continuation so dispatch can proceed.

- Add an engine handoff that atomically seeds approved Plan Review work without duplicating active continuations.
- Invoke the handoff under the dashboard approval lifecycle lock and cover approval, duplicate, and lifecycle-fence cases.
- Document the lifecycle guarantee and add a patch changeset.

Files changed:
 .changeset/fn-8792-plan-approval-dispatch.md       |   7 +
 docs/architecture.md                               |   6 +-
 .../dashboard/src/__tests__/routes-github.test.ts  | 167 ++++++++++++++++++++-
 .../src/routes/register-task-workflow-routes.ts    |  17 +++
 .../__tests__/plan-approval-hold-invariant.test.ts |  70 +++++++++
 packages/engine/src/index.ts                       |   4 +
 packages/engine/src/plan-review-continuation.ts    |  38 +++++
 7 files changed, 304 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8792

Fusion-Task-Lineage: 0645c48d-ec92-475d-9e29-73cc22c12df8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 19:31:06 -07:00
gsxdsm
71b13e7888 test(engine): memoize corpus scans in lifecycle-column gate tests
Both gate-admitted census tests re-scanned the whole ~1200-file corpus
redundantly: legacy-column-literal-census ran census() twice in full
(~900ms each) and no-legacy-move-targets re-read the entire tree a second
time in its anti-vacuity case. Memoize the census result and share a
comment-stripped read cache so each tree is scanned once per run.

Fusion-Task-Id: none
2026-08-04 17:03:44 -07:00
gsxdsm
1dc636b8b4 FN-8785: deduplicate queued dependency and scope logs
Persist queue episodes atomically so repeated scheduler and self-healing passes do not duplicate diagnostics.

- Add a queued-episode signature with PostgreSQL migration and task serialization support.
- Route dependency and file-scope queue transitions through the atomic deduplication API.
- Cover repeated and concurrent queue transitions, and update scheduler mocks for the new store API.

Files changed:
 .changeset/fn-8785-queued-log-deduplication.md     |   7 +
 docs/architecture.md                               |   1 +
 .../postgres/queued-episode-transition.pg.test.ts  | 158 +++++++++++++++++++++
 .../src/__tests__/postgres/schema-applier.test.ts  |   9 +-
 .../core/src/postgres/migrations/0000_initial.sql  |   1 +
 .../0044_fn_8785_queued_episode_signature.sql      |   3 +
 packages/core/src/postgres/schema-applier.ts       |  12 +-
 packages/core/src/postgres/schema/project.ts       |   1 +
 packages/core/src/store.ts                         |   5 +-
 packages/core/src/task-store/audit-ops.ts          |  80 +++++++++++
 packages/core/src/task-store/persistence.ts        |   2 +
 packages/core/src/task-store/serialization.ts      |   1 +
 packages/core/src/types/task/task-core.ts          |   5 +
 ...executor-outer-dispatch-dependency-gate.test.ts |  39 +++--
 .../engine/src/__tests__/executor-test-helpers.ts  |   7 +
 .../__tests__/scheduler-overlap-starvation.test.ts |  43 +++++-
 .../__tests__/scheduler-workflow-cutover.test.ts   |  35 +++--
 .../self-healing-completion-fanout.test.ts         |  37 +++++
 packages/engine/src/__tests__/self-healing.test.ts |  25 +++-
 packages/engine/src/executor.ts                    |  16 ++-
 packages/engine/src/scheduler.ts                   |  26 ++--
 packages/engine/src/self-healing.ts                | 117 +++++----------
 22 files changed, 491 insertions(+), 139 deletions(-)

Fusion-Task-Id: FN-8785
Fusion-Task-Lineage: 8d68c243-f24e-4db4-bd1d-b7eda01309f6
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 11:52:15 -07:00
gsxdsm
1d1a7fedab fix(FN-8785): ignore completed duplicate history
Fusion-Task-Id: FN-8785
2026-08-04 10:52:12 -07:00
gsxdsm
9e4a0817db feat: restart the development engine on source changes (#3329)
## Summary

Add an opt-in source-development loop that restarts the dashboard and
engine when runtime TypeScript or JSON changes. Use `pnpm dev:watch`;
`pnpm dev:hmr` now combines Vite UI HMR with the same supervised
API/engine restart path.

The watcher filters tests, fixtures, generated declarations, build
output, and task state. It coalesces bursts with a two-second maximum
wait, waits for the child to acknowledge its IPC listener, and rebuilds
runtime dist artifacts before a source-triggered respawn.

## Safety model

- Close scheduler, triage, heartbeat, mission, routine, self-healing,
and merge admission before checking for active work.
- Let already-running agents reach a safe boundary; do not mutate
durable pause settings.
- Enter the existing graceful exit-code-86 shutdown and supervised
respawn path.
- Retry failed liveness reads and declined restart requests instead of
dropping the pending change.
- Keep ordinary `pnpm dev` behavior unchanged; inherited watch state
does not break nested non-dashboard development commands.

A development restart intentionally replaces the dashboard process, so
transient dashboard connections and project dev-server children
reconnect or restart with it. Agent work is the protected boundary.

## Validation

- `pnpm lint`
- `pnpm test:gate` (753 tests passed across engine, core, PostgreSQL
gate, and CI-shape suites)
- Focused CLI watcher/restart/supervision suites: 40 tests passed
- Focused engine drain/manager suites: 52 tests passed
- `pnpm --filter @runfusion/fusion typecheck`
- `pnpm --filter @fusion/engine typecheck`
- `pnpm verify:fast` (13 steps passed, including CLI build and real
health boot smoke)
- Manual unsupported-command probe confirms explicit `--watch` fails
clearly outside the dashboard command

## Post-Deploy Monitoring & Validation

- Watch for `[fusion:dev] source changed`, `source restart deferred`,
`active work drained`, and `restart requested` logs during the first
watched development session.
- Healthy behavior is one exit-86 respawn per edit batch, no interrupted
active agents, refreshed dist artifacts, and a healthy dashboard after
respawn.
- Investigate repeated restart loops, watcher attachment warnings,
declined restart retries, or liveness-read failures.
- Immediate mitigation is to use ordinary `pnpm dev` without `--watch`;
no production runtime behavior or durable setting needs rollback.
- Validation owner: Fusion maintainers during the first source edit
after merge.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added `pnpm dev:watch` to automatically restart development runtime
processes when source files change.
* Development restarts now wait for active work to finish, preventing
new work from starting during the transition.
* Enhanced `pnpm dev:hmr` with graceful runtime source restarts while
keeping the dashboard available.
  * Rapid source changes are grouped to avoid unnecessary restarts.

* **Documentation**
* Updated development setup and contribution guides with the new watch
workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-04 08:57:30 -07:00
Phil Larson
b00d8adaeb test(engine): fix moved skill resolver fixture import (#3328)
## Summary
- update the CE workflow-step fixture runtime import to the moved
`cli-runtime/skill-resolver.js` path
- align the runtime specifier with the existing type-only import

## Test plan
- `pnpm --filter @fusion/engine exec vitest run --project=engine-default
src/__tests__/ce-workflow-step-executor.test.ts --silent=passed-only
--reporter=dot --maxWorkers=1 --no-file-parallelism` (52 passed)
- `pnpm --filter @fusion/engine typecheck`
- `pnpm check:changesets`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Updated test configuration to reference the correct skill resolver
location.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-04 08:55:01 -07:00
gsxdsm
dd2cb0c8ba fix(FN-8778): preserve planning lock receiver
Fusion-Task-Id: FN-8778
2026-08-04 01:06:44 -07:00
gsxdsm
9939897aab fix: prevent stale planning approvals and review churn (#3327)
## Summary

Planning can no longer approve or execute against evidence from a
superseded dependency episode. Dependency mutations, approval decisions,
recovery, and execution admission now share serialized lifecycle rules,
so stale planner work cannot restore an invalid approval or release an
unplanned task.

Review also converges instead of discovering one blocker per round.
Planning performs a repository-grounded completeness pass up front; Plan
Review batches all independently discoverable blockers and carries an
episode-scoped decision ledger across revisions; code review traces
changed invariants through production consumers and tests. Repeated
feedback still advances the safety budget, while provider failures and
superseded episodes stay outside the remediation ledger.

The dashboard now exposes manual approval only for the intended
exhausted-review state, and refusal/recovery audit events make rejected
lifecycle transitions diagnosable without leaking prompt content.

## Validation

- `pnpm verify:fast` — scoped typechecks/builds, CLI build, and boot
smoke passed.
- Focused Core and Engine regression suites — 511 tests passed.
- `pnpm lint`, strict changeset validation, Core/Engine typechecks, and
package builds passed.

Fixes #3325.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Improved Plan Review approvals, rejections, and replan-cap handling
across task workflows.
* Added cumulative feedback and attempt tracking across repeated
planning reviews.
* Added safer recovery for stalled planning handoffs and interrupted
approval updates.
* **Bug Fixes**
* Prevented stale approvals and unplanned execution after dependency
changes.
* Improved concurrent approval handling, retryability, and
refusal-record deduplication.
  * Refined dashboard approval indicators and responsive approval views.
* **Quality Improvements**
* Strengthened planning and code-review completeness checks and
blocking-finding coverage.
  * Preserved review history while clearly marking outdated approvals.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-04 00:20:08 -07:00