Commit Graph

984 Commits

Author SHA1 Message Date
Fusion
e87961825f feat(FN-3314): align auth route assertion in agents routes test
Test FN-3314 completes its final step by refining an auth route assertion in the agents routes test, ensuring the test accurately validates the expected behavior.

Fusion-Task-Id: FN-3314
2026-05-04 15:04:36 -07:00
Timothy Laurent
6fd47416ee merge main: resolve db.test.ts import conflict
Combined both branches: TaskStore import from main + rmSync import
from our branch (needed for fresh DB test cleanup).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 14:58:47 -07:00
Fusion
cfdc72e511 feat(FN-3199): align memory insight docs with canonical paths
Updates three documentation files to align memory insight and plugin path references with their canonical locations.

Fusion-Task-Id: FN-3199
2026-05-04 13:43:22 -07:00
Fusion
c9e776cb34 feat(FN-3293): add stabilization docs to test audit report
Documentation for test stabilization was finalized by updating the test audit report with 2 additional lines.

Fusion-Task-Id: FN-3293
2026-05-04 13:17:57 -07:00
gsxdsm
3ca4bee819 Merge branch 'main' into fix/sqlite-corruption-wal-pragmas 2026-05-04 13:04:52 -07:00
Timothy Laurent
014a239ca5 fix(core): re-arm flush timer after retryable flush failure
When flushAgentLogBuffer() requeues valid entries on transient failure,
the timer was cleared but never re-armed, leaving entries in memory
indefinitely. Now schedules a retry after AGENT_LOG_FLUSH_MS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 12:10:21 -07:00
Timothy Laurent
eb675749e3 fix(core): add backlog cap for agent log buffer and close DB on init failure
Two fixes from CodeRabbit review:
- Add MAX_AGENT_LOG_BACKLOG cap (5000 entries) to prevent unbounded memory
  growth during prolonged SQLite outages. Oldest entries are dropped when
  cap is exceeded.
- Only assign this._db/this._archiveDb after init() succeeds. On failure,
  close the DB handle before throwing so callers never get a partially
  initialized instance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 11:56:57 -07:00
Timothy Laurent
67adfd455e merge main and fix CI: add plugin build step to pr-checks workflow
Merges origin/main to bring in the droid runtime plugin (needed by
plugin-loader test) and all recent changes. Adds a "Build plugins"
step to pr-checks.yml so plugin dist/ directories are compiled before
tests run — fixes ERR_MODULE_NOT_FOUND for hermes and droid plugins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 11:41:37 -07:00
Timothy Laurent
63ab030c56 fix(core): move liveTaskIds query inside transaction for atomicity
Addresses CodeRabbit TOCTOU concern: querying live task IDs inside the
transaction ensures the check and inserts are atomic under SQLite locking,
preventing FK violations from concurrent deletes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 10:33:11 -07:00
Fusion
b7ac46ecef feat(FN-3195): document llama.cpp provider setup and onboarding
Docs(FN-3195): adds llama.cpp provider setup and onboarding documentation to the main and dashboard READMEs.

Fusion-Task-Id: FN-3195
2026-05-04 10:18:38 -07:00
gsxdsm
1321830800 chore(release): v0.18.1
Version bump via changesets.
2026-05-04 09:55:19 -07:00
Fusion
3b956b773c feat(FN-3266): address quick chat FAB CSS token consistency
Fixed QuickChatFAB styling to align with the design token system, replacing hardcoded CSS values with consistent token variables in the component's stylesheet.

Fusion-Task-Id: FN-3266
2026-05-04 09:51:54 -07:00
gsxdsm
625c5c5f4d chore(release): v0.18.0
Version bump via changesets.
2026-05-04 09:21:08 -07:00
Fusion
5dcb739bbe feat(FN-3112): tokenize NodesView border-radius and motion styles
Fixes FN-3112: Updates NodesView CSS to use tokenized border-radius and transition values from the design system instead of hardcoded pixel values, ensuring consistency with the dashboard's established token variables.

Fusion-Task-Id: FN-3112
2026-05-04 06:12:12 -07:00
Fusion
b8d36506db feat(FN-3071): add droid runtime plugin with event bridge, process manageme
This merge introduces a droid runtime plugin system with event bridge and process management (FN-3228), stabilizes plugin workspace verification gates and suppresses placeholder plugin shells in onboarding/settings flows (FN-3071), tokenizes danger/error styling in task detail components (FN-3350),

Fusion-Task-Id: FN-3071
2026-05-04 04:30:16 -07:00
Fusion
6ecfb3c4ec feat(FN-3350): tokenize task detail danger/error styling
Fixes task detail modal danger/error styling by switching to token-based CSS variables for consistent theming across dark and light modes.

Fusion-Task-Id: FN-3350
2026-05-04 04:09:28 -07:00
gsxdsm
eb21d84fa3 chore(release): v0.17.2
Version bump via changesets.
2026-05-04 00:49:34 -07:00
gsxdsm
a3ce8e1f8e fix(FN-XXX): unify codex auth and chat fallback 2026-05-03 23:08:05 -07:00
Timothy Laurent
7e695c355c fix(core): fail-fast on corruption, preserve buffer on transient errors
- Throw from init() when integrity check fails and recovery doesn't help,
  preventing writes to a known-corrupt database
- Only drain buffer on successful flush; requeue valid entries on transient
  failures (busy/IO) so they aren't silently lost
- Add spy on flushAgentLogBuffer in deleteTask test to prove flush-before-delete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 21:39:08 -07:00
gsxdsm
4a4028f526 chore(release): v0.17.1
Version bump via changesets.
2026-05-03 19:37:04 -07:00
gsxdsm
7bccf6860b chore(release): v0.17.0
Version bump via changesets.
2026-05-03 17:26:39 -07:00
Fusion
1ff52a6f83 feat(FN-3336): recover chat isGenerating state on session load to prevent U
Merges FN-3336 to recover chat streaming state on page reload — adds `isGenerating()` and `getGeneratingSessionIds()` to `ChatManager`, enriches the session API to surface active-streaming sessions, and makes `useChat` and `useQuickChat` hooks restore the `isGenerating` flag when loading existing se

Fusion-Task-Id: FN-3336
2026-05-03 16:51:01 -07:00
Fusion
8bc76ee52b feat(FN-3334): add auto-reload setting and fix worktree project resolution
Merged two features: FN-3334 introduces a new `autoReloadOnVersionChange` setting with a toggle in the Settings modal, version-check logic in the dashboard, and corresponding tests; FN-3335 fixes worktree project root resolution in `createFnAgent` and the skill resolver, with tests for both paths. S

Fusion-Task-Id: FN-3334
2026-05-03 16:26:47 -07:00
Fusion
7773e4e4ad feat(FN-3111): add mesh configuration API routes and generator service
The merge lands the mesh configuration system (FN-3111) with type definitions, a `MeshConfigGenerator` service using a new `DockerClientService.recreateContainer()` method, and backend API routes for managing Docker-based mesh nodes. It also adds a "New Chat" button to the ChatView header on desktop

Fusion-Task-Id: FN-3111
2026-05-03 15:13:08 -07:00
Fusion
873a30141a feat(FN-3110): add docker provisioning service, API routes, and status UI c
Merges FN-3110 to add Docker provisioning support across the stack: TypeScript types and DockerProvisioningService in core, API routes in dashboard for provisioning operations, a useDockerProvisioning hook for frontend integration, and a DockerProvisioningStatus UI component — all covered by unit an

Fusion-Task-Id: FN-3110
2026-05-03 14:10:11 -07:00
Timothy Laurent
b68eee04b7 fix(core): address all PR review feedback
- Move integrity check before SCHEMA_SQL writes (was after, contradicting comment)
- Log error message in checkpoint recovery catch block
- Make flushAgentLogBuffer private
- Move deleteTask flush inside withTaskLock to prevent race
- Use try/finally in flush so splice always runs on failure
- Filter stale task entries during flush to prevent buffer poisoning
- Add flush before getAgentLogsByTimeRange for read consistency
- Clean up leaked temp dir in fresh DB test
- Fix false-positive buffer-capacity test (query DB directly)
- Rename misleading "single flush" test title

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 13:53:53 -07:00
Fusion
0bb923b044 feat(FN-3263): strengthen worker-budget regression test coverage
Strengthens regression test coverage for worker-budget behavior in the vitest workers test suite, adding 14 lines to cover edge cases.

Fusion-Task-Id: FN-3263
2026-05-03 09:51:43 -07:00
Timothy Laurent
71f26c07b0 fix(core): address PR review — buffer ordering, flush safety, dbPath in logs
- Flush buffer before appendAgentLogBatch to prevent rowid ordering
  inversion when callers interleave buffered and direct writes (P1)
- Wrap size-triggered flush in try-catch for consistency with timer path
- Move bumpLastModified inside transactions for atomicity
- Expose db.path getter and include DB path in all flush error logs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 09:16:46 -07:00
Fusion
f2fa44e270 feat(FN-2999): harden research lifecycle with idempotent cancel/retry, SSE
Merges FN-2999 research hardening (idempotent cancel/retry routes, aligned SSE event wiring, and cleaned status handling in the core research store and orchestrator) plus UI improvements to AgentDetailView header actions and planning disclosure UX in the modal, with a CSS token fallback fix in Scrip

Fusion-Task-Id: FN-2999
2026-05-03 09:11:04 -07:00
Timothy Laurent
2f96fd34a9 fix(core): include dbPath in corruption log messages
Ensures operators can identify which database has integrity issues
when multiple DB instances are running.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 09:06:39 -07:00
Timothy Laurent
2fce9b13c9 fix: address review findings — buffer exception safety, integrity check ordering
- Move integrity check before migrations/seeds to avoid writing to a
  corrupted database (makes corruption worse)
- Fix buffer swap-before-commit hazard: entries are now only removed from
  the buffer after the transaction succeeds
- Add try-catch to timer-triggered flush to prevent uncaught exceptions
  from crashing the process
- Log warning in close() catch instead of silently swallowing errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 08:58:22 -07:00
Timothy Laurent
af2bc0e341 fix: prevent SQLite B-tree corruption with WAL tuning and batched agent logs
The agentLogEntries table was doing individual auto-committed INSERTs,
creating extreme WAL pressure that caused recurring B-tree corruption.
This adds three WAL PRAGMAs (aggressive autocheckpoint, size limit,
synchronous=NORMAL), a write-behind buffer for agent log entries, and
a startup integrity check with auto-recovery attempt.

Refs: Runfusion/Fusion#24

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 08:56:52 -07:00
Fusion
93ecc88fee feat(FN-3109): add Docker connectivity service and target selector UI
This merge adds Docker connectivity management to Fusion (FN-3109), introducing a Docker client service in `@fusion/core` with typed interfaces for daemon connection configuration (host, socket path, TLS). The dashboard gains a `DockerTargetSelector` component for choosing between local socket and T

Fusion-Task-Id: FN-3109
2026-05-03 07:47:45 -07:00
Fusion
3878132c4e feat(FN-3207): remove runtime memory-backend side-load
Merged FN-3207 and FN-3242: streamlined the memory backend by removing the runtime side-load pattern in `project-memory.ts` (simplified from 25+ lines), added regression tests across core, engine, and CLI bundle to catch the import issue at build time, and updated ChatView with a CSS fix for file me

Fusion-Task-Id: FN-3207
2026-05-03 07:24:14 -07:00
Fusion
56a407b52c feat(FN-3013): add durable insight lifecycle with bounded run executor
Adds durable insight lifecycle management to the Fusion system, including a bounded insight run executor, storage contracts for insight and research data, and API integration through the insights routes. Legacy schema compatibility is stabilized, and lifecycle safeguards are documented in the archit

Fusion-Task-Id: FN-3013
2026-05-03 02:36:07 -07:00
gsxdsm
abeeec53bd chore(release): v0.16.0
Version bump via changesets.
2026-05-03 02:09:54 -07:00
gsxdsm
92513dfe0b fix(core): evict cached AgentStore Database on close
Companion to the per-rootDir Database cache: when an AgentStore is
closed, drop it from the cache so the next instantiation opens a
fresh connection instead of handing out the closed handle. Also
tolerate "database is not open" on close, since multiple AgentStore
instances now share one underlying Database.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:07:36 -07:00
gsxdsm
43a9cad3b9 fix(fusion): prevent nested .fusion roots and safe fn version lookup 2026-05-03 02:02:25 -07:00
gsxdsm
757d304a1a perf(core): cache AgentStore SQLite connection per project
The dashboard re-instantiates AgentStore on every /api/agents request, and
each instance was opening a fresh Database — re-running schema migrations
and PRAGMA integrity_check on the full file. On a multi-hundred-MB DB that
was 3-7s per request and leaked file handles. Sharing a cached Database
keyed by rootDir reduces it to a one-time process cost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:02:09 -07:00
gsxdsm
8dcf25c53a perf(dashboard): index tasks.column/updatedAt and debounce detail fetches
Speeds up task-list load and interaction for projects with 100+ tasks.

- Migration 59 adds idxTasksColumn and idxTasksUpdatedAt; listTasks()
  filters by "column" on every board load and SSE/refresh paths sort by
  updatedAt, so each query was previously a full table scan plus a temp
  B-tree sort.
- Debounce handleEmbeddedOpenDetail in ListView so rapid keyboard/mouse
  navigation no longer fires a heavy /tasks/:id (log + comments) per
  selection; stale-target requests short-circuit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 01:06:18 -07:00
gsxdsm
8d9b05e70b fix(triage): stop clobbering freshly-written PROMPT.md specs on title sync
`TriageProcessor.finalizeApprovedTask` (added in FN-3056) called
`store.updateTask({title})` while the task was still in column='triage',
which triggered a pre-existing regen path in `TaskStore.updateTask` that
overwrote the agent's just-written specification with the bootstrap stub
(`# {id}: {title}\n\n{description}\n`). Tasks shipped to `todo` (and
through to `done`) with empty 70–200 byte specs while the executor only
saw the original one-line user description. The same regen path also
silently dropped `## Review Level` / `## Frontend UX Criteria` and any
section outside a fixed whitelist whenever a non-triage task's title or
description was edited.

Replaces the regen with wrapper-shape-exact stub detection (compare to
the bytes `createTask` would have written for the pre-update title and
description) plus surgical edits for real specs: title changes splice
only the leading `# ...` heading, description changes rewrite only the
body of `## Mission`, and every other section is preserved verbatim.
`finalizeApprovedTask` now applies the prompt-declared title after
`moveTask("todo")` as defense in depth. New regression tests cover real
specs surviving title sync, long bootstrap stubs, stubs whose body
contains `##` markdown or `**Created:**` text, and the end-to-end
triage finalize sequence on a real `TaskStore`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 23:41:45 -07:00
Fusion
1ff4fb19c8 feat(FN-3015): expand insights route tests with persistence coverage and cl
This merge lands FN-3015's insights feature: it adds persistence-backed coverage for the insights routes, expands the insight store lifecycle tests, closes route validation regressions, and fixes workspace verification gates. The implementation in `insights-routes.ts` was streamlined, and a new rese

Fusion-Task-Id: FN-3015
2026-05-02 21:39:36 -07:00
Fusion
4f897d1a46 feat(FN-3067): polish onboarding disclosure UX, plugin slot fallback, and m
Merge brings FN-3067 UX revisions across onboarding components, including reduced ModelOnboardingModal complexity, new fallback styling for PluginSlot, and polish to OnboardingDisclosure, OnboardingResumeCard, and PostOnboardingRecommendations with minor updates to PlanningModeModal and SettingsModa

Fusion-Task-Id: FN-3067
2026-05-02 21:17:01 -07:00
Fusion
d1cb401a0d feat(FN-3156): add database schema init hook runner for plugin settings lif
The merge adds plugin schema initialization lifecycle support (FN-3156), introduces a ResearchTaskActionModal with model fallback notifications (FN-3012, FN-3008), adds async planning draft sync to prevent UI blocking (FN-3229), and implements viewport-conditional mission split layout (FN-3130). Inf

Fusion-Task-Id: FN-3156
2026-05-02 20:30:18 -07:00
Fusion
68f34dd0f7 feat(FN-3008): notify when model settings fall back to defaults
Merges FN-3008 to add a "fallback-used" notification system: the engine now emits events when AI model fallbacks are triggered, dispatches notifications via ntfy/webhook providers, surfaces a session banner in the dashboard, and exposes a settings toggle to enable or disable these alerts.

Fusion-Task-Id: FN-3008
2026-05-02 19:55:54 -07:00
Fusion
44a996e769 feat(FN-2998): scope ResearchView bottom safe-area padding to mobile
The merge brings in a fix (FN-2998) that scopes the bottom safe-area padding in ResearchView to mobile devices only, correcting an over-application of the padding on desktop or larger screens.

Fusion-Task-Id: FN-2998
2026-05-02 19:45:43 -07:00
gsxdsm
a01ae60088 chore(test): split dashboard api/routes monoliths and document core fork-only constraint
Split packages/dashboard/app/__tests__/api.test.ts (~6.4k lines) into per-area files (auth, git, missions, projects, settings, tasks), and src/__tests__/routes.test.ts (~20k lines) into per-area files (agents, auth, automation, git, github, planning, settings, system, tasks, tasks-ops). The monolith files were dominating wall-clock for the dashboard suite under file-parallel execution.

Also document in packages/core/vitest.config.ts why the core suite cannot move to "threads": vitest-setup gates per-worker cwd on isMainThread (false in worker_threads, so isolation breaks), and setup-test-isolation writes process.env.HOME unconditionally (threads share env, so concurrent workers race).

Drop an unused execFileSync import from scripts/test-with-lock.mjs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:25:40 -07:00
gsxdsm
1aa1e723f6 chore(build,test): split desktop/mobile from default build; share vitest worker budget
- pnpm build now excludes @fusion/desktop and @fusion/mobile by default
  (recursive build still available as pnpm build:all). Saves time on
  workspace-wide builds that don't need the native shells.
- Hoist the per-package max-worker computation into a shared
  packages/core/src/__test-utils__/vitest-workers.ts util. Every
  vitest.config.ts now calls computeMaxWorkers(), which honors
  VITEST_MAX_WORKERS, FUSION_TEST_TOTAL_WORKERS, and a per-config
  defaultCap, clamped to cpus-1.
- pnpm test sets VITEST_MAX_WORKERS=2 so the workspace run keeps total
  fan-out modest with --workspace-concurrency=2.
- Switch dashboard vitest pool from forks to threads so jsdom/React
  suites share a V8 heap instead of duplicating ~500MB per worker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:56:15 -07:00
gsxdsm
117224ba8f fix(engine): give merge commits a real subject in fallback paths
Three merger fallback commit paths (auto-resolve-all-conflicts,
-X theirs/ours side strategy, AI-agent-didn't-commit) hard-coded
`feat(FN-XXXX): merge fusion/fn-xxxx` as the subject and never used
the AI subject summarizer. Route them through buildDeterministicMergeMessage
so they pick up aiSubject when available.

When the AI subject summarizer returns null, derive the subject from
the branch's first step commit (with conventional-commit prefix
stripped, plus `(+N more)` for multi-commit branches) instead of the
bare `merge <branch>` template.

Bump DEFAULT_COMMIT_SUBJECT_TIMEOUT_MS 15s → 30s so slow-first-token
providers complete instead of silently falling back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:32:47 -07:00
Fusion
bb79f56f8f feat(FN-3106): add draft planning workflow with createAiSession plugin API
This merge delivers the full draft planning feature (FN-3106) — API routes for planning subtasks, the AiSessionStore backend for draft sessions, a draft planning API client, auto-creation of planning drafts from user input, and corresponding UI polish in PlanningModeModal with accessibility-focused

Fusion-Task-Id: FN-3106
2026-05-02 13:32:09 -07:00