Commit Graph

1474 Commits

Author SHA1 Message Date
gsxdsm
204772bcc3 fix: show the dev tunnel URL in the TUI instead of painting over it
`pnpm dev --tunnel` printed its banner to stdout, and a TTY run then handed
the screen to DashboardTUI, which repainted over it. The public URL — the
entire output of the flag — was unreadable.

The wrapper forwards the URL to the dev child over the IPC channel it already
uses for the listening report, and the dashboard renders a Tunnel row in the
system panel beside URL and Token.

Capture is order-independent. cloudflared can publish before or after the TUI
is constructed, and an IPC message that arrives with no listener attached is
lost, so the URL is stored at run scope on arrival and applied by whichever
half completes second.

Watch-mode restarts reuse the tunnel (a fresh quick tunnel would hand out a
new hostname on every reload), but the new child knows nothing about it, so
the wrapper re-announces on each listening report.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 21:20:34 -07:00
gsxdsm
16e63462cc fix: audit fallout — tunnel port, orphaned dev processes, scrollback clear
Auditing for repeats of the `pnpm dev --tunnel` bugs turned up the same
mistakes elsewhere.

Remote tunnels assumed 4040. ProjectEngine's Cloudflare quick tunnel
hardcoded http://localhost:4040, so a dashboard on an explicit --port, a PORT
override, or runDashboard's EADDRINUSE rebind published a PUBLIC tunnel to
whatever else held 4040. The dashboard now records its bound port
(setLocalDashboardPort, from both runDashboard and headless serve) and the
tunnel reads it, keeping 4040 only as the pre-report default.
register-discovery-routes already derived its port from req.socket.localPort
and is untouched.

Stopping the dev wrapper orphaned everything it started. It installed no
signal handlers, so teardown only ran from the child's close handler:
signalling the wrapper left the dev server AND its cloudflared alive —
observed twice, four surviving processes each time, including a public
trycloudflare URL still serving a dev server believed to be down. Ctrl-C hid
it by signalling the whole process group.

SessionTerminal appended scrollback instead of clearing first, though the
server sends it as a separate frame precisely so the client can clear. Latent
today because every reattach builds a fresh xterm; a duplicated-history bug
the moment an in-place reconnect appears.

And BackupManager's centralDbPath is gone: written, never read, and a
leftover of the removed SQLite backup — the same class of stale artifact that
onboarding was using as evidence about a Postgres install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 21:09:03 -07:00
gsxdsm
b67e3aa8bc fix: stop onboarding ambushing a working install with questions
Two defects, both visible as "why is it asking me about AI provider setup
when I just started a dev server?".

The auto-launch gate probed ~/.fusion/fusion-central.db to decide whether the
install was initialized. SQLite central was removed, so a Postgres install
never creates that file and the probe was permanently false: onboarding
auto-launched on every interactive start of a completely working Fusion,
until something happened to stamp the completion marker. The probe now also
accepts the embedded Postgres data directory.

And auto-launched onboarding ran the full interactive flow. It fires while
the operator is starting something else, so its questions interrupt work
nobody asked to interrupt — and a dev server stopped on a prompt never
listens, which is why `pnpm dev --tunnel` produced no dev server and so no
tunnel link. Auto-launch is now non-interactive: create the central database,
stamp the marker, point at the dashboard, ask nothing. `fn onboard` still
runs every step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:55:18 -07:00
gsxdsm
ce69558c7a fix: always create the central DB during onboarding, never ask
The step was a skippable prompt, but declining left an install Fusion cannot
run on — reported by a line that described the breakage without fixing it.
There is no useful negative answer.

It also blocked non-interactive startup: `pnpm dev --tunnel` sat on "Run
central db now? (Y/n)", never reached listening, and so served nothing at all
while the tunnel had no dev server to point at.

The database is now created unconditionally when absent; the already-exists
path is untouched. Scripted onboarding tests lose their leading central-DB
answer, and the skip-every-step case now asserts the database is still
created.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:40:34 -07:00
gsxdsm
6f461a4744 fix: take the dev tunnel's token from the dev server, not a guessed file
The banner re-derived the token from ~/.fusion/settings.json. That is simply
the wrong source: on a real run the file contained no daemonToken while the
dashboard's own banner, two lines above, printed a working one — so the
tunnel claimed no token existed next to a token that plainly did.

The dashboard already holds the resolved token at the point where it reports
its bound port, so it now reports both over the same IPC message and the
wrapper prefers that over anything it could derive. The env/settings lookup
survives only for targets that report nothing, such as an explicit
--tunnel=PORT aimed at a server the dev child knows nothing about. The token
crosses the existing parent/child channel only; it is never logged or sent
onward.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:16:44 -07:00
gsxdsm
0289d26b13 fix: tunnel the dev server's real port, not whatever holds 4040
The tunnel target was resolved from PORT/4040 before anything bound, but an
occupied port makes the dashboard silently rebind to an ephemeral one
(server.listen(0) on EADDRINUSE). With a normal Fusion already running on
4040, `pnpm dev --tunnel` therefore published THAT instance under a
dev-looking URL while the dev server sat unreachable on a random port.

The dashboard now reports the port it actually bound to the dev supervisor
over IPC, and the wrapper tunnels that:

- IPC is enabled whenever --tunnel is set, not only in watch mode; a plain
  tunnel run previously had no channel at all.
- The tunnel waits for the report (60s cap, then falls back to the configured
  port with a warning), so it also cannot come up against a port nothing is
  serving yet.
- A mismatch is logged instead of silent.
- A reported port is treated as the dashboard whatever its number, so the
  banner keeps printing the bearer token; without that, the ephemeral case
  would classify the dev dashboard as a foreign port and drop it.
- An explicit --tunnel=PORT names a target the dev child knows nothing about,
  so it never waits and is still compared against the configured port.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 18:49:42 -07:00
gsxdsm
ee57f8a3b9 fix: print the dashboard token with the dev tunnel URL
`pnpm dev --tunnel` published a bare URL under a "public, unauthenticated"
header. That label was wrong for the flag's own default target: --tunnel with
no port aims at the dashboard, which is bearer-token gated, so the recipient
of a shared link got a 401 with no token to supply.

resolveDevTunnelAuth() now classifies the target and the banner says what is
actually true of it:

  token         dashboard with auth on — prints the token and a ?token= link,
                resolved from FUSION_DASHBOARD_TOKEN, FUSION_DAEMON_TOKEN,
                then ~/.fusion/settings.json
  token-pending first run, token not minted yet — defers to the dashboard's
                own startup banner
  no-auth       --no-auth is on; the dashboard really is open
  foreign       a non-dashboard port; Fusion has no auth to lend it, the only
                genuinely ungated case

Auth resolves at banner time rather than flag-parse time so a token the dev
child mints on a first authenticated run is already readable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 18:21:50 -07:00
gsxdsm
7423555c46 feat(dev): pnpm dev --tunnel publishes the dev server over a quick tunnel
Operator case: someone works inside a remote Fusion (a container, a shared box),
starts a dev server there, and needs to view it from their own browser. The dev
server binds inside that machine, so without a tunnel the only options are port
publishing or a VPN — both needing cooperation from whoever owns the host.

  pnpm dev --tunnel            # tunnels the dashboard port (PORT, default 4040)
  pnpm dev --tunnel=5173       # tunnels a Vite dev server instead
  pnpm dev --tunnel dashboard  # tunnel the default port AND run the dashboard
  FUSION_DEV_TUNNEL=1 pnpm dev

Cloudflare QUICK tunnels are usable here precisely because a dev server is HTTP:
no account, no domain, no card. The TCP endpoints that SSH would have needed
require a card (ngrok) or a domain plus Zero Trust (Cloudflare) — that asymmetry
is why this exists for HTTP only, and it is recorded in the module header so the
next person does not retry the SSH variant.

Design decisions:
- Tunnel failure is NON-FATAL. A missing cloudflared or a tunnel that never
  publishes a URL logs and is skipped; losing a preview URL must never cost the
  operator their dev loop.
- Watch-mode restarts reuse the existing tunnel. A fresh quick tunnel hands out a
  different hostname each time, which would invalidate an already-shared link.
- `--tunnel` consumes a following token only when it is numeric, so
  `--tunnel dashboard` forwards `dashboard` to the dev command rather than
  tunnelling port NaN. That is the bug this flag shape invites, so it is tested.

Verified end to end in a container: a dev server bound to 127.0.0.1 inside it was
fetched from the public internet through the tunnel (200, correct body). Also
confirmed that tunnelling the DASHBOARD port does not weaken auth — unauthenticated
requests through the tunnel return 401 for /api/tasks, /api/settings and
/api/artifacts, with only /api/health open by design.

Adding two fields to parseDevWrapperArgs' return broke two existing strict toEqual
assertions; those were updated rather than loosened to toMatchObject. 27 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 17:18:56 -07:00
gsxdsm
86950400c9 chore(release): v0.77.0-beta.2
Version bump via changesets.
2026-08-18 00:22:21 -07:00
Timoteo
725b0a3330 feat: expose Fusion custom tools to ACP agents via loopback MCP bridge (#3476)
## Summary

- ACP runtimes can expose Fusion custom tools (`fn_*`) to external
agents such as Hermes ACP and Prime.
- When the engine passes `customTools`, `AcpRuntimeAdapter` starts a
per-session loopback tool bridge and registers it as a stdio MCP server
in `session/new.mcpServers`.
- The bridge uses a per-session bearer token, binds only to loopback,
preserves the MCP request ID as `toolCallId`, propagates tool `isError`
results, and exposes only runnable non-built-in tools.
- The MCP shim supports `initialize`, `ping`, `tools/list`, and
`tools/call`, reporting transport, authentication, malformed-request,
and unknown-tool failures correctly.
- Bridge startup failures degrade gracefully: the ACP session remains
usable without custom tools and exposes a fixed `fusionToolBridgeError`
reason code for engine auditing.
- Startup, request, and teardown paths clean temporary schemas and
listeners; disposal aborts cooperative tools, bounds non-cooperative
drains, prevents post-dispose execution, and preserves the existing
synchronous session contract through an awaitable `disposePromise`.
- The packaged CLI stages `mcp-schema-server.cjs` beside the ACP runtime
distribution.

## Verification

Validated at source commit `2fa6fd2e26923ac6241d1b9379b3819f1832c079`:

- `pnpm --filter @fusion-plugin-examples/acp-runtime test` — 21 files /
251 tests passed
- `pnpm --filter @fusion-plugin-examples/acp-runtime typecheck` — passed
- Plugin build with `.cjs` asset copy — passed
- `pnpm check:changesets` — passed
- `git diff --check` — passed
- MCP shim smoke test — passed
- Greptile Review — passed
- CodeRabbit — passed
- Devin review — 0 bugs, 6 analyses, `errored_tasks=[]`, quality `4/10`

## Scope

ACP runtime plugin only. The Hermes CLI runtime remains untouched;
Hermes ACP is enabled by selecting the generic ACP runtime with
`acpBinaryPath: hermes` and `acpArgs: ["acp"]`.

---------

Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-08-18 00:11:06 -07:00
gsxdsm
7380be699c chore(release): v0.77.0-beta.1
Version bump via changesets.
2026-08-16 08:39:57 -07:00
gsxdsm
dd1e0f22e1 chore(release): v0.77.0-beta.0
Version bump via changesets.
2026-08-16 00:32:50 -07:00
Phil Larson
aedcb681b9 test(cli): refresh task command store fixtures (#3459)
## Summary
- keep CLI task command store mocks aligned with required settings and
retry-budget capabilities
- preserve resolved-store identity while filling production-shaped test
capabilities
- update task-create assertions for synchronous post-create tracking
ownership

## Test plan
- `corepack pnpm --filter @runfusion/fusion exec vitest run
src/commands/__tests__/task.test.ts --silent=passed-only --reporter=dot`
- `corepack pnpm --filter @runfusion/fusion typecheck`
- `corepack pnpm lint`

## CI note
- Build, Gate, Typecheck, Desktop packaging, CodeRabbit, and Greptile
pass on head `6632fd7e4`.
- Lint reaches the lifecycle-column ratchet, then hits current-main
mailbox census drift already fixed by green PR #3440.

Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-08-15 21:43:53 -07:00
gsxdsm
0ec3c76faf fix(FN-9093): eagerly install bundled Cursor runtime plugin at host boot
The Cursor provider card's Enable action only flips useCursorCli in
settings and never registers fusion-plugin-cursor-runtime, so
getRuntimeById("cursor") missed and every cursor-cli selection hit the
runtime-routed fail-fast error even with an authenticated cursor-agent.
Mirror the FN-7761 Grok eager bootstrap in serve, dashboard, and daemon,
guarded by the same source-scan regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 21:07:02 -07:00
Phil Larson
81b1860f95 fix(ci): correct future FNXC stamps (#3440)
## Summary
- replaces newly added future-dated FNXC metadata with the actual UTC
change time
- tightens the FNXC future-date baseline to zero known exceptions

## Test plan
- `pnpm check:fnxc-future-dates`
- `pnpm check:lifecycle-columns`
- `pnpm check:changesets`
- `pnpm --filter @runfusion/fusion exec vitest run
src/__tests__/staged-plugin-core-imports.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/engine typecheck`
- `pnpm lint`
2026-08-15 17:16:05 -07:00
gsxdsm
c0e568bf78 FN-9100: fix staged Cursor core imports in CLI builds
Ensure staged plugin core runtime imports resolve reliably in packaged CLI builds.

- Export Cursor runtime core helpers from the CLI runtime shim.
- Guard staged plugin imports against undeclared or unavailable core exports.
- Add Cursor bundle coverage and document the focused packaging test.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-9100-staged-plugin-core-shim.md      |   7 +
 docs/testing.md                                    |   1 +
 .../__tests__/plugin-sdk-core-runtime-shim.test.ts |  40 +++-
 .../__tests__/staged-plugin-core-imports.test.ts   | 221 +++++++++++++++++++++
 packages/cli/src/plugin-sdk-core-runtime-shim.mjs  |  10 +-
 5 files changed, 272 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-9100

Fusion-Task-Lineage: 4c25ef74-065d-4e5a-86f2-e6f9a22500b3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-15 12:04:30 -07:00
gsxdsm
c7779e44ac FN-9055: guard archive disposal of live workspace worktrees
Prevent archive cleanup from removing worktrees that still belong to live tasks.

- Add shared archive liveness evaluation and transactional refusal guards.
- Require CLI and extension archive operations to refuse live tasks unless a human uses --force.
- Protect baseline archive worktree disposal and cover CLI, core, and engine paths with tests.

Files changed:
 .changeset/fn-9055-archive-live-worktree-guard.md  |  7 ++
 docs/cli-reference.md                              |  4 +-
 docs/task-management.md                            |  4 +-
 .../extension-task-archive-live-guard.test.ts      | 82 +++++++++++++++++++
 packages/cli/src/bin.ts                            |  6 +-
 packages/cli/src/commands/__tests__/task.test.ts   | 66 ++++++++++++++-
 packages/cli/src/commands/task.ts                  | 49 +++++++++---
 packages/cli/src/extension.ts                      | 25 ++++--
 .../src/__tests__/archive-live-task-guard.test.ts  | 70 ++++++++++++++++
 .../postgres/archive-live-task-fence.pg.test.ts    | 69 ++++++++++++++++
 .../src/__tests__/task-archive-liveness.test.ts    | 19 +++++
 packages/core/src/index.ts                         | 10 +++
 packages/core/src/store.ts                         |  4 +-
 .../core/src/task-store/archive-lifecycle-2.ts     | 27 +++++--
 packages/core/src/task-store/archive-lifecycle.ts  | 20 ++---
 .../src/task-store/async/async-archive-lineage.ts  | 17 +++-
 packages/core/src/tasks/task-archive-liveness.ts   | 56 +++++++++++++
 ...chive-baseline-disposer-live-task-guard.test.ts | 93 ++++++++++++++++++++++
 .../healing/archive-worktree-disposer-install.ts   | 15 +++-
 19 files changed, 592 insertions(+), 51 deletions(-)

Fusion-Task-Id: FN-9055

Fusion-Task-Lineage: 08644626-cc61-4854-abb9-5b415ddc9491

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-15 00:35:12 -07:00
gsxdsm
9ba6a67695 fix: create CLI GitHub tracking issues synchronously before process exit
The task-created hook (GitHub tracking issue creation) was deferred behind
the fire-and-forget auto-title-summarize chain whenever autoSummarizeTitles
is on and the task has a long description and no title — i.e. for every
'fn task create'. The short-lived CLI process closed the store and exited
before the deferred chain ran, so tasks ended up with
githubTracking.enabled=true but no issue (observed on FN-9045..FN-9061).

fn task create now suppresses the deferred hook and calls
createTrackingIssueForTask directly after create, printing the linked
issue; exports that helper from @fusion/dashboard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 21:55:49 -07:00
gsxdsm
41d415fe70 FN-9051: report blocked workspace finalization
Prevent workspace merge entry points from treating an unfinalized task as a successful merge.

- Add a typed blocked-finalization result and engine handling that avoids retries, failure parking, and branch promotion.
- Return blocked outcomes through dashboard and CLI merge surfaces.
- Cover blocked finalization behavior and publish a patch changeset.

Files changed:
 .changeset/fn-9051-workspace-blocked-finalize.md   |   7 ++
 packages/cli/src/commands/__tests__/task.test.ts   |  38 ++++++++
 packages/cli/src/commands/dashboard.ts             |  22 +++--
 packages/cli/src/commands/task.ts                  |  19 ++--
 .../engine/src/__tests__/project-engine.test.ts    | 105 ++++++++++++++++++++-
 .../engine/src/__tests__/workspace-merger.test.ts  |   1 +
 packages/engine/src/index.ts                       |   1 +
 packages/engine/src/merge/merger-ai.ts             |  28 +++++-
 packages/engine/src/project-engine.ts              |  42 ++++++++-
 9 files changed, 240 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-9051

Fusion-Task-Lineage: 89d5fcbb-1a00-4429-87ea-fc3e34db2706

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-14 21:51:45 -07:00
gsxdsm
52a28d39ff feat: add per-task GitHub tracking overrides to task create (fn_task_create + CLI)
fn_task_create gains github_tracking/github_repo params and fn task create
gains --github/--no-github/--github-repo flags, resolved through
resolveTaskGithubTracking (task > project > global). CLI create now also
honors the project/global tracking-enabled default it previously ignored;
explicit disables persist enabled:false so later default flips cannot
re-enable a task.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 21:12:15 -07:00
gsxdsm
66b1c046c5 test: assert Memory Keeper in fresh-project built-in agent listings
Fusion-Task-Id: automation

FN-8932 seeds the durable Memory Keeper alongside the four routed workflow principals, so fn_list_agents and fn_agent_org_chart now enumerate five built-in agents on a fresh project. Update the two extension.test.ts assertions from count 4 to 5 and assert Memory Keeper is present.
2026-08-14 17:04:07 -07:00
gsxdsm
9d31396f7a FN-9031: strengthen computer snapshot action fencing
Serialize computer snapshots and actions through a durable app-scoped fence.

- Hold the fence from snapshot acquisition or element resolution through OS action consumption.
- Report snapshot consumption only when the expected latest pointer was invalidated.
- Heartbeat and token-check directory locks for safe crash recovery and add command-fence coverage.

Files changed:
 .../commands/__tests__/computer-commands.test.ts   | 26 +++++++++-
 .../__tests__/computer-snapshot-index.test.ts      |  2 +-
 packages/cli/src/commands/computer.ts              | 37 ++++++++-----
 .../cli/src/commands/computer/snapshot-store.ts    | 60 ++++++++++++++++------
 4 files changed, 93 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-9031

Fusion-Task-Lineage: f196b7ca-ce3f-4a50-98d2-d6ac8bf184ac

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-13 17:44:02 -07:00
gsxdsm
2dcead4c8f FN-9035: prevent static computer commands in shipped skills
Keep bundled computer-use guidance limited to runtime discovery so command syntax cannot drift.

- Scan all shipped skill markdown files, including plugin skills
- Reject static `fn computer` commands outside the computer-use discovery stub
- Assert the discovery stub exposes only its supported JSON probes

Files changed:
 packages/cli/src/commands/__tests__/computer-use-skill.test.ts | 50 ++++++++++++++++++++--
 1 file changed, 47 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-9035

Fusion-Task-Lineage: 5049fd29-1b3b-4968-b09e-1bb7be9d52ff

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-13 17:01:39 -07:00
gsxdsm
1788dc0506 FN-9033: harden macOS computer-use permission handling
Treat missing osascript as an explicit automation denial while preserving replay failures.

- Track missing osascript separately from indeterminate permission probes.
- Block all macOS automation paths before execution when osascript is unavailable.
- Preserve replay permission and timeout errors, mapping only stale locators to element errors.
- Add coverage for replay failures and missing-binary enforcement.

Files changed:
 .../__tests__/computer-adapter-registry.test.ts    | 87 +++++++++++++++++++++-
 .../commands/__tests__/computer-commands.test.ts   | 29 +++++++-
 .../cli/src/commands/computer/adapter-macos.ts     | 52 +++++++------
 3 files changed, 142 insertions(+), 26 deletions(-)

Fusion-Task-Id: FN-9033
Fusion-Task-Lineage: 48e77cc5-cd71-49f1-a163-13d68a81d1d4
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-13 16:55:23 -07:00
gsxdsm
7673f2e839 FN-9031: enforce snapshot consumption after computer actions
Computer-use actions now consume the captured app snapshot and require a fresh state capture before another element-targeted action.

- Add app-scoped, serialized snapshot-pointer consumption with stale-state diagnostics.
- Mark successful action results as consuming their snapshot and cover action/replay behavior.
- Document the enforced snapshot → act → snapshot loop and add a CLI changeset.

Files changed:
 .../fn-9031-computer-use-snapshot-consumption.md   |  7 ++
 docs/cli-reference.md                              |  2 +-
 docs/computer-use.md                               | 11 +--
 .../commands/__tests__/computer-commands.test.ts   | 88 ++++++++++++++++++++--
 .../commands/__tests__/computer-contract.test.ts   |  7 +-
 .../__tests__/computer-snapshot-index.test.ts      | 52 ++++++++++++-
 .../commands/__tests__/computer-use-guide.test.ts  |  4 +
 packages/cli/src/commands/computer.ts              | 37 ++++++---
 .../cli/src/commands/computer/adapter-macos.ts     |  4 +-
 packages/cli/src/commands/computer/contract.ts     | 17 ++++-
 packages/cli/src/commands/computer/guide.ts        |  4 +-
 .../cli/src/commands/computer/snapshot-store.ts    | 79 +++++++++++++++++--
 12 files changed, 272 insertions(+), 40 deletions(-)

Fusion-Task-Id: FN-9031

Fusion-Task-Lineage: f196b7ca-ce3f-4a50-98d2-d6ac8bf184ac

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-13 16:31:44 -07:00
gsxdsm
d3e51f566e FN-9030: resolve computer state at project root
Resolve computer-use state once per invocation at the containing Fusion project root.

- Add a state-root resolver shared by computer command adapters and snapshot storage.
- Preserve capture and replay snapshots across working directories while isolating projects.
- Cover root resolution and cross-directory state behavior, and document the storage contract.
- Add a patch changeset for the CLI fix.

Files changed:
 .../fn-9030-computer-use-project-local-state.md    |  7 ++
 docs/computer-use.md                               |  2 +-
 .../commands/__tests__/computer-commands.test.ts   | 76 ++++++++++++++++++++++
 .../__tests__/computer-snapshot-index.test.ts      | 14 ++++
 .../commands/__tests__/computer-state-root.test.ts | 49 ++++++++++++++
 packages/cli/src/commands/computer.ts              |  9 ++-
 packages/cli/src/commands/computer/state-root.ts   | 18 +++++
 7 files changed, 171 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-9030

Fusion-Task-Lineage: a0cb48ee-fd7f-4966-9930-cde273027eca

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-13 16:08:52 -07:00
gsxdsm
8b00bab0b0 chore(release): v0.76.0
Version bump via changesets.
2026-08-13 01:41:54 -07:00
gsxdsm
a1ea7fe562 chore(release): v0.76.0-beta.3
Version bump via changesets.
2026-08-13 01:34:18 -07:00
gsxdsm
c7451ec6b2 chore(release): v0.76.0-beta.2
Version bump via changesets.
2026-08-12 17:37:09 -07:00
gsxdsm
8699ff41e2 FN-9016: add manager evaluation tools
Enable managers to review report evaluations and record coaching follow-ups.

- Add manager-scoped evaluation read and follow-up extension tools.
- Enforce management-subtree access through action gating and regression tests.
- Document the tool surface and add a minor release changeset.

Files changed:
 .changeset/fn-9016-manager-eval-tools.md           |   7 +
 docs/agent-tool-surface-full-loop.md               |   4 +-
 docs/agents.md                                     |   8 +-
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |  22 ++
 .../skill/fusion/references/fusion-capabilities.md |   2 +
 .../__tests__/extension-manager-eval-tools.test.ts | 159 +++++++++++++++
 packages/cli/src/extension.ts                      | 227 +++++++++++++++++++++
 .../engine/src/__tests__/agent-action-gate.test.ts |   1 +
 .../src/__tests__/gating-classifications.test.ts   |   1 +
 .../src/__tests__/permanent-agent-gating.test.ts   |   1 +
 .../engine/src/execution/gating-classifications.ts |   8 +
 12 files changed, 438 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-9016

Fusion-Task-Lineage: 1ad7c344-0f3c-4565-aabc-acb51481431d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 15:51:22 -07:00
gsxdsm
c4467b0a5b FN-9007: upgrade Pi runtime to 0.84.1
Upgrade the bundled Pi runtime closure to version 0.84.1.

- Pin direct and transitive Pi runtime packages to a coherent 0.84.1 closure.
- Adapt runtime interfaces and test assertions for Pi 0.84.1 behavior.
- Guard the added Pi client, protocol, and telemetry packages in desktop packaging checks.

Files changed:
 .changeset/fn-9007-pi-0-84-1.md                    |   7 +
 packages/cli/package.json                          |   4 +-
 packages/cli/src/__tests__/package-config.test.ts  |   6 +-
 packages/cli/vitest.config.ts                      |   2 +-
 packages/core/package.json                         |   2 +-
 packages/dashboard/package.json                    |   4 +-
 packages/dashboard/src/routes.ts                   |   6 +-
 packages/engine/package.json                       |   4 +-
 packages/engine/src/__tests__/pi.test.ts           |  45 ++--
 .../src/__tests__/provider-registration.test.ts    |   4 +-
 packages/engine/src/auth/auth-storage.ts           |  20 +-
 packages/engine/src/pi.ts                          |   5 +
 packages/pi-claude-cli/package.json                |   8 +-
 pnpm-lock.yaml                                     | 283 ++++++++++++---------
 pnpm-workspace.yaml                                |  14 +-
 .../__tests__/check-pi-versions-pinned.test.mjs    |  27 +-
 scripts/check-pi-versions-pinned.mjs               |   8 +
 17 files changed, 279 insertions(+), 170 deletions(-)

Fusion-Task-Id: FN-9007

Fusion-Task-Lineage: 89045e86-d4c8-4fc3-bbf6-5ba38fc786e7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 14:07:30 -07:00
gsxdsm
36691e54d2 chore(release): v0.76.0-beta.1
Version bump via changesets.
2026-08-12 00:17:27 -07:00
Phil Larson
6cc15fd73d fix(ci): restore clean-main CLI and lifecycle gates (#3420)
## Summary
- Complete the isolated `@fusion/core` mock used by the
experiment-finalize extension suite
- Classify three intentional physical/synthetic lifecycle literals
introduced on current main
- Re-record the strict lifecycle census baseline with zero unexamined
guards

## Test plan
- `pnpm --filter @runfusion/fusion exec vitest run
src/__tests__/extension-experiment-finalize.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/core exec vitest run
src/__tests__/task-intake-owner-resolver.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/engine exec vitest run --project engine-default
src/__tests__/mission-feature-sync-lanes.test.ts --silent=passed-only
--reporter=dot`
- `pnpm check:lifecycle-columns`
- `node scripts/check-mock-completeness.mjs`


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

- **Bug Fixes**
- Improved mission reconciliation previews for task links, specification
alignment, and lifecycle updates.
- Prevented stale or superseded validation runs from overwriting current
feature status or ownership.
- Improved blocked-feature diagnostics and archived-task handling across
workflow configurations.

- **Documentation**
- Clarified validation, assignment checks, and mission synchronization
behavior.

- **Tests**
- Expanded coverage for reconciliation previews and validator ownership
scenarios.

- **Chores**
  - Updated lifecycle baseline data for known archived-task cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 10:57:36 -10:00
gsxdsm
25e292d0e6 FN-8954: preserve CLI liveness during startup
Ensure CLI startup operations settle before process exit on supported Node runtimes.

- Keep awaited QMD probes and ephemeral port selection ref'd until completion.
- Add CLI process regressions for init persistence and exit code 13.
- Declare the Node 22.4 runtime floor and extend boot smoke coverage.

Files changed:
 .changeset/fn-8954-cli-exit-13.md                  |  7 ++
 docs/testing.md                                    |  4 +-
 package.json                                       |  3 +
 packages/cli/agent-browser.mjs                     |  6 ++
 packages/cli/bin.mjs                               |  7 ++
 packages/cli/package.json                          |  3 +
 packages/cli/src/__tests__/ci-workflow.test.ts     |  9 +++
 packages/cli/src/__tests__/cli-exit-code.test.ts   | 82 ++++++++++++++++++++++
 packages/cli/src/__tests__/package-config.test.ts  | 12 ++++
 packages/cli/src/bin.ts                            |  6 ++
 .../__tests__/postgres/embedded-free-port.test.ts  | 37 ++++++++++
 packages/core/src/memory/memory-backend.ts         | 17 +++--
 packages/core/src/postgres/embedded-lifecycle.ts   | 16 +++--
 scripts/boot-smoke.mjs                             | 62 +++++++++++-----
 14 files changed, 244 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-8954

Fusion-Task-Lineage: 05303d07-2662-48d5-a442-6d43fa0a4493

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 04:20:33 -07:00
gsxdsm
62979d8796 FN-8985: centralize CLI version resolution
Centralize CLI self-version discovery without widening the early boot import graph.

- Reuse one bounded manifest resolver for the CLI binary, updater, and plugin scaffold.
- Add regression coverage for manifest lookup bounds, malformed manifests, and scaffold version fallback.
- Preserve update command test isolation after the core i18n module relocation.

Files changed:
 packages/cli/src/__tests__/cli-version.test.ts     | 136 +++++++++++++++++++++
 .../plugin-scaffold-caret-fallback.test.ts         |  91 ++++++++++++++
 packages/cli/src/bin.ts                            |  45 +------
 packages/cli/src/cli-version.ts                    |  51 ++++++++
 packages/cli/src/commands/__tests__/update.test.ts |   2 +-
 packages/cli/src/commands/plugin-scaffold.ts       |  40 +-----
 packages/cli/src/commands/update.ts                |  37 +-----
 7 files changed, 292 insertions(+), 110 deletions(-)

Fusion-Task-Id: FN-8985

Fusion-Task-Lineage: dd95b651-3578-4c5f-957a-5af7b85129d7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 01:51:22 -07:00
gsxdsm
8f6190910d FN-8971: add mission blocked-status clearing tool
Add an operator-only CLI tool for repairing stale mission blocked badges.

- Register and document fn_mission_clear_blocked with PostgreSQL and status-error handling.
- Withhold the repair action from agent principals and deny it in readonly workflow steps.
- Classify the tool consistently across engine permission gates and add coverage.
- Add a minor CLI changeset for the new operator capability.

Files changed:
 .changeset/fn-8971-mission-clear-blocked-tool.md   |  7 +++
 docs/missions.md                                   |  7 ++-
 packages/cli/skill/fusion/SKILL.md                 |  2 +-
 .../cli/skill/fusion/references/extension-tools.md |  9 ++++
 .../skill/fusion/references/fusion-capabilities.md |  1 +
 .../__tests__/extension-permission-gates.test.ts   | 26 ++++++++++
 packages/cli/src/__tests__/extension.test.ts       | 56 +++++++++++++++++++++-
 packages/cli/src/extension.ts                      | 54 +++++++++++++++++++++
 .../src/__tests__/agent-mission-tools.test.ts      |  5 +-
 .../src/__tests__/gating-classifications.test.ts   |  8 ++++
 .../workflow-step-readonly-allowlist.test.ts       |  5 +-
 .../engine/src/execution/gating-classifications.ts |  7 +++
 12 files changed, 182 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8971

Fusion-Task-Lineage: 650c13b3-c6c4-4dc5-a0b5-9c71d3b94fc5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 01:45:08 -07:00
gsxdsm
eacd6687bc FN-8961: add computer-use skill and version-matched guide
Ship the computer-use skill across bundled clients and surface its matching guide through the CLI.

- add the computer-use skill, computer command descriptor, and `fn skills get computer-use` guide
- reconcile all shipped Claude skills at project and startup entry points
- cover both skills' reconciliation outcomes and every required call site

Files changed:
 .changeset/fn-8961-computer-use-skill.md           |   7 +
 docs/cli-reference.md                              |   6 +-
 docs/computer-use.md                               |   8 +
 packages/cli/skill/computer-use/SKILL.md           |  31 +++
 packages/cli/src/__tests__/package-config.test.ts  |  20 ++
 packages/cli/src/bin.ts                            |  14 +-
 .../__tests__/claude-skills-callsites.test.ts      |  64 ++++++
 .../src/commands/__tests__/claude-skills.test.ts   | 221 ++++++++-------------
 .../__tests__/computer-surface-descriptor.test.ts  | 108 ++++++++++
 .../commands/__tests__/computer-use-guide.test.ts  |  36 ++++
 .../commands/__tests__/computer-use-skill.test.ts  |  20 ++
 packages/cli/src/commands/__tests__/daemon.test.ts |  36 +++-
 .../__tests__/dashboard-claude-skills.test.ts      |  19 ++
 packages/cli/src/commands/__tests__/init.test.ts   |  48 ++++-
 .../cli/src/commands/__tests__/project.test.ts     |  38 ++++
 packages/cli/src/commands/__tests__/serve.test.ts  |  36 +++-
 .../commands/__tests__/skill-installation.test.ts  |  12 ++
 .../cli/src/commands/__tests__/skills-get.test.ts  |  67 ++++++
 packages/cli/src/commands/claude-skills-runner.ts  |  55 ++---
 packages/cli/src/commands/claude-skills.ts         |  47 +++--
 packages/cli/src/commands/computer.ts              |   6 +-
 packages/cli/src/commands/computer/contract.ts     |  52 +++++
 packages/cli/src/commands/computer/guide.ts        |  62 ++++++
 packages/cli/src/commands/init.ts                  |   4 +-
 packages/cli/src/commands/skill-installation.ts    |  45 +++--
 packages/cli/src/commands/skills.ts                |  24 +++
 26 files changed, 853 insertions(+), 233 deletions(-)

Fusion-Task-Id: FN-8961
Fusion-Task-Lineage: b6baaebb-bf72-4991-8239-eb9bcf9cbcf1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 01:16:59 -07:00
gsxdsm
79502c67a0 FN-8978: fix CLI TypeScript external packaging
Keep TypeScript available as a runtime external in the published CLI package.

- Remove the duplicate TypeScript devDependency declaration.
- Assert tsup externals are published runtime dependencies.
- Document the runtime external packaging invariant.

Files changed:
 .changeset/fn-8978-typescript-dedup.md            |  7 +++++
 packages/cli/package.json                         |  1 -
 packages/cli/src/__tests__/package-config.test.ts | 31 +++++++++++++++++++++++
 packages/cli/tsup.config.ts                       |  6 +++++
 4 files changed, 44 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8978

Fusion-Task-Lineage: b9630c4a-73a9-414f-9a78-25c689359509

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 23:04:32 -07:00
gsxdsm
79206c3f31 FN-8977: unify CLI Vitest mock resolution
Route CLI test mocks through dashboard and engine runtime imports.

- Anchor pi-coding-agent resolution to the CLI package instance
- Preserve real session exports while overriding runtime dependencies
- Add a regression test and document cross-package mock scoping

Files changed:
 docs/testing.md                                    |  6 ++
 .../__tests__/extension-permission-gates.test.ts   | 10 ++-
 .../vitest-cross-package-mock-scope.test.ts        | 75 ++++++++++++++++++++++
 packages/cli/vitest.config.ts                      | 12 ++++
 4 files changed, 101 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-8977
Fusion-Task-Lineage: a652cdf4-463e-4603-8d71-87db91d0b846
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 22:12:15 -07:00
gsxdsm
1da61f35f7 FN-8960: add macOS computer automation CLI
Add a snapshot-backed macOS computer-use surface to the Fusion CLI.

- Register fn computer commands for app state, permission, capability, and UI actions.
- Implement macOS JXA automation with locator replay and persisted snapshot safety checks.
- Document the CLI surface, add contract coverage, and include a release changeset.

Files changed:
 .changeset/fn-8960-computer-use-cli.md             |   7 +
 docs/README.md                                     |   1 +
 docs/cli-reference.md                              |  21 ++
 docs/computer-use.md                               | 156 +++++++++++++
 packages/cli/src/bin.ts                            |  11 +
 .../__tests__/computer-adapter-registry.test.ts    | 154 ++++++++++++
 .../commands/__tests__/computer-commands.test.ts   |  71 ++++++
 .../commands/__tests__/computer-contract.test.ts   |  34 +++
 .../__tests__/computer-snapshot-index.test.ts      |  87 +++++++
 packages/cli/src/commands/computer.ts              | 182 +++++++++++++++
 .../cli/src/commands/computer/adapter-macos.ts     | 211 +++++++++++++++++
 .../cli/src/commands/computer/adapter-registry.ts  |  42 ++++
 .../src/commands/computer/adapter-unsupported.ts   |  44 ++++
 packages/cli/src/commands/computer/adapter.ts      |  97 ++++++++
 packages/cli/src/commands/computer/contract.ts     |  83 +++++++
 packages/cli/src/commands/computer/exec-seam.ts    |  61 +++++
 .../cli/src/commands/computer/scripts/macos-jxa.ts |  37 +++
 .../cli/src/commands/computer/snapshot-store.ts    | 257 +++++++++++++++++++++
 18 files changed, 1556 insertions(+)

Fusion-Task-Id: FN-8960

Fusion-Task-Lineage: 5870bf69-b751-4879-bf9d-5f5396cc0f55

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 21:56:18 -07:00
gsxdsm
cef07527f6 FN-8948: reconcile mission state from task ground truth
Centralize mission and feature state repair around deterministic task lifecycle evidence.

- Add a reusable mission reconciliation authority with task-move, API, tool, and maintenance callers.
- Repair unambiguous title links while preserving terminal, validation, and audit safeguards.
- Route scheduler moves through the authority and reject duplicate feature-title ownership.
- Expose reconcile controls and document the operator workflow.

Files changed:
 .changeset/fn-8948-mission-auto-reconcile.md       |   7 +
 AGENTS.md                                          |   1 +
 docs/missions.md                                   |   8 +-
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |   9 +
 .../skill/fusion/references/fusion-capabilities.md |   1 +
 .../extension-experiment-finalize.test.ts          |   2 +
 .../__tests__/extension-gitlab-tracking.test.ts    |   2 +
 .../cli/src/__tests__/extension-web-fetch.test.ts  |   2 +
 packages/cli/src/extension.ts                      |  14 +
 packages/dashboard/src/mission-routes.ts           |  24 +-
 .../src/__tests__/agent-mission-tools.test.ts      |   2 +-
 .../engine/src/__tests__/mission-autopilot.test.ts |   8 +-
 .../src/__tests__/mission-state-reconcile.test.ts  |  67 +++++
 packages/engine/src/agent-tools.ts                 |   6 +
 .../engine/src/execution/gating-classifications.ts |   1 +
 packages/engine/src/index.ts                       |   6 +
 packages/engine/src/missions/index.ts              |   8 +-
 packages/engine/src/missions/mission-autopilot.ts  | 106 +------
 .../engine/src/missions/mission-feature-sync.ts    |   1 +
 .../engine/src/missions/mission-state-reconcile.ts | 169 +++++++++++
 packages/engine/src/runtimes/in-process-runtime.ts |   4 +-
 packages/engine/src/scheduler.ts                   | 331 +++++----------------
 packages/engine/src/util/run-audit.ts              |   2 +
 24 files changed, 426 insertions(+), 357 deletions(-)

Fusion-Task-Id: FN-8948
Fusion-Task-Lineage: 0fbccef3-eeac-46d2-b3d8-aca679b3657e
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 20:32:26 -07:00
gsxdsm
b82f1a41f3 FN-8947: add repairable mission validation controls
Add repairable mission-validation badges with clear and re-run flows.

- Persist repair metadata and audit events for mission validation state changes.
- Expose validation repair through dashboard routes, UI controls, engine tools, and CLI capabilities.
- Add database, API, UI, engine, and extension coverage plus operator documentation.

Files changed: .changeset/fn-8947-mission-validation-repair.md    |   7 +
 docs/missions.md                                   |  15 +-
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |  10 +
 .../skill/fusion/references/fusion-capabilities.md |   1 +
 .../extension-experiment-finalize.test.ts          |   2 +
 .../__tests__/extension-gitlab-tracking.test.ts    |   2 +
 .../cli/src/__tests__/extension-web-fetch.test.ts  |   2 +
 packages/cli/src/__tests__/extension.test.ts       |  24 +++
 packages/cli/src/extension.ts                      |  40 ++++
 .../mission-status-event-metadata.test.ts          |  23 +++
 .../postgres/mission-validation-repair.pg.test.ts  | 187 ++++++++++++++++++
 .../core/src/async-stores/async-mission-store.ts   | 216 ++++++++++++++++++---
 packages/core/src/index.gate.ts                    |   5 +
 packages/core/src/index.ts                         |   5 +-
 packages/core/src/missions/mission-types.ts        |  49 +++++
 packages/core/src/types.ts                         |   7 +
 packages/dashboard/app/api/legacy.ts               |   1 +
 packages/dashboard/app/api/missions/missions.ts    |  13 ++
 .../dashboard/app/components/MissionManager.css    |  26 ++-
 .../dashboard/app/components/MissionManager.tsx    | 207 +++++++++++++++++---
 .../__tests__/MissionManager.mobile-css.test.ts    |   8 +
 .../MissionManager.validation-repair.test.tsx      |  83 ++++++++
 .../__tests__/mission-task-prefix-routes.test.ts   | 162 +++++++++++++++-
 packages/dashboard/src/mission-routes.ts           | 104 +++++++++-
 .../src/__tests__/agent-mission-tools.test.ts      | 119 +++++++++++-
 .../__tests__/mission-feature-sync-lanes.test.ts   |  59 +++++-
 .../workflow-step-readonly-allowlist.test.ts       |   1 +
 packages/engine/src/agent-tools.ts                 |  36 ++++
 .../engine/src/execution/gating-classifications.ts |   1 +
 packages/engine/src/index.ts                       |   1 +
 .../engine/src/missions/mission-feature-sync.ts    |  79 ++++++++
 32 files changed, 1430 insertions(+), 67 deletions(-)

Fusion-Task-Id: FN-8947

Fusion-Task-Lineage: b93e5ab6-021c-4d32-bffb-f89f4c3894bc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 19:36:31 -07:00
gsxdsm
a839c61929 FN-8926: expose graph and recall through MCP
Expose Fusion knowledge graph and durable recall through a built-in MCP transport.

- Add the reserved fusion-memory server with graph and recall MCP tools.
- Resolve built-in availability and enable/disable tombstones across configuration and UI.
- Add CLI transport, documentation, release metadata, and lane coverage tests.

Files changed:
 .changeset/fn-8926-memory-mcp-server.md            |   7 +
 docs/cli-reference.md                              |   4 +
 docs/mcp.md                                        |  10 ++
 packages/cli/src/bin.ts                            |   6 +
 .../__tests__/mcp-memory-server-spawn.test.ts      |  79 ++++++++++
 .../commands/__tests__/mcp-memory-server.test.ts   |  83 +++++++++++
 packages/cli/src/commands/__tests__/mcp.test.ts    |  27 +++-
 packages/cli/src/commands/mcp-memory-server.ts     | 104 +++++++++++++
 packages/cli/src/commands/mcp.ts                   |  64 ++++++--
 packages/core/package.json                         |  10 ++
 .../core/src/__tests__/mcp-builtin-servers.test.ts |  17 +++
 packages/core/src/__tests__/mcp-config.test.ts     |  12 ++
 packages/core/src/config/mcp-builtin-descriptor.ts |  16 ++
 packages/core/src/config/mcp-builtin-servers.ts    |  18 +++
 packages/core/src/config/mcp-config.ts             |  40 +++--
 packages/core/src/config/mcp-discovery.ts          |   3 +-
 packages/core/src/index.ts                         |   6 +
 packages/core/src/memory/index.ts                  |   1 +
 .../mcp/__tests__/memory-mcp-handler.test.ts       |  36 +++++
 .../mcp/__tests__/memory-mcp-serialization.test.ts |  23 +++
 packages/core/src/memory/mcp/index.ts              |   4 +
 .../core/src/memory/mcp/memory-mcp-backends.ts     |  39 +++++
 packages/core/src/memory/mcp/memory-mcp-handler.ts |  54 +++++++
 .../src/memory/mcp/memory-mcp-serialization.ts     |  48 ++++++
 packages/core/src/memory/mcp/memory-mcp-tools.ts   |  64 ++++++++
 packages/core/src/types.ts                         |  10 ++
 .../settings/sections/GlobalMcpSection.tsx         |  14 +-
 .../settings/sections/McpServersCard.tsx           |  67 +++++++--
 .../settings/sections/ProjectMcpSection.tsx        |  15 +-
 .../__tests__/McpServersCard.builtin.test.tsx      |  45 ++++++
 .../dashboard/src/__tests__/chat-manager.test.ts   |  24 +++
 .../register-config-mcp-pi-settings-routes.ts      |  20 ++-
 packages/dashboard/vitest.config.ts                |   2 +
 .../__tests__/mcp-builtin-lane-coverage.test.ts    | 163 +++++++++++++++++++++
 packages/engine/src/mcp/mcp-resolution.ts          |  10 +-
 packages/engine/vitest.config.ts                   |   2 +
 36 files changed, 1097 insertions(+), 50 deletions(-)

Fusion-Task-Id: FN-8926
Fusion-Task-Lineage: b2861491-33da-4b05-b9f8-a7c1448c1c8c
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 17:50:27 -07:00
gsxdsm
3143f9536f FN-8908: auto-recover terminal task failures
Recover generic terminal task failures through a bounded, durable retry budget before escalating them to operators.

- add fenced task-store recovery claims, retries, budget resets, and audit events
- defer terminal-failure notifications until recovery is exhausted while preserving a single escalation
- expose operator retry budget reset and cover recovery lifecycle behavior

Files changed:
 .../fn-8908-terminal-failure-auto-recovery.md      |   7 +
 AGENTS.md                                          |   1 +
 docs/agents.md                                     |   2 +
 docs/architecture.md                               |   2 +
 packages/cli/src/commands/task.ts                  |   2 +
 packages/cli/src/extension.ts                      |   2 +
 ...terminal-failure-auto-recovery-store.pg.test.ts | 108 +++++++++
 .../terminal-failure-auto-recovery.test.ts         |  60 +++++
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/store.ts                         | 179 ++++++++++++++-
 .../core/src/task-store/archive-lifecycle-2.ts     |  15 ++
 packages/core/src/task-store/moves.ts              |  48 +++-
 packages/core/src/task-store/persistence.ts        |  18 +-
 packages/core/src/task-store/project-store-ops.ts  |   4 +-
 .../src/task-store/workflow-task-create-ops.ts     |   4 +-
 packages/core/src/tasks/index.ts                   |   1 +
 .../src/tasks/terminal-failure-auto-recovery.ts    | 114 ++++++++++
 packages/core/src/types/task/task-core.ts          |  24 ++
 .../src/routes/register-task-workflow-routes.ts    |   2 +
 ...-healing-terminal-failure-auto-recovery.test.ts | 199 ++++++++++++++++
 .../__tests__/notification-service.test.ts         |  86 ++++++-
 .../__tests__/task-wedge-notification.test.ts      |   2 +-
 .../src/notification/notification-service.ts       | 103 +++++++--
 .../src/notification/task-wedge-notification.ts    |  30 ++-
 packages/engine/src/self-healing.ts                | 251 ++++++++++++++++++++-
 packages/engine/src/util/run-audit.ts              |   7 +
 27 files changed, 1240 insertions(+), 33 deletions(-)

Fusion-Task-Id: FN-8908

Fusion-Task-Lineage: 99e96b16-0306-41f1-87da-8623d69735f7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 16:53:51 -07:00
gsxdsm
0fc6f3d849 FN-8946: enable attributed agent mission status updates
Enable authorized agents to update feature and mission statuses with transactional, attributed audit events.

- Add mission and feature status tools to the Fusion extension and engine allowlists.
- Record bounded actor, reason, and hierarchy metadata for status transitions across every writer.
- Guard linked feature transitions and document the agent-facing workflow.

Files changed:
 .changeset/fn-8946-mission-status-writes.md        |   7 +
 docs/missions.md                                   |   7 +-
 packages/cli/skill/fusion/SKILL.md                 |   2 +-
 .../cli/skill/fusion/references/extension-tools.md |  20 +++
 .../skill/fusion/references/fusion-capabilities.md |   2 +
 packages/cli/src/__tests__/extension.test.ts       |  46 ++++++
 packages/cli/src/extension.ts                      |  27 +++
 .../mission-status-event-metadata.test.ts          |  50 ++++++
 .../__tests__/postgres/mission-store.pg.test.ts    | 160 +++++++++++++++++-
 .../core/src/async-stores/async-mission-store.ts   | 182 +++++++++++++++------
 packages/core/src/index.ts                         |   5 +
 packages/core/src/missions/mission-store.ts        |   7 +-
 packages/core/src/missions/mission-types.ts        |  99 +++++++++--
 .../src/__tests__/chat-toolset-permissions.test.ts |  24 +++
 packages/dashboard/src/mission-routes.ts           |   3 +-
 .../src/__tests__/agent-mission-tools.test.ts      |  42 ++++-
 .../src/__tests__/heartbeat-executor.test.ts       |   4 +-
 .../workflow-step-readonly-allowlist.test.ts       |   2 +
 packages/engine/src/agent-tools.ts                 |  18 ++
 .../engine/src/execution/gating-classifications.ts |   2 +
 20 files changed, 635 insertions(+), 74 deletions(-)

Fusion-Task-Id: FN-8946

Fusion-Task-Lineage: 473cc0e0-e632-48b3-ac84-adaaeb81db4b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 07:30:42 -07:00
gsxdsm
27cb2d2621 FN-8921: add deterministic knowledge graph tooling
Add a committable, provenance-tagged knowledge graph layer with CLI generation and query support.

- Extract TypeScript, Markdown, and FNXC knowledge into deterministic graph nodes and edges.
- Persist recoverable graph artifacts outside ignored Fusion state and expose build/query CLI commands.
- Document configuration and add core and CLI coverage for graph structure, serialization, and recovery.

Files changed:
 .changeset/fn-8921-knowledge-graph.md              |   7 +
 .gitattributes                                     |   3 +
 AGENTS.md                                          |   1 +
 docs/README.md                                     |   2 +
 docs/cli-reference.md                              |   4 +
 docs/knowledge-graph.md                            |  37 +++++
 docs/settings-reference.md                         |   4 +
 docs/storage.md                                    |   2 +
 packages/cli/package.json                          |   3 +-
 .../__tests__/knowledge-graph-bundle-shape.test.ts |   4 +
 .../src/__tests__/knowledge-graph-command.test.ts  | 115 ++++++++++++++
 packages/cli/src/bin.ts                            |  19 +++
 packages/cli/src/commands/knowledge-graph.ts       |  79 ++++++++++
 packages/cli/tsup.config.ts                        |   2 +
 packages/core/package.json                         |   4 +-
 packages/core/src/config/settings-schema.ts        |   2 +
 packages/core/src/index.ts                         |   1 +
 .../__tests__/derive-modules.test.ts               |  11 ++
 .../__tests__/extract-file-composition.test.ts     |  20 +++
 .../knowledge-graph/__tests__/extract-fnxc.test.ts |  33 ++++
 .../__tests__/extract-markdown.test.ts             |  21 +++
 .../__tests__/extract-typescript.test.ts           |  30 ++++
 .../__tests__/file-discovery.test.ts               |  26 ++++
 .../graph-artifact-not-gitignored.test.ts          |  15 ++
 .../__tests__/graph-builder-equivalence.test.ts    |  76 ++++++++++
 .../__tests__/graph-builder-incremental.test.ts    |  52 +++++++
 .../__tests__/graph-identity.test.ts               |  11 ++
 .../knowledge-graph/__tests__/graph-query.test.ts  |  13 ++
 .../__tests__/graph-serialization.test.ts          |  29 ++++
 .../__tests__/graph-store-recovery.test.ts         | 106 +++++++++++++
 .../__tests__/resolve-imports.test.ts              |  10 ++
 .../core/src/knowledge-graph/derive-modules.ts     |   4 +
 packages/core/src/knowledge-graph/extract-file.ts  |   6 +
 packages/core/src/knowledge-graph/extract-fnxc.ts  | 168 +++++++++++++++++++++
 .../core/src/knowledge-graph/extract-markdown.ts   |   9 ++
 .../core/src/knowledge-graph/extract-typescript.ts | 107 +++++++++++++
 .../core/src/knowledge-graph/file-discovery.ts     |  85 +++++++++++
 packages/core/src/knowledge-graph/graph-builder.ts | 141 +++++++++++++++++
 .../core/src/knowledge-graph/graph-manifest.ts     |   4 +
 packages/core/src/knowledge-graph/graph-query.ts   | 126 ++++++++++++++++
 .../src/knowledge-graph/graph-serialization.ts     | 134 ++++++++++++++++
 packages/core/src/knowledge-graph/graph-store.ts   |  97 ++++++++++++
 packages/core/src/knowledge-graph/graph-types.ts   |  54 +++++++
 packages/core/src/knowledge-graph/index.ts         |  14 ++
 .../core/src/knowledge-graph/resolve-imports.ts    |   4 +
 packages/core/src/types/settings/settings-scope.ts |   2 +
 pnpm-lock.yaml                                     |  12 +-
 47 files changed, 1700 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-8921

Fusion-Task-Lineage: 7014d0f1-fc47-454b-afe5-5f0d9b229f33

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 06:15:17 -07:00
gsxdsm
1cf86baa1c refactor: package code organization wave 18 (executor pure peels) (#3317)
## Summary

Wave 18 continues the package code-organization program after wave 17
domain folders (U4 Slice A from
`docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`).

### What changed
Peel **pure, behavior-preserving** helpers out of
`packages/engine/src/executor.ts` into domain modules under
`packages/engine/src/executor/`, with **stable re-exports** from
`executor.ts` so deep imports and `vi.mock("../executor.js")` keep
working.

| New module | Symbols |
|------------|---------|
| `executor/task-done-refusal.ts` | `evaluateTaskDoneRefusal`,
`determineRevisionResetStart`, skip-bypass refusal helper |
| `executor/workflow-feedback-paths.ts` |
`extractReferencedPathsFromWorkflowFeedback`,
`isAlwaysAllowedScopeLeakPath`, `workflowPathMatchesDeclaredScope` |
| `executor/workflow-step-verdict.ts` |
`FUSION_WORKFLOW_STEP_CONVENTIONS_PREAMBLE`, `parseWorkflowStepVerdict`
/ `parseWorkflowStepOutput`, step outcome types |
| `executor/await-input-parse.ts` | `parseAwaitInputSentinel`,
`parseAwaitInputQuestionToolCall` |
| `executor/no-commit-eligibility.ts` | `getNoCommitEligibilityReason`
(+ prompt heuristics) |

`executor.ts` live LOC ~**22817 → ~22427** (first pure-peel batch; more
peels needed to approach the 2k cap).

### Shims
- `old path` `executor.ts` public exports → `new path` `executor/*.ts` →
delete-when consumer deep-imports are re-pointed (not this PR)

### Test plan
- [x] `@fusion/engine` typecheck
- [x] Oracle: task-done refusal, skip-bypass, workflow malformed
verdict, scope-leak allowlist, executor-step-session, executor-prompt
- [x] `vitest --project=engine-core` (merge-gate curated suite)
- [ ] CI merge gate

**Stack:** wave17 (merged) → **this PR**

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

* **New Features**
* Improved recognition of workflow outcomes from structured and
conversational responses.
* Added support for extracting questions from await-input responses and
tool calls.
* Improved workflow feedback handling for referenced files and declared
scope patterns.
* Added clearer guidance for task execution, approvals, verification,
and available tools.

* **Bug Fixes**
* Prevented completion when required review approvals are missing or
revisions remain pending.
* Improved handling of workflows that legitimately require no code
changes.
  * Added clearer refusal messages and more reliable revision restarts.
  * Sanitized repository paths in Git remediation instructions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-09 15:46:09 -10:00
Victor Canô
a09e0cb87f feat(i18n): add Português (Brasil) (pt-BR) locale (#3347)
## Summary

Adds **Português (Brasil)** (`pt-BR`) as a supported locale:

- Selectable as **Translation target language** (project settings) and
as the dashboard / terminal UI language.
- Full machine-drafted catalogs (`app`, `cli`, `common`), disclosed in
`packages/i18n/locales/TRANSLATION_STATUS.md` following the pattern
#1352 established — reviewed for glossary/register consistency (0.18%
untranslated, matching only keys that are empty in `en`), but
native-speaker corrections are welcome.
- Brazilian Portuguese content-language detection (accent-stripped
stopword list — the scorer strips diacritics before matching, so
accented entries never match; `com`/`mais` deliberately omitted to avoid
bare-domain `.com` and French collisions, with regression tests for both
directions).
- `pt`/`pt-PT` browser and environment locales resolve to `pt-BR` on all
three detection paths (`FALLBACK_LNG` routing plus a `pt` branch in
`normalizeToSupportedLocale`, mirroring the existing `zh` handling).
- `README.pt-BR.md` + switcher links in all READMEs, docs updates
(`settings-reference`, `cli-reference`, `i18n-contributing`, `--lang`
help text), changeset (`minor`).

Drive-by fixes bundled: `TRANSLATION_STATUS.md` was missing the `ko`
row; the LanguageSelector endonym test was missing `한국어`;
`docs/i18n-contributing.md` now names the two compile-enforced display
maps (`LOCALE_LABELS`, `localeDisplayName`) a new locale must update;
the `--lang` CLI help text no longer drifts from its validator.

## Test plan

- `pnpm i18n:status` (key parity gate) green; catalogs are
`i18n:sync`-idempotent.
- Updated/extended suites: core `locale-settings`, i18n
`config`/`parity`/`db-banner-catalog`/`i18n-gate-coverage`, dashboard
`useLanguage`/`LanguageSelector`/`GeneralSection.importTranslate`/`detectContentLanguage`
(incl. new pt-BR detection + bare-domain regression tests), CLI
`settings`.
- `pnpm verify:fast` (typecheck, build, boot smoke), `pnpm lint`, `pnpm
check:changesets`, and the bounded `pnpm test` lane all green locally
(the three `test:pg-gate` files fail locally only for lack of a Postgres
instance; they fail identically on clean `main`).


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

* **New Features**
* Added Brazilian Portuguese (Português (Brasil)) across the dashboard,
terminal interface, settings, and translation tools.
  * Added Portuguese translations for common interface and CLI content.
* Added automatic Portuguese language detection, locale normalization,
and fallback support.
* Added a Portuguese (Brazil) README with product, setup, and usage
documentation.

* **Documentation**
* Updated language selectors, CLI references, settings documentation,
and translation guidance.
  * Added Portuguese README links to translated documentation.
  * Added French to the documented dashboard language options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-08-09 13:33:16 -10:00
gsxdsm
c7c879905b FN-8903: add event-driven GitHub CI merge checks
Persist ingested GitHub CI signals and use them to assess merge readiness.

- Store project-scoped GitHub check states with retention maintenance.
- Resolve configured required checks from ingested signals during PR merge decisions.
- Add delivery, lifecycle, persistence, and retention coverage with operator documentation.

Files changed:
 .changeset/fn-8903-event-driven-checks.md          |   7 ++
 docs/architecture.md                               |   1 +
 docs/settings-reference.md                         |   2 +-
 docs/signals-connectors.md                         |   2 +-
 .../src/commands/__tests__/task-lifecycle.test.ts  |  50 ++++++++-
 packages/cli/src/commands/task-lifecycle.ts        |   7 +-
 .../core/src/__tests__/ingested-checks.test.ts     |  66 +++++++++++
 .../postgres/github-check-states.pg.test.ts        |  71 ++++++++++++
 packages/core/src/config/index.ts                  |   1 +
 packages/core/src/config/ingested-checks.ts        |  32 ++++++
 packages/core/src/index.ts                         |  10 ++
 .../0048_fn_8903_github_check_states.sql           |  32 ++++++
 packages/core/src/postgres/schema-applier.ts       |  15 ++-
 packages/core/src/postgres/schema/project.ts       |  29 ++++-
 .../core/src/task-store/async/async-ci-checks.ts   | 104 ++++++++++++++++++
 packages/core/src/task-store/async/index.ts        |   1 +
 packages/core/src/types.ts                         |   2 +
 packages/dashboard/src/__tests__/github.test.ts    | 121 ++++++++++++++++++++-
 .../src/__tests__/register-signal-routes.test.ts   |  81 +++++++++++++-
 packages/dashboard/src/github.ts                   |  74 +++++++++----
 .../dashboard/src/routes/register-git-github.ts    |  29 +++--
 .../dashboard/src/routes/register-signal-routes.ts |  10 +-
 .../src/routes/register-task-workflow-routes.ts    |  14 ++-
 packages/dashboard/src/signal-source.ts            |  23 ++++
 packages/dashboard/src/signal-sources/github.ts    |   2 +
 .../self-healing-github-check-retention.test.ts    | 121 +++++++++++++++++++++
 packages/engine/src/self-healing.ts                |  23 ++++
 27 files changed, 878 insertions(+), 52 deletions(-)

Fusion-Task-Id: FN-8903
Fusion-Task-Lineage: b2643587-c568-4b6c-8b3a-d50a6165963d
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 09:14:56 -07:00
gsxdsm
2643f4e567 FN-8884: enable GitHub-native PR auto-merge
Enable opt-in GitHub-managed auto-merge for pull requests.

- Add a project setting and dashboard control for GitHub native auto-merge.
- Arm individual, group, dashboard, and workflow PRs with `gh pr merge --auto` or GraphQL, including while checks are pending.
- Preserve deferred PR reconciliation, unavailable-feature errors, project-scoped runtime configuration, tests, documentation, and a release changeset.

Files changed:
 .changeset/fn-8884-github-native-auto-merge.md     |   7 +
 docs/settings-reference.md                         |   5 +
 packages/cli/src/commands/__tests__/daemon.test.ts |  16 +++
 packages/cli/src/commands/__tests__/serve.test.ts  |  14 ++
 .../src/commands/__tests__/task-lifecycle.test.ts  | 158 +++++++++++++++++++++
 packages/cli/src/commands/daemon.ts                |  11 +-
 packages/cli/src/commands/dashboard.ts             |  11 +-
 packages/cli/src/commands/serve.ts                 |  11 +-
 packages/cli/src/commands/task-lifecycle.ts        |  45 ++++--
 .../core/src/__tests__/settings-defaults.test.ts   |   4 +
 packages/core/src/config/settings-schema.ts        |   1 +
 packages/core/src/types/settings/settings-scope.ts |   8 ++
 .../settings/__tests__/section-keys.test.ts        |   1 +
 .../app/components/settings/section-keys.ts        |   1 +
 .../components/settings/sections/MergeSection.tsx  |  14 +-
 .../settings-default-descriptions.test.tsx         |   1 +
 .../src/__tests__/github-native-auto-merge.test.ts | 114 +++++++++++++++
 .../src/__tests__/routes-pr-merge.test.ts          |  84 +++++++++++
 packages/dashboard/src/github.ts                   |  88 +++++++++++--
 packages/dashboard/src/index.ts                    |   2 +-
 .../dashboard/src/routes/register-git-github.ts    |  33 +++--
 .../project-engine-deferred-startup.test.ts        |  21 +++
 packages/engine/src/project-engine-manager.ts      |   2 +
 packages/engine/src/project-engine.ts              |   6 +
 packages/engine/src/project/project-runtime.ts     |   6 +
 packages/engine/src/runtimes/in-process-runtime.ts |   9 +-
 packages/i18n/locales/en/app.json                  |   4 +-
 27 files changed, 634 insertions(+), 43 deletions(-)

Fusion-Task-Id: FN-8884

Fusion-Task-Lineage: cf1b1ea4-7ef7-4050-bd87-25933456a5b6

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 04:50:30 -07:00