Commit Graph

13287 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
ef99dcd1b0 FN-8894: model advancing clocks in oversight tests
Ensure TaskDetailModal mutation fixtures mirror server update timestamps.

- Add an advancing-clock task fixture helper for mutation responses
- Update desktop and mobile oversight control mocks to use newer task snapshots
- Cover equal-clock merge behavior and document the fixture contract

Files changed:
 docs/testing.md                                    |  6 ++
 .../TaskDetailModal.oversight-controls.test.tsx    | 74 +++++++++++++++++++++-
 .../TaskDetailModal.oversight-mobile.test.tsx      |  3 +-
 .../__tests__/TaskDetailModal.test-helpers.ts      | 15 +++++
 4 files changed, 94 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8894

Fusion-Task-Lineage: 614eb85a-0fbf-4f44-a08d-347f2511499b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:23:54 -07:00
gsxdsm
ccf2ffe93d FN-8854: document rebase settings and configuration audits
Document the worktree rebase controls and configuration audit surfaces.

- Describe worktree rebase defaults, remote resolution, and legacy pipeline reachability
- Explain configuration revisions and Activity Log query contracts
- Add source-aligned documentation contract coverage

Files changed:
 docs/diagnostics.md                                | 22 ++++-
 docs/settings-reference.md                         | 15 ++++
 .../configuration-audit-documentation.test.ts      | 94 ++++++++++++++++++++++
 3 files changed, 130 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8854

Fusion-Task-Lineage: 5807280f-e1da-4847-8337-1c27c8ed695f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:06:44 -07:00
gsxdsm
555316c12f FN-8892: test responsive status badge fallbacks
Cover lifecycle badge fallback behavior across AppModals status surfaces.

- Verify authoritative status refreshes replace stale Planning labels with In Progress lifecycle badges.
- Exercise board, desktop list, mobile list, and detail modal status renderers.
- Isolate task cache and viewport mocks for deterministic responsive assertions.

Files changed:
 .../app/components/__tests__/AppModals.test.tsx    | 145 ++++++++++++++++++++-
 1 file changed, 140 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8892

Fusion-Task-Lineage: 34ccda74-3f29-4bc3-8221-f44983a97a5e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:01:05 -07:00
gsxdsm
56e330f66e FN-8887: fix dependency link test hydration
Align TaskDetailModal dependency tests with the full-task hydration contract.

- Assert that full task details skip mount fetches before dependency navigation
- Cover unscoped dependency requests and slim-task hydration before link fetches
- Preserve click, keyboard, failure, and blocking-link assertions with scoped mocks

Files changed:
 ...etailModal.responsive-and-dependencies.test.tsx | 94 +++++++++++++++++-----
 1 file changed, 73 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-8887

Fusion-Task-Lineage: db910342-4cde-418c-99fa-c0f19498d5e2

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 01:45:52 -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
d59c1b162f FN-8855: enforce configured PR checks before merging
Add configurable Fusion-side PR check gating across merge surfaces.

- Add project required-check settings, validation, UI controls, CLI support, and operator documentation.
- Evaluate configured checks before dashboard and CLI PR merges, accepting successful, skipped, and neutral checks.
- Bind merges to the evaluated PR head SHA to prevent push-and-merge races.
- Cover required-check policy and head-SHA merge behavior with tests.

Files changed:
 .changeset/fn-8855-required-checks.md              |   7 +
 docs/dashboard-guide.md                            |   5 +
 docs/settings-reference.md                         |   1 +
 .../src/commands/__tests__/task-lifecycle.test.ts  |  30 ++++-
 packages/cli/src/commands/task-lifecycle.ts        |  17 ++-
 .../core/src/__tests__/required-checks.test.ts     |  16 +++
 packages/core/src/config/index.ts                  |   1 +
 packages/core/src/config/required-checks.ts        |  16 +++
 packages/core/src/config/settings-schema.ts        |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/types.ts                         |   6 +
 packages/core/src/types/settings/settings-scope.ts |   6 +
 packages/core/src/types/task/task-tracking.ts      |   5 +
 .../settings/__tests__/section-keys.test.ts        |   1 +
 .../app/components/settings/section-keys.ts        |   1 +
 .../settings/sections/MergeSection.search.ts       |   3 +
 .../components/settings/sections/MergeSection.tsx  |  30 ++++-
 .../__tests__/MergeSection.requiredChecks.test.tsx |  50 +++++++
 .../settings-default-descriptions.test.tsx         |   1 +
 packages/dashboard/src/__tests__/github.test.ts    | 123 +++++++++++++++++
 packages/dashboard/src/github.ts                   | 149 +++++++++++++--------
 .../dashboard/src/routes/register-git-github.ts    |  38 ++++--
 .../src/routes/register-task-workflow-routes.ts    |   8 +-
 packages/i18n/locales/en/app.json                  |   4 +-
 24 files changed, 441 insertions(+), 79 deletions(-)

Fusion-Task-Id: FN-8855

Fusion-Task-Lineage: 708e9c27-72be-4925-bf09-5db421bcaa67

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 01:33:06 -07:00
gsxdsm
2809fcb608 FN-8886: fix Git Manager mobile CSS contract tests
Aligns Git Manager mobile CSS assertions with the documented phone breakpoint.

- Target Git Manager assertions at the <768px media query.
- Require stable Git Manager selectors before checking phone layout rules.

Files changed:
 .../__tests__/core-modals-mobile.test.tsx          | 30 ++++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-8886

Fusion-Task-Lineage: d0de1f25-49db-4674-8d2b-302feb2ebc2a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 01:06:19 -07:00
gsxdsm
601a63709c FN-8878: strengthen mobile FloatingWindow overflow coverage
Protect the shared mobile FloatingWindow sheet overflow contract with focused regression coverage.

- Assert common full-screen geometry for chat, GitHub Import, and Task Detail sheets.
- Verify Task Detail reasserts clipping on phones while other sheets inherit base clipping.
- Prevent visible-overflow overrides for chat and GitHub Import mobile sheets.

Files changed:
 .../__tests__/GitHubImportModal.test.tsx           | 65 ++++++++++++++++++++--
 1 file changed, 59 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-8878

Fusion-Task-Lineage: b631876b-f6a1-4562-8edb-bb77a414f249

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 00:55:03 -07:00
gsxdsm
2d52908d52 FN-8879: preserve local task detail patches
Keep locally authored task-detail updates visible without weakening server snapshot freshness.

- Add a local patch helper that preserves lifecycle guards only for explicitly stale patches.
- Apply id-less local detail updates in modal, split-detail, and main-panel views while rejecting foreign task ids.
- Cover equal-clock, lifecycle, and split-detail patch behavior with dashboard tests.
- Add a patch changeset for visible PR and review updates.

Files changed:
 .changeset/fn-8879-detail-task-patch.md            |  7 ++
 packages/dashboard/app/components/ListView.tsx     | 15 +++--
 .../app/components/__tests__/ListView.test.tsx     | 21 ++++++
 .../app/components/dashboard/MainContent.tsx       |  6 +-
 .../MainContent.detail-task-patch.test.tsx         | 77 ++++++++++++++++++++++
 .../app/hooks/__tests__/useModalManager.test.ts    | 42 ++++++++++++
 .../__tests__/useTasks-hydration-freshness.test.ts | 61 ++++++++++++++++-
 packages/dashboard/app/hooks/useModalManager.ts    | 15 +++--
 packages/dashboard/app/hooks/useTasks.ts           | 45 +++++++++++++
 9 files changed, 275 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8879

Fusion-Task-Lineage: 7166b597-c4c7-491a-a9d8-856fa820865e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 00:47:50 -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
ec52a9131a FN-8859: add native roadmap embeds to chat
Enable roadmap structures to open, preview, and embed directly from chat and dashboard views.

- Register roadmap views as native structures with chat-reference support.
- Add composer previews, in-place dashboard embedding, and drag-safe interactions.
- Document the native-structure plugin contract and add coverage across supported surfaces.

Files changed:
 .changeset/fn-8859-roadmap-native-structure-embeds.md     |   7 +
 docs/PLUGIN_AUTHORING.md                           |   1 +
 docs/dashboard-guide.md                            |   6 +-
 packages/dashboard/app/components/MessageComposer.tsx   |  16 +-
 packages/dashboard/app/components/__tests__/MessageComposer.test.tsx  | 102 ++++++++++-
 packages/dashboard/app/components/__tests__/overflowViewRegistry.test.tsx | 68 +++++++-
 packages/dashboard/app/components/dashboard/MainContent.tsx | 22 ++-
 packages/dashboard/app/components/dashboard/__tests__/MainContent.native-structure-roadmap.test.tsx | 188 +++++++++++++++++++++
 packages/dashboard/app/components/nativeStructureChatRef.ts | 4 +-
 packages/dashboard/app/components/overflowViewRegistry.tsx | 34 ++--
 packages/dashboard/app/plugins/types.ts            |  10 +-
 packages/dashboard/app/utils/__tests__/nativeStructureDrag.test.ts | 46 +++--
 packages/dashboard/app/utils/nativeStructureDrag.ts | 18 +-
 plugins/fusion-plugin-roadmap/src/dashboard-view.tsx | 7 +-
 plugins/fusion-plugin-roadmap/src/dashboard/RoadmapsView.tsx | 22 ++-
 plugins/fusion-plugin-roadmap/src/dashboard/__tests__/RoadmapsView.test.tsx | 51 ++++++
 16 files changed, 560 insertions(+), 42 deletions(-)

Fusion-Task-Id: FN-8859

Fusion-Task-Lineage: 99a7292b-2a06-4325-8131-ca74431214e3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 23:54:40 -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
fb125b6f5e FN-8852: exclude heartbeat writes from revision history
Prevent liveness bookkeeping from evicting real settings changes while making revision history pageable.

- Exclude engineLastActiveAt from project revision snapshots and preserve its live value during rollback.
- Add validated limit/offset paging with hasMore to configuration revision stores and the API.
- Cover heartbeat filtering, rollback compatibility, and paging contracts; document the behavior and add a patch changeset.

Files changed:
 .changeset/fn-8852-config-revision-heartbeat.md    |   7 +
 docs/settings-reference.md                         |   4 +
 docs/storage.md                                    |   6 +
 .../__tests__/configuration-revision-store.test.ts | 178 ++++++++++++++++++++-
 .../configuration-revision-heartbeat.pg.test.ts    | 118 ++++++++++++++
 .../async-configuration-revision-store.ts          |  46 ++++--
 .../src/config/configuration-revision-store.ts     |   9 +-
 packages/core/src/config/global-settings.ts        |   2 +-
 packages/core/src/config/settings-schema.ts        |  20 +++
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/task-store/task-mutation-ops.ts  |  24 ++-
 packages/core/src/types.ts                         |   6 +
 packages/core/src/types/settings/settings-scope.ts |   3 +
 .../register-org-portability-routes.test.ts        |  19 ++-
 .../src/routes/register-org-portability-routes.ts  |  18 ++-
 16 files changed, 437 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-8852

Fusion-Task-Lineage: 46d5ac9d-d2c0-4294-a5f7-d228fcb341c9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 23:16:01 -07:00
gsxdsm
65bf3097ff FN-8857: invalidate stale task dispatch routes
Clear persisted effective routes whenever an eligible task node override changes.

- Add route invalidation logic that preserves checkout-bound and explicit replacement routes.
- Cover in-memory and PostgreSQL task-update scenarios, including partial snapshot replacements.
- Document the dispatch snapshot invalidation behavior and add a patch changeset.

Files changed:
 .changeset/fn-8857-stale-effective-route.md        |   7 +
 docs/architecture.md                               |   6 +-
 docs/task-management.md                            |   4 +-
 .../__tests__/effective-route-invalidation.test.ts | 101 ++++++++++++++
 .../postgres/task-node-override.pg.test.ts         |  63 +++++++++
 ...ask-update-effective-route-invalidation.test.ts | 148 +++++++++++++++++++++
 packages/core/src/index.ts                         |   5 +
 .../core/src/mesh/effective-route-invalidation.ts  |  58 ++++++++
 packages/core/src/task-store/task-update.ts        |  40 ++++++
 9 files changed, 428 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8857

Fusion-Task-Lineage: ab6c1a40-70b4-4501-ab34-771de288da10

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 23:05:29 -07:00
gsxdsm
53416f6535 FN-8851: attribute settings writes by request source
Record auditable provenance for every configuration mutation.

- Add system and verified/unverified API configuration actors.
- Propagate request provenance through settings, workflow, sync, and portability routes.
- Cover mutation attribution across core persistence and dashboard routes.

Files changed:
 .changeset/fn-8851-settings-attribution.md         |   7 +
 .../postgres/settings-persistence.pg.test.ts       |  17 +++
 .../settings-revision-attribution.test.ts          | 102 ++++++++++++++
 packages/core/src/automation/automation-store.ts   |  11 +-
 packages/core/src/automation/routine-store.ts      |   9 +-
 packages/core/src/config/global-settings.ts        |   5 +-
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/task-store/settings-ops.ts       |   5 +-
 packages/core/src/task-store/task-mutation-ops.ts  |   5 +-
 packages/core/src/types.ts                         |   2 +
 packages/core/src/types/agents/agents.ts           |  12 ++
 .../src/__tests__/auth-middleware.test.ts          |  29 +++-
 .../dashboard/src/__tests__/request-actor.test.ts  |  46 ++++++
 packages/dashboard/src/auth-middleware.ts          |   8 ++
 packages/dashboard/src/request-actor.ts            |  13 ++
 .../register-org-portability-routes.test.ts        |  17 ++-
 .../register-settings-memory-worktrunk.test.ts     |  45 +++++-
 .../__tests__/settings-sync-attribution.test.ts    | 156 +++++++++++++++++++++
 .../src/routes/__tests__/workflow-setting-attribution.test.ts |  73 ++++++++++
 .../src/routes/register-org-portability-routes.ts  |   3 +-
 .../src/routes/register-settings-memory-routes.ts  |   3 +-
 .../src/routes/register-settings-sync-inbound-routes.ts |  18 ++-
 .../src/routes/register-settings-sync-routes.ts    |  18 ++-
 .../src/routes/register-workflow-routes.ts         |   3 +
 25 files changed, 576 insertions(+), 33 deletions(-)

Fusion-Task-Id: FN-8851
Fusion-Task-Lineage: 27a51666-f9ed-4395-99dc-d7ae47f119e1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 22:55:38 -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
1e5d80dd4d FN-8853: record all settings changes in Activity Log
Record all meaningful settings changes in the Activity Log.

- Replace the four-key listener allowlist with safe generic setting diffs.
- Exclude engine churn, redact sensitive values, and cap displayed summaries.
- Add regression coverage, diagnostics guidance, and a patch changeset.

Files changed: .changeset/fn-8853-settings-activity-coverage.md   |   7 ++
 docs/diagnostics.md                                |   4 +
 .../src/__tests__/settings-activity-log.test.ts    | 138 +++++++++++++++++++++
 packages/core/src/task-store/lifecycle-ops.ts      |  40 +++---
 packages/core/src/task-store/settings-activity.ts  |  95 ++++++++++++++
 5 files changed, 260 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8853

Fusion-Task-Lineage: ea072564-0bf1-4a97-8dd8-cde5844b1055

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 21:10:13 -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
b181f20859 FN-8848: show Recommendations for completed tasks
Keep the completed-task Recommendations destination available when no records exist.

- Render a localized empty state without task-creation controls.
- Preserve Recommendations selection until a task leaves the completed column.
- Cover empty states and shared detail entry points with dashboard tests.
- Document the behavior and add a patch changeset.

Files changed:
 .changeset/fn-8848-recommendations-empty-state.md  |  7 +++
 docs/dashboard-guide.md                            |  2 +-
 .../dashboard/app/components/TaskDetailModal.tsx   | 15 ++---
 .../app/components/TaskRecommendationsTab.css      |  5 ++
 .../app/components/TaskRecommendationsTab.tsx      |  5 +-
 .../TaskDetailModal.recommendations.test.tsx       | 21 +++++++
 .../__tests__/TaskDetailModal.summary-tab.test.tsx | 73 +++++++++++++++++++++-
 packages/i18n/locales/en/app.json                  |  1 +
 packages/i18n/locales/es/app.json                  |  1 +
 packages/i18n/locales/fr/app.json                  |  1 +
 packages/i18n/locales/ko/app.json                  |  1 +
 packages/i18n/locales/zh-CN/app.json               |  1 +
 packages/i18n/locales/zh-TW/app.json               |  1 +
 packages/i18n/src/resources.d.ts                   |  1 +
 14 files changed, 125 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-8848

Fusion-Task-Lineage: e200dfba-8113-4ede-a117-f94d221a8e7d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 19:03:14 -07:00
gsxdsm
c0e2ba2ade FN-8836: classify GitHub branch policy merge blocks
Classify ambiguous GitHub merge failures using refreshed pull request state.

- Distinguish branch-protection blocks from true merge conflicts.
- Surface review and required-check blockers in CLI and dashboard merge flows.
- Add regression coverage and a patch changeset.

Files changed:
 .changeset/fn-8836-gh-merge-policy-errors.md       |   7 ++
 .../src/commands/__tests__/task-lifecycle.test.ts  |  55 +++++++++
 packages/cli/src/commands/task-lifecycle.ts        |  14 ++-
 packages/core/src/__tests__/gh-cli.test.ts         |  39 +++++-
 packages/core/src/cli/gh-cli.ts                    |  60 +++++++++-
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 .../dashboard/src/__tests__/routes-github.test.ts  | 131 +++++++++++++++++++++
 .../dashboard/src/routes/register-git-github.ts    |  58 +++++++--
 9 files changed, 351 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-8836

Fusion-Task-Lineage: 7102f5ba-aca9-48cd-a27b-76deb952c4a5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 18:56:43 -07:00
gsxdsm
a61ab834f8 FN-8846: show workflow agents' active tasks
Expose active workflow-linked tasks alongside explicit agent assignments.

- Return a deduplicated, project-scoped union of assigned and active agent tasks.
- Clarify agent task loading, failure, and empty-state copy.
- Cover task visibility across workflow, assignment, project, and viewport states.

Files changed:
 packages/dashboard/app/api/agents/run-audit.ts     |   9 +-
 .../dashboard/app/components/AgentDetailView.tsx   |   6 +-
 .../AgentDetailView.logs-tasks-runs.test.tsx       |  86 ++++++++----
 .../register-agent-runtime-routes.tasks.test.ts    | 154 +++++++++++++++++++++
 .../src/routes/register-agent-runtime-routes.ts    |  17 ++-
 5 files changed, 239 insertions(+), 33 deletions(-)

Fusion-Task-Id: FN-8846

Fusion-Task-Lineage: 38c00c21-711a-4792-87fd-8aa2aff4f07a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 18:35:19 -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
54d1ccb8d5 FN-8835: block unmergeable pull requests
Fail closed before auto-merging pull requests that GitHub reports as unmergeable.

- Require normalized clean mergeability in PR readiness checks.
- Cover protected, behind, conflicting, and unknown PR states across CLI and dashboard tests.
- Add a patch changeset for the corrected auto-merge behavior.

Files changed:
 .changeset/fn-8835-pr-merge-readiness.md           |  7 +++
 .../src/commands/__tests__/task-lifecycle.test.ts  | 21 ++++---
 packages/dashboard/src/__tests__/github.test.ts    | 64 ++++++++++++++++++----
 packages/dashboard/src/github.ts                   | 11 ++++
 4 files changed, 84 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-8835

Fusion-Task-Lineage: 698dacf9-5f24-42b7-b927-ae5b5579ee3f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 18:13:52 -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
03f84d406c chore(release): v0.76.0-beta.0
Version bump via changesets.
2026-08-08 14:25:19 -07:00
gsxdsm
168f7fb9cc FN-8834: clarify mission merge behavior and branch details
Clarify mission merge options and safely surface shared-branch status in Mission Manager.

- Reuse merge behavior guidance across mission create and edit forms.
- Add a manual mission-create link while preserving AI planning as the primary CTA.
- Guard branch-group details against stale or foreign mission data and cover the behavior with tests.
- Update localized copy, mission documentation, and the published-package changeset.

Files changed:
 .changeset/fn-8834-mission-merge-guidance.md       |   7 +
 docs/missions.md                                   |   2 +-
 packages/dashboard/app/components/MissionManager.css    |  26 ++
 packages/dashboard/app/components/MissionManager.tsx    | 169 +++++++++----
 packages/dashboard/app/components/__tests__/MissionManager.auto-merge.test.tsx   | 271 +++++++++++++++++++--
 packages/i18n/locales/en/app.json                  |   1 +
 packages/i18n/locales/es/app.json                  |   1 +
 packages/i18n/locales/fr/app.json                  |   1 +
 packages/i18n/locales/ko/app.json                  |   1 +
 packages/i18n/locales/zh-CN/app.json               |   1 +
 packages/i18n/locales/zh-TW/app.json               |   1 +
 packages/i18n/src/resources.d.ts                   |   1 +
 12 files changed, 411 insertions(+), 71 deletions(-)

Fusion-Task-Id: FN-8834

Fusion-Task-Lineage: 43b28c43-83d5-41cf-a9ec-0e91117ec091

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 10:36:36 -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
15418d2936 FN-8831: document ephemeral agent default
Document the canonical enabled default for the routing-inert ephemeral-agent compatibility setting.

- Add the enabled default to Settings help and English localization.
- Cover the help text and canonical-default inventory with dashboard tests.
- Update operator documentation and add a patch changeset.

Files changed:
 .changeset/fn-8831-settings-default-description.md         |  7 +++++++
 docs/dashboard-guide.md                                    |  4 ++--
 .../components/__tests__/SettingsModal.general.test.tsx    | 14 ++++++++++++++
 .../app/components/settings/sections/GeneralSection.tsx    |  6 +++++-
 .../__tests__/settings-default-descriptions.test.tsx       | 12 +++++++++---
 packages/i18n/locales/en/app.json                          |  1 +
 6 files changed, 38 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-8831

Fusion-Task-Lineage: 11ab2275-cfbc-4778-ba0c-466520d2e0fc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 23:31:59 -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
1f5c44ac71 FN-8826: restore WIP lifecycle badges
Restore visible lifecycle badges for empty-status tasks in WIP lanes.

- Derive fallback badge labels from resolved workflow WIP traits and lane names
- Render the fallback consistently on board cards and desktop/mobile list rows
- Cover empty, custom-lane, populated, and paused status precedence

Files changed:
 .changeset/fn-8826-dashboard-wip-badge.md          |  7 +++
 packages/dashboard/app/components/ListView.tsx     | 37 +++++++++++--
 packages/dashboard/app/components/TaskCard.tsx     | 19 +++++--
 .../app/components/__tests__/ListView.test.tsx     | 61 ++++++++++++++++++++++
 .../app/components/__tests__/TaskCard.test.tsx     | 38 +++++++++++++-
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    | 24 +++++++++
 6 files changed, 177 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-8826

Fusion-Task-Lineage: fd9c857a-a25f-44d0-ae66-502bc1bd860e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 20:33:42 -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
10c7dd6972 fix: let a node be re-attempted after its previous attempt ended terminal
Tasks were parking with:

  Workflow principal fence write failed at node 'step-execute' — Workflow work
  item <id> is terminal (cancelled) and cannot be requeued as running

A work item is keyed on (project_id, run_id, task_id, node_id, kind), and a
node's fence run id is DERIVED rather than per-attempt
(`<taskId>:<workflowId>:<nodeInstanceId>`), so every attempt at a node instance
targets the same row. Fence rows are terminalized at the end of every run, so
the SECOND visit to any node hit upsertWorkflowWorkItem's terminal guard and
failed the fence closed. Retries, rework cycles (maxReworkCycles) and operator
re-dispatch all make a second visit ordinary, so this caught any task that did
not clear a node on its first pass — every step-execute row in the affected
database was already terminal (succeeded, failed, or cancelled).

The guard is correct; the identity was wrong — a new attempt is a new work item.
replaceActiveTaskWorkflowContinuation is the sanctioned single writer for a task
continuation and its contract is already "retire the predecessor, install the
successor", so it now drops a TERMINAL row occupying the exact target key inside
the same locked transaction before upserting. Bounded and non-destructive: at
most one row per (task, node instance), the dropped row is finished work, and
its transitions are already in run-audit. Terminal rows for other nodes are
untouched and upsertWorkflowWorkItem still refuses to resurrect a terminal row
for every other caller.

Existing stuck rows heal on their next dispatch; no migration or cleanup needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 20:01:41 -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
0fda8b203b test: bind a project partition in the PG harness for built-in agent provisioning
FN-8764 made AgentStore.init() unconditionally provision the four durable
built-in workflow-owner agents, and that provisioning needs a bound
asyncLayer.projectId — backendProjectId rejects the empty/unbound partition so a
shared cluster cannot mix ownership. Every AgentStore-backed PG test therefore
threw in init(); without this change all 10 cases in agent-instructions.pg.test
fail at agent-store.ts:526.

createTaskStoreForTest / createSharedPgTaskStoreTestHarness gain an OPT-IN
projectId. Undefined keeps the historical project-agnostic harness (RLS bypass,
empty-string partition) that the rest of the core suite relies on. When set, the
connection GUC `fusion.project_id`, the AsyncDataLayer, and the seeded config row
all share one partition — so agents (explicit project_id) and their config
revisions (GUC-default project_id) land together and the
(project_id, agent_id) FK on agent_config_revisions holds.

Also folds in two already-merged consequences: serve.test expects the
consumerId: "engine" that serve.ts:326 already passes (FN-8685), and the
auto-generated Fusion skill docs pick up fn_workflow_step_resume, the roles /
max_workflow_sessions agent fields, and the deprecated singular role.

Uncommitted in the working tree; reviewed, verified against the real database,
and committed as-is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 17:33:56 -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