Commit Graph

377 Commits

Author SHA1 Message Date
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
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
e963be4088 FN-7220: harden workflow recovery lineage checks
Harden workflow recovery so pause/resume parks and already-merged detection preserve task ownership lineage.

- Reject already-merged recovery candidates with foreign task or lineage trailers before accepting patch-id, tree, or branch-tip matches.
- Recover benign pause/resume abort parks back to todo when the task has no live executor/session state.
- Add real-git and executor regression coverage plus architecture docs and a changeset for recovery behavior.

Files changed:
 .changeset/fn-7220-workflow-recovery-lineage.md    |   7 +
 docs/architecture.md                               |   8 +-
 .../already-merged-detector.real-git.test.ts       |  69 ++++++++
 .../executor-paused-abort-todo-benign.test.ts      | 194 ++++++++++++++++++---
 .../self-healing-already-merged.real-git.test.ts   |  64 ++++++-
 packages/engine/src/already-merged-detector.ts     | 113 +++++++++---
 packages/engine/src/executor.ts                    |  84 +++++++++
 packages/engine/src/self-healing.ts                | 134 ++++++++++++--
 8 files changed, 609 insertions(+), 64 deletions(-)

Fusion-Task-Id: FN-7220

Fusion-Task-Lineage: 186c65bc-fe1a-457a-b90a-abbd73044252

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 22:43:02 -07:00
gsxdsm
58a0c1f1d6 FN-7214: make workflow node pause resume re-entrant
Workflow graph pause aborts now re-enter interrupted nodes instead of failing the task.

- Track and abort active workflow graph runners during hard cancel and global pause flows.
- Stamp interrupted workflow nodes with typed engine-pause abort context and surface it through graph run results.
- Re-enter safe todo, in-progress, and auto-mergeable in-review graph nodes with retry bounds and run-audit evidence.
- Add regression coverage and architecture notes for paused node re-entry behavior.

Files changed:
 .changeset/fn-7214-workflow-graph-node-pause-resume.md    |   7 +
 docs/architecture.md                                      |   4 +-
 packages/engine/src/__tests__/executor-paused-abort-todo-benign.test.ts      | 231 ++++++++++++++++++++-
 packages/engine/src/__tests__/workflow-graph-paused-node-resume.test.ts      | 148 +++++++++++++
 packages/engine/src/executor.ts                           | 158 +++++++++++++-
 packages/engine/src/workflow-graph-executor.ts            |  50 ++++-
 packages/engine/src/workflow-graph-task-runner.ts         |  26 ++-
 7 files changed, 614 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-7214
Fusion-Task-Lineage: 1689e3fd-e35f-4e83-8049-aabbab49cecd
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 19:42:45 -07:00
gsxdsm
dc54b615d4 FN-7182: pause auto-merge for manual pull requests
Manual pull requests now pause automatic merge processing until human action closes or merges the PR.

- Mark dashboard-created or linked pull requests with manual provenance and preserve it across PR refreshes and merges.
- Exclude tasks with manual open or draft PRs from automatic merge processing while preserving pipeline PR automation.
- Add regression coverage and document the manual PR handoff behavior.

Files changed:
 .changeset/FN-7182-no-auto-merge-with-manual-pr.md |  7 ++
 docs/architecture.md                               |  2 +-
 docs/dashboard-guide.md                            |  1 +
 packages/core/src/__tests__/task-helpers.test.ts   | 49 ++++++++++++-
 packages/core/src/__tests__/task-merge.test.ts     | 60 +++++++++++++++-
 packages/core/src/index.ts                         |  2 +-
 packages/core/src/task-helpers.ts                  | 13 ++++
 packages/core/src/task-merge.ts                    | 10 ++-
 packages/core/src/types.ts                         |  6 ++
 .../dashboard/src/__tests__/routes-auth.test.ts    | 80 ++++++++++++++++++++++
 .../dashboard/src/__tests__/routes-github.test.ts  | 45 +++++++++++-
 .../dashboard/src/routes/register-git-github.ts    | 20 +++++-
 12 files changed, 285 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-7182

Fusion-Task-Lineage: c415a9dc-43c1-4609-a032-367991e949a1

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 01:43:08 -07:00
gsxdsm
9f45f108e5 FN-7174: reset lost steps before stuck requeue cleanup
Preserve durable stuck-requeue progress while preventing retries from skipping deleted uncommitted work.

- Reconcile completed and in-progress steps before stuck cleanup removes executor worktrees.
- Reset step progress when a branch has no unique commits or git proof fails before checkout deletion.
- Cover normal, loop-timeout, and force stuck-requeue paths with regression tests and documentation.

Files changed:
 .changeset/fn-7174-stuck-requeue-progress.md       |   7 +
 docs/architecture.md                               |   2 +-
 packages/core/src/types.ts                         |   9 +-
 ...xecutor-stuck-requeue-preserve-progress.test.ts | 282 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  99 ++++----
 5 files changed, 349 insertions(+), 50 deletions(-)

Fusion-Task-Id: FN-7174

Fusion-Task-Lineage: 3b8b09e7-fceb-4b3d-af80-993a8842a51a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 00:08:53 -07:00
gsxdsm
e42679daff FN-7173: preserve stuck triage drafts on requeue
Stuck triage retries now continue from saved planning drafts instead of restarting.

- Detect non-empty PROMPT.md drafts or saved plan task documents after stuck-detector aborts.
- Requeue draft-backed stuck triage runs as replans with explicit resume feedback and bounded retry escalation.
- Cover prompt-vs-plan recovery, cold retries, approval recovery, and exhaustion behavior in engine tests.
- Document the stuck-triage preservation invariant and add a patch changeset.

Files changed:
 ...-7173-preserve-triage-draft-on-stuck-requeue.md |   7 +
 docs/architecture.md                               |   6 +-
 .../triage-stuck-requeue-preserve-draft.test.ts    | 348 +++++++++++++++++++++
 packages/engine/src/__tests__/triage.test.ts       |   2 +-
 packages/engine/src/triage.ts                      | 153 ++++++++-
 5 files changed, 499 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-7173
Fusion-Task-Lineage: 8e59b025-92cc-4902-bf88-b203b65c2c7d
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 23:18:28 -07:00
gsxdsm
d7a02c4d5b FN-7151: free scoped project concurrency slots
Free stopped or paused project engines' leaked slots without disturbing other projects.

- Add scoped semaphore accounting around the shared global agent pool.
- Return residual per-project slots after runtime stop drains aborted agents.
- Keep idle leak reconciliation scoped to the owning project so active projects retain their slots.
- Cover scoped release, reconciliation, project pause, and in-process runtime behavior with tests.

Files changed:
 .../fn-7151-free-concurrency-slots-on-stop.md      |   7 ++
 docs/architecture.md                               |   2 +-
 packages/engine/src/__tests__/concurrency.test.ts  | 126 +++++++++++++++++++++
 .../src/__tests__/project-engine-manager.test.ts   |  60 ++++++++++
 packages/engine/src/concurrency.ts                 | 123 +++++++++++++++++++-
 packages/engine/src/project-engine.ts              |   2 +-
 .../runtimes/__tests__/in-process-runtime.test.ts  |  51 +++++++++
 packages/engine/src/runtimes/in-process-runtime.ts |  22 +++-
 8 files changed, 385 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-7151

Fusion-Task-Lineage: e59e5e0c-67e8-4f80-a6b9-1ea4febaeb97

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 20:55:59 -07:00
gsxdsm
8b124960b8 FN-7154: prevent duplicate automation schedule runs
Add an atomic schedule claim so concurrent automation pollers execute each due window only once.

- Add AutomationStore.claimDueSchedule to CAS-advance nextRunAt before execution.
- Gate CronRunner execution on the claim across project, global, and all-scope pollers.
- Cover single-store, shared SQLite, legacy command, step, and in-process intercept deduplication paths.
- Document the claim-then-run automation invariant.

Files changed:
 docs/architecture.md                               |   1 +
 .../core/src/__tests__/automation-store.test.ts    |  77 +++++++++++++++
 packages/core/src/automation-store.ts              |  33 +++++++
 packages/engine/src/__tests__/cron-runner.test.ts  | 110 +++++++++++++++++++++
 packages/engine/src/cron-runner.ts                 |  18 +++-
 5 files changed, 237 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-7154

Fusion-Task-Lineage: 490ba154-9dd8-4e92-bacb-24b7184cb6f8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 20:09:52 -07:00
gsxdsm
6f46fa17dd FN-7138: show task column context in agent assignments
Agent Current Task output now includes linked task column context to distinguish active execution from parked or stale links.

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

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

Fusion-Task-Id: FN-7138
Fusion-Task-Lineage: 0ea97b4c-d4f8-4289-a5b6-e5c51b47b768
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 16:16:25 -07:00
gsxdsm
5608bf555f FN-7083: derive project in-flight counts from live tasks
Derive CLI project in-flight agent displays from live in-progress task counts instead of persisted health bookkeeping.

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

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

Fusion-Task-Id: FN-7083

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

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-26 18:35:54 -07:00
gsxdsm
0440ae4bb9 FN-7074: make task ID reservation commits atomic
Task creation now commits or rolls back distributed task ID reservations with the task-row transaction.

- Add transaction-participating reservation commit and rollback helpers.
- Wire create, duplicate, and refinement task paths to commit reservations inside task insertion.
- Record rollback audit events and preserve burned reservation rows after failed creates.
- Cover atomicity, rollback, and allocator behavior with reservation-focused tests and docs.

Files changed:
 .changeset/fn-7074-reservation-atomicity.md        |   7 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   7 +-
 docs/storage.md                                    |   4 +-
 .../core/src/__tests__/distributed-task-id.test.ts |  25 ++-
 .../__tests__/store-reservation-atomicity.test.ts  | 224 +++++++++++++++++++++
 packages/core/src/distributed-task-id.ts           | 208 +++++++++++++------
 packages/core/src/store.ts                         |  93 +++++++--
 8 files changed, 479 insertions(+), 90 deletions(-)

Fusion-Task-Id: FN-7074

Fusion-Task-Lineage: 464a98cf-e903-4257-93ac-424c7129412b
2026-06-26 14:55:01 -07:00
gsxdsm
74d37785d2 FN-7069: reconcile phantom task reservations
Harden task-store startup and maintenance against phantom committed task reservations.

- Reconcile committed reservation phantoms without freeing reserved task IDs.
- Prune orphaned child rows and emit durable run-audit evidence.
- Normalize missing legacy task.json reads to clean not-found errors.
- Cover archive/search and phantom-reservation reconciliation behavior with tests.

Files changed:
 .changeset/fn-7069-phantom-task-reconcile.md       |   7 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   2 +
 .../src/__tests__/store-archive-search.test.ts     |   5 +
 .../store-phantom-reservation-reconcile.test.ts    | 148 +++++++++++++++++++++
 packages/core/src/store.ts                         | 106 ++++++++++++++-
 packages/engine/src/self-healing.ts                |  14 ++
 7 files changed, 282 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-7069

Fusion-Task-Lineage: 772aad37-db30-4310-a968-c6e5306c73bb
2026-06-26 13:39:33 -07:00
gsxdsm
b293525751 fix(dashboard): repair CSS token/contrast regressions and stale tests
Fixes ~19 deterministic dashboard test failures pre-existing on origin/main
(non-blocking full-suite lane). Mix of real product fixes and stale-test
reconciliation; no appeasement (no widened timeouts, skips, or weakened
assertions).

Product CSS fixes (real regressions the guards caught):
- Info toast contrast: shadcn-custom light theme had white-on-#0284c7 (4.10,
  below WCAG AA 4.5); enrolled it in the light-mode dark-text correction.
- 27 undefined CSS token references (typos/foreign tokens) renamed to canonical
  defined tokens; defined the genuinely-intended --border-strong and
  --right-dock-min/max-width.
- Raw rgba() box-shadow fallback tokenized to color-mix; dev-server mobile
  header split into its own responsive rule.

Stale tests reconciled with intentional product changes:
- workflowColumns graduated to always-on (board-workflows unit test).
- workflow optional-steps source re-pointed to v2 optional-group nodes.
- command-center pricing docs (one doc gap filled: openai-codex:* keying).
- SetupWizardModal added detectWorkspace + workspaceMode/taskPrefix payload.
- board-mobile listener-count assertion → unmount no-throw behavior.
- CommandCenterControls / ThemeSelector: default theme relabeled "Fusion Legacy".
- ProjectOverview / WorkflowNodeEditor: header divider intentionally removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:37:52 -07:00
gsxdsm
eb3833a542 FN-6971: retire dual-observe cutover gating
Remove stale dual-observe prerequisites from workflow-authoritative readiness while preserving parity-summary safeguards.

- Require the authoritative flag plus clean populated parity summaries for interpreter cutover readiness.
- Keep persisted workflowInterpreterDualObserve values inert in runtime tests and documentation.
- Update cutover, parity, and graph-executor tests to reflect retired shadow observation behavior.
- Add a formatted patch changeset for the operator-facing cutover readiness fix.

Files changed:
 .changeset/fn-6971-workflow-cutover-readiness.md   |  7 ++
 docs/architecture.md                               |  2 +-
 docs/settings-reference.md                         |  4 +-
 docs/workflow-steps.md                             | 19 +++--
 .../core/src/__tests__/workflow-cutover.test.ts    | 19 +++--
 packages/core/src/workflow-cutover.ts              |  9 +--
 .../workflow-interpreter-cutover.test.ts           | 87 +++++++++++++++++++---
 .../workflow-interpreter-dual-observe.test.ts      | 76 ++++++-------------
 .../src/__tests__/stepwise-workflow-parity.test.ts | 25 ++++---
 .../engine/src/workflow-authoritative-driver.ts    | 10 +--
 10 files changed, 152 insertions(+), 106 deletions(-)

Fusion-Task-Id: FN-6971
Fusion-Task-Lineage: 363a441d-62e5-403c-9389-75fcf788352a
2026-06-24 23:32:52 -07:00
gsxdsm
fe536b2af8 FN-6954: reconcile stale parked task assignments
Reconcile agent/task drift when durable agents remain linked to queued tasks without live execution proof.

- clear stale Agent.taskId links for parked todo/triage tasks while preserving task leases and queue state
- report stale parked assignments as active/no-live-run in Reports Health Check before reconciliation completes
- add scheduler and self-healing coverage for queued lease drift, overlap starvation, and audit events
- document the reconciliation behavior and add a published package patch changeset

Files changed:
 .changeset/fn-6954-agent-task-state-drift.md       |   5 +
 docs/architecture.md                               |   2 +
 .../src/__tests__/heartbeat-executor.test.ts       |  68 ++++++++++++
 .../__tests__/scheduler-overlap-starvation.test.ts |  68 +++++++++++-
 .../self-healing-agent-link-drift.test.ts          |  97 ++++++++++++++++-
 .../engine/src/__tests__/task-agent-sync.test.ts   |  33 +++++-
 packages/engine/src/agent-heartbeat.ts             | 121 +++++++++++++++++++--
 packages/engine/src/run-audit.ts                   |   5 +
 packages/engine/src/runtimes/in-process-runtime.ts |   1 +
 packages/engine/src/scheduler.ts                   |  24 +++-
 packages/engine/src/self-healing.ts                | 102 ++++++++++++++---
 packages/engine/src/task-agent-sync.ts             |  65 ++++++++++-
 12 files changed, 555 insertions(+), 36 deletions(-)

Fusion-Task-Id: FN-6954
Fusion-Task-Lineage: 24b8a2eb-5a33-4539-ab64-ae2bbfc2d195
2026-06-23 10:30:50 -07:00
gsxdsm
efb94c8623 FN-6876: add editable model pricing refresh
Add editable model pricing overrides and a LiteLLM refresh path for usage cost analytics.

- Add persisted model pricing override settings and apply them to token and team analytics cost calculations.
- Add a Command Center pricing fetch endpoint that imports chat pricing from LiteLLM and invalidates settings caches.
- Add a Global Models pricing editor with manual rows, removal, and one-click fetch support.
- Cover override lookup, settings parity, analytics, route behavior, and UI editing with tests and docs.

Files changed:
 .changeset/model-pricing-overrides.md              |   5 +
 docs/architecture.md                               |   3 +-
 docs/dashboard-guide.md                            |   5 +-
 docs/settings-reference.md                         |   3 +
 packages/core/src/__tests__/model-pricing.test.ts  | 101 +++++++++++
 .../core/src/__tests__/settings-parity.test.ts     |   4 +
 packages/core/src/__tests__/store-settings.test.ts |  25 +++
 .../core/src/__tests__/token-analytics.test.ts     |  39 +++++
 packages/core/src/index.ts                         |   4 +
 packages/core/src/model-pricing.ts                 | 118 +++++++++++--
 packages/core/src/settings-schema.ts               |   3 +
 packages/core/src/team-analytics.ts                |  17 +-
 packages/core/src/token-analytics.ts               |  19 +-
 packages/core/src/types.ts                         |  12 ++
 .../dashboard/app/components/SettingsModal.tsx     |   2 +
 .../settings/sections/GlobalModelsSection.tsx      |   8 +-
 .../settings/sections/ModelPricingSection.css      |  82 +++++++++
 .../settings/sections/ModelPricingSection.test.tsx | 126 ++++++++++++++
 .../settings/sections/ModelPricingSection.tsx      | 193 +++++++++++++++++++++
 .../register-command-center-routes.test.ts         | 172 +++++++++++++++++-
 .../src/routes/register-command-center-routes.ts   |  58 +++++++
 21 files changed, 967 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-6876

Fusion-Task-Lineage: 4d4e3b9d-bec4-4e14-b7bc-88f846465566
2026-06-23 01:14:11 -07:00
gsxdsm
584ed02541 FN-6897: update dashboard navigation docs
Refresh the documentation to match the reshuffled dashboard navigation model.

- Clarify that desktop/tablet content destinations live in the left sidebar while inline tools live in the right dock.
- Update Planning, Import Tasks, Git Manager Recovery, and plugin view navigation instructions across docs.
- Remove stale Header overflow, duplicate dock/sidebar, and standalone Stash Recovery wording.

Files changed:
 docs/architecture.md    |  2 +-
 docs/dashboard-guide.md | 55 +++++++++++++++++++++++++++----------------------
 docs/getting-started.md |  4 ++--
 docs/task-management.md |  4 ++--
 4 files changed, 35 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-6897

Fusion-Task-Lineage: d0009a23-c197-4c1b-8c54-5fe4a8dca03c
2026-06-22 19:24:55 -07:00
gsxdsm
8dd9697468 FN-6714: backfill commit-association diff stats
Backfill historical commit-association diff stats so Command Center LOC can use real persisted git data.

- Add a core backfill API that inspects local git commits for associations with missing additions/deletions and supports dry-run reporting.
- Expose an authenticated Command Center productivity backfill endpoint and route it through the legacy API shim.
- Keep productivity LOC/hour sentinels safe for legacy payloads and document the backfill contract.
- Cover the backfill path, auth gate, productivity analytics, and route registration with tests.

Files changed:
 .changeset/fn-6714-command-center-loc-backfill.md  |   5 +
 docs/architecture.md                               |   4 +-
 docs/storage.md                                    |   4 +-
 ...mmit-association-diff-backfill.real-git.test.ts | 140 +++++++++++++++++++++
 packages/core/src/index.ts                         |   1 +
 packages/core/src/store.ts                         |  76 ++++++++++-
 packages/core/src/types.ts                         |   9 ++
 packages/dashboard/app/api/legacy.ts               |  16 +++
 .../command-center/areas/ProductivityArea.tsx      |   8 +-
 .../register-command-center-routes.auth.test.ts    |  48 ++++---
 .../register-command-center-routes.test.ts         |  49 +++++++-
 .../src/routes/register-command-center-routes.ts   |  20 +++
 12 files changed, 354 insertions(+), 26 deletions(-)

Fusion-Task-Id: FN-6714

Fusion-Task-Lineage: 657c7789-bbe4-4611-abca-127af05b0300
2026-06-22 03:42:24 -07:00
gsxdsm
0b410d54e1 FN-6915: surface user comments in agent prompts
User task chat and steering comments now flow into planning, review, and merge agent context.

- Add a shared user-comment formatter and selector for prompt context.
- Inject latest user comments into planner-triggered review, reviewer, merger, and clean-room AI merge prompts.
- Cover comment selection, prompt formatting, review/merge propagation, and docs updates with targeted tests.

Files changed:
 docs/architecture.md                               |  1 +
 docs/dashboard-guide.md                            |  1 +
 .../src/__tests__/agent-user-comments.test.ts      | 81 ++++++++++++++++++++++
 .../executor-review-step-indexing.test.ts          | 28 +++++++-
 packages/engine/src/__tests__/merger-ai.test.ts    | 54 +++++++++++++++
 .../src/__tests__/merger-prompt-and-utils.test.ts  | 29 ++++++++
 packages/engine/src/__tests__/reviewer.test.ts     | 37 ++++++++--
 packages/engine/src/__tests__/triage.test.ts       | 23 ++++++
 packages/engine/src/agent-user-comments.ts         | 60 ++++++++++++++++
 packages/engine/src/executor.ts                    | 14 ++--
 packages/engine/src/merger-ai.ts                   | 23 +++++-
 packages/engine/src/merger.ts                      | 22 +++++-
 packages/engine/src/reviewer.ts                    | 13 ++++
 13 files changed, 372 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-6915

Fusion-Task-Lineage: 02de0c12-481a-4489-b495-70c9c00619bc
2026-06-22 03:34:15 -07:00
gsxdsm
55266b6e9e FN-6874: document Command Center pricing semantics
Document the Command Center pricing contract for maintainers and users.

- Explain that estimated token costs are derived at read time from the maintained pricing table and are not persisted billing truth.\n- Document pricingAsOf, stale low-confidence, unknown-model unavailable, and provider coverage maintenance expectations.\n- Add a documentation contract test to keep the dashboard and architecture guides aligned.

Files changed:\n docs/architecture.md                               |  2 ++\n docs/dashboard-guide.md                            |  3 +-\n .../__tests__/command-center-pricing-docs.test.ts  | 35 ++++++++++++++++++++++\n 3 files changed, 39 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6874

Fusion-Task-Lineage: 04606ae1-4870-479a-afb6-8a24675fe66b
2026-06-21 16:28:30 -07:00
gsxdsm
7ee1fec22c FN-6861: reject repo-root task worktrees
Prevent stale task metadata from treating the project repository root as a reusable task worktree.

- Classify root-equal task worktree paths as repo-root before registered-worktree checks.
- Clear stale resumed repo-root assignments so acquisition creates a fresh configured task worktree.
- Add structured executor audit metadata and regression coverage for repo-root liveness collisions.
- Document the repo-root requeue-loop invariant and recovery behavior.

Files changed:
 docs/architecture.md                               |  2 +-
 .../repo-root-task-worktree-requeue-loop.md        | 49 ++++++++++++++++
 .../__tests__/executor-worktree-liveness.test.ts   | 23 +++++++-
 .../src/__tests__/worktree-acquisition.test.ts     | 67 +++++++++++++++++++++-
 .../src/__tests__/worktree-pool-liveness.test.ts   | 25 ++++++++
 packages/engine/src/executor.ts                    | 22 ++++++-
 packages/engine/src/worktree-acquisition.ts        |  4 ++
 packages/engine/src/worktree-pool.ts               | 13 ++++-
 8 files changed, 198 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6861

Fusion-Task-Lineage: d6a4922e-5a21-4037-b2c2-86ff53d8e9e3
2026-06-21 14:28:58 -07:00
gsxdsm
d99246cb74 FN-6834: use OS-available memory for system metrics
Use shared OS-available memory readings so macOS cache/inactive pages are not counted as used.

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

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

Fusion-Task-Id: FN-6834

Fusion-Task-Lineage: 2e651551-6c35-46d1-b517-535758c7ace2
2026-06-21 13:32:19 -07:00
gsxdsm
08d1f09107 FN-6796: preserve benign in-review pause aborts
Preserve completed in-review tasks when benign pause/resume aborts surface after executor handoff.

- Detect non-user hard-cancel pause aborts on clean completed in-review rows and clear the transient abort marker without moving the task.
- Let self-healing recover persisted safe in-review pause-abort parks in place while keeping hard-cancel, pause, autoMerge:false, terminal merge, and live-execution guards intact.
- Cover executor and self-healing recovery paths with regression tests, document the audit metadata, and add a patch changeset.

Files changed:
 .../fn-6796-pause-resume-in-review-recovery.md     |  5 ++
 AGENTS.md                                          |  1 +
 docs/architecture.md                               |  2 +
 .../engine/src/__tests__/executor-recovery.test.ts | 97 +++++++++++++++++++++-
 .../active-worktree-removal-liveness.test.ts       |  2 +-
 .../self-healing-paused-abort-recovery.test.ts     | 90 +++++++++++++++++++-
 packages/engine/src/executor.ts                    | 35 ++++++++
 packages/engine/src/self-healing.ts                | 38 +++++++--
 8 files changed, 257 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-6796

Fusion-Task-Lineage: d2fe6c6d-c118-4f2f-b19e-58e6f1b29384
2026-06-20 15:11:22 -07:00
gsxdsm
61ff17a057 FN-6797: harden in-review dependency rebound audits
Harden in-review dependency drift reconciliation with explicit guarded no-action audit evidence.

- Emit no-action run-audit events when pause, auto-merge, live execution, checkout, or rebound mutation guards prevent an in-review dependency rebound.
- Preserve scheduler dependency satisfaction semantics so in-review dependencies remain non-blocking under merge-request shadow mode without accepted markers.
- Extend regression coverage and run-audit documentation for guarded in-review rebounds.

Files changed:
 .changeset/fn-6797-in-review-dependency-drift.md   |   5 +
 AGENTS.md                                          |   2 +-
 docs/architecture.md                               |   4 +-
 .../in-review-unmet-dependency-reconcile.test.ts   |  18 ++-
 packages/engine/src/__tests__/self-healing.test.ts |  79 +++++++++++--
 packages/engine/src/self-healing.ts                | 129 ++++++++++++++++-----
 6 files changed, 190 insertions(+), 47 deletions(-)

Fusion-Task-Id: FN-6797

Fusion-Task-Lineage: f94c7875-619a-47be-88f5-320a4dda3b34
2026-06-20 10:21:26 -07:00
gsxdsm
d2fc70ac91 FN-6793: enforce dependency gates before review
Dependency gating now blocks executor and review recovery paths when dependencies remain unmet.

- Re-check unmet scheduling dependencies before workflow graph or authoritative executor dispatch and requeue blocked tasks with blockedBy.
- Rebound auto-merge-eligible in-review tasks with live unmet dependencies back to todo while preserving progress, worktree, and resume state.
- Add run-audit documentation, a patch changeset, and regression coverage for executor, scheduler, and self-healing behavior.

Files changed:
 .changeset/fn-6793-dependency-gating.md            |   7 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   2 +
 .../engine/src/__tests__/executor-core.test.ts     |  68 +++++++++
 .../in-review-unmet-dependency-reconcile.test.ts   | 115 +++++++++++++++
 packages/engine/src/__tests__/scheduler.test.ts    |  36 +++++
 packages/engine/src/__tests__/self-healing.test.ts | 159 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  46 ++++++
 packages/engine/src/self-healing.ts                | 112 +++++++++++++++
 9 files changed, 546 insertions(+)

Fusion-Task-Id: FN-6793

Fusion-Task-Lineage: b209264c-faae-41aa-a024-c33e0d8b61be
2026-06-20 08:13:33 -07:00
gsxdsm
c32c925321 FN-6783: recover orphaned task dirs into the task index
Reconcile on-disk task.json records that are missing from SQLite without resurrecting tombstoned IDs.

- Add TaskStore orphaned task directory scanning with metadata validation, FTS-safe insertion, cache updates, lifecycle events, and run-audit entries.
- Run the reconcile during store init and self-healing maintenance for tasks created after startup.
- Cover recovery, skip, and maintenance behavior with core and engine regression tests.
- Document task index reconciliation and add the published package changeset.

Files changed:
 .changeset/fn-6783-orphaned-task-dir-reconcile.md  |   5 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   2 +
 docs/storage.md                                    |   8 +
 .../store-orphaned-task-dir-reconcile.test.ts      | 179 +++++++++++++++++++++
 packages/core/src/store.ts                         | 170 ++++++++++++++++++-
 .../self-healing-orphaned-task-dirs.test.ts        |  40 +++++
 packages/engine/src/self-healing.ts                |  14 ++
 8 files changed, 412 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6783
Fusion-Task-Lineage: 5c8d4690-5278-4c29-8f02-32d9f01d581d
2026-06-20 04:40:31 -07:00
gsxdsm
5117944371 FN-6720: add productivity task duration stats
Adds completed-task active-duration analytics to the Command Center Productivity surface.\n\n- Aggregate average, median, p90, total, and completed-task duration metrics from done tasks with recorded active time.\n- Render duration stat cards with unavailable dash sentinels and export matching CSV rows.\n- Cover analytics, dashboard, route, CSV, mobile/tablet layout, and documentation behavior.\n\nFiles changed:\n .changeset/soft-badgers-measure.md                 |   5 +\n docs/architecture.md                               |   4 +-\n docs/dashboard-guide.md                            |   2 +-\n docs/storage.md                                    |   2 +\n .../src/__tests__/productivity-analytics.test.ts   | 105 ++++++++++++++++++++-\n packages/core/src/productivity-analytics.ts        |  83 +++++++++++++++-\n .../__tests__/CommandCenter.mobile-scroll.test.tsx |  16 ++++\n .../__tests__/CommandCenter.tablet-layout.test.tsx |  19 ++++\n .../command-center/areas/ProductivityArea.tsx      |  65 ++++++++++++-\n .../command-center/areas/__tests__/areas.test.tsx  |  65 ++++++++++++-\n .../components/command-center/areas/areaShared.ts  |  12 +++\n .../src/__tests__/command-center-csv.test.ts       |   8 ++\n .../register-command-center-routes.test.ts         |  22 +++++\n packages/dashboard/src/command-center-csv.ts       |   5 +\n 14 files changed, 404 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-6720

Fusion-Task-Lineage: aa0980eb-d156-4dca-b6b8-1788570c166b
2026-06-19 17:25:35 -07:00
gsxdsm
59d3eee7f4 FN-6721: estimate productivity hours saved
Estimate human hours saved from productivity LOC analytics and expose it consistently.

- Add a shared human-lines-per-hour conversion and hoursSaved summary to productivity analytics.
- Show human hours saved in the Command Center productivity area with unavailable-state handling.
- Include hoursSaved in productivity CSV exports, docs, tests, and the release changeset.

Files changed:
 .changeset/fuzzy-productivity-hours.md             |  5 ++++
 docs/architecture.md                               |  4 +--
 docs/storage.md                                    |  4 +--
 .../src/__tests__/productivity-analytics.test.ts   | 29 ++++++++++++++++------
 packages/core/src/index.ts                         |  3 ++-
 packages/core/src/productivity-analytics.ts        | 28 +++++++++++++++++++--
 .../command-center/areas/ProductivityArea.tsx      | 24 ++++++++++++++++++
 .../command-center/areas/__tests__/areas.test.tsx  |  9 ++++++-
 .../src/__tests__/command-center-csv.test.ts       | 29 +++++++++++++++++++++-
 .../register-command-center-routes.test.ts         |  1 +
 packages/dashboard/src/command-center-csv.ts       |  1 +
 11 files changed, 120 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-6721

Fusion-Task-Lineage: 80114bfc-7d7f-4659-983a-9488660e5f0f
2026-06-19 16:47:34 -07:00
gsxdsm
87f18f87ed FN-6705: add plugin activation analytics
Record plugin activation events and expose them to Command Center analytics.

- Add plugin activation persistence, aggregation helpers, and exports.
- Record load/reload activation events through the plugin loader and store APIs.
- Surface plugin activation counts in the Command Center Ecosystem area and API route.
- Cover migrations, aggregation behavior, plugin loader recording, route auth, UI rendering, and quarantined flaky suites.

Files changed:
 .changeset/fn-6705-plugin-activation-analytics.md  |   5 +
 docs/architecture.md                               |   2 +-
 docs/dashboard-guide.md                            |   2 +-
 packages/cli/vitest.config.ts                      |   8 +
 packages/core/src/__tests__/db-migrate.test.ts     |  34 ++---
 packages/core/src/__tests__/db.test.ts             |  59 ++++----
 packages/core/src/__tests__/goals-schema.test.ts   |   6 +-
 packages/core/src/__tests__/insight-store.test.ts  |  12 +-
 .../src/__tests__/merge-request-record.test.ts     |   3 +-
 packages/core/src/__tests__/mission-store.test.ts  |   6 +-
 .../__tests__/plugin-activation-analytics.test.ts  |  67 ++++++++
 packages/core/src/__tests__/plugin-loader.test.ts  | 168 ++++++++++++++++++++-
 packages/core/src/__tests__/run-audit.test.ts      |   6 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   3 +-
 .../src/__tests__/store-plugin-activations.test.ts |  52 +++++++
 packages/core/src/__tests__/task-documents.test.ts |   3 +-
 packages/core/src/db.ts                            |  35 ++++-
 packages/core/src/index.ts                         |   8 +
 packages/core/src/plugin-activation-analytics.ts   | 104 +++++++++++++
 packages/core/src/plugin-loader.ts                 |  27 ++++
 packages/core/src/store.ts                         |  24 ++-
 packages/core/src/types.ts                         |  22 +++
 packages/core/vitest.config.ts                     |  12 ++
 .../command-center/areas/EcosystemArea.tsx         |  40 +++--
 .../command-center/areas/__tests__/areas.test.tsx  |  52 ++++++-
 .../register-command-center-routes.auth.test.ts    |   1 +
 .../register-command-center-routes.test.ts         |  29 ++++
 .../src/routes/register-command-center-routes.ts   |  20 +++
 .../src/store/__tests__/roadmap-store.test.ts      |   9 +-
 scripts/boot-smoke.mjs                             |  24 ++-
 scripts/lib/test-quarantine.json                   |  55 +++++++
 31 files changed, 799 insertions(+), 99 deletions(-)

Fusion-Task-Id: FN-6705
Fusion-Task-Lineage: 12ed6227-f935-4038-bbe9-a605a054850e
2026-06-19 16:47:33 -07:00
gsxdsm
df139ec84c FN-6736: reclaim phantom executor bindings
Recover wedged in-progress tasks by clearing stale executor bindings only after liveness proves the owner is gone.

- Add a guarded executor escape hatch that clears only stale in-memory task bookkeeping while refusing live session surfaces.
- Teach self-healing to identify phantom executor-active bindings using age, checkout, heartbeat, run-audit, and worktree liveness signals before requeueing preserved work.
- Record reclaim events in run audit and cover preserved-worktree recovery with reliability interaction tests.
- Document the recovery path and add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6736-phantom-executor-binding.md     |   5 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   1 +
 .../reclaim-phantom-executor-binding.test.ts       | 244 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  35 +++
 packages/engine/src/run-audit.ts                   |   2 +
 packages/engine/src/runtimes/in-process-runtime.ts |   3 +-
 packages/engine/src/self-healing.ts                | 112 ++++++++++
 8 files changed, 402 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6736

Fusion-Task-Lineage: c76191ba-f4c3-4832-a790-67676e258ba2
2026-06-19 16:47:33 -07:00
gsxdsm
340da92400 FN-6735: treat benign merge-seam pause aborts as retryable
Treat benign pause/resume aborts at workflow merge seams as retryable transient merge failures.

- Classify legacy, merge-region, manual-hold, and retry node ids as merge-seam graph failures.
- Route clean in-review pause/resume aborts back through bounded auto-merge retry when eligible.
- Keep conflict, contamination, foreign-work, exhausted-retry, global/user pause, and confirmed-merge cases terminal.
- Cover the lifecycle with a reliability regression test and architecture notes.

Files changed:
 docs/architecture.md                               |   4 +-
 .../merge-node-paused-abort-retryable.test.ts      | 227 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  77 ++++++-
 packages/engine/src/workflow-graph-executor.ts     |   2 +-
 4 files changed, 301 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-6735

Fusion-Task-Lineage: 3560c1e3-91e9-405a-bdfc-a243f7052803
2026-06-19 16:47:33 -07:00
gsxdsm
47e7b4a150 FN-6704: capture merge LOC for productivity analytics
Capture merge-time diff stats so Command Center Productivity can report real Lines changed when available.

- Add nullable additions/deletions columns to task commit associations with migration and storage normalization.
- Persist git shortstat counts from merge association paths without blocking merges when stats are unavailable.
- Aggregate Productivity LOC from recorded commit stats while preserving the unavailable sentinel for historical unknowns.
- Cover migration, store upsert, analytics, and merger association stats behavior with tests and documentation.

Files changed:
 .changeset/fn-6704-command-center-loc.md           |  5 ++
 docs/architecture.md                               |  4 +-
 docs/storage.md                                    |  3 +
 packages/core/src/__tests__/db-migrate.test.ts     | 32 ++++----
 packages/core/src/__tests__/db.test.ts             | 90 ++++++++++++++++------
 .../src/__tests__/productivity-analytics.test.ts   | 47 +++++++++--
 packages/core/src/__tests__/store-upsert.test.ts   | 40 ++++++++++
 packages/core/src/db.ts                            | 14 +++-
 packages/core/src/productivity-analytics.ts        | 56 +++++++++-----
 packages/core/src/store.ts                         | 17 +++-
 packages/core/src/task-lineage.ts                  |  2 +
 packages/core/src/types.ts                         |  2 +
 .../merger-commit-association-stats.test.ts        | 90 ++++++++++++++++++++++
 packages/engine/src/merger-ai.ts                   |  2 +
 packages/engine/src/merger.ts                      | 17 +++-
 15 files changed, 349 insertions(+), 72 deletions(-)

Fusion-Task-Id: FN-6704

Fusion-Task-Lineage: f079fecb-eade-4318-bc55-23aa48097b4a
2026-06-19 06:51:57 -07:00
gsxdsm
898ac1e85f FN-6698: back command center signals with incidents
Replace the Command Center signals placeholders with incidents-backed analytics.

- Add core signal aggregation over the incidents table with date filtering, breakdowns, and MTTR handling.
- Expose the signals analytics through the Command Center API and update dashboard areas to consume real data.
- Cover empty, scoped, auth, and rendered signal states with tests and update docs/changeset.

Files changed:
 .changeset/command-center-signals.md               |   5 +
 docs/architecture.md                               |   1 +
 docs/dashboard-guide.md                            |   6 +-
 .../core/src/__tests__/signals-analytics.test.ts   | 114 ++++++++++++
 packages/core/src/index.ts                         |   8 +
 packages/core/src/signals-analytics.ts             | 195 +++++++++++++++++++++
 .../components/command-center/CommandCenter.tsx    |  49 +-----
 .../command-center/areas/EcosystemArea.tsx         |   9 +-
 .../command-center/areas/ProductivityArea.tsx      |   3 +
 .../command-center/areas/SignalsArea.tsx           |  63 +------
 .../register-command-center-routes.auth.test.ts    |   1 +
 .../register-command-center-routes.test.ts         |  54 ++++++
 .../src/routes/register-command-center-routes.ts   |  23 +++
 13 files changed, 431 insertions(+), 100 deletions(-)

Fusion-Task-Id: FN-6698

Fusion-Task-Lineage: 9ce41fb2-9a92-4863-8aa7-ae124294fe09
2026-06-19 06:04:20 -07:00
gsxdsm
3566cf8a1d FN-6695: block unsafe in-review branch rebinds
Protect in-review branch metadata repair from overriding user or checkout ownership.

- Replace the stale optional auto-mutate TODO with an explicit rebind safety gate.
- Skip and audit rebind attempts for user-paused tasks or live checked-out tasks.
- Extend reliability coverage for safe autoMerge=false repairs and existing skip outcomes.
- Document the self-healing contract for unsafe metadata repair skips.

Files changed:
 docs/architecture.md                               |   2 +-
 .../in-review-branch-rebind.test.ts                | 131 ++++++++++++++++++++-
 packages/engine/src/self-healing.ts                |  64 ++++++++--
 3 files changed, 187 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-6695

Fusion-Task-Lineage: dfed3013-3bbf-433d-bb3e-434f6a6fe0e9
2026-06-19 05:02:29 -07:00
gsxdsm
af31f7ddfa FN-6657: embed system stats in Command Center
Move system telemetry out of the global header modal and into Command Center as a dedicated System area.

- add a Command Center System tab with live CPU, memory, heap, process, task, agent, and vitest controls
- remove the legacy System Stats modal entry points from desktop and mobile navigation
- update modal manager, docs, and regression coverage for the new embedded System area
- add a patch changeset for the published Fusion package

Files changed:
 .../fn-6657-system-stats-into-command-center.md    |   5 +
 docs/architecture.md                               |   2 +-
 docs/dashboard-guide.md                            |   4 +-
 packages/dashboard/app/App.tsx                     |   7 -
 packages/dashboard/app/components/AppModals.tsx    |  12 -
 packages/dashboard/app/components/Header.tsx       |   9 -
 packages/dashboard/app/components/MobileNavBar.tsx |  12 -
 .../dashboard/app/components/SystemStatsModal.css  | 319 -------------
 .../dashboard/app/components/SystemStatsModal.tsx  | 523 ---------------------
 .../app/components/__tests__/AppModals.test.tsx    |  51 --
 .../app/components/__tests__/Header.test.tsx       |  12 -
 .../app/components/__tests__/MobileNavBar.test.tsx |  13 -
 .../components/__tests__/SystemStatsModal.test.tsx | 329 -------------
 ...-merge-toggle-blank.mobile-integration.test.tsx |   1 -
 .../components/command-center/CommandCenter.tsx    |   5 +
 .../__tests__/CommandCenter.mobile-scroll.test.tsx |  46 ++
 .../__tests__/CommandCenter.test.tsx               |  57 ++-
 .../__tests__/SystemStatsArea.test.tsx             | 229 +++++++++
 .../command-center/areas/SystemStatsArea.css       | 122 +++++
 .../command-center/areas/SystemStatsArea.tsx       | 440 +++++++++++++++++
 .../app/hooks/__tests__/useModalManager.test.ts    |  23 -
 packages/dashboard/app/hooks/useModalManager.ts    |  12 -
 22 files changed, 906 insertions(+), 1327 deletions(-)

Fusion-Task-Id: FN-6657

Fusion-Task-Lineage: 7593ee86-671e-4c95-96f8-a8dc8861e7b7
2026-06-18 18:58:21 -07:00
gsxdsm
a6a3260fa3 FN-6647: preserve completed handoffs after graph aborts
Persist completed workflow handoffs so trailing graph aborts stay benign after executor cleanup.

- Derive finalized completion state from persisted task rows when volatile executor markers are gone.
- Keep genuine pause, global-pause, merge-seam, incomplete, and failed/error rows on their existing failure paths.
- Expand executor recovery tests for no-commit completions, terminal rows, stale marker cleanup, and durable classifier controls.
- Document the persisted completion-finalize classifier contract.

Files changed:
 docs/architecture.md                               |   2 +-
 .../engine/src/__tests__/executor-recovery.test.ts | 164 ++++++++++++++++++---
 packages/engine/src/executor.ts                    |  18 ++-
 3 files changed, 160 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-6647

Fusion-Task-Lineage: 71605a4c-4077-4219-bfa9-44bba2d8372c
2026-06-18 12:36:48 -07:00
gsxdsm
3b32b535d0 FN-6644: preserve finalized graph aborts
Keep no-commit completion handoffs in review when teardown reclassifies their abort provenance.

- Track completed finalize-to-review handoffs with a durable executor marker.
- Suppress false operator-action graph failures after hard-cancel teardown overwrites completion-finalize provenance.
- Cover preserved user/global pause, merge-seam, hard-cancel, terminal, and redispatch cleanup behavior.
- Document the finalized completion abort exception and add a patch changeset.

Files changed:
 .changeset/fn-6644-finalize-to-review-abort-overwrite.md  |   5 +
 docs/architecture.md                                      |   2 +-
 packages/engine/src/__tests__/executor-recovery.test.ts   | 300 +++++++++++++++++++++
 packages/engine/src/executor.ts                           |  40 ++-
 4 files changed, 342 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-6644
Fusion-Task-Lineage: 569fa84f-2cbe-45ae-b12c-874dd45cea73
2026-06-18 11:18:03 -07:00
gsxdsm
3d28b3b212 FN-6632: preserve reattached chat stream chunks
Seed streaming accumulators from durable in-flight snapshots so reattached chat bubbles keep prior chunks.

- Add initial text, thinking, and tool-call snapshots to chat stream handlers.
- Wire main chat and QuickChat reattach flows to seed handler accumulators before replayed deltas arrive.
- Cover text, thinking, and tool-call continuation across shared handler, main chat, and QuickChat tests.
- Document the reattach accumulator invariant and add a published package changeset.

Files changed:
 .changeset/fn-6632-chat-stream-reattach.md         |   5 +
 docs/architecture.md                               |   2 +-
 docs/dashboard-guide.md                            |   2 +-
 .../__tests__/createChatStreamHandlers.test.ts     |  63 +++++++
 .../dashboard/app/hooks/__tests__/useChat.test.ts  | 182 +++++++++++++++++++++
 .../app/hooks/__tests__/useQuickChat.test.ts       | 147 +++++++++++++++++
 .../app/hooks/createChatStreamHandlers.ts          |  19 ++-
 packages/dashboard/app/hooks/useChat.ts            |   7 +
 packages/dashboard/app/hooks/useQuickChat.ts       |   7 +
 9 files changed, 429 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-6632
Fusion-Task-Lineage: e2f2eb42-08aa-4bae-a79f-60cfc9fb03d4
2026-06-18 06:36:03 -07:00
gsxdsm
4315cd01c6 FN-6598: suppress stuck detection during verification
Treat bounded verification subprocesses as healthy activity so progressing tasks avoid false stuck-loop recovery.

- Bracket fn_run_verification commands with stuck-detector start/end signals.
- Suppress loop and no-progress churn while verification is active, with timeout-bounded cleanup.
- Add regression coverage for verification heartbeats, compact-and-resume recovery, and no-progress churn behavior.
- Document verification suppression in reliability guidance.

Files changed:
 docs/architecture.md                               |   5 +-
 docs/testing.md                                    |   1 +
 .../src/__tests__/executor-step-session.test.ts    |  10 +-
 .../non-progress-churn.test.ts                     |  55 +++++++++
 .../src/__tests__/run-verification-command.test.ts |  45 ++++++-
 .../src/__tests__/stuck-task-detector.test.ts      | 136 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |   2 +
 packages/engine/src/run-verification-tool.ts       |  33 +++--
 packages/engine/src/stuck-task-detector.ts         |  69 +++++++++++
 9 files changed, 341 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-6598

Fusion-Task-Lineage: 5449b413-c500-46aa-b46d-cf94c2d88710
2026-06-18 00:39:01 -07:00
gsxdsm
98ccf8a293 FN-6625: classify completion finalization aborts
Prevent completed no-commit executions that already advanced to review from being re-parked as pause-abort failures.

- Add completion-finalize pause-abort provenance and exclude it from genuine pause handling after review handoff.
- Mark paused-after-completion finalization paths with the new provenance before handing tasks to review.
- Cover the finalize-to-review abort recovery path with executor regression tests and document the lifecycle exception.
- Add a patch changeset for the published Fusion package.

Files changed:
 .changeset/fn-6625-finalize-to-review-abort.md     |   5 +
 docs/architecture.md                               |   2 +-
 .../engine/src/__tests__/executor-recovery.test.ts | 158 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    |  26 +++-
 4 files changed, 185 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-6625

Fusion-Task-Lineage: 728f6fe5-4c27-4597-b17e-e16ff97b9277
2026-06-18 00:01:32 -07:00
gsxdsm
5b9ff047d3 FN-6599: preserve chat thread during streaming attach
Keep existing chat history visible when attaching to an in-flight streaming response.

- Commit attach-triggered message loads for the streaming session before active session refs settle.
- Avoid clearing cached main chat messages on attach cache misses while fetching prior thread history.
- Add regression coverage for main chat and QuickChat streaming thread visibility, plus quarantine ledger updates.

Files changed:
 .changeset/fn-6599-chat-streaming-thread.md        |   5 +
 docs/architecture.md                               |   1 +
 docs/dashboard-guide.md                            |   2 +-
 packages/core/vitest.config.ts                     |   1 +
 .../__tests__/ChatView.streaming-thread.test.tsx   | 168 +++++++++++++++++++++
 .../dashboard/app/hooks/__tests__/useChat.test.ts  |  51 +++++++
 .../app/hooks/__tests__/useQuickChat.test.ts       |  39 +++++
 packages/dashboard/app/hooks/useChat.ts            |  37 +++--
 packages/dashboard/app/hooks/useQuickChat.ts       |  27 ++--
 scripts/lib/test-quarantine.json                   |   5 +
 10 files changed, 307 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-6599

Fusion-Task-Lineage: b2c94391-6a5b-4048-836d-e4bc56e16786
2026-06-17 17:49:20 -07:00
gsxdsm
e2a3a37b26 FN-6569: make auto-merge retry cap configurable
Adds a project setting that controls how many auto-merge conflict retries run before recovery paths give up.

- Add maxAutoMergeRetries to project settings defaults, schema, types, and dashboard controls.
- Resolve the retry cap in engine merge handling, self-healing recovery, stall detection, and blocker fanout logic.
- Cover custom retry caps with core, dashboard, and engine regression tests.

Files changed:
 .changeset/fn-6569-max-auto-merge-retries.md       |  5 ++
 docs/architecture.md                               |  2 +-
 docs/settings-reference.md                         |  1 +
 .../core/src/__tests__/settings-defaults.test.ts   | 12 ++++
 packages/core/src/in-review-stall.ts               | 16 ++++-
 packages/core/src/index.ts                         |  1 +
 packages/core/src/settings-schema.ts               |  6 ++
 packages/core/src/task-priority.ts                 |  4 +-
 packages/core/src/types.ts                         |  8 +++
 .../dashboard/app/components/SettingsModal.tsx     |  8 +++
 .../components/settings/sections/MergeSection.tsx  | 26 +++++++
 .../app/hooks/__tests__/useBlockerFanout.test.ts   |  5 +-
 packages/dashboard/app/hooks/useBlockerFanout.ts   |  3 +-
 .../auto-merge-retry-cap-settings.test.ts          | 79 ++++++++++++++++++++++
 packages/engine/src/project-engine.ts              | 77 +++++++++++++--------
 packages/engine/src/self-healing.ts                | 30 +++++---
 16 files changed, 236 insertions(+), 47 deletions(-)

Fusion-Task-Id: FN-6569
Fusion-Task-Lineage: 42242d6a-68bc-41f1-b2d9-af2e6f168eed
2026-06-17 04:51:31 -07:00
gsxdsm
6ced5d73de FN-6568: route merge-seam graph aborts to retry
Classify merge-seam abort provenance so non-paused merge graph failures retry instead of parking as pauses.

- Track paused-abort provenance separately from the legacy pause-abort bit.
- Route merge and requestMerge graph failures through bounded auto-merge retry when they are not genuine pauses.
- Preserve user/global pause parking behavior with regression coverage and document the lifecycle invariant.

Files changed:
 .../fn-6568-merge-seam-abort-classification.md     |   5 +
 docs/architecture.md                               |   1 +
 .../engine/src/__tests__/executor-recovery.test.ts | 131 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    | 122 +++++++++++++------
 4 files changed, 221 insertions(+), 38 deletions(-)

Fusion-Task-Id: FN-6568

Fusion-Task-Lineage: 5d9ee4f8-0336-4fb9-aa95-beb65e6c1ed9
2026-06-17 04:16:10 -07:00
gsxdsm
bc6dfd386e FN-6478: surface paused workflow graph failures
Surface stranded paused workflow exits as actionable executor failures.

- Treat paused or aborted graph exits as benign only while the live task remains in-progress.
- Preserve terminal/review lifecycle state while recording operator-actionable failure evidence for advanced columns.
- Cover user-paused, pause-aborted, existing-failure, in-progress, in-review, todo, and done column recovery paths.
- Document the workflow lifecycle invariant and add a patch changeset.

Files changed:
 .changeset/fn-6478-paused-workflow-executions.md   |   5 +
 docs/architecture.md                               |   1 +
 .../engine/src/__tests__/executor-recovery.test.ts | 283 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  30 ++-
 4 files changed, 315 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6478

Fusion-Task-Lineage: 219d8612-6604-4dbc-9a3a-a1c7837419c1
2026-06-15 02:30:41 -07:00
gsxdsm
fee0178b4f FN-6461: block incomplete no-commits no-op finalization
Add a shared no-op finalize guard so no-commits tasks with mostly incomplete steps return to todo instead of silently completing.

- Add core step-evidence evaluation for no-commits no-op finalization.
- Apply the guard across AI empty merge, early empty-own-diff, legacy no-op classifier, direct no-op, and self-healing finalize lanes.
- Emit run-audit/log evidence and preserve progress when demoting blocked tasks.
- Cover guard behavior with core, merger, AI merge, real-git, and self-healing tests.
- Document the finalize integrity invariant and add a patch changeset.

Files changed:
 .changeset/fn-6461-no-commits-finalize-guard.md    |   5 +
 docs/architecture.md                               |   2 +
 .../__tests__/no-commits-finalize-guard.test.ts    |  58 +++++++
 packages/core/src/index.ts                         |   2 +
 packages/core/src/no-commits-finalize-guard.ts     |  42 +++++
 packages/engine/src/__tests__/merger-ai.test.ts    |  59 +++++++
 .../merger-finalize-unproven.real-git.test.ts      | 176 +++++++++++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 125 +++++++++++++++
 packages/engine/src/merger-ai.ts                   |  45 ++++++
 packages/engine/src/merger.ts                      | 130 +++++++++++++++
 packages/engine/src/run-audit.ts                   |   6 +
 packages/engine/src/self-healing.ts                |  41 ++++-
 12 files changed, 689 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6461
Fusion-Task-Lineage: 36647768-42da-414a-9304-d8e0ed61b99c
2026-06-15 02:29:08 -07:00
gsxdsm
7b839069b5 FN-6420: run dependency sync in AI merge worktrees
Run configured or inferred dependency installs before AI merge verification uses the clean-room worktree.

- Add shared dependency-sync helpers with install marker caching for inferred lockfile installs.
- Run dependency sync during AI clean-room merges and audit/log the command, skip reason, and duration.
- Reuse the helper from merger paths while documenting the new behavior and covering install success/failure cases.

Files changed:
 .changeset/fn-6420-ai-merge-dependency-sync.md     |   5 +
 docs/architecture.md                               |   2 +-
 docs/settings-reference.md                         |   2 +-
 .../src/__tests__/executor-step-session.test.ts    |   5 +-
 .../merger-ai-dependency-install.slow.test.ts      | 269 +++++++++++++++++++++
 packages/engine/src/merge-dependency-sync.ts       | 144 +++++++++++
 packages/engine/src/merger-ai.ts                   |  31 +++
 packages/engine/src/merger.ts                      | 120 +++------
 packages/engine/src/run-audit.ts                   |   1 +
 9 files changed, 484 insertions(+), 95 deletions(-)

Fusion-Task-Id: FN-6420

Fusion-Task-Lineage: 49353cb6-4953-4670-b620-a90331f048dc
2026-06-13 21:09:12 -07:00
gsxdsm
f68775a5a6 FN-6376: preserve user-paused tasks during recovery
Ensure automated resume and recovery paths leave user-paused tasks paused.

- Skip user-paused tasks when cascading agent resume and approval-decision unpauses.
- Preserve userPaused during stuck-task recovery and log skipped recoveries for user-paused tasks.
- Add regression coverage across engine heartbeat, self-healing, and dashboard route surfaces.
- Document the invariant and add a patch changeset.

Files changed:
 .changeset/fn-6376-user-paused-stays-paused.md     |  5 ++++
 docs/architecture.md                               |  1 +
 .../src/__tests__/routes-agent-runs.test.ts        |  4 +++
 .../src/__tests__/routes-approval.test.ts          | 26 +++++++++++++++--
 .../src/routes/register-agent-runtime-routes.ts    |  2 +-
 .../src/routes/register-approval-routes.ts         |  2 +-
 .../src/__tests__/heartbeat-executor.test.ts       | 28 ++++++++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 33 +++++++++++++++++++++-
 packages/engine/src/agent-heartbeat.ts             |  3 +-
 packages/engine/src/self-healing.ts                | 12 ++++++--
 10 files changed, 108 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6376
Fusion-Task-Lineage: efa00cb1-58e1-496a-919b-69867f8bff3c
2026-06-13 10:44:01 -07:00
gsxdsm
bffae81a98 FN-6277: track and reconcile legacy auto-merge stamps
Track legacy auto-merge stamp provenance and add safe operator cleanup.

- Add autoMergeProvenance storage and migration support so user overrides can be distinguished from legacy review-entry stamps.
- Mark existing ambiguous in-review autoMerge=true tasks as legacy stamps without changing behavior, and expose a dry-run/apply reconciliation API to clear them safely.
- Emit a non-mutating advisory when global auto-merge is disabled while legacy stamped review tasks remain.
- Cover migration, persistence, reconciliation, movement, merge resolution, and advisory behavior with regression tests and docs.

Files changed:
 .../fn-6277-legacy-automerge-stamp-cleanup.md      |   5 +
 docs/architecture.md                               |   2 +-
 docs/settings-reference.md                         |   2 +-
 packages/core/src/__tests__/db-migrate.test.ts     |  30 ++--
 packages/core/src/__tests__/db.test.ts             |  44 +++---
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 .../legacy-automerge-stamp-reconcile.test.ts       | 144 +++++++++++++++++++
 .../src/__tests__/merge-request-record.test.ts     |   2 +-
 packages/core/src/__tests__/mission-store.test.ts  |   2 +-
 packages/core/src/__tests__/run-audit.test.ts      |   4 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/store-movement.test.ts |  14 ++
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/__tests__/task-merge.test.ts     |  16 ++-
 packages/core/src/db.ts                            |  10 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/store.ts                         | 157 ++++++++++++++++++++-
 packages/core/src/task-merge.ts                    |   8 +-
 packages/core/src/types.ts                         |  10 +-
 .../automerge-toggle-legacy-advisory.test.ts       | 128 +++++++++++++++++
 packages/engine/src/project-engine.ts              |  68 ++++++++-
 22 files changed, 593 insertions(+), 70 deletions(-)

Fusion-Task-Id: FN-6277

Fusion-Task-Lineage: 22d36519-f2ba-4ca7-8a09-12fc803c9a5b
2026-06-13 05:06:05 -07:00
gsxdsm
4e6df035c1 FN-6275: allow verified no-op completions
Allow executors to finish already-satisfied tasks without fabricating commits while preserving existing completion guards.

- Add leading sentinel parsing for premise-stale, no-op, duplicate, and redundant completion summaries.
- Permit zero-commit fn_task_done only for recognized sentinels or existing no-commit contracts, with audit log/activity details.
- Document the verified no-op completion contract and add regression coverage for accepted and refused paths.

Files changed:
 .changeset/fn-6275-no-op-completion.md             |   5 ++
 docs/architecture.md                               |   1 +
 .../src/__tests__/no-op-completion-marker.test.ts  |  55 ++++++++++++
 packages/core/src/agent-prompts.ts                 |   4 +
 packages/core/src/index.ts                         |   5 ++
 packages/core/src/no-op-completion-marker.ts       |  48 ++++++++++
 .../__tests__/executor-task-done-invariant.test.ts | 100 +++++++++++++++++++++
 .../engine/src/__tests__/executor-test-helpers.ts  |   1 +
 packages/engine/src/executor.ts                    |  64 ++++++++++++-
 9 files changed, 279 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6275

Fusion-Task-Lineage: 0a2ec21b-415f-411c-bfcd-4f1c19a6a136
2026-06-13 02:54:57 -07:00