Commit Graph

1827 Commits

Author SHA1 Message Date
gsxdsm
bb0f693d79 FN-5751: fix dashboard auto-merge toggle race
Prevent rapid auto-merge toggles from desynchronizing dashboard settings state.

- Track auto-merge state in a ref so each toggle reads and writes the latest value
- Apply optimistic updates from the ref and roll back correctly on failed setting updates
- Add regression coverage for rapid double-toggle behavior in useAppSettings
- Add a patch changeset for @runfusion/fusion describing the dashboard blank-state fix

Files changed:
 .changeset/fn-5751-auto-merge-toggle.md            |  5 ++++
 .../app/hooks/__tests__/useAppSettings.test.ts     | 27 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useAppSettings.ts     | 20 +++++++++++-----
 3 files changed, 46 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-5751

Fusion-Task-Lineage: 1a0090ff-4015-46b8-a974-3accbbdce919
2026-05-30 14:18:15 -07:00
gsxdsm
9c4e8edf39 FN-5733: enforce mission completion-gate assertions for live Goals mission
Realize the mission completion-gate contract by surfacing and enforcing structured assertion coverage for milestone completion.

- add milestone rollup signaling for prose-only acceptance criteria and wire it into mission-store completion gating
- update mission execution loop reliability paths so validator-trigger continuity is preserved across completion and startup recovery
- expose the new rollup flag in dashboard mission types/API and show an autopilot warning badge in MissionManager when prose exists without structured assertions
- extend core, engine, and dashboard tests plus mission docs, and add a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5733-mission-completion-gate.md      | 10 +++
 docs/missions-completion-contract.md               | 11 +++
 docs/missions.md                                   |  4 +
 packages/core/src/__tests__/mission-store.test.ts  | 81 ++++++++++++++++++++
 packages/core/src/mission-store.ts                 | 89 ++++++++++++++++++++++
 packages/core/src/mission-types.ts                 |  2 +
 packages/dashboard/app/api/legacy.ts               |  1 +
 .../dashboard/app/components/MissionManager.css    | 42 +++++++++-
 .../dashboard/app/components/MissionManager.tsx    | 22 +++++-
 .../components/__tests__/MissionManager.test.tsx   | 20 ++++-
 packages/dashboard/app/components/mission-types.ts |  1 +
 .../src/__tests__/mission-execution-loop.test.ts   | 23 ++++++
 .../mission-validation-trigger-gap.test.ts         | 41 ++++++++++
 packages/engine/src/mission-execution-loop.ts      | 21 ++++-
 14 files changed, 357 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-5733

Fusion-Task-Lineage: 259418c6-5404-4773-8fd2-db8d7e9cadd3
2026-05-30 14:07:20 -07:00
gsxdsm
cf95d3636f ci(release): drop macOS Intel (bun-darwin-x64) from binary matrix
macos-13 runners are too scarce — the darwin-x64 leg sat queued for hours
and blocked the release publish job (which needs all build legs). Ship the
CLI Apple-Silicon-only for macOS; desktop macOS DMG/ZIP stays universal.
Removed from release.yml + test-release.yml matrices, updated ci-workflow
assertions (5→4 targets) and RELEASING.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 10:06:51 -07:00
gsxdsm
3255965ad5 FN-5715: gate mission feature completion on assertion validation
Prevent mission-linked done tasks from bypassing assertion validation and recover stalled validation triggers after restart.

- require assertion-linked done features to have a passed validator result before slice/milestone completion
- keep assertion-linked features in progress when linked tasks move to done/archived until validation passes
- restart mission loop recovery when needed and re-trigger done/archived implementing features that still need validation
- add regression coverage for scheduler, mission loop recovery, mission store completion gating, and reliability trigger continuity
- document the new FN-5715 reliability backstop and recovery behavior

Files changed:
 .changeset/fn-5715-mission-validation-trigger.md   |   7 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   1 +
 docs/missions.md                                   |  11 +-
 packages/core/src/__tests__/mission-integration.test.ts |   2 +-
 packages/core/src/__tests__/mission-store.test.ts  |  30 +++-
 packages/core/src/mission-store.ts                 |  19 ++-
 packages/engine/src/__tests__/mission-execution-loop.test.ts   |  95 +++++++++++++
 packages/engine/src/__tests__/reliability-interactions/mission-validation-trigger-gap.test.ts         | 151 +++++++++++++++++++++
 packages/engine/src/__tests__/scheduler.test.ts    |  54 ++++++++
 packages/engine/src/mission-autopilot.ts           |   7 +-
 packages/engine/src/mission-execution-loop.ts      |  25 ++++
 packages/engine/src/mission-feature-sync.ts        |  32 ++++-
 packages/engine/src/scheduler.ts                   |  12 +-
 14 files changed, 431 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-5715

Fusion-Task-Lineage: 98b1cbd6-6b68-40a0-b4b3-c512183adf8b
2026-05-30 09:43:02 -07:00
gsxdsm
805eae4237 fix(ci): scope node_modules cache key per job to stop save races
The Windows desktop build now succeeds (artifact builds + uploads), but the
job was marked failed on the post-job cache *save*: build-binaries
(windows-x64) and build-desktop-windows share runner.os/arch and thus the
same cache key, so concurrent saves hit "unable to reserve cache ... another
job may be creating this cache." Adding github.job to the key gives each job
its own cache and eliminates the race.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 09:09:25 -07:00
gsxdsm
f5e738be14 Merge pull request #1177 from plarson/fix/fn202-dashboard-column-filter
fix: respect dashboard task column filters
2026-05-30 08:40:53 -07:00
gsxdsm
884e677afa fix(build): pin @types/node workspace-wide; make build-exe tests opt-in
(b) Windows desktop build flakily failed with "Property 'ok'/'status' does
not exist on type 'Response'" because the workspace resolved multiple
@types/node versions (incl. an ancient 12.20.55 from @manypkg/find-root that
predates global fetch types). plugin-sdk compiles with lib:["ES2022"] and no
DOM lib, so Response comes solely from @types/node — nondeterministic across
runners. Pin via pnpm.overrides "@types/node": "^25.5.2"; collapses the
lockfile to one version. Verified: plugin-sdk build + desktop + full
workspace typecheck all pass.

Also: build-exe-cross tests cross-compiled all 5 platforms on every CI run
(auto-enabled via Boolean(process.env.CI)) — a release-build dependency in
the normal lane. Made them opt-in (FUSION_TEST_BUILD_EXE=1) and pointed the
root test:slow-cli at the CLI slow lane instead of test:pre-release, so
everyday CI no longer depends on release builds. test:pre-release and
test-release.yml still validate binaries deliberately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 08:39:38 -07:00
gsxdsm
033f74c458 FN-5714: reject linking features to non-active tasks
Gracefully handle feature-to-task linking when the referenced task is archived, deleted, or missing.

- enforce active-board task validation in mission store linkage path with clear error text
- return surfaced validation errors from fn_feature_link_task instead of throwing opaque failures
- add regression coverage in core and CLI extension tests for archived/non-active task references
- add changeset and sync Fusion skill reference docs with the new fn_feature_link_task behavior

Files changed:
 .changeset/fn-5714-link-archived-task.md           |  5 +++
 .../cli/skill/fusion/references/extension-tools.md |  2 +-
 .../skill/fusion/references/fusion-capabilities.md |  2 +-
 packages/cli/src/__tests__/extension.test.ts       | 50 ++++++++++++++++++++++
 packages/cli/src/extension.ts                      | 35 +++++++++------
 packages/core/src/__tests__/mission-store.test.ts  | 17 ++++++++
 packages/core/src/mission-store.ts                 |  9 ++++
 7 files changed, 106 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-5714

Fusion-Task-Lineage: d84c45cf-0a0d-47a3-81c5-f99d16e03ecf
2026-05-30 08:39:38 -07:00
gsxdsm
3b594879a8 FN-5713: add mission update tool and docs
Add mission-update support to Fusion tooling and document it across mission references.

- register new `fn_mission_update` extension tool to patch mission title/description with validation and not-found handling
- add extension tests covering successful mission updates and error cases
- allowlist `fn_mission_update` in workflow-step readonly gating policy tests and classifications
- update Fusion skill and mission docs to describe mission updates and extension tool usage
- add a changeset for `@runfusion/fusion` patch release

Files changed:
 .changeset/fn-5713-mission-update-tool.md          |  5 ++
 docs/missions.md                                   | 13 ++++
 packages/cli/skill/fusion/SKILL.md                 |  2 +-
 packages/cli/skill/fusion/references/extension-tools.md | 10 +++
 packages/cli/skill/fusion/references/fusion-capabilities.md |  1 +
 packages/cli/src/__tests__/extension.test.ts       | 71 ++++++++++++++++++++++
 packages/cli/src/extension.ts                      | 69 +++++++++++++++++++++
 packages/engine/src/__tests__/workflow-step-readonly-allowlist.test.ts |  1 +
 packages/engine/src/gating-classifications.ts      |  1 +
 9 files changed, 172 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5713
Fusion-Task-Lineage: e491973a-2d5d-4ef8-bf13-39b3669918ee
2026-05-30 08:39:38 -07:00
Phil Larson
6ba3cbf495 fix: respect dashboard task column filters 2026-05-30 08:29:04 -07:00
Phil Larson
f8bda56716 fix(FN-166): bypass coordination-only overlap leases
Fusion-Task-Id: FN-166
2026-05-30 06:47:02 -07:00
gsxdsm
b5178fd9ee fix(release): match electron-builder x64 AppImage name in Linux verify
electron-builder emits Fusion-<v>-linux-x86_64.AppImage for x64 (deb uses
amd64, tar.gz uses x64). The verify step globbed -linux-x64.AppImage and
failed with "No Fusion Linux x64 AppImage artifacts produced" even though
the AppImage built. Upload globs already used the broad -linux-*.AppImage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:17:54 -07:00
gsxdsm
e153d00ee2 fix(desktop): declare author email so Linux .deb build succeeds
electron-builder's fpm target requires author 'email' in package.json;
without it the arm64/x64 .deb build failed (`Please specify author 'email'`).
Surfaced once the electron-builder --x64 --arm64 flags actually parsed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:02:30 -07:00
gsxdsm
4148f43ce4 fix(release): honor --publish never, guard Windows signing, fix desktop spawn
Second pass after the cache/arch fix unblocked `pnpm build` and surfaced
later-stage failures:

- Desktop packaging called `pnpm --filter @fusion/desktop dist:mac -- <args>`,
  but pnpm leaks the `--` separator into the script args. electron-builder
  stops parsing at `--`, so `--publish never` was ignored — it auto-published
  to api.github.com/repos/gsxdsm/fusion/releases and 404'd. The same leak
  dropped Linux's `--x64 --arm64`. Switch all four desktop packaging steps to
  `pnpm --filter @fusion/desktop exec electron-builder ...`, which forwards
  args cleanly (verified locally).
- Windows CLI signing now skips when WINDOWS_CERTIFICATE_BASE64 is absent,
  mirroring the macOS guard (was hard-failing the bun-windows-x64 job).
- Desktop build spawns workspace .cmd bins with shell:true on Windows; Node
  rejects .cmd/.bat spawns without a shell (EINVAL) since CVE-2024-27980,
  which broke `@fusion/desktop build` on the Windows runner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 00:30:39 -07:00
gsxdsm
f659a07a25 chore(release): v0.38.1
Version bump via changesets.
2026-05-30 00:18:41 -07:00
gsxdsm
bad8f52c5c chore: add patch changesets for release fix and mission mobile layout
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 00:16:04 -07:00
gsxdsm
45d22586dc chore(release): v0.38.0
Version bump via changesets.
2026-05-29 23:17:31 -07:00
gsxdsm
4a60c2ac41 FN-5708: backfill files changed chip on done task cards
Ensure freshly done task cards show the "N files changed" chip once mergeDetails diff stats arrive.

- backfill TaskCard diff stat display logic so completed cards update when mergeDetails enrichment lands after initial render
- update useTaskDiffStats to derive files-changed counts from merge details with fallback-safe behavior
- add TaskCard and useTaskDiffStats test coverage for late-arriving mergeDetails and chip rendering
- add a changeset for @runfusion/fusion documenting the patch release

Files changed:
 .changeset/fn-5708-files-changed-chip.md           |  5 ++
 packages/dashboard/app/components/TaskCard.tsx     | 10 +++
 .../app/components/__tests__/TaskCard.test.tsx     | 64 +++++++++++++++
 .../app/hooks/__tests__/useTaskDiffStats.test.ts   | 92 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useTaskDiffStats.ts   | 17 +++-
 5 files changed, 185 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5708

Fusion-Task-Lineage: 3f961f3f-045b-473e-9636-ca33fd84282c
2026-05-29 21:32:09 -07:00
gsxdsm
afc3b4749f FN-5655: add goal anchoring audit events across lanes
Add audit guardrails that track goal anchoring injection across executor, heartbeat, and CLI/dashboard surfaces.

- add a dedicated engine goal-anchoring audit emitter and export it
- emit goal anchoring audit events from executor and heartbeat goal-context injection paths
- extend run-audit wiring and CLI extension output to surface goal anchoring events
- add engine, CLI, and dashboard regression tests for goal-tool and audit event behavior
- document the new audit coverage and include a published changeset entry

Files changed:
 .changeset/fn-5655-goal-anchoring-audit.md         |  7 ++
 docs/architecture.md                               |  1 +
 docs/dashboard-guide.md                            |  1 +
 .../__tests__/extension-goal-tools-audit.test.ts   | 65 +++++++++++++++
 packages/cli/src/extension.ts                      | 28 +++++++
 .../__tests__/routes-run-audit-goal-events.test.ts | 72 ++++++++++++++++
 .../src/__tests__/goal-anchoring-audit.test.ts     | 95 ++++++++++++++++++++++
 packages/engine/src/agent-heartbeat.ts             | 20 +++--
 packages/engine/src/executor.ts                    | 20 +++--
 packages/engine/src/goal-anchoring-audit.ts        | 89 ++++++++++++++++++++
 packages/engine/src/index.ts                       | 10 +++
 packages/engine/src/run-audit.ts                   |  6 +-
 12 files changed, 399 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-5655

Fusion-Task-Lineage: f3c10568-4050-42c4-9fe2-b84bf749b89d
2026-05-29 20:05:14 -07:00
Phil Larson
53d97e2c6f fix(FN-096): explain role-filtered auto-claim candidates 2026-05-29 18:25:19 -07:00
gsxdsm
668e3a5099 FN-5679: default new missions to stopped state
Ensure mission creation always starts in a stopped planning state with autopilot off.

- Force MissionStore createMission to ignore create-time autopilotEnabled and persist stopped defaults
- Update mission POST route behavior to stop auto-watching on create and keep optional create-time updates scoped
- Add/adjust core and dashboard tests to assert stopped-by-default creation semantics
- Document mission autopilot creation behavior and add a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5679-missions-default-stopped.md         |  7 +++++++
 docs/missions.md                                       |  4 +++-
 .../mission-factory-parity.integration.test.ts         |  6 +++---
 packages/core/src/__tests__/mission-store.test.ts      | 18 ++++++++++++++++++
 packages/core/src/mission-store.ts                     |  5 +++--
 packages/dashboard/src/__tests__/mission-e2e.test.ts   |  8 +++++---
 packages/dashboard/src/mission-routes.ts               |  9 +--------
 7 files changed, 40 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-5679

Fusion-Task-Lineage: 05eff3cb-07d8-4b52-ac7f-065979e78816
2026-05-29 15:45:20 -07:00
gsxdsm
0605d13ab5 FN-5675: add mission branch strategy and planning breakdown controls
Add mission-level branch strategy support and expose planning breakdown controls across mission flows.

- Extend mission/core data models and store logic to track and persist base-branch strategy metadata.
- Update mission API routes and legacy adapters to read/write new mission branch strategy fields.
- Enhance MissionManager and PlanningModeModal UX to configure branch strategy and planning breakdown behavior.
- Add/adjust coverage across core, dashboard, and roadmap plugin tests for mission branch and planning flow behavior.
- Add a changeset and mission docs updates for the new mission branch strategy behavior.

Files changed:
 .changeset/fn-5675-mission-branch-strategy.md      |   9 +
 docs/missions.md                                   |  13 ++
 packages/core/src/__tests__/db-migrate.test.ts     |  12 +-
 .../src/__tests__/db-mission-base-branch.test.ts   |  14 +-
 packages/core/src/__tests__/db.test.ts             |  34 ++--
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 packages/core/src/__tests__/mission-store.test.ts  | 148 +++++++++++++-
 packages/core/src/__tests__/run-audit.test.ts      |   2 +-
 packages/core/src/__tests__/secrets-schema.test.ts |   6 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |   9 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/mission-store.ts                 |  64 ++++--
 packages/core/src/mission-types.ts                 |   9 +
 packages/dashboard/app/api/legacy.ts               |  23 ++-
 .../dashboard/app/components/MissionManager.tsx    | 226 +++++++++++++++++++--
 .../dashboard/app/components/PlanningModeModal.tsx |   9 +-
 .../components/__tests__/MissionManager.test.tsx   | 100 +++++++++
 .../PlanningModeModal.planning-flow.test.tsx       |  91 +++++++++
 packages/dashboard/app/components/mission-types.ts |   4 +
 .../dashboard/src/__tests__/mission-e2e.test.ts    |  49 ++++-
 packages/dashboard/src/mission-routes.ts           |  41 +++-
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 25 files changed, 808 insertions(+), 76 deletions(-)

Fusion-Task-Id: FN-5675

Fusion-Task-Lineage: cfd13c13-9eff-4b82-90c3-88505d51bfb2
2026-05-29 15:25:47 -07:00
Phil Larson
9112b7dc08 fix(FN-080): ignore non-runnable queued overlap blockers
Fusion-Task-Id: FN-080
2026-05-29 12:57:56 -07:00
gsxdsm
d5b33367c1 FN-5698: clear OAuth relogin banner after successful login
Clear OAuth re-login banner entries immediately after provider re-authentication.

- add a shared oauth relogin success browser event constant in auth utilities
- dispatch relogin success events from Settings and Model Onboarding OAuth success flows
- update OAuthReloginBanner to listen for relogin success, optimistically clear matching provider rows, and trigger immediate status refresh
- add banner tests covering immediate clearing, refetch behavior, unrelated-provider events, and poll-only behavior
- document the immediate-clear behavior in dashboard docs and add a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5698-relogin-banner-auto-clear.md    |  5 ++
 docs/dashboard-guide.md                            |  4 +
 packages/dashboard/app/auth.ts                     |  1 +
 .../app/components/ModelOnboardingModal.tsx        |  3 +-
 .../app/components/OAuthReloginBanner.tsx          | 70 +++++++++--------
 .../dashboard/app/components/SettingsModal.tsx     |  3 +-
 .../__tests__/OAuthReloginBanner.test.tsx          | 90 ++++++++++++++++++++++
 7 files changed, 144 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-5698

Fusion-Task-Lineage: 1e2f8055-4f77-4e16-ac15-44891de13f55
2026-05-29 11:25:11 -07:00
gsxdsm
0044c23c64 FN-5699: fix github-copilot device-code login callback handling
Prevent dashboard auth initiation from crashing when Copilot emits device-code callbacks.

- wire optional auth callbacks (`onDeviceCode`, `onSelect`) through dashboard auth route typing
- capture and return device-code payload from either `onDeviceCode` or parsed Copilot instructions when `/api/auth/login` starts
- guard auth-init promise settlement to avoid double resolve/reject races and normalize async login errors
- add regression coverage for Copilot device-code callback handling in auth route tests
- sync roadmap plugin schema-version test expectation from 94 to 95 to keep suite assertions aligned

Files changed:
 .changeset/fn-5699-copilot-device-code-callback.md |  5 ++
 packages/dashboard/src/__tests__/routes-auth.test.ts    | 21 ++++++++
 packages/dashboard/src/routes.ts                   |  7 +++
 packages/dashboard/src/routes/register-auth-routes.ts   | 62 +++++++++++++++++-----
 plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts      |  4 +-
 5 files changed, 83 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-5699
Fusion-Task-Lineage: 24bf59f2-3b22-4087-96ca-35409fe00895
2026-05-29 11:22:27 -07:00
gsxdsm
72214132d2 FN-5678: add branch-group data model foundation
Establish per-mission/per-planning branch-group persistence and task metadata plumbing for shared auto-merge behavior.

- add `branch_groups` schema, indexes, exports, and store types for mission/planning branch assignment
- wire task source metadata branch-context helpers and branch-group row handling into core store flows
- add branch-group and migration coverage plus roadmap schema-version assertion wording fix
- add published changeset and storage doc note for the new branch-group persistence layer
- preserve forward-only migration safety by advancing schema to 96 and gating branch-group migration at `< 96`

Files changed:
 .changeset/per-mission-automerge-foundation.md     |  11 ++
 docs/storage.md                                    |   1 +
 packages/core/src/__tests__/backup.test.ts         |  32 ++++
 .../core/src/__tests__/branch-group-store.test.ts  | 148 ++++++++++++++++++
 packages/core/src/__tests__/db-migrate.test.ts     |  40 +++++
 packages/core/src/__tests__/db.test.ts             |  16 ++
 packages/core/src/__tests__/mission-store.test.ts  |  16 ++
 packages/core/src/db.ts                            |  52 ++++++-
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/mission-store.ts                 |  19 ++-
 packages/core/src/mission-types.ts                 |   4 +
 packages/core/src/store.ts                         | 171 ++++++++++++++++++++-
 packages/core/src/types.ts                         |  59 +++++++
 13 files changed, 556 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-5678
Fusion-Task-Lineage: cd6e5312-a9c5-475f-a0de-1d3090395bdd
2026-05-29 11:16:00 -07:00
gsxdsm
a014c6d42d FN-5697: retry transient auto-merge failures and fix migration versioning
Treat transient auto-merge/provider abort errors as bounded retries while preserving correct schema migration ordering.

- Add transient merge retry handling with capped exponential backoff, queue re-enqueue, and exhaustion logging before failing tasks.
- Extend task/core types and evaluator evidence plumbing for merge transient retry tracking and MergeTransientRetryExhausted visibility.
- Add regression coverage for transient auto-merge retries and exhaustion behavior in merge error recovery tests.
- Resolve migration collision by promoting workflow_steps.gateMode migration to version 77, shifting subsequent migrations, and bumping schema version to 95.
- Add a changeset and architecture note documenting transient retry behavior.

Files changed:
 .changeset/fn-5697-auto-merge-transient-retry.md   |  5 ++
 docs/architecture.md                               |  1 +
 packages/core/src/db.ts                            | 85 +++++++++++----------
 packages/core/src/eval-types.ts                    |  1 +
 packages/core/src/store.ts                         | 19 +++--
 packages/core/src/types.ts                         |  7 ++
 packages/engine/src/__tests__/evaluator-evidence.test.ts       |  1 +
 packages/engine/src/__tests__/merge-error-recovery.test.ts     | 87 ++++++++++++++++++++++
 packages/engine/src/evaluator-evidence.ts          |  1 +
 packages/engine/src/project-engine.ts              | 68 +++++++++++++++++
 10 files changed, 231 insertions(+), 44 deletions(-)

Fusion-Task-Id: FN-5697

Fusion-Task-Lineage: c8be7374-7cb6-444e-9920-9227e05a43dc
2026-05-29 10:23:59 -07:00
gsxdsm
dbb0804490 FN-5666: exclude base commit from done-task diff ranges
Prevent done-task diff endpoints from counting base-commit-only lineage as task-owned changes.

- add base-boundary handling in done-task merge SHA resolution so `baseCommitSha` is excluded by default and only consulted for boundary checks
- short-circuit `/diff` and `/file-diffs` responses to empty results when resolved done-task SHA is at or below `baseCommitSha`
- export and use an ancestry helper to detect base-boundary cases, while preserving normal and rebase range behavior
- extend done-task diff route tests with FN-5666 cases for no-op merge SHA, lineage association at base commit, normal post-base commits, and rebase ranges
- add a patch changeset for `@runfusion/fusion`

Files changed:
 .changeset/fn-5666-base-commit-exclusive.md        |   5 +
 .../src/__tests__/routes-diff-done-tasks.test.ts   | 217 ++++++++++++++++++++-
 .../src/routes/register-session-diff-routes.ts     |  57 +++++-
 3 files changed, 273 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-5666
Fusion-Task-Lineage: 782f9875-856a-4d31-9505-0bcd638c9c29
2026-05-29 10:14:06 -07:00
gsxdsm
4fee2c1324 FN-5671: add branch-strategy selection to new task creation
Add branch-strategy based task branch handling from modal through task creation routes.

- add branch strategy dropdown + validation in New Task modal and TaskForm, including required branch-name handling for existing/custom-new modes
- send structured branchSelection payload from dashboard API client and cover UI/API behavior with new tests
- add server-side branch selection mode parsing, auto-new branch derivation (fusion/<task-id>-<slug>), and response updates when auto branch is generated
- update engine/worktree and dashboard route tests plus dashboard guide documentation
- add a changeset for @runfusion/fusion patch release

Files changed:
 .changeset/fn-5671-branch-strategy-dropdown.md     |  7 ++
 docs/dashboard-guide.md                            | 16 +++++
 packages/dashboard/app/__tests__/api-tasks.test.ts | 21 ++++++
 packages/dashboard/app/api/legacy.ts               |  9 +++
 packages/dashboard/app/components/NewTaskModal.css |  8 +++
 packages/dashboard/app/components/NewTaskModal.tsx | 41 +++++++++---
 packages/dashboard/app/components/TaskForm.tsx     | 30 ++++++++-
 .../app/components/__tests__/NewTaskModal.test.tsx | 77 +++++++++++++++++++---
 .../src/__tests__/branch-selection.test.ts         | 13 ++++
 .../dashboard/src/__tests__/routes-tasks.test.ts   | 72 ++++++++++++++++++++
 packages/dashboard/src/routes/branch-selection.ts  | 45 ++++++++-----
 .../src/routes/register-task-workflow-routes.ts    | 22 +++++--
 .../engine/src/__tests__/worktree-pool.test.ts     | 41 ++++++++++++
 packages/engine/src/worktree-pool.ts               |  2 +-
 14 files changed, 361 insertions(+), 43 deletions(-)

Fusion-Task-Id: FN-5671
Fusion-Task-Lineage: 7f2e7b68-050d-4a2c-af0b-cb895de35576
2026-05-29 09:44:17 -07:00
gsxdsm
71e2aec5b7 FN-5663: add goal-citation audit trail to agent reasoning
Record goal citation evidence so agent reasoning can be traced end-to-end.

- add core goal citation types, extraction helper, persistence schema, and store APIs for citation create/list workflows
- add CLI support and tests for goal citation flows, including command wiring and regression coverage
- update docs and add a published changeset for @runfusion/fusion describing the new audit-trail capability

Files changed:
 .changeset/fn-5663-goal-citation-audit-trail.md    |  10 +
 docs/agents.md                                     |  15 ++
 docs/cli-reference.md                              |   6 +-
 packages/cli/src/__tests__/bin.test.ts             |   2 +
 .../cli/src/__tests__/goals-citations-cli.test.ts  |  82 ++++++++
 packages/cli/src/bin.ts                            |  19 +-
 packages/cli/src/commands/goals.ts                 |  43 +++++
 packages/core/src/__tests__/db-migrate.test.ts     |  10 +-
 packages/core/src/__tests__/db.test.ts             |  34 ++--
 .../src/__tests__/goal-citation-extractor.test.ts  |  56 ++++++
 .../src/__tests__/goal-citations-store.test.ts     | 175 +++++++++++++++++
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 packages/core/src/__tests__/mission-store.test.ts  |   2 +-
 packages/core/src/__tests__/run-audit.test.ts      |   2 +-
 packages/core/src/__tests__/secrets-schema.test.ts |   6 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |  51 ++++-
 packages/core/src/goal-citation-extractor.ts       |  56 ++++++
 packages/core/src/index.ts                         |  13 ++
 packages/core/src/store.ts                         | 210 ++++++++++++++++++++-
 packages/core/src/types.ts                         |  51 ++++-
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 24 files changed, 817 insertions(+), 46 deletions(-)

Fusion-Task-Id: FN-5663

Fusion-Task-Lineage: 720f2c4b-4363-464a-a76f-472ec6aca136
2026-05-29 08:25:38 -07:00
gsxdsm
a960bb1031 chore(release): v0.37.0
Version bump via changesets.
2026-05-29 08:09:33 -07:00
gsxdsm
dbfd71373a Merge pull request #1142 from plarson/fix/pending-review-not-failed
fix(engine): do not fail tasks parked for pending review
2026-05-29 08:05:48 -07:00
gsxdsm
b335f3d7c4 FN-5652: add goal retrieval tool for agent execution
Expose goal details to agents during task execution workflows.

- add fn_goal_show tool to the CLI extension with goal lookup, formatted output, and not-found error details
- add focused tests for goal tool registration and execution behavior
- mark fn_goal_show as execution-safe in engine gating classifications and test coverage
- update Fusion skill/reference docs to include the new goal retrieval capability
- add a changeset for @runfusion/fusion patch release

Files changed:
 .changeset/fn-5652-goal-show.md                    |   7 +
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |  16 +++
 .../skill/fusion/references/fusion-capabilities.md |   1 +
 .../cli/src/__tests__/extension-goal-tools.test.ts | 148 +++++++++++++++++++++
 packages/cli/src/extension.ts                      |  43 ++++++
 .../src/__tests__/gating-classifications.test.ts   |   7 +
 packages/engine/src/gating-classifications.ts      |   2 +
 8 files changed, 225 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5652

Fusion-Task-Lineage: 98c2c417-0887-4794-81b1-6b47ab0f708f
2026-05-29 07:13:23 -07:00
Phil Larson
b5f2f91e87 fix(FN-057): park pending review without failed status 2026-05-29 06:54:45 -07:00
gsxdsm
230efa1cdc FN-5644: default AI merge commit body to summarize changes
Fusion-Task-Id: FN-5644

Fusion-Task-Lineage: 5cf0133b-2a14-4bb4-a1c4-2d5bef5793bc
2026-05-28 23:45:40 -07:00
gsxdsm
6c44ed16e7 chore(release): v0.36.0
Version bump via changesets.
2026-05-28 23:40:25 -07:00
gsxdsm
d78fbccacc FN-5643: fix gh api --json flag handling for PR fetches
Fusion-Task-Id: FN-5643

Fusion-Task-Lineage: 2eaba342-1ac7-4ebf-886e-acd22af637ee
2026-05-28 22:59:18 -07:00
gsxdsm
aa7eccbadb FN-5642: add AI-generated merge commit body summaries
Fusion-Task-Id: FN-5642

Fusion-Task-Lineage: 27701749-6107-4ffe-a83e-42873b06473b
2026-05-28 22:23:55 -07:00
gsxdsm
cec191eac3 FN-5638: migrate pi-ai and pi-coding-agent packages to @earendil-works scope
Fusion-Task-Id: FN-5638

Fusion-Task-Lineage: 6e99c156-5f6c-42e6-bd26-618e08ffd05f
2026-05-28 21:23:48 -07:00
gsxdsm
f258a75162 FN-5634: fix ntfy JSON publish priority mapping
Fusion-Task-Id: FN-5634

Fusion-Task-Lineage: 20868ce3-fe31-4638-87f6-83577f46caab
2026-05-28 21:17:02 -07:00
gsxdsm
c1d558c765 feat(FN-5633): AI merge commit summary + task trailers, verify-and-fix, editable prompt
- Commit message: the merge agent writes a concise change-summary subject (not
  just the task title), and every landed squash carries board-association
  trailers — `Fusion-Task-Id: <taskId>` plus the canonical lineage trailer when
  the task has a lineageId — guaranteed via an idempotent amend
  (ensureTaskTrailersOnHead) even if the agent omits them.
- Verify-and-fix: the merge prompt instructs the agent to run the project's
  tests / type-check / lint after resolving the merge and fix any NEW failure
  the merge introduced (not pre-existing breakage) before committing.
- Editable prompt: the AI merge agent's base persona is the editable "merger"
  role prompt (Settings -> Prompts); the clean-room / verification / trailer
  rules are always appended so a custom prompt can't drop them.
- Reviewer model: reviewer uses the project reviewer/validator model lane
  (resolveValidatorSettingsModel); the bespoke merger.reviewerModel setting is
  removed.

Changeset updated to cover all AI merger changes.

Tests: trailer present on landed commit (+ lineage when set), editable-prompt
incorporation, new-breakage verification wording.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 20:14:13 -07:00
gsxdsm
1153b0932e Gitignore .fusion and stray fusion.db files on fn init 2026-05-28 19:55:52 -07:00
gsxdsm
b2dce7d852 Recovery: Re-land (Close source-imported GitHub issues on ta 2026-05-28 19:49:31 -07:00
gsxdsm
2c4683a298 Recovery: re-land tablet TaskDetailModal width onto main 2026-05-28 19:45:27 -07:00
gsxdsm
009d569bdd Recovery: re-land fn goals CLI + pi tools onto main 2026-05-28 19:44:15 -07:00
gsxdsm
29ac58f8d0 feat(FN-5633): standalone AI merge path (clean-room merge + AI reviewer)
New default merge path (merger.mode="ai"), self-contained in merger-ai.ts and
dispatched from ProjectEngine.onMerge instead of the legacy aiMergeTask pipeline
(kept for merger.mode="deterministic").

Flow: clean-room detached worktree at the target branch tip → AI agent merges
the task branch + squashes (resolving conflicts) → fresh read-only AI reviewer
audits with corrective retries (blocking vs advisory; advisory lands, unfixable
correctness hard-fails via AiMergeBlockedError; fail-safe verdict parsing) →
land via `git merge --ff-only` when the checkout is on the target (else
update-ref CAS) → sync the local checkout (stash → ff → restore; AI reconciles
a conflicting restore and keeps the original edits in a backup stash;
un-stashable dirt advances the ref + warns) → finalize (delete task branch —
never the integration branch — task→done, remove temp worktree).

- Per-task target branch honored (falls back to the default integration
  branch); local checkout synced only when on that target.
- Structurally immune to the dirty-clobber and stale-base/non-FF bug classes of
  the legacy path (clean room + FF-by-construction).
- Progress surfaced on the task status pill + task log stream.
- Clear error when the target branch has no local ref.

Settings: merger.mode / merger.reviewerModel / merger.maxReviewPasses, surfaced
in Settings → Merge; legacy merge-mechanics settings hidden when AI mode is on.

Tests: merger-ai.test.ts (verdict parser, clean merge, blocking hard-fail,
advisory land, empty no-op, target-branch isolation, missing-target error,
landSquash clean/other-branch/dirty-restore/AI-resolved). Legacy
merge-orchestration tests pinned to deterministic mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 18:50:23 -07:00
gsxdsm
e75c4dae28 fix(FN-5627): suppress ntfy notifications for transient merge failures the engine auto-recovers
Even with FN-5627's merger TOCTOU fix + transient-failure self-healing
sweep + safety-fallback auto-prerebase landed, the merger can still hit
transient failure classes (lease handoff races, brief same-SHA non-FF
advances) for tasks whose branches are particularly out-of-sync. The
self-healing sweep auto-recovers them within bounded budget \u2014 but each
individual failure cycle was firing a ntfy alarm before the recovery
cleared the failed state, producing user-facing alarm spam for tasks
that were never actually stuck.

Two layers of fix:

1. NotificationService.handleTaskUpdated now classifies task.error via
   the new shared classifyTransientMergeError helper before scheduling
   the deferred failure notification. Transient classes
   (lease-handoff-target-not-queued, spurious-concurrent-advance-same-sha)
   get logged as suppressed and never schedule a ntfy timer.

2. Defense-in-depth: fireDeferredFailureNotification re-classifies the
   error at dispatch time, so a failure scheduled before the suppression
   landed on a newer cycle still suppresses if the error matches a
   transient class.

The classifier itself moved from self-healing.ts to a new logger-free
transient-merge-error-classifier.ts module so consumers in
NotificationService don't pull createLogger through the import chain and
break test mocks of ../logger.js (per project-memory rule about new
modules using createLogger). self-healing.ts re-exports the symbol for
backward compatibility.

Log prefix for the recovery actions also changed from
'[FN-5627] Auto-recovering...' to 'Auto-recovered:' so that
NotificationService.maybeSuppressTransientFailedNotification's existing
/^Auto-recovered:/ log-prefix check cancels any already-scheduled failure
notification when the sweep runs mid-grace-window.

Tests (3 new):
- transient lease-handoff-target-not-queued failure NOT notified
- transient spurious-concurrent-advance-same-sha failure NOT notified
- genuine different-SHAs concurrent-advance still notifies (control)

Engine suite: 6166 tests pass.

Fusion-Task-Id: FN-5627
2026-05-28 15:39:23 -07:00
gsxdsm
694970b2f1 fix(FN-5627): always rebase behind branches before squash (safety fallback)
The FN-5627 default-threshold fix changed the prerebase threshold default
from 0 (never fire on commit-count) to 1 (fire on any divergence). But
that only affected projects WITHOUT an explicit threshold. Projects with
user-set values like 'prerebaseDivergenceThreshold: 50' continued to
skip prerebase for small divergences (e.g., 4 commits behind), so the
squash built against stale base and update-ref refused non-FF \u2014
producing the same-SHA spurious-concurrent-advance signature that
stranded FN-5626/FN-5628/FN-5633.

Root distinction missed earlier:
- prerebaseDivergenceThreshold is for USER-VISIBLE SEVERITY REPORTING
  (this branch is N commits behind, warn me).
- Engine correctness requires a SAFETY INVARIANT (any branch behind main
  MUST be rebased before squash or update-ref will fail).

These are independent concerns. The safety invariant must not be gated
on the user's threshold.

decideAutoPrerebase() now returns fire=true with reason
'safety-fallback-any-divergence' whenever commitsBehind > 0, after the
hot-file and threshold checks. The threshold path still wins the reason
label when its condition trips, so user-visible severity reporting is
unchanged for non-pathological cases.

Full opt-out remains prerebaseAutoEnabled=false (skips the safety
fallback; user accepts behind-branch merges will fail).
prerebaseDivergenceThreshold=0 is no longer a complete opt-out from the
commit-count gate \u2014 it only suppresses the threshold-based reason label.

Tests (4 updated/new):
- safety-fallback-any-divergence reason added to AutoPrerebaseDecision
- 4 commits behind with threshold=50 fires via safety fallback
- prerebaseAutoEnabled=false respects full opt-out
- threshold trip still wins reason label
- commitsBehind=0 returns no-divergence (unchanged)

Engine suite: 6163 tests pass.

In-flight: FN-5626, FN-5628, FN-5633 manually SQL-reset to mergeRetries=0,
status=null, error=null, transientRecoveryCount=0 so the next merger tick
(after engine restart picks up this code) auto-prerebases via safety
fallback and lands the work. Future occurrences self-heal automatically.

Fusion-Task-Id: FN-5627
2026-05-28 15:04:41 -07:00
gsxdsm
b96b0bc79a feat(FN-5632): add collision retry logic to fn update command
Adds collision retry logic to the `fn update` CLI command to handle binary path conflicts, including test coverage and a getting-started guide update.

Fusion-Task-Id: FN-5632

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5632
2026-05-28 14:50:15 -07:00
gsxdsm
6b27ab5aab fix(FN-5627): default auto-prerebase to fire when branch >=1 commit behind
decideAutoPrerebase() previously defaulted prerebaseDivergenceThreshold
to 0, which meant the threshold path NEVER fired unless the user
explicitly set a positive value. Only hot-file matches could trigger
prerebase.

The result: tasks whose branch was started against an older main tip
(because other tasks landed concurrently) skipped prerebase, built their
squash commit against the stale base, and then failed at git update-ref
because the squash didn't descend from current main. The merger correctly
detected this as non-fast-forward and threw
IntegrationBranchConcurrentAdvanceError, but with both 'expected' and
'observed' SHAs set to current main tip \u2014 because observedCurrentSha was
captured from the pre-update rev-parse, not post-failure. This produced
the misleading 'expected X, observed X' same-SHA error signature that
stranded FN-5632 stuck at mergeRetries=3 after the FN-5627 merger fix
and engine restart.

New default: prerebaseDivergenceThreshold = 1. Any branch behind by at
least 1 commit auto-rebases before squash. Users who want the legacy
never-fire behavior can explicitly set prerebaseDivergenceThreshold = 0.
Threshold comparison also changed from > to >= so an explicit threshold
of N rebases at N+ commits behind instead of N+1+.

The self-healing classifier comment for spurious-concurrent-advance-same-sha
is updated to note the signature can come from either pre-FN-5627
misclassification OR the legitimate post-FN-5627 non-FF path; the
auto-recovery sweep is unchanged because both cases self-heal cleanly
once prerebase fires on the retry.

Tests (3 new):
- Default threshold (undefined) fires at 1 commit behind
- Explicit threshold = 0 stays as opt-out (never fire on commit-count)
- Default threshold doesn't fire when branch is up-to-date

Engine suite: 6160 tests pass.

In-flight: FN-5632 manually SQL-reset to mergeRetries=0 / status=null
once more so the next merger tick (after engine restart picks up this
code) auto-prerebases and lands the work. Future occurrences self-recover.

Fusion-Task-Id: FN-5627
2026-05-28 14:21:38 -07:00