Commit Graph

163 Commits

Author SHA1 Message Date
gsxdsm
7a01995465 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
f6bd237f46 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
11dfcaf7e2 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
f4012fc5f2 fix: recover completed tasks stuck in progress 2026-04-05 15:24:32 -07:00
gsxdsm
ec2dc79569 feat(FN-972): auto-triage features when slice activated with autoAdvance
- When a slice is activated and has autoAdvance enabled, automatically triage all features in that slice
- Add auto-triage logic to mission-store activateSlice method
- Add comprehensive tests for auto-triage behavior covering edge cases
- Fix module import paths across mission-related files (mission.ts, extension.ts, mission-integration.test.ts, mission-routes.ts, scheduler.ts)
2026-04-05 11:04:16 -07:00
gsxdsm
7f3a100202 fix(FN-954): allow retry for stuck-killed tasks across all interfaces
- Extend retry API to accept 'stuck-killed' as a retryable status alongside 'failed'
- Update CLI retry command to recognize stuck-killed tasks
- Update pi extension retry tool to handle stuck-killed tasks
- Show retry button in TaskDetailModal for stuck-killed task status
- Add changeset for patch release
2026-04-05 00:41:15 -07:00
gsxdsm
5e6e1e8fe6 fix(FN-952): activate projects after CLI registration
- Set project status to 'active' after registration in runInit (kb init)
- Set project status to 'active' after registration in runProjectAdd (kb project add)
- Set project status to 'active' after interactive registration in resolveProjectDirectory
- Add updateProject mock to init.test.ts, project.test.ts, and project-resolver.test.ts
2026-04-04 21:07:43 -07:00
gsxdsm
e28cbb1c1f feat(FN-882): add loop detection recovery with compact-and-resume
- Add ContextLimitDetector to detect agent loops via repeated tool call patterns
- Implement compact-and-resume strategy: summarize conversation and restart agent from current step
- Add loop recovery to StuckTaskDetector with configurable attempt tracking and retry limits
- Extend executor with automatic loop recovery on context limit detection
- Add loop recovery support to pi executor with same compact-and-resume pattern
- Add comprehensive tests for context-limit-detector, stuck-task-detector loop detection, executor, and pi recovery
- Add changeset for patch bump to @gsxdsm/fusion
- Update README with loop detection and recovery documentation
2026-04-04 19:47:48 -07:00
gsxdsm
fbda14717e fix: defer stuck-kill requeue to executor finally block to prevent race
When the stuck task detector killed a task and immediately called
moveTask("todo"), the scheduler could re-dispatch the task before the
old execution's finally block cleared this.executing. The new execute()
call hit the guard and silently returned, stranding the task in
"in-progress" with no active session or worktree (seen on FN-810/FN-912).

Move the requeue responsibility from StuckTaskDetector.killAndRetry to
the executor's finally block, which runs after this.executing.delete().
The beforeRequeue budget check now runs before session.dispose() and its
result is passed via StuckTaskEvent.shouldRequeue → markStuckAborted().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 12:26:13 -07:00
gsxdsm
0c31127169 fix(FN-850): harden merge readiness and reopen done tasks 2026-04-04 08:35:19 -07:00
gsxdsm
f99c065b0f feat(FN-850): add no-progress loop detection and improve stuck-task detector
- Add explicit no-progress loop detection signals to executor agent sessions
- Enhance stuck-task detector with configurable strategies (timeout, no-progress, combined)
- Add comprehensive test coverage for stuck-task detector (371 lines of tests)
- Remove modelFilter test utilities (198 lines of dead test code)
- Simplify modelFilter.ts by removing unused filtering logic
- Clean up dashboard server startup and minor README fix
2026-04-04 07:48:47 -07:00
gsxdsm
574d1793fc feat(FN-840): add closed/merged PR feedback contract and clean up unused code
- Add closed/merged PR feedback contract to pr-monitor for post-merge follow-up behavior
- Fix PR monitor drainComments + consume/drain behavior with comprehensive tests
- Add PR feedback follow-up tests and scheduler follow-up logic
- Remove unused activity log, agent log viewer, and multi-agent log code from dashboard
- Remove unused store methods, types, API endpoints, and route handlers
- Update README docs to document manual-merge PR follow-up behavior and fix auth wording
- Add dashboard CLI test coverage for new commands
2026-04-04 02:01:58 -07:00
gsxdsm
e46d357a6a feat: sync OpenRouter models on dashboard startup and add mission interview module
- Add openrouterModelSync setting to eagerly fetch OpenRouter model catalog at
  dashboard startup so the model picker shows all available models
- Add toggle in Settings → Models to disable the sync
- Add mission-interview session management module for AI-guided mission specs
- Include tests for the sync opt-out behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:39:17 -07:00
gsxdsm
448762d1f6 feat(FN-813): add project-aware ntfy deep links
- Thread real project context (projectName, projectId) into ntfy notification deep links
- Dashboard deep-link URL now honors project context with /project/:name/task/:id pattern
- Update App.tsx routing to handle project-scoped deep link navigation
- Add project info to NtfyNotifier types and wire through notification payload
- Add changeset for published @gsxdsm/fusion package
- Add tests for notifier project context and dashboard routing
2026-04-03 21:34:39 -07:00
gsxdsm
fdf6d0b4a1 feat: add SelfHealingManager for unattended multi-day operation
Adds four self-healing subsystems to enable the engine to recover from
common failure modes without human intervention:

- Auto-unpause: clears rate-limit-triggered globalPause with escalating
  backoff (5 min → 60 min cap), resets on sustained recovery
- Stuck kill budget: caps task stuck-kill retries (default 3) to prevent
  infinite stuck→todo→stuck loops
- Periodic maintenance (every 15 min): git worktree prune, orphan cleanup,
  SQLite WAL checkpoint
- Worktree cap enforcement: removes oldest idle worktrees when count
  exceeds 2× maxWorktrees

New settings: autoUnpauseEnabled, autoUnpauseBaseDelayMs,
autoUnpauseMaxDelayMs, maxStuckKills, maintenanceIntervalMs.
New task field: stuckKillCount (schema v8 migration).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 15:35:12 -07:00
gsxdsm
c5913b951d fix(FN-000): harden project migration runtime 2026-04-02 17:55:25 -07:00
gsxdsm
c03c9602b4 feat(KB-620): complete Step 7 — Migration and first-run experience
- Add fn init command for initializing new kb projects
- Add auto-migration check at CLI startup
- Add /api/setup-state and /api/complete-setup dashboard endpoints
- Add SetupState and CompleteSetupInput types to dashboard API
- Add migration and rollback documentation to AGENTS.md
- Create changeset for multi-project migration feature
2026-04-02 09:18:45 -07:00
gsxdsm
566f531361 feat: rename data directory, add global project settings, multi-project CLI commands, and provider badge in model selector
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 09:10:42 -07:00
gsxdsm
1fa8837c6b refactor: improve mocking for GitHubClient and enhance SIGINT handling in tests 2026-04-01 22:55:16 -07:00
gsxdsm
dc442cf391 feat: refactor tests and improve mocking for file-service and GitHub polling
- Updated mocking strategy for node:fs and node:fs/promises in file-service tests.
- Removed redundant test files and improved test implementations for better clarity.
- Enhanced GitHub polling service tests with rate limiter integration.
2026-04-01 22:44:44 -07:00
gsxdsm
59a236adbd feat(KB-619): enhance project commands with JSON output and task counts
- Add --json flag to 'kb project list' for machine-readable output
- Add --json flag to 'kb project show' for structured data
- Show task counts per column in project details
- Update CLI help text for better documentation
- Add changeset for multi-project CLI commands feature
- Add comprehensive tests for project commands
2026-04-01 22:40:03 -07:00
gsxdsm
04b194982d feat: add per-provider timeout for usage panel to prevent blocking on slow responses
fix: update scheduler filesystem path from .kb to .fusion for task validation

style: clean up TaskDetailModal styling with reusable CSS classes

test: add comprehensive tests for file-service operations with mocked filesystem
2026-04-01 22:38:18 -07:00
gsxdsm
e0266b4840 fix: update TaskStore mock implementation type casting 2026-04-01 22:06:18 -07:00
gsxdsm
64295637f2 feat: enhance dashboard styling and functionality for task changes and package extensions 2026-04-01 22:06:12 -07:00
gsxdsm
2778027423 Removed unwanted files marked in .gitignore 2026-04-01 21:25:08 -07:00
gsxdsm
51e0883708 feat(KB-503): merge kb/kb-503
- feat(KB-503): complete Step 5 other command project support
- fix(KB-503): align task resolution with shared project context
- fix(KB-503): preserve local task command fallback
- test(KB-503): complete Step 4 task command coverage
- test(KB-503): harden Step 3 CLI parser coverage
- fix(KB-503): keep settings set scope explicit
- fix(KB-503): allow implicit project resolution for project settings
- fix(KB-503): enforce explicit settings scope rules
- fix(KB-503): restore shared settings resolution behavior
- fix(KB-503): align settings scope and project flag behavior
- feat(KB-503): complete Step 5 — add project-aware settings, git, and backup behavior
- fix(KB-503): enforce settings scope for global and project modes
- fix(KB-503): preserve project-scoped settings and cwd-aware git helpers
- fix(KB-503): add scoped settings behavior and git project tests
- feat(KB-503): complete Step 5 — add project-aware git and backup coverage
- test(KB-503): cover remaining project-aware task command paths
- fix(KB-503): use shared resolution flow for all task commands
- fix(KB-503): restore legacy task fallback and correct task mocks
- fix(KB-503): align task resolution order and kb storage paths
- fix(KB-503): restore local task store fallback without project flag
- test(KB-503): cover remaining project-aware task handlers
- fix(KB-503): preserve branch naming and avoid duplicate log resolution
- test(KB-503): expand project-aware task command coverage
- fix(KB-503): restore cwd fallback for path-based task commands
- fix(KB-503): add project-aware task output and tests
- fix(KB-503): harden project command output and coverage
- fix(KB-503): preserve legacy task resolution without project flag
- test(KB-503): add bin routing coverage for project flag parsing
- feat(KB-503): complete Step 3 — CLI argument parsing updates
- fix(KB-503): add defaultProjectId to GlobalSettings type and fix TypeScript errors
- test(KB-503): fix resolveProject mock in task tests for runTaskLogs follow mode
- docs(KB-503): add multi-project CLI documentation and changeset
- test(KB-503): add project-context mock to task tests
- test(KB-503): update git tests for new cwd parameter
- feat(KB-503): Step 3 — CLI argument parsing updates with --project flag support
- feat(KB-503): Steps 1-2 — project context utilities and project subcommands
2026-04-01 15:06:58 -07:00
gsxdsm
27d2f25b42 feat(KB-635): integrate mission workflows across CLI, extension, and engine
- Add mission CLI commands and pi extension tools for creating missions, milestones, slices, features, and task links
- Extend core mission storage and schema migrations with auto-advance support, task slice linkage, and comment normalization coverage
- Wire mission-aware scheduler and executor behavior so linked features progress with task execution and completed slices can auto-activate follow-on work
- Add regression tests for mission CLI parsing, extension behaviors, scheduler mission semantics, and executor integration
2026-04-01 13:45:56 -07:00
gsxdsm
6a69e83e90 feat(KB-619): add multi-project CLI resolution and commands
- Add CLI project resolution with --project targeting and project subcommands
- Implement project list/add/remove/info flows with central registry integration
- Expand resolver and command test coverage, including cancellation and explicit selection paths
- Include published CLI changeset metadata for the multi-project command feature
2026-04-01 13:00:03 -07:00
gsxdsm
97ec4268a4 feat(KB-636): add Missions system for large-scale project planning
- Fix TaskStore sliceId persistence and bidirectional linking between tasks and features
- Add comprehensive mission integration tests for hierarchy, status rollup, and events
- Enhance E2E tests with reorder, cascade delete, and error handling coverage
- Add scheduler integration tests for mission slice activation
- Fix duplicate mission commands in CLI help text
- Add changeset for missions launch
2026-04-01 08:04:51 -07:00
gsxdsm
021055c82a feat(KB-341): unify steeringComments and comments into single comments system
- Consolidate steeringComments and comments into unified comments field using TaskComment type

- Remove SteeringComment type, migrate all comments to TaskComment format

- Update addComment to delegate to addTaskComment with auto-refinement for done tasks

- Merge legacy steeringComments data into comments during database migration

- Update dashboard API endpoint from /steer to /comments

- Update executor to use unified comments field for real-time injection

- Update PR comment handler to use addTaskComment method
2026-04-01 07:44:04 -07:00
gsxdsm
51303c897a feat(KB-619): add CLI multi-project commands and --project flag support
- Add project-resolver module for centralized project resolution
- Add project subcommands: list, add, remove, info/show
- Add --project flag to task and settings commands
- Integrate project resolution into CLI entry point
- Update types for defaultProjectId setting
2026-04-01 07:16:10 -07:00
gsxdsm
02a30a9e96 feat(KB-622): unify steeringComments and comments into single comments field
- Merge steeringComments and comments into unified comments field in Task type
- Update TaskStore to use single comments array instead of separate steeringComments
- Add database migration to convert existing steeringComments to comments
- Update executor to inject all comments into AI execution context
- Update dashboard SteeringTab to use unified comments API
- Update CLI task steer command to use comments field
- Update PR comment handler to add comments via unified API
2026-04-01 07:05:23 -07:00
gsxdsm
d2d32acce8 feat(KB-503): add multi-project CLI support with project subcommands
- Add project subcommands: list, add, remove, show, set-default, detect
- Add --project flag support for all task commands
- Create project-context.ts utilities for project resolution
- Add defaultProjectId to GlobalSettings type
- Implement project auto-detection from cwd
- Update CLI argument parsing for global --project flag
- Add multi-project CLI documentation to AGENTS.md
2026-04-01 07:02:15 -07:00
gsxdsm
e08eb60cf0 feat(KB-617): add Changes tab to task detail modal with file diffs
- Add modifiedFiles and baseCommitSha fields to task schema for tracking changes
- Capture list of modified files during task execution in the executor
- Add GET /tasks/:id/diff API endpoint to retrieve file list and patches
- Create TaskChangesTab component with expandable file diffs
- Integrate Changes tab into TaskDetailModal for in-progress, in-review, and done tasks
- Add CSS styles for diff viewer with syntax highlighting
- Update API client with fetchTaskDiff function and Project Management types
2026-04-01 06:56:32 -07:00
gsxdsm
fa37de1bed feat(KB-648): enable parallel test execution and optimize test performance
- Optimize backup tests using fake timers instead of real timeouts

- Enable parallel file execution in core, engine, CLI, and dashboard packages

- Add inline test helpers to reduce dependencies in dashboard routes tests

- Update executor tests with exact command matching and improved assertions

- Update AGENTS.md with test optimization patterns (fake timers, unique temp dirs)
2026-04-01 06:54:50 -07:00
gsxdsm
3692b97440 feat(KB-635): add mission management CLI commands and engine integration
- Add comprehensive mission CLI commands: create, list, show, start, abort, delete, and next
- Add Pi extension tools for mission operations: list_missions, show_mission, start_mission, abort_mission
- Implement mission-aware scheduler with task start handling and autoAdvance support
- Add sliceId to Task type and autoAdvance flag to Mission type for slice sequencing
- Add MissionStore helper methods for mission lifecycle operations
- Include comprehensive tests for CLI commands and Pi extension mission tools
2026-04-01 01:19:19 -07:00
gsxdsm
5a12fc3ab5 feat(KB-619): add multi-project CLI support
- Add project-resolver module with CentralCore integration for project resolution
- Add project subcommands: list, add, remove, info with proper CLI integration
- Add --project flag support across all task and settings commands
- Refactor getStore to use project resolution with options pattern
- Update bin.ts command routing to extract and propagate project context
- Add project context propagation via FN_PROJECT environment variable
2026-03-31 23:41:36 -07:00
gsxdsm
e5c598122f feat(KB-617): add diff viewer tab to task detail modal
- Add modifiedFiles and baseCommitSha tracking during task execution
- Create GET /tasks/:id/diff API endpoint for file list and patches
- Build TaskChangesTab component with expandable file diffs
- Integrate Changes tab into TaskDetailModal for in-progress, in-review, and done tasks
- Add database columns and types for diff tracking
- Update executor to capture modified files during agent sessions
2026-03-31 23:31:04 -07:00
gsxdsm
fb65d4bf0b feat(KB-503): add multi-project CLI support
- Add project context utilities for multi-project operations

- Add project subcommands (list, add, remove, set-default, detect)

- Update CLI argument parsing with --project flag support

- Add multi-project documentation and changeset
2026-03-31 23:28:43 -07:00
gsxdsm
7344a80e40 feat(KB-618): add multi-project support to dashboard
- Add project API methods and types (fetchProjects, registerProject, fetchProjectHealth, etc.)
- Add ProjectCard component with health metrics, status badges, and pause/resume actions
- Add server-side project management routes for multi-project orchestration
- Add ActivityFeed component with grouped entries and project badges
- Add SetupWizard component with 5-step project creation flow
- Fix TypeScript errors in server routes for listProjects and getGlobalConcurrencyState
2026-03-31 23:19:03 -07:00
gsxdsm
38f7cec604 fix: prevent SQLite corruption by checkpointing WAL and closing DB on shutdown
The database was never properly closed on SIGINT/SIGTERM — WAL files were left
in a partially-written state causing "database disk image is malformed" errors.
Adds WAL checkpoint on close, synchronous=NORMAL pragma, SIGTERM handlers, and
a store.close() method that flushes all pending writes before exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:15:30 -07:00
gsxdsm
2221f9a2b9 fix(KB-503): fix process.exit mock in project tests
- Add proper process.exit mock that throws error for testability
- All 6 project command tests now passing
2026-03-31 22:42:57 -07:00
gsxdsm
d4f6aa2cbe feat(KB-503): complete Step 2 — project subcommand implementation
- Create project.ts with all project commands: list, add, remove, show, set-default, detect
- Implement runProjectList() with default project highlighting
- Implement runProjectAdd() with validation for name, path, isolation mode
- Implement runProjectRemove() with confirmation prompt and --force flag
- Implement runProjectShow() with project details and health info
- Implement runProjectSetDefault() to set default project
- Implement runProjectDetect() to show project from CWD
- Add project.test.ts with basic function export tests
2026-03-31 22:41:44 -07:00
gsxdsm
80ab88db3d feat(KB-336): rename data directory from .kb to .fusion
- Rename data directory from .kb to .fusion across core, CLI, dashboard, and engine
- Update all path references in source files, tests, and CLI output
- Remove deprecated central-core infrastructure (central-core, central-db, central-integration)
- Remove obsolete test files (PlanningModeModal.test.tsx, ScheduleForm.test.tsx)
- Add changeset for the directory rename breaking change
2026-03-31 20:00:25 -07:00
gsxdsm
e98cb5c100 feat(KB-334): change default task prefix from KB to FN
- Change default taskPrefix from KB to FN and branch naming from kb/ to fusion/
- Update all test expectations and patterns for new naming convention
- Update settings UI placeholder text to reflect FN prefix
- Update dashboard, engine, and CLI components for fusion/ branch paths
- Add changeset documenting the breaking change for users
2026-03-31 19:50:15 -07:00
gsxdsm
ada014213a feat(KB-640): add role editing UI and restore KB task prefix
- Add inline role editing to AgentListModal with clickable role icons
- Add handleRoleChange and handleRoleKeyDown handlers for role updates
- Persist view toggle (board/list) with localStorage alongside role editing
- Restore task prefix from FN back to KB for generated task IDs
- Restore branch naming from fusion/ back to kb/ for task branches
- Update branch name references in executor, merger, scheduler, and CLI
- Add touch gesture detection support to TaskCard component
- Update worktree grouping labels to use KB prefix
2026-03-31 19:44:36 -07:00
gsxdsm
e4579728ba feat(KB-332): rename task prefix from KB to FN and branches from kb/ to fusion/
- Change default task prefix from KB to FN across all packages

- Rename branch naming pattern from kb/{id} to fusion/{id}

- Update all test assertions and fixtures to use new prefixes

- Add changeset for the breaking change

- Resolve merge conflicts in TaskCard.test.tsx touch gesture tests
2026-03-31 19:29:47 -07:00
gsxdsm
5912e829b1 feat(KB-624): add settings export and import functionality
- Add core settings export/import module with comprehensive tests
- Add CLI commands: kb settings --export and kb settings --import
- Add dashboard API endpoints for settings export/import
- Add dashboard UI for exporting and importing settings in SettingsModal
- Add changeset for @gsxdsm/fusion package release
2026-03-31 18:04:48 -07:00
gsxdsm
36bdb62783 feat(KB-614): reduce CLI tool call logging noise
- Remove tool call logging from dashboard.ts CLI command
- Remove tool call logging from task.ts CLI command
- Add changeset documenting the reduced logging behavior
2026-03-31 17:47:45 -07:00
gsxdsm
a6f99f90bb feat(KB-327): add automatic database backup system
- Add backup settings to ProjectSettings with schedule, retention, and directory config
- Create BackupManager with create, list, cleanup, and restore operations
- Add CLI backup commands: --create, --list, --restore, --cleanup
- Implement backup validation and automation sync for scheduled backups
- Add dashboard backup settings UI with stats and 'Backup Now' button
- Add backup API routes for settings management and manual operations
- Include comprehensive backup tests and changeset for patch release
- Document backup configuration and recovery in AGENTS.md
2026-03-31 15:40:25 -07:00