Commit Graph

2564 Commits

Author SHA1 Message Date
gsxdsm
7bd6f37932 feat(FN-1515): merge fusion/fn-1515 2026-04-14 09:28:50 -07:00
gsxdsm
bc74460340 feat(FN-1524): add POST /routines/:id/trigger endpoint
- Add POST /routines/:id/trigger as canonical endpoint for manual routine triggers
- Keep POST /routines/:id/run as backward-compatible alias
- Remove duplicate recordRun calls from routine route handlers (persistence handled by RoutineRunner)
- Update webhook auth to return 401 instead of 403 for signature failures
- Fix TypeScript types for promptOverrides to support null values (delete semantics)
- Fix API endpoint to return empty diff stats when worktree doesn't exist
2026-04-14 09:28:05 -07:00
gsxdsm
8e44096e07 fix(FN-1513): fix SessionSkillContextInput to use AgentStore instead of TaskStore 2026-04-14 09:03:43 -07:00
gsxdsm
817f5eae90 feat(FN-1513): track excluded skill paths and improve skill resolver diagnostics
- Add excludedSkillPaths to SkillSelectionResult to track skills disabled by - patterns
- Update createSkillsOverrideFromSelection to filter out excluded skills
- Produce warning diagnostics for disabled skills that exist but were excluded
- Add tests for excluded paths tracking and deterministic output order
- Update memory documentation with skill resolver diagnostics distinction
- Fix pi-create-kb-agent test to include excludedSkillPaths in selection mock
2026-04-14 08:56:06 -07:00
gsxdsm
07b8030400 feat(FN-1639): merge fusion/fn-1639 2026-04-14 08:43:59 -07:00
gsxdsm
f95afa129f feat(FN-1498): merge fusion/fn-1498 2026-04-14 08:43:51 -07:00
gsxdsm
016bd8c77d docs(FN-1513): update memory with skill resolver diagnostics distinction
- Document excludedSkillPaths tracking for disabled skills
- Document the three-case diagnostic distinction (allowed/disabled/missing)
- Note the console.error logging pattern for diagnostics
2026-04-14 08:42:10 -07:00
gsxdsm
b6c26d308b feat(FN-1513): regression tests for skill override wiring and resolver fallback semantics
- Added excludedSkillPaths to SkillSelectionResult for tracking explicitly
  disabled skill paths from -prefix patterns
- Extended createSkillsOverrideFromSelection to distinguish disabled
  skills (exist but excluded) from missing skills (not found)
- Added regression tests:
  - Excluded skill paths tracking in resolveSessionSkills
  - Disabled vs missing skill diagnostics distinction
  - Deterministic ordering verification
  - Skills override wiring in createKbAgent
- Updated existing tests to use new interface
2026-04-14 08:41:37 -07:00
gsxdsm
203948cca9 feat(FN-1511): add skill selection resolver for deterministic session skills
- Add SkillSelectionResolver and SkillSelectionContext for deterministic skill sets
- Implement skill-resolver.ts with request/filter/resolve workflow
- Add session-skill-context.ts helper for unified skill selection across all session types
- Wire skill override into createKbAgent via AgentOptions
- Apply skill selection to triage, executor, reviewer, merger, and heartbeat sessions
- Add comprehensive tests for skill-resolver and session-skill-context
- Export skill resolver types and functions from engine index
- Add skill selection resolver pattern to memory documentation
2026-04-14 08:40:21 -07:00
gsxdsm
383995a434 feat(FN-1511): apply skill selection to reviewer, merger, and heartbeat sessions 2026-04-14 08:24:18 -07:00
gsxdsm
4e217e493d feat(FN-1511): apply skill selection to triage and executor sessions 2026-04-14 08:20:22 -07:00
gsxdsm
78190897be feat(FN-1618): merge fusion/fn-1618 2026-04-14 08:14:28 -07:00
gsxdsm
6667fd93c2 feat(FN-1530): merge fusion/fn-1530 2026-04-14 08:14:19 -07:00
gsxdsm
ad363d8441 feat(FN-1510): merge fusion/fn-1510 2026-04-14 08:13:53 -07:00
gsxdsm
271f3f7c16 feat(FN-1745): scope WebSocket channels to project context for multi-project support
- Scope /api/tasks/:id/logs/stream SSE endpoint to resolved project context
- Make badge WebSocket/pubsub channels project-aware using scopeKey
- Fix terminal WebSocket project/service resolution with auth middleware
- Add cross-instance badge broadcast via BadgePubSub with projectId metadata
- Update AGENTS.md documentation for badge WebSocket project-scoping
- Add tests for project-scoped WebSocket and SSE endpoints
- Add tests for project detection in WebSocket upgrade handling
2026-04-14 08:13:25 -07:00
gsxdsm
0944fff7ba feat(FN-1511): add session-skill-context helper for unified skill selection 2026-04-14 08:12:47 -07:00
gsxdsm
7849ec2a51 docs(FN-1510): add skill selection resolver pattern to memory 2026-04-14 08:02:09 -07:00
gsxdsm
38d859e843 fix(FN-1554): return empty diff when worktree is missing or nonexistent
- Return empty diff instead of 500 error when worktree path is null, undefined, or doesn't exist on disk
- Add 9 tests covering null worktree, undefined worktree, nonexistent paths, and valid paths
- Fixes dashboard crash on diff tab for in-progress tasks with missing worktrees
2026-04-14 08:00:47 -07:00
gsxdsm
0afb5eb31d feat(FN-1510): add skill resolver and createKbAgent override tests 2026-04-14 07:59:58 -07:00
gsxdsm
5eaf7374af feat(FN-1638): add plugin manager UI redesign and clear triage status on todo
- Restructure PluginManager detail view with card-based layout
- Add mobile responsive styles with adaptive grid
- Add desktop CSS with card-based grid design
- Clear triage status when task moves to todo
- Add changeset for plugin settings design
2026-04-14 07:51:33 -07:00
gsxdsm
c6f9d8fc66 feat(FN-1510): export skill resolver types and functions from engine index 2026-04-14 07:49:17 -07:00
gsxdsm
43a7e2b933 feat(FN-1510): wire skill override into createKbAgent via AgentOptions 2026-04-14 07:48:58 -07:00
gsxdsm
d564f57db8 feat(FN-1510): add skill selection resolver for deterministic session skill sets 2026-04-14 07:48:13 -07:00
gsxdsm
1341c606f7 fix triage handoff state 2026-04-14 07:42:45 -07:00
gsxdsm
b48c95cb1c fix(engine): clear stale specifying statuses on triage processor startup
After a process crash or restart, tasks retain "specifying" status in the
database but no agent is actually running. These stale statuses consume
concurrency slots, blocking all new triage work. Added a startup sweep
that clears orphaned "specifying" statuses, mirroring the existing
merge status cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 00:11:37 -07:00
gsxdsm
ef63b4c78a fix: recover orphaned specifying tasks whose agent session died before approval
Tasks stuck in triage with status "specifying" had no recovery path when the
agent session crashed mid-specification (before producing an approved spec).
The stuck task detector only monitors tracked sessions, and
recoverApprovedTriageTasks only handles tasks with an approved spec — leaving
unapproved specifying tasks stranded indefinitely.

Add recoverOrphanedSpecifyingTasks to clear status back to null so the next
triage poll picks them up for a fresh specification attempt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:42:51 -07:00
gsxdsm
f72a3a39db feat(FN-1771): add dashboard memory settings UX with backend selector and capability-aware editing
- Add /api/memory/backend endpoint returning current backend, capabilities, and available backends
- Create useMemoryBackendStatus hook with polling and frontend-friendly interface
- Add MemorySettingsSection to SettingsModal with backend selector dropdown
- Implement capability-aware UI: readonly backends disable save, fallback on unknown types
- Add comprehensive tests for API endpoints and hook behavior
- Update architecture docs with memory backend architecture section
2026-04-13 22:32:31 -07:00
gsxdsm
f6ae0e2e82 feat(FN-1772): add backend-aware memory instruction context API
- Add MemoryBackendContext interface for backend-aware memory integration
- Implement getMemoryInstructions() method with backend-specific logic in project-memory.ts
- Add QMD memory backend type detection and instruction context for QMD-backed projects
- Update memory-plugin-contract.md with backend-variant instruction requirements (section 3.8.7)
- Update settings reference for memoryBackendType with custom backend support
- Add comprehensive regression tests for backend-variant memory instruction behavior
- Add changeset for @gsxdsm/fusion package
2026-04-13 22:03:42 -07:00
gsxdsm
ce518f3b61 feat(FN-1769): add pluggable memory backend system with QMD support
- Add MemoryBackend interface with file and QMD backend implementations
- Implement QMD memory backend with async execution, atomic writes, and fallback to file backend
- Add ProjectMemory class with backend-aware read/bootstrap semantics and conflict resolution
- Wire dashboard memory routes to use backend abstraction instead of direct file I/O
- Add comprehensive tests for memory backend and project memory classes
- Update settings reference and architecture docs for new backend configuration
2026-04-13 21:56:08 -07:00
gsxdsm
a4fe357d85 feat(FN-1767): add QMD memory backend with async execution and backend-aware project helpers
- Add QmdMemoryBackend class implementing MemoryBackend interface with async agent execution
- Backend executes QMD memory operations via subprocess spawn with configurable command/args
- Graceful fallback to readonly mode on write failures with error logging
- Add readWithoutFetch() and bootstrap() helpers to ProjectMemory for backend-aware read/bootstrap semantics
- Wire QMD backend into TaskStore.create() and memory initialization
- Export QmdMemoryBackend and BackendCapabilities from @fusion/core
- Add comprehensive tests for QMD backend and project memory helpers
2026-04-13 21:35:47 -07:00
gsxdsm
06abd57bb9 feat(FN-1725): improve settings management and mission interview robustness
- Fix global settings persistence to load from correct path and handle first-run state
- Expose global execution concurrency limit in settings UI and routes
- Harden mission-routes.ts utility-lane invariants with null checks
- Fix mission interview saturation tests with proper cleanup
- Add mission e2e tests covering interview and milestone flows
- Update SettingsModal to show scope indicators (global vs project)
- Update TaskForm model selection handling
2026-04-13 20:52:43 -07:00
gsxdsm
f6f5f14e07 feat(FN-1714): add scope-aware scheduling and global concurrency settings
- Add scope columns (global/project) to automations table with migration v32
- Implement scope-aware store query APIs in AutomationStore and RoutineStore
- Expose global concurrency limit in Settings UI with dedicated state
- Implement null-as-delete semantics for global settings to allow explicit clearing
- Add getActiveMergingTask cross-process guard to merger for safety
- Add stale status cleanup on startup sweep for crash recovery
- Update mock store in merger tests to include getActiveMergingTask method
2026-04-13 20:45:15 -07:00
gsxdsm
cc88b2be1c feat(FN-1695): polish Settings Authentication Panel UX
- Reorder authentication providers: authenticated shown first, then alphabetically sorted
- Upgrade auth section to grouped/card-style hierarchy with section labels
- Update auth status badges to show '✓ Active' and '✗ Not connected'
- Add 'Authenticated' and 'Available' group labels in auth section
- Improve visual prominence of authenticated providers with subtle green accent
- Add section hint when no providers are authenticated
- Update CSS for new card-based layout with mobile-responsive styles
- Add tests for provider ordering behavior
2026-04-13 20:35:18 -07:00
gsxdsm
f9f7aff3ec fix(engine): add cross-process merge guard to prevent concurrent merges
Multiple engine processes (dashboard + serve) share the same SQLite database
but each has its own in-memory merge queue. Without a cross-process check,
two processes can start merging different tasks simultaneously.

Added store.getActiveMergingTask() as a DB-level check before any merge
starts. The drainMergeQueue defers with pollIntervalMs delay, and both
aiMergeTask and processPullRequestMergeTask have safety-net checks.
Also moved stale merge status cleanup to run regardless of autoMerge setting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:22:10 -07:00
gsxdsm
827c0370c3 feat(FN-1665): merge fusion/fn-1665 2026-04-13 20:22:10 -07:00
gsxdsm
192ea195f7 feat(FN-1627): expose global execution concurrency limit in settings
- Add global max concurrent agent limit to settings UI (Scheduling section)
- Add null-as-delete semantics for global settings persistence
- Add fetchGlobalConcurrency and updateGlobalConcurrency API integrations
- Update SettingsModal tests with comprehensive coverage for new features
- Fix lint issues in modified files
2026-04-13 20:22:10 -07:00
gsxdsm
c2ddbdfb61 fix: add busy_timeout pragma to prevent "database is locked" errors
SQLite was immediately returning SQLITE_BUSY when concurrent writes
collided (e.g., recordActivity firing from a timer during another write).
Adding a 5-second busy_timeout lets SQLite retry internally before failing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 19:59:55 -07:00
gsxdsm
27e7a4389d feat(FN-1631): merge fusion/fn-1631 2026-04-13 18:58:26 -07:00
gsxdsm
db43409316 feat(FN-1518): merge fusion/fn-1518 2026-04-13 18:58:18 -07:00
gsxdsm
748db6c605 feat(FN-1506): add skills registry and configuration API
- Add skills discovery API (GET /api/skills/discovered) to list available skills with enabled state
- Add skills execution toggle API (PATCH /api/skills/execution) for enabling/disabling skills with project-scoped persistence
- Add skills catalog API (GET /api/skills/catalog) with resilient fallback to fetch skills.sh catalog
- Skills are stored in project settings (.fusion/settings.json) with support for both top-level and package-scoped skills
- Add SkillsAdapter runtime class for skills discovery, catalog fetching, and execution toggle
- Add comprehensive tests for all skills API endpoints
- Update dashboard, serve, and provider-settings commands with skills adapter integration
- Skip flaky streamChatResponse test (matches main branch behavior)
2026-04-13 18:30:52 -07:00
gsxdsm
26732e7e43 feat(FN-1719): rebuild eslint baseline and add memory lessons
- Rebuild eslint config with context-aware flat config for better TypeScript/JSX handling
- Add memory lessons for lint/type/test baseline restoration
- Skip pre-existing flaky stream test (flushes a final complete event)
- Fix api.ts require import path
- Add ProjectEngineManager.startReconciliation mock to tests for main compatibility
2026-04-13 18:21:31 -07:00
gsxdsm
e8dc9e9963 feat(engine): add background project engine reconciliation + global concurrency setting
- ProjectEngineManager.startReconciliation() polls for newly registered
  projects every 30s and starts their engines without requiring UI access
- Expose global concurrency limit in dashboard settings
- Fix SettingsModal test cleanup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 18:03:39 -07:00
gsxdsm
564659fcbe fix: prevent agents from killing production dashboard on port 4040
An AI review agent (FN-1506) killed the running dashboard by finding
the process on port 4040 via lsof and running kill -9, causing exit
code 137 (SIGKILL) with no logs. This adds multi-layer guardrails:

- AGENTS.md: project-level rule reserving port 4040
- Executor/reviewer system prompts: explicit prohibition on killing
  port 4040 processes, with instruction to use --port 0 instead
- Core agent-prompts.ts: same guardrails in all prompt variants
- Reviewer told to issue REVISE if executor violates the rule
- SIGHUP handlers in dashboard.ts and serve.ts for resilience
- Background engine reconciliation in dashboard/serve startup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 18:00:49 -07:00
gsxdsm
9a028b6573 feat(FN-1640): add Frontend UX Design built-in workflow template
- Add Frontend UX Design template for verifying UI/UX design implementation
- Include WCAG 2.1 compliance checks, design system adherence, and user flow validation
- Add template to WorkflowStepManager with category-based organization
- Update documentation with new template description
- Add tests for template API endpoints and workflow step manager
2026-04-13 17:41:33 -07:00
gsxdsm
755b8b2520 Fix mission task status sync 2026-04-13 17:14:06 -07:00
gsxdsm
0d0e2e6dbe fix(engine): prevent two tasks showing "merging" status simultaneously
Root cause: if a merge crashed or the process restarted mid-merge, the
"merging" status was never cleared. On next startup the stale task kept
its "merging" status while the queue moved on to the next task, resulting
in two tasks appearing to merge at once.

Two fixes:
1. Add "merging"/"merging-pr" to BLOCKING_TASK_STATUSES so tasks with
   active merge status are not re-enqueued by the retry sweep.
2. Clear stale "merging" statuses during startup merge sweep — no merge
   is actually running at engine start, so any such status is a leftover.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 17:06:17 -07:00
gsxdsm
98bc2dfdae feat(FN-1702): merge fusion/fn-1702 2026-04-13 17:04:15 -07:00
gsxdsm
6079dfd316 fix(engine): serialize manual merge through the auto-merge queue
The onMerge() path (dashboard "merge now" button) bypassed the
drainMergeQueue serialization, allowing two tasks to enter "merging"
status simultaneously within the same project. Route manual merges
through the same queue so only one merge runs at a time per project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 16:40:06 -07:00
gsxdsm
1712866ae8 feat(FN-1706): merge fusion/fn-1706 2026-04-13 16:35:06 -07:00
gsxdsm
f3087df5de feat(FN-1492): merge fusion/fn-1492 2026-04-13 16:30:42 -07:00