Commit Graph

150 Commits

Author SHA1 Message Date
gsxdsm
f9e551317f Harden fusion.db against recurring corruption
Root cause: node:sqlite SIGSEGVs inside pager_write leave the B-tree
malformed in a way that still opens but fails integrity checks; large
operational-log tables widen the write window where the crash strikes.

- backup: verify every copy with PRAGMA quick_check, quarantine corrupt
  copies as *.corrupt, and never rotate out the last verified-good backup
- db: add Database.recoverIfCorrupt() startup guard (wired into
  TaskStore.init, disk-backed only, opt out via FUSION_DISABLE_DB_AUTORECOVER)
  that rebuilds a malformed db via sqlite3 .recover, preserving the corrupt
  original; also fixes the latent `.recover main` invalid-option bug that made
  recoverDatabase() always fail
- db: drop lost_and_found* scratch tables on init; add pruneOperationalLogs()
- settings: add operationalLogRetentionDays (default 30, 0 = off) and prune
  activityLog/agentLogEntries/runAuditEvents/agentHeartbeats during maintenance
- dashboard: expose retention in Settings -> Backups -> Database Maintenance

Tests: backup 59/59, db 135/135 (incl. real corrupt->recover->reopen),
self-healing cleanup/corruption 10/10, settings 77/77, SettingsModal 460/460.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 21:55:10 -07:00
gsxdsm
e854d33375 FN-5805: add fn onboard command with sequential runOnboard flow
Add a new interactive onboarding CLI flow that guides first-time setup end to end.

- add new `fn onboard` command wiring in CLI entrypoint and usage help
- implement `runOnboard()` with sequential prompts for central DB, provider auth, init, test mode, and project maxConcurrent
- persist `cliOnboardingCompletedAt` marker in global settings with `--force` rerun support
- add onboarding command tests and global settings regression coverage
- document `fn onboard` usage and options in CLI reference
- add a minor changeset for published `@runfusion/fusion`

Files changed:
 .changeset/fn-5805-onboard-command.md              |   5 +
 docs/cli-reference.md                              |  20 ++
 packages/cli/src/bin.ts                            |  10 +
 packages/cli/src/commands/__tests__/onboard.test.ts| 193 ++++++++++++++++
 packages/cli/src/commands/onboard.ts               | 249 +++++++++++++++++++++
 packages/core/src/__tests__/global-settings.test.ts|  11 +
 packages/core/src/index.ts                         |   2 +-
 packages/core/src/settings-schema.ts               |   1 +
 packages/core/src/types.ts                         |   4 +
 9 files changed, 494 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5805

Fusion-Task-Lineage: b1bcaf27-9bd7-4569-b685-225a97fa1200
2026-06-01 01:42:19 -07:00
gsxdsm
f1aba5b534 Merge pull request #1226 from plarson/fix/dirty-integration-merge-block
fix(engine): block dirty integration merge landings
2026-05-31 13:49:58 -07:00
Phil Larson
3dee395d67 fix(engine): block dirty integration merge landings
Refuse AI merge landing on a checked-out dirty integration worktree by default. This prevents Fusion from stashing/restoring unrelated project-root edits into main and then marking tasks done against contaminated state.

Fusion-Task-Id: FN-5780
2026-05-31 13:12:13 -07:00
gsxdsm
62bc1e4458 FN-5777: remove GitHub star setting and button
Remove the dashboard setting and UI entry points for the GitHub star prompt.

- Remove the Star on GitHub option from settings state types and schema definitions.
- Delete SettingsModal UI, handlers, and styles tied to the star button and related layout.
- Update SettingsModal tests and add a changeset documenting the patch release impact.

Files changed:
 .changeset/FN-5777-removal.md                      |   7 ++
 packages/core/src/settings-schema.ts               |   1 -
 packages/core/src/types.ts                         |   4 -
 .../dashboard/app/components/SettingsModal.css     |  51 +-------
 .../dashboard/app/components/SettingsModal.tsx     | 137 +--------------------
 .../components/__tests__/SettingsModal.test.tsx    |   5 +-
 6 files changed, 13 insertions(+), 192 deletions(-)

Fusion-Task-Id: FN-5777

Fusion-Task-Lineage: 16367ba6-ad22-4ba0-a033-005ccc420c19
2026-05-31 11:55:10 -07:00
gsxdsm
20c1c3261e FN-5741: persist merge-request handoff shadow contract
Introduce Phase 1 write-only persistence for merge-request handoff acceptance across core and engine paths.

- add persisted merge-request record types, schema/settings plumbing, and store write-path support
- update merger/executor/self-healing/run-audit flows to emit and consume the handoff-accepted shadow marker
- expand core/engine/roadmap tests and docs to cover the new merge-request shadow contract
- add a patch changeset for @runfusion/fusion for this bundled package update

Files changed:
 .changeset/fn-5741-merge-request-shadow.md         |   5 +
 AGENTS.md                                          |   1 +
 docs/architecture.md                               |   2 +
 docs/settings-reference.md                         |   1 +
 packages/core/src/__tests__/db-migrate.test.ts     |  12 +-
 packages/core/src/__tests__/db.test.ts             |  34 ++--
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 .../src/__tests__/merge-request-record.test.ts     |  97 +++++++++++
 packages/core/src/__tests__/mission-store.test.ts  |   2 +-
 packages/core/src/__tests__/run-audit.test.ts      |   2 +-
 packages/core/src/__tests__/secrets-schema.test.ts |   6 +-
 .../core/src/__tests__/settings-parity.test.ts     |   3 +
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |  49 +++++-
 packages/core/src/index.ts                         |   4 +-
 packages/core/src/settings-schema.ts               |  30 ++++
 packages/core/src/store.ts                         | 189 ++++++++++++++++++++-
 packages/core/src/types.ts                         |  37 ++++
 .../src/__tests__/merger-merge-lifecycle.test.ts   |  54 ++++++
 .../merge-request-shadow-handoff.test.ts           |  74 ++++++++
 packages/engine/src/executor.ts                    |  15 +-
 packages/engine/src/merger.ts                      |  37 ++++
 packages/engine/src/run-audit.ts                   |   1 +
 packages/engine/src/self-healing.ts                |  16 +-
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 27 files changed, 646 insertions(+), 45 deletions(-)

Fusion-Task-Id: FN-5741

Fusion-Task-Lineage: 3fec14c3-47ff-4f14-bc02-24021518c992
2026-05-30 14:42:50 -07:00
gsxdsm
0e5ca34c61 refactor(FN-5633): AI merge reviewer uses the project reviewer/validator model
Drop the bespoke `merger.reviewerModel` setting. The AI merge reviewer now
resolves its model via `resolveValidatorSettingsModel` — the same
reviewer/validator lane used elsewhere (project validator → global validator →
project default) — falling back to the merger model only if that lane is empty.
Removes the setting from the type, schema default, and the Settings UI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 19:53:11 -07:00
gsxdsm
b2dce7d852 Recovery: Re-land (Close source-imported GitHub issues on ta 2026-05-28 19:49:31 -07:00
gsxdsm
29ac58f8d0 feat(FN-5633): standalone AI merge path (clean-room merge + AI reviewer)
New default merge path (merger.mode="ai"), self-contained in merger-ai.ts and
dispatched from ProjectEngine.onMerge instead of the legacy aiMergeTask pipeline
(kept for merger.mode="deterministic").

Flow: clean-room detached worktree at the target branch tip → AI agent merges
the task branch + squashes (resolving conflicts) → fresh read-only AI reviewer
audits with corrective retries (blocking vs advisory; advisory lands, unfixable
correctness hard-fails via AiMergeBlockedError; fail-safe verdict parsing) →
land via `git merge --ff-only` when the checkout is on the target (else
update-ref CAS) → sync the local checkout (stash → ff → restore; AI reconciles
a conflicting restore and keeps the original edits in a backup stash;
un-stashable dirt advances the ref + warns) → finalize (delete task branch —
never the integration branch — task→done, remove temp worktree).

- Per-task target branch honored (falls back to the default integration
  branch); local checkout synced only when on that target.
- Structurally immune to the dirty-clobber and stale-base/non-FF bug classes of
  the legacy path (clean room + FF-by-construction).
- Progress surfaced on the task status pill + task log stream.
- Clear error when the target branch has no local ref.

Settings: merger.mode / merger.reviewerModel / merger.maxReviewPasses, surfaced
in Settings → Merge; legacy merge-mechanics settings hidden when AI mode is on.

Tests: merger-ai.test.ts (verdict parser, clean merge, blocking hard-fail,
advisory land, empty no-op, target-branch isolation, missing-target error,
landSquash clean/other-branch/dirty-restore/AI-resolved). Legacy
merge-orchestration tests pinned to deterministic mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 18:50:23 -07:00
Fusion (runfusion.ai)
2d2e5b809f feat(FN-5233): add tombstone recreate guard and allow-resurrection delete f
Implements the FN-5233 tombstone system for soft-delete resurrection: a configurable `tombstoneWindowSeconds` deduplicates recreation of recently deleted tasks, with an `allowResurrection` flag that permits explicit resurrect-on-recreate, tombstone recreate guards in the store layer, and cleanup of

Fusion-Task-Id: FN-5233
2026-05-23 17:07:14 -07:00
gsxdsm
a201f56f09 feat(core): add mergeAdvanceAutoSync project setting
Schema for what the merger should do in other worktrees still checked out
on the integration branch when it advances the branch ref. Modes:
  off          — legacy (user pulls manually)
  ff-only      — fast-forward only when other worktree is clean
  stash-and-ff — Smart Pull pipeline (default)

Threads through DEFAULT_PROJECT_SETTINGS, PROJECT_SETTINGS_KEYS (auto via
Object.keys), the docs settings table, and parity + persistence tests.
Merger consumption lands in the follow-up engine change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 14:19:50 -07:00
gsxdsm
8f5c1f97ad feat(FN-5255): flip directMergeCommitStrategy default from squash to direct
Changes the default merge strategy from squash to direct by flipping `directMergeCommitStrategy` in the settings schema and types, with the core implementation in `merger-ref-update-advance.ts`. Also aligns a heartbeat executor test assertion with the FN-5060 deduplication shape.

Fusion-Task-Id: FN-5255

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5255
2026-05-23 11:08:08 -07:00
gsxdsm
2a3a07a612 feat(FN-5403): merge fusion/fn-5403 2026-05-22 23:12:49 -07:00
Fusion (runfusion.ai)
9c2b61eec6 feat(FN-5204): add test mode activation across settings, engine, and dashboard
- Add core settings schema/types support for testMode with model-resolution override handling
- Enforce engine session lane overrides in test mode with targeted helper coverage
- Add dashboard settings toggle plus persistent test-mode banner and related component tests
- Update settings documentation and parity/roundtrip tests for the new test mode behavior
2026-05-22 00:15:14 -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
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
Fusion (runfusion.ai)
c60045df22 feat(FN-5223): anchor staleness and stall detectors to engine activation ti
The merge introduces an engine-activation timestamp as the staleness floor for task age calculations, replacing arbitrary wall-clock thresholds with a runtime-relative anchor. Step 1 adds settings defaults, Steps 2–4 wire the floor helper through project engine, in-process runtime, and task store hy

Fusion-Task-Id: FN-5223
2026-05-20 14:29:07 -07:00
Fusion (runfusion.ai)
22d59b5f9a feat(FN-5279): add merge integration worktree feature with settings UI and
Implements the `mergeIntegrationWorktree` setting (FN-5279) that allows tasks to reuse their own worktree as the integration root instead of spawning a separate one. Steps 1–2 added the settings schema, types, and SettingsModal surface with documentation; Step 3 wired an integration-root resolver th

Fusion-Task-Id: FN-5279
2026-05-20 09:42:40 -07:00
Fusion (runfusion.ai)
274f86ffaa feat(FN-5093): complete Step 2 — wire types settings and exports
Fusion-Task-Id: FN-5093
Fusion-Task-Lineage: fe96617a-88f8-4a3c-b96c-c516d2206331
2026-05-19 03:54:48 -07:00
Fusion (runfusion.ai)
8e3e71744b feat(FN-5091): complete Step 2 — wire settings and exports
Fusion-Task-Id: FN-5091
Fusion-Task-Lineage: f59dc7dd-abc2-4d1d-a755-1fe446314131
2026-05-19 03:21:17 -07:00
Fusion (runfusion.ai)
b35843c2ea feat(FN-5034): complete Step 3 — wire stale paused todo types settings exports
Fusion-Task-Id: FN-5034
Fusion-Task-Lineage: 1e315656-30d8-41d2-9802-0d9e155f0ba8
2026-05-19 03:10:25 -07:00
Fusion (runfusion.ai)
e53cf7e0b1 fix(FN-5089): add trailer settings typing defaults
Fusion-Task-Id: FN-5089
Fusion-Task-Lineage: ad7ea32a-c024-45bb-b68e-b65665b9b7c6
2026-05-19 02:34:37 -07:00
Fusion (runfusion.ai)
ac9c83c106 test(FN-5089): add commit-msg hook coverage and wiring
Fusion-Task-Id: FN-5089
Fusion-Task-Lineage: ad7ea32a-c024-45bb-b68e-b65665b9b7c6
2026-05-19 02:34:35 -07:00
gsxdsm
af7367ab99 feat(FN-5035): merge fusion/fn-5035 2026-05-18 18:07:53 -07:00
gsxdsm
cae9c6c4fc feat(FN-5064): merge fusion/fn-5064 2026-05-18 12:46:23 -07:00
gsxdsm
a8a413cc91 feat(FN-5009): merge fusion/fn-5009 2026-05-18 12:31:21 -07:00
Fusion (runfusion.ai)
106499c375 feat(FN-4958): complete Step 1 — settings surface
Fusion-Task-Id: FN-4958
Fusion-Task-Lineage: 2f1bc742-14e0-4fdd-a980-00051fc3323c
2026-05-18 06:20:52 -07:00
Fusion (runfusion.ai)
6624adf110 feat(FN-4890): complete Step 1 — settings and notification types
Fusion-Task-Id: FN-4890
Fusion-Task-Lineage: d1ae6585-7df0-481f-83c3-c7cdd45daf4f
2026-05-17 19:36:10 -07:00
Fusion (runfusion.ai)
1f08449bda feat(FN-4867): complete Step 2 — add project secrets settings types
Fusion-Task-Id: FN-4867
Fusion-Task-Lineage: c06c5e79-b038-4941-951b-08bfb164fa17
2026-05-17 18:46:42 -07:00
Fusion (runfusion.ai)
e3cfd0b05e feat(FN-4885): complete Step 1 — core deadlock threshold primitives
Fusion-Task-Id: FN-4885
Fusion-Task-Lineage: 31110eed-5ca3-4d67-8f11-581185056dc6
2026-05-17 09:31:06 -07:00
Fusion (runfusion.ai)
0076b754eb feat(FN-4792): complete Step 2 — add secret policy resolver and default
Fusion-Task-Id: FN-4792
Fusion-Task-Lineage: 8e29f9a0-4c9f-4322-9595-3c9c581dacb0
2026-05-17 00:21:12 -07:00
Fusion (runfusion.ai)
2ff19bc9c9 feat(FN-4813): complete Step 3 — add owning-node handoff policy
Fusion-Task-Id: FN-4813
Fusion-Task-Lineage: 846893a5-2afa-4817-8f64-8c444d2fd713
2026-05-16 17:31:09 -07:00
Fusion (runfusion.ai)
d89a4569f1 fix(FN-4777): add dedup default setting and lint-safe regex
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
92a85b8a9d feat(FN-4743): complete Step 1 — add mail cleanup project setting
Fusion-Task-Id: FN-4743
Fusion-Task-Lineage: 50d1d8e4-66d5-4299-843b-28072a904277
2026-05-16 10:43:48 -07:00
Fusion (runfusion.ai)
7ec2711aa8 feat(FN-4733): complete Step 1 — add chat auto-cleanup setting
Fusion-Task-Id: FN-4733
Fusion-Task-Lineage: 38495ced-c7a0-40aa-be22-7f02fe958806
2026-05-16 08:50:47 -07:00
Fusion (runfusion.ai)
0affca047a feat(FN-4718): complete Step 1 — add done auto-archive days setting
Fusion-Task-Id: FN-4718
Fusion-Task-Lineage: 4553c39c-c174-4993-a4ac-2c8b7d86bda2
2026-05-16 04:44:36 -07:00
Fusion (runfusion.ai)
30f71d399c feat(FN-4641): complete Step 1 — extend core types and settings
Fusion-Task-Id: FN-4641
Fusion-Task-Lineage: 50ac1fd2-8c88-4a29-9ebb-962a6b5c772c
2026-05-15 22:56:30 -07:00
Fusion (runfusion.ai)
91238e7a08 feat(FN-4624): complete Step 0 — preflight worktrunk settings surface
Fusion-Task-Id: FN-4624
Fusion-Task-Lineage: 854e6033-bc17-45be-8d04-18bcb66b31c4
2026-05-15 20:24:57 -07:00
Fusion
d2066cfa58 feat(FN-4621): complete Step 2 — add worktrunk defaults to both scopes
Fusion-Task-Id: FN-4621
Fusion-Task-Lineage: fc1b0b13-9052-4378-86e3-3634d6c9db4e
2026-05-15 11:07:43 -07:00
Fusion
362b0c4433 feat(FN-4639): complete Step 2 — add sandbox defaults
Fusion-Task-Id: FN-4639
Fusion-Task-Lineage: 40745d49-dd20-4c51-87e3-42062417f788
2026-05-15 10:41:37 -07:00
Fusion
d1909afc2a feat(FN-4616): complete Step 1 — add OpenRouter settings shape/default keys
Ref: Runfusion/Fusion#325
Fusion-Task-Id: FN-4616
Fusion-Task-Lineage: ea5ea571-cc40-4ec0-86b4-2f003ac2834c
2026-05-15 10:18:47 -07:00
Fusion
8bb3493553 fix(FN-4608): complete Step 6 — resolve verification regressions
Fusion-Task-Id: FN-4608
Fusion-Task-Lineage: 6cabc509-38a1-4cb8-be6f-51c53d5753ff
2026-05-15 09:52:58 -07:00
Fusion
e3cad24c41 feat(FN-4606): complete Step 1 — settings schema and types
Ref: Runfusion/Fusion#321
Fusion-Task-Id: FN-4606
Fusion-Task-Lineage: 94b23f37-944e-4bcd-bfa1-67d0a8c0a267
2026-05-15 09:19:58 -07:00
Fusion
18695c860f feat(FN-4452): complete Step 1 — core stale paused review detector
Fusion-Task-Id: FN-4452
Fusion-Task-Lineage: 7d8b1c13-883b-4815-94ee-fdf18ad24e5f
2026-05-14 18:35:30 -07:00
Fusion
79eb74ca7e feat(FN-4534): add auto-recovery dispatcher and pause-site wiring
Fusion-Task-Id: FN-4534
Fusion-Task-Lineage: 2b46a5df-efc6-4305-a0f2-69991e58512c
2026-05-14 17:59:57 -07:00
Fusion
831e4969e9 feat(FN-4398): complete Step 2 — add retry summary and retry storm types
Fusion-Task-Id: FN-4398
Fusion-Task-Lineage: 8b898b2e-3468-4fa7-8546-b8f6ba52cf46
2026-05-14 15:25:08 -07:00
Fusion
ffd274d646 feat(FN-4482): complete Step 2 — add plan-only scope leak guard
Fusion-Task-Id: FN-4482
Fusion-Task-Lineage: 5850cda2-ded5-42ac-a206-396839580748
2026-05-14 14:31:25 -07:00
Fusion
49bb2b3858 feat(FN-4455): complete Step 5 — migrate memory mode resolution and tests
Fusion-Task-Id: FN-4455
Fusion-Task-Lineage: 735091fa-9d42-4f23-9c5b-3e5889da99a6
2026-05-14 13:59:10 -07:00
Fusion
2aa5805850 feat(FN-4488): complete Step 1 — core permission policy model
Fusion-Task-Id: FN-4488
Fusion-Task-Lineage: 3fc1ac43-490f-43f2-a27e-4fdceb64d9c4
2026-05-14 13:16:09 -07:00
Fusion
b233cb391b feat(FN-4396): complete Step 2 — add token budget types and defaults
Fusion-Task-Id: FN-4396
Fusion-Task-Lineage: 3839210b-b443-410d-a476-aa81128c739a
2026-05-14 08:03:40 -07:00