Commit Graph

13404 Commits

Author SHA1 Message Date
gsxdsm
fd68bb1bea fix: model-target chats 404, and worktree rmdir races misreported as branch conflicts
Two unrelated production failures with a shared symptom of an opaque error.

Chat: FN-8869 hoisted the agent-existence check out of its else branch, so it ran
even when the client supplied an explicit model pair. Model-target chats send the
client-only sentinel `__fn_agent__`, which is never an agent row, so every one of
them 404'd behind the generic "Failed to create chat session" toast. The agent is
now required only when it is the source of model resolution.

Self-healing: a failed `tip-already-merged` cleanup was rethrown and classified
`branch-conflict-unrecoverable`, failing and pausing tasks whose branch was already
an ancestor of the integration ref. Every one of the 78 logged parks carried a
`git worktree remove --force` / `ENOTEMPTY rmdir node_modules` message -- a pnpm
race, not a conflict. Cleanup failure now retries on the next sweep, and prune runs
before removal so a stale registration stops causing the failure it would prevent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 02:39:56 -07:00
gsxdsm
06ea444339 fix: uncap workflow principals and auto-resume stranded continuations
Two independent wedges kept cards silently stuck on the board.

1. Workflow principals were capped. `WorkflowAgentCapacity.acquire` enforced
   `settings.maxConcurrent` as a project session budget plus an optional
   per-agent `maxWorkflowSessions`, and `routeWorkflowPrincipal`'s availability
   test applied the same per-agent ceiling. The workflow roles stand in for
   STAGES, not workers, and there is typically one agent per role - so the cap
   serialized the entire board behind a single Workflow Executor regardless of
   maxConcurrent/maxWorktrees. Admission now always succeeds; the lease survives
   as bookkeeping (it is what activeSessions counts and what the renewal timer
   keeps warm). `maxProjectSessions` is removed from the input rather than
   defaulted, so it cannot be reintroduced without deleting the contract, and
   the agent-capacity re-route loops in triage and graph admission are deleted
   with the refusal they existed to work around.

2. Continuations that stop in `running` or `held` were never re-polled. The
   scheduler's due-poll takes only `runnable`/`retrying`; a row claimed through
   a path that leaves `leaseExpiresAt` NULL keeps `state: "running"` forever
   after its process dies, and `acquireWorkflowWorkItemLease` can only re-take a
   `held` row whose blockedReason matches workflow-principal-%. Observed live:
   seven cards `running` behind leases from a process that exited ~9h earlier,
   two `held` with a NULL blockedReason for 46h, none emitting a single
   run-audit row while stranded. A further 33 active-state rows belonged to
   archived+soft-deleted tasks (the FK cascade only fires on hard delete).

   New sweep `reconcileStrandedWorkflowContinuations` (startup + periodic)
   re-queues both stranded shapes and retires dead tasks' rows, gated by the
   canonical liveness triple, a 10-minute grace matching the capacity lease
   duration, and a compare-and-set on the scanned state so a real claim wins.
   The decision is the pure `evaluateStrandedContinuationReclaim`, shared with
   its tests so coverage cannot drift from behavior - the drift that let the
   FN-8923 sweep ship covering one ninth of this problem.

Verified: pnpm lint, engine typecheck, pnpm test:gate (606 tests), verify:fast,
and the new suite under mutation (removing either guard fails 3 cases). The two
pre-existing failures in self-healing-orphaned-pending-step-results.test.ts
reproduce identically at HEAD without these changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 02:02:51 -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
7ddcf7e2a6 FN-8979: remove legacy mission resume blockers
Retire the deprecated v0 mission-resume blocker payload in favor of canonical descriptors.

- Remove legacy blocker types, conversions, exports, and HTTP payload mirrors.
- Deduplicate canonical blocker descriptors and update clients, tests, and documentation.
- Add a major changeset for the breaking API removal.

Files changed:
 .changeset/fn-8979-removal.md                      |  7 +++++
 docs/missions.md                                   |  4 +--
 .../suite-only-flakes-observed-register.md         | 14 +++++++++
 .../src/__tests__/mission-blocked-clear.test.ts    | 23 ++++++++++++++-
 .../core/src/__tests__/mission-blockers.test.ts    | 26 +++++++++++------
 .../__tests__/postgres/mission-store.pg.test.ts    |  5 +---
 .../core/src/async-stores/async-mission-store.ts   |  7 +----
 packages/core/src/index.gate.ts                    |  3 +-
 packages/core/src/index.ts                         |  3 +-
 packages/core/src/missions/mission-blockers.ts     | 34 +++++++++++++---------
 packages/core/src/missions/mission-types.ts        |  9 ++----
 packages/core/src/types.ts                         |  2 +-
 packages/dashboard/app/api/missions/missions.ts    | 25 +++++-----------
 .../MissionManager.blocked-repair.test.tsx         | 17 +++++++----
 .../MissionManager.resume-conflict.test.tsx        |  9 ++++--
 .../src/__tests__/mission-resume-conflict.test.ts  | 11 ++++---
 packages/dashboard/src/mission-routes.ts           | 10 +++----
 17 files changed, 127 insertions(+), 82 deletions(-)

Fusion-Task-Id: FN-8979
Fusion-Task-Lineage: 2a0dd0b6-43ca-44ad-b992-79f4ef8eda67
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 01:30:04 -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
3eec1338c5 FN-8970: add mission reconcile controls
Add a dry-run mission reconciliation control with explicit apply feedback.

- Add the dashboard reconcile API client and exported result type.
- Present preview, apply, empty, and archived reconciliation states in Mission Manager.
- Guard reconcile requests across direct selection and target-mission deep-link changes.
- Cover reconcile interactions, stale requests, and deep-link intent updates.

Files changed:
 .changeset/fn-8970-mission-reconcile-control.md    |   7 +
 docs/missions.md                                   |   6 +
 packages/dashboard/app/api/legacy.ts               |   2 +
 packages/dashboard/app/api/missions/missions.ts    |  31 +++
 packages/dashboard/app/components/MissionManager.css    |  48 +++++
 packages/dashboard/app/components/MissionManager.tsx    | 184 +++++++++++++-
 packages/dashboard/app/components/__tests__/MissionManager.mobile-css.test.ts    |   8 +
 packages/dashboard/app/components/__tests__/MissionManager.reconcile.test.tsx    | 277 +++++++++++++++++++++
 8 files changed, 557 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-8970

Fusion-Task-Lineage: 62802129-a7ea-43cb-8068-5ce2c2c21b77

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 00:23:10 -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
844512ed3e FN-8976: prevent concurrent automatic validator runs
Prevent automatic validation from running alongside a fresh manual or non-memoized validator.

- Serialize validator admission around a feature-scoped fresh-running check.

- Report feature-versus-fingerprint blocking scope and preserve memoization semantics.

- Add regression coverage, documentation, and a patch changeset.

Files changed:

 .changeset/fn-8976-validator-admission.md          |   7 ++
 docs/missions.md                                   |   4 +-
 .../__tests__/postgres/mission-store.pg.test.ts    | 110 +++++++++++++++++++--
 .../core/src/async-stores/async-mission-store.ts   |  61 ++++++++++--
 packages/core/src/missions/mission-types.ts        |   2 +
 .../src/__tests__/mission-execution-loop.test.ts   |  10 +-
 6 files changed, 171 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-8976
Fusion-Task-Lineage: 61b487e8-5542-4cce-94f7-58d5295fe177
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 22:57:21 -07:00
gsxdsm
918a4c4bfa FN-8973: add versioned mission resume blockers
Expose versioned mission resume blockers across API and UI.

- Add versioned blocker descriptors with fail-closed legacy normalization and v0 compatibility projections.
- Return typed resume-conflict envelopes and render root stop details in Mission Manager.
- Cover descriptor behavior, route conflicts, UI handling, and PostgreSQL persistence.

Files changed:
 .changeset/fn-8973-mission-blocker-descriptor.md   |  7 ++
 docs/missions.md                                   |  2 +-
 .../src/__tests__/mission-blocked-clear.test.ts    | 18 ++---
 .../core/src/__tests__/mission-blockers.test.ts    | 43 ++++++++++++
 .../__tests__/postgres/mission-store.pg.test.ts    | 22 ++++--
 .../core/src/async-stores/async-mission-store.ts   | 23 +++---
 packages/core/src/index.gate.ts                    |  4 ++
 packages/core/src/index.ts                         |  4 ++
 packages/core/src/missions/mission-blockers.ts     | 43 ++++++++++++
 packages/core/src/missions/mission-types.ts        | 81 ++++++++++------------
 packages/core/src/types.ts                         |  4 +-
 packages/dashboard/app/api/legacy.ts               |  1 +
 packages/dashboard/app/api/missions/missions.ts    | 46 +++++++-----
 .../dashboard/app/components/MissionManager.tsx    | 11 +--
 .../MissionManager.blocked-repair.test.tsx         | 10 +--
 .../MissionManager.resume-conflict.test.tsx        | 24 +++++++
 .../__tests__/mission-blocked-clear-routes.test.ts |  2 +-
 .../src/__tests__/mission-resume-conflict.test.ts  | 42 +++++++++++
 packages/dashboard/src/mission-routes.ts           | 12 +++-
 19 files changed, 297 insertions(+), 102 deletions(-)

Fusion-Task-Id: FN-8973
Fusion-Task-Lineage: 5d36c9c9-dc0f-4cb0-bd0c-ad41c8dde5c0
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 22:36:01 -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
9571f73666 FN-8972: preserve blocked mission status during rollups
Protect explicitly blocked or archived hierarchy statuses from automatic recomputation.

- Restrict mission and milestone rollups to statuses they own.
- Make asynchronous recomputations transactional and preserve status events.
- Cover guarded rollups in SQLite and PostgreSQL tests.

Files changed:
 .../fn-8972-mission-recompute-blocked-guard.md     |   7 ++
 docs/missions.md                                   |   2 +
 .../mission-status-recompute-guard.test.ts         |  85 +++++++++++++++++
 .../__tests__/postgres/mission-store.pg.test.ts    | 105 +++++++++++++++++++++
 .../core/src/async-stores/async-mission-store.ts   |  67 +++++++++++--
 packages/core/src/missions/mission-store.ts        |  12 ++-
 packages/core/src/missions/mission-types.ts        |  21 +++++
 7 files changed, 286 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-8972

Fusion-Task-Lineage: 07ede656-dec0-4d3e-b35c-06e0f6304b74

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 22:03:57 -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
90573e31b0 FN-8963: prevent concurrent mission validation runs
Prevent duplicate manual validation runs while preserving recovery from stale validator state.

- Add atomic mission-store claims and release handling for manual validator runs.
- Return a conflict response and disable the validation action while a run is active.
- Cover concurrent claims, API behavior, UI state, and stale-window parity.

Files changed:
 .changeset/fn-8963-validate-inflight-guard.md      |   7 ++
 docs/missions.md                                   |   2 +
 .../__tests__/postgres/mission-store.pg.test.ts    | 129 +++++++++++++++++++++
 .../core/src/async-stores/async-mission-store.ts   |  87 ++++++++++++--
 packages/core/src/index.ts                         |   2 +
 packages/core/src/missions/mission-store.ts        |  69 ++++++++++-
 packages/core/src/missions/mission-types.ts        |  13 +++
 packages/dashboard/app/api/legacy.ts               |   2 +
 packages/dashboard/app/api/missions/missions.ts    |  11 +-
 .../dashboard/app/components/MissionManager.tsx    |  15 ++-
 .../MissionManager.validate-inflight.test.tsx      |  77 ++++++++++++
 .../mission-validate-inflight-guard.test.ts        |  55 +++++++++
 packages/dashboard/src/mission-routes.ts           |  32 +---
 .../src/__tests__/mission-execution-loop.test.ts   |  61 +++++++++-
 .../validator-run-stale-window-parity.test.ts      |   9 ++
 15 files changed, 549 insertions(+), 22 deletions(-)

Fusion-Task-Id: FN-8963
Fusion-Task-Lineage: 7e5d0ae4-98ac-4f79-99ca-45fd1450362d
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 21:41:47 -07:00
gsxdsm
5dd3031e34 FN-8962: add mission blocked status repair controls
Add explicit diagnostics and repair paths for stale mission blocked badges.

- Expose audited core and REST APIs that recompute and clear stale mission blocked status without resuming automation.
- Add mission-manager controls, blocker diagnostics, responsive styling, and operator documentation.
- Cover clear conflicts, persistence, routes, and desktop/mobile UI behavior.

Files changed: .changeset/fn-8962-mission-blocked-clear.md        |   7 ++
 docs/missions.md                                   |  12 ++-
 .../src/__tests__/mission-blocked-clear.test.ts    |  40 ++++++++
 .../__tests__/postgres/mission-store.pg.test.ts    |  71 ++++++++++++++
 .../core/src/async-stores/async-mission-store.ts   |  90 +++++++++++++++--
 packages/core/src/index.gate.ts                    |   4 +
 packages/core/src/index.ts                         |   5 +-
 packages/core/src/missions/mission-types.ts        |  62 ++++++++++++
 packages/dashboard/app/api/legacy.ts               |   3 +
 packages/dashboard/app/api/missions/missions.ts    |  29 ++++++
 .../dashboard/app/components/MissionManager.css    |   6 ++
 .../dashboard/app/components/MissionManager.tsx    |  90 ++++++++++++++++-
 .../MissionManager.blocked-repair.test.tsx         | 106 +++++++++++++++++++++
 .../__tests__/MissionManager.mobile-css.test.ts    |   8 ++
 .../__tests__/mission-blocked-clear-routes.test.ts |  71 ++++++++++++++
 packages/dashboard/src/mission-routes.ts           |  49 ++++++++++
 16 files changed, 638 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-8962

Fusion-Task-Lineage: 38cab277-a0c3-4c60-af3e-dd25d2f88dea

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 20:41:11 -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
33d4fa46c5 FN-8969: fix plan evidence version collisions
Prevent plan writes from permanently failing when durable and snapshot evidence versions diverge.

- Centralize conflict-tolerant plan-evidence appends with durable version allocation
- Reuse the helper for prompt, lineage, and project evidence writes
- Cover version drift, retry, deduplication, and concurrent PostgreSQL writes

Files changed:
 .../fn-8969-plan-evidence-version-collision.md     |  7 ++
 .../__tests__/plan-evidence-next-version.test.ts   | 49 ++++++++++++++
 .../plan-evidence-version-collision.pg.test.ts     | 72 ++++++++++++++++++++
 packages/core/src/store.ts                         | 40 ++++++-----
 .../core/src/task-store/async/async-lifecycle.ts   | 49 +++++++-------
 packages/core/src/task-store/plan-evidence.ts      | 77 ++++++++++++++++++++++
 packages/core/src/task-store/project-store-ops.ts  | 47 +++++++------
 7 files changed, 276 insertions(+), 65 deletions(-)

Fusion-Task-Id: FN-8969

Fusion-Task-Lineage: 5fba0bc8-bcf6-42ea-b617-3484919ed2fa

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 19:43:13 -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
4c9f14e21a FN-8965: restore explicit intake owner routing
Restore deliberate engineer and authorized override assignments while preserving executor-only automatic routing.

- Accept eligible engineers as explicit intake owners through normal and reserved-ID task creation.
- Honor metadata-authorized role overrides without weakening runtime, state, or assignment-policy gates.
- Add resolver and PostgreSQL coverage plus release and architecture documentation.

Files changed:
 .../fn-8965-intake-owner-explicit-routing.md       |  7 +++
 docs/architecture.md                               |  2 +-
 .../postgres/create-task-reserved-id.pg.test.ts    | 29 ++++++++++++
 .../__tests__/task-intake-owner-resolver.test.ts   | 51 ++++++++++++++++++++--
 packages/core/src/task-store/task-creation.ts      |  7 +++
 .../core/src/tasks/task-intake-owner-resolver.ts   | 38 ++++++++++++----
 6 files changed, 121 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-8965

Fusion-Task-Lineage: 4ecf7fc8-e966-49c8-abf6-e50ae26d8224

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 19:31:21 -07:00
ischindl
f775039f5b feat(engine): add typed delivery-pipeline run-audit catalogue (#3410)
## What
Adds a typed, queryable catalogue for engine run-audit events as the
first step of the delivery-pipeline reliability & observability effort.

- **New module** `packages/engine/src/run-audit/run-audit-catalogue.ts`
— a typed registry describing run-audit event kinds (scheduler,
self-healing, merger, worktree, symbol-lock, …) so pipeline
observability can ingest and reason about them consistently.
- **Parity test** `run-audit-catalogue.test.ts` — asserts the catalogue
matches the emitted run-audit event space.
- **Docs** `docs/run-audit.md` + index pointer.

## Why
Run-audit events are currently emitted ad-hoc without a typed contract.
A catalogue gives:
- a single source of truth for event kinds/names,
- a parity guard so any new or renamed event is caught,
- a foundation for delivery-pipeline reliability dashboards.

## Verification
- `@fusion/engine` `tsc` build → **PASS**
- `vitest run run-audit-catalogue.test.ts` → **3 tests passed**
- No production behavior change outside the new module.

## Scope
New isolated module + its test + docs. No changesets/release artifacts.

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

* **Documentation**
* Added a run-audit catalogue covering delivery-pipeline finalization,
self-healing reconciliation, and durable-agent error events.
* Documented recorded outcomes, emission conditions, audit-store
querying, and event catalogue maintenance.
  * Added a documentation index entry linking to the new catalogue.
* **Tests**
* Added validation to ensure documented audit events remain complete,
consistently formatted, and synchronized with the supported event
catalogue.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-08-10 15:19:43 -10:00
gsxdsm
8c055a6695 fix: keep self-healing sweeps alive across stale task links (#3417)
## Summary
Supersedes #3405 — the fork head is not writable from maintainers, so
this branch carries the same fix rebased/merged onto current `main`.

## Conflict resolution
- Main already landed the equivalent fail-open path as **FN-8919**
(`readLinkedTaskOrUndefined` + per-agent try/catch).
- Kept the additional `recoverAgentsRunningOnInactiveTasks` regression
that covers task-gone races plus transient lookup isolation.
- Dropped the duplicate changeset (main already has
`fn-8919-agent-link-sweep-fail-open`).

## Test plan
- [x] `git merge-tree` clean against `main`
- [ ] CI green

Closes context from #3405.

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

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved recovery handling when task lookups fail.
* Agents linked to deleted or missing tasks are now unlinked, while
agents affected by temporary errors remain preserved.
* Recovery continues for other eligible agents instead of stopping after
an individual lookup failure.

* **Tests**
* Added regression coverage for deleted, missing, and temporarily
unavailable tasks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Codex <codex@openai.com>
2026-08-10 15:19:08 -10:00
gsxdsm
d749a11a5b FN-8923: document orphan merge durable-write fences
Record the bounded cancellation frontier for orphaned AI merge bodies.

- Add AST-derived durable-writer inventory and drift guard for the pinned merge closure.
- Characterize orphan and successor merge-lane writes with production-path fixtures.
- Document unresolved follow-ups and link the fence from the architecture guide.

Files changed:
 docs/architecture.md                               |    2 +-
 .../merge-orphan-body-durable-write-fences.md      |   92 +
 .../__tests__/_merge-durable-write-callsites.ts    |  938 ++
 .../merge-orphan-durable-write-inventory.json      | 9965 ++++++++++++++++++++
 .../merge-orphan-body-durable-writes.test.ts       |  348 +
 ...ge-orphan-durable-write-inventory-drift.test.ts |   56 +
 packages/engine/src/merge/merger-ai.ts             |    6 +
 packages/engine/src/project-engine.ts              |    6 +
 8 files changed, 11412 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8923

Fusion-Task-Lineage: 5b2d278c-1626-439a-affd-077f2de2aef1

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 17:55:46 -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
a1b56f11e3 test(dashboard): flush SettingsModal auto-save debounce with fake timers
Convert the SettingsModal.general 'saves X via settings payload' tests from
real-timer waitFor (each burning a real ~500ms auto-save debounce) to the
FN-7506 fake-timer pattern already used by the auto-save tests in this file.
Payload-routing/coalescing assertions are unchanged; only the artificial
wall-clock wait is removed (Standing Rule: prefer fake timers over real time
waits). Isolated test-execution time drops ~21.7s -> ~15.0s (82 tests, all
green across repeated runs).
2026-08-10 17:50:26 -07:00
ischindl
8cba8d3e92 fix(core): make TaskStore.emit override assignable to EventEmitter<TaskStoreEvents> signature (#3407)
## Problem
Dashboard typecheck fails with **TS2416** in `@fusion/core`'s
`TaskStore`:

```
Property 'emit' in type 'TaskStore' is not assignable to the same property in base type 'EventEmitter<TaskStoreEvents>'.
```

The `override emit<E extends string | symbol>(event, ...args)` generic
conflicts with the base class's generic `emit<K>(eventName: keyof
TaskStoreEvents | K, ...)`. This breaks the dashboard typecheck / CI
merge gate.

## Fix
Change the override to:

```ts
override emit(event: unknown, ...args: any[]): boolean {
  return EventEmitter.prototype.emit.call(this, event as string, ...args);
}
```

`event: unknown` remains assignable to the base's generic signature
while still forwarding non-typed runtime keys (`agent:log`,
`settings:updated`, …). Internal `EventEmitter.prototype.emit` calls
cast `event as string`. Behavior-preserving.

## Verification
- `@fusion/dashboard` `tsc --noEmit` → **PASS** (previously failed with
TS2416)
- `eslint` on touched file → clean
- Single-file change (`packages/core/src/store.ts`, +6/−3)

## Scope
No behavior change, no changesets required.

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

* **Bug Fixes**
* Improved task event handling to support a broader range of event
identifiers.
* Preserved cached-lane information for single-argument task update
events.
* Maintained support for custom and arbitrary event names without
disrupting existing behavior.
* Improved classification of workflow roles, session purposes, and
outcome-related status checks in lifecycle analysis, producing more
accurate findings and reducing misleading results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-10 14:10:26 -10: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
55fd20e5f8 fix(engine): bound spec-drift reconciliation so boot cannot exhaust the connection pool
Fusion wedged on "starting" and never brought the engine up. The dashboard bound
the migration holding server on 4040, then every query behind it failed with
"sorry, too many clients already", so the card never progressed and the
supervisor crash-looped.

Root cause: each spec-drift reconcile costs a DEDICATED PostgreSQL connection.
persist -> appendSpecDriftReport -> withPlanningLifecycleLock opens its own
postgres(directUrl, { max: 1 }) session, because the planning advisory lock is
session-scoped and deliberately fences a stale report against a newer plan.

enqueue() released every id straight into its own microtask, and project-engine
enqueues every task at runtime-boundary setup (listTasks includeArchived). On a
1,082-task project that opened ~1,082 lock sessions simultaneously against
max_connections = 500. The cluster saturated ~25s into boot and stayed saturated.

The flat 1s retry then made it self-sustaining rather than transient: once
saturated, every task failed for the same shared reason and re-armed in lockstep
once per second, re-opening the whole fleet of sessions and pinning the very
resource it was waiting on. Measured 4,777 lock sessions in 17 seconds.

Fix, contained to the reconciler — the advisory lock and its fencing semantics
are load-bearing and unchanged:
- concurrency bound (maxConcurrent, default 4) drained by a fair
  insertion-ordered pump, so fan-out can no longer exceed a known connection cost
- per-task in-flight dedupe; two passes on one task would contend on that task's
  own advisory lock while holding two connections
- exponential backoff with jitter capped at 60s, and retries re-enter through
  enqueue so a retry storm is bounded by the same limit as a first pass

Verified against the real 1,082-task project: connections stay flat at 3-10
across a 70s boot that previously reached 1,109 and saturated, and the engine
boots through to executing tasks and shuts down cleanly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 16:44:19 -07:00
gsxdsm
67cdb33a92 chore: gitignore the knowledge-graph build artifact
`.fusion-knowledge/` is `fn knowledge-graph build` output (FN-8920 memory epic):
~85MB of generated JSON, rewritten on every build. edges.json alone is 43MB,
past GitHub's 50MB warning threshold.

It is deterministic and fully regenerable from source — the manifest's SHA-256
fingerprints drive incremental rebuilds — so tracking it preserves nothing a
rebuild cannot reproduce, while adding irreversible, compounding history bloat to
every clone and CI checkout.

docs/knowledge-graph.md previously left this to the operator ("it is not
ignored"); that guidance is updated here so the doc and .gitignore agree. An
operator who explicitly wants a snapshot in history can still force one with
`git add -f .fusion-knowledge/graph`.

Nothing under the path was ever tracked, so no index purge is needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 13:49:37 -07:00
gsxdsm
7b3bd75268 fix(engine): wire the Plan Review replan cap and tombstone its dead predecessor
Investigating the "dead cap" turned up the opposite of what it looked like, plus a
worse problem next to it.

The Plan Review replan loop was NOT unbounded. U3 re-owned the cap-park in the
graph: requestPreMergeOptionalStepFix parks via parkPlanReviewReplanCapExhausted
at awaiting-approval with reason plan-review-replan-cap, on both an explicit
finite budget and the unbounded default. That capability has been live throughout.

What was actually dead:

1. PLAN_REVIEW_GATE_REPLAN_CAP = 8 — an unread constant belonging to the
out-of-graph triage gate (runPlanReviewBeforeExecution) that U10/R4 deleted. Its
companion column Task.planReviewReplanCount was persisted, serialized and reset
but never incremented or compared. A constant and a column that look like a live
safety ceiling while enforcing nothing are worse than no ceiling: they answer "is
this loop bounded?" with a confident yes. Deleted, ratcheted in
legacy-tombstones.test.ts, and the column documented as legacy/never-written with
the live owner named.

2. planReviewReplanCap — an operator-facing setting, declared, validated,
documented in settings-reference.md and editable in the Workflow Editor, that
NOTHING read. Lowering it changed nothing. The unbounded backstop was instead
hardcoded to PLAN_REVIEW_FEEDBACK_HISTORY_LIMIT — a bound on how much reviewer
PROSE is replayed into the next planning prompt, whose own comment says it is
"bounded independently of persistence and retry accounting". Two unrelated
concerns shared one number, so trimming prompt history would have silently
tightened a safety ceiling.

The backstop now resolves from the setting, defaulting to the new
DEFAULT_PLAN_REVIEW_REPLAN_CAP = 15 — the previously-effective value, so this is a
pure re-wiring rather than a silent behavior change. The existing 15-attempt
regression test passes unchanged, which is the evidence for that. 0 is honored as
park-on-first-REVISE. An explicit planReviewMaxRevisions / node maxRevisions
budget remains a stricter, earlier gate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 13:39:55 -07:00
gsxdsm
c05d44d44a fix(engine): bound planning retries and cap the planning turn
Three changes to the triage planning path.

1. Unclassified planning failures are bounded. specifyTask's catch-all branch —
the one reached by every error the classifiers above do not recognize — restored
the card's claimable status and wrote nothing else: no counter, no
nextRecoveryAt, no park. Triage rediscovery re-admitted the card on the very next
poll, and replaceActiveTaskWorkflowContinuation replaced the terminal work item
with a fresh one carrying no attempt count, so nothing recorded that the task had
already failed N times. It now consumes the same recoveryRetryCount/nextRecoveryAt
budget the transient branch uses (MAX_RECOVERY_RETRIES = 3, 60s/120s/300s jittered
backoff) and parks status:"failed" with a PLANNING_FAILED_EXHAUSTED: error once
spent — status:"failed" is what suppresses rediscovery. Classifying one error
string fixes one symptom; this budget is what makes the NEXT unrecognized error
fail safely instead of looping for a day.

2. The planning turn has a ceiling. Fusion set no timeout on it at all:
workflowStepTimeoutMs covers pre-merge workflow steps only, and the provider SDK's
300s APIConnectionTimeoutError caps time-to-first-byte and is cleared once headers
arrive, after which the stream is uncapped. configureHttpDispatcher, which would
install undici idle timeouts, is only called from pi's CLI entrypoints and never
in the in-process engine. Observed consequence: single attempts ran to 126 minutes,
with failed-attempt durations spread smoothly from 1 to 126 min and no clustering —
the signature of nothing enforcing a bound. New workflow-native planningTimeoutMs
(default 90 min) aborts the session; the failure consumes one bounded attempt.

The default is deliberately generous rather than tight. Successful planning work
items measured over 7 days ran p50 12.7 / p90 39.5 / p99 105.7 minutes, so a
tighter bound would abort legitimate plans and pay for the restart — the churn
this work exists to remove. It bounds hung turns, not slow ones.

3. [event:task:moved] executor tracing dropped from log to debug. It fires on
every dispatch, rebound, requeue, archive and self-healing move across every task,
which made it the loudest line in engine output and buried operator-actionable
events. No test pins the level; the information remains at debug.

Also fixes a test break shipped in 963dba6f80: the review blocking-severity
settings landed inside BUILTIN_REVIEW_REVISION_SETTINGS, whose contents
builtin-workflow-settings-triage.test.ts asserts exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 13:27:10 -07:00
gsxdsm
e0af6ddd93 FN-8952: derive Quick Add Save smoke fixtures from locales
Keep 300px Quick Add Save browser smoke coverage synchronized with shipped translations.

- Derive board and list Save fixtures from supported locale catalogs.
- Escape fixture labels and reject missing Save translations.
- Add fast fixture parity, derivation, and escaping coverage.

Files changed:
 docs/testing.md                                    |   3 +
 .../__tests__/browser-layout-smoke-fixture.test.ts |  75 +++++++++++++-
 .../dashboard/scripts/browser-layout-smoke.mjs     | 110 ++++++++++++++-------
 3 files changed, 147 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-8952
Fusion-Task-Lineage: 31daec25-5d9a-43bb-9ccf-667702006e76
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 12:38:00 -07:00
gsxdsm
878db6dca7 FN-8951: repair script-test governance drift
Keep test-shard timing governance aligned with the current workspace and workflow seams.

- Add a safe timing-snapshot pruning mode with coverage.
- Align Todo plugin Vitest isolation and Docker dependency manifests.
- Refresh workflow reliability evidence and remove deleted test timings.

Files changed:
 Dockerfile                                         |  7 ++-
 docs/testing.md                                    |  9 ++-
 plugins/fusion-plugin-todos/vitest.config.ts       | 26 ++++++--
 scripts/__tests__/ci-test-shard-timings.test.mjs   | 71 ++++++++++++++++++++++
 scripts/ci-test-shard.mjs                          | 65 ++++++++++++++++++--
 .../lib/workflow-reliability-release-check.json    | 22 +++----
 scripts/test-timings.json                          | 21 -------
 7 files changed, 175 insertions(+), 46 deletions(-)

Fusion-Task-Id: FN-8951

Fusion-Task-Lineage: fbf7e79f-4cb2-43e2-9982-09f3f94de70d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 12:09:20 -07:00
gsxdsm
81139dbbd0 fix(engine): classify provider request timeouts as transient
"Request timed out." is the literal default message of the Anthropic and OpenAI
SDKs' APIConnectionTimeoutError, surfaced to Fusion by checkSessionError after
pi-coding-agent exhausts its in-session retries. It matched none of the
connection-scoped timeout patterns, which deliberately excluded "general
timeouts", so it fell through to specifyTask's generic failure branch — the one
that restores status: null and writes no counter, no nextRecoveryAt, and no park.
Triage rediscovery then re-admitted the card on the very next poll, forever.

Measured before this change: 48 "Specification failed: Request timed out." events
across 10 tasks in 30 hours with zero backoff between attempts. FN-8950 alone
burned 8 consecutive attempts over ~8 hours and never reached implementation.
Across 2 days, 91 failed planning attempts averaged 33 minutes each — ~50 hours of
wall-clock producing nothing, 24% of all planning time.

Classifying these as transient routes them into the bounded recovery policy
(MAX_RECOVERY_RETRIES = 3, 60s/120s/300s jittered backoff) already used by the
connection-level patterns, so a provider blip costs three spaced retries instead
of an unbounded loop.

The pattern is anchored to "request timed out" rather than a bare timeout match:
agent log prose and verification output legitimately contain "timed out"
("BuildKit timed out", "stuck-kill unwind timeout"), and a broad pattern would
reclassify real permanent failures as retryable — the mistake the connection-only
rule was written to avoid. Regression tests pin both directions.

This does not affect model fallback, which pi decides internally and Fusion only
observes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 12:01:25 -07:00
gsxdsm
00ddafd5fe FN-8845: persist deterministic spec alignment
Persist approved-plan drift alignment on linked mission features.

- Store spec alignment across PostgreSQL and SQLite mission feature projections
- Reconcile and render durable alignment instead of browser-side task joins
- Preserve migration identities and cover drift persistence regressions

Files changed:
 docs/architecture.md                               |  2 +
 docs/missions.md                                   |  2 +-
 .../core/src/__tests__/planner/spec-lock.test.ts   |  1 +
 .../src/__tests__/postgres/schema-applier.test.ts  |  9 ++++-
 .../async-stores/async-mission-store-queries.ts    |  5 +++
 packages/core/src/missions/mission-store.ts        |  9 ++++-
 packages/core/src/missions/mission-types.ts        | 10 +++++
 packages/core/src/planner/spec-lock.ts             |  7 +++-
 .../0053_mission_feature_spec_alignment.sql        |  3 ++
 packages/core/src/postgres/schema-applier.ts       | 13 +++++-
 packages/core/src/postgres/schema/project.ts       |  2 +
 packages/dashboard/app/api/missions/missions.ts    |  2 +
 .../dashboard/app/components/MissionManager.tsx    | 40 ++++++------------
 packages/dashboard/app/components/mission-types.ts |  2 +
 .../src/__tests__/plan-approval-status.pg.test.ts  |  4 +-
 .../src/__tests__/mission-feature-sync.test.ts     | 37 ++++++++++++++++-
 .../src/__tests__/spec-drift-reconciler.test.ts    | 14 +++++++
 packages/engine/src/missions/mission-autopilot.ts  | 17 +++++---
 .../engine/src/missions/mission-feature-sync.ts    | 47 +++++++++++++++++++++-
 packages/engine/src/project-engine.ts              |  3 +-
 packages/engine/src/scheduler.ts                   | 40 +++++++++++-------
 packages/engine/src/spec-drift-reconciler.ts       |  5 +++
 22 files changed, 215 insertions(+), 59 deletions(-)

Fusion-Task-Id: FN-8845

Fusion-Task-Lineage: d4a30472-f1c3-41ba-a61b-3f2be1ad32ab

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 11:50:56 -07:00
gsxdsm
963dba6f80 feat: gate review verdicts on finding severity and preserve remediation sessions
Review remediation loops were the dominant cost of task wall-clock: over 14 days,
tasks with >=5 post-review fix rounds were 22% of tasks but consumed 78% of all
task active time, and 311 of 331 recorded findings were spec-internal-consistency
complaints that changed no delivered behavior.

Two causes compounded. Plan/Code Review remediation was unbounded by default, and
the review policy ordered a full re-derivation of the artifact after every edit
("distrust the edit ... fresh holistic pass"), so each round surfaced a fresh crop
of previously-acceptable observations as new blockers.

Make the already-persisted WorkflowReviewFinding.severity load-bearing instead of
decorative: a REVISE only blocks when it carries a finding at or above the review
kind's threshold (plan: P0+P1, code: P0). Non-blocking findings are still parsed,
persisted, and handed to the implementer as advisory notes in PROMPT.md. Fails
closed — a REVISE with no findings, or with any unclassified finding, still blocks,
so prose-only and custom reviewers keep full blocking power. The gate only ever
relaxes a verdict, never promotes one.

Reviewer prompts now request the structured findings schema (Plan Review emitted
none before), define severity by consequence as P0/P1/P2, omit nits entirely rather
than filing them as low-severity findings, and use an incremental re-review contract.
Remediation renders findings grouped by priority and sanctions an explicit decline
with rationale, so a disputed finding has a terminal state.

Also preserve the implementation session across a review bounce: sendTaskBackForFix
no longer nulls sessionFile when preserving resume state, and the executor's finally
no longer clears it on a review handoff. Remediation rounds continue the conversation
instead of re-reading the repo and re-deriving the change they just wrote. The resume
prompt now directs a PROMPT.md re-read, without which a resumed agent would never see
the new findings.

New per-workflow settings planReviewBlockingSeverity / codeReviewBlockingSeverity;
set either to "any" to restore the previous behavior.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 11:28:32 -07:00
gsxdsm
e6b6223d30 fix(engine): stop per-poll symbol-lock renewal log and activityLog spam
Renewal runs every poll for every implementation-column task with declared
symbols, and a lost lock never recovers by renewing — renewSymbolLocks reports
the same lost set on each pass, so the warning and its store.logEntry companion
repeated forever: log-pane spam plus unbounded activityLog growth for a stuck
task. The two error paths had the same shape on any persistent failure.

Extract the executor's suppression into a shared createRepeatSuppressedLog and
use it in both: first occurrence per task/signature logs at full level, repeats
drop to debug(), a changed lost set or error message logs again, and a clean
renewal clears the memo. The logEntry write is gated on the same decision.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 10:33:35 -07:00
gsxdsm
a2deae041a fix(engine): stop per-poll executor dispatch-blocked log spam
The unmet-dependency and ephemeral-disabled pre-dispatch gates re-run on every
dispatch attempt for a blocked task but only change state on the first, so every
later pass re-logged the same line at default level and drowned the log pane.

Route both through logDispatchBlockedOnce: first block per task/reason logs at
log(), identical repeats drop to debug() (FUSION_DEBUG=executor), a changed
reason logs again, and the marker clears when the gate passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 10:11:11 -07:00
gsxdsm
936dd1ea96 FN-8924: retain safe age gate for merge recovery
Document why interrupted merge recovery retains its age-based admission gate.

- Record why merger logs cannot establish task ownership or orphan status.
- Pin non-owner recovery behavior when a merging task was recently updated.

Files changed:
 docs/self-healing-backward-move-audit.md           | 8 +++++++-
 packages/engine/src/__tests__/self-healing.test.ts | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-8924

Fusion-Task-Lineage: 19e7f803-21fe-43fb-8ca6-eecf8ff61df4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 09:09:04 -07:00
gsxdsm
82b5d78bf8 FN-8945: invalidate approved lineage fingerprints
Invalidate stale approval evidence atomically when a parent task leaves lineage.

- Lock and revalidate lineage children before parent deletion or archival.
- Clear affected approvals, append invalidation evidence, and reconcile cleared children.
- Cover lifecycle races, evidence collisions, and async archive/delete paths.

Files changed:
 .changeset/fn-8945-lineage-approval-invalidation.md       |   7 +
 docs/architecture.md                               |   6 +
 .../lineage-approval-invalidation.pg.test.ts       | 379 +++++++++++++++++++++
 .../planning-lifecycle-advisory-lock.pg.test.ts    |  58 ++++
 .../postgres/runtime-lifecycle-async.test.ts       |   4 +
 .../__tests__/postgres/taskstore-lifecycle.test.ts |   3 +-
 packages/core/src/postgres/advisory-locks.ts       | 164 ++++++---
 packages/core/src/store.ts                         |  26 +-
 .../core/src/task-store/archive-lifecycle-2.ts     | 123 +++++--
 .../src/task-store/async/async-archive-lineage.ts  |  27 +-
 .../core/src/task-store/async/async-lifecycle.ts   |  89 +--
 .../task-store/lineage-approval-invalidation.ts    | 168 +++++++++
 12 files changed, 939 insertions(+), 115 deletions(-)

Fusion-Task-Id: FN-8945

Fusion-Task-Lineage: be7dd6c8-5411-4b0e-8734-9fe63b9d1d9f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 08:48:47 -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
a5e1b0efc2 docs: add docs index back-link to knowledge-graph.md
Missing [← Docs index](./README.md) back-link per convention for all
indexed docs. Added during ambient docs audit.
2026-08-10 06:23:35 -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
00e369711c FN-8949: add dead mock specifier guard
Prevent silent dead engine test mocks and restore renamed-lane coverage.

- Add a ratcheting test that detects unresolved relative vi.mock specifiers.
- Update self-healing test seams for moved modules and queue transitions.
- Document mock-specifier and store-fake failure patterns.

Files changed:
 .../dead-vi-mock-specifiers-fail-silently.md       |  57 ++++++
 ...e-defects-that-masquerade-as-production-bugs.md |  12 ++
 docs/testing.md                                    |   5 +
 .../self-healing-query-filter-blindness.test.ts    |  42 ++++-
 .../__tests__/vi-mock-specifiers-resolve.test.ts   | 199 +++++++++++++++++++++
 5 files changed, 306 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-8949

Fusion-Task-Lineage: a1079d1c-a2a9-4ac2-8245-1db434468405

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 04:54:55 -07:00
gsxdsm
5573d042a9 FN-8922: add persistent memory recall store
Add PostgreSQL-backed recall records for durable project memory retrieval.

- add recall record types, storage, search, deduplication, and prompt instructions
- migrate project schemas and expose recall APIs from core memory modules
- document plugin and storage contracts, with unit and PostgreSQL coverage

Files changed:
 .changeset/fn-8922-memory-recall-store.md          |   7 +
 docs/memory-plugin-contract.md                     |  10 +
 docs/storage.md                                    |   4 +
 .../__tests__/memory-recall-dedup-search.test.ts   |  10 +
 .../__tests__/memory-recall-instructions.test.ts   |  62 +++++
 .../postgres/memory-recall-store.pg.test.ts        | 296 +++++++++++++++++++++
 .../src/__tests__/postgres/schema-applier.test.ts  |  15 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/memory/index.ts                  |   1 +
 packages/core/src/memory/project-memory.ts         |  33 ++-
 packages/core/src/memory/recall/index.ts           |  10 +
 packages/core/src/memory/recall/recall-dedup.ts    |  35 +++
 .../core/src/memory/recall/recall-instructions.ts  |  59 ++++
 packages/core/src/memory/recall/recall-search.ts   |  20 ++
 packages/core/src/memory/recall/recall-store.ts    |  51 ++++
 packages/core/src/memory/recall/recall-types.ts    |  14 +
 .../0052_fn_8922_memory_recall_records.sql         |  17 ++
 packages/core/src/postgres/schema-applier.ts       |  13 +-
 packages/core/src/postgres/schema/project.ts       |  10 +-
 19 files changed, 648 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-8922

Fusion-Task-Lineage: bb98f048-6fcf-46d9-bd1f-09294c2dc005

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 04:46:10 -07:00
gsxdsm
0fbeba50d1 FN-8937: rescue project engine test quarantine
Rescue the project engine suite by making subprocess watchdog behavior deterministic.

- Capture real timer APIs for subprocess watchdogs and isolate failure ownership.
- Mock integration-branch resolution to prevent host git during lifecycle tests.
- Add watchdog regression coverage and remove the expired quarantine exclusion.

Files changed:
 docs/testing.md                                    |   3 +
 packages/core/src/__test-utils__/vitest-setup.ts   |  74 ++++++++++-
 .../__tests__/subprocess-guard-fake-timers.test.ts | 140 +++++++++++++++++++++
 .../engine/src/__tests__/project-engine.test.ts    |  63 +++++++---
 packages/engine/vitest.config.ts                   |  12 +-
 scripts/lib/test-quarantine.json                   |   8 +-
 6 files changed, 265 insertions(+), 35 deletions(-)

Fusion-Task-Id: FN-8937

Fusion-Task-Lineage: 9fe166b5-b101-4683-bb2b-4855ee73df10

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 03:50:58 -07:00
gsxdsm
08a3f2851b FN-8919: harden stale agent link recovery
Normalize missing task lookup errors so stale durable-agent links do not halt self-healing sweeps.

- Treat thrown not-found and deleted task lookups as stale links.
- Isolate transient task lookup failures to their affected agent.
- Add recovery regression coverage and a patch changeset.

Files changed:
 .changeset/fn-8919-agent-link-sweep-fail-open.md   |  7 ++
 .../self-healing-agent-link-drift.test.ts          | 58 +++++++++++++--
 .../self-healing-path-utils-task-miss.test.ts      | 51 +++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 84 +++++++++++++++++++++-
 .../engine/src/healing/self-healing-path-utils.ts  | 34 ++++++++-
 packages/engine/src/self-healing.ts                | 57 +++++++++++----
 6 files changed, 272 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-8919

Fusion-Task-Lineage: 6dca2c1d-8ff9-47fb-b6c1-24f5af57b499

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 03:31:50 -07:00
gsxdsm
313eea1461 FN-8935: make Agents Overview scrollable on mobile
Make long Active Agents lists reachable within constrained mobile and short desktop layouts.

- Establish a bounded, touch-friendly Active Agents scroll owner.
- Add unit and Chromium layout coverage for populated and empty overview states.
- Document the required browser smoke coverage and add a patch changeset.

Files changed:
 .../fn-8935-agents-overview-mobile-scroll.md       |  7 ++
 docs/testing.md                                    |  2 +
 .../__tests__/browser-layout-smoke-fixture.test.ts | 26 +++++-
 .../dashboard/app/components/AgentsOverviewBar.css | 14 ++++
 .../AgentsOverviewBar.mobile-scroll.test.tsx       | 96 ++++++++++++++++++++++
 .../dashboard/scripts/browser-layout-smoke.mjs     | 86 +++++++++++++++++++
 6 files changed, 230 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8935

Fusion-Task-Lineage: 43b793b9-3629-45a8-b6c1-d8100467e960

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 03:24:37 -07:00
gsxdsm
e610c72034 FN-8943: reconcile spec-lock divergence history
Preserve prior divergence when a task is re-locked after plan changes.

- Persist immutable spec locks, current-plan evidence, and drift reports.
- Reconcile retained divergence into re-approved alignment state across engine, API, and dashboard views.
- Fence Plan Review acceptance and schema upgrades while retaining migration identity parity.

Files changed:
 .changeset/fn-8845-spec-lock-drift-report.md       |   7 +
 .changeset/fn-8943-spec-lock-divergence.md         |   7 +
 docs/architecture.md                               |  17 +-
 docs/dashboard-guide.md                            |   3 +
 docs/missions.md                                   |   4 +
 .../core/src/__tests__/planner/spec-lock.test.ts   | 158 ++++++++++++++
 .../src/__tests__/postgres/schema-applier.test.ts  |  30 ++-
 .../postgres/task-dependency-mutation.pg.test.ts   |  74 +++++++
 packages/core/src/index.gate.ts                    |   4 +
 packages/core/src/index.ts                         |   4 +
 packages/core/src/planner/drift-report.ts          | 152 +++++++++++++
 packages/core/src/planner/spec-lock.ts             | 182 ++++++++++++++++
 .../migrations/0050_spec_lock_drift_report.sql     |  29 +++
 .../0051_spec_lock_source_revision_bigint.sql      |   3 +
 packages/core/src/postgres/schema-applier.ts       |  25 ++-
 packages/core/src/postgres/schema/project.ts       |  13 ++
 packages/core/src/store.ts                         | 242 ++++++++++++++++++++-
 .../core/src/task-store/branch-and-pr-entities.ts  |  32 ++-
 packages/core/src/task-store/project-store-ops.ts  |  34 ++-
 packages/core/src/task-store/task-update.ts        |  66 +++++-
 packages/core/src/task-store/update-task-deps.ts   |  31 ++-
 packages/dashboard/app/api.ts                      |   3 +
 packages/dashboard/app/api/tasks/tasks.ts          |  22 ++
 .../dashboard/app/components/MissionManager.css    |  21 ++
 .../dashboard/app/components/MissionManager.tsx    |  41 +++-
 .../dashboard/app/components/TaskDetailModal.css   |  26 +++
 .../dashboard/app/components/TaskDetailModal.tsx   |  62 +++++-
 .../__tests__/TaskDetailModal.spec-lock.test.tsx   |  80 +++++++
 .../__tests__/TaskDetailModal.test-helpers.ts      |   2 +
 .../src/__tests__/plan-approval-status.pg.test.ts  |  81 ++++++-
 .../src/routes/register-task-workflow-routes.ts    |  59 ++++-
 .../src/__tests__/mission-feature-sync.test.ts     |  15 +-
 .../src/__tests__/spec-drift-reconciler.test.ts    | 108 +++++++++
 .../engine/src/executor/execute-workflow-graph.ts  |  49 ++++-
 .../engine/src/missions/mission-feature-sync.ts    |  55 ++++-
 packages/engine/src/project-engine.ts              |  33 +++
 packages/engine/src/spec-drift-reconciler.ts       | 105 +++++++++
 packages/engine/src/triage.ts                      |  29 +++
 38 files changed, 1842 insertions(+), 66 deletions(-)

Fusion-Task-Id: FN-8943

Fusion-Task-Lineage: 2a7f8a38-99aa-4c4b-8c36-41d14c466d21

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 02:56:58 -07:00
gsxdsm
6cf95433bf FN-8928: evict flaky workflow IR PG gate canary
Remove the flaky sync-workflow-IR PostgreSQL canary from the blocking merge gate while preserving non-blocking coverage.

- Remove the default workflow-IR PostgreSQL test from the gate canary script.
- Update gate-policy coverage expectations and flake-eviction documentation.
- Record the observed setup-hook timeout and retained regression coverage.

Files changed:
 .../suite-only-flakes-observed-register.md         | 25 +++++++++++++--
 docs/testing.md                                    |  6 ++--
 packages/core/package.json                         |  2 +-
 .../sync-workflow-ir-is-always-default.pg.test.ts  |  6 ++++
 .../__tests__/engine-vitest-gate-policy.test.mjs   | 37 +++++++++++-----------
 5 files changed, 51 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-8928

Fusion-Task-Lineage: b725ba1a-fb33-4d49-89b4-277a64246cdd

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 02:32:24 -07:00
gsxdsm
5b9e6643d6 FN-8869: inherit project model overrides for role agents
Role-based permanent agents now consistently use their effective project model and thinking settings.

- Resolve permanent-agent model and thinking inheritance by workflow role in core.
- Apply inherited settings to Agent views, Chat sessions, routes, and heartbeat sessions.
- Cover role-specific inheritance and preserve the lifecycle-column ratchet classification.

Files changed:
 .changeset/fn-8869-role-agent-project-model-override.md   |   7 ++
 docs/agents.md                                     |   9 +-
 docs/settings-reference.md                         |   4 +-
 packages/core/src/__tests__/agent-effective-model.test.ts    |  97 +++++++++++++++++++
 packages/core/src/__tests__/no-hardcoded-lifecycle-columns.test.ts |   2 +
 packages/core/src/ai/agent-effective-model.ts      |  82 +++++++++++++++++
 packages/core/src/ai/model-resolution.ts           |  14 +++
 packages/core/src/index.gate.ts                    |   7 ++
 packages/core/src/index.ts                         |   7 ++
 packages/core/src/types.ts                         |   7 ++
 packages/dashboard/app/components/AgentDetailView.tsx |  49 ++++++---
 packages/dashboard/app/components/AgentsView.tsx   |  11 ++-
 packages/dashboard/app/components/__tests__/AgentDetailView.effective-model.test.tsx |  55 +++++++++++
 packages/dashboard/app/components/__tests__/AgentDetailView.settings.test.tsx |  22 +++++
 packages/dashboard/app/components/__tests__/AgentsView.test.tsx |  25 +++++
 packages/dashboard/src/__tests__/chat-manager.test.ts |  45 +++++++++
 packages/dashboard/src/__tests__/routes-chat-sessions-project-model.test.ts | 103 +++++++++++++++++++++
 packages/dashboard/src/chat.ts                     |  65 +++++--------
 packages/dashboard/src/routes/register-chat-routes.ts |  37 +++++---
 packages/engine/src/__tests__/agent-session-helpers-test-mode.test.ts |  13 +++
 packages/engine/src/__tests__/agent-session-helpers.test.ts |  54 +++++++++++
 packages/engine/src/agent-heartbeat.ts             |  10 +-
 packages/engine/src/agents/agent-session-helpers.ts |   6 +-
 23 files changed, 648 insertions(+), 83 deletions(-)

Fusion-Task-Id: FN-8869

Fusion-Task-Lineage: 00227aaf-b33b-43f1-bcbb-2203c9930dbc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 02:25:03 -07:00