Commit Graph

10425 Commits

Author SHA1 Message Date
gsxdsm
ccb7d4e8ff FN-8367: enforce bounded engine shellouts
Enforce bounded synchronous shellout use across the engine.

- Audit every production synchronous shellout against a call-site allowlist.
- Bound data-dependent git diff commands by timeout and output size.
- Document the async shellout invariant and align focused command guards.

Files changed:
 AGENTS.md                                          |   2 +-
 docs/architecture.md                               |   1 +
 .../__tests__/engine-no-blocking-shellout.test.ts  | 135 +++++++++++++++++++++
 .../user-configured-command-no-execsync.test.ts    |   5 +-
 packages/engine/src/merger-git-parse.ts            |  16 ++-
 .../engine/src/merger-workspace-test-commands.ts   |  27 ++++-
 6 files changed, 181 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8367
Fusion-Task-Lineage: 976384e6-f283-4464-9f74-f328f2be3430
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 16:00:28 -07:00
gsxdsm
e0e395a715 FN-8365: enforce dashboard route registrar mount order
Keep dashboard API registration modular while preserving Express route precedence.

- Route all top-level dashboard registrars through a runtime-checked canonical mount sequence
- Add mount-order and inline-route-ratchet coverage with CI enforcement
- Document registrar ownership and mount-order conventions

Files changed:
.github/workflows/pr-checks.yml                    |   3 +
AGENTS.md                                          |   2 +
package.json                                       |   5 +-
packages/dashboard/src/routes.ts                   | 136 +++++-----
packages/dashboard/src/routes/README.md            | 276 ++++++++++-----------
packages/dashboard/src/routes/__tests__/create-api-routes-mount-order.test.ts |  66 +++++
packages/dashboard/src/routes/create-api-routes-mount-sequence.ts |  54 ++++
scripts/__tests__/check-routes-modular.test.mjs    |  28 +++
scripts/check-routes-modular.mjs                   |  65 +++++
scripts/lib/routes-modular-baseline.json           |   3 +
10 files changed, 433 insertions(+), 205 deletions(-)

Fusion-Task-Id: FN-8365

Fusion-Task-Lineage: 9c36a263-ed5e-4524-8ea5-71ed3f3e34d9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:53:07 -07:00
gsxdsm
d940bf3d5c FN-8358: add roadmap-item structure previews
Enable native previews and hosted navigation for roadmap items.
- Extend native structure references and API resolution through the roadmap adapter.
- Register the bundled Roadmaps view across desktop and mobile navigation.
- Cover roadmap preview availability, navigation, and route behavior.

Files changed:
 ...n-8358-roadmap-item-native-structure-preview.md |  7 ++++
 docs/dashboard-guide.md                            |  6 ++--
 packages/core/src/types.ts                         | 24 ++++++++-----
 packages/dashboard/app/App.tsx                     | 24 ++++++++-----
 .../dashboard/app/components/LeftSidebarNav.tsx    | 12 +++----
 .../app/components/NativeStructurePreview.tsx      | 10 ++++--
 .../app/components/__tests__/App.test.tsx          | 13 ++++---
 .../app/components/__tests__/Header.test.tsx       |  5 ++-
 .../components/__tests__/LeftSidebarNav.test.tsx   |  5 ++-
 .../app/components/__tests__/MobileNavBar.test.tsx |  4 +--
 .../__tests__/NativeStructurePreview.test.tsx      | 40 ++++++++++++++++------
 .../__tests__/registerBundledPluginViews.test.tsx  | 24 ++++++++++---
 .../app/plugins/registerBundledPluginViews.ts      | 23 +++++++++++++
 packages/dashboard/src/native-structure-preview.ts | 25 +++++++++++++-
 .../native-structure-preview-routes.test.ts        | 31 +++++++++++++++--
 .../src/routes/register-task-workflow-routes.ts    |  4 +--
 packages/dashboard/vite.config.ts                  |  4 +++
 packages/dashboard/vitest.config.ts                |  4 +++
 plugins/fusion-plugin-roadmap/package.json         |  5 +++
 .../fusion-plugin-roadmap/src/dashboard-view.tsx   |  5 +++
 plugins/fusion-plugin-roadmap/src/index.ts         | 14 ++++++--
 21 files changed, 223 insertions(+), 66 deletions(-)

Fusion-Task-Id: FN-8358
Fusion-Task-Lineage: c369ce87-eef0-4d06-bf23-bced9c4363f9
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:45:45 -07:00
gsxdsm
41f387b219 FN-8364: track task token usage from session deltas
Track only task-local deltas from cumulative session usage.

- Capture and reset baselines for reused, resumed, and heartbeat sessions
- Route executor prompt accounting through the shared per-session delta seam
- Cover token accounting behavior and document the analytics correction

Files changed:
 .changeset/fn-8364-session-token-deltas.md         |  7 +++
 docs/storage.md                                    |  2 +-
 .../src/__tests__/executor-token-usage.test.ts     | 48 +++++++++++++++++++-
 .../src/__tests__/heartbeat-executor.test.ts       | 42 +++++++++++++++++
 .../src/__tests__/session-token-usage.test.ts      | 53 +++++++++++++++++++++-
 packages/engine/src/agent-heartbeat.ts             | 10 +++-
 packages/engine/src/executor.ts                    | 44 +++++++++++-------
 packages/engine/src/session-token-usage.ts         | 20 ++++++++
 8 files changed, 205 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-8364

Fusion-Task-Lineage: 2b16a581-0d58-4c91-8903-6ce368b30a7c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:38:31 -07:00
gsxdsm
50454d8a59 fix(FN-7996): release Plan Review fallback lease
Unregister the exact workflow-step path after a repository-root fallback so later Plan Review tasks are not blocked by a stale active-session owner.
2026-07-19 15:28:33 -07:00
gsxdsm
2c72ac0c0c FN-8387: add canonical lineage approval predicate
Centralize symbol-lock admission rules for resolved mission lineage.

- Add a pure core predicate with stable approval and rejection reasons.
- Export the lineage contract and cover status and plan-fingerprint cases.
- Document scheduler ownership and the admission requirements.

Files changed:
 docs/missions.md                                   |  15 +++
 .../__tests__/symbol-lock-lineage-approval.test.ts | 123 +++++++++++++++++++++
 packages/core/src/index.ts                         |  10 ++
 packages/core/src/symbol-lock-lineage-approval.ts  |  87 +++++++++++++++
 4 files changed, 235 insertions(+)

Fusion-Task-Id: FN-8387

Fusion-Task-Lineage: dc2d8518-ffff-4062-b11f-a162dd1b10da

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:20:39 -07:00
gsxdsm
bea51f7bdb FN-8348: relocate report actions to settings and command center
Relocate guided reporting from the header into durable project and overview surfaces.

- Add Report entry points to Project General settings and Command Center Overview.
- Preserve guided report modal context through a shared route helper.
- Cover relocated controls and update dashboard guidance.

Files changed:
 docs/dashboard-guide.md                            |  2 +-
 packages/dashboard/app/components/Header.tsx       | 33 ++++------------------
 .../dashboard/app/components/SettingsModal.tsx     |  2 +-
 .../app/components/__tests__/Header.test.tsx       |  7 +++++
 .../components/command-center/CommandCenter.css    | 32 +++++++++++++++++++++
 .../components/command-center/CommandCenter.tsx    | 30 +++++++++++++++++++-
 .../__tests__/CommandCenter.test.tsx               | 11 ++++++++
 .../settings/sections/GeneralSection.tsx           | 21 ++++++++++++++
 .../GeneralSection.aiUndoWorkflow.test.tsx         | 20 +++++++++++--
 packages/dashboard/app/utils/reportContextRefs.ts  | 13 +++++++++
 10 files changed, 139 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-8348

Fusion-Task-Lineage: add1b302-deab-4e17-be2f-832971c1c83d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:12:23 -07:00
gsxdsm
f85acce548 FN-8361: guard planning recovery mutations atomically
Keep delayed planning recovery mutations conditional on the task still being in its planning stage.

- Add task-lock-backed conditional move and deletion APIs for planning recovery.
- Guard triage and self-healing writes, including prompt-file mutations, with live planning predicates.
- Cover conditional task operations and stale recovery behavior with regression tests.

Files changed:
 docs/architecture.md                               |  2 +-
 .../src/__tests__/delete-task-if-planning.test.ts  | 56 +++++++++++++
 .../src/__tests__/move-task-if-planning.test.ts    | 43 ++++++++++
 packages/core/src/store.ts                         | 22 ++++-
 .../core/src/task-store/archive-lifecycle-2.ts     | 35 ++++++++
 packages/core/src/task-store/archive-lifecycle.ts  | 65 +++++++++++++++
 packages/core/src/task-store/moves.ts              | 32 ++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 26 ++++++
 packages/engine/src/__tests__/triage.test.ts       | 14 +++-
 packages/engine/src/self-healing.ts                | 30 ++++++-
 packages/engine/src/triage.ts                      | 95 ++++++++++++++++------
 11 files changed, 383 insertions(+), 37 deletions(-)

Fusion-Task-Id: FN-8361

Fusion-Task-Lineage: d76f1805-d8c6-4b3f-9bc6-12907aae9733

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 15:05:31 -07:00
gsxdsm
8b6dca4379 FN-8343: add Planning Mode E2E coverage
Add deterministic end-to-end coverage for the Planning Mode plan-creation lifecycle.

- Exercise contextual interview responses, multilingual options, custom input, and answer rewinds
- Ensure premature agent completion cannot finalize a plan before explicit validation
- Verify validation gates task creation and session cleanup

Files changed:
 .../__tests__/planning-e2e-plan-creation.test.ts   | 286 +++++++++++++++++++++
 1 file changed, 286 insertions(+)

Fusion-Task-Id: FN-8343

Fusion-Task-Lineage: 61b8b22e-7d13-4578-ba35-0f2208fcb851

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 14:58:48 -07:00
gsxdsm
da1e445d6b FN-8310: add public-roadmap report deduplication
Add public-roadmap issues as a configurable, reviewable deduplication source for in-app reports.

- Resolve roadmap settings across project, global, and tracking-repository fallbacks
- Search and endorse matching open roadmap issues before filing duplicate reports
- Expose and index roadmap controls with localized default descriptions

Files changed:
 .changeset/fn-8310-public-roadmap-dedupe.md        |  7 ++
 docs/dashboard-guide.md                            |  2 +-
 docs/settings-reference.md                         |  4 +-
 .../core/src/__tests__/settings-parity.test.ts     | 14 +++-
 packages/core/src/settings-schema.ts               |  7 +-
 packages/core/src/types.ts                         | 13 +++-
 packages/dashboard/app/api/report.ts               |  2 +-
 packages/dashboard/app/components/ReportModal.tsx  | 18 ++---
 .../dashboard/app/components/SettingsModal.tsx     | 15 +++-
 .../app/components/__tests__/ReportModal.test.tsx  | 12 ++--
 .../__tests__/SettingsModal.general.test.tsx       |  6 +-
 .../settings/__tests__/section-keys.test.ts        |  5 +-
 .../app/components/settings/save-split.ts          | 14 ++--
 .../app/components/settings/section-keys.ts        |  5 ++
 .../settings/sections/GeneralSection.search.ts     | 34 ++++++---
 .../settings/sections/GeneralSection.tsx           | 29 ++++++--
 .../sections/SourceControlGlobalSection.search.ts  | 27 +++++++
 .../sections/SourceControlGlobalSection.tsx        | 55 ++++++++++----
 .../settings-default-descriptions.test.tsx         |  4 +-
 .../src/__tests__/report-pipeline.test.ts          | 73 ++++++++++++-------
 .../dashboard/src/__tests__/report-routes.test.ts  | 23 +++---
 packages/dashboard/src/report-pipeline.ts          | 84 ++++++++++++++--------
 .../dashboard/src/routes/register-report-routes.ts |  9 +--
 packages/i18n/locales/en/app.json                  | 17 ++++-
 packages/i18n/locales/es/app.json                  | 17 ++++-
 packages/i18n/locales/fr/app.json                  | 17 ++++-
 packages/i18n/locales/ko/app.json                  | 17 ++++-
 packages/i18n/locales/zh-CN/app.json               | 16 ++++-
 packages/i18n/locales/zh-TW/app.json               | 16 ++++-
 29 files changed, 409 insertions(+), 153 deletions(-)

Fusion-Task-Id: FN-8310

Fusion-Task-Lineage: 0efa8d76-e849-4256-bdcd-e9d6dd612e41

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 14:51:49 -07:00
gsxdsm
b2c784b3f8 FN-8381: remove flaky dist-barrel test
Remove the repeatedly quarantined extension dist-barrel test while retaining source-level listing coverage.

- Delete the CPU-bound dist-barrel regression test after its fourth quarantine cycle.
- Remove its quarantine exclusion and ledger entry.
- Document retained source-level formatting and truncation coverage.

Files changed:
 .../src/__tests__/extension-dist-barrel.test.ts    | 204 ---------------------
 packages/cli/src/__tests__/extension.test.ts       |   4 +-
 packages/cli/vitest.config.ts                      |   6 +-
 scripts/lib/test-quarantine.json                   |   5 -
 4 files changed, 6 insertions(+), 213 deletions(-)

Fusion-Task-Id: FN-8381

Fusion-Task-Lineage: ba6e61e1-fba1-4308-9d9d-1d3f387aa5e9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 14:14:12 -07:00
gsxdsm
965f15f5ca FN-8368: enforce browser-safe dashboard core imports
Prevent dashboard code from bypassing Vite's browser-safe core boundary.

- Add an allowlist-backed scanner for dashboard core value imports, including dynamic template imports.
- Run the scanner in test and merge-gate prechecks, with regression coverage and import guidance.
- Document reviewed browser-safe core leaves and Vite alias requirements.

Files changed:
 docs/dashboard-guide.md                            |   6 +
 package.json                                       |   6 +-
 packages/dashboard/vite.config.ts                  |   5 +
 ...no-node-only-core-imports-in-dashboard.test.mjs |  80 ++++++++++
 ...heck-no-node-only-core-imports-in-dashboard.mjs | 167 +++++++++++++++++++++
 .../lib/dashboard-browser-safe-core-modules.json   |  59 ++++++++
 6 files changed, 320 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-8368

Fusion-Task-Lineage: 13e70672-d1da-430c-a360-0a714ad33d9f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 14:08:51 -07:00
gsxdsm
954ebe816a FN-8362: isolate agent lifecycle pauses and backlog claims
Keep agent lifecycle transitions independent from task pause state and make automatic backlog pickup executor-first.

- Prevent agent stop, sleep, resume, and heartbeat recovery from changing assigned task pause state
- Limit engineer automatic backlog pickup to explicit opt-in while preserving explicit routing
- Document CLI and extension lifecycle behavior and cover the boundaries with regression tests

Files changed:
 .../cli/skill/fusion/references/extension-tools.md |  4 +--
 .../skill/fusion/references/fusion-capabilities.md |  4 +--
 packages/cli/src/__tests__/extension.test.ts       | 13 +++++++
 packages/cli/src/commands/__tests__/agent.test.ts  | 27 ++++++++++++--
 packages/cli/src/commands/agent.ts                 |  4 +++
 packages/cli/src/extension.ts                      |  8 +++--
 .../core/src/__tests__/agent-role-policy.test.ts   |  7 +++-
 packages/core/src/agent-role-policy.ts             |  7 ++++
 .../src/__tests__/heartbeat-executor.test.ts       | 35 +++++++++---------
 packages/engine/src/__tests__/self-healing.test.ts | 30 ++++++++++++++++
 packages/engine/src/agent-heartbeat.ts             | 42 ++++++++++++++++------
 packages/engine/src/self-healing.ts                | 12 +++++++
 12 files changed, 157 insertions(+), 36 deletions(-)

Fusion-Task-Id: FN-8362

Fusion-Task-Lineage: a1fb37f3-f95e-4eb7-9fbf-bdc0ab5d5f9e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-19 13:47:38 -07:00
gsxdsm
2302fb8a3d feat: add beta/stable release tracks with switchable update channel (#2345)
## Summary

Fusion can now ship on two release tracks. Betas are cut from `main` as
`vX.Y.Z-beta.N` (npm dist-tag `beta`, GitHub prerelease), stable
releases are promoted to a long-lived `release` branch and published to
`latest`, and users pick their track with the new `updateChannel` global
setting — via **Settings → General → Release channel** or `fn update
--channel <stable|beta>`. Previously everything was single-track: every
publish landed on `latest` and every update surface could only see it.

| | beta | stable |
|---|---|---|
| Cut from | `main` | `release` branch |
| Version | `X.Y.Z-beta.N` (changesets pre-mode) | `X.Y.Z` |
| npm dist-tag | `beta` | `latest` |
| GitHub Release | prerelease | latest |
| Homebrew tap / X draft | skipped | bumped / printed |

## How releasing works now

`pnpm release` prompts for the channel and **defaults to beta**, so
day-to-day releases are betas; stable is always an explicit choice.
Choosing stable from `main` triggers assisted promotion: the script
proposes the newest beta tag reachable from HEAD, verifies `release`
fast-forwards to it, then runs the whole stable release inside a
temporary git worktree on `release` — the primary checkout never leaves
`main`. Changesets pre-mode preserves changeset files across betas, so
the promoted stable release aggregates every changeset since the last
stable into one clean changelog entry.

## Design decisions

- **Every publish path names an explicit `--tag`.** A beta accidentally
landing on `latest` is the one unrecoverable failure of a dual-track
scheme, so nothing relies on npm's implicit default (`release.mjs`,
`version.yml`).
- **Beta channel resolves to semver-max of `latest` and `beta`**, so
beta users are offered each promoted stable once it overtakes their
prerelease. Switching beta → stable never downgrades; `fn update
--channel stable --force` is the explicit escape hatch.
- **One comparator instead of three.** CLI, dashboard, and desktop each
had their own `isRemoteNewer` that ignored prerelease identifiers —
`0.73.0-beta.2`, `-beta.3`, and `0.73.0` all compared equal, which
breaks the moment any beta exists. They now share full SemVer-precedence
helpers (`compareVersions`, `resolveUpdateTargetVersion`) from
`@fusion/core`.
- **Installs pin exact versions** (`@runfusion/fusion@0.73.0-beta.2`),
never a dist-tag, so an install can't silently land on the wrong track.
- **Desktop channels via electron-updater manifests.** Beta tags build
desktop artifacts with `publish.channel=beta` (emitting `beta*.yml`);
the app sets `channel`/`allowPrerelease` from the shared setting,
re-read on every manual check.
- **Update caches are channel-stamped** — a cache written for one
channel is never served to the other, so switching tracks takes effect
on the next check instead of after TTL.

## Test plan

- New unit coverage: SemVer precedence + channel resolution in
`@fusion/core` (30), channel behavior of the dashboard update check (28,
incl. 9 new) and `fn update` (16, incl. 8 new: persist `--channel`,
no-downgrade, `--force`, cache channel mismatch).
- `pnpm verify:fast` green (scoped typecheck, builds, CLI build, boot
smoke); desktop + settings-section suites green.
- `release.mjs` dry-run matrix exercised by hand: channel prompt
(default/override/invalid), branch preflights per channel,
assisted-promotion target selection, fast-forward guard against a
diverged `release` branch, and bootstrap when no `release` branch
exists.
- Not exercised live: an end-to-end publish (needs TTY authorization +
real npm publish). First real run is the first `pnpm release --channel
beta`.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
![Claude
Code](https://img.shields.io/badge/Fable_5-D97757?logo=claude&logoColor=white)


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

* **New Features**
* Added beta and stable release channels across CLI, dashboard, and
desktop updates.
* Users can select a channel via Settings or `fn update --channel
<stable|beta>` (stored as a global default).
* Desktop beta releases now generate beta update manifests and publish
as prereleases.
* **Documentation**
* Expanded release-track, settings, and CLI references to explain
channel semantics and workflows.
* **Bug Fixes**
* Updates now pin the resolved version per channel, improve version
comparison, and prevent unintended cross-channel downgrades unless
`--force` is used.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 13:34:25 -07:00
gsxdsm
048ae909fd fix(core): restore PostgreSQL lifecycle activity logging (#2344)
## Summary

PostgreSQL-backed projects now record automatic TaskStore lifecycle
activity, including ordinary task creation and movement. Backend
initialization previously returned before registering the lifecycle
listeners, while features that called `recordActivity()` directly could
make the log appear only partially affected. The fix wires the
backend-agnostic listeners without changing SQLite initialization
behavior.

## Validation

- PostgreSQL activity parity test verifies all six listener surfaces and
persisted `task:created` and `task:moved` entries.
- `pnpm lint`
- `pnpm --filter @fusion/core typecheck`
- `pnpm check:changesets --strict`
- `pnpm verify:fast`


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

* **Bug Fixes**
* Restored automatic task lifecycle entries in PostgreSQL activity logs
by ensuring task lifecycle activity listeners are wired during
PostgreSQL backend initialization.
* Activity logs now reliably include task creation and movement events
(with transition details) immediately after backend startup.
* **Tests**
* Added a PostgreSQL activity-log parity test to verify listeners are
connected and that activity logs reflect `task:created` and `task:moved`
as expected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-19 12:34:55 -07:00
gsxdsm
48b3656bde refactor: package code organization wave 11 (#2333)
## Summary

Wave 11 of package code organization (continues #2328 / wave 10), after
syncing main into the wave10 stack.

### Peels

| New module | Parent |
|---|---|
| `app/api/event-source.ts` | resilient `EventSource` reconnect +
pagehide cleanup |
| `app/api/chat.ts` | chat sessions / rooms / streaming |
| `app/api/projects.ts` | multi-project management client |
| `app/api/agents.ts` | agent CRUD / soul / memory |
| `app/api/workflows.ts` | workflow definition client |
| `app/api/scheduling.ts` | automations + routines |
| `app/api/ai-text.ts` | text refine / import translate / subtasks |
| `app/api/ai-sessions.ts` | AI / planning session client +
`startKeepAlive` |
| `app/api/research.ts` | research + evals client |
| `task-store/branch-and-pr-entities.ts` | rename of `remaining-ops-6` |

Public paths stay stable via `legacy.ts` re-exports (`app/api.ts` →
`legacy`).

### LOC

- `legacy.ts` ~8921 → ~5670

### Shims

- `legacy.ts` → peels above (delete-when: dashboard imports domain
modules)
- `remaining-ops-6` → `branch-and-pr-entities` (rename complete)

## Test plan

- [x] eslint on peeled API modules + legacy
- [x] dashboard app typecheck (`app/api/*` clean)
- [x] core typecheck
- [x] `plugin-setup-api` tests
- [ ] CI merge gate

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

* **New Features**
* Expanded dashboard APIs for agents, AI sessions, chat rooms/sessions,
research runs, projects, workflows, routines/automations, and
scheduling.
* Added AI text refinement/translation, planning title regeneration, and
streamed subtask breakdown with task creation.
* Introduced resilient server-sent-events streaming for chat and other
live updates.
* Added workflow export/import and workflow design support, plus scripts
and workflow configuration controls.
* Added research export and ability to attach research outputs to tasks.

* **Enhancements**
* Missions support clearing an auto-merge override back to project
defaults.
  * Subtasks can now include an optional priority when creating tasks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-19 12:16:51 -07:00
gsxdsm
aa401123ea fix: make Windows updates and CE personas reliable (#2340)
## Summary

Windows installs with slow native dependencies now get five minutes to
finish, and a real timeout is reported as an actionable terminal retry
instead of a wall of preceding npm deprecation warnings. Registry
`ETIMEDOUT` errors keep their network diagnosis, including after the
legacy-bin `--force` retry.

Compound Engineering personas are now included in the published CLI
bundle, with complete source-to-staged coverage for all persona
definitions and a clear startup error if the bundled assets are missing
or empty.

The PostgreSQL statement visible in the report was validated by the
existing real-Postgres schema reapply test. Its actual `caused by`
detail was truncated, so this PR deliberately makes no speculative
database change.

## Validation

- Dashboard updater tests: 22 passed
- CLI updater tests: 16 passed
- CE persona installer tests: 7 passed
- Published bundle persona assertion: passed against every source
persona
- CLI and CE plugin typechecks: passed
- Changed production/config lint and strict changeset validation: passed
- Real PostgreSQL schema reapply integration test: passed

---

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


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

* **Bug Fixes**
* Windows CLI and dashboard updates now allow up to five minutes for
installation and restore Compound Engineering agent personas during npm
installs.
* Update failures now surface clearer, terminal timeout guidance (while
preserving specific network connection diagnostics) and avoid misleading
“deprecated”/generic timeout text.
* Persona assets are reliably included in plugin builds and bunded
persona installation now errors clearly when definitions are missing or
empty.
* **Tests**
* Expanded update and bundling coverage for the new 5-minute timeout and
error-handling scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-19 12:16:12 -07:00
gsxdsm
b2a7425c76 refactor(cutover 3/3): dashboard + changesets — IR-driven lifecycle cutover (#2335)
Completes the IR-driven lifecycle cutover: **the workflow IR becomes the
single source of truth for task lifecycle.** Node column assignments
move cards at runtime, every lifecycle predicate re-keys on column
traits instead of literal column ids, and the graph exclusively owns
review gates.

Plan (the spec for this work):
[`docs/plans/2026-07-18-001-refactor-ir-driven-lifecycle-cutover-plan.md`](docs/plans/2026-07-18-001-refactor-ir-driven-lifecycle-cutover-plan.md)

## What changed

**IR as runtime authority (R1, R2).** Graph traversal crossing a node
column boundary moves the card through the store's trait-hook `moveTask`
path, attributed `workflowMoveSource: "workflow-graph"` and emitting
`task:column-transition`. This replaces the executor's hardcoded
`moveTask(id, "in-review")` merge boundary and its handoff-invariant
allowlist. Scheduler, hold/release, self-healing, merger and
finalization now key on column traits
(`intake`/`hold`/`wip`/`merge-blocker`/`human-review`/`merge`/`complete`/`archived`/`timing`/`abort-on-exit`/`reset-on-entry`/`stall-detection`),
with rebound targets resolved per KTD-10.

**Single ownership of review gates (R4, R5).** Triage's out-of-graph
Plan Review gate is deleted; the graph is the sole author. `pending`
step results are CAS-claimed leases with owner and staleness floor
(KTD-4), so a crash/restart re-entry can no longer dispatch a second
reviewer and silently discard the losing verdict.

**Graph ownership is unconditional (R9).** The legacy execute fallback
is gone: `maybeExecuteWorkflowGraph` is now `executeWorkflowGraph`
returning `void`, `graphCompletion` is a required parameter, and a store
that cannot resolve a workflow fails closed rather than silently running
nothing. Also deleted, with a tombstone ratchet: `fn_review_step` and
its RETHINK/session-rewind machinery, `workflow-cutover.ts`,
`workflow-authoritative-driver.ts`, `workflow-parity-observer.ts`, and
the `graphCompletionInterceptors` map.

**`reviewLevel` becomes a creation-time preset (R6)** writing
`enabledWorkflowSteps`, with zero runtime reads.

**Upgrade path (R10).** Migration 0026 adds the durable per-node-entry
IR pin (KTD-3) and the one-time adoption stamp (KTD-8);
`planLegacyAdoption` is the single shared decision run by both the
startup sweep and the store-open reconcile, so pre-cutover rows are
adopted instead of freezing. A stale-binary guard refuses to open a
database migrated by a newer binary.

**Operator surfaces (R2, R11).** Four places still closed the column
set: the dashboard coerced every ingested task's column through the
legacy six-id enum (a card in a custom `Merging` column rendered in
**Triage**), `POST /tasks/:id/move` answered 400 for any
workflow-defined column, retry/reset/re-engage/unassign/spec-revise used
hardcoded move targets, and GitHub issue open/closed mapping
literal-compared `done`/`archived`. All now resolve from the task's
workflow by trait, each with a legacy fallback so `builtin:coding` is
byte-identical.

## Evidence

`builtin:coding` keeps its column ids and observable behavior
byte-compatible (R8, KTD-7), pinned by a characterization oracle. A new
**6-column benchmark acceptance suite** drives a user-authored workflow
— `Ideas → Todo → In-progress → In-review → Merging → Done` — asserting
the ordered transition trail, single-mover at the hold→wip seam (KTD-2),
column-role purity (R12), bounded review cycles from workflow config,
and park-in-place on failure (R3). The same fixture is proven
**editor-buildable** through the real save-validation path, plus
negative cases.

Verified locally on this branch, post-rebase:

- `pnpm test:gate` — green (engine-core 294/294, pg-gate 126/126,
ci-workflow 63/63)
- characterization oracle 59/59, tombstones 5/5, 6-column benchmark
11/11
- `tsc --noEmit` clean for `@fusion/core`, `@fusion/engine`,
`@fusion/dashboard` (both `tsconfig.json` and `tsconfig.app.json`)

## Known reds

- **`executor-task-done-invariant` → "moves a cleanly completed task to
in-review via the merge-node boundary"** — red on this branch. A
real-Postgres test whose graph re-entry rebounds the card to
`in-progress` after `execute()` returns. Not in the merge gate, so it
does not gate CI. Honest status: I could **not** verify it green on
pristine `main` — running main's tests in this worktree reuses built
artifacts and produced obviously polluted results, so I am not claiming
"pre-existing". It needs its own look.
- **`html2canvas` / FN-8309 — fixed here by deleting dead code.**
`packages/dashboard/app/utils/capture-screenshot.ts` imported
`html2canvas`, which is not a dependency of `@fusion/dashboard` and is
**not in `pnpm-lock.yaml` at all**, so it had never compiled in CI. The
file had **zero importers**. Main never caught it because PR Checks runs
only on pull requests (main's last PR Checks run was in June) while
main's own pushes run just the non-blocking Full Suite — so the required
**Typecheck** check was failing on *every* PR against main, including
this one. Inherited from `88b0db0f4` (FN-8309). **To restore when the
feature lands its dependency properly:** `git checkout 88b0db0f4 --
packages/dashboard/app/utils/capture-screenshot.ts` and add
`html2canvas` to `packages/dashboard/package.json` in the same change.
- **pg-gate rotating contention** — historically a different file set
each run with zero assertion failures. It passed 126/126 on the final
run here.

Two entries that were on the provisional ledger turned out **not** to be
pre-existing and are fixed in this PR: the
`workflow-graph-optional-step-fix` replan-cap pair were stale assertions
against U3's own contract change (cap-exhausted now *parks*
awaiting-approval and reports handled, rather than silently leaving the
task in place), and `executor-column-agent-seams` /
`executor-fast-mode-workflows` are green.

## Deferred follow-ups

- **Graph does not suspend at the ready-for-release seam.** A parked
`onNodeEntry` returns `void` and the node executes anyway, so within one
walk the card can run In-progress work while still displayed in Todo.
The benchmark models the scheduler explicitly for this reason and says
so at the seam. Making the graph actually suspend is U4-scope follow-up.
- **`needs-replan` reader migration.** Post-U3 the durable write happens
at the graph's own `plan-replan` seam, so the workflow *is* the writer
and the 14 readers form one coherent graph-owned loop — it is the
graph's durable replan signal wearing a legacy name, not un-migrated
legacy. The adoption census guard requiring that literal in
`executor.ts` is correct and stays. Migrating those readers to a
purpose-built run-state signal is a post-cutover naming change with its
own risk budget.
- **U9b seam-node refinement.** The merge substates
(`merging`/`merging-pr`/`merging-fix`) are adopted as `resume-graph`
rather than mapped to an exact re-entry node; naming a precise node
would require resolving the task's IR, which the adoption module
deliberately cannot do.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

* **New Features**
* Workflows now drive task lifecycle columns, transitions, capacity
limits, review gates, and completion behavior—including custom
workflows.
* Tasks created with review levels automatically receive the
corresponding workflow review steps.
* Legacy in-progress tasks are automatically recovered during upgrades.
  * Dashboard status badges now show the active workflow step name.
* Added safeguards for workflow changes, review ownership, database
compatibility, and workflow validation.

* **Bug Fixes**
  * Fixed custom-column rendering and task movement.
* Improved merge-boundary handling and completion for workflows without
merge steps.
* Prevented cards from stalling, moving backward, or exceeding pooled
WIP capacity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 12:09:12 -07:00
gsxdsm
3f7c32c95c refactor(cutover 2/3): engine — graph-owned lifecycle, legacy execution deleted (#2342)
Part **2 of 3** of the IR-driven lifecycle cutover (stacked on #2341;
top is #2335).

**Scope (80 files, packages/engine + cli/pi skill docs +
AGENTS/architecture):** graph-driven column moves via the
column-boundary controller (R1), single-mover scheduler/hold-release
trait cutover (KTD-2/KTD-9), trait re-keyed self-healing + merger with
the R7b confirmed-merge-must-finalize guarantee, graph-exclusive Plan
Review with leased dedup (R4/R5), the executeCore body-lift — zero
legacy re-entry — with fn_review_step + interceptor machinery deleted
and tombstone-ratcheted (R9), builtin workflow runtime fixes (missing
hold handler, unseamed-node column inheritance, no-merge completion
mover), the 6-column benchmark acceptance suite (11 tests) + 12-builtin
lifecycle sweep (94 assertions), and the executor test-harness
modernization. Also retires core's interpreter-cutover scaffolding whose
last consumer (the authoritative driver) dies here.

**Merge order:** #2341 → this → #2335. After #2341 merges, retarget this
to main.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 12:08:10 -07:00
gsxdsm
05a02e8061 refactor(cutover 1/3): core — IR-driven lifecycle foundation (#2341)
Part **1 of 3** of the IR-driven lifecycle cutover (split from #2335 to
fit review-tool file limits; plan:
docs/plans/2026-07-18-001-refactor-ir-driven-lifecycle-cutover-plan.md,
included here).

**Scope (48 files, packages/core + docs/plans):** shared transition
policy + validator (KTD-5), IR validation hardening incl. the benchmark
capability floor, CAS review leases (KTD-4), pooled WIP capacity budgets
(KTD-9), lifecycle-trait helpers, durable IR pin/drift detection
(KTD-3), review-level creation-time preset, legacy adoption module +
census + migration 0026 + stale-binary guard (KTD-8), core-side builtin
workflow fixes (single default-IR authority, no-merge complete-column
support).

Note: `workflow-cutover.ts` (interpreter parity scaffolding) stays alive
in this PR — its last consumer dies in part 2/3, which retires it.

**Merge order:** this PR → #TBD-2 (engine) → #2335 (dashboard/top).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **New Features**
* Added workflow-trait-driven task lifecycle transitions, including WIP
capacity pooling and workflow-aware recovery (IR pinning + drift
detection).
* Added legacy adoption/backfill for pre-cutover task states, with
unmappable rows safely parked.
* Added create-time `reviewLevel` presets to automatically configure
enabled workflow steps.
* **Bug Fixes**
  * Fixed workflow moves when no workflow selection exists.
* Improved merge-blocker validation to be keyed to the workflow’s actual
review-lane identity, preventing invalid moves and misclassified
terminal states.
* **Tests**
* Added end-to-end and unit/integration coverage for workflow
validation, legacy adoption, migrations/schema guards, leases, review
presets, and transition rules.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 11:50:52 -07:00
Drew Donaldson
c0eafc2fce fix(postgres): widen overflow-prone token/usage counters to bigint (#2331)
SQLite INTEGER is effectively int64, but the PostgreSQL baseline mapped
unbounded token/usage counters on `project.tasks` and
`project.chat_token_usage` to `integer` (int4). Real data contains
values > 2,147,483,647, causing the SQLite-to-PostgreSQL migration to
fail with `value ... is out of range for type integer`.

Changes:
- Change baseline DDL to `bigint` for the affected columns.
- Update Drizzle schema to `bigint({ mode: "number" })` to preserve JS
`number` semantics.
- Add forward migration `0024_bigint_counters.sql` for existing
clusters.
- Bump `SCHEMA_BASELINE_VERSION` to `0024`.

Fixes the int4 overflow observed during migration of large token/usage
counters.

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

* **Bug Fixes**
* Expanded token-usage and activity/lease counters to 64-bit integers to
prevent overflow on large workloads.
* Improved distributed task ID state/reservations to be isolated per
project and to merge/update conflicting entries more reliably.
* **Chores**
* Added an idempotent PostgreSQL migration for bigint counter support
and advanced schema baseline tracking.
* Updated dashboard build support by adding `html2canvas` type
definitions and the production dependency.
* **Tests**
* Updated schema-applier migration checks to include the new
bigint-counters baseline identity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-07-19 10:15:30 -07:00
gsxdsm
845d82ec67 fix(ci): restore full-suite after verification request + lucide mock gaps (#2332)
## Summary

Main Full Suite shards have been red after recent landings. Root causes:

1. **Executor tests** — `execute()` now polls
`getTaskVerificationRequestAsync` (chat-enqueued verification). Shared
`createMockStore()` (and soft-delete inline store) lacked the method, so
nearly every execute-path suite failed with `is not a function`.
2. **TaskDetailModal suites** — `NativeStructurePreview` imports `Map` /
`Lightbulb` / `BarChart3` / `Target` / `CircleAlert` from lucide; the
shared TaskDetail lucide mock omitted them, so suites failed at import.
3. **Grok process-lifecycle** — 15s bound stress timed out under
full-suite load without product-bug evidence → quarantined on sight per
AGENTS.md.

## Test plan

- [x] `executor-task-done-blocked`, `executor-fast-mode-workflows`,
concurrent-execute race
- [x] `executor-step-session`, plan-only scope leak, review-step
indexing
- [x] `TaskDetailModal.create-pr` + `TaskDetail.mobile-transition`
- [ ] Full Suite CI on this PR

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

* **Improvements**
* Added `html2canvas` support in the dashboard to enable HTML-to-canvas
rendering needed for visual structure previews.
* **Tests**
* Updated task execution test mocks to handle task verification-request
flows reliably.
* Improved task deletion safeguard coverage and related execution
behavior checks.
* Enhanced test stubs to support structure preview rendering elements
during modal-related tests.
* **Chores**
* Quarantined a timing-sensitive process lifecycle test and refreshed
quarantine tracking to improve full-suite stability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-19 09:50:22 -07:00
gsxdsm
3bf7f92be0 refactor: package code organization wave 10 (#2328)
## Summary

Wave 10 of package code organization (plan:
`docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`),
after #2274.

### Peels

| New module | Parent |
|---|---|
| `types/agents.ts` | `types.ts` (permissions, Agent entity, ratings,
reflections, heartbeat run types) |
| `app/api/missions.ts` | `legacy.ts` (hierarchy, assertions,
validation, autopilot) |
| `app/api/messaging.ts` | `legacy.ts` (mailbox, approvals,
reflections/ratings, budget) |
| `app/api/plugins-and-skills.ts` | `legacy.ts` |
| `app/api/todo.ts` | `legacy.ts` |
| `app/api/insights.ts` | `legacy.ts` |
| `app/api/system-panel.ts` | `legacy.ts` |
| `task-store/workflow-definitions.ts` | rename of `remaining-ops-8` |

Mission interview SSE streams stay in `legacy.ts` until
`createResilientEventSource` is shared.

Public paths stay stable via re-exports.

### LOC

- `types.ts` ~7101 → ~6165
- `legacy.ts` ~10273 → ~8913

### Shims

- `types.ts` → `types/agents.ts` (delete-when: consumers import agents
domain directly)
- `legacy.ts` → peels above (delete-when: dashboard imports domain
modules)
- `remaining-ops-8` → `workflow-definitions` (rename complete)

## Test plan

- [x] `@fusion/core` typecheck
- [x] eslint on peeled dashboard API modules
- [x] `pnpm check:line-count`
- [x] `agent-permissions` + `agent-permission-policy` tests
- [x] `plugin-setup-api` tests
- [ ] CI merge gate

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

* **New Features**
* Added typed dashboard API support for missions, milestones/features,
validation loops, and autopilot.
  * Added insights browsing and management, including run triggering.
* Added messaging/mailboxes and approvals, plus agent reflections,
ratings, and budget controls.
  * Added plugins & skills management and discovery.
  * Added todo lists and items with reordering.
* Added system monitoring controls: rebuilds/restarts, logs, and
research finding promotion.
* **Improvements**
* Centralized agent-related type contracts for safer browser
consumption.
* Enhanced legacy API compatibility and improved AI session deletion
error handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-19 09:47:58 -07:00
gsxdsm
ecffdbb14b fix: isolate test-mode database access
Prevent automated tests from inheriting production PostgreSQL URLs and route global test-mode startups to a dedicated external or embedded test database.
2026-07-19 00:10:02 -07:00
gsxdsm
b4c1a1ac77 fix(FN-8350): keep tasks running through MCP outages
Retry MCP bootstrap with bounded backoff and request deadlines, then continue with healthy servers when an integration remains unavailable.

Exclude definitions with unresolved secrets so graceful degradation never connects a partially authenticated server.
2026-07-18 21:58:29 -07:00
gsxdsm
74de68af72 fix: prevent duplicate diagnostic task creation
Serialize cross-parent diagnostic claims at project scope and reuse a recent active canonical task. Keep ordinary, completed, and path-distinct work independent.
2026-07-18 21:21:55 -07:00
gsxdsm
e30f6d851f FN-8293: add native structure drag-and-draft mail composition
Mail composers can attach native structures by drag-and-drop and generate report narratives with AI.

- Add a shared native-structure drag protocol and attachable previews across Mail source views.
- Add a disposable compose-chat panel that drafts narratives around attached embeds.
- Cover drag behavior and compose-chat session lifecycle, and document the Mail interaction.

Files changed:
 .changeset/fn-8293-mail-drag-compose-chat.md       |   7 ++
 docs/dashboard-guide.md                            |   3 +
 .../dashboard/app/components/ComposeChatPanel.css  |  33 ++++++
 .../dashboard/app/components/ComposeChatPanel.tsx  | 117 +++++++++++++++++++++
 packages/dashboard/app/components/EvalsView.tsx    |   3 +-
 packages/dashboard/app/components/GoalsView.tsx    |   6 ++
 packages/dashboard/app/components/InsightsView.tsx |   8 +-
 .../dashboard/app/components/MessageComposer.css   |  22 ++++
 .../dashboard/app/components/MessageComposer.tsx   |  92 ++++++++++++++--
 .../dashboard/app/components/MissionManager.tsx    |  11 +-
 .../components/__tests__/ComposeChatPanel.test.tsx | 102 ++++++++++++++++++
 .../components/__tests__/MessageComposer.test.tsx  |  25 +++++
 .../utils/__tests__/nativeStructureDrag.test.ts    |  56 ++++++++++
 .../dashboard/app/utils/nativeStructureDrag.ts     |  54 ++++++++++
 14 files changed, 525 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8293
Fusion-Task-Lineage: 9864e76c-2a0d-41f6-b7f2-de8dd63710b5
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 20:30:42 -07:00
gsxdsm
0dbe67c851 FN-8356: clear stale duplicate decision pauses
Clear inactive duplicate markers so eligible tasks resume planning instead of showing a stranded decision badge.

- Reconcile stale triage-marker duplicate pauses during self-healing and record audit events.
- Clear inactive canonical markers during triage while preserving user and unrelated pauses.
- Cover missing, deleted, completed, and archived canonical states with regression tests.

Files changed:
 .changeset/fn-8356-stale-duplicate-decision.md     |   7 ++
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   1 +
 .../explicit-duplicate-marker-sweep.test.ts        |  43 ++++++--
 .../self-healing-stale-duplicate-decision.test.ts  | 109 +++++++++++++++++++++
 .../triage-explicit-duplicate-marker.test.ts       |  32 ++++--
 packages/engine/src/run-audit.ts                   |   2 +
 packages/engine/src/self-healing.ts                |  87 ++++++++++++++--
 packages/engine/src/triage.ts                      |  41 ++++++--
 9 files changed, 298 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-8356

Fusion-Task-Lineage: 8df8f0ee-d73e-41d6-8abe-a4b33662c9da

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 20:06:41 -07:00
gsxdsm
d31a43d586 FN-8345: preserve manual live-log scrolling
Keep live workflow output at the tail only while the reader remains pinned.

- Track whether readers remain near the live log tail before following output.
- Observe in-place streamed content growth and resume following after re-pinning.
- Cover desktop and mobile scrolling behavior with workflow log regression tests.

Files changed:
 .changeset/fn-8345-workflow-live-log-scroll.md     |   7 +
 .../app/components/WorkflowResultsTab.tsx          | 113 ++++++++++------
 .../__tests__/WorkflowResultsTab.test.tsx          | 146 ++++++++++++++++++++-
 3 files changed, 225 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-8345

Fusion-Task-Lineage: 44075099-738d-4c61-b482-dd7c500539d3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 20:02:34 -07:00
gsxdsm
996155734a FN-8363: add outer dispatch dependency gate coverage
Add regression coverage for dependency gating before executor dispatch.

- Verify unmet live dependencies requeue before graph, authoritative, and legacy dispatch paths
- Cover satisfied, missing, soft-deleted, shadow-marker, and pre-held-slot dependency cases

Files changed:
 ...executor-outer-dispatch-dependency-gate.test.ts | 241 +++++++++++++++++++++
 1 file changed, 241 insertions(+)

Fusion-Task-Id: FN-8363

Fusion-Task-Lineage: 9528e846-2e9b-4c20-a2a2-7af3bb91b245

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:56:24 -07:00
gsxdsm
c8b4e23ca4 FN-8357: show verification videos in the Quality hub
Surface executor-produced task verification videos in the top-level Quality hub.

- Fetch review-artifact settings and video artifacts per selected project.
- Render tokenized inline videos with source-task navigation and responsive states.
- Add host interop aliases, coverage, documentation, and a minor changeset.

Files changed:
 .changeset/FN-8357-quality-verification-videos.md  |   7 +
 docs/settings-reference.md                         |   2 +-
 docs/workflow-steps.md                             |   2 +-
 packages/dashboard/tsconfig.app.json               |   1 +
 packages/dashboard/vite.config.ts                  |   2 +
 packages/dashboard/vitest.config.ts                |   2 +
 plugins/fusion-plugin-quality/package.json         |   1 +
 .../dashboard-view-verification-videos.test.tsx    | 131 ++++++++++++++++++
 .../src/dashboard-interop.d.ts                     |  20 +++
 .../fusion-plugin-quality/src/dashboard-view.css   |  87 ++++++++++++
 .../fusion-plugin-quality/src/dashboard-view.tsx   | 151 +++++++++++++++++++--
 plugins/fusion-plugin-quality/tsconfig.json        |   1 +
 plugins/fusion-plugin-quality/vitest.config.ts     |   8 ++
 pnpm-lock.yaml                                     | 135 +++++++++++++++++-
 14 files changed, 532 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-8357
Fusion-Task-Lineage: 728a5417-87ed-4203-850d-8ee108206766
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:51:58 -07:00
gsxdsm
cf3f5e9bf0 FN-8292: embed native structures in mail messages
Embed selected native project structures directly in mailbox messages and drafts.

- Persist native structure embeds in message metadata and expose their shared types.
- Add composer selection, mailbox rendering, previews, and dashboard navigation for linked structures.
- Cover metadata persistence and mailbox embed behavior with core and dashboard tests.

Files changed:
 .changeset/fn-8292-mail-native-structure-embeds.md |  7 ++
 docs/dashboard-guide.md                            |  1 +
 .../message-metadata-native-structures.test.ts     | 25 +++++++
 .../__tests__/postgres/message-store.pg.test.ts    | 21 ++++++
 packages/core/src/index.ts                         |  2 +-
 packages/core/src/types.ts                         | 32 +++++++++
 packages/core/src/types/messages.ts                | 14 ++++
 packages/dashboard/app/components/MailboxModal.css | 29 ++++++++
 packages/dashboard/app/components/MailboxModal.tsx | 13 +++-
 .../components/MailboxNativeStructureEmbeds.tsx    | 37 ++++++++++
 packages/dashboard/app/components/MailboxView.tsx  | 14 +++-
 .../dashboard/app/components/MessageComposer.tsx   | 65 ++++++++++++++++--
 .../app/components/NativeStructurePreview.tsx      |  6 +-
 .../__tests__/MailboxModal.cache.test.tsx          |  8 +--
 .../app/components/__tests__/MailboxModal.test.tsx |  9 +++
 .../MailboxNativeStructureEmbeds.test.tsx          | 42 ++++++++++++
 .../app/components/__tests__/MailboxView.test.tsx  |  9 +++
 .../components/__tests__/MessageComposer.test.tsx  | 25 +++++++
 .../app/components/dashboard/MainContent.tsx       | 78 +++++++++++++++++++++-
 .../MainContent.mailbox-view-task.test.tsx         | 46 ++++++++++++-
 20 files changed, 459 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8292

Fusion-Task-Lineage: ae6cfb9c-a764-407c-bd45-cfd879ccdd3e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:45:08 -07:00
gsxdsm
bc4b679598 FN-8291: add inline native structure previews to chat
Enable chat users to inspect and open referenced native structures inline.

- Render clickable inline previews for native structure references across chat surfaces.
- Route preview actions to their corresponding task, mission, goal, and other dashboard views.
- Add regression coverage, dashboard documentation, and a CLI changeset.

Files changed:
 ...fn-8291-chat-native-structure-inline-preview.md |   7 +
 docs/dashboard-guide.md                            |   5 +-
 packages/dashboard/app/App.tsx                     |  31 +++
 .../app/components/StandardChatSurface.tsx         | 226 ++++++++++++++++--
 ...andardChatSurface.nativeStructureEmbed.test.tsx | 257 +++++++++++++++++++++
 .../__tests__/nativeStructureChatRef.test.ts       |  54 +++++
 .../app/components/nativeStructureChatRef.ts       |  58 +++++
 .../app/components/nativeStructureNavigation.ts    |  21 ++
 8 files changed, 635 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8291

Fusion-Task-Lineage: 9db2c0fa-494e-4779-93f3-3309eed8565a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:36:57 -07:00
gsxdsm
b61311baa8 FN-8305: add durable PostgreSQL symbol locks
Introduce durable project-scoped symbol locks backed by PostgreSQL.

- Add normalized lease-based lock acquisition, renewal, release, and reconciliation APIs with audit events.
- Add PostgreSQL schema migrations and self-healing reconciliation coverage.
- Document the lock model and test migration and lock behavior.

Files changed:
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   1 +
 docs/storage.md                                    |   7 +
 .../src/__tests__/postgres/schema-applier.test.ts  | 115 +++++++++-
 packages/core/src/__tests__/symbol-locks.test.ts   |  91 ++++++++
 packages/core/src/index.ts                         |  17 ++
 .../core/src/postgres/migrations/0000_initial.sql  |  25 +++
 .../src/postgres/migrations/0025_symbol_locks.sql  |  63 ++++++
 packages/core/src/postgres/schema-applier.ts       |  18 +-
 packages/core/src/postgres/schema/project.ts       |  29 +++
 packages/core/src/store.ts                         |  23 ++
 packages/core/src/symbol-lock-types.ts             |  60 +++++
 packages/core/src/task-store/symbol-locks.ts       | 244 +++++++++++++++++++++
 .../__tests__/symbol-lock-reconciliation.test.ts   |  19 ++
 packages/engine/src/self-healing.ts                |  35 +++
 15 files changed, 745 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-8305

Fusion-Task-Lineage: efd95c73-23e3-4359-8204-dfad374a39bc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:31:30 -07:00
gsxdsm
13540ee9c2 FN-8344: preserve manual planner chat scroll position
Keep Planner Chat pinned to live output only while readers remain near the transcript tail.

- Track user scroll position and distinguish programmatic anchoring.
- Preserve manually unsnapped transcript positions during streamed updates.
- Add scroll-follow regression coverage and a patch changeset.

Files changed:
 .changeset/fn-8344-planner-chat-scroll-follow.md   |   7 ++
 .../app/components/TaskPlannerChatTab.tsx          |  63 +++++++++-
 .../__tests__/TaskPlannerChatTab.test.tsx          | 134 ++++++++++++++++++++-
 3 files changed, 198 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-8344

Fusion-Task-Lineage: fde7965c-cffc-4908-90c1-3df1f3c2af75

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:24:52 -07:00
gsxdsm
12aee016ee FN-8352: promote ideation to top-level navigation
Make ideation independently accessible from desktop and mobile navigation.

- Add an Ideation view backed by the Command Center panel and view-state routing.
- Surface Ideation in desktop/sidebar and mobile primary navigation, with coverage for navigation and rendering.
- Document the experimental setting and add a minor changeset.

Files changed:
 .changeset/fn-8352-ideation-top-level-view.md      |  7 ++++
 docs/dashboard-guide.md                            | 14 +++++++
 docs/settings-reference.md                         |  3 +-
 .../src/__tests__/mobile-nav-primary-items.test.ts | 10 ++++-
 packages/core/src/mobile-nav-primary-items.ts      | 17 +++++++-
 packages/dashboard/app/App.tsx                     | 16 ++++++-
 packages/dashboard/app/components/Header.tsx       | 21 +++++++--
 .../dashboard/app/components/LeftSidebarNav.tsx    |  8 +++-
 packages/dashboard/app/components/MobileNavBar.tsx |  2 +
 .../dashboard/app/components/SettingsModal.tsx     |  6 +++
 .../app/components/__tests__/App.test.tsx          | 20 +++++++++
 .../app/components/__tests__/Header.test.tsx       | 15 +++++++
 .../components/__tests__/LeftSidebarNav.test.tsx   |  5 +++
 .../app/components/__tests__/MobileNavBar.test.tsx | 43 +++++++++++++++---
 .../components/command-center/CommandCenter.tsx    | 12 +++---
 .../__tests__/CommandCenter.test.tsx               |  7 ++--
 .../__tests__/IdeationPanel.test.tsx               | 49 ++++++++++++++++++++++
 .../app/components/dashboard/MainContent.tsx       | 13 ++++++
 .../dashboard/app/components/dashboard/types.ts    |  1 +
 .../settings/sections/GeneralSection.tsx           | 10 ++---
 packages/dashboard/app/hooks/useViewState.ts       |  8 +++-
 21 files changed, 256 insertions(+), 31 deletions(-)

Fusion-Task-Id: FN-8352
Fusion-Task-Lineage: e7791119-2fe5-4e68-b669-0e5bd8df9b49
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:18:57 -07:00
gsxdsm
482dbe77a4 FN-8340: preserve Quick Chat layout on restore
Keep minimized Quick Chat mounted and layout-stable for instant restores.

- Hide retained floating windows with visibility and disable pointer interaction
- Cover conversation-load, session, and scroll retention across desktop and mobile restores
- Document the retained Quick Chat behavior

Files changed:
 docs/dashboard-guide.md                            |  2 +-
 packages/dashboard/app/components/FloatingWindow.css | 12 +++--
 packages/dashboard/app/components/FloatingWindow.tsx |  9 ++--
 packages/dashboard/app/components/__tests__/FloatingWindow.test.tsx |  4 ++
 packages/dashboard/app/components/__tests__/QuickChat.persist.test.tsx | 58 +++++++++++++++++-----
 5 files changed, 63 insertions(+), 22 deletions(-)

Fusion-Task-Id: FN-8340

Fusion-Task-Lineage: 25027098-b89a-481c-bf00-de64cf302628

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:11:56 -07:00
gsxdsm
0400c02f08 FN-8355: preserve mobile model list scrolling
Keep filtered mobile model dropdown lists scrollable when the virtual keyboard repositions the viewport.

- Allow the portaled list flex child to shrink and retain overflow ownership.
- Cover desktop and mobile scroll contracts, filtering, keyboard repositioning, and no-result states.
- Add a patch changeset for the mobile dropdown fix.

Files changed:
 .changeset/fn-8355-mobile-model-dropdown-scroll.md |  7 ++
 .../app/components/CustomModelDropdown.css         |  4 ++
 .../__tests__/CustomModelDropdown.test.tsx         | 79 ++++++++++++++++++++++
 3 files changed, 90 insertions(+)

Fusion-Task-Id: FN-8355

Fusion-Task-Lineage: 4e9dff76-f347-45ff-8ef6-abd7eea90d20

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 19:04:07 -07:00
gsxdsm
927f2baf7d FN-8354: add Oh My Pi provider logo
Render the official Oh My Pi mark throughout provider selection and analytics surfaces.

- Add a tokenized OMP SVG icon and provider aliases.
- Infer OMP-tagged model identifiers without misattributing bare models.
- Cover OMP icon rendering and inference with dashboard tests.

Files changed:
 packages/dashboard/app/components/ProviderIcon.tsx | 26 +++++++++++++++++++++-
 .../app/components/__tests__/ProviderIcon.test.tsx | 23 +++++++++++++++++++
 packages/dashboard/app/styles.css                  |  1 +
 .../app/utils/__tests__/providerIconKey.test.ts    |  8 +++++++
 packages/dashboard/app/utils/providerIconKey.ts    |  9 ++++++++
 5 files changed, 66 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8354

Fusion-Task-Lineage: 71d5638c-b41e-4960-9391-c7a441d04f51

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:58:44 -07:00
gsxdsm
0cba6fa56a FN-8351: move org portability controls to Team
Move organization export and import from Overview to the Team section.

- Render the existing portability controls in TeamArea with the established settings refresh flow
- Remove the Overview mount and update focused placement coverage
- Document the Team-tab location and add a patch changeset

Files changed:
 .changeset/fn-8351-org-portability-team-tab.md     |  7 +++
 docs/dashboard-guide.md                            |  3 +-
 .../command-center/CommandCenterControls.tsx       |  6 +-
 .../__tests__/CommandCenterControls.test.tsx       | 15 ++---
 .../components/command-center/areas/TeamArea.tsx   |  8 +++
 .../areas/__tests__/TeamArea.test.tsx              | 66 ++++++++++++++++++++++
 6 files changed, 91 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8351

Fusion-Task-Lineage: 3877a8ec-f307-4da5-88bb-806e1428d14a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:53:02 -07:00
gsxdsm
9f44f26a36 FN-8350: move configuration versions into Settings
Move project configuration revision history and rollback controls from Command Center to Settings.

- Add a Project Settings configuration versions section with rollback handling.
- Remove the Command Center revision card and retain organization portability controls.
- Update translations, dashboard documentation, tests, and release metadata.

Files changed:
 .changeset/fn-8350-config-versions-settings.md     |  7 ++
 docs/dashboard-guide.md                            |  3 +-
 .../dashboard/app/components/SettingsModal.tsx     | 11 ++++
 .../command-center/OrgPortabilityControls.css      | 47 ++------------
 .../command-center/OrgPortabilityControls.tsx      | 55 +---------------
 .../__tests__/CommandCenter.mobile-scroll.test.tsx |  2 +-
 .../__tests__/OrgPortabilityControls.test.tsx      | 37 ++---------
 .../sections/ConfigurationVersionsSection.css      | 56 ++++++++++++++++
 .../sections/ConfigurationVersionsSection.tsx      | 75 ++++++++++++++++++++++
 .../ConfigurationVersionsSection.test.tsx          | 58 +++++++++++++++++
 packages/i18n/locales/en/app.json                  | 29 +++++----
 11 files changed, 238 insertions(+), 142 deletions(-)

Fusion-Task-Id: FN-8350

Fusion-Task-Lineage: a7f68720-038a-42a6-b064-38533c584492

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:45:16 -07:00
gsxdsm
38891bfd81 FN-8296: add chat-requested task verification
Enable chat agents to queue and monitor executor-owned verification runs.

- Persist task verification requests through a new PostgreSQL migration.
- Expose action-gated chat request and status tools with executor processing.
- Show verification status in task and Command Center views.
- Advance the schema baseline to migration 0024 and keep chat mocks complete.

Files changed:
 .changeset/fn-8296-feature.md                      |  7 ++
 docs/agent-tool-surface-full-loop.md               | 10 +--
 docs/dashboard-guide.md                            |  4 +
 packages/core/src/index.ts                         |  2 +
 .../core/src/postgres/migrations/0000_initial.sql  | 20 +++++
 .../migrations/0024_task_verification_request.sql  | 20 +++++
 packages/core/src/postgres/schema-applier.ts       | 13 ++-
 packages/core/src/postgres/schema/project.ts       | 25 ++++++
 packages/core/src/store.ts                         | 16 +++-
 packages/core/src/task-store/reads.ts              | 14 +++-
 packages/core/src/task-store/remaining-ops-6.ts    | 49 ++++++++++-
 packages/core/src/types.ts                         | 30 +++++++
 packages/dashboard/app/api/legacy.ts               |  1 +
 packages/dashboard/app/api/task-content.ts         | 10 +++
 .../dashboard/app/components/TaskDetailModal.tsx   | 17 +++-
 .../app/components/TaskVerificationStatus.css      | 94 ++++++++++++++++++++++
 .../app/components/TaskVerificationStatus.tsx      | 39 +++++++++
 .../__tests__/TaskVerificationStatus.test.tsx      | 28 +++++++
 .../components/command-center/CommandCenter.css    | 33 ++++++++
 .../components/command-center/CommandCenter.tsx    | 37 ++++++++-
 packages/dashboard/src/__tests__/chat.test.ts      |  1 +
 packages/dashboard/src/chat.ts                     | 55 +++++++++++++
 .../src/routes/register-command-center-routes.ts   | 20 +++++
 .../src/routes/register-task-workflow-routes.ts    | 17 ++++
 packages/engine/src/executor.ts                    | 51 +++++++++++-
 packages/engine/src/gating-classifications.ts      |  5 ++
 packages/engine/src/index.ts                       |  2 +-
 27 files changed, 605 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-8296

Fusion-Task-Lineage: f94647cf-c89f-4f0e-b25f-cbf5b56683bc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:38:47 -07:00
gsxdsm
a348428f32 FN-8335: surface settings defaults in help tips
Expose default and inheritance descriptions through consistent Settings help affordances.

- Move report-mode and per-action override descriptions into accessible help tips
- Cover default, override reset, and embedded PostgreSQL connection-cap help text
- Keep the settings-default description inventory aligned with rendered copy

Files changed:
 .../__tests__/SettingsModal.general.test.tsx       | 37 ++++++++++++++++++++++
 .../settings/sections/GeneralSection.tsx           | 28 +++++++++-------
 .../settings-default-descriptions.test.tsx         | 13 ++++----
 3 files changed, 60 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-8335

Fusion-Task-Lineage: 7a8711be-8559-4799-afcd-8f22ac3adc2b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:19:12 -07:00
gsxdsm
e2b5532290 FN-8288: add native structure preview foundation
Provide reusable, typed previews for native dashboard structures.

- Define five-kind native structure references and preview payloads.
- Add project-scoped preview resolution API with unavailable states and capped excerpts.
- Add a callback-driven inline preview card, tests, documentation, and release note.

Files changed:
 .changeset/fn-8288-native-structure-preview.md     |   7 ++
 docs/dashboard-guide.md                            |   4 +
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/types.ts                         |  54 ++++++++++
 packages/dashboard/app/api/legacy.ts               |   1 +
 packages/dashboard/app/api/task-content.ts         |  13 ++-
 .../app/components/NativeStructurePreview.css      |  61 +++++++++++
 .../app/components/NativeStructurePreview.tsx      | 115 +++++++++++++++++++++
 .../__tests__/NativeStructurePreview.test.tsx      | 102 ++++++++++++++++++
 packages/dashboard/src/native-structure-preview.ts |  88 ++++++++++++++++
 .../native-structure-preview-routes.test.ts        | 102 ++++++++++++++++++
 .../src/routes/register-task-workflow-routes.ts    |  23 +++++
 13 files changed, 571 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-8288

Fusion-Task-Lineage: 1a4ce369-9f9e-4a45-b533-2d53b5f1020c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:11:02 -07:00
gsxdsm
ed2ffc4885 FN-8346: preserve manual scroll position in live logs
Preserve the sticky-bottom follow invariant across streamed Dev Server and System Controls output.

- Track pinned-bottom state synchronously for rebuild and system-log streams.
- Follow in-place Dev Server transcript mutations only while the reader is pinned.
- Cover manual unsnapping, stream growth, and re-pinning behavior.
- Add a patch changeset for live-log scrolling.

Files changed:
 .changeset/fn-8346-live-tail-scroll-follow.md      |  7 ++
 .../app/components/DevServerLogViewer.tsx          | 43 ++++++++++--
 .../__tests__/DevServerLogViewer.test.tsx          | 47 +++++++++++++
 .../__tests__/SystemControlsArea.test.tsx          | 81 +++++++++++++++++++++-
 .../command-center/areas/SystemControlsArea.tsx    | 44 ++++++++++--
 5 files changed, 208 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8346

Fusion-Task-Lineage: c1eeb84d-c0af-473b-99f1-0d8564ac8a24

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:04:26 -07:00
gsxdsm
059a71f5e9 fix(FN-8288): fail closed when review contract is unavailable
Fusion-Task-Id: FN-8288
2026-07-18 18:00:52 -07:00
gsxdsm
4cc8002c97 FN-8341: rework planning interviews for reactive validation
Make planning interviews user-controlled and context-aware from validation through task creation.

- Replace fixed-depth and deepening checkpoints with reactive follow-up questions
- Add explicit planning validation and require it before creating or breaking down work
- Expose validation through the API, CLI, routes, types, documentation, and release notes
- Update localized copy and PlanningModeModal mocks and assertions for the revised workflow

Files changed:
 .changeset/fn-8341-deepening-checkpoint-removal.md |   7 +
 .changeset/fn-8341-planning-reactive-backend.md    |   7 +
 docs/dashboard-guide.md                            |   8 +-
 packages/cli/src/commands/task.ts                  |  12 +-
 packages/core/src/index.gate.ts                    |   2 +-
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/types.ts                         |  38 +-
 packages/dashboard/app/api/legacy.ts               |  15 +-
 .../dashboard/app/components/PlanningModeModal.tsx | 192 +-----
 .../__tests__/PlanningModeModal.autosize.test.tsx  |   4 +
 .../__tests__/PlanningModeModal.initial.test.tsx   |  50 +-
 .../PlanningModeModal.planning-flow.test.tsx       | 442 +------------
 .../__tests__/PlanningModeModal.test-helpers.ts    |   1 +
 .../PlanningModeModal.ui-interactions.test.tsx     |   3 +
 .../__tests__/planning-infinite-interview.test.ts  | 221 +++++++
 packages/dashboard/src/planning.ts                 | 711 ++++++---------------
 .../src/routes/register-planning-subtask-routes.ts |  64 +-
 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 -
 23 files changed, 536 insertions(+), 1249 deletions(-)

Fusion-Task-Id: FN-8341

Fusion-Task-Lineage: 102f88af-2675-43f5-8e08-5403a0e17da8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 17:53:20 -07:00
gsxdsm
358b628b8d fix(FN-8288): preserve approved review and recovery state
Fusion-Task-Id: FN-8288
2026-07-18 17:24:49 -07:00
gsxdsm
a3dda8eaff fix(core): prevent concurrent startup database failures (#2330)
## Summary

Concurrent PostgreSQL project initialization no longer causes transient
dashboard failures, including repeated `GET /api/remote/status` 500
responses. The failure was a database deadlock between project-row
identity promotion and schema/plugin DDL, which previously acquired
overlapping locks in inconsistent orders.

This establishes one advisory-lock order across SQLite cutover, project
identity promotion, and schema mutations. Focused regression coverage
proves schema DDL waits behind an active migration transaction and that
identity stamping acquires the migration lock before reading
project-owned tables.

## Validation

- 25 focused unit tests passed.
- 3 focused real-PostgreSQL regression tests passed.
- `@fusion/core` typecheck passed.
- Strict changeset validation passed.
- Fast workspace verification passed, including the CLI build and boot
health check.

---

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


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

## Summary by CodeRabbit

* **Bug Fixes**
* Prevented transient dashboard failures caused by PostgreSQL startup
and migration deadlocks.
* Improved serialization when multiple projects initialize or update
database schemas concurrently.
* Ensured migration state updates and schema changes occur in a
consistent order.

* **Tests**
* Added coverage for migration lock ordering, concurrent schema
operations, and recovery after lock contention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-18 17:12:27 -07:00
gsxdsm
f5c9dc6f91 fix: prevent stuck-kill from stranding approved plans as unplanned (#2326)
## Summary

Fixes a race where a stuck-kill during Plan Review could leave an
approved task stranded in `todo` as **unplanned**, so the scheduler
refused release to `in-progress` for several minutes (observed on
FN-1312: ~6m39s idle after Plan Review APPROVE).

### What went wrong

1. Finalize clears `status` early, then runs Plan Review.
2. Stuck-kill disposes the main triage session near the 30m processing
threshold.
3. Stale eviction only treated the main session as live, so the card
left `processing` while Plan Review / finalize was still running.
4. A second planner claimed `status: "planning"` and rewrote
`PROMPT.md`.
5. The first finalize moved `triage → todo` without clearing planning
statuses.
6. Hold-release saw planning/`needs-replan` and blocked: *“card is
unplanned and cannot enter processing column in-progress”*.

### Fix

In `packages/engine/src/triage.ts`:

- Track **finalizing** handoffs and **live Plan Review subagents** as
live planning work.
- Keep them in `getProcessingTaskIds`, refuse concurrent `specifyTask`,
and skip stale-processing eviction while they are live.
- **Defer** stuck-abort requeue during finalize (bump kill count only;
do not force `needs-replan`).
- Recover approved drafts with `status: null` (post early-clear), not
only `status: "planning"`.
- Re-assert `status: null` after the successful release move to todo.

### Tests

Regression coverage in `triage.test.ts` for eviction retention,
processing-id inclusion, null-status recovery, needs-replan
non-recovery, and deferred stuck-abort during finalize.

## Test plan

- [x] `pnpm --filter @fusion/engine exec vitest run
src/__tests__/triage.test.ts -t "evictStaleProcessing|specified triage
recovery|stuck|recoverApproved|markStuckAborted|defers stuck-abort"`
(related cases green)
- [ ] CI gate on this PR
- [ ] Optional: reproduce stuck-kill mid–Plan Review and confirm todo
releases without a second full replan

## Notes

Secondary report (stuck-kill immediately after all implementation steps
complete, then 16s auto-recovery) is **out of scope** here; existing
recovery already continued by skipping completed steps.


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

* **Bug Fixes**
* Improved recovery for approved tasks when Plan Review has completed,
including correct handling of `null`-status drafts.
* Avoided recovering unplanned seed drafts and tasks that should enter a
replanning flow.
* Refined stuck-abort requeue/cleanup to respect in-progress Plan Review
and finalize handoffs.
* Prevented stale-processing eviction from removing tasks while Plan
Review/subagent finalization is still active.
* Blocked new triage discovery and task specification when finalize/Plan
Review work is ongoing, preventing handoff disruption.
* Preserved durable task state during handoff completion
(approval/failure/replan outcomes).
* **Tests**
* Added expanded triage recovery and stuck-abort/stale-eviction
regression coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-18 17:11:55 -07:00