Commit Graph

7875 Commits

Author SHA1 Message Date
Fusion (runfusion.ai)
b8147dd3b1 feat(FN-5405): remove broad-scope triage heuristics and UI advisory chips/b
Removes the broad-scope detection feature end-to-end: the TaskCard chip and TaskDetailModal advisory banner are gone from the dashboard, the triage heuristic that flagged tasks as broad-scope has been deleted from the engine along with its associated run-audit events, and documentation references ha

Fusion-Task-Id: FN-5405
2026-05-21 15:07:15 -07:00
gsxdsm
0f6f0263f5 feat(FN-5352): merge fusion/fn-5352 2026-05-21 15:06:25 -07:00
Fusion (runfusion.ai)
5a76a89071 feat(FN-5351): add merge audit telemetry with typed events and integration
FN-5351 adds structured telemetry for merge audit events and integration worktree state, including typed ref-advance tracking, terminal handoff fallback audit, and integration state probes with corresponding reliability backstop tests and documentation updates.

Fusion-Task-Id: FN-5351
2026-05-21 14:34:59 -07:00
Fusion (runfusion.ai)
caeb6a7e00 feat(FN-5350): switch merge integration advance to ref-only git update-ref
Implements ref-only integration branch advancement via `git update-ref` instead of checkout+commit, including a new `merger-ref-update-advance.ts` helper, a reduced and clarified `merger.ts`, comprehensive unit and real-git regression coverage, and audit event wiring.

Fusion-Task-Id: FN-5350
2026-05-21 13:56:27 -07:00
gsxdsm
109f969f06 Merge commit '0c2416903f4f7d29fc5933d440a46a9c55f80235' 2026-05-21 13:40:25 -07:00
Fusion (runfusion.ai)
0c2416903f feat(FN-5363): enforce strict target lease to prevent merge queue pollution
Enforces strict target-lease behavior on merge queue rows, gates and scrubs polluted entries, enriches no-lease handoff diagnostics, and adds regression tests covering leased-target no-lease and polluted queue reuse paths, with audit registration and docs updates.

Fusion-Task-Id: FN-5363
2026-05-21 13:40:25 -07:00
gsxdsm
9bc5b5f4e9 feat(FN-5443): merge fusion/fn-5443 2026-05-21 13:36:39 -07:00
Fusion (runfusion.ai)
252ae24434 feat(FN-5442): add merge mode warning banner to SettingsModal
Added a merge mode warning banner to SettingsModal with styling and visibility tests.

Fusion-Task-Id: FN-5442
2026-05-21 13:06:49 -07:00
Fusion (runfusion.ai)
b3f995c857 feat(FN-5348): remove cwd-main integration mode fallback
Removes the `cwd-main` integration fallback mode (FN-5348), eliminating the legacy shortcut path where the merger would operate directly on the project root instead of a dedicated worktree. Steps normalize the `reuse-task-worktree` integration mode as the sole path, wire stricter mode invariants in

Fusion-Task-Id: FN-5348
2026-05-21 12:49:50 -07:00
Fusion (runfusion.ai)
79850b233f feat(FN-5349): add integration branch resolver with auto-recovery fallback
FN-5349 adds a dedicated integration branch resolution module (`packages/engine/src/integration-branch.ts`) replacing ad-hoc dynamic fallbacks, routes merger branch conflict resolution through it, wires auto-recovery handlers (branch-worktree, contamination) to use integration branch fallback, and w

Fusion-Task-Id: FN-5349
2026-05-21 12:04:58 -07:00
gsxdsm
e58530aa37 Merge commit 'e0d8600ae6cfbead60a0b19a068f4dfc786e2aea' 2026-05-21 11:13:40 -07:00
Fusion (runfusion.ai)
e0d8600ae6 feat(FN-5434): silence queued-status stale-clear branch in self-healing
Fixes a stale queued-status recovery branch in self-healing and updates the corresponding test assertions to match the corrected behavior.

Fusion-Task-Id: FN-5434
2026-05-21 11:13:39 -07:00
gsxdsm
2d425b1e28 fix: scrub queued/blockedBy/overlapBlockedBy on in-review transition
A task that picked up status='queued' or overlapBlockedBy while waiting in
todo (file-scope overlap with a higher-priority peer) was carrying those
todo-dispatch markers into in-review, where the merge gate then permanently
refused with "task is marked 'queued'". Ghost-review → todo → scheduler
re-queue → stranded-completed-todo recovery → in-review formed a steady-
state loop that never let the task merge.

moveTaskInternal now treats queued/blockedBy/overlapBlockedBy as todo-only
dispatch state and clears them on every transition into in-review. failed
and awaiting-* statuses are left untouched (already covered by an existing
test, plus a new regression test for the queued case).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 11:08:14 -07:00
gsxdsm
933cea434a feat(FN-5256): merge fusion/fn-5256 2026-05-21 11:06:26 -07:00
Fusion (runfusion.ai)
a2a643844d feat(FN-5436): skip step retries when review is pending
Added executor logic to skip retries when a review is pending for a task, introducing a `pendingReviewBlockHelper` in the task-done path and updating the retry-gate to consult it; two new reliability-interaction test suites cover the feature behavior and composition with existing retry/backstop laye

Fusion-Task-Id: FN-5436
2026-05-21 10:58:28 -07:00
gsxdsm
7d25d98b2f fix(FN-5256): await disposal across task:moved-away and task:deleted
Close the last fire-and-forget gap from the previous fixes: the task:moved
(away from in-progress) and task:deleted listeners no longer call the
synchronous fire-and-forget `abortInFlightTaskWork`. Instead they track an
awaited disposal promise per task in `pendingTaskDisposals`. The task:moved
(to in-progress) dispatch path awaits any in-flight disposal for the same
task before calling `execute()`, so a fast bounce (in-progress → todo →
in-progress) no longer races the conflict-cleanup path against a still-live
shell.

`awaitAbortInFlightTaskWork` now claims each session surface (activeSessions,
activeStepExecutors, activeWorkflowStepSessions, activeSubagentSessions)
synchronously before awaiting any async abort. This lets concurrent disposal
calls for the same task dedupe naturally — the second call finds the maps
empty and no-ops, preserving the existing single-abort/single-dispose
contract that the soft-delete and user-cancel tests assert.

Adds a regression test in executor-user-cancel covering the re-dispatch
ordering: an immediate task:moved-to-in-progress that follows a still-running
task:moved-away must wait for abort to complete before execute() runs.

The legacy `abortInFlightTaskWork` is removed (no callers).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 10:14:38 -07:00
gsxdsm
b4fc54bb20 fix(FN-5256): route merger-handoff reconcile through hardened gates
Code-review follow-up to cf0101be7. The merger integration worktree path
was still calling bare `activeSessionRegistry.reconcileStaleSelfOwned` for
same-task entries, bypassing the minIdleMs window introduced by the main
fix. A merger-handoff that races a warming-down session could clear a
registry entry < 5s old. Route through `reconcileSelfOwnedActiveSessionForRemoval`
with the `executingTaskLock` process probe so all reconcile sites enforce
the same liveness contract. Test updated to backdate `registeredAt`,
matching the pattern used for the other reliability-interactions tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 09:17:54 -07:00
gsxdsm
cf0101be7c fix(FN-5256): keep live task worktrees through pause/resume races
Three independent reliability fixes that all surfaced as the same bug:
live tasks losing their worktrees mid-execution and emitting
`wrong_toplevel` errors.

Fix A — executor stale-self-owned classifier:
`reconcileSelfOwnedActiveSessionForRemoval` now takes a process-active
probe (`executingTaskLock.has`) and a minimum-idle window (default 5s)
in addition to the existing in-memory `activeWorktrees` binding probe.
Recently-registered or still-running entries are refused with
`process-active-refuses` / `too-recent-refuses`, with audit-grade
log lines. Both the pre-remove path
(`reconcileSelfOwnedBeforeRemove`), the post-throw retry in
`removeOwnWorktreeWithReconcile`, and the defensive reconcile in
`removeWorktree` route through the same hardened gates.

Fix B — pause synchronously reaps the agent session:
New `awaitAbortInFlightTaskWork` mirrors the existing fire-and-forget
abort but awaits each `session.abort()` /
`stepExecutor.terminateAllSessions()` /
`workflowSession.abort()`. `parkTaskAfterWorkflowStepPause` calls it
before `moveTask("todo")`, and the `task:updated` user-pause handler
routes through it, so a fast re-dispatch can no longer race a still-
live shell.

Fix C — self-healing realpath + active-task skip:
`reconcileTaskWorktreeMetadata` now realpath-normalizes both sides of
the registry comparison (handling macOS `/private/var/...`) and
refuses to clear `worktree`/`branch` on in-progress or in-review
tasks. The skip emits a new
`task:auto-recover-worktree-metadata-skipped-active` audit event;
executor-level recovery paths remain in charge of active tasks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 09:06:23 -07:00
Fusion
66e2bc34ea feat(FN-024): Add dependencies parameter to fn_task_update tool
- Added optional dependencies parameter to taskUpdateParams schema
- Implemented validation for self-dependency and non-existent task IDs
- Updates task dependencies via store.updateTask() when parameter is provided
- Preserves existing dependencies when parameter is omitted
- Updated tool description to document the new parameter
2026-05-21 15:46:45 +00:00
gsxdsm
2cdb51126d Merge commit 'ef5dd7ba2511621b906abc54eb432ba79cf4195f' 2026-05-21 08:43:57 -07:00
Fusion (runfusion.ai)
ef5dd7ba25 feat(FN-5435): reset fallback retry counter on success in reviewer
Adds a fallback retry counter to the reviewer that resets on successful step completion, preventing premature escalation when earlier steps exhaust retries while later ones succeed; also aligns dashboard trace buffer types and adds comprehensive coverage for the reset semantics.

Fusion-Task-Id: FN-5435
2026-05-21 08:43:57 -07:00
Fusion (runfusion.ai)
a04ba3cf21 feat(FN-5413): add null description persist regression test
Added a regression test for null description persistence in the core task store and a CLI patch changeset to ship the fix.

Fusion-Task-Id: FN-5413
2026-05-21 08:20:42 -07:00
Fusion (runfusion.ai)
f236dc3982 feat(FN-5433): suppress no-op blockedBy refresh in self-healing
Fixed self-healing to suppress unnecessary blocked-by refreshes when there are no changes (no-op), preventing spurious requeues. Added a regression test covering this scenario in the self-healing test suite.

Fusion-Task-Id: FN-5433
2026-05-21 07:59:46 -07:00
gsxdsm
04648a4a68 Merge commit '5f9f7776300afbc935d651949c50c60bca2cafd4' 2026-05-21 07:05:48 -07:00
Fusion (runfusion.ai)
5f9f777630 feat(FN-5374): raise room transcript defaults and align compaction settings
Raised room transcript defaults (`messagesBefore` and `daysBefore`) in the core settings schema and updated project-level setting defaults, with corresponding documentation refresh in the settings reference. Added full test coverage for room compaction defaults, pinned room default settings in Setti

Fusion-Task-Id: FN-5374
2026-05-21 07:05:48 -07:00
gsxdsm
97e6a0cc0e fix(FN-5256): skip cycle preflight when new task has no deps
The unconditional listTasks() in assertNoDependencyCycle was wasted work
for the common no-dependency write and broke the same-agent duplicate
intake fail-open path: tests that stub listTasks to throw had the cycle
check consume the rejection before _maybeAutoArchiveSameAgentDuplicate's
try/catch could swallow it, propagating the error out of createTask.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 06:40:15 -07:00
Fusion (runfusion.ai)
e12adeb3fa feat(FN-5256): complete Step 2 — enforce cycle checks on writes 2026-05-21 04:15:21 -07:00
gsxdsm
ad8fa7be0d Merge commit '6fdfb1ad5cedc12afec1300d39a9a1d445d7b6f7' 2026-05-21 00:17:33 -07:00
Fusion (runfusion.ai)
6fdfb1ad5c feat(FN-5425): add coordination notice system for multi-agent room task fil
Adds a `room-coordination.ts` helper module for multi-agent coordination messaging, wires coordination notices into the agent heartbeat path, and ships tests plus documentation for the feature. A changeset prepares the `@runfusion/fusion` package for release.

Fusion-Task-Id: FN-5425
2026-05-21 00:17:33 -07:00
Fusion (runfusion.ai)
59bebf0806 feat(FN-5430): gate task update invalidation in scheduler
Scheduler now gates task update invalidation, preventing spurious invalidations when engine lifecycle changes (soft-delete, lease recovery) touch task metadata, with coverage via new scheduler invalidation tests and a small dashboard server test adjustment.

Fusion-Task-Id: FN-5430
2026-05-20 23:48:57 -07:00
gsxdsm
5c15031416 fix(health): re-run integrity check on Refresh health, not just re-read cache
The dashboard's corruption banner refresh action was a no-op for clearing
stale corruption flags after the user repaired the DB. Database.
scheduleBackgroundIntegrityCheck runs the integrity check exactly once at
engine boot and then early-returns forever after, so corruptionDetected
was sticky for the life of the process. POST /api/health/refresh just
read the cached flag back.

Add Database.refreshIntegrityCheck() and TaskStore.refreshDatabaseHealth()
which synchronously re-run the integrity check and update the cached
state, and have the route use them. After REINDEX / fn db --vacuum / any
in-place repair, users can now clear the banner without restarting the
engine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:02:53 -07:00
gsxdsm
85f0de9881 Merge commit 'b12ff26f36daaf31e807f4920c61c2a7b3727a64' 2026-05-20 22:34:32 -07:00
Fusion (runfusion.ai)
b12ff26f36 feat(FN-5424): add opencode-go provider to settings with model refresh on k
Exposes the `opencode-go` provider via `startup-model-sync`, wires it into the daemon and serve commands, and adds a refresh-status indicator in the SettingsModal that triggers model reloading whenever the provider key is saved. Includes a changeset, settings documentation, and corresponding tests a

Fusion-Task-Id: FN-5424
2026-05-20 22:34:32 -07:00
gsxdsm
17b9d851c3 chore: add scripts/reimport-tasks.mjs recovery utility
One-off helper to re-import specific FN-* tasks from .fusion/tasks/<id>/task.json
back into the live SQLite DB after a restore. Mirrors the column list used by
db-migrate.ts:migrateTasks but uses INSERT OR IGNORE so existing rows are
never overwritten. Used to rebuild FN-5415..FN-5425 after the FN-5407 backup
corruption recovery.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:25:15 -07:00
gsxdsm
d90da81079 fix(core): default null task.description to empty string on persist
The tasks table description column is NOT NULL, so a task arriving with
description == null/undefined would fail the insert with a constraint
error. Default to "" in getTaskPersistValues, matching the ?? null / ?? 0
treatment of other optional fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:25:15 -07:00
gsxdsm
57dbff4ba4 fix(FN-5407): stop checkpoint-truncating live DB during backup
Backups opened a second node:sqlite connection against the live fusion.db
and ran PRAGMA wal_checkpoint(TRUNCATE) before copying. A node:sqlite
SIGSEGV mid-checkpoint (the recurring pager_write crash noted in db.ts)
could leave the main DB file extended-but-zeroed, which is exactly the
failure mode that wiped a 1GB fusion.db tonight.

Replace the in-process checkpoint with a plain cp of the main DB plus any
sibling -wal/-shm files. SQLite replays the WAL on first open, so
uncheckpointed pages survive without us ever opening a second connection
against the live database.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:09:30 -07:00
Fusion (runfusion.ai)
f798378693 feat(FN-5346): add post-completion defensive backstop and shared reconcile
The merge adds a post-completion defensive backstop that probes and removes stale same-task `activeSessionRegistry` entries on `done`/`archived` transitions, completing FN-5346 with a shared reconcile helper, a defensive ownership probe wired into paused cleanup, audit event alignment, and regressio

Fusion-Task-Id: FN-5346
2026-05-20 21:53:02 -07:00
Fusion
f09b568ffa docs(FN-009): document fix rationale in CHANGELOG 2026-05-21 03:34:32 +00:00
Fusion (runfusion.ai)
e96cb09982 feat(FN-5388): add warm room cache hydration with open diagnostics
Add room open performance diagnostics and warm cache hydration for room switches (FN-5388). The implementation adds a timing instrumentation utility, SWR cache constants, warm-room handoff logic in `useChatRooms`, and a documentation file covering the performance model, accompanied by regression tes

Fusion-Task-Id: FN-5388
2026-05-20 20:27:11 -07:00
gsxdsm
b936ab9bb5 feat(FN-5414): merge fusion/fn-5414 2026-05-20 20:15:43 -07:00
gsxdsm
20a77ec29f Merge commit '2baaad743adf77b6461e10849411ff5c3a970677' 2026-05-20 20:05:09 -07:00
Fusion (runfusion.ai)
2baaad743a feat(FN-5407): add paired central backup support to backup command and stor
FN-5407 adds paired central backup support to the Fusion task management system, with both the core backup engine and CLI commands updated to handle central database backup pairs. Documentation was updated to reflect the new capability, and two stabilization fixes were included to handle central bac

Fusion-Task-Id: FN-5407
2026-05-20 20:05:08 -07:00
Fusion (runfusion.ai)
1913cb59fe feat(FN-5389): add resume event instrumentation with SSE, hooks, and diagno
FN-5389 adds dashboard resume event instrumentation: a `resumeInstrumentation` utility captures SSE resume signals, wired through `useChat`, `useChatRooms`, and `useTasks` hooks, with remount markers in `Board` and `ChatView`; diagnostics routes expose resume events for observability, documented in

Fusion-Task-Id: FN-5389
2026-05-20 19:58:49 -07:00
Fusion
956f9748ba test(FN-009): add coverage for missing worktree scenario 2026-05-21 02:54:02 +00:00
Fusion
1314a9796f fix(FN-009): allow task completion when worktree missing 2026-05-21 02:33:10 +00:00
Fusion (runfusion.ai)
12582414da feat(FN-5380): preserve ChatView scroll position on navigation
Preserve chat scroll state across view transitions in ChatView, with comprehensive test coverage. The feature adds scroll position persistence logic gated behind a debug trace flag, and a full test suite covering the scroll state behavior.

Fusion-Task-Id: FN-5380
2026-05-20 19:30:15 -07:00
Fusion (runfusion.ai)
dcb6774db3 feat(FN-5406): remove interview mission title length guard
Removes a title-length guard from mission routes (4-line deletion in `mission-routes.ts`) and adds end-to-end coverage for long interview mission titles (`mission-e2e.test.ts`).

Fusion-Task-Id: FN-5406
2026-05-20 19:20:28 -07:00
Fusion (runfusion.ai)
1a5aff9c44 feat(FN-5337): remove speculative orphan requeue from self-healing sweep
Removes the speculative orphan requeue mutation path from self-healing, replacing it with an observation-only sweep that no longer attempts to re-enqueue orphaned tasks — a conservative regression that eliminates noisy false-positive recovery attempts. The change includes rewritten unit coverage, a

Fusion-Task-Id: FN-5337
2026-05-20 18:49:38 -07:00
Fusion (runfusion.ai)
dbccdb1275 feat(FN-5375): enforce manifest-gated cloudflared checksum installation
Added manifest-gated checksum verification for cloudflared remote access tunnels: a pinned manifest validator (Step 1) and enforcement logic (Step 2) wired into the settings memory routes, with aligned tests and documentation covering fail-closed install behavior and pending-manifest guidance.

Fusion-Task-Id: FN-5375
2026-05-20 18:43:17 -07:00
Fusion (runfusion.ai)
e814ba9508 fix(FN-5345): address third-pass review findings
Follow-up to c64884c24 addressing three review findings, including one
real interaction bug caught by a new test.

MEDIUM

- Re-indented and rewrote 'if (directReuseEligible) try { ... } catch'
  as 'if (directReuseEligible) { try { ... } catch { ... } }' with the
  whole body at one consistent indent level. No behavior change \u2014 fixes
  the mismatched indentation from c64884c24 where the body sat one level
  deeper than its containing block.

LOW

- Two new backstop tests in merge-reuse-task-worktree.test.ts:
  * 'preserves worktrees with uncommitted tracked changes' \u2014 asserts the
    fast-path leaves a tracked-dirty worktree alone (result.worktreeRemoved
    is false, dir still exists). Without this, a future refactor could
    silently re-enable destructive cleanup.
  * 'cleans up worktrees with only untracked noise' \u2014 asserts untracked
    junk (.DS_Store, editor swap files) does NOT block cleanup. Also caught
    a real interaction bug: 'git worktree remove' without --force refuses
    on untracked files, so the LOW finding's intent (drop noise, preserve
    tracked dirt) needs --force on the removal call. Restored --force with
    a comment explaining why it's safe (the tracked-only dirty check above
    already refused if there was real work to preserve).

- Switched 'git status' check from '--untracked-files=normal' to
  '--untracked-files=no'. Tracked modifications and staged changes still
  block cleanup; untracked junk is correctly ignored. Dirty-skip warn log
  now includes the first 5 dirty paths for operator diagnosability.

Tests
  - Full @fusion/engine suite: 448 files / 5883 tests / 9 skipped, all green
  - pnpm lint green, pnpm build green
2026-05-20 18:21:14 -07:00