Commit Graph

675 Commits

Author SHA1 Message Date
gsxdsm
35084c8e20 chore: snapshot WIP across dashboard, engine, and core
Bundles staged work-in-progress modifications across multiple packages
(routes, store, agent-instructions, self-healing, QuickEntryBox, etc.)
plus the dashboard theme-data.css preload fix.

Note: an unstaged 621-line deletion in .fusion/memory.md was deliberately
NOT committed — it appears to be an accidental overwrite of architecture
notes and is left in the working tree for review.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 21:12:40 -07:00
gsxdsm
b3f057a281 fix: improve merge verification and dashboard behavior 2026-04-10 18:30:23 -07:00
gsxdsm
2ece64dd70 refactor(FN-1563): decouple CLI commands from UI dependencies
- Extract task lifecycle helpers (checkForExistingSession, resolveProjectPath) to shared modules
- Extract port selection logic to dedicated port-prompt module
- Remove direct imports from @fusion/dashboard in serve.ts
- Add architectural boundary comments for future maintainability
- Update tests to reflect new module structure
- Add memory note documenting the architectural decision
2026-04-10 12:47:46 -07:00
gsxdsm
9830ea96c6 fix(ci): fix test failures from recent feature additions
- Add ChatStore mock to all dashboard route tests that mock @fusion/core,
  since server.ts now instantiates ChatStore(store.getFusionDir(), ...)
- Add getFusionDir to createMockStore in server.test.ts
- Gate AI session cleanup scheduling behind shouldScheduleAiSessionCleanup()
  (returns false in test env) to prevent open handle warnings
- Fix desktop tests: DASHBOARD_URL is now exported as a function alias,
  update assertions to call DASHBOARD_URL() instead of using as string
- Add node:os mocks to system-metrics.test.ts for deterministic results
- Replace hardcoded maxWorkers=16 with availableParallelism()-based
  calculation in all vitest configs to prevent OOM on 2-core CI runners
- Add --workspace-concurrency=2 to pnpm test commands
- Fix TaskCard tests: update mission badge title assertions to full titles
- Remove unused /api/mesh/state route
- Fix plugin-auto-label: add isError field, async onTaskCreated, "tests" keyword
- Fix plugin-ci-status: add module-level logger, tighten test assertions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:01:03 -07:00
gsxdsm
d7552a56a4 feat(FN-1408): complete Step 1 - Add node context plumbing at App shell
- Wrap AppInner with NodeProvider in App.tsx
- Read node context state (currentNode, currentNodeId, isRemote, setters)
- Add useRemoteNodeData and useRemoteNodeEvents hooks
- Sync selected node with useNodes() results
- Update Board/ListView/ExecutorStatusBar to use remote tasks when in remote mode
- Add mocks for NodeContext, useRemoteNodeData, useRemoteNodeEvents, useNodes in App.test.tsx
- Clear fusion-dashboard-current-node in test setup to avoid cross-test leakage
2026-04-09 23:28:25 -07:00
gsxdsm
7b8960f3e9 feat(FN-1496): harden semaphore lane-vs-utility boundary
- Add explicit boundary comments to serve.ts and dashboard.ts clarifying semaphore lane usage
- Add regression tests for semaphore lane-vs-utility boundary in serve.test.ts and dashboard.test.ts
- Add changeset for @gsxdsm/fusion patch release
2026-04-09 21:52:07 -07:00
gsxdsm
0266b6d000 feat(FN-1468): wire plugin backend into dashboard and serve startup
- Add plugin backend wiring to fn dashboard startup
- Add plugin backend wiring to fn serve (headless node) startup
- Document plugin wiring pattern in project memory
- Add comprehensive tests for plugin initialization in dashboard and serve commands
- Include changeset for @gsxdsm/fusion package
2026-04-09 21:22:46 -07:00
gsxdsm
27c02d33c7 feat(FN-1477): add memory pruning to daily insight extraction
- Add pruneStaleMemoryEntities() function to memory-insights.ts
- Integrate memory pruning into dailyInsightExtraction() workflow
- Add maxMemoryAgeDays setting (default: 30 days) for configurable pruning threshold
- Include pruned count in daily insight report summary
- Add comprehensive unit tests for memory pruning logic
- Update docs: architecture, memory-plugin-contract, settings-reference, contributing
2026-04-09 21:07:48 -07:00
gsxdsm
749babf522 feat(FN-1114): merge fusion/fn-1114 (auto-resolved)
- feat(FN-1114): complete all steps — plugin examples, docs, and scaffold command
2026-04-09 19:04:12 -07:00
gsxdsm
fbcc1540b3 feat(FN-1113): complete Step 5 — CLI plugin commands 2026-04-09 18:42:48 -07:00
gsxdsm
04f835f821 feat(FN-1399): add background memory summarization after task completion
- Add MemoryInsights class in @fusion/core for AI-powered memory audit generation
- Add post-run hook to CronRunner for triggering memory summarization after scheduled tasks
- Wire memory background processing in both dashboard and serve commands
- Add memoryAuditEnabled and memoryAuditSchedule settings for configurable automation
- Fix startup ordering: sync automation before cronRunner.start() to prevent race conditions
- Add comprehensive tests for memory-insights and dashboard/serve integration
- Update contributing.md and settings-reference.md with documentation
2026-04-09 16:14:44 -07:00
gsxdsm
ef9b4edd12 fix(FN-1339): move executor status bar above mobile nav bar 2026-04-09 15:49:42 -07:00
gsxdsm
a53da8890c feat(FN-1229): add node mesh CLI commands for node and mesh management
- Add fn node list command to list all registered nodes with status and URL
- Add fn node show command to display detailed node information including system metrics
- Add fn node health-check command to trigger and verify node health status
- Add fn node remove command to unregister nodes from the mesh
- Add fn mesh status command to show mesh topology with peer connections
- Add comprehensive tests for all node and mesh CLI commands
- Update bin.ts to wire up new node and mesh subcommands
- Update memory with CLI mock pattern for testing
2026-04-09 12:54:16 -07:00
gsxdsm
2e3c94f4de feat(FN-1228): add Node Dashboard UI with mesh topology and routes tests 2026-04-09 12:34:03 -07:00
gsxdsm
effd3d8423 fix(FN-1348): fix test mocks for HeartbeatMonitor wiring in dashboard
- Update dashboard command tests to properly mock HeartbeatMonitor dependencies
- Ensure test suite passes with correct wiring expectations
2026-04-09 10:20:39 -07:00
gsxdsm
82bc3a4848 fix: sync semaphore concurrency limit on every settings change
The cachedMaxConcurrent variable driving the AgentSemaphore was only
updated during unpause transitions and merge retry timers. Changing
maxConcurrent in the dashboard had no effect on the semaphore until one
of those events fired, causing fewer tasks to run than configured.

Also adds HeartbeatMonitor and HeartbeatTriggerScheduler wiring to both
serve and dashboard commands, with tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 09:56:32 -07:00
gsxdsm
0ad76e1e40 feat(FN-1236): migrate GitHub PR workflows to gh authentication
- Require gh-authenticated paths for task pr-create and dashboard PR routes
- Switch dashboard command and extension GitHub tools to use the gh auth client instead of token-based auth
- Update CLI and dashboard tests to cover gh-only createPr and import behavior
- Refresh README guidance and add a changeset removing the GitHub token requirement for PR flows
2026-04-08 15:40:39 -07:00
gsxdsm
b94c7428d3 feat(FN-1318): rename CLI binary artifacts from kb to fn
- Update CLI build and runtime paths to emit and reference fn-named binaries across default and cross-target builds
- Adjust Bun binary bootstrap stubs and native patch temp/symlink prefixes to use fn naming consistently
- Update CI, release, and test-release workflows to validate and collect fn-prefixed artifacts
- Align CLI build and package config tests with fn binary expectations and add a patch changeset for @gsxdsm/fusion
2026-04-08 14:47:30 -07:00
gsxdsm
e78d05e02c feat(FN-1216): rename extension tools to fn_* across CLI and docs
- Rename all pi extension tool registrations from kb_* to fn_* across task, mission, and agent tool families
- Update extension and skill-sync tests plus Fusion skill docs/workflows to assert and document the new fn_* tool names
- Align product-identity strings across core, dashboard, and CLI references, including GitHub import examples, User-Agent headers, and terminal TERM_PROGRAM
- Add a @gsxdsm/fusion minor changeset describing the extension tool-prefix rename
2026-04-08 14:26:30 -07:00
gsxdsm
d5063c6b26 feat(FN-1196): support API-key providers in dashboard auth flow
- Wrap dashboard auth storage with API-key provider helpers derived from model registry providers
- Normalize provider display names and bridge set/clear/has API-key operations to AuthStorage credentials
- Expand route and onboarding tests for mixed OAuth/API-key states and API-key-authenticated setup paths
- Stabilize assignment-trigger heartbeat timing test by replacing fixed delays with waitFor assertions
2026-04-08 13:54:30 -07:00
gsxdsm
15f3dca938 feat(FN-1190): add agent export for Agent Companies packages
- Add a core exporter that generates COMPANY.md, per-agent AGENTS.md files, and optional SKILL.md stubs with stable slug/link handling
- Export new Agent Companies exporter APIs from @fusion/core and extend manifest kinds to include skill entries
- Add fn agent export with project-aware agent loading, optional company metadata flags, and export summary/error output
- Add POST /api/agents/export route with request validation, agent ID filtering, custom/default output directory support, and exporter integration
- Add focused tests for core exporter behavior, CLI export command, and dashboard route handling
2026-04-08 13:31:07 -07:00
gsxdsm
7881a09a07 fix(FN-1285): harden async listener error guards
- Wrap TaskExecutor task:updated async listener logic in a top-level guard and log uncaught listener failures
- Add explicit catch handling for ProjectManager activity logging and dashboard stuck-detector settings-triggered checkNow calls
- Document async EventEmitter guard conventions in scheduler and hybrid executor listener wiring
- Add regression tests for executor and dashboard listener guards and include a patch changeset for @gsxdsm/fusion
2026-04-08 11:49:33 -07:00
gsxdsm
d100a887f1 fix(FN-1252): add dashboard dispose lifecycle to prevent listener leaks
- Track runDashboard event handlers through a centralized register helper
- Add an idempotent dispose() that unregisters store/process listeners and clears merge retry timers
- Guard periodic merge retry scheduling against disposed state and invoke cleanup on shutdown paths
- Add lifecycle regression tests covering listener cleanup, idempotent dispose, and MaxListeners warnings
2026-04-08 11:27:42 -07:00
gsxdsm
4f48d2d186 feat(FN-1163): align command references with fn naming
- Update CLI command strings, help text, and project-resolution messaging to reference fn
- Sync core backup/store messaging and dashboard API/planning/subtask prompt examples with fn usage
- Refresh dashboard UI copy in settings, project detection, and PR guidance for consistent command naming
- Adjust CLI/dashboard tests and add a @gsxdsm/fusion changeset for the naming alignment patch
2026-04-08 11:00:32 -07:00
gsxdsm
4c843a60f3 test(FN-1283): expand CLI settings and routing coverage
- Add comprehensive settings-import tests for global/project scope handling and error paths
- Add settings-export tests covering output targets, filtering, and serialization behavior
- Expand project-resolver test matrix for flag/default/CWD resolution and fallback cases
- Extend bin entrypoint tests for command routing, argument forwarding, and failure handling
2026-04-08 10:38:15 -07:00
gsxdsm
c36d54b757 feat(FN-1174): migrate agent import flow to agent companies format
- Replace legacy companies.sh parser/types with the new agent companies parser and exported core types.
- Update CLI agent import wiring and tests to consume the new import source handling.
- Update dashboard agent import modal, API client, and import route tests to support archive-based sources.
- Add release-note changesets and lockfile updates for the @gsxdsm/fusion patch release.
2026-04-08 10:35:28 -07:00
gsxdsm
dfa109742a feat(FN-1218): harden mission autopilot with self-healing recovery
- Add mission self-healing project settings for stale activation thresholds, task retry budgets, and mission health-check intervals
- Extend MissionAutopilot with failed-task retry handling, blocked feature escalation, stale activating mission recovery, and periodic feature/task consistency reconciliation
- Wire autopilot failure and recovery flows through Scheduler and InProcessRuntime, including startup recovery for watched missions after crashes
- Add blocked feature status support in core mission types and CLI mission status labels
- Expand mission-autopilot coverage for retry flows, stale/startup recovery, health checks, and regression scenarios, and include a patch changeset for @gsxdsm/fusion
2026-04-08 10:01:06 -07:00
gsxdsm
a321b89011 feat(FN-1273): support agent assignment in extension task tools
- Add optional agentId parameter to kb_task_create and persist it as assignedAgentId
- Extend kb_task_create output/details to include assignee information when present
- Add kb_task_update support for setting or clearing assignedAgentId via agentId (including null)
- Expand extension tests for create/update/clear assignment flows and add a patch changeset for @gsxdsm/fusion
2026-04-08 09:57:45 -07:00
gsxdsm
d03cc933d7 test(FN-1245): harden bundle-output tests for hermetic behavior
- Only require dist/bin.js in setup so tests do not depend on dashboard client artifacts being prebuilt
- Gate dashboard client asset assertion behind a presence check to avoid flaky environment-specific failures
- Add tsup.config.ts assertions to verify dashboard/dist/client is copied into cli dist/client during build
2026-04-08 09:57:05 -07:00
gsxdsm
f68a5f0565 fix(FN-1243): add build-time dashboard stub fallback for CLI bundles
- Add resilient client asset staging in packages/cli/build.ts with automatic dist/client/index.html stub generation when dashboard assets are missing
- Update packages/cli/tsup.config.ts onSuccess hook to clear stale client output and emit the same minimal stub fallback in clean checkout builds
- Make bundle-output test build-aware by running pnpm build in beforeAll when bundle artifacts are absent, then assert client assets are present
- Preserve build output visibility by reporting whether real or stub client assets were staged
2026-04-08 09:44:42 -07:00
gsxdsm
eac3f1c6a1 feat(FN-1225): add headless fn serve command with health checks
- Add a new serve command implementation that runs the dashboard server in headless mode and exposes a health endpoint
- Register the serve command in CLI routing and extend bin command coverage for dispatch behavior
- Add comprehensive serve command tests for startup flow, options handling, and health-check responses
- Fix mission event ordering in MissionStore to keep health snapshots deterministic under concurrent updates
- Include a changeset for @gsxdsm/fusion documenting the new fn serve capability
2026-04-08 09:26:56 -07:00
gsxdsm
e27e1fd5bf fix: include remaining local updates 2026-04-08 08:57:19 -07:00
gsxdsm
d1b4f5d417 fix: recover approved triage tasks stuck specifying 2026-04-08 08:57:09 -07:00
gsxdsm
c1ccf92016 feat(FN-1189): add Agent Companies import support
- Expand fn agent import to accept directories, .tar.gz/.tgz/.zip archives, single .md manifests, and legacy .sh manifests
- Update /api/agents/import to handle agents array, source path, or manifest string inputs with dry-run previews and legacy fallback parsing
- Refresh AgentImportModal and dashboard API typing for new preview metadata, directory uploads, and improved error handling
- Add coverage for CLI import paths, dashboard import routes, modal behavior, and assignment route timeout stability
- Add a minor @gsxdsm/fusion changeset documenting Agent Companies import support
2026-04-08 07:13:38 -07:00
gsxdsm
44d0b400d4 feat(FN-1226): add production Docker workflow
- Add a root .dockerignore to reduce build context and exclude local runtime state
- Add a multi-stage Dockerfile that builds the workspace, runs as non-root, and includes health checks
- Document Docker build/run usage, env vars, persistence, and quick-start commands in README and docs/docker.md
- Add Docker configuration tests in packages/cli/src/docker.test.ts to validate required image and docs expectations
2026-04-08 06:55:35 -07:00
gsxdsm
ecf0eb6d84 feat(FN-1073): add desktop CLI workflow and packaging support
- Add new `fn desktop` CLI command with argument handling and comprehensive command/bin tests
- Implement desktop build and hot-reload dev scripts and wire package scripts/dependencies for Electron workflows
- Add electron-builder configuration and desktop main-process/integration test coverage to stabilize packaging behavior
- Document desktop development and usage in README files and include a changeset for the published CLI package
2026-04-08 01:40:05 -07:00
gsxdsm
750911a809 feat(FN-1085): align agent routing and runtime contracts
- Harden core AgentStore lifecycle behavior and heartbeat runtime integration paths
- Align dashboard agent APIs, server routes, and agent UI flows with the updated contract
- Tighten CLI agent/message command routing and validate payload handling semantics
- Expand test coverage across core, dashboard, engine, and CLI for route, heartbeat, and instruction regressions
2026-04-08 00:44:33 -07:00
gsxdsm
b5980ebbb3 feat(FN-1080): add node management APIs and CLI commands
- Add dashboard /api/nodes CRUD, health-check, and metrics routes backed by CentralCore with request validation
- Extend project updates and frontend API types to support node assignment via nodeId
- Add dashboard API client helpers for node list/register/update/delete/health/metrics operations
- Implement fn node list/add/remove/show/health commands with validation, confirmation, and table/JSON output
- Add route and CLI/bin tests plus a minor @gsxdsm/fusion changeset for node management support
2026-04-07 22:28:58 -07:00
gsxdsm
5f7f351a8a fix(triage): clear specifying status on pause/stuck and add StuckTaskDetector support
- Fix pause-abort handler using updateTask({status: undefined}) which was a
  no-op, leaving tasks stuck in 'specifying' forever after a pause interrupts
  a session post-APPROVE. Changed to status: null to actually clear the field.
- Apply same fix to transient-error retry and general error catch paths.
- Wire StuckTaskDetector into TriageProcessor: trackTask/untrackTask/recordActivity
  on session lifecycle, markStuckAborted to prevent stuck kills from being
  reported as errors, and clear status to null on stuck-kill for next-poll retry.
- Update dashboard.ts to pass stuckTaskDetector to TriageProcessor and call
  triageRef.current?.markStuckAborted in the shared onStuck callback.
- Add 3 tests covering pause-abort status clearing and stuck detector wiring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 21:51:09 -07:00
gsxdsm
d653391d30 test(FN-1084): expand mission workflow automated test coverage
- Add dashboard mission e2e coverage for autopilot endpoint flows and mission summary behavior
- Add comprehensive mission interview tests for planning, step progression, and output handling
- Extend CLI mission command tests for add/link workflows and argument validation paths
- Strengthen engine mission scheduler assertions around activation sequencing and state transitions
- Add core mission store tests to validate mission persistence and related edge cases
2026-04-07 19:06:18 -07:00
gsxdsm
335a20e1bd feat(FN-1050): add per-agent custom instructions support
- Add instructionsPath and instructionsText fields to Agent type and AgentStore
- Create agent-instructions resolver module in engine with priority-based resolution
- Wire custom instructions into executor, triage, reviewer, and merger agents
- Add PATCH /agents/:id/instructions API endpoint with file and text support
- Add instructions editor UI to dashboard agent detail config tab
- Add comprehensive tests for instructions resolver and AgentStore integration
- Add changeset for published package bump
2026-04-07 15:17:08 -07:00
gsxdsm
a716605747 feat(FN-1062): fix step status tracking and expose step session settings in CLI
- Fix step status not being tracked correctly in executor callbacks (done/skipped were not updated)
- Expose runStepsInNewSessions and maxParallelSteps settings in CLI settings command
- Add AGENTS.md documentation for runStepsInNewSessions and maxParallelSteps settings
- Add changeset for the published CLI package
- Add tests for CLI settings validation and executor step status tracking
2026-04-07 13:41:12 -07:00
gsxdsm
8d6a44d1b6 feat(FN-1044): add thinkingLevel and planning model support to task creation
- Add thinkingLevel field to createTask and updateTask in core store
- Accept thinkingLevel and planningModel fields in dashboard task routes
- Send thinkingLevel and planningModel in frontend API calls from task forms
- Add ThinkingLevel selector to ModelSelectorTab component with tests
- Wire up planning model and thinking level in QuickEntryBox, TaskForm, and NewTaskModal
- Add unit tests for store, routes, and ModelSelectorTab coverage
- Add changeset and update AGENTS.md documentation
2026-04-07 12:18:49 -07:00
gsxdsm
612827eee8 feat(FN-976): add companies.sh agent import for CLI and dashboard
- Add companies.sh type definitions and parser in @fusion/core with comprehensive tests
- Create CLI `kb agent-import` command to import agents from companies.sh
- Add POST /api/agents/import dashboard endpoint with dry-run support
- Build AgentImportModal component with search, preview, and batch import UI
- Add dashboard route tests for the agent import API endpoint
- Create changeset for @gsxdsm/fusion minor bump
2026-04-07 11:41:38 -07:00
gsxdsm
7cc4ee5ebb feat(FN-989): add inter-agent messaging system with mailbox UI and CLI commands
- Add Message types (Message, MessageThread, MessageRecipient) and exports to @fusion/core
- Create MessageStore with full CRUD: send, read, delete, inbox, threads, and search
- Add messages table migration (schema v12) with SQLite full-text search support
- Add REST API routes for messaging (CRUD, search, broadcast, unread count)
- Add frontend API client functions for all messaging endpoints
- Build MailboxModal and MessageComposer dashboard components with header integration
- Add CLI message commands (inbox, send, read, delete) with rich output formatting
- Add comprehensive test coverage for MessageStore, CLI commands, and UI components
- Update documentation (CLI STANDALONE.md, dashboard README) with messaging usage
2026-04-07 11:21:59 -07:00
gsxdsm
a22676b1d1 feat(FN-1053): add AI prompt executor for cron workflow steps
- Define AiPromptExecutor type and update CronRunner constructor to accept injected executor
- Implement executeAiPromptStep with real agent session execution in worktrees
- Create createAiPromptStepExecutor factory and wire up in dashboard CLI
- Add comprehensive tests for AI prompt step execution (mock agent, errors, output capture)
- Fix mock typing for dashboard test build compatibility
2026-04-07 11:20:48 -07:00
gsxdsm
7e8eea2051 feat(FN-1051): wire MissionAutopilot into dashboard startup
- Instantiate MissionAutopilot with TaskStore and MissionStore before Scheduler creation
- Pass missionAutopilot and missionStore to Scheduler constructor options
- Break circular dependency via setScheduler() after Scheduler construction
- Start autopilot in engine startup sequence, stop on graceful shutdown
- Add comprehensive tests verifying MissionAutopilot wiring in both test files
2026-04-07 10:40:05 -07:00
gsxdsm
3fb3e819af feat(FN-986): add agent stop/start CLI commands and extension tools
- Add `fn agent stop <id>` and `fn agent start <id>` CLI commands for pausing/resuming agents
- Add `kb_agent_stop` and `kb_agent_start` tools to the pi extension for in-session agent control
- Validate state transitions using AGENT_VALID_TRANSITIONS before applying changes
- Export AgentStore from @fusion/core public API
- Add comprehensive tests for agent CLI commands (210 lines)
- Add changeset for @gsxdsm/fusion patch release
2026-04-05 16:15:22 -07:00
gsxdsm
7f68136e5b feat(FN-987): wire AgentStore to TaskExecutor in dashboard command
- Wire AgentStore into TaskExecutor initialization within dashboard.ts startup
- Add AgentStore mock to dashboard command tests for proper test coverage
- Update test mocks to reflect new AgentStore dependency injection
2026-04-05 15:55:05 -07:00
gsxdsm
eb6fbbb42c fix: recover completed tasks stuck in progress 2026-04-05 15:24:32 -07:00