Commit Graph

917 Commits

Author SHA1 Message Date
gsxdsm
94ddfe1064 FN-7274: document workflow tools in Fusion skill
Document the workflow-authoring tool surface in the packaged Fusion skill references.

- Add workflow tools to the generated Fusion skill category and capability tables.
- Teach the skill sync script to read workflow tool specs from extension and engine agent tool sources.
- Cover workflow tool documentation and cache inputs with sync tests.
- Add a changeset for the published CLI skill update.

Files changed:
 .changeset/fn-7274-workflow-skill-tools.md         |   7 +
 packages/cli/skill/fusion/SKILL.md                 |   1 +
 .../cli/skill/fusion/references/engine-tools.md    |   4 +-
 .../cli/skill/fusion/references/extension-tools.md |  83 +++++++++-
 .../skill/fusion/references/fusion-capabilities.md |   8 +
 packages/cli/src/__tests__/skill-sync.test.ts      |  60 ++++++-
 scripts/__tests__/skill-sync-cache.test.mjs        |   5 +
 scripts/sync-fusion-skill-tools.mjs                | 172 ++++++++++++++++++---
 8 files changed, 312 insertions(+), 28 deletions(-)

Fusion-Task-Id: FN-7274

Fusion-Task-Lineage: e1cd6bd8-aecc-49ca-96ed-a937a15a18a4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 08:04:12 -07:00
gsxdsm
b5da5d310a FN-7263: refresh custom provider model lists
Refresh persisted custom-provider model lists from saved endpoints and expose manual refresh controls.

- Add dashboard API helpers and routes to refresh one or all custom-provider model lists while preserving concurrent settings edits.
- Start background model refresh from serve, dashboard, and daemon startup paths after the server begins listening.
- Add Settings UI refresh actions, row-level status messaging, styles, docs, and regression coverage for refresh behavior.

Files changed:
 .changeset/fn-7263-custom-provider-model-refresh.md       |   7 +
 docs/dashboard-guide.md                            |   6 +-
 docs/settings-reference.md                         |   2 +-
 packages/cli/src/commands/__tests__/daemon.test.ts |  59 +++++
 .../cli/src/commands/__tests__/dashboard.test.ts   |  51 ++++
 packages/cli/src/commands/__tests__/serve.test.ts  |  59 ++++-
 packages/cli/src/commands/daemon.ts                |  39 +++-
 packages/cli/src/commands/dashboard.ts             |  10 +
 packages/cli/src/commands/serve.ts                 |  11 +-
 .../app/__tests__/api-custom-providers.test.ts     |  43 ++++
 packages/dashboard/app/api/legacy.ts               |  11 +
 .../app/components/CustomProvidersSection.css      |  41 +++-
 .../app/components/CustomProvidersSection.tsx      |  68 +++++-
 .../__tests__/CustomProvidersSection.test.tsx      | 227 ++++++++++++++++++
 packages/dashboard/src/index.ts                    |   6 +
 .../__tests__/custom-provider-routes.test.ts       | 255 ++++++++++++++++++++
 .../src/routes/__tests__/custom-providers.test.ts  |  12 +
 .../src/routes/register-custom-provider-routes.ts  | 259 ++++++++++++++++-----
 18 files changed, 1101 insertions(+), 65 deletions(-)

Fusion-Task-Id: FN-7263

Fusion-Task-Lineage: 60ee0637-ac85-409f-a376-c01f4bc8e8c5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 01:23:09 -07:00
gsxdsm
f01e5c9651 FN-7247: document current workflow behavior
Refresh workflow documentation to match the latest runtime, dashboard, and agent tool behavior.

- Add a current workflow behavior inventory covering built-ins, fail-closed runtime semantics, optional gates, settings, tools, routing, and create forwarding.
- Clarify dashboard All workflows aggregation, workflow badges, and workflow-aware task creation behavior.
- Expand editor, agent, CLI, and settings docs for governed workflow authoring, values, trait inspection, and selection boundaries.
- Add docs drift tests requiring workflow docs index coverage and current behavior markers.

Files changed:
 docs/agents.md                                     |  5 +-
 docs/cli-reference.md                              | 11 ++-
 docs/dashboard-guide.md                            | 10 ++-
 docs/settings-reference.md                         |  5 ++
 docs/workflow-editor.md                            | 15 +++-
 docs/workflow-steps.md                             | 48 ++++++++---
 .../cli/src/__tests__/docs-readme-index.test.ts    |  4 +
 .../src/__tests__/workflow-docs-current.test.ts    | 95 ++++++++++++++++++++++
 8 files changed, 172 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-7247
Fusion-Task-Lineage: 72bf0c89-80a3-440c-b6aa-1aea315279f5
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 19:46:23 -07:00
gsxdsm
03d4f95e8a FN-7224: separate Anthropic subscription and API-key auth
Separate Claude subscription OAuth from raw Anthropic API-key authentication surfaces.

- Add synthetic Anthropic Subscription and Anthropic API Key provider IDs while preserving upstream credential storage compatibility.\n- Map dashboard auth routes, CLI auth storage, Settings, and onboarding flows so OAuth login/logout and API-key save/clear no longer share one user-facing card.\n- Extend auth tests, docs, icons, and the release changeset for the split Anthropic authentication behavior.\n\nFiles changed:\n .changeset/fn-7224-separate-anthropic-api-key.md   |   7 +\n docs/dashboard-guide.md                            |   2 +-\n docs/settings-reference.md                         |   2 +-\n .../src/commands/__tests__/provider-auth.test.ts   | 233 +++++++++++++++++++--\n packages/cli/src/commands/provider-auth.ts         | 202 +++++++++++++++---\n packages/dashboard/app/api/legacy.ts               |   2 -\n .../app/components/ModelOnboardingModal.tsx        | 146 ++++---------\n packages/dashboard/app/components/ProviderIcon.tsx |   7 +\n .../__tests__/AuthenticationSection.test.tsx       |  89 ++++----\n .../__tests__/SettingsModal.models-auth.test.tsx   |  77 ++++---\n .../components/__tests__/onboarding-flow.test.tsx  |  29 ++-\n .../components/__tests__/settings-mobile.test.tsx  |  17 +-\n .../settings/sections/AuthenticationSection.tsx    |  20 +-\n .../dashboard/src/__tests__/routes-auth.test.ts    | 111 ++++++----\n .../dashboard/src/routes/register-auth-routes.ts   |  93 +++++---\n 15 files changed, 713 insertions(+), 324 deletions(-)

Fusion-Task-Id: FN-7224

Fusion-Task-Lineage: a2db2cf6-3452-4516-81e5-41dcdf47e1d2

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 18:32:36 -07:00
Phil Larson
4c31441f58 fix: reset PR fixture git remote mock consistently 2026-06-29 17:18:59 -07:00
Phil Larson
6763584f64 fix: align dashboard PR fixture cwd mock 2026-06-29 17:17:35 -07:00
Phil Larson
bdd0a1cc2c test(cli): stabilize dashboard pr repository fixtures 2026-06-29 17:17:35 -07:00
gsxdsm
42226edde1 FN-7245: expose workflow authoring tools to agents
Expose workflow authoring and selection tools through agent-visible extension surfaces.

- Register workflow list/get/create/update/delete/settings/select and trait-list tools in the published pi extension.
- Export shared workflow tool schemas/factories and include workflow settings in centralized authoring tool sets.
- Update action-gate classifications, permission examples, docs, tests, and the changeset for the new agent workflow surface.

Files changed:
 .changeset/FN-7245-workflow-tools.md               |   7 +
 docs/agents.md                                     |   4 +-
 docs/cli-reference.md                              |  17 ++
 docs/workflow-steps.md                             |   9 +-
 .../src/__tests__/extension-workflow-tools.test.ts | 244 +++++++++++++++++++++
 packages/cli/src/__tests__/extension.test.ts       |   8 +
 packages/cli/src/extension.ts                      | 142 ++++++++++++
 packages/core/src/types.ts                         |   6 +-
 .../dashboard/src/__tests__/chat-manager.test.ts   |   9 +-
 .../planning-document-tools-exposure.test.ts       |  19 +-
 .../engine/src/__tests__/agent-action-gate.test.ts |   8 +
 .../agent-workflow-tools-exposure.test.ts          |  30 ++-
 .../src/__tests__/gating-classifications.test.ts   |  13 +-
 .../src/__tests__/permanent-agent-gating.test.ts   |   4 +-
 packages/engine/src/agent-tools.ts                 |  13 +-
 packages/engine/src/gating-classifications.ts      |   6 +-
 packages/engine/src/index.ts                       |   7 +
 17 files changed, 506 insertions(+), 40 deletions(-)

Fusion-Task-Id: FN-7245

Fusion-Task-Lineage: 82501602-7177-4ee8-a67b-32de35aa73de

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 16:35:51 -07:00
gsxdsm
013d50fe8b FN-7206: add Anthropic API-key authentication
Add Anthropic API-key authentication alongside the existing OAuth flow.

- Expose Anthropic as a built-in API-key provider without hiding its OAuth controls.
- Render dual-auth Anthropic cards in Settings and model onboarding with key hints, save, and clear actions.
- Cover API status, CLI provider classification, desktop/mobile settings, and onboarding flows with tests and docs.

Files changed:
 .changeset/fn-7206-anthropic-api-key.md            |   7 +
 docs/dashboard-guide.md                            |   2 +
 docs/settings-reference.md                         |   4 +
 .../src/commands/__tests__/provider-auth.test.ts   |  51 ++++---
 packages/cli/src/commands/provider-auth.ts         |  10 +-
 packages/dashboard/app/api/legacy.ts               |   2 +
 .../app/components/ModelOnboardingModal.tsx        | 121 +++++++++++++++-
 .../__tests__/AuthenticationSection.test.tsx       | 141 +++++++++++++++++++
 .../__tests__/SettingsModal.models-auth.test.tsx   |  51 +++++++
 .../__tests__/SettingsModal.test-harness.tsx       |   2 +
 .../components/__tests__/onboarding-flow.test.tsx  |  28 ++++
 .../components/__tests__/settings-mobile.test.tsx  |  16 ++-
 .../settings/sections/AuthenticationSection.tsx    | 153 ++++++++++-----------
 .../dashboard/src/__tests__/routes-auth.test.ts    |  70 ++++++++++
 .../dashboard/src/routes/register-auth-routes.ts   |  17 ++-
 15 files changed, 569 insertions(+), 106 deletions(-)

Fusion-Task-Id: FN-7206

Fusion-Task-Lineage: 3559b7ea-47c6-4f8c-9aa1-5318f47ce07e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 17:03:11 -07:00
gsxdsm
bc38f0c842 FN-7209: require JDK 21 for Android CI builds
Align Android Gradle build environments with Capacitor's Java 21 source compatibility.

- Update mobile, release, and test-release workflows to provision Temurin JDK 21.
- Document Java 21 as the required Android Gradle build JDK.
- Add CI workflow coverage that checks Android build jobs satisfy @capacitor/android sourceCompatibility.

Files changed:
 .github/workflows/mobile.yml                   |  6 +-
 .github/workflows/release.yml                  |  6 +-
 .github/workflows/test-release.yml             |  6 +-
 MOBILE.md                                      |  4 +-
 packages/cli/src/__tests__/ci-workflow.test.ts | 99 +++++++++++++++++++++++++-
 5 files changed, 112 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-7209

Fusion-Task-Lineage: d9e50bee-d7f8-4e87-b33e-136ffffc93af

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 16:56:35 -07:00
gsxdsm
2be00efc04 fix(cli): stop engine teardown logs repainting shell after TUI quit
Root cause of "the TUI keeps rendering after I get my terminal back": on
quit, dispose() called logSink.releaseConsole() (re-pointing console.* at
the real terminal) and then tui.stop() left the alt-screen and restored the
user's shell. Every log line from the slow engine/mesh/dev-server teardown
that followed then painted over the recovered prompt.

dispose() now calls a new logSink.silence() instead, which drops all sink
and console.* output from quit through process exit. Shutdown-step
diagnostics (timeShutdownStep + the watchdog stall line) are gated behind
FUSION_DEBUG_SHUTDOWN so a normal quit is pristine; the 3s hard-exit
watchdog still guarantees the process dies.

Adds a silence() regression guard to log-sink.test.ts asserting sink
methods and captured console.* both go silent across surfaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 10:56:38 -07:00
gsxdsm
524c15c2fd FN-7188: prevent agents from pausing failed tasks
Clarify agent heartbeat and tool guidance so failures surface through recovery paths instead of task pauses.

- Update heartbeat prompts to prohibit failure/blocker handling via fn_task_pause.
- Clarify fn_task_pause tool copy as explicit user-requested manual control only.
- Refresh generated Fusion skill docs and add regression coverage for the guidance.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/FN-7188-no-pause-on-failure.md                    |  7 +++++++
 packages/cli/skill/fusion/references/best-practices.md       |  6 +++---
 packages/cli/skill/fusion/references/extension-tools.md      |  2 +-
 packages/cli/skill/fusion/references/fusion-capabilities.md  |  2 +-
 packages/cli/skill/fusion/workflows/task-management.md       |  2 +-
 packages/cli/src/__tests__/extension.test.ts                 |  8 ++++++++
 packages/cli/src/extension.ts                                | 10 ++++++++--
 .../engine/src/__tests__/heartbeat-session-prompt.test.ts    | 10 ++++++++++
 packages/engine/src/agent-heartbeat.ts                       | 12 ++++++++++--
 9 files changed, 49 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-7188
Fusion-Task-Lineage: 29df6168-7920-49d5-9c11-804727033721
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 01:22:43 -07:00
gsxdsm
a95cfa7f92 FN-7160: unify live agent counts and fix use markers
Unifies running-agent slot accounting across engine, CLI, and dashboard surfaces.

- Add shared core helpers for identifying and counting active top-level agent tasks, including in-review reviewer, merger, fix, and PR merge states.
- Reuse the shared count in engine semaphore repair, project health displays, and dashboard project-store routes.
- Correct Command Center utilization markers to use a zero-based active/cap ratio.
- Cover the shared predicate and affected CLI, dashboard, and engine behaviors with regression tests.

Files changed:
 .changeset/fn-7160-running-agent-count.md          |  7 ++++
 docs/dashboard-guide.md                            |  2 +-
 .../cli/src/commands/__tests__/project.test.ts     | 40 ++++++++++++++----
 packages/cli/src/commands/project.ts               | 15 +++----
 .../core/src/__tests__/live-agent-count.test.ts    | 47 ++++++++++++++++++++++
 packages/core/src/index.ts                         |  2 +
 packages/core/src/live-agent-count.ts              | 30 ++++++++++++++
 packages/core/src/types.ts                         |  2 +-
 .../command-center/CommandCenterControls.tsx       | 14 ++++---
 .../__tests__/CommandCenterControls.test.tsx       | 22 +++++++++-
 .../dashboard/src/__tests__/project-routes.test.ts | 31 +++++++++-----
 .../src/__tests__/project-store-resolver.test.ts   | 20 ++++++---
 packages/dashboard/src/project-store-resolver.ts   |  9 ++---
 .../src/routes/register-project-routes.ts          |  7 ++--
 packages/engine/src/__tests__/concurrency.test.ts  | 18 +++++++++
 packages/engine/src/concurrency.ts                 | 12 +++---
 16 files changed, 220 insertions(+), 58 deletions(-)

Fusion-Task-Id: FN-7160

Fusion-Task-Lineage: f48332f8-ac5d-46eb-b975-d2f6c880ddd5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 21:39:40 -07:00
gsxdsm
aeafee75e5 test: remove dead post-await sleeps in skills install tests
runSkillsInstall already awaits the spawned child exit event, so the
fixed 100ms post-await sleeps were redundant wall-clock time (FN-5048).
Removes ~400ms of dead waits; assertions unchanged, 22 tests still pass.
2026-06-27 17:03:55 -07:00
gsxdsm
6f46fa17dd FN-7138: show task column context in agent assignments
Agent Current Task output now includes linked task column context to distinguish active execution from parked or stale links.

- Add shared Current Task formatting for active, terminal, and unresolved task links.
- Show linked task columns in engine and CLI agent list/show surfaces.
- Cover parked, active, terminal, and missing task-link display cases with tests.
- Document the durable agent task-link invariant and release the CLI fix.

Files changed:
 .changeset/fn-7138-agent-current-task-context.md   |  7 ++++
 docs/agents.md                                     |  1 +
 docs/architecture.md                               |  2 +-
 packages/cli/src/__tests__/extension.test.ts       | 44 ++++++++++++++++++++++
 packages/cli/src/extension.ts                      | 35 +++++++++++++++--
 packages/core/src/agent-store.ts                   | 30 +++++++++++++++
 packages/core/src/index.ts                         |  2 +-
 .../src/__tests__/agent-tools-delegation.test.ts   | 44 +++++++++++++++++++++-
 packages/engine/src/agent-tools.ts                 | 15 ++++++--
 9 files changed, 169 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-7138
Fusion-Task-Lineage: 0ea97b4c-d4f8-4289-a5b6-e5c51b47b768
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 16:16:25 -07:00
gsxdsm
63b44b819a FN-7133: fix PR merge status repository lookup
Fix PR-mode auto-merge status checks to query GitHub with the project repository.

- Resolve the current project owner/repo once from the task cwd before PR status checks.
- Pass owner/repo/number to getPrMergeStatus for shared-group, task, and retry paths.
- Cover repository resolution and PR status argument behavior in lifecycle tests.
- Add a patch changeset for the published CLI fix.

Files changed:
 .changeset/FN-7133-pr-merge-status-repo-args.md    |  7 ++++
 .../src/commands/__tests__/task-lifecycle.test.ts  | 39 +++++++++++++++++++++-
 packages/cli/src/commands/task-lifecycle.ts        | 17 +++++++---
 3 files changed, 58 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-7133
Fusion-Task-Lineage: 3f9bfd65-6950-40dc-9505-53140bd6a6a1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 13:28:47 -07:00
gsxdsm
7657cc6d84 feat(cli): instrument dashboard shutdown to pinpoint stalling teardown step
Each graceful-shutdown teardown step (dev servers, hybrid executor,
engine manager, peer exchange, mesh, central-core) now runs through
timeShutdownStep, which records the in-flight step name. A hang leaves
that name set, so the hard-exit watchdog reports the exact culprit on
stderr before force-exiting — no repro needed. Per-step timings print to
stderr under FUSION_DEBUG_SHUTDOWN=1; otherwise only steps slower than
1s are surfaced. Folds the per-step try/catch into the wrapper so a
throwing step logs and continues instead of stranding the process.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 13:24:57 -07:00
gsxdsm
661b6b8a47 fix(cli): guarantee TUI quit exits even if graceful shutdown stalls
Pressing q/Ctrl+C in the TUI routes through SIGINT so the dashboard's
graceful shutdown runs (kills dev-server process groups, engines, mesh,
central-core). That shutdown awaits several teardown steps with no
timeout, so a single hung step left process.exit(0) unreachable: the
process never exited and the still-alive dashboard kept writing output
onto the restored shell. The shutdownInProgress guard also swallowed
repeat signals, so mashing q could not escape.

Both shutdown() and devShutdown() now arm an unref'd 3s hard-exit
watchdog on the first signal and force an immediate process.exit(0) on a
second signal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 13:22:28 -07:00
gsxdsm
9e2fb5d62c FN-7102: count active triage planners in project health
Align project health in-flight readouts with live agent slot holders.\n\n- Count non-paused triage planning tasks alongside in-progress executors for dashboard health and CLI project displays.\n- Keep persisted projectHealth.inFlightAgentCount as bookkeeping while deriving user-facing counts from live task state.\n- Cover CLI and dashboard health routes for paused, inactive, and per-project triage planner cases.\n- Document the live count behavior and add a patch changeset.\n\nFiles changed:\n .changeset/fn-7102-health-triage-inflight.md       |  7 +++\n docs/cli-reference.md                              |  2 +\n docs/multi-project.md                              |  4 +-\n .../cli/src/commands/__tests__/project.test.ts     | 59 +++++++++++++++---\n packages/cli/src/commands/project.ts               | 35 +++++++----\n packages/cli/src/project-resolver.ts               | 17 ++++--\n packages/core/src/types.ts                         |  4 +-\n .../dashboard/src/__tests__/project-routes.test.ts | 71 ++++++++++++++++++----\n .../src/routes/register-project-routes.ts          |  9 ++-\n 9 files changed, 163 insertions(+), 45 deletions(-)

Fusion-Task-Id: FN-7102

Fusion-Task-Lineage: ebcba74c-238d-4ca7-aa77-df0d329c0ea9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 09:28:30 -07:00
gsxdsm
8b22dd2ffe FN-7090: link imported GitHub issues as tracked tasks
Link GitHub issue imports to existing source issues when tracking defaults are enabled.

- Resolve project/global GitHub tracking defaults before CLI, extension, and dashboard issue imports.
- Mark imported issue tasks as tracking-enabled so the post-create hook adopts the source issue instead of creating duplicates.
- Cover tracked and untracked import behavior across CLI tools, task commands, and dashboard GitHub routes.
- Document the import tracking behavior and add a minor changeset for the published CLI.

Files changed:
 .changeset/fn-7090-import-github-tracked.md        |   7 ++
 docs/cli-reference.md                              |   2 +
 docs/settings-reference.md                         |   2 +-
 .../__tests__/extension-github-tracking.test.ts    |  63 +++++++++++
 packages/cli/src/__tests__/extension.test.ts       | 125 ++++++++++++++++++++-
 .../task-command-github-import-tracking.test.ts    | 119 ++++++++++++++++++++
 packages/cli/src/commands/__tests__/task.test.ts   |  64 ++++++++++-
 packages/cli/src/commands/task.ts                  |  30 ++++-
 packages/cli/src/extension.ts                      |  27 +++++
 .../dashboard/src/__tests__/routes-github.test.ts  |  74 ++++++++++++
 .../dashboard/src/routes/register-git-github.ts    |  21 +++-
 11 files changed, 524 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-7090
Fusion-Task-Lineage: 1e5510c3-7a98-4ff2-a109-e465ff58b9c2
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 09:28:29 -07:00
gsxdsm
5608bf555f FN-7083: derive project in-flight counts from live tasks
Derive CLI project in-flight agent displays from live in-progress task counts instead of persisted health bookkeeping.

- Add shared CLI display health handling for project list and show output.
- Cover stale, missing, unreadable, table, and JSON project health cases in CLI tests.
- Clarify central health and concurrency fields as persisted bookkeeping in docs and types.
- Add a patch changeset for the published CLI behavior fix.

Files changed:
 .changeset/fn-7083-cli-inflight-live-count.md      |   7 +
 docs/architecture.md                               |   1 +
 docs/multi-project.md                              |   4 +-
 .../cli/src/commands/__tests__/project.test.ts     | 172 ++++++++++++++++++++-
 packages/cli/src/commands/project.ts               |  60 ++++---
 packages/cli/src/project-resolver.ts               |   4 +
 packages/core/src/types.ts                         |  12 +-
 7 files changed, 235 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-7083

Fusion-Task-Lineage: 2b57cb35-383f-443b-8bf3-3fc3c7a1ad43

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-26 18:35:54 -07:00
gsxdsm
ad3149093a FN-7077: inject configured MCP servers across agent surfaces
Configured MCP servers now follow every agent-work lane that launches model-backed tools.

- Thread MCP server forwarding through chat, task execution, tools, PR response, cron, memory, research, and planning surfaces.
- Add regression coverage for dashboard and engine lanes that previously omitted MCP server configuration.
- Document all covered MCP surfaces and add a published package changeset.

Files changed:
 .changeset/fn-7077-mcp-all-surfaces.md             |   7 +
 docs/mcp.md                                        |   3 +
 docs/settings-reference.md                         |   2 +-
 packages/cli/src/commands/__tests__/serve.test.ts  |   3 +-
 packages/core/src/memory-compaction.ts             |   4 +
 .../src/__tests__/mcp-lane-forwarding.test.ts      |  62 +++++++++
 packages/dashboard/src/agent-generation.ts         |   4 +
 packages/dashboard/src/ai-refine.ts                |   8 ++
 .../dashboard/src/milestone-slice-interview.ts     |  11 +-
 packages/dashboard/src/mission-interview.ts        |   9 +-
 packages/dashboard/src/pr-conflict-resolver.ts     |  12 +-
 packages/dashboard/src/routes.ts                   |  10 ++
 packages/dashboard/src/subtask-breakdown.ts        |   8 ++
 packages/engine/src/__tests__/cron-runner.test.ts  |  61 +++++++++
 .../src/__tests__/mcp-lane-forwarding.test.ts      |   3 +-
 .../__tests__/mcp-pr-response-forwarding.test.ts   | 110 ++++++++++++++++
 .../src/__tests__/mcp-surface-coverage.test.ts     | 141 +++++++++++++++++++++
 packages/engine/src/agent-heartbeat.ts             |  18 +++
 packages/engine/src/cli-agent-ask.ts               |   4 +
 packages/engine/src/cron-runner.ts                 |   9 +-
 packages/engine/src/pr-nodes.ts                    |   2 +-
 packages/engine/src/pr-response-run-ops.ts         |  10 +-
 packages/engine/src/project-engine.ts              |   2 +-
 .../research/providers/llm-synthesis-provider.ts   |   4 +
 .../src/research/providers/web-search-provider.ts  |   4 +
 25 files changed, 497 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-7077
Fusion-Task-Lineage: 00d36357-c3d8-4954-b647-d3aea24a967b
2026-06-26 16:14:44 -07:00
gsxdsm
42f46a12c1 FN-7060: sanitize bundled plugin manifests
Sanitize published CLI plugin manifests so off-workspace installs do not resolve private workspace packages.

- Add manifest sanitization for copied bundled plugins and vendored pi extensions during the CLI build.
- Cover built plugin and extension package.json files with a pack-shape regression test.
- Update plugin authoring docs and add a patch changeset for the published CLI fix.

Files changed:
 .../fn-7060-fix-plugin-manifest-workspace-deps.md  |  7 ++
 docs/PLUGIN_AUTHORING.md                           |  8 ++-
 .../cli/src/__tests__/plugin-pack-shape.test.ts    | 55 +++++++++++++-
 packages/cli/tsup.config.ts                        | 83 ++++++++++++++++++++--
 4 files changed, 142 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-7060

Fusion-Task-Lineage: e38a4237-7197-4bc4-87bd-117dfd35a0f8
2026-06-26 10:18:04 -07:00
gsxdsm
3ee47dec86 merge: integrate origin/main into feature/workflow-steps (FN-7039)
Resolve conflicts from 56 upstream commits:
- db.ts: renumber my migrations around main's new migration 130 (columnDwellMs) —
  enable-id normalization 130→131, drop-table 131→132, SCHEMA_VERSION→132.
- index.ts / routes.ts: take main's new MCP exports/imports; keep WORKFLOW_STEP_TEMPLATES
  array removed (kept the WorkflowStepTemplate type).
- merger.ts: keep the legacy post-merge execution path removed (U7c) over main's version.
- ci-workflow.test.ts (from main): add port-4040/process-supervisor allowlist markers to
  the gate-script assertions that reference the checker filenames (pre-existing self-match).

Gate green (engine-core 299, ci-shape 62); boot smoke PASS; migration tests + typecheck clean.
2026-06-26 08:50:22 -07:00
gsxdsm
7d13f880ba FN-7059: pin merge gate composition
Add CI-shape coverage that guards the trusted merge gate composition.\n\n- Load root and engine package scripts plus the engine vitest config in the CI workflow test.\n- Assert test:gate includes the audited guard scripts, engine core suite, and CLI CI-shape suite.\n- Assert engine test:core continues targeting the engine-core vitest project.\n\nFiles changed:\n packages/cli/src/__tests__/ci-workflow.test.ts | 26 ++++++++++++++++++++++++++\n 1 file changed, 26 insertions(+)

Fusion-Task-Id: FN-7059

Fusion-Task-Lineage: 47af7fdd-a812-4d03-960a-a6300d86b59e
2026-06-26 06:47:27 -07:00
gsxdsm
429143ecf0 FN-7024: add MCP server management CLI
Add CLI support for managing MCP server configuration without exposing secret values.

- Add fn mcp list/add/edit/remove/enable/disable/import/export/validate subcommands.
- Store MCP env and header values as Fusion secret references, including Claude Desktop import conversion.
- Document MCP CLI usage and add command coverage for scoped configuration, import, export, and validation.
- Add a minor changeset for the published CLI feature.

Files changed:
 .changeset/fn-7024-mcp-cli.md                   |   7 +
 docs/cli-reference.md                           |  49 +++
 packages/cli/src/bin.ts                         | 124 +++++++
 packages/cli/src/commands/__tests__/mcp.test.ts | 182 ++++++++++
 packages/cli/src/commands/mcp.ts                | 455 ++++++++++++++++++++++++
 5 files changed, 817 insertions(+)

Fusion-Task-Id: FN-7024

Fusion-Task-Lineage: e3d98bfa-b883-4b9e-86d5-f0416808d6f2
2026-06-25 23:34:07 -07:00
gsxdsm
4a4e389254 FN-7032: add signed Android release artifacts
Add secret-gated signed Android release packaging while preserving the unsigned fallback.

- Build signed Android release APK and AAB artifacts when keystore secrets are configured.
- Verify signed APKs, generate checksums for APK/AAB outputs, and include AABs in release aggregation.
- Document Android signing secrets, sideload verification, fallback artifacts, and Play upload scope.
- Cover the release and rehearsal workflow wiring with CLI and desktop workflow tests.

Files changed:
 .github/workflows/release.yml                      | 94 ++++++++++++++++++----
 .github/workflows/test-release.yml                 | 94 ++++++++++++++++++----
 MOBILE.md                                          | 18 ++++-
 RELEASING.md                                       | 34 ++++++--
 packages/cli/src/__tests__/ci-workflow.test.ts     | 24 ++++++
 packages/desktop/README.md                         |  2 +-
 .../desktop/src/__tests__/release-workflow.test.ts | 24 +++++-
 7 files changed, 251 insertions(+), 39 deletions(-)

Fusion-Task-Id: FN-7032
Fusion-Task-Lineage: 0334c026-384e-4531-a2b2-f8a0b5bb7ff0
2026-06-25 20:20:33 -07:00
gsxdsm
dba65933e5 FN-7014: publish Android APK release artifacts
Adds Android APK generation to binary release and rehearsal workflows so GitHub releases ship mobile assets.

- Add Android build jobs that sync Capacitor, assemble the debug APK, and upload APK/checksum artifacts.
- Include Android artifacts in release and test-release collection dependencies and file matching.
- Document Android release outputs and extend workflow shape tests for the new asset path.

Files changed:
 .github/workflows/release.yml                      | 86 +++++++++++++++++++++-
 .github/workflows/test-release.yml                 | 85 ++++++++++++++++++++-
 MOBILE.md                                          |  2 +-
 RELEASING.md                                       | 10 ++-
 packages/cli/src/__tests__/ci-workflow.test.ts     |  6 +-
 packages/desktop/README.md                         |  1 +
 .../desktop/src/__tests__/release-workflow.test.ts | 24 +++++-
 7 files changed, 201 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-7014
Fusion-Task-Lineage: 8ed94f64-399b-433f-add4-0294fc5722d1
2026-06-25 19:35:05 -07:00
gsxdsm
bc56ab287e fix: align tests with recent source changes on main
Fix 6 failing tests caused by intentional source changes that landed
without updating dependent test assertions:

- Core test-project: taskPrefix default changed from "FN" to undefined
  (commit 800f845e1, derived from project name at runtime)
- Dashboard ScriptsModal.css: replace banned --text-primary with --text
- CLI package-config: update expected pi dep version ^0.79.1 -> ^0.79.9
- CLI skill-sync: document 4 new engine tools in engine-tools.md
- CLI version: update expected release:version script to include
  run-ci-distill.mjs
- CLI bundled-plugin-freshness: rebuild stale dist directories
2026-06-25 00:13:29 -07:00
gsxdsm
f9816799a0 FN-7000: test unified CLI merge entrypoints
Strengthen CLI merge tests around the unified runAiMerge path.\n\n- Mock runAiMerge separately from deprecated aiMergeTask in CLI task and dashboard tests.\n- Assert task merge uses runAiMerge without falling back to workspace landing or aiMergeTask.\n- Verify dashboard manual merge logging streams through runAiMerge and restores spies safely.\n\nFiles changed:\n .../cli/src/commands/__tests__/dashboard.test.ts   | 51 +++++++++++++---------\n packages/cli/src/commands/__tests__/task.test.ts   | 30 +++++++++----\n 2 files changed, 52 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-7000

Fusion-Task-Lineage: 96080841-c813-4a9e-97bd-a41aba60089f
2026-06-24 23:32:52 -07:00
gsxdsm
3ae053e744 FN-6976: keep planning JSON failures retryable
Persist malformed Planning Mode AI responses as retryable errors while improving JSON response selection.

- Preserve failed initial-turn planning sessions with actionable retry errors instead of deleting them.
- Prefer valid planning-shaped JSON candidates over unrelated embedded JSON blobs.
- Cover streaming, non-streaming, retry recovery, and AI merge test mock compatibility.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6976-planning-json-recovery.md       |   7 +
 .../cli/src/commands/__tests__/dashboard.test.ts   |   1 +
 packages/cli/src/commands/__tests__/task.test.ts   |   9 +-
 .../src/__tests__/session-error-recovery.test.ts   | 144 +++++++++++++++++++++
 packages/dashboard/src/planning.ts                 | 123 ++++++++++--------
 5 files changed, 229 insertions(+), 55 deletions(-)

Fusion-Task-Id: FN-6976

Fusion-Task-Lineage: e1cb59cb-1d7d-4aff-b17f-9633568f823f
2026-06-24 23:32:52 -07:00
gsxdsm
b680948d8c Address PR review feedback (#1746)
- Fix race condition: add request ID guard for stale workspace detection responses
- Guard workspaceMode:true: only persist when repos.length > 0
- Add server-side taskPrefix validation (/^[A-Z]{1,5}$/)
- Move store.init() inside try/finally in both CLI TaskStore lifecycles
- Accept 1-character prefixes in CLI prompt (was requiring >= 2)
- Fix workspaceMode passing: forward false explicitly (was coerced to undefined)
- Fix 3rd KB→FN fallback in distributed-task-id.ts catch block
- Add try/finally to dashboard TaskStore in register-project-routes
- Gate workspace detection on existing-directory mode only (skip clone mode)
2026-06-24 14:24:07 -07:00
gsxdsm
46d0c4a1f6 Address PR review feedback round 3 (#1741)
- Align dashboard prefix validation to 1-5 chars (was 1-10) matching CLI cap
- Fix distributed-task-id.ts fallback from KB to FN (3 occurrences)
- Move taskPrefix/defaultWorkflowId persistence outside interactive-only block
  so non-interactive CLI registration also gets defaults
- Wrap both TaskStore lifecycles in try/finally to guarantee close() on error
2026-06-24 14:08:32 -07:00
gsxdsm
b317a39d80 Cap interactive prefix input to 5 chars (#1741) 2026-06-24 11:39:40 -07:00
gsxdsm
06adc190ce Add max-length cap (10) to interactive prefix input (#1741)
CodeRabbit: suggestTaskPrefix caps at 4 chars, but user input was uncapped.
Align with the dashboard validation regex (1-10 uppercase letters).
2026-06-24 11:34:38 -07:00
gsxdsm
aae76cecc3 Address PR review feedback (#1741)
- Close first TaskStore before creating second in interactive registration (P1)
- Revert defaultWorkflowId default to undefined; set explicitly in onboarding only (P1)
- Add alpha-only filter + 2-char min to interactive prefix input (P2)
- Move suggestTaskPrefix to @fusion/core, share between CLI and dashboard (P2)
- Fix suggestTaskPrefix JSDoc to match implementation (P2)
2026-06-24 10:45:21 -07:00
gsxdsm
800f845e15 feat(workspace): fix auto-detection, derive prefix from name, default coding workflow
- Fix workspace detection: change workspaceMode default from false to
  undefined so isWorkspaceModeExplicitlyDisabled no longer blocks
  auto-detection on fresh projects (config.json was being written with
  workspaceMode:false during store.init(), causing the guard to skip
  detection before it ever ran)
- Derive task prefix from project name (first 2-4 chars) instead of
  hardcoded 'FN' as the suggested default
- Default workflow is now builtin:coding instead of undefined
- CLI registerProjectInteractive: onboarding prompt for task prefix
  confirmation after project name
- Dashboard POST /api/projects: auto-derive prefix and set default
  workflow for new registrations
2026-06-24 10:31:06 -07:00
gsxdsm
9aaf911735 feat(workspace): add per-project workspaceMode setting with interactive confirmation
Add workspaceMode as a first-class ProjectSettings boolean that controls
whether the project root is treated as a workspace parent (multi-repo)
or a single git repo.

- ProjectSettings type + DEFAULT_PROJECT_SETTINGS: workspaceMode?: boolean
- CLI registerProjectInteractive: when sub-repos are detected, ask the
  user to confirm workspace mode instead of auto-applying
- TaskStore.updateSettings: when workspaceMode is toggled on, detect
  sub-repos and persist workspace.json; when toggled off, remove it
- Dashboard SettingsModal GeneralSection: workspace mode toggle checkbox

This lets users change workspace mode per-project at any time via the
dashboard Settings or PUT /settings API.
2026-06-24 00:45:24 -07:00
gsxdsm
0dea25061d Merge remote-tracking branch 'origin/main' into conflict-resolution-1717
# Conflicts:
#	packages/engine/src/__tests__/executor-recovery.test.ts
#	packages/engine/src/agent-tools.ts
#	packages/engine/src/executor.ts
#	packages/engine/src/merger-ai.ts
#	packages/engine/src/project-engine.ts
#	packages/engine/src/worktree-acquisition.ts
2026-06-23 16:12:10 -07:00
gsxdsm
905a877954 Merge pull request #1710 from MichaelHoughtonDeBox/feat/workspace-multi-repo
Workspace mode: open a folder of git repos as one project (foundation + design Q)
2026-06-23 15:08:15 -07:00
gsxdsm
4704e58ed8 fix(cli): drain TUI performance entries 2026-06-23 12:10:40 -07:00
gsxdsm
3a71237624 fix(review): address PR #1717 Phase C merge-loop review feedback
- merger-ai: resolve+persist concrete landedSha when a sub-repo is recognized
  already-landed via the Fusion-Task-Id trailer fallback, so finalize no longer
  drops it and mis-finalizes a fully-landed workspace task as a no-op
- project-engine: manual-merge land-lease busy errors reject the resolver without
  burning mergeRetries; clear stale busy-reenqueue counter on real partial land;
  persist retry count before arming the backoff timer (fail closed on write error)
- cli/dashboard + task: use shared isWorkspaceTask predicate instead of inlining
- base-commit-capture: POSIX single-quote shell escaping for integration ref
- git-repository: validate workspace.json repos elements are strings
- merger-ai: drop dead store param from landOneRepo
- tests: assert the 60s backoff cap across cycles; exercise the real runAiMerge
  merge door; fix non-git-root assertion; re-export real workspace error classes
  in the merger-ai mock (fixes 24 pre-existing instanceof-undefined failures);
  remove generic fake-timer smoke test now covered by the live engine assertion

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 03:04:21 -07:00
gsxdsm
627bdcfb0a fix(review): Phase C merge-loop hardening — double-land, lease clobber, retry storm
5-persona review of the Phase-C per-repo merge loop. No P0; the no-push invariant
and retry/park accounting verified clean. Fixed:

Land mechanics (merger-ai.ts / active-session-registry.ts):
- persistRepoLandedSha no longer swallows the DB write: a failed landedSha write
  after the ref advanced now escalates to WorkspacePartialLandError so the engine
  parks/retries instead of silently re-landing (duplicate squash). isRepoLanded
  gains a landedSha-independent fallback — it scans the integration ref for this
  task's Fusion-Task-Id trailer (a squash commit is NOT a branch descendant, so a
  branch-ancestor check is provably wrong), so an actually-landed repo is skipped
  on retry.
- The land lease is now taskId-aware across kinds: any foreign-task holder on a
  sub-repo path is contention (a merging task can't run over an executing task's
  acquire lease), and registerPath throws ActiveSessionPathHeldByForeignTaskError
  instead of silently clobbering a different task's entry.
- The per-repo loop is wrapped in try/finally(setStatus(null)) so the busy/partial
  throws can't leave the task stuck 'merging'. WorkspacePartialLandError is a real
  exported class (not a .name-mutated Error). finalizeWorkspaceTask re-reads fresh
  and no longer swallows the mergeDetails write (TOCTOU). isRepoLanded exported for
  Phase D.

Dispatch + doors (project-engine.ts / dashboard.ts / task.ts / @fusion/core):
- getTask-null in the partial-land catch fails closed (park) instead of defaulting
  retries to 0 and scheduling an indefinite retry storm.
- The merge-confirmed reachability fast-path skips workspace tasks (its
  representative commitSha is a sub-repo squash sha, unreachable in the root cwd —
  it was demoting fully-merged tasks); they're verified by per-repo landedSha.
- The CLI/dashboard merge doors now return merged:true on full land (were hardcoded
  merged:false). WorkspaceRepoLandBusyError re-enqueues with backoff WITHOUT burning
  the mergeRetries quota (bounded busy counter) so contention can't park a healthy
  task. Backoff capped at 60s. shouldRetryWorkspacePartialLand folded into
  shouldRetryAutoMergeConflict. Catch switched to instanceof. New canonical
  isWorkspaceTask predicate in @fusion/core.

Gate green: build, typecheck, lint, test:gate (649+58); workspace-merger + oracle
+ project-engine 174.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 01:11:52 -07:00
gsxdsm
429258354d fix(workspace): address CodeRabbit review findings on the foundation
Resolves the actionable CodeRabbit threads on the workspace-mode foundation:

- project-resolver: defer saveWorkspaceConfig until after the user confirms init
  and store.init() succeeds (no partial .fusion/ on a declined/non-interactive run).
- git-repository: validate each candidate with a real `git rev-parse` work-tree
  probe before counting it (no false-positive repos from stray .git markers);
  loadWorkspaceConfig now rejects absolute paths, `..` escapes, and non-string
  entries so a corrupt/malicious config can't resolve outside the workspace root.
- executor: gate workspace mode on repos.length > 0 at all three sites so an
  empty { repos: [] } can't bypass the git-repo guard or enable an empty workspace.
- worktree-acquisition: thread the configured-command runner through the workspace
  acquire path (sub-repos run their init setup); validate repoRelPath as an in-root
  relative path before joining; liveness-check a remembered worktree before
  reporting it ready (pruned paths fall through to re-acquire); clear the singular
  task.worktree/branch after persisting per-repo state (per-repo state lives only
  in workspaceWorktrees).
- agent-tools: forward runContext into acquireWorkspaceRepoWorktree for log attribution.

The executor-workspace test's mock-the-subject pattern is left for the
session-scoping follow-up that rewrites it with a real two-repo fixture (FN-5048).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 00:09:59 -07:00
gsxdsm
5191e1f22d FN-6911: defer Droid CLI startup probes
Defer Droid CLI validation and discovery so startup no longer spawns or hangs on droid.

- Register the Droid provider without boot-time validation or model discovery side effects.
- Trigger CLI validation only when a Droid stream starts and expose explicit model discovery.
- Add regression coverage for non-interactive droid process spawning and startup probe behavior.
- Add a patch changeset for the published Fusion CLI package.

Files changed:
 .changeset/fn-6911-droid-cli-no-boot-spawn.md      |  5 ++
 .../commands/__tests__/droid-cli-extension.test.ts | 15 +++-
 packages/droid-cli/index.ts                        | 33 ++++----
 packages/droid-cli/src/__tests__/index.test.ts     | 90 +++++++++-------------
 .../src/__tests__/discover-models.test.ts          |  7 +-
 .../src/__tests__/probe.test.ts                    |  8 ++
 .../src/__tests__/process-manager.test.ts          | 74 ++++++++++++++++++
 .../src/__tests__/startup-probes.test.ts           |  5 +-
 8 files changed, 160 insertions(+), 77 deletions(-)

Fusion-Task-Id: FN-6911

Fusion-Task-Lineage: ef4bc3df-bfe8-416a-b701-64f752faea30
2026-06-21 23:44:26 -07:00
gsxdsm
744ed098a5 feat(workspace): Phase C U1 — per-repo merge loop (landOneRepo + landWorkspaceTask)
Extracts the per-repo land mechanics out of runAiMerge's inline clean-room
closure into an exported landOneRepo(store, repoRootDir, branch, integrationBranch,
ctx): pre-merge prune (rooted at the sub-repo), the clean-room temp worktree,
mergeAndReview, landSquash, and the CAS concurrent-advance retry that advances ONE
local integration ref — no remote push. runAiMerge is rewired as the single-repo
caller (its task-global finalization unchanged); the merger-ai suite (56 tests)
stays green as the byte-for-byte oracle.

landWorkspaceTask loops a workspace task's acquired sub-repos (sorted keys),
re-resolving each repo's integration branch with the shared override stripped
({...settings, integrationBranch: undefined, baseBranch: undefined}) so each
sub-repo lands on its own origin/HEAD, calls landOneRepo per repo, and aggregates
repo-tagged results — land-as-you-go on each repo's LOCAL ref (D2/D5). It does NOT
finalize/move the task (finalize-once + landed-tracking + idempotent retry are U2).

Door routing (KTD2): the engine dispatch and the user-facing CLI `fn task merge`
+ dashboard merge doors route workspace tasks to landWorkspaceTask so manual merge
works; store.mergeTask, aiMergeTask, and the runAiMerge chokepoint guard keep
throwing WorkspaceTaskMergeError as defense-in-depth.

New two-repo fixture tests: both repos land + no-push assertion, per-repo
override-stripped resolution onto distinct branches, repo-B conflict partial land
(task not moved), defense-in-depth throws. Gate green: typecheck, lint, build,
test:gate (649+58).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 23:31:43 -07:00
gsxdsm
7240b77c67 fix(review): harden R7 workspace merge guard + deprecation warning (U0)
Applies ce-code-review (autofix) feedback — 5 reviewers, P1s corroborated.

F1 [P1, ×4 reviewers] Guard the merge chokepoint, not just the 4 doors. The
per-caller `getTask().catch(()=>null); if(t) assert` pattern failed open on a
transient read, and runAiMerge re-read the task unguarded — so a workspace
task could reach git work against the non-git root. Added a named
WorkspaceTaskMergeError and call assertNotWorkspaceTaskMerge inside runAiMerge
(the sole merge path) and the deprecated aiMergeTask body; door guards remain
as fast-fail defense-in-depth.

F2 [P1] The dispatch catch treated the guard throw as a merge failure and set
mergeRetries=MAX, permanently blocking manual retry. It now recognizes
WorkspaceTaskMergeError and parks without burning retries.

F3 [P2] Deprecation-warning test asserted toBeLessThanOrEqual(1) — vacuously
true on zero emissions. Now resets the per-project flag and asserts the
warning fires exactly once and not again on a second deterministic merge.

F6 [P2] The once-per-process warning flag suppressed the notice for all other
projects in a multi-project host; now keyed per project (Set by cwd).

F5/F7/F8 [P3] @deprecated propagated to the aiMergeTask barrel re-export; CLI
runTaskMerge guard moved inside the formatted try/catch; FNXC placeholder
timestamps corrected; test .at(-1) -> length index.

Documented as residual (deferred to master-plan U8, not bugs in U0's window):
self-healing auto-finalize + store.mergeTask are additional merge-completing
paths not hardened here — workspace tasks are not end-to-end runnable until
master-plan Phase A, and U8 makes self-healing workspace-aware.

Gate green: typecheck (29 projects), lint, build, test:gate (649+58),
affected tests (206+4).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 19:19:55 -07:00
gsxdsm
a6252e518d refactor(merger): unify on runAiMerge as the sole merge path (U0)
Make runAiMerge (the FN-5633 clean-room AI merge path, already the default)
the sole merge path; soft-deprecate the legacy aiMergeTask pipeline. Phase 0
of the workspace-mode master plan — a standalone merge-consolidation refactor
that lands first so downstream workspace work targets one merge function.

U1 — collapse the dispatch: project-engine.ts now calls runAiMerge
unconditionally; the two direct callers that bypassed the dispatch
(dashboard.ts onMergeImpl in --no-engine mode, task.ts runTaskMerge /
`fn task merge`) now route to runAiMerge too. Export runAiMerge from
@fusion/engine.

U2 — soft-deprecate: aiMergeTask is @deprecated (body retained for a later
deletion pass; shared helpers runAiMerge imports, e.g.
captureSingleCommitLandedMetadata, left intact). merger.mode "deterministic"
is annotated deprecated and made inert (type + field kept — published
@runfusion/fusion surface); the dispatch logs a one-time deprecation warning
and routes to runAiMerge. Changeset added (minor).

U3 — R7 workspace merge-boundary guard: shared @fusion/core predicate
assertNotWorkspaceTaskMerge(task) rejects tasks with populated
workspaceWorktrees at all four merge entry points (dispatch, store.mergeTask,
onMergeImpl, runTaskMerge) with an error naming master-plan U6. Covers the
window until per-repo merge support lands; U6 removes it.

U4 — deterministic-mode blast-radius audit: no production project, CI config,
or seeded setting pins merger.mode "deterministic"; only four engine tests
used it to drive the dispatch to aiMergeTask as a mockable seam — migrated to
mock runAiMerge instead. Other module-level aiMergeTask mocks were dead under
the default "ai" mode or test aiMergeTask directly (body retained), so they
are unaffected.

Also removes an unused acquireWorkspaceRepoWorktree import inherited from the
foundation branch (executor.ts) that was failing lint; master-plan U1 re-adds
it with its per-repo usage.

Merge gate green: lint, typecheck (29 projects), build, test:gate
(649 + 58), plus the migrated (114) and new predicate (4) tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 18:58:06 -07:00
MichaelHoughtonDeBox
8f4098e5b1 feat: add workspace mode foundation (multi-repo projects)
Allow registering a non-git parent directory that contains multiple git
repositories as a single Fusion project. The agent acquires per-repo
worktrees on demand via a new `fn_acquire_repo_worktree` tool as it
discovers it needs to work in each sub-repo.

This commit lays the foundation:
- detectWorkspaceRepos / loadWorkspaceConfig / saveWorkspaceConfig in
  @fusion/core (config persisted to .fusion/workspace.json)
- Task.workspaceWorktrees data model + store plumbing (per-repo
  worktree/branch map, distinct from the singular task.worktree)
- acquireWorkspaceRepoWorktree wraps acquireTaskWorktree per sub-repo,
  clearing the singular worktree/branch fields so each sub-repo gets a
  fresh worktree instead of resuming a sibling repo's worktree
- fn_acquire_repo_worktree agent tool + workspace prompt injection
- executor git-repository validation bypassed when a workspace config
  is present
- CLI `fn init` detects a non-git dir containing sub-repos and writes a
  workspace config

Known gap (intentionally left for design discussion, see PR): the
executor's main worktree-acquisition path still assumes a single git
root and is not yet workspace-aware. End-to-end execution (skipping the
root acquisition, per-repo merge, per-repo session scoping) is a
follow-on once the execution model is agreed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 22:04:37 +01:00
gsxdsm
d99246cb74 FN-6834: use OS-available memory for system metrics
Use shared OS-available memory readings so macOS cache/inactive pages are not counted as used.

- Add a core available-memory helper that prefers `process.availableMemory()` and flags `freemem` fallback reliability.
- Route core metrics, dashboard system stats, and the dashboard TUI through the shared helper.
- Move and expand memory tests across core, dashboard routes, and verification coverage while documenting the telemetry behavior.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/fix-macos-memory-used.md                |  5 ++
 docs/architecture.md                               |  2 +-
 docs/dashboard-guide.md                            |  2 +-
 .../__tests__/available-memory.test.ts             | 54 --------------
 .../cli/src/commands/dashboard-tui/controller.ts   | 37 +---------
 .../core/src/__tests__/available-memory.test.ts    | 83 ++++++++++++++++++++++
 packages/core/src/__tests__/system-metrics.test.ts | 36 +++++++++-
 packages/core/src/available-memory.ts              | 32 +++++++++
 packages/core/src/index.ts                         |  1 +
 packages/core/src/system-metrics.ts                |  9 ++-
 .../dashboard/src/__tests__/routes-system.test.ts  | 27 +++++++
 packages/dashboard/src/routes.ts                   |  7 +-
 .../src/__tests__/run-verification-command.test.ts | 18 +++++
 13 files changed, 218 insertions(+), 95 deletions(-)

Fusion-Task-Id: FN-6834

Fusion-Task-Lineage: 2e651551-6c35-46d1-b517-535758c7ace2
2026-06-21 13:32:19 -07:00