Commit Graph

2555 Commits

Author SHA1 Message Date
gsxdsm
2a37ee4e59 FN-6341: settle cli-agent re-entry test promise
Stabilize the cli-agent re-entry regression test by awaiting the original run after the replacement session succeeds.

- Keep the first cli-agent run promise instead of dropping it with void.
- Assert the active task session still points at the first PTY before simulating re-entry.
- Kill and await the first session at the end so no hub or store work outlives teardown.

Files changed:
 packages/engine/src/__tests__/cli-agent-executor.test.ts | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6341

Fusion-Task-Lineage: 3e365f21-0d05-496a-adec-aa782aa83503
2026-06-13 04:06:17 -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
gsxdsm
0765913db9 Merge branch 'fix/fn-352-no-commit-coordination' 2026-06-13 00:03:17 -07:00
gsxdsm
000a73b3f0 Merge origin/main into fix/fn-352-no-commit-coordination
Reconcile the FN-352 no-commit coordination guard skip with main's
independently-landed FN-424 work. Both branches added a no_commits
guard bypass at the same fn_task_done call site:

- FN-352 (this branch): getNoCommitEligibilityReason(task) covering
  Review Level 1 coordination prompts with board-only scope and
  explicit no-source intent (e.g. "Do not change product source").
- FN-424 (main): evaluatePromptDerivedNoCommitEligibility(...) plus
  non-blocking audit logging of the skip.

Their prompt phrase-matching differs, so neither alone satisfies the
merged test file. Resolved by OR-ing both eligibility checks and
wrapping the skip in main's audit-logging block. Both helpers still
refuse the contradictory implementation+coordination prompt.

All 18 executor-task-done-invariant tests pass; engine typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 00:01:30 -07:00
gsxdsm
a9b11399d9 FN-6336: reattach orphaned assigned executions
Self-healing now resumes stranded assigned in-progress work when an agent has no active run or execution.

- Add a self-healing pass that groups stale assigned in-progress tasks by durable agent and calls the executor resume seam without moving tasks backward.
- Emit run-audit telemetry for reattached orphaned executions and wire the resume hook through the in-process runtime.
- Cover grace windows, pause/active-run/active-execution guards, task filtering, and registration order with engine tests.
- Document the recovery behavior and add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6336-reattach-orphaned-executions.md |   5 +
 docs/agents.md                                     |   2 +
 docs/architecture.md                               |   2 +
 ...lf-healing-reattach-orphaned-executions.test.ts | 217 +++++++++++++++++++++
 packages/engine/src/run-audit.ts                   |   1 +
 packages/engine/src/runtimes/in-process-runtime.ts |   1 +
 packages/engine/src/self-healing.ts                | 122 ++++++++++++
 7 files changed, 350 insertions(+)

Fusion-Task-Id: FN-6336

Fusion-Task-Lineage: 6d8519b9-d8b0-4726-9b45-bfa445b7883e
2026-06-12 23:17:28 -07:00
gsxdsm
011b401764 Merge pull request #1668 from plarson/fix/fn-424-plan-only-no-commit
fix(FN-424): allow plan-only no-commit completion
2026-06-12 22:01:03 -07:00
gsxdsm
1450d39976 Merge origin/main into fix/fn-424-plan-only-no-commit
Resolve conflicts from main's FN-6232 single-source triage prompt refactor:
- Drop the inline FAST_TRIAGE_SYSTEM_PROMPT const removed by main; the fast
  triage prompt now lives in agent-prompts.ts (planning-fast seam).
- Migrate the PR's no-commit/operational-routing heuristic edits into the
  fast block of agent-prompts.ts (standard block already carried them).
- Point triage tests at FAST_PLANNING_PROMPT/TRIAGE_POLICY_PROMPT instead of
  the removed const.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 21:47:57 -07:00
gsxdsm
ac8ad834ce Merge branch 'main' into fix/fn-352-no-commit-coordination 2026-06-12 21:39:07 -07:00
gsxdsm
0457144111 Merge pull request #1665 from plarson/fix/insights-extract-response
fix(dashboard): repair insight extraction and research provider config
2026-06-12 21:36:20 -07:00
gsxdsm
9d0573a2ee Merge pull request #1663 from plarson/fix/fn-343-merge-worktree-cleanup
fix: classify harmless merge worktree cleanup failures
2026-06-12 21:34:51 -07:00
gsxdsm
167f9b0542 FN-6324: allow opted-in engineer backlog auto-claim
Engineer backlog auto-claim now respects an explicit opt-in while keeping the default executor-only behavior.

- Add engineerBacklogAutoClaim settings and runtime overrides for backlog pickup role checks.
- Update heartbeat auto-claim filtering, logs, and no-task prompt guidance for opted-in engineer agents.
- Cover executor/default engineer/opted-in engineer routing with core and heartbeat tests.
- Document the setting and record quarantined unrelated temp-root flakes seen during verification.

Files changed:
 .changeset/FN-6324-engineer-backlog-auto-claim.md  |  5 ++
 docs/agents.md                                     |  3 +
 docs/settings-reference.md                         |  1 +
 .../core/src/__tests__/agent-role-policy.test.ts   | 33 +++++++++-
 packages/core/src/agent-role-policy.ts             | 11 +++-
 packages/core/src/settings-schema.ts               |  1 +
 packages/core/src/types.ts                         |  4 ++
 packages/core/vitest.config.ts                     |  6 ++
 .../src/__tests__/heartbeat-executor.test.ts       | 70 ++++++++++++++++++++++
 packages/engine/src/agent-heartbeat.ts             | 65 +++++++++++++++-----
 scripts/lib/test-quarantine.json                   | 20 +++++++
 11 files changed, 199 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-6324

Fusion-Task-Lineage: 4d124d98-4ad1-44ce-a76c-f1db3199b3c6
2026-06-12 19:45:37 -07:00
gsxdsm
e17e8b34f8 FN-6319: quarantine flaky engine tests
Quarantine unrelated engine test flakes so the gate avoids known unstable fixtures.

- Add the soft-delete blocker residue reliability test to the quarantine ledger and reliability interaction exclusions.
- Add the bubblewrap sandbox backend test to the quarantine ledger and engine-core exclusions.

Files changed:
 packages/engine/vitest.config.ts |  6 +++++-
 scripts/lib/test-quarantine.json | 10 ++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6319
Fusion-Task-Lineage: 9a47ae20-76b8-47d8-8858-f4fe51ea807e
2026-06-12 17:47:02 -07:00
Phil Larson
285f238e92 fix(FN-424): keep audit logging non-blocking 2026-06-12 16:08:00 -07:00
Phil Larson
f331419867 fix(FN-424): simplify prompt scope parsing 2026-06-12 15:59:58 -07:00
Phil Larson
8541db3185 fix(engine): normalize dashboard research providers 2026-06-12 15:57:12 -07:00
Phil Larson
c6bcbe26a2 fix(FN-352): address no-commit review feedback 2026-06-12 15:54:47 -07:00
Phil Larson
3a729f53a9 fix(FN-352): allow no-commit coordination completion 2026-06-12 15:51:50 -07:00
Phil Larson
834ea3c227 fix(FN-343): address follow-up review findings 2026-06-12 15:51:50 -07:00
Phil Larson
16d71e6773 fix(FN-343): address PR review feedback 2026-06-12 15:51:50 -07:00
Phil Larson
92c5503f88 test(FN-343): cover merger temp cleanup visibility
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:51:45 -07:00
Phil Larson
3cfc3972a5 fix(FN-343): classify pruned temp merge worktree removals
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:51:45 -07:00
Phil Larson
21afa84b2b test(FN-343): add regression for temp cleanup classification
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:51:40 -07:00
Phil Larson
02a85818c1 fix(FN-343): address follow-up review findings 2026-06-12 15:51:15 -07:00
Phil Larson
2ac9968ea5 fix(FN-343): address PR review feedback 2026-06-12 15:51:15 -07:00
Phil Larson
14cc9d82d1 test(FN-343): cover merger temp cleanup visibility
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:50:53 -07:00
Phil Larson
b094e0c765 fix(FN-343): classify pruned temp merge worktree removals
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:50:53 -07:00
Phil Larson
af830ac770 test(FN-343): add regression for temp cleanup classification
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:45:16 -07:00
Phil Larson
e9b48bd50c fix(FN-424): address no-commit review edge cases 2026-06-12 15:45:04 -07:00
Phil Larson
fb4a5e912a feat(FN-424): complete Step 3 — guide operational no-commit planning
Fusion-Task-Id: FN-424

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:02:41 -07:00
Phil Larson
ab35c87114 test(FN-424): prove no-commit guard preserves worktree checks
Fusion-Task-Id: FN-424

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:00:19 -07:00
Phil Larson
35502afdb8 fix(FN-424): align no-commit regression fixtures
Fusion-Task-Id: FN-424

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 14:58:40 -07:00
Phil Larson
cb128f5824 test(FN-424): cover plan-only no-commit finalization
Fusion-Task-Id: FN-424

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 14:58:39 -07:00
gsxdsm
039d3ce440 FN-6236: move fast triage into workflow settings
Move fast triage prompting into the workflow/settings prompt model.

- Add a core-owned fast triage prompt and expose the workflow prompt mode type.
- Add a fast-mode builtin workflow variant and route triage prompt selection through workflow settings.
- Remove the engine-local fast triage prompt constant and update triage tests for workflow-driven fast mode.
- Document the fast triage prompt mode setting and add a patch changeset.

Files changed:
 .changeset/FN-6236-fast-mode-workflow-variant.md   |   7 +
 docs/settings-reference.md                         |   2 +
 packages/core/src/__tests__/agent-prompts.test.ts  |  16 +-
 .../builtin-workflow-settings-triage.test.ts       |   5 +
 packages/core/src/agent-prompts.ts                 | 221 +++++++++++++++++++
 packages/core/src/builtin-workflow-prompts.ts      |  12 +-
 packages/core/src/builtin-workflow-settings.ts     |  18 +-
 packages/core/src/index.ts                         |   5 +
 packages/core/src/types.ts                         |   4 +
 .../triage-duplicate-search-regression.test.ts     |  18 +-
 .../triage-fast-mode-workflow-variant.test.ts      | 219 +++++++++++++++++++
 .../triage-planning-prompt-single-source.test.ts   |   8 +-
 packages/engine/src/__tests__/triage.test.ts       |  64 +++---
 packages/engine/src/triage.ts                      | 235 ++-------------------
 14 files changed, 565 insertions(+), 269 deletions(-)

Fusion-Task-Id: FN-6236

Fusion-Task-Lineage: 369954d8-41e7-4d88-aa6d-e6bbca077d50
2026-06-12 14:39:51 -07:00
gsxdsm
751d94244c FN-6294: collapse workflow merge primitives
Collapse built-in workflow merge-policy primitives back to the legacy merge seam until graph execution owns merge policy end-to-end.

- Treat all merge-policy primitive node kinds as a synthetic legacy merge node during graph traversal.
- Preserve shadow-stage parity by mapping the synthetic merge node into legacy stage transitions.
- Add regression coverage for success, failure, pre-merge review failure, and alternate merge-region entry points.
- Record a patch changeset for the published Fusion package.

Files changed:
 .changeset/fn-6294-merge-region-collapse.md        |   5 +
 .../workflow-graph-executor-handlers.test.ts       |  13 ++-
 .../workflow-graph-merge-region-collapse.test.ts   | 116 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  14 ++-
 packages/engine/src/workflow-graph-executor.ts     |  63 ++++++++++-
 5 files changed, 203 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6294

Fusion-Task-Lineage: fe86b5e2-861f-448d-8db0-b0332e6ad76f
2026-06-12 14:21:18 -07:00
gsxdsm
ba610a1c0e FN-6296: fix stuck-kill force-requeue cleanup
Reap hung executor surfaces before requeueing stuck-kill timeout tasks.

- terminate spawned child agents and active session surfaces before clearing execution guards
- remove stale worktrees during force-requeue while preserving concurrent recovery ownership
- add regression coverage and architecture notes for the cleanup contract

Files changed:
 docs/architecture.md                               |   2 +
 .../engine/src/__tests__/executor-recovery.test.ts | 248 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    |  61 ++++-
 3 files changed, 305 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-6296

Fusion-Task-Lineage: a393e2b1-a72c-4d7b-9de2-6bf7268986d4
2026-06-12 14:08:52 -07:00
gsxdsm
283adce4d0 FN-6295: move AI merge clean rooms into worktrees
Move AI-merge clean-room worktrees into the configured worktrees directory while preserving legacy cleanup.

- Resolve AI-merge roots through the configured worktrees directory using a hidden .ai-merge container.
- Keep local git excludes and stale cleanup compatible with legacy .fusion/ai-merge and tmpdir locations.
- Exclude the .ai-merge container from worktree pool and self-healing one-level sweeps.
- Add regression coverage for path resolution, cleanup, orphan reap, and cap enforcement behavior.
- Update architecture and agent guidance for the relocated clean-room root.

Files changed:
 AGENTS.md                                          |  2 +-
 docs/architecture.md                               |  4 +-
 .../engine/src/__tests__/merger-ai-cleanup.test.ts | 50 +++++++++----
 .../__tests__/self-healing-tempdir-sweep.test.ts   | 87 +++++++++++++++++++---
 .../engine/src/__tests__/worktree-paths.test.ts    | 24 ++++++
 .../engine/src/__tests__/worktree-pool.test.ts     | 55 ++++++++++++++
 packages/engine/src/merger-ai.ts                   | 27 +++++--
 packages/engine/src/self-healing.ts                | 25 +++----
 packages/engine/src/worktree-paths.ts              | 17 +++++
 packages/engine/src/worktree-pool.ts               | 10 +--
 10 files changed, 247 insertions(+), 54 deletions(-)

Fusion-Task-Id: FN-6295
Fusion-Task-Lineage: d95d32c2-3253-4964-b68a-252b4cb65109
2026-06-12 12:49:34 -07:00
gsxdsm
0897b2a0bf FN-6281: add bounded graph resume retries
Add a narrow persisted retry path for transient workflow-graph failures during resume after restart or unpause.

- Persist graphResumeRetryCount with schema migration, store round-tripping, manual retry reset, and task serialization coverage.
- Retry only no-progress execute-seam graph failures immediately following resume markers, then clear transient status/error and re-run within a capped budget.
- Preserve terminal graph failure handling for explicit reasons, durable task failures, completed progress, non-resume cases, and exhausted retry budgets.
- Document the resume-limbo retry contract and add a patch changeset for @runfusion/fusion.

Files changed:
 .changeset/fn-6281-graph-resume-retry.md           |   5 +
 docs/architecture.md                               |   1 +
 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 +-
 .../core/src/__tests__/manual-retry-reset.test.ts  |   1 +
 .../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 +-
 .../core/src/__tests__/store-persistence.test.ts   |  22 +++
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |  10 +-
 packages/core/src/manual-retry-reset.ts            |   1 +
 packages/core/src/store.ts                         |  14 +-
 packages/core/src/types.ts                         |   5 +
 .../engine/src/__tests__/executor-recovery.test.ts | 201 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  54 ++++++
 19 files changed, 359 insertions(+), 53 deletions(-)

Fusion-Task-Id: FN-6281

Fusion-Task-Lineage: f9061445-8624-465a-9255-c3d02eac1bdb
2026-06-12 11:10:12 -07:00
gsxdsm
36ba1b9d68 FN-6292: prevent dependency-blocking file leases
Prevent dependency waiters from holding file-scope leases that can block their own dependencies.

- Exclude in-progress tasks with unmet scheduling dependencies from active overlap lease maps.
- Add self-healing recovery for existing dependency/lease circular waits with triple-proof auditing.
- Cover scheduler and self-healing behavior with regression tests and document the new audit events.

Files changed:
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   5 +-
 packages/engine/src/__tests__/scheduler.test.ts    | 108 +++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 172 ++++++++++++++++++++-
 packages/engine/src/scheduler.ts                   |  67 +++++---
 packages/engine/src/self-healing.ts                | 132 ++++++++++++++++
 6 files changed, 462 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-6292
Fusion-Task-Lineage: 7c0e852d-bdb1-4775-a6b7-2b60b7583da1
2026-06-12 10:49:02 -07:00
gsxdsm
f7f2cae9d0 FN-6237: apply frontend UX criteria as workflow policy
Move frontend UX criteria out of triage self-instructions and into deterministic workflow policy.

- Add a shared frontend UX policy helper that matches frontend file scopes and injects the byte-equivalent checklist idempotently.
- Apply the policy during triage finalization and persist the updated PROMPT.md when applicable.
- Replace the legacy prompt-based injection instructions with a pointer to the deterministic policy.
- Cover path matching, insertion behavior, and checklist parity with focused core tests.
- Add a minor changeset for the published Fusion package.

Files changed:
 .changeset/fn-6237-frontend-ux-policy.md           |   5 +
 .../core/src/__tests__/frontend-ux-policy.test.ts  | 119 +++++++++++++++++
 packages/core/src/agent-prompts.ts                 |  29 +---
 packages/core/src/frontend-ux-policy.ts            | 148 +++++++++++++++++++++
 packages/core/src/index.ts                         |   1 +
 packages/engine/src/triage.ts                      |  19 ++-
 6 files changed, 291 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-6237

Fusion-Task-Lineage: 7ac95064-9ec6-4760-8609-20c35075aca1
2026-06-12 09:24:02 -07:00
gsxdsm
2085610e9e FN-6246: move AI merge clean rooms into repo storage
Move AI merge clean-room worktrees into a repo-local ignored root while preserving legacy temp cleanup.

- Add repo-local `.fusion/ai-merge` resolution and ignore handling for AI merge worktrees.
- Sweep both repo-local clean rooms and legacy tempdir worktrees with active-session and age safeguards.
- Prune stale git worktree metadata after cleanup and classify missing clean-room errors as transient.
- Update cleanup tests, architecture docs, and changeset coverage for the relocation.

Files changed:
 .changeset/fn-6246-ai-merge-cleanroom-relocation.md       |   5 +
 AGENTS.md                                          |   2 +-
 docs/architecture.md                               |   6 +-
 .../merger-ai-cleanup-active-session.test.ts       |  22 ++-
 .../engine/src/__tests__/merger-ai-cleanup.test.ts |  48 +++++-
 .../ai-merge-worktree-cleanup.test.ts              |  26 ++-
 .../__tests__/self-healing-tempdir-sweep.test.ts   |  34 ++++
 .../transient-merge-error-classifier.test.ts       |   2 +
 packages/engine/src/merger-ai.ts                   | 144 ++++++++++-------
 packages/engine/src/self-healing.ts                | 180 ++++++++++++---------
 .../engine/src/transient-merge-error-classifier.ts |  14 +-
 11 files changed, 325 insertions(+), 158 deletions(-)

Fusion-Task-Id: FN-6246
Fusion-Task-Lineage: f6fe8ef2-aa7b-4cc3-903f-b7a5cc165487
2026-06-12 06:49:29 -07:00
gsxdsm
bd1c533120 FN-6280: stabilize self-healing recovery patch test
Stabilize the self-healing dirty worktree recovery test by avoiding timer and async cleanup races.

- Force real timers for branch conflict reclaim tests.
- Provide explicit integration branch settings and dispatcher behavior for the recovery path.
- Use synchronous fixture setup and cleanup around the recovery patch assertion.

Files changed:
 packages/engine/src/__tests__/self-healing.test.ts | 77 +++++++++++++---------
 1 file changed, 46 insertions(+), 31 deletions(-)

Fusion-Task-Id: FN-6280

Fusion-Task-Lineage: ef93f14a-1d16-4cca-ac6d-3cfd7249ca21
2026-06-12 05:12:00 -07:00
gsxdsm
ec4b247a86 FN-6284: refire deferred agent assignments
Ensure assigned agents resume task work even when their heartbeat loop is idle.

- add deferred assignment refiring when an agent is assigned work without an active heartbeat run
- track in-process runtime activity so scheduled work is not double-started
- cover idle, active, and concurrent heartbeat assignment paths with scheduler and runtime tests
- document the deferred assignment wake-up behavior and add a changeset

Files changed:
 .changeset/fn-6284-deferred-assignment-refire.md   |   5 +
 docs/agents.md                                     |   2 +
 docs/architecture.md                               |   1 +
 .../src/__tests__/heartbeat-scheduler.test.ts      | 174 ++++++++++++++++++++-
 packages/engine/src/agent-heartbeat.ts             | 109 ++++++++++++-
 .../runtimes/__tests__/in-process-runtime.test.ts  |  24 +++
 packages/engine/src/runtimes/in-process-runtime.ts |   3 +
 7 files changed, 311 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6284
Fusion-Task-Lineage: cf8a9abe-163e-45c6-961a-095891e45ea5
2026-06-12 03:00:45 -07:00
gsxdsm
6f5be09edb FN-6276: suppress repeated queued overlap recovery logs
Deduplicate self-healing log entries for queued tasks that remain blocked by the same active file-scope overlap.

- Track the last active overlap blocker logged per task and skip duplicate preserved-queued log entries across self-healing passes.
- Clear the memo when blockers change, resolve, or the manager stops so legitimate future recoveries are still logged.
- Cover unchanged blockers, blocker changes, resolved blockers, stop/reset behavior, and FN-5488 stale-blockedBy preservation with regression tests.

Files changed:
 packages/engine/src/__tests__/self-healing.test.ts | 123 +++++++++++++++++++++
 packages/engine/src/self-healing.ts                |  61 ++++++++--
 2 files changed, 177 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6276

Fusion-Task-Lineage: 169d4402-ec4e-4fa9-8225-2f545c11a3f7
2026-06-11 22:25:41 -07:00
gsxdsm
d73d8f4036 FN-6241: rescue quarantined engine tests
Rescue quarantined engine tests by adding deterministic seams and fake-timer flushing.\n\n- Add an injectable staged-files reader for squash file-scope invariant checks while preserving the production git-backed default.\n- Update file-scope invariant tests to use the deterministic staged-files seam instead of child_process mocking.\n- Stabilize project engine reconciliation retry coverage by avoiding mixed real timers in fake-timer tests.\n- Remove the rescued engine tests from Vitest excludes and the quarantine ledger.\n\nFiles changed:\n .../__tests__/merger-file-scope-invariant.test.ts  | 39 ++++++++++++----------\n .../src/__tests__/project-engine-manager.test.ts   | 18 +++++-----\n packages/engine/src/merger.ts                      | 22 ++++++++----\n packages/engine/vitest.config.ts                   |  3 --\n scripts/lib/test-quarantine.json                   | 10 ------\n 5 files changed, 48 insertions(+), 44 deletions(-)

Fusion-Task-Id: FN-6241

Fusion-Task-Lineage: c1c0d40c-7581-4bcf-8244-688ea04d12b9
2026-06-11 22:17:55 -07:00
gsxdsm
d23c5d901f FN-6247: refresh PR controls from live auto-merge setting
Keep task detail PR and review affordances synchronized with the current project auto-merge setting.

- Thread the live auto-merge value into task detail modals and list split-pane detail views.
- Prefer the live auto-merge setting over the stale fetched modal snapshot while preserving task-level overrides.
- Cover PR and review tab behavior for auto-merge on/off and document the dashboard behavior.
- Evict flaky engine gate entries and add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6247-automerge-off-modal-stale.md    |   5 +
 docs/dashboard-guide.md                            |   1 +
 packages/dashboard/app/App.tsx                     |   3 +-
 packages/dashboard/app/components/AppModals.tsx    |   2 +
 packages/dashboard/app/components/ListView.tsx     |   3 +
 .../dashboard/app/components/TaskDetailModal.tsx   |   4 +-
 .../__tests__/TaskDetailModal.create-pr.test.tsx   | 171 ++++++++++++++++++++-
 packages/engine/vitest.config.ts                   |   2 -
 8 files changed, 182 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-6247

Fusion-Task-Lineage: 1321c03a-216d-4b15-bf4f-95621d68c9ae
2026-06-11 22:11:44 -07:00
gsxdsm
65251d2e6b FN-6252: stop agent pauses from pausing tasks
Agent pause and sleep flows now leave task pause state under explicit task controls.\n\n- Remove automatic task pausing from heartbeat pauseAgent and dashboard fallback state changes.\n- Default resume task cascade to off while retaining legacy opt-in unpause cleanup.\n- Cover agent sleep, heartbeat execution, and dashboard fallback pause behavior with regression tests.\n- Document task pause ownership and add a patch changeset.\n\nFiles changed:\n .changeset/fn-6252-no-agent-task-autopause.md      |  5 ++\n docs/agents.md                                     |  2 +-\n docs/architecture.md                               |  4 ++\n .../src/__tests__/routes-agent-runs.test.ts        | 32 +++++++++\n .../src/routes/register-agent-runtime-routes.ts    | 17 -----\n .../src/__tests__/heartbeat-executor.test.ts       | 75 ++++++++++++++++++++--\n packages/engine/src/agent-heartbeat.ts             | 29 +++------\n 7 files changed, 121 insertions(+), 43 deletions(-)

Fusion-Task-Id: FN-6252

Fusion-Task-Lineage: f7a0ef30-0c99-4f9c-b0c1-43217d613187
2026-06-11 22:03:29 -07:00
gsxdsm
de6e493e2a FN-6238: stabilize self-healing test and quarantine merger AI suite
Rescue the already-merged self-healing real-git test while quarantining a separate flaky merger AI suite.

- Call the already-merged recovery path directly in the rescued test and assert specific audit event types instead of exact total counts.
- Remove self-healing-already-merged.real-git.test.ts from the engine default quarantine list and ledger.
- Add merger-ai.test.ts to the engine default quarantine list and quarantine ledger with FN-6238 evidence.

Files changed:
 .../self-healing-already-merged.real-git.test.ts     | 20 +++++++++++++-------
 packages/engine/vitest.config.ts                     |  2 +-
 scripts/lib/test-quarantine.json                     | 10 +++++-----
 3 files changed, 19 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-6238

Fusion-Task-Lineage: b04451e3-fbd3-4dee-aca2-f542d1036d20
2026-06-11 21:10:00 -07:00
gsxdsm
fb2c6e5098 FN-6235: source reviewer prompts from workflow IR
Deduplicate reviewer policy text by making workflow IR review seams the engine's built-in prompt source.

- Move the canonical built-in reviewer prompt into core agent prompts and export seam prompt resolution helpers.
- Resolve reviewer prompts from explicit role overrides first, then workflow IR review seams, with the built-in prompt as a fallback.
- Update prompt cache and reviewer tests to cover single-source reviewer prompt behavior.
- Add a patch changeset for the published Fusion package.

Files changed:
 .../FN-6235-reviewer-prompt-single-source.md       |   5 +
 packages/core/src/__tests__/agent-prompts.test.ts  |   8 +-
 packages/core/src/agent-prompts.ts                 | 109 +++++++++--
 packages/core/src/index.ts                         |   2 +
 packages/core/src/workflow-ir-resolver.ts          |  31 ++-
 .../src/__tests__/prompt-cache-integration.test.ts |  10 +-
 .../reviewer-prompt-single-source.test.ts          | 160 +++++++++++++++
 packages/engine/src/__tests__/reviewer.test.ts     |  97 ++++-----
 packages/engine/src/prompt-layers.ts               |   2 +-
 packages/engine/src/reviewer.ts                    | 217 ++-------------------
 10 files changed, 370 insertions(+), 271 deletions(-)

Fusion-Task-Id: FN-6235

Fusion-Task-Lineage: 725932d1-2469-4507-a0f9-0946c83a1572
2026-06-11 21:00:23 -07:00
gsxdsm
e22afece56 FN-6233: add typed triage policy settings
Render triage planning thresholds from typed workflow settings instead of hard-coded prompt constants.

- Add typed triage threshold/default workflow settings, migration coverage, exports, and docs.
- Render built-in triage prompt placeholders before engine prompt execution and tests.
- Remove the duplicate standard triage prompt from engine in favor of the core workflow IR source.
- Add regression coverage for default and customized triage policy rendering.

Files changed:
 .changeset/FN-6233-triage-threshold-settings.md    |   7 +
 docs/settings-reference.md                         |  19 ++
 docs/workflow-steps.md                             |   2 +-
 packages/core/src/__tests__/agent-prompts.test.ts  |  16 +-
 .../builtin-workflow-settings-triage.test.ts       |  63 ++++
 .../src/__tests__/settings-consistency.test.ts     |  24 +-
 .../core/src/__tests__/settings-migration.test.ts  |  12 +-
 .../src/__tests__/workflow-ir-settings.test.ts     |  11 +-
 packages/core/src/agent-prompts.ts                 |  20 +-
 packages/core/src/builtin-workflow-settings.ts     | 154 ++++++++-
 packages/core/src/index.ts                         |   7 +-
 packages/core/src/moved-settings.ts                |  13 +-
 .../triage-planning-prompt-single-source.test.ts   |   9 +-
 .../__tests__/triage-threshold-settings.test.ts    |  84 +++++
 packages/engine/src/__tests__/triage.test.ts       |  17 +-
 packages/engine/src/triage.ts                      | 343 +--------------------
 packages/engine/vitest.config.ts                   |   5 +-
 17 files changed, 423 insertions(+), 383 deletions(-)

Fusion-Task-Id: FN-6233

Fusion-Task-Lineage: b2a986df-fa37-4297-a359-84d8463b0867
2026-06-11 20:53:01 -07:00
gsxdsm
905d5bf849 FN-6228: prioritize project model overrides
Ensure saved project model settings outrank stale durable-agent runtime models across AI lanes.

- Document the updated task, heartbeat, validator, merger, and summarizer model precedence.
- Add model-resolution regression coverage for project lanes, globals, defaults, runtime fallback, and test-mode mock forcing.
- Route AI merge body summarization through the shared title-summarizer settings resolver.
- Preserve upstream triage prompt coverage for TRIAGE_POLICY_PROMPT while resolving conflicts.

Files changed:
 docs/agents.md                                     |  18 +--
 docs/settings-reference.md                         |  32 ++--
 .../core/src/__tests__/model-resolution.test.ts    |  98 ++++++++++++
 packages/core/vitest.config.ts                     |   1 +
 .../src/__tests__/agent-session-helpers.test.ts    | 173 +++++++++++++++++++++
 .../src/__tests__/merger-ai-merge-body.test.ts     |  85 +++++++++-
 packages/engine/src/agent-session-helpers.ts       |   4 +
 packages/engine/src/merger.ts                      |  26 +---
 8 files changed, 392 insertions(+), 45 deletions(-)

Fusion-Task-Id: FN-6228

Fusion-Task-Lineage: a6c03f2a-dde7-4037-bdcd-a1c92a8b7fae
2026-06-11 20:44:52 -07:00