Commit Graph

458 Commits

Author SHA1 Message Date
Fusion
a6c8e2886f feat(FN-1761): fix lint errors in executor.test.ts and restart.integration.test.ts
- executor.test.ts: remove unused imports (Column, StuckTaskDetector),
  replace Function type with EventListener, add MockTaskStore interface
- restart.integration.test.ts: replace require() with ESM import,
  replace Function types with proper function signatures
- All tests pass
2026-04-15 03:00:54 -07:00
Fusion
c944095339 feat(FN-1757): clear residual lint debt in engine package
- Remove unused imports across 25 files in engine package
- Remove unused variable declarations in ipc-worker.ts, child-process-runtime.ts, and mission-autopilot.ts
- Clean up unnecessary imports in agent-instructions.ts, agent-tools.ts, cron-runner.ts, executor.ts, and other modules
- Minor cleanup in notifier.ts, peer-exchange-service.ts, pi.ts, plugin-runner.ts, and other files
- Improves code quality and reduces potential confusion from unused code
2026-04-15 02:20:39 -07:00
Fusion
cfc2e16148 fix(FN-1818): fix milestone/slice status tracking on feature changes
- Add SSE listener for milestone:updated events in MissionManager to refresh UI on status changes
- Trigger slice and milestone status recompute when task feature status changes
- Add diagnostic log when task feature resolution fails for easier debugging
- Add regression tests for milestone status recompute logic
2026-04-15 01:15:29 -07:00
gsxdsm
889fd169e1 feat(FN-1787): merge fusion/fn-1787 2026-04-15 00:46:08 -07:00
gsxdsm
152b2b307b feat(FN-1858): merge fusion/fn-1858 2026-04-14 19:00:56 -07:00
gsxdsm
568c6ddd17 feat(FN-1852): merge fusion/fn-1852 2026-04-14 18:46:00 -07:00
gsxdsm
6942904447 feat(FN-1840): merge fusion/fn-1840 2026-04-14 13:45:28 -07:00
gsxdsm
051622ae08 feat(FN-1828): merge fusion/fn-1828 2026-04-14 13:30:02 -07:00
gsxdsm
3e6b8fad02 feat(FN-1811): merge fusion/fn-1811 2026-04-14 13:00:49 -07:00
gsxdsm
a10151d234 feat(FN-1798): merge fusion/fn-1798 2026-04-14 12:45:09 -07:00
gsxdsm
d4972c5ee7 feat(FN-1795): merge fusion/fn-1795 2026-04-14 12:15:33 -07:00
gsxdsm
65c118e388 fix: wire triage recovery into SelfHealingManager and fix duplicate imports
- Pass recoverApprovedTriageTask and getSpecifyingTaskIds callbacks from
  TriageProcessor to SelfHealingManager in InProcessRuntime. Without these,
  approved triage tasks stuck in 'specifying' status were never recovered.
- Remove duplicate imports in ModelOnboardingModal.tsx that caused TypeScript
  errors (duplicate identifiers: useEffect, useRef, ToastType, fetchAuthStatus).
- Add mock for model-onboarding-state in App.test.tsx.
2026-04-14 11:48:44 -07:00
gsxdsm
4067f85454 feat(FN-1740): merge fusion/fn-1740 2026-04-14 10:43:59 -07:00
gsxdsm
9ef6cecf75 feat(FN-1513): merge fusion/fn-1513 2026-04-14 09:58:51 -07:00
gsxdsm
7857b9660b feat(FN-1514): add regression tests for skillSelection across executor, step-session, and triage
- Add executor skillSelection regression tests covering model override resolution
- Add step-session skillSelection tests for per-step agent creation
- Add triage skillSelection tests for spec generation with projectRootDir
- Verify skillSelection context propagation across all execution paths
2026-04-14 09:51:12 -07:00
gsxdsm
3e2731a0c3 feat(FN-1513): add skill selection resolver for deterministic session skills
- Add skill selection resolver for deterministic session skill sets
- Wire skill override into createKbAgent via AgentOptions
- Export skill resolver types and functions from engine index
- Add regression tests for skill override wiring and resolver fallback semantics
- Apply skill selection to triage and executor sessions
- Apply skill selection to reviewer, merger, and heartbeat sessions
- Fix SessionSkillContextInput to use AgentStore instead of TaskStore
- Add session-skill-context helper for unified skill selection across all session types
- Update memory with skill resolver diagnostics distinction
2026-04-14 09:47:06 -07:00
gsxdsm
7bd6f37932 feat(FN-1515): merge fusion/fn-1515 2026-04-14 09:28:50 -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
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
ad363d8441 feat(FN-1510): merge fusion/fn-1510 2026-04-14 08:13:53 -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
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
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
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
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
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
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
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
6aec83fff3 feat(FN-1663): merge fusion/fn-1663 2026-04-13 15:51:05 -07:00
gsxdsm
f46803d985 fix(triage): enforce per-project maxConcurrent limit on triage
The triage processor was only checking the global semaphore, not the
per-project maxConcurrent setting. Now it counts all active agents
(in-progress + specifying) and respects Math.min(perProjectAvailable,
semaphoreAvailable) before starting new triage tasks. This matches the
scheduler's concurrency enforcement and prevents triage from consuming
all available slots on startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:18:32 -07:00
gsxdsm
8124f10511 fix(triage): respect global concurrency limit before queuing tasks
The triage processor was kicking off all eligible tasks simultaneously,
queuing them all on the semaphore regardless of available slots. Now it
checks semaphore.availableCount first and only starts as many triage
tasks as there are free slots. Remaining tasks get picked up on the
next poll cycle (default 10-15s) as slots free up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:06:29 -07:00
gsxdsm
730059123b fix: share one global semaphore across all project engines
ProjectEngineManager now creates a single AgentSemaphore and injects it
into all engines via config.globalSemaphore. Previously each engine created
its own semaphore, so the globalMaxConcurrent limit was not enforced across
projects. The semaphore dynamically reads the limit and listens for
concurrency:changed events for live updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 14:46:21 -07:00
gsxdsm
f2afce2468 feat: expose global execution concurrency limit in settings
- Add PUT /api/global-concurrency endpoint to update globalMaxConcurrent
  via CentralCore (validated 1-50 range)
- Make InProcessRuntime semaphore react to live concurrency changes via
  CentralCore "concurrency:changed" event — no restart needed
- Add Global Max Concurrent input to Settings modal Scheduling section
  with fetch-on-mount and save-alongside-project-settings behavior
- Add updateGlobalConcurrency API client function

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 14:23:40 -07:00
gsxdsm
1383b8d7d6 refactor: replace primary/secondary engine pattern with uniform ProjectEngineManager
Remove the anti-pattern where the cwd project was treated as "primary" with a
special engine, and other projects got "secondary" engines through a separate
code path. Every project now gets an identical ProjectEngine created through
ProjectEngineManager.

Key changes:
- Add ProjectEngineManager class to @fusion/engine for uniform engine lifecycle
- Replace manual engine maps in dashboard.ts and serve.ts with engineManager
- Add engineManager to ServerOptions for per-project engine resolution
- Add getProjectContext() helper in routes.ts (replaces 199 getScopedStore calls)
- Merge and automation routes now resolve engine subsystems per-request
- SSE endpoint uses engine's store when available (same EventEmitter)
- Fix tsx not found in dev-with-memory.mjs startup script
- Add invalidateAllGlobalSettingsCaches for cross-project settings sync

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 13:32:38 -07:00
gsxdsm
6d414f7b59 feat(FN-1626): merge fusion/fn-1626
- docs(FN-1626): document PWA home bar gap token and updated bottom-layout contract
- fix(pre-existing): add missing invalidateAllGlobalSettingsCaches export to unblock build
- feat(FN-1626): update regression tests for standalone spacing and PWA home bar gap
- feat(FN-1626): add PWA home bar gap token and update bottom-layout CSS contract
2026-04-13 13:31:05 -07:00