Commit Graph

364 Commits

Author SHA1 Message Date
gsxdsm
34b2af26a7 Fix task card step progress 2026-04-10 21:46:06 -07:00
gsxdsm
e258279a5f feat(FN-1567): add mission contract assertions model types and APIs
- Add mission contract assertions model with types: ContractAssertion, ContractAssertionStatus, ContractAssertionType
- Add assertions table to schema v29 with migration from v28
- Implement assertion APIs: create, update, link/unlink to features, list, getWithContext
- Add rollup computation (assertion counts, pass rates) for missions and milestones
- Add many-to-many feature-to-assertion linking via featureAssertions table
- Add project memory documentation for assertion lifecycle and patterns
- Update schema version assertions in db.test.ts, run-audit.test.ts, and task-documents.test.ts
2026-04-10 21:29:54 -07:00
gsxdsm
1a3ff011d3 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
5984584d22 perf(dashboard): slim task list + auto-archive stale done tasks
GET /api/tasks was returning ~69 MB of JSON per call (67.9 MB of agent
logs across 1199 tasks), causing the dashboard to hang for 2+ minutes.

- core: extend listTasks() with slim and includeArchived options
- dashboard: GET /api/tasks now uses slim mode and excludes archived
  by default; ?includeArchived=1 opts in
- frontend: lazy-load archived tasks when the archived column is first
  expanded via new useTasks.loadArchivedTasks()
- engine: self-healing maintenance now auto-archives done tasks older
  than 48h (data stays in SQLite, column flips done -> archived)
- tests: slim mode + includeArchived coverage in store.test.ts;
  routes.test.ts assertion updated for new args

Also bundles in-progress test-setup noise filters and pre-existing
QuickEntryBox/routes test work that was already modified locally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 20:16:20 -07:00
gsxdsm
b8a0b6ccbf feat(FN-1446): wire planning + subtask prompt override resolution with regression tests 2026-04-10 19:32:22 -07:00
gsxdsm
93bfdc1e76 feat(FN-1559): enforce feature status invariants at API boundary
- Guard PATCH /api/missions/features/:featureId to reject status
  transitions to execution states (triaged, in-progress, done, blocked)
  when feature has no taskId
- 'defined' status remains always allowed (initial state)
- Non-status field updates (title, description) are unaffected
- Add 6 new tests covering guard behavior and edge cases
- All 147 mission-e2e tests passing
2026-04-10 19:18:20 -07:00
gsxdsm
df1ff16519 feat(FN-1269): add Routine Engine Integration and fix PROMPT_KEY_CATALOG
- Add Routine Engine Integration documentation to project memory
- Fix PROMPT_KEY_CATALOG by adding missing executor role to agent-generation-system and workflow-step-refine entries
- Update test to expect 6 executor keys instead of 4
2026-04-10 13:22:29 -07:00
gsxdsm
d61e3c59fd feat(FN-1434): add prompt overrides for agent generation
- Add prompt-overrides module with template resolution and instruction injection
- Wire prompt overrides into agent generation flow via POST /api/agents route
- Support template-based prompt customization with role-based assignments
- Add agent generation tests and routes tests
- Document new prompt override settings in settings reference
2026-04-10 12:49:38 -07:00
gsxdsm
d9acc10c49 feat(FN-1540): add lint as inline quality gate in task prompts
- Add ESLint configuration (eslint.config.mjs) for TypeScript/JavaScript linting
- Update executor prompts to include lint instruction before code submission
- Add lint check to triage prompt validation workflow
- Update agent prompts to emphasize lint compliance as quality requirement
- Add lint tool to agent toolset with file-level rule disabling capability
- Include lint in CI workflow with non-blocking status
- Update tests to verify lint-inclusive prompt behavior
- Add documentation for lint integration in contributing.md
- Add changeset for @gsxdsm/fusion minor release
2026-04-10 12:48:27 -07:00
gsxdsm
ed396fc6b6 feat(FN-1539): add deterministic merge verification runner
- Add verification runner that executes testCommand then buildCommand before merge completion
- Verification runs on all merge paths (AI resolve, auto-resolve, -X theirs)
- If verification fails, merge is aborted and task stays out of done
- Add comprehensive tests for merger verification logic
- Fix routine-store test variable reference bug (created.id vs routine.id)
- Add changeset for @gsxdsm/fusion patch release
2026-04-10 12:20:56 -07:00
gsxdsm
5cb368d7cf feat(FN-1269): complete routine engine integration with RoutineRunner and RoutineScheduler
- Add RoutineRunner class for routine execution via heartbeat system
- Add RoutineScheduler class for cron-based routine polling
- Add triggerManual and triggerWebhook methods for API and webhook triggers
- Wire RoutineScheduler into InProcessRuntime lifecycle
- Add routine trigger and webhook API endpoints
- Fix type mismatches between PROMPT and actual FN-1519 types
2026-04-10 12:11:55 -07:00
gsxdsm
6c21b2dd85 fix: resolve database-is-locked error in completeRoutineExecution
completeRoutineExecution was reading from the DB outside the per-routine
lock then calling recordRun which acquires the lock internally. This
allowed concurrent operations on the same routine to hit SQLite
simultaneously. Inlined the logic inside a single withRoutineLock call
so the read and write are serialized.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 11:32:48 -07:00
gsxdsm
cd51de28bd fix: add agentId to routine-store test createRoutine calls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 11:30:48 -07:00
gsxdsm
fa4c9f8841 fix: align routine system with actual RoutineStore/Routine APIs to prevent CLI crash
The RoutineRunner and RoutineScheduler were written against a different
interface than what RoutineStore actually implements, causing TypeError
crashes as soon as any routine became due. This adds the missing
agentId/catchUpLimit fields to the Routine type and DB schema, adds
startRoutineExecution/completeRoutineExecution/cancelRoutineExecution
methods to RoutineStore, and fixes all property name mismatches
(lastExecutedAt→lastRunAt, trigger.cron→trigger.cronExpression,
policy value alignment) in the runner, scheduler, and tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 11:26:19 -07:00
gsxdsm
d693e45f2b fix: resolve dashboard performance bottlenecks causing sporadic hangs
The dashboard was sporadically hanging for several seconds during task
creation and settings loading due to multiple compounding issues:

- checkForChanges() polled every 1s with SELECT * FROM tasks + full
  JSON.stringify comparison, blocking the Node.js event loop. Now uses
  incremental polling (only changed tasks via updatedAt filter).
- allocateId() called readConfig() which always ran listWorkflowSteps(),
  adding unnecessary DB queries while holding the serialization lock.
  Now uses readConfigFast() that skips workflow steps.
- Task creation triggered listWorkflowSteps() up to 3 times per request.
  Added in-memory cache with invalidation on create/update/delete.
- Route handlers used getSettings() (slow path) where getSettingsFast()
  suffices (POST /tasks, GET /config).
- SSE effect in useTasks had searchQuery and refreshTasks in its
  dependency array, causing EventSource teardown/rebuild on every search
  change. Moved to refs since the EventSource URL doesn't use searchQuery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 11:01:15 -07:00
gsxdsm
14efe1c6a4 feat(FN-1369): add mission planning context propagation to tasks
- Add buildEnrichedDescription() for hierarchical mission context during triage
- Propagate mission → milestone → slice → feature context to task descriptions
- Add planningNotes and verification fields to milestones and slices
- Track planState on slices (not_started, planned, needs_update)
- Add apply/skip interview endpoints for milestone and slice planning
- Fix error mapping for rate limit and apply interview routes
- Add comprehensive integration tests for context enrichment
- Add AGENTS.md documentation for Mission Planning Context feature
2026-04-10 10:44:03 -07:00
gsxdsm
f5a36596f5 fix(FN-1537): stabilize CI workflows and fix version tests
- Update GitHub Actions workflows to use Node.js 24 (actions/setup-node@v5)
- Add private packages to .changeset/config.json ignore array
- Fix version string tests to read dynamically from package.json
- Add FN-1537 documentation to .fusion/memory.md
2026-04-10 09:42:51 -07:00
gsxdsm
0ab37d87a6 test(FN-1414): add run-audit integration tests for core and engine
- Add core run-audit integration regression tests covering task activity logging
- Add engine run-audit integration tests covering executor lifecycle and mutations
- Stabilize run-audit ordering with inline comments for deterministic behavior
- Update memory with run-audit testing learnings and patterns
- Fix test naming and use valid GitMutationType in tests
2026-04-10 09:21:38 -07:00
gsxdsm
97afba2f7e 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
bb679d5aa1 feat(FN-1532): add performance indexes for dashboard boot queries
- Add composite indexes for dashboard boot query paths
- Optimize taskList queries with (column, updatedAt) and (column, status, updatedAt) indexes
- Optimize activityLog queries with (timestamp DESC, taskId) index
- Add idempotent CREATE INDEX IF NOT EXISTS pattern for migrations
- Document index patterns in memory.md for future schema changes
- Update schema version assertions in db.test.ts and task-documents.test.ts
- Add changeset for dashboard load performance improvement
2026-04-10 07:26:13 -07:00
gsxdsm
325ae22624 feat(FN-1354): add auto-summarize task titles feature
- Add /api/ai/summarize-title endpoint for AI-generated task titles
- Integrate title summarization into task creation flow when autoSummarizeTitles is enabled
- Add debug logging and error checking to summarizeTitle in ai-summarize.ts
- Add error logging to route handler and task store for failed summaries
- Add comprehensive integration tests for the summarize-title API endpoint
- Add memory entry documenting the auto-summarize titles bug fix
2026-04-10 07:04:15 -07:00
gsxdsm
3cb59159e5 feat(FN-1336): add write-through cache to GlobalSettingsStore
- Add in-memory cache to GlobalSettingsStore for fast settings reads
- Add getSettingsFast() to TaskStore that uses the cached settings
- Update GET /settings route to use getSettingsFast() for faster responses
- Add invalidateCache() method for testing and external process scenarios
- Document write-through cache pattern in .fusion/memory.md
2026-04-10 03:03:51 -07:00
gsxdsm
fb8e77290b feat(FN-1368): add milestone and slice interview sessions
- Create milestone-slice-interview.ts module for AI-guided milestone/slice planning
- Add interview session types (milestone_interview, slice_interview) to AiSessionStore
- Wire up server rehydration and automatic session cleanup
- Add milestone/slice interview routes to mission router with SSE streaming
- Extend MissionStore to persist planningNotes and verification fields
- Add comprehensive tests for milestone-slice interview engine
2026-04-10 02:06:23 -07:00
gsxdsm
818562bd95 feat(FN-1266): add dashboard API integration tests for budget endpoints 2026-04-10 01:05:21 -07:00
gsxdsm
e5479d9692 feat(FN-1377): add sandstone, lagoon, frost, lavender, neon-bloom, sepia theme IDs to core types 2026-04-10 00:56:12 -07:00
gsxdsm
dfaf768601 feat(FN-1430): add worktree execution boundaries to prevent out-of-scope modifications
- Add worktree-aware path boundaries in agent factory to prevent cross-task contamination
- Sync core agent prompts with worktree boundary guidance for consistent enforcement
- Add boundary guidance to executor prompts so agents understand their scope
- Fix TypeScript types for worktree boundary wrapping
- Add comprehensive tests for boundary wrapping behavior
- Create changeset for @gsxdsm/fusion (minor)
2026-04-09 23:59:45 -07:00
gsxdsm
3ab16f6ad4 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
34c11a7078 feat(FN-1259): add review handoff mechanism for user assignment
- Add assigneeUserId field to Task type and SQLite schema for human assignment
- Add reviewHandoffPolicy setting to control automatic handoff behavior
- Implement handoff detection in executor: detect user assignment during review and auto-transition task
- Add dashboard API routes for user assignment, handoff queries, and completion
- Add frontend API functions: getHandoffTask, assignTaskToUser, completeHandoff
- Add comprehensive tests for store methods, API routes, and executor handoff logic
- Update memory documentation with review handoff pattern
2026-04-09 21:06:19 -07:00
gsxdsm
7bd98d888c feat(FN-1429): enforce always-green test-suite instructions for executor agents
- Add explicit always-green test suite instructions to executor agent prompts
- Update executor to enforce test-suite validation before task completion
- Add tests for agent prompt generation and executor behavior
- Ensure test failures block merge-ready state rather than allowing broken builds
2026-04-09 19:33:44 -07:00
gsxdsm
db0d5c8dc9 feat(FN-1133): add plugin hot-reload support
- Add PluginLoader hot-load/unload with watch mode, auto-recovery, and staged loading
- Add PluginRunner reactive integration with executor dynamic tools registration
- Add dashboard reload endpoint (POST /api/plugins/reload) and PluginManager UI
- Add comprehensive tests for plugin-hot-reload (core) and plugin-runner (engine)
- Update plugin authoring docs and add memory notes
- Add changeset for @gsxdsm/fusion minor release
2026-04-09 19:15:53 -07:00
gsxdsm
1c4a3f4e4d feat(FN-1452): make structured run records the source of truth for agent run state
- Update AGENTS.md with authoritative run lifecycle semantics documentation
- Add API-level regression test for repeated manual run prevention
- Update run lifecycle tests to match corrected behavior
- Refactor AgentStore to use structured run records as the authoritative source for run state
- Improve run status queries with better filtering and ordering
2026-04-09 18:37:48 -07:00
gsxdsm
411a2c26ad feat(FN-1423): add promptOverrides to project settings
- Add promptOverrides configuration to project settings with null-as-delete semantics
- Add core prompt-key catalog with resolver primitives in packages/core/src/prompt-overrides.ts
- Export prompt key catalog, resolution functions, and settings merge helpers from @fusion/core
- Add parity tests for promptOverrides settings handling
- Add settings export/import coverage for promptOverrides
- Add settings export tests verifying promptOverrides round-trip
- Update settings reference documentation with promptOverrides section
- Add store methods for loading/exporting project settings with prompt overrides
2026-04-09 18:21:29 -07:00
gsxdsm
f257c53059 feat(FN-1403): add run audit system with SQLite persistence
- Add run-audit event types and SQLite schema migration
- Implement typed store read/write/query APIs for run audit
- Make audit writes atomic with task updates (transactional writes)
- Fix SQLite parameter type casting in db layer
- Add comprehensive tests for RunMutationContext and audit functionality
2026-04-09 16:39:16 -07:00
gsxdsm
daabb51e71 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
8ba375549c feat(FN-1453): fix mission autopilot progression and state refresh
- Fix mission autopilot slice activation when tasks complete
- Fix state refresh in MissionManager to properly reflect autopilot status
- Fix scheduler to correctly trigger autopilot progression events
- Add unit tests for mission store autopilot state transitions
- Add component tests for MissionManager autopilot toggle and state display
- Add e2e tests for mission autopilot lifecycle (enable → task completion → slice progression)
- Update documentation with autopilot state machine details
2026-04-09 16:12:58 -07:00
gsxdsm
c38e254258 feat(FN-1343): add rust, copper, foundry, carbon color themes
- Add rust, copper, foundry, carbon theme IDs to core types
- Register themes in ThemeSelector component and flash-prevention logic
- Add CSS theme blocks and swatches for all four new themes
- Add ThemeSelector unit tests for the new themes
- Update memory documentation with new theme count
2026-04-09 16:06:13 -07:00
gsxdsm
7db168d5d7 feat(FN-1400): add getPluginStore() lazy getter to TaskStore
- Add PluginStore lazy getter to TaskStore class
- Update memory documentation with plugin foundation learnings
2026-04-09 15:50:57 -07:00
gsxdsm
35a2d02529 feat(FN-1246): add app version tracking and sync infrastructure
- Add getAppVersion() utility that walks up directories to find package.json
- Add parseSemver() for semver string parsing with major/minor/patch components
- Add CentralCore version sync methods (getAppVersion, syncVersion, getLastSyncTime, getSyncStatus)
- Add CentralCore events for version sync lifecycle (version-sync-started, version-sync-completed, version-sync-failed)
- Add schema v4 migration with appVersion and lastSyncTime columns to projects table
- Export new types (CentralSyncStatus, SyncResult) and utilities via @fusion/core
- Update memory.md documentation with new types
- Fix TypeScript error in app-version.ts (return pkg.version directly instead of cached variable)
2026-04-09 15:14:19 -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
gsxdsm
7d484dd972 feat(FN-1257): add runContext audit trail for task mutations
- Add RunMutationContext type to track which agent run caused a mutation
- Thread runContext through TaskStore.logEntry, addComment, addSteeringComment, and pauseTask
- Propagate runContext from HeartbeatMonitor.executeHeartbeat to task store operations
- Propagate runContext from TaskExecutor.execute to task store operations
- Add GET /api/agents/:id/runs/:runId/mutations endpoint to query mutations by runId
- Add createTaskLogToolWithContext for heartbeat tools with run context support
- Add comprehensive tests for RunMutationContext across store and heartbeat modules
- Update memory.md with RunMutationContext usage convention
2026-04-09 13:59:43 -07:00
gsxdsm
e26321790c refactor(FN-1353): simplify mission autopilot to single toggle
- Deprecate autoAdvance field in favor of autopilotEnabled as the sole control
- Remove autoAdvance guard logic from MissionAutopilot engine class
- Simplify MissionManager UI to use single autopilot toggle with visual state indicator
- Update MissionAutopilot tests to use autopilotEnabled instead of autoAdvance
- Update MissionManager component tests for simplified UI
- Update AGENTS.md documentation to reflect the simplified autopilot model
2026-04-09 13:45:19 -07:00
gsxdsm
008f664183 feat(FN-1224): add peer gossip protocol for mesh network synchronization
- Add peer exchange types (MeshSyncState, PeerExchangeMessage, PeerGossipConfig) to core types
- Add peer merge and sync methods to CentralCore (mergeProject, syncWithPeer, getMeshState)
- Add mesh sync API endpoints (GET /api/mesh/state, POST /api/mesh/sync)
- Implement PeerExchangeService background gossip engine for periodic peer synchronization
- Add comprehensive tests for CentralCore mesh methods and PeerExchangeService
- Update memory docs with peer gossip protocol documentation
2026-04-09 13:22:29 -07:00
gsxdsm
3ef12726d1 feat(FN-1375): add null-as-delete pattern for settings with Reset button
- Send null instead of undefined when clearing token cap to explicitly delete setting
- Handle null values as delete operations in updateSettings (for clearing keys)
- Add Reset button in Settings modal to clear token cap with one click
- Update placeholder and help text for token cap input
- Fix TypeScript cast error for config.settings
2026-04-09 12:43:38 -07:00
gsxdsm
ced3ad3be6 fix(FN-1187): integration fixes for mission health and type updates
- Add /missions/health endpoint handling to MissionManager test mocks
- Add listMissionsWithSummaries to mission-e2e test mock
- Add planState to Slice type and mock factories
- Add stuckKillCount to retry task test assertions
- Update log message for stuck-killed retry
2026-04-09 12:21:51 -07:00
gsxdsm
5e38eace77 feat(FN-1228): complete Step 1 — Backend API Routes modifications
- Modified POST /api/nodes to make type optional (defaults to 'remote')
- Changed DELETE /api/nodes/:id to return 204 No Content
- Updated GET /api/nodes/:id/metrics to return SystemMetrics from node.systemMetrics
- Added GET /api/mesh/state route for full mesh topology state
2026-04-09 11:51:03 -07:00
gsxdsm
88c0db6aac fix(FN-1371): replace placeholder MiniMax and Z.ai logos with real brand icons 2026-04-09 11:23:33 -07:00
gsxdsm
81a98c3acf feat(FN-1359): add ChatStore for session and message management
- Add chat system type definitions (ChatSession, ChatMessage, ChatMessageRole)
- Add SQLite schema migration for chat_sessions and chat_messages tables
- Implement ChatStore with full CRUD operations for sessions and messages
- Export ChatStore and types from @fusion/core public API
- Add comprehensive test suite for ChatStore with session/message operations
- Update schema version expectations in existing tests
2026-04-09 10:58:21 -07:00
gsxdsm
dcbad95fd6 feat(FN-1260): add full-text search for tasks and comments
- Add FTS5 virtual table with v21 database migration for task search
- Add searchTasks() method to TaskStore with FTS5 query support
- Add q= search parameter to GET /api/tasks route for server-side search
- Update useTasks hook and frontend API to support searchQuery prop
- Update Board.tsx and App.tsx to pass searchQuery through component hierarchy
- Add comprehensive tests for FTS5 index and searchTasks functionality
2026-04-09 10:17:02 -07:00
gsxdsm
ac07be790b feat(FN-1348): export HeartbeatMonitor and HeartbeatTriggerScheduler from @fusion/engine 2026-04-09 09:42:21 -07:00
gsxdsm
914e80add3 feat(FN-1214): add ember color theme
- Add ember theme to COLOR_THEMES array in types.ts
- Add ember theme CSS variables in styles.css
- Add ember theme swatch preview in ThemeSelector component
- Add ember to validThemes validation in index.html
- Add ThemeSelector tests for ember theme
2026-04-09 09:28:52 -07:00