Commit Graph

13 Commits

Author SHA1 Message Date
gsxdsm
7a2da530b9 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
Fusion
174453465f 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
gsxdsm
9c45d2410b perf(test): cap vitest worker fan-out to keep dashboard responsive
On high-core dev machines (e.g. 28-core M-series), per-package vitest
defaulted to cpus().length - 1 workers (27), and `pnpm test` ran 4
workspace packages concurrently — easily 100+ vitest threads per sweep.
When the dashboard had agents running tests, 2+ concurrent sweeps would
saturate CPU and the UI became sluggish.

- Cap defaultMaxWorkers to min(6, cpus()-1) in cli/dashboard/desktop/
  mobile/plugin-sdk vitest configs (engine and core were already capped)
- Lower root `pnpm test` workspace-concurrency 4 → 2
- VITEST_MAX_WORKERS override still respected for explicit fast runs

Worst-case fan-out drops from ~108 workers to ~12 per `pnpm test`.
CI runners with fewer cores are unaffected (cap doesn't bind).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:30:02 -07:00
gsxdsm
afd48c2cc4 test(FN-2360): harden test isolation around repo fusion state 2026-04-29 12:02:56 -07:00
Fusion
995165ea60 feat(FN-2944): merge fusion/fn-2944
- test(FN-2944): cover already checked out worktree conflict recovery
- fix(FN-2944): recognize git already checked out worktree conflict
- fix(engine): auto-recover from squash-merge orphan rebase failures

Fusion-Task-Id: FN-2944
2026-04-29 07:10:52 -07:00
Fusion
0c241b017f feat(FN-2855): route scheduled tasks using effective node resolution
- Add an effective node resolver with task override, project default, and local fallback precedence.
- Wire scheduler dispatch to persist effectiveNodeId/effectiveNodeSource and log resolved node routing.
- Add coverage for effective node resolution and scheduler node routing integration behavior.
- Stabilize workspace test resolution by adding @fusion/core and @fusion/plugin-sdk aliases across Vitest configs.
2026-04-28 14:25:55 -07:00
Fusion
7c1a1c36cc feat(FN-2370): merge fusion/fn-2370 (auto-resolved)
- test(FN-2370): complete Step 3 — align qa-check template expectation
- test(FN-2370): complete Step 2 — add regression coverage for addComment diagnostics
- test(FN-2370): complete Step 2 — cover addComment warning regressions
- feat(FN-2370): complete Step 1 — log addComment best-effort failures
- feat(FN-2369): merge fusion/fn-2369
- feat(prompts): require lint alongside tests and typecheck in agent instructions
- perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency
- fix(core): recognize legacy kb-* backups and canonicalize .kb/backups settings
- refactor: eliminate remaining 15 any warnings and ratchet rule to error
- refactor: eliminate ~400 no-explicit-any warnings across the workspace
- feat(core): add getErrorMessage helper for narrowing unknown errors
- refactor: fix and tighten mechanical lint rules
- chore(eslint): fix pre-existing errors surfaced by wider .cjs match
- chore(eslint): promote @typescript-eslint/no-unused-vars from warn to error
- refactor(dashboard,desktop,engine): remove unused imports, props, and locals
- refactor(core): remove unused imports, helpers, and dead migration constant
- refactor(cli): remove unused imports and variables
- refactor: adapt resource loader and tool wiring to pi-coding-agent 0.70
- fix: adapt to AgentState.error → errorMessage rename
- refactor: migrate @sinclair/typebox imports to typebox 1.x
- refactor: migrate to ModelRegistry.create factory
- chore: bump pi-coding-agent + pi-ai to 0.70.0
- refactor: remove legacy kb compatibility
- feat: add "Anthropic — via Claude CLI" as a first-class provider
- test(FN-2358): harden clean-worktree CI verification tests
- fix(FN-2352): add structured terminal websocket diagnostics
- fix: use live merge-base for task diff scope
- feat: backfill Claude skills when useClaudeCli toggle flips on
- fix: prevent nested .fusion/.fusion dir from PluginStore path bug
2026-04-24 08:54:25 -07:00
gsxdsm
c36d16e87d Revert "perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency"
This reverts commit 972ad0f9fa55dc1419660aba4758a9d3c325919a.
2026-04-23 23:02:37 -07:00
gsxdsm
8def13ee2e perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency
- All 8 vitest configs now default maxWorkers to \`cpus().length - 1\`
  instead of the arbitrary \`Math.min(4, …)\` cap. Respects an explicit
  VITEST_MAX_WORKERS override for constrained environments (CI, laptops
  on battery). CLI keeps \`fileParallelism: false\` — audit found real
  shared state (process.chdir in agent-import, dist/ races in build-exe
  suites) that needs refactoring before we can flip it.
- packages/dashboard: move the mobile build-output smoke test (which
  invokes \`pnpm build:client\` via execSync, ~3s per run) into a
  dedicated \`test:build\` script so \`pnpm test\` isn't gated by it. A
  matching root script keeps CI wiring simple.
- Root: bump --workspace-concurrency from 2 → 4 so core/engine/cli/
  desktop can pipeline against dashboard's tail.
- Drop the now-redundant VITEST_MAX_WORKERS=4 prefix from the root
  scripts; the per-package configs pick up cpu count themselves.

Dashboard test suite: 182s → 38s (5x) on a 10-core machine. Full
workspace run: ~3m15 → 2m29. All tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
Fusion
313a5e6385 test(dashboard): realign DevServer tests with session-based component
- DevServerView.preview.test.tsx: drop manual-preview-override assertion
  (the component hard-codes isManualPreviewOverride=false under the new
  session model, so the badge is always "Auto"), provide both legacy and
  current-API fields from createDevServerHookState, and mirror
  embedContext into blockReason in createPreviewEmbedState so the
  fallback panel picks up the reason text under the new destructure.
- runtime-adapter.test.ts: skip the createSession / promptWithFallback /
  describeModel blocks with a TODO — the adapter loads pi.js via
  CommonJS require() which vi.mock does not intercept, so the mocked
  module is never actually installed. Needs a dynamic import seam
  before these can run; tracking separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 16:31:30 -07:00
gsxdsm
31b88cdad3 fix(FN-2116): allow two vitest workers 2026-04-18 17:48:22 -07:00
gsxdsm
e70f9aebc0 fix(FN-2116): show paused agents and cap vitest workers 2026-04-18 17:34:44 -07:00
gsxdsm
8c5327a660 feat(FN-1111): merge fusion/fn-1111 (auto-resolved)
- docs(FN-1111): complete Step 8 - plugin system documentation
- feat(FN-1111): complete Step 7 - testing and build fixes
- feat(FN-1111): complete Step 6 - export plugin types from core
- feat(FN-1111): complete Step 5 - plugin SDK package
- feat(FN-1111): complete Step 4 - plugin loader with lifecycle management
- feat(FN-1111): complete Step 3 - plugin store with CRUD
- feat(FN-1111): complete Step 2 - add plugins table schema migration
- feat(FN-1111): complete Step 1 - plugin type definitions
2026-04-09 14:45:32 -07:00