Commit Graph

2259 Commits

Author SHA1 Message Date
gsxdsm
a1b7556c7b FN-5924: throttle OAuth expiry alerts across restarts
Persist OAuth expiry alert state so repeated provider expiry warnings are suppressed for 12 hours across engine restarts.

- add a persisted OAuth alert state store under ~/.fusion/agent and share it between the expiry monitor and startup validity logger
- throttle repeated oauth-token-expired notifications and startup expiry warnings per provider for 12 hours, while clearing stale state when providers disappear or change
- cover persisted throttling, restart behavior, failure handling, and wiring updates in engine notification tests
- document the persisted 12-hour OAuth alert throttle and add a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5924-oauth-alert-throttle.md         |   5 +
 docs/settings-reference.md                         |   4 +-
 packages/engine/src/__tests__/project-engine-soft-delete-merge-abort.test.ts |   3 +
 packages/engine/src/__tests__/project-engine.test.ts    |  17 ++-
 packages/engine/src/__tests__/reliability-interactions/soft-delete-in-flight-abort.test.ts            |   3 +
 packages/engine/src/auth-storage.ts                |   6 +-
 packages/engine/src/notification/__tests__/oauth-alert-state.test.ts            |  72 ++++++++++
 packages/engine/src/notification/__tests__/oauth-expiry-monitor.test.ts         | 148 ++++++++++++++++---
 packages/engine/src/notification/__tests__/oauth-validity-logger.test.ts        | 159 ++++++++++++++++++---
 packages/engine/src/notification/index.ts          |   3 +
 packages/engine/src/notification/oauth-alert-state.ts   | 144 +++++++++++++++++++
 packages/engine/src/notification/oauth-expiry-monitor.ts       |  12 +-
 packages/engine/src/notification/oauth-validity-logger.ts      |  16 ++-
 packages/engine/src/project-engine.ts              |  13 +-
 14 files changed, 554 insertions(+), 51 deletions(-)

Fusion-Task-Id: FN-5924
Fusion-Task-Lineage: 83255a25-40c7-44d4-8302-b068ae51250e
2026-06-02 23:13:16 -07:00
gsxdsm
ee00d9f1b7 FN-5928: enforce surface enumeration for bug-fix invariants
Require bug-fix specs and reviews to enumerate affected surfaces and reject repro-only regression coverage.

- add a required `## Surface Enumeration` section to triage prompt templates and bug-fix planning guidance
- tighten reviewer guidance to block missing surface enumeration and repro-only regression tests
- document the canonical surface checklist in `docs/testing.md` and cover the new wording with prompt/reviewer tests

Files changed:
 AGENTS.md                                         |  6 ++--
 docs/testing.md                                   |  9 +++++
 packages/core/src/__tests__/agent-prompts.test.ts | 22 ++++++++++++
 packages/core/src/agent-prompts.ts                | 16 +++++++++
 packages/engine/src/__tests__/reviewer.test.ts    | 17 ++++++++++
 packages/engine/src/__tests__/triage.test.ts      | 41 ++++++++++++++++++++---
 packages/engine/src/reviewer.ts                   |  3 ++
 packages/engine/src/triage.ts                     | 24 +++++++++++++
 8 files changed, 131 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5928
Fusion-Task-Lineage: 717ddcbe-f3a6-4589-ad90-4e640f7a9ff2
2026-06-02 21:57:21 -07:00
gsxdsm
a8f91e9cc8 fix(FN-5930): remove duplicate const in afterEach cleanup
The FN-5930 squash merge combined two wait-for-exit strategies,
leaving a shadowed 'const exited' and double await. Collapse to
a single register-before-kill pattern.

Fusion-Task-Id: FN-5930
2026-06-02 21:42:38 -07:00
gsxdsm
3ac02ccdd3 FN-5930: stabilize verification spawn supervision test
Reduce flakiness in the real-git verification spawn supervision test.\n\n- write the child PID to stdout with an awaited newline flush before the parent exits\n- collapse the scenario branching so the SIGTERM path is mutually exclusive with crash handling\n- await parent process exit during cleanup and document coverage across normal, signal, and crash teardown paths\n\nFiles changed:\n .../verification-spawn-supervision.real-git.test.ts              | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5930

Fusion-Task-Lineage: 20c3fe73-a640-4c34-8a07-edf5bdda4b25
2026-06-02 21:38:03 -07:00
gsxdsm
821d724628 Fix tests 2026-06-02 21:37:16 -07:00
gsxdsm
bddc876d10 Fix tests 2026-06-02 21:10:00 -07:00
gsxdsm
6d3a077539 FN-5912: separate planning summary button loading states
Keep planning summary actions responsive with operation-specific loading indicators.

- pass separate single-task and breakdown loading flags into the planning summary view
- show the Creating spinner only on Create Single Task and the Breaking down spinner only on Break into Tasks while keeping the sibling action disabled
- add regression coverage for both pending-action paths and normalize the restart integration test temp worktree root under /private/tmp

Files changed:
 .../dashboard/app/components/PlanningModeModal.tsx |  14 ++-
 .../PlanningModeModal.planning-flow.test.tsx       | 138 +++++++++++++++++++++
 .../src/__tests__/restart.integration.test.ts      |   7 +-
 3 files changed, 151 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-5912

Fusion-Task-Lineage: b93da566-0c2b-4ff8-83ea-b6e009dfd650
2026-06-02 20:47:42 -07:00
gsxdsm
9a58c8efac Clean up agents 2026-06-02 20:14:24 -07:00
gsxdsm
0041962309 FN-5915: show unread badge on header mailbox
Add unread mailbox status to the desktop header toggle while keeping pending approvals prioritized.

- show an unread status dot on the desktop header mailbox toggle when unread mail exists without pending approvals
- keep pending-approval indicators taking precedence and hide mailbox indicators while the mailbox view is active
- extend Header coverage for unread-only, pending-only, combined, zero-count, and active-mailbox states
- update restart integration coverage to reuse an existing worktree during orphaned resume concurrency

Files changed:
 docs/dashboard-guide.md                            |  2 +-
 packages/dashboard/app/components/Header.tsx       |  9 +++++--
 .../app/components/__tests__/Header.test.tsx       | 26 ++++++++++++++++---
 .../src/__tests__/restart.integration.test.ts      | 29 ++++++++++++++++++++--
 4 files changed, 58 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-5915

Fusion-Task-Lineage: 3a207e2c-ca58-402f-94cf-3a9e514fe263
2026-06-02 19:19:33 -07:00
gsxdsm
cf23c6f571 FN-5909: run configured merge bootstrap before verification
Ensure AI merge verification reuses the configured worktree bootstrap command.

- run merge dependency sync unconditionally when a non-blank worktreeInitCommand is configured
- reuse the configured init command instead of inferred package-manager install commands during merge verification
- add merger verification coverage for warm/cold worktrees, inferred-install fallback, and whitespace-only init commands
- document the expanded worktreeInitCommand behavior and add a published changeset

Files changed:
 .changeset/fn-5909-merge-install-script.md         |   5 +
 docs/settings-reference.md                         |   2 +-
 packages/engine/src/__tests__/merger-verification.test.ts      | 159 +++++++++++++++------
 packages/engine/src/merger.ts                      |  30 +++-
 4 files changed, 143 insertions(+), 53 deletions(-)

Fusion-Task-Id: FN-5909

Fusion-Task-Lineage: 8530c641-9574-45e2-b9ac-82e42c9c00a7
2026-06-02 18:43:29 -07:00
gsxdsm
cc18206bc5 FN-5902: make mission validation AI-run all criteria
Route every mission feature through validator-backed completion checks.

- lazily restore a managed feature assertion before validation instead of auto-passing zero-assertion features
- thread milestone acceptance criteria into validator prompts and system instructions as enforced requirements
- update MissionManager copy/tests to present criteria as AI-validated runtime gates and remove informational-only/zero-assertion warnings
- document the all-criteria AI-run contract and add a changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5902-mission-validation-ai-run.md    |   5 +
 AGENTS.md                                          |   2 +-
 docs/architecture.md                               |   2 +-
 docs/missions-completion-contract.md               | 198 ++++++---------------
 docs/missions.md                                   |   5 +-
 packages/core/src/__tests__/mission-store.test.ts  |  23 ++-
 packages/core/src/mission-store.ts                 |  10 ++
 packages/dashboard/app/components/MissionManager.css    |  31 ----
 packages/dashboard/app/components/MissionManager.tsx    |  86 +++------
 packages/dashboard/app/components/__tests__/MissionManager.test.tsx   |  60 +++++--
 packages/engine/src/__tests__/mission-execution-loop.test.ts   | 111 +++++++++---
 packages/engine/src/__tests__/reliability-interactions/mission-validation-trigger-gap.test.ts         |  57 +++---
 packages/engine/src/mission-execution-loop.ts      |  78 ++++----
 13 files changed, 318 insertions(+), 350 deletions(-)

Fusion-Task-Id: FN-5902

Fusion-Task-Lineage: 5f25caad-33c9-42ff-822b-1ea092afc29f
2026-06-02 18:11:26 -07:00
gsxdsm
bb87ac0693 FN-5905: remove orphaned .skip stubs from soft-delete test
Remove obsolete placeholder skips from the soft-delete end-to-end suite.

- delete six orphaned `it.skip(...)` stub cases from `soft-delete-end-to-end.test.ts`
- keep the reliability interaction test focused on active end-to-end assertions instead of cross-file placeholder notes

Files changed:
 packages/engine/src/__tests__/reliability-interactions/soft-delete-end-to-end.test.ts | 49 ----------------------
 1 file changed, 49 deletions(-)

Fusion-Task-Id: FN-5905
Fusion-Task-Lineage: 2edd9ef8-e5f4-492e-9bd0-a58963ac2e58
2026-06-02 16:21:07 -07:00
gsxdsm
3b9ff42073 FN-5901: reap stale mission validator runs
Add self-healing recovery for stale mission validator runs left behind after execution ownership disappears.

- add mission-store support to find and reap stale running validator runs, preserving terminal error status and resetting eligible features to needs_fix
- teach the mission execution loop and self-healing maintenance sweep to skip live validations, reap abandoned runs, record audit events, and avoid double-completing runs
- extend regression coverage, mission docs, architecture notes, and add a published-package changeset for the new recovery behavior

Files changed:
 .changeset/fn-5901-validator-run-reaper.md         |   7 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   2 +
 docs/missions.md                                   |  26 ++-
 packages/core/src/__tests__/mission-store.test.ts  |  99 +++++++++
 packages/core/src/mission-store.ts                 |  91 ++++++++
 packages/engine/src/__tests__/mission-execution-loop.test.ts   | 232 +++++++++++++++++++++
 packages/engine/src/__tests__/reliability-interactions/mission-validator-run-reaper.test.ts           | 181 ++++++++++++++++
 packages/engine/src/mission-execution-loop.ts      | 102 +++++++--
 packages/engine/src/runtimes/in-process-runtime.ts |   8 +-
 packages/engine/src/self-healing.ts                |  22 ++
 11 files changed, 746 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-5901

Fusion-Task-Lineage: 87eb2f3f-fc31-4e0a-b0fc-b771f6dc48a3
2026-06-02 15:33:31 -07:00
gsxdsm
65ddb4d4f5 FN-5893: require invariant-level bug regression coverage
Add invariant-first regression guidance to triage prompts and testing docs.

- add an AGENTS standing rule to cover bug-fix invariants across all known surfaces
- update standard, fast, and core triage prompt templates to require invariant-level regression tests
- add triage regression tests that lock the new wording into standard, fast, and core prompts
- link docs/testing guidance back to the new invariant-over-repro rule

Files changed:
 AGENTS.md                                    |  7 ++++++
 docs/testing.md                              |  1 +
 packages/core/src/agent-prompts.ts           |  3 ++-
 packages/engine/src/__tests__/triage.test.ts | 32 ++++++++++++++++++++++++++++
 packages/engine/src/triage.ts                |  6 ++++--
 5 files changed, 46 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5893

Fusion-Task-Lineage: 31c082c6-2a0a-4619-a13b-94dad97eef62
2026-06-02 14:02:36 -07:00
gsxdsm
a6989ed7f4 FN-5891: respect validator model settings in mission validation
Use the configured validator lane when creating mission validation sessions.

- resolve mission validation session models from test mode, assigned agent runtime, and validator/default task settings in precedence order
- surface validation session creation failures as mission validation errors instead of triggering fix-feature retries
- add regression coverage and documentation for mission validation model resolution and error handling

Files changed:
 AGENTS.md                                          |   1 +
 docs/missions.md                                   |   4 +-
 docs/settings-reference.md                         |   6 +-
 .../src/__tests__/mission-execution-loop.test.ts   | 252 ++++++++++++++++++++-
 packages/engine/src/mission-execution-loop.ts      |  63 +++++-
 5 files changed, 316 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-5891

Fusion-Task-Lineage: 6254daee-fb6b-4ebb-9fb4-3636237404b1
2026-06-02 12:38:09 -07:00
gsxdsm
8156382d76 FN-5889: suppress post-done continuation wedges
Keep completed post-done continuation errors from wedging review tasks in a failed state.

- route step-session non-continuable continuation errors through the executor recovery path before marking tasks failed
- add self-healing recovery and run-audit events for in-review tasks already wedged by post-done non-continuable errors
- extend reliability coverage and architecture/backstop docs for the new post-done wedge handling

Files changed:
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   3 +-
 packages/engine/src/__tests__/reliability-interactions/post-done-continuation-no-wedge.test.ts        | 131 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    |  11 +-
 packages/engine/src/run-audit.ts                   |   2 +
 packages/engine/src/self-healing.ts                |  97 ++++++++++++++-
 6 files changed, 236 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-5889

Fusion-Task-Lineage: c22716f2-cddb-4c98-ac87-0282017e7c82
2026-06-02 11:03:18 -07:00
gsxdsm
d9e1cdbbd7 FN-5890: include task description in ntfy task-created notifications
Ensure agent-created ntfy notifications fall back to the task description when the title is still empty.

- pass task descriptions through task-created notification payloads
- cover empty-title task creation in notification service tests
- verify ntfy task-created messages render the id+description fallback
- add a patch changeset for the published CLI package

Files changed:
 .changeset/fn-5890-task-created-title.md                 |  5 +++++
 .../engine/src/__tests__/notification-service.test.ts    | 12 +++++++++++-
 packages/engine/src/__tests__/ntfy-provider.test.ts      | 16 ++++++++++++++++
 packages/engine/src/notification/notification-service.ts |  1 +
 4 files changed, 33 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5890

Fusion-Task-Lineage: 4a67a4d0-c3a8-4923-a506-7a67a8836127
2026-06-02 10:29:34 -07:00
gsxdsm
742a564491 FN-5888: retry non-continuable sessions with a fresh session
Retry incomplete executor work with a fresh session after non-continuable session errors.

- add executor recovery handling that clears session state and requeues incomplete tasks to todo while retry budget remains
- preserve terminal failure behavior once the fresh-session retry budget is exhausted
- extend reliability coverage and AGENTS.md backstop notes for the new retry path

Files changed:
 AGENTS.md                                          |  1 +
 .../post-done-continuation-no-wedge.test.ts        | 48 +++++++++++++++++++++-
 packages/engine/src/executor.ts                    | 40 ++++++++++++++++++
 3 files changed, 87 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5888

Fusion-Task-Lineage: 4ebce260-8923-4599-aced-541533b94543
2026-06-02 10:14:20 -07:00
gsxdsm
0006408181 FN-5874: persist fast-forward merge details
Persist merge metadata for AI fast-forward landings and done-task recovery.

- capture landed files and shortstat metadata from the single landed commit in the AI merge finalizer
- persist mergeDetails and modifiedFiles for landed squash commits, and record commit associations without setting no-op attribution flags
- extend done-task self-healing to backfill merge metadata when baseCommitSha exists but mergeDetails is empty
- add reliability and self-healing coverage for landed-file persistence, empty AI merges, and recovery behavior

Files changed:
 AGENTS.md                                          |   1 +
 .../ai-merge-ff-landed-files.test.ts               | 150 +++++++++++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts |  76 +++++++++++
 packages/engine/src/merger-ai.ts                   |  40 +++++-
 packages/engine/src/merger.ts                      |  30 ++++-
 packages/engine/src/self-healing.ts                |  11 +-
 6 files changed, 303 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-5874

Fusion-Task-Lineage: a407910c-9ce8-4049-86ef-e80f045c981a
2026-06-02 08:35:47 -07:00
gsxdsm
7d20a997b9 FN-5872: clear active-session registry on PR cleanup
Ensure PR-mode merge cleanup removes stale active-session registry state before deleting worktrees.

- unregister the task worktree from the active-session registry during merged-task artifact cleanup
- export the active-session registry from the engine entrypoint for lifecycle cleanup usage
- add CLI and engine regression coverage for registry cleanup and missing-entry best-effort behavior
- add a patch changeset for the published CLI package

Files changed:
 .changeset/fn-5872-registry-cleanup.md             |  5 ++++
 .../src/commands/__tests__/task-lifecycle.test.ts  | 29 +++++++++++++++++++++-
 packages/cli/src/commands/task-lifecycle.ts        |  8 +++++-
 .../pr-mode-worktree-invariants.test.ts            | 11 +++++---
 packages/engine/src/index.ts                       |  1 +
 5 files changed, 49 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-5872

Fusion-Task-Lineage: d4db24a3-7ae0-4d07-b029-7f30b2f65d2e
2026-06-02 07:46:38 -07:00
gsxdsm
f4cbaed494 FN-5866: suppress post-done non-continuable session errors
Keep completed executor work in review when session continuation is no longer possible.

- detect non-continuable session errors separately from unsupported message role failures
- suppress post-done continuation errors once task work is already complete and clear any failed state before review handoff
- add regression coverage for completed vs incomplete continuation failures and document the FN-5866 backstop

Files changed:
 AGENTS.md                                          |   1 +
 .../post-done-continuation-no-wedge.test.ts        | 169 +++++++++++++++++++++
 .../src/__tests__/transient-error-detector.test.ts |  27 ++++
 packages/engine/src/executor.ts                    |  41 ++++-
 packages/engine/src/transient-error-detector.ts    |   8 +
 5 files changed, 245 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5866

Fusion-Task-Lineage: b5cffce4-7c14-40f6-b12e-84b9acdf7f50
2026-06-02 01:48:26 -07:00
gsxdsm
e36fb451a8 FN-5863: harden secondary worktree recovery test path
Tighten the branch-conflicts recovery test to use an isolated secondary worktree root.

- create a unique temporary parent directory for the detached secondary worktree
- track the temporary root for cleanup instead of only the nested worktree path
- keep the reanchor regression focused on detached worktree recovery behavior

Files changed:
 packages/engine/src/__tests__/branch-conflicts-recovery.test.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5863

Fusion-Task-Lineage: 6cfb02c0-e9fd-456d-a78b-451e3e0707b2
2026-06-02 00:26:38 -07:00
gsxdsm
de23db3789 FN-5862: bump pi coding agent dependencies to 0.78
Update Fusion to the latest pi coding agent and pi AI dependency release.

- bump @earendil-works/pi-coding-agent from ^0.77.0 to ^0.78.0 in the CLI, dashboard, and engine packages
- bump @earendil-works/pi-ai from ^0.77.0 to ^0.78.0 where it is consumed
- add a patch changeset documenting the published @runfusion/fusion update and refresh the lockfile

Files changed:
 .changeset/fn-5862-pi-coding-agent-0.78.md |   5 +
 packages/cli/package.json                  |   4 +-
 packages/dashboard/package.json            |   2 +-
 packages/engine/package.json               |   4 +-
 pnpm-lock.yaml                             | 193 +++++++++++++++++++----------
 5 files changed, 138 insertions(+), 70 deletions(-)

Fusion-Task-Id: FN-5862

Fusion-Task-Lineage: abdfa987-7ba5-45f7-8bea-3db3329a760c
2026-06-01 23:55:20 -07:00
gsxdsm
7d1708f023 FN-5851: fix goal tool store resolution
Resolve goal tool lookups to the canonical project store from Fusion worktree directories.

- recognize both legacy .worktrees and .fusion/worktrees paths when resolving the project root for pi extensions
- add CLI coverage proving fn_goal_list and fn_goal_show return dashboard-created goals from a Fusion worktree cwd
- extend core worktree-resolution tests and keep the branch conflict recovery test worktree path isolated in tmpdir
- add a patch changeset for the published CLI fix

Files changed:
 .changeset/fn-5851-goal-store-resolution.md        |   5 +
 packages/cli/src/__tests__/goal-store-resolution.test.ts    | 104 +++++++++++++++++++++
 packages/core/src/__tests__/pi-extensions.test.ts  |  14 ++-
 packages/core/src/pi-extensions.ts                 |  12 ++-
 packages/engine/src/__tests__/branch-conflicts-recovery.test.ts    |   2 +-
 5 files changed, 130 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5851

Fusion-Task-Lineage: ec4c8239-b953-4df7-9f72-02e17e4b0851
2026-06-01 23:39:20 -07:00
gsxdsm
f9e551317f Harden fusion.db against recurring corruption
Root cause: node:sqlite SIGSEGVs inside pager_write leave the B-tree
malformed in a way that still opens but fails integrity checks; large
operational-log tables widen the write window where the crash strikes.

- backup: verify every copy with PRAGMA quick_check, quarantine corrupt
  copies as *.corrupt, and never rotate out the last verified-good backup
- db: add Database.recoverIfCorrupt() startup guard (wired into
  TaskStore.init, disk-backed only, opt out via FUSION_DISABLE_DB_AUTORECOVER)
  that rebuilds a malformed db via sqlite3 .recover, preserving the corrupt
  original; also fixes the latent `.recover main` invalid-option bug that made
  recoverDatabase() always fail
- db: drop lost_and_found* scratch tables on init; add pruneOperationalLogs()
- settings: add operationalLogRetentionDays (default 30, 0 = off) and prune
  activityLog/agentLogEntries/runAuditEvents/agentHeartbeats during maintenance
- dashboard: expose retention in Settings -> Backups -> Database Maintenance

Tests: backup 59/59, db 135/135 (incl. real corrupt->recover->reopen),
self-healing cleanup/corruption 10/10, settings 77/77, SettingsModal 460/460.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 21:55:10 -07:00
gsxdsm
e561290174 FN-5846: route shared-group member finalization to shared branch
Ensure shared branch-group members keep their routed shared-branch target through merge finalization and recovery.

- ignore a shared member's default-base branch when resolving branch-group merge routing
- reroute merge-confirmed fast paths and self-healing recovery flows to the branch-group integration branch
- stamp merge target metadata, record member landings, and add regression coverage plus architecture/changeset updates

Files changed:
 .changeset/fn-5846-shared-group-merge-routing.md   |   5 +
 docs/architecture.md                               |   4 +-
 packages/engine/src/__tests__/group-merge-coordinator.test.ts  |  26 +++
 packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts  |  73 +++++--
 packages/engine/src/group-merge-coordinator.ts     |  11 +-
 packages/engine/src/project-engine.ts              |  49 ++++-
 packages/engine/src/self-healing.ts                | 212 ++++++++++++++++++++-
 7 files changed, 357 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-5846

Fusion-Task-Lineage: c8fbf8b8-3cbe-4ee5-96d9-9040bd4f0df5
2026-06-01 20:19:37 -07:00
gsxdsm
130f6f1e9a FN-5834: enforce explicit developer-role compatibility for custom providers
Prevent unsupported developer-role API failures by making provider role compatibility explicit and covered by regression safeguards.

- Add explicit supportsDeveloperRole capability to custom provider metadata/types and wire it through provider registration.
- Update CLI custom-provider registration behavior and tests to persist and validate developer-role compatibility settings.
- Add/adjust engine regression coverage for openai-completions message role conversion, including reasoning-model fallback behavior.
- Document the new custom provider setting and add a published changeset for @runfusion/fusion.

Files changed:
 .changeset/fn-5834-developer-role-compat.md        |  5 ++
 docs/settings-reference.md                         |  2 +-
 packages/cli/src/commands/__tests__/custom-provider-registry.test.ts     | 44 +++++++++++-
 packages/cli/src/commands/custom-provider-registry.ts   |  9 ++-
 packages/core/src/types.ts                         |  5 ++
 packages/engine/src/__tests__/custom-providers-openai-completions.test.ts    | 84 +++++++++++-----------
 6 files changed, 106 insertions(+), 43 deletions(-)

Fusion-Task-Id: FN-5834
Fusion-Task-Lineage: 4edc80c9-5e60-41e4-bce1-662d18255d88
2026-06-01 09:05:18 -07:00
gsxdsm
f76716e55b FN-5833: fix custom Responses API model lookup
Ensure custom OpenAI Responses providers resolve configured models without requiring registry entries.

- update global settings model resolution to preserve custom provider model configuration
- adjust engine custom-provider and fn-agent creation paths to avoid false 'model not found' failures
- add regression tests for OpenAI Responses custom providers and pi create-fn-agent flows
- document the custom provider model behavior and add a changeset for @runfusion/fusion

Files changed:
 .../FN-5833-custom-provider-responses-fix.md       | 10 ++++
 docs/settings-reference.md                         |  2 +-
 packages/core/src/global-settings.ts               | 56 +++++++++----------
 packages/core/src/index.ts                         |  2 +-
 .../custom-providers-openai-responses.test.ts      | 64 ++++++++++++++++++++++
 .../engine/src/__tests__/custom-providers.test.ts  | 33 ++++++++++-
 .../src/__tests__/pi-create-fn-agent.test.ts       | 11 +++-
 packages/engine/src/custom-providers.ts            |  4 +-
 packages/engine/src/pi.ts                          | 21 +++++--
 9 files changed, 162 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-5833

Fusion-Task-Lineage: a59481cf-faf5-42b8-97ce-7b3eca27b4fb
2026-06-01 08:23:02 -07:00
gsxdsm
e16893a3c7 FN-5832: surface unsupported message-role provider errors
Make unsupported provider message-role failures fail fast with actionable operator guidance.

- detect provider errors that reject `messages.[n].role` values via a dedicated transient-error detector helper
- classify unsupported message-role failures as operator-actionable/permanent to prevent retry loops
- annotate `promptSessionAndCheck` failures with model/provider compatibility guidance for imported company-role agents
- add regression tests for role-error detection, operator-actionable classification, and prompt-boundary error hinting
- add a patch changeset for `@runfusion/fusion`

Files changed:
 .changeset/fn-5832-unsupported-message-role.md     |  5 +++
 .../pi-prompt-session-and-check-recursion.test.ts  | 24 +++++++++++++++
 .../src/__tests__/transient-error-detector.test.ts | 36 ++++++++++++++++++++++
 packages/engine/src/pi.ts                          |  8 +++++
 packages/engine/src/transient-error-detector.ts    | 14 ++++++++-
 5 files changed, 86 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5832

Fusion-Task-Lineage: b3f78f0e-d097-4cb7-a652-dc547f46fe1d
2026-06-01 07:53:56 -07:00
gsxdsm
1d3978e20a FN-5820: add shared-branch-group lifecycle regression coverage
Add end-to-end reliability coverage for shared branch group promotion flow.

- add a new reliability interaction test covering concurrent member execution through completion gate and single shared-branch promotion/PR behavior
- document FN-5820 backstop coverage in AGENTS.md for future reliability reference

Files changed:
 AGENTS.md                                          |   1 +
 packages/engine/src/__tests__/reliability-interactions/shared-branch-group-lifecycle.test.ts          | 359 +++++++++++++++++++++
 2 files changed, 360 insertions(+)

Fusion-Task-Id: FN-5820

Fusion-Task-Lineage: 4c7bbc6f-6bf9-4698-bcb9-43d7c98d5bd7
2026-06-01 07:43:25 -07:00
gsxdsm
3373c0beed FN-5830: re-land shared branch promotion gate and API
Reintroduce shared-branch-group completion gating and promotion endpoints with reliability coverage.

- add GroupMergeCoordinator promotion gate behavior and shared branch group promotion logic updates
- expose promotion flow wiring through engine index and project engine APIs
- expand coordinator tests and add reliability interaction coverage for branch-group promotion
- document the new reliability backstop and add a changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5830-branch-group-promotion.md       |   5 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   3 +-
 .../src/__tests__/group-merge-coordinator.test.ts  | 170 ++++++++++++++++++-
 .../branch-group-promotion.test.ts                 | 166 +++++++++++++++++++
 packages/engine/src/group-merge-coordinator.ts     | 183 ++++++++++++++++++++-
 packages/engine/src/index.ts                       |   4 +
 packages/engine/src/project-engine.ts              |  37 +++++
 8 files changed, 566 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5830

Fusion-Task-Lineage: e9823f51-df0e-4da8-8f51-58dfefdc293d
2026-06-01 05:39:01 -07:00
gsxdsm
35ce9bd244 FN-5819: allow shared-group members to merge into group branch with auto-merge off
Allow shared branch-group members to continue member→group integration even when project auto-merge is disabled.

- add core helper to detect shared branch-group member integrations and export it
- update engine in-review enqueue/handoff/startup flows to permit shared-member integration while still honoring global/engine pause gates
- keep self-healing from pulling shared-member in-review tasks backward during auto-merge-off maintenance
- expand project-engine and reliability-interaction tests for shared-member autoMerge-off behavior and add FN-5819 backstop docs updates

Files changed:
 AGENTS.md                                          |  2 +
 docs/architecture.md                               |  3 +-
 packages/core/src/__tests__/task-merge.test.ts     | 37 +++++++++
 packages/core/src/index.ts                         |  1 +
 packages/core/src/task-merge.ts                    | 13 +++
 packages/engine/src/__tests__/project-engine.test.ts    | 64 ++++++++++++++
 packages/engine/src/__tests__/reliability-interactions/branch-group-merge-routing.test.ts             | 48 +++++++++++
 packages/engine/src/__tests__/reliability-interactions/shared-group-member-integration.test.ts        | 97 ++++++++++++++++++++++
 packages/engine/src/project-engine.ts              | 35 ++++----
 packages/engine/src/self-healing.ts                |  3 +-
 10 files changed, 284 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-5819

Fusion-Task-Lineage: b5eeced7-7c47-4573-9ab4-ca577bec65e1
2026-06-01 02:42:36 -07:00
gsxdsm
327f0a9a4f FN-5818: fix shared-branch-group execution to use per-task working branches
Ensure shared branch-group flows consistently derive and acquire per-task working branches.

- update engine merge/executor/scheduler/self-healing paths to resolve task-scoped working branch names instead of shared branch-group names
- adjust worktree acquisition and already-merged detection logic to use the corrected branch resolution
- add regression coverage for shared-branch-group working-branch behavior, worktree acquisition, and worktree name derivation
- add a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5818-shared-branch-working-branch.md |  5 ++
 .../shared-branch-group-working-branch.test.ts     | 53 ++++++++++++++++++++++
 .../src/__tests__/worktree-acquisition.test.ts     | 52 +++++++++++++++++++++
 .../engine/src/__tests__/worktree-names.test.ts    | 20 +++++++-
 packages/engine/src/already-merged-detector.ts     |  6 +--
 packages/engine/src/executor.ts                    | 10 ++--
 packages/engine/src/merger-ai.ts                   |  4 +-
 packages/engine/src/merger.ts                      | 16 +++----
 packages/engine/src/scheduler.ts                   |  6 +--
 packages/engine/src/self-healing.ts                | 12 ++---
 packages/engine/src/worktree-acquisition.ts        |  4 +-
 packages/engine/src/worktree-names.ts              |  9 +++-
 12 files changed, 166 insertions(+), 31 deletions(-)

Fusion-Task-Id: FN-5818

Fusion-Task-Lineage: c7eb1ec4-971a-49ad-9156-5c0349c629aa
2026-06-01 01:37:25 -07:00
gsxdsm
feceedbf7e FN-5803: normalize streamed sentence spacing across message boundaries
Ensure streamed agent text preserves sentence-boundary spacing even when providers split output across message boundaries.

- add stateful streaming delta normalizer that tracks prior text/thinking tail when partial blocks reset
- update executor and PI session subscriptions to use per-session normalizer instances for text_delta and thinking_delta events
- expand streaming-delta tests to cover cross-message/tool-call boundary spacing regressions
- add task notes documenting cross-message spacing refinement

Files changed:
 .../fn-5803-streaming-cross-message-space.md       |  5 ++
 .../engine/src/__tests__/streaming-delta.test.ts   | 86 +++++++++++++++++++++-
 packages/engine/src/executor.ts                    | 13 ++--
 packages/engine/src/pi.ts                          | 24 +++---
 packages/engine/src/streaming-delta.ts             | 44 ++++++++++-
 5 files changed, 155 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-5803

Fusion-Task-Lineage: 8f88d54c-bbc0-44dd-99fc-c69738ce0ca8
2026-05-31 23:24:53 -07:00
gsxdsm
a8c920daf9 chore(release): v0.39.0
Version bump via changesets.
2026-05-31 20:05:32 -07:00
gsxdsm
5930c18b4d FN-5795: send ntfy notification when agents create tasks
Add agent task-created ntfy notifications with configurable settings and coverage.

- add notification plumbing to emit a dedicated event when an agent creates a task
- extend ntfy provider/settings typing and dashboard settings coverage for the new event toggle
- add regression tests for notification service, notifier integration, and ntfy provider behavior
- add a changeset and documentation updates describing the new notification capability

Files changed:
 .changeset/fn-5795-task-created-notification.md    |  9 +++
 docs/architecture.md                               |  4 +-
 docs/settings-reference.md                         |  4 +-
 docs/storage.md                                    |  2 +-
 packages/core/src/types.ts                         |  4 +-
 .../dashboard/app/components/SettingsModal.tsx     |  1 +
 .../components/__tests__/SettingsModal.test.tsx    | 27 +++++++-
 .../src/__tests__/notification-service.test.ts     | 71 ++++++++++++++++++++++
 packages/engine/src/__tests__/notifier.test.ts     |  5 ++
 .../engine/src/__tests__/ntfy-provider.test.ts     | 32 ++++++++++
 .../src/notification/notification-service.ts       | 53 +++++++++++++++-
 packages/engine/src/notification/ntfy-provider.ts  | 21 +++++--
 12 files changed, 220 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-5795

Fusion-Task-Lineage: 4cfa3b46-8e9c-451e-ab2d-b7d5c9bf5968
2026-05-31 19:59:32 -07:00
gsxdsm
fa428a487b FN-5794: run worktree init for fresh merge workspaces
Run merge worktree initialization automatically when a merge workspace is newly created.

- detect when integration worktree creation is fresh and invoke the configured init command
- preserve existing behavior for already-initialized worktrees while improving setup reliability
- add integration tests covering init command execution paths for merge worktree setup

Files changed:
 .changeset/fn-5794-merge-worktree-init.md          |  5 +++
 .../__tests__/merger-integration-worktree.test.ts  | 16 +++++++++
 packages/engine/src/merger.ts                      | 39 +++++++++++++++++++++-
 3 files changed, 59 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5794

Fusion-Task-Lineage: f368099f-a179-466e-b994-2a503167112c
2026-05-31 17:52:57 -07:00
gsxdsm
2140ab2dcf FN-5789: normalize missing sentence spaces in streamed deltas
Repair provider-agnostic streaming deltas so sentence boundaries keep expected spacing in chat and agent logs.

- add shared streaming-delta normalization helpers for text/thinking events
- apply normalization at executor and PI message_update chokepoints before emitting deltas
- add focused engine tests covering punctuation-boundary repairs and no-op cases
- add a patch changeset for @runfusion/fusion describing the fix

Files changed:
 .changeset/fn-5789-streaming-space-repair.md       |  5 ++
 .../engine/src/__tests__/streaming-delta.test.ts   | 84 ++++++++++++++++++++
 packages/engine/src/executor.ts                    | 11 ++-
 packages/engine/src/pi.ts                          | 13 +++-
 packages/engine/src/streaming-delta.ts             | 91 ++++++++++++++++++++++
 5 files changed, 197 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5789

Fusion-Task-Lineage: e60ed2ae-c006-42f9-9ab0-f4e79560fb66
2026-05-31 16:48:28 -07:00
gsxdsm
7b70e7fb72 FN-5788: add group promotion gate to merge coordinator
Add lifecycle wiring so branch-group promotion respects group-level auto-merge gating.

- Extend merge coordinator/merger flow to apply group promotion precedence and pause/override reasons.
- Hook the group-promotion coordinator into engine lifecycle startup.
- Add reliability and coordinator coverage for branch group promotion gating behavior.
- Add release changeset and update architecture/AGENTS backstop notes.

Files changed:
 .changeset/fn-5788-branch-group-promotion-gate.md  |   5 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   3 +-
 .../src/__tests__/group-merge-coordinator.test.ts  |  95 ++++++++++++++-
 .../branch-group-promotion-gate.test.ts            | 129 +++++++++++++++++++++
 packages/engine/src/group-merge-coordinator.ts     |  46 +++++---
 packages/engine/src/index.ts                       |   2 +
 packages/engine/src/merger.ts                      |  34 +++---
 8 files changed, 283 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-5788

Fusion-Task-Lineage: 5930f662-908e-4cf0-a0d4-68b2f4360074
2026-05-31 15:59:59 -07:00
gsxdsm
06d84905ba FN-5783: enforce branch-group autoMerge precedence for shared promotions
Honor group-level autoMerge precedence when promoting shared branch groups.

- add core/store helpers to preserve branch-group autoMerge overrides and resolve effective precedence against task/project settings
- gate branch-group promotion eligibility in engine merge coordination and emit promotion-gated audit metadata
- update dashboard planning/subtask flows for shared mission triage routing and add reliability/unit coverage
- include docs and changeset updates for branch-group autoMerge precedence behavior

Files changed:
 .../fn-5783-branch-group-automerge-precedence.md   |   5 +
 AGENTS.md                                          |   1 +
 docs/settings-reference.md                         |   2 +-
 docs/workflow-steps.md                             |   2 +
 .../core/src/__tests__/branch-group-store.test.ts  |  18 ++++
 packages/core/src/__tests__/task-merge.test.ts     |  18 ++++
 packages/core/src/index.ts                         |   1 +
 packages/core/src/mission-store.ts                 |  13 +++
 packages/core/src/store.ts                         |  17 ++++
 packages/core/src/task-merge.ts                    |   8 ++
 .../dashboard/src/__tests__/mission-e2e.test.ts    |  98 ++++++++++++++++--
 .../src/__tests__/routes-planning.test.ts          | 109 ++++++++++++++++++++-
 packages/dashboard/src/planning.ts                 |   1 +
 .../src/routes/register-planning-subtask-routes.ts |  28 ++++++
 packages/dashboard/src/subtask-breakdown.ts        |   1 +
 .../branch-group-automerge-precedence.test.ts      | 102 +++++++++++++++++++
 packages/engine/src/group-merge-coordinator.ts     |  31 +++++-
 packages/engine/src/merger.ts                      |  30 ++++--
 18 files changed, 466 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-5783

Fusion-Task-Lineage: 74327984-b14f-445c-81cd-5295ee562382
2026-05-31 15:17:11 -07:00
gsxdsm
0c425788cb FN-5782: wire branch groups into merge routing
Connect branch_group metadata through planning and merge execution for grouped integration branches.

- propagate `branchGroup` and `branchGroupName` through core store types, merge metadata, and CLI task lifecycle APIs
- add merge coordination that computes branch-group plans and routes grouped tasks via `group-merge-coordinator`
- extend finalize-plan, merger, and reliability tests to cover grouped merge routing and integration behavior
- document the architecture update and add a patch changeset for `@runfusion/fusion`

Files changed:
 .changeset/fn-5782-branch-group-merge.md           |   7 +
 docs/architecture.md                               |   2 +
 packages/cli/src/commands/__tests__/task-lifecycle.test.ts  |  64 ++++++++-
 packages/cli/src/commands/task-lifecycle.ts        |   4 +
 packages/core/src/__tests__/branch-group-store.test.ts  |  20 +++
 packages/core/src/__tests__/task-merge.test.ts     |  64 +++++++++
 packages/core/src/store.ts                         |  22 ++-
 packages/core/src/task-merge.ts                    |  26 +++-
 packages/core/src/types.ts                         |   2 +-
 packages/engine/src/__tests__/experiment-finalize-plan.test.ts |  33 ++++-
 packages/engine/src/__tests__/group-merge-coordinator.test.ts  |  62 +++++++++
 packages/engine/src/__tests__/reliability-interactions/branch-group-merge-routing.test.ts | 153 +++++++++++++++++++++
 packages/engine/src/experiment/finalize-plan.ts    |  62 +++++++--
 packages/engine/src/group-merge-coordinator.ts     |  51 +++++++
 packages/engine/src/index.ts                       |   4 +
 packages/engine/src/merger.ts                      |  47 ++++++-
 16 files changed, 601 insertions(+), 22 deletions(-)

Fusion-Task-Id: FN-5782
Fusion-Task-Lineage: 0a70cfaa-2379-4955-b295-64de1f3093c8
2026-05-31 13:50:23 -07:00
gsxdsm
f1aba5b534 Merge pull request #1226 from plarson/fix/dirty-integration-merge-block
fix(engine): block dirty integration merge landings
2026-05-31 13:49:58 -07:00
Phil Larson
3dee395d67 fix(engine): block dirty integration merge landings
Refuse AI merge landing on a checked-out dirty integration worktree by default. This prevents Fusion from stashing/restoring unrelated project-root edits into main and then marking tasks done against contaminated state.

Fusion-Task-Id: FN-5780
2026-05-31 13:12:13 -07:00
gsxdsm
9f29935525 FN-5778: throttle OAuth expiry notifications per provider
Limit repeated oauth-token-expired alerts by enforcing a per-provider minimum notification interval.

- add a 12-hour default min notify interval to OAuthExpiryMonitor and track last notification time by provider
- skip dispatch when a provider was already notified within the configured window, even if expiry timestamps change
- clear per-provider notification timestamps when no OAuth providers are configured
- add regression coverage for 12-hour throttling and changed-expiry throttling behavior
- add a patch changeset for @runfusion/fusion documenting the notification throttle

Files changed:
 .changeset/fn-5778-oauth-notify-throttle.md        |  5 +++
 packages/engine/src/notification/__tests__/oauth-expiry-monitor.test.ts         | 40 ++++++++++++++++++++++
 packages/engine/src/notification/oauth-expiry-monitor.ts       | 15 ++++++++
 3 files changed, 60 insertions(+)

Fusion-Task-Id: FN-5778

Fusion-Task-Lineage: a9741101-e8da-4dae-ac7f-817e564b4f23
2026-05-31 11:55:11 -07:00
gsxdsm
69f22c0140 Merge pull request #1221 from plarson/fix/incomplete-stuck-loop-parking
fix(engine): requeue incomplete stuck-loop exhaustion
2026-05-31 11:54:47 -07:00
Phil Larson
a7bd44ca96 fix(engine): split stuck requeue fallback handling 2026-05-31 10:57:54 -07:00
Phil Larson
5a163ce07a fix(engine): resolve stuck-loop requeue review feedback 2026-05-31 10:50:58 -07:00
gsxdsm
93e8a5f78a FN-5775: persist AI merge agent output in merger logs
Ensure AI merger runs persist agent output signals so merge activity is visible in task logs.

- Persist merger agent text, thinking, tool start, and tool result output via AgentLogger in AI merge/review sessions.
- Add regression coverage validating persisted merger agent logs and prompt/commit guidance behavior.
- Add a patch changeset for @runfusion/fusion describing AI merge log persistence.

Files changed:
 .changeset/fn-5775-ai-merge-logs.md             |  5 ++
 packages/engine/src/__tests__/merger-ai.test.ts | 62 +++++++++++++++++++++++++
 packages/engine/src/merger-ai.ts                | 40 +++++++++++++++-
 3 files changed, 105 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5775

Fusion-Task-Lineage: 7e1b803f-135a-412e-81d9-bad0aa655855
2026-05-31 08:50:23 -07:00
Phil Larson
5861884456 fix(engine): requeue incomplete stuck-loop exhaustion 2026-05-31 08:35:36 -07:00
gsxdsm
b154844286 FN-5772: re-anchor nested task worktree paths
Fix executor worktree invariant handling by re-anchoring nested task worktree paths to the actual git top-level.

- add nested worktree root detection that only re-anchors when the top-level is a registered worktree inside the configured worktrees directory
- update executor liveness gating and verifyWorktreeInvariants to persist re-anchored task.worktree values and retry checks safely
- emit a new run-audit git mutation (worktree:reanchored) and add reliability tests/docs coverage plus a patch changeset

Files changed:
 .changeset/fn-5772-worktree-reanchor.md            |  7 +++
 docs/architecture.md                               |  4 +-
 packages/engine/src/__tests__/reliability-interactions/executor-liveness-gate.test.ts                 | 33 ++++++++++
 packages/engine/src/__tests__/verify-worktree-invariants-missing.test.ts     | 62 +++++++++++++++++-
 packages/engine/src/__tests__/worktree-reanchor-nested-root.test.ts          | 73 ++++++++++++++++++++++
 packages/engine/src/executor.ts                    | 54 ++++++++++++++--
 packages/engine/src/run-audit.ts                   |  1 +
 packages/engine/src/worktree-pool.ts               | 63 +++++++++++++++++++
 8 files changed, 290 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5772

Fusion-Task-Lineage: 475de161-7bc1-4359-bb76-20c4c07196d9
2026-05-31 08:32:01 -07:00