Commit Graph

2933 Commits

Author SHA1 Message Date
gsxdsm
3e0391eada FN-7267: expose MCP tools to planning sessions
Expose configured MCP session tools to read-only planning and mission lanes while keeping other read-only sessions locked down.

- Add an explicit allowMcpToolsInReadonly option to createFnAgent and apply it only to connected MCP tools.
- Opt planning, streaming planning, mission, milestone, and slice interview sessions into read-only MCP tools.
- Expand regression coverage for MCP forwarding, read-only filtering, and session tool disposal behavior.
- Document the read-only MCP opt-in model and add a published package changeset.

Files changed:
 .changeset/fn-7267-planning-mission-mcp.md         |  7 +++
 docs/mcp.md                                        |  4 +-
 .../src/__tests__/mcp-lane-forwarding.test.ts      |  4 ++
 .../dashboard/src/milestone-slice-interview.ts     |  4 ++
 packages/dashboard/src/mission-interview.ts        |  4 ++
 packages/dashboard/src/planning.ts                 |  4 ++
 .../src/__tests__/mcp-surface-coverage.test.ts     | 25 +++++++-
 .../src/__tests__/pi-create-fn-agent.test.ts       | 67 ++++++++++++++++++++++
 .../src/__tests__/pi-mcp-session-tools.test.ts     |  6 +-
 .../workflow-step-readonly-allowlist.test.ts       | 17 +++++-
 packages/engine/src/pi.ts                          | 17 +++++-
 packages/engine/src/workflow-step-tool-policy.ts   | 15 ++++-
 12 files changed, 163 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-7267

Fusion-Task-Lineage: 8d9cac1a-edcc-453d-bda1-9abb58de7f86

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 00:09:36 -07:00
gsxdsm
41ff08a158 fix(FN-7261): prevent premature fast workflow merges
Block the merge requester when fast workflow traversal reaches merge before implementation steps are complete, and recover stale no-op merge proof by requeuing executable work instead of looping in blocked finalization.

Fusion-Task-Id: FN-7261
2026-06-29 23:36:34 -07:00
gsxdsm
eb83c81ffb fix(FN-7265): align per-step review workflow 2026-06-29 23:25:17 -07:00
gsxdsm
cfd9d5b32e test(FN-7249): cover phantom worktree recovery 2026-06-29 22:30:23 -07:00
gsxdsm
9e23d6c403 fix(FN-7265): stop duplicate graph plan reviews 2026-06-29 22:29:22 -07:00
gsxdsm
5a6d110483 fix(engine): stop phantom-reservation audit churn and preserve worktree on phantom reclaim
reconcilePhantomCommittedReservations emitted a task:reconcile-phantom-committed-reservation audit row every maintenance tick for the same orphaned committed reservations even when zero child rows were pruned (~19k no-op writes/day). Gate the audit emission on actual pruned work; the FN-7069 contract is unchanged (committed reservation stays committed so the ID is never reused).

clearPhantomExecutorBinding unconditionally unregistered held worktree paths from activeSessionRegistry, defeating the moveTask(preserveWorktree:true) the self-healing phantom reclaim pairs it with: re-dispatch then acquired a brand-new worktree instead of reattaching (FN-7249 lost its first worktree this way). Add a preserveWorktrees option that clears only the stale in-memory executor/lock bookkeeping and leaves the session-registry path entries intact; the self-healing caller opts in. Non-self-healing callers keep the default full-clear behavior.
2026-06-29 21:56:14 -07:00
gsxdsm
095007c640 fix(FN-7262): honor step session setting 2026-06-29 21:51:13 -07:00
gsxdsm
09687f723c fix(FN-7261): confirm AI no-op merge finalization 2026-06-29 21:38:57 -07:00
gsxdsm
be9e231004 fix(FN-7248): skip completed steps on resume 2026-06-29 19:23:38 -07:00
gsxdsm
ed21597690 FN-7251: suppress missing skill-pattern info logs
Suppress non-actionable missing configured skill-pattern messages while preserving resolver diagnostics.

- Filter configured skill-pattern miss diagnostics out of pi runtime logging paths.
- Keep missing configured patterns available as resolver diagnostics for programmatic visibility.
- Cover direct skill resolution and fn-agent creation logging with regression tests.
- Add a patch changeset for the published Fusion CLI package.

Files changed:
 .../fn-7251-suppress-missing-skill-pattern-logs.md |  7 +++
 .../src/__tests__/pi-create-fn-agent.test.ts       | 21 ++++++---
 .../engine/src/__tests__/skill-resolver.test.ts    | 50 ++++++++++++++++++----
 packages/engine/src/pi.ts                          |  1 +
 packages/engine/src/skill-resolver.ts              | 13 ++++++
 5 files changed, 78 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-7251

Fusion-Task-Lineage: 3c61c349-f216-410b-9ead-24c310bb2415

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 19:17:37 -07:00
gsxdsm
9fd286b1d3 fix(FN-7242): keep code review remediation recovering 2026-06-29 18:41:43 -07:00
gsxdsm
90b62b7884 FN-7246: preserve explicit empty step dependencies
Preserve authored empty workflow step dependencies so parallel roots remain independent.

- Keep parser and TaskStep projections from dropping explicit empty dependsOn arrays.
- Treat missing dependsOn as the legacy previous-step fallback while allowing [] to mean no dependencies.
- Cover heading and JSON parsers plus parallel foreach scheduling with regression tests and docs.

Files changed:
 .changeset/fn-7246-workflow-depends-on-empty.md              |  7 +++++++
 docs/workflow-steps.md                                       |  4 ++--
 packages/core/src/__tests__/step-parsers.test.ts             |  8 ++++----
 packages/core/src/step-parsers.ts                            | 30 +++++++++++++++++++++---------
 packages/core/src/types.ts                                   | 13 +++++++++----
 packages/engine/src/__tests__/workflow-parse-steps.test.ts   | 12 ++++++++++++
 packages/engine/src/__tests__/workflow-step-parallel.test.ts | 30 +++++++++++++++++++++++++++++-
 packages/engine/src/workflow-graph-foreach.ts                |  9 +++++++--
 packages/engine/src/workflow-node-handlers.ts                |  6 +++++-
 9 files changed, 96 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-7246

Fusion-Task-Lineage: a75687fa-5711-4509-b60f-43669323a6c0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 18:05:44 -07:00
gsxdsm
6f2b8ab6e5 FN-7244: retry unavailable Plan Review without replanning
Preserve existing task specs when Plan Review retries after reviewer outages.

- Route plan-review-unavailable triage tasks through the Plan Review/finalization path instead of the planner.
- Validate existing PROMPT.md content and fail clearly when it is missing, empty, or invalid.
- Preserve retry status across interrupted triage work and cover retry behavior with engine tests.
- Document the retry lifecycle and add a patch changeset.

Files changed:
 .../fn-7244-plan-review-unavailable-retry.md       |   7 +
 docs/architecture.md                               |   2 +
 docs/workflow-steps.md                             |   2 +
 .../triage-plan-review-unavailable-retry.test.ts   | 251 +++++++++
 packages/engine/src/__tests__/triage.test.ts       | 604 +++++++++++++++++++++
 packages/engine/src/triage.ts                      | 108 +++-
 6 files changed, 945 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-7244

Fusion-Task-Lineage: 80e790e3-d2b9-4309-beec-3dbf6a03db39

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 17:40:00 -07:00
gsxdsm
72e50ac8c6 fix(artifacts): support task image artifact previews (#1821)
## Summary
Task image artifacts can now complete the full loop: agents and chat
flows can register base64 image bytes, and task details can display
those artifacts with an expandable preview instead of leaving them as
undiscoverable metadata.

This keeps binary payloads on the existing managed artifact storage
path, validates that base64 payloads are real non-empty image data, and
documents the new `dataBase64` field for engine-tool callers. The task
details artifacts gallery now treats image cards as expandable while
leaving document, audio, video, and generic artifact cards on their
existing behavior.

## Validation
- `pnpm --filter @fusion/dashboard exec vitest run
app/components/__tests__/TaskDocumentsTab.test.tsx
src/routes/__tests__/artifacts-route-integration.test.ts
--silent=passed-only --reporter=dot`
- `pnpm --filter @fusion/engine exec vitest run
src/__tests__/agent-artifact-tools.test.ts --silent=passed-only
--reporter=dot`

---

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


<!-- stage-review-badge-begin -->

---

<a href="https://stagereview.app/Runfusion/Fusion/pull/1821">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://stagereview.app/assets/gh-open-in-stage-dark.svg">
<img src="https://stagereview.app/assets/gh-open-in-stage-light.svg"
alt="Open in Stage">
  </picture>
</a>

<!-- stage-review-badge-end -->

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

* **New Features**
* Added inline base64 (`dataBase64`) support for registering image
artifacts from agent tools, including task-scoped chat registration.
* Task details now allow expanding image media artifacts in a preview
lightbox with accessible keyboard interaction.
* **Bug Fixes**
* Improved verification for media streaming by validating raw binary
responses; added HTTP 200/404 coverage for image endpoints.
* **Documentation**
* Updated `fn_artifact_register` tool documentation to include the
optional `dataBase64` parameter.
* **Tests**
* Added coverage for base64 validation/error handling and lightbox
expand/close behavior (including Escape and Tab focus trapping).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-29 17:33:50 -07:00
copilot-swe-agent[bot]
8544b5b08b fix(FN-7143): simplify base64 validation and improve error messages 2026-06-30 00:18:04 +00:00
Phil Larson
06b863ed2f fix: address external review checkout review feedback 2026-06-29 17:17:59 -07:00
Phil Larson
b829821dd9 fix(engine): review explicit external checkouts 2026-06-29 17:17:59 -07:00
copilot-swe-agent[bot]
1bf8d83bc1 Merge remote-tracking branch 'origin/main' into fusion/fn-7143 2026-06-30 00:14:37 +00:00
gsxdsm
d7f26bb6cf fix(FN-7219): stabilize compound engineering workflow 2026-06-29 16:42:11 -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
3886e585dd fix(FN-7143): show compound workflow node progress
Record skill-backed workflow nodes into workflowStepResults and teach task progress surfaces to include those graph-node records without re-showing disabled optional workflow checks.
2026-06-29 14:59:16 -07:00
gsxdsm
b26d8a6772 fix(FN-7143): address image artifact review feedback
- classify image artifact support as a minor feature changeset
- reject non-image, empty, and signature-mismatched dataBase64 payloads
- trap keyboard focus in the task image lightbox
- assert media streaming with raw image bytes

Fusion-Task-Id: FN-7143
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 14:59:07 -07:00
gsxdsm
a766813ed9 FN-7239: scope executor prompts and quarantine stale pause test
Scope missing executor prompts safely while keeping graph coverage aligned with the post-cutover workflow route.

- Treat absent executor prompts as empty before worktree path scoping.
- Update graph retry, parity, and smoke expectations for plan review, completion summary, and post-merge traversal.
- Quarantine only the stale executor-pause direct-dispatch suite with a ledger entry and engine-default exclude.

Files changed:
 .changeset/fn-7239-scope-prompt-guard.md           |  7 ++++
 .../engine/src/__tests__/executor-pause.test.ts    | 10 +++++
 .../src/__tests__/task-pipeline-smoke.test.ts      |  7 ++++
 .../workflow-graph-executor-parity.test.ts         | 15 ++++++-
 ...ow-graph-executor-retry-coding-workflow.test.ts | 48 +++++++++++++++++-----
 packages/engine/src/executor.ts                    | 15 ++++---
 packages/engine/vitest.config.ts                   |  5 +++
 scripts/lib/test-quarantine.json                   |  8 +++-
 8 files changed, 97 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-7239

Fusion-Task-Lineage: 9382e4e0-7cfc-416a-93e8-6ba1c7cd7879

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 14:17:29 -07:00
gsxdsm
41c0cf3603 fix(FN-7235): scope workflow remediation recovery
Keep merge finalization from stranding scoped workflow tasks on out-of-scope branch residue, move built-in optional gate remediation attempts into workflow config, and guard review remediation against out-of-scope fixes.

Also covers FN-7236 review-remediation scope drift.
2026-06-29 14:00:32 -07:00
gsxdsm
50f8807037 fix(FN-7233): persist workflow transition notifications
Store workflow transition notification markers as durable task state so recovery alerts do not depend on human-readable log text.
2026-06-29 12:40:00 -07:00
gsxdsm
e09d45037f fix(FN-7233): move workflow lifecycle policy into nodes 2026-06-29 12:23:20 -07:00
gsxdsm
24d78816a0 fix(FN-7233): route workflow reviews through remediation nodes 2026-06-29 11:24:41 -07:00
gsxdsm
b169072224 fix(FN-7233): enforce workflow summary and done guards 2026-06-29 11:07:11 -07:00
gsxdsm
2135bd653d fix(FN-7228): record workflow completion summaries 2026-06-29 10:32:51 -07:00
gsxdsm
2b73a0a238 FN-7228: add task pipeline smoke and plan review retry
Add engine coverage for the default task pipeline while preserving accepted plans during Plan Review retries.

- Add a deterministic engine-core smoke test for the minimal builtin:coding task pipeline.
- Reuse existing PROMPT.md when retrying plan-review-unavailable tasks instead of replanning them.
- Cover missing-PROMPT retry failure handling and workflow parity ordering.
- Add a patch changeset for the Plan Review retry behavior.

Files changed:
 .changeset/fn-7228-plan-review-retry.md            |   7 ++
 .../src/__tests__/task-pipeline-smoke.test.ts      | 140 +++++++++++++++++++++
 packages/engine/src/__tests__/triage.test.ts       |  47 +++++++
 .../workflow-graph-executor-parity.test.ts         |   6 +-
 packages/engine/src/triage.ts                      |  49 +++++++-
 packages/engine/vitest.config.ts                   |   5 +
 6 files changed, 252 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-7228

Fusion-Task-Lineage: e61ba4aa-6d96-4413-9048-9eeaf9ea95b5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 10:21:29 -07:00
gsxdsm
6239b2acb3 fix(FN-7228): make built-in code review blocking 2026-06-29 10:16:17 -07:00
gsxdsm
6fc50d8d9e fix(FN-7232): enforce workflow merge boundary 2026-06-29 10:05:49 -07:00
gsxdsm
353aaf3b4a fix(FN-7143): support task image artifacts
Fusion-Task-Id: FN-7143
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 09:47:59 -07:00
gsxdsm
123639c89f fix(FN-7231): require current workflow merge proof 2026-06-29 09:28:02 -07:00
gsxdsm
875cfad136 fix(FN-7231): require merge proof before workflow done 2026-06-29 09:01:00 -07:00
gsxdsm
4184062288 fix(FN-7224): notify workflow graph task flows
Fusion-Task-Id: FN-7224
2026-06-29 08:49:59 -07:00
gsxdsm
8b20f3458e fix(FN-7224): address workflow code review findings
Fusion-Task-Id: FN-7224
2026-06-29 08:36:07 -07:00
gsxdsm
57d8065778 fix(FN-7224): let workflow nodes own worktree prep
Classify write-capable graph nodes before handler dispatch and let executor adapters fulfill the declared worktree requirement, keeping custom-node execution out of lifecycle decision making.

Fusion-Task-Id: FN-7224
2026-06-29 08:22:49 -07:00
gsxdsm
cb94fc8451 fix(FN-7224): make workflow graph replay idempotent
Move completed-step replay and proven-merge finalization into workflow-owned execution paths so graph restarts continue from live task projection instead of failing stale step nodes.

Fusion-Task-Id: FN-7224
2026-06-29 08:15:32 -07:00
gsxdsm
05c54fbe29 fix(FN-7228): complete workflow recovery after reviews pass
Fusion-Task-Id: FN-7228
2026-06-29 04:12:13 -07:00
gsxdsm
c088f8a412 fix(FN-7228): preserve plan review status during execution 2026-06-29 03:40:43 -07:00
gsxdsm
984e36255d fix(FN-7229): stop parking execution errors in review 2026-06-29 03:33:18 -07:00
gsxdsm
f430f5db39 fix(FN-7228): respect workflow step dependencies 2026-06-29 03:23:01 -07:00
gsxdsm
50ccd79b9f fix(FN-7226): land graph step-session commits 2026-06-29 03:15:30 -07:00
gsxdsm
399a4a2a5f fix(FN-7226): use graph projection for step sessions 2026-06-29 03:09:43 -07:00
gsxdsm
1efcdcfe35 fix(FN-7224): clear stale graph pins on reset 2026-06-29 02:55:35 -07:00
gsxdsm
36d090c326 fix(FN-7225): keep plan review in triage 2026-06-29 02:47:17 -07:00
gsxdsm
c93217dee0 fix(FN-7225): honor plan review approvals in workflows
Fusion-Task-Id: FN-7225
2026-06-29 02:08:08 -07:00
gsxdsm
998a7f2745 fix(FN-7226): make plan review the single pre-execution gate
Fusion-Task-Id: FN-7226
2026-06-29 01:48:27 -07:00
gsxdsm
1d21241725 fix(FN-7225): auto-retry stale parse pause aborts 2026-06-29 01:13:31 -07:00