Commit Graph

1851 Commits

Author SHA1 Message Date
gsxdsm
33953234b9 fix(FN-1426): re-export PROMPT_KEY_CATALOG from types.ts for vite alias compatibility 2026-04-10 22:37:58 -07:00
gsxdsm
997dd01eca feat(FN-1426): add tests for prompt override edit/reset/save behavior 2026-04-10 22:33:29 -07:00
gsxdsm
35cdc97686 feat(FN-1426): add Prompts section to Settings modal with per-prompt editor UI 2026-04-10 22:27:41 -07:00
gsxdsm
729d2eb1f4 feat(FN-1583): merge fusion/fn-1583 2026-04-10 22:20:39 -07:00
gsxdsm
fd8208d2f5 fix(FN-1567): fix plugin loader type and ntfy events test
- Fix ConstructorParameters type in plugin loader
- Update ntfy events test to expect awaiting-user-review event
2026-04-10 21:52:58 -07:00
gsxdsm
f2b08b6781 Fix task card step progress 2026-04-10 21:46:06 -07:00
gsxdsm
3b849c47d1 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
4fae4a7104 feat(FN-1578): merge fusion/fn-1578 2026-04-10 21:23:06 -07:00
gsxdsm
020549d5cc feat(FN-1562): merge fusion/fn-1562 2026-04-10 21:22:59 -07:00
gsxdsm
fd79050af3 feat(FN-1490): merge fusion/fn-1490 2026-04-10 21:22:50 -07:00
gsxdsm
28363aa332 fix(dashboard): restore jest-dom matchers in QuickEntryBox/InlineCreateCard tests
Changed @testing-library/jest-dom import to @testing-library/jest-dom/vitest
in vitest.setup.ts to properly provide type definitions for jest-dom matchers
like toBeInTheDocument, toHaveClass, toBeDisabled, and toHaveAttribute in the
vitest environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 21:22:34 -07:00
gsxdsm
ddb8b2f96b fix(types): correct GitHubOperations interface and test type assertions
- Tighten GitHubOperations.findPrForBranch and mergePr param types to
  match the literal unions in FindPrParams/MergePrParams, fixing the
  GitHubClient assignability error in dashboard.ts and serve.ts
- Cast MockStore as unknown as TaskStore at mesh-routes.test.ts call
  site to satisfy TaskStore shape without implementing 117 methods
- Double-cast AgentGenerationSession via unknown in agent-generation.test.ts
  to silence the unsafe conversion diagnostic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 21:16:42 -07:00
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
d955f2c854 docs(FN-1567): add project memory for mission contract assertions pattern 2026-04-10 21:10:26 -07:00
gsxdsm
3541afe497 docs(FN-1567): add inline documentation for assertion lifecycle, linkage, and rollup precedence 2026-04-10 21:09:17 -07:00
gsxdsm
e90bbad160 feat(FN-1567): complete Step 2 — add assertion APIs, links, and rollup tests 2026-04-10 21:00:06 -07:00
gsxdsm
2e65bc76f1 test(FN-1567): update schema version assertions to v29 2026-04-10 20:58:47 -07:00
gsxdsm
ed6204621a feat(FN-1567): complete Step 1 — add mission contract model types and schema v29 2026-04-10 20:58:03 -07:00
gsxdsm
3a6bd140ea feat(FN-1444): complete Step 2 — include soul in agent instructions assembly 2026-04-10 20:47:04 -07:00
gsxdsm
5faa9ead19 fix(dashboard): restore step/comment fields on slim list and detail tabs
The previous slim listing dropped log, comments, steps,
workflowStepResults, and steeringComments from the board task payload.
Of those, only `log` is actually heavy (~60 MB across 1200 tasks);
everything else combined is under 500 KB and is needed by the board UI:

- TaskCard step progress badge reads task.steps
- TaskCard comment count badge reads task.comments
- Workflow status indicators read task.workflowStepResults

Slim mode now drops *only* log. The other JSON columns stay in board
payloads, so progress bars and badges render again without forcing a
full per-task fetch.

Also fix the TaskDetailModal regression where the Activity tab and the
Step Progress section read task.log/task.steps from the slim board prop
instead of workingTask (the full row loaded via fetchTaskDetail). The
prop is the cached slim row from the board, so the activity tab was
empty until the user scrolled — now both tabs read workingTask.

Updated the slim listTasks regression test to assert the new contract:
log is dropped, but steps/comments/workflowStepResults/steeringComments
match the full row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 20:46:04 -07:00
gsxdsm
0111d819ff feat(FN-1444): complete Step 1 — add soul to POST/PATCH agent routes with validation 2026-04-10 20:41:48 -07:00
gsxdsm
62ac9e2753 perf(dashboard): kill startup SSE storm and slim hot-path task scans
- TaskStore.watch() now initializes lastPollTime so the first
  checkForChanges() poll filters by "modified since now" instead of
  doing an unfiltered SELECT * and emitting a task:updated event for
  every cached task. On a 1200-task board this dropped ~60 MB of SSE
  traffic and a 1199-call setState storm one second after dashboard
  startup.
- listTasks() gains a column option so callers can filter in SQL.
- dashboard CLI auto-merge sweeps (startup + 2 unpause handlers + the
  15s periodic retry) now use listTasks({ column: "in-review" })
  instead of pulling the full table on every cycle.
- self-healing archiveStaleDoneTasks() uses slim listTasks — it only
  needs id/column/columnMovedAt to decide staleness.
- Document the listTasks() perf contract and the watch() polling
  invariant in AGENTS.md and project memory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 20:40:42 -07:00
gsxdsm
0fb17a07be Merge fusion/fn-1446 into main (dashboard perf + FN-1446 planning work) 2026-04-10 20:17:57 -07:00
gsxdsm
39a0f783bf 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
ffa0edc7b2 fix(FN-1446): improve test reliability and git command TTY handling
- Fix QuickEntryBox focus restoration after task creation with proper submission state tracking
- Improve QuickEntryBox tests by using explicit promise resolution and proper afterEach cleanup with act() wrappers
- Fix TaskCard tests to use proper act() wrappers for async operations
- Add stdio: 'pipe' to all git execSync calls to prevent TTY interaction issues in CI environments
- Add test log suppression for noisy subagent and pi-claude-cli output in vitest setup
2026-04-10 19:49:05 -07:00
gsxdsm
e2fe909d25 feat(FN-1446): wire planning + subtask prompt override resolution with regression tests 2026-04-10 19:32:22 -07:00
gsxdsm
616796ad60 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
d79d2eef47 feat(FN-1559): recover orphaned features in autopilot reconciliation
- Add tryRelinkOrphanedFeature() to find and link matching tasks
- Normalize titles (trim, lowercase, collapse whitespace) for matching
- Only relink when exactly one task matches (ambiguous = no action)
- Sync feature status from task state on successful relink
- Normalize to 'defined' when no safe relink exists
- Add 7 tests for orphaned feature relink scenarios
- All 57 tests passing
2026-04-10 19:14:23 -07:00
gsxdsm
b3f057a281 fix: improve merge verification and dashboard behavior 2026-04-10 18:30:23 -07:00
gsxdsm
43802b165c feat(FN-1480): merge fusion/fn-1480 2026-04-10 18:09:00 -07:00
gsxdsm
f9d65f5447 feat(FN-1558): add dedicated Instructions tab in Agent Detail view
- Add InstructionsTab component for editing agent system instructions directly in the dashboard
- Include validation (character count, preview section) and reset to default functionality
- Add 82 regression tests covering Instructions tab editing flows
- Update agents.md documentation with Instructions tab usage guide
- Add changeset for @gsxdsm/fusion package
2026-04-10 13:30:37 -07:00
gsxdsm
c1bb1adce8 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
bf7b7ad701 fix(FN-1564): remove duplicate Retry button in task detail modal
- Fix duplicate Retry button appearing in task detail modal header
- Add test coverage for Retry button visibility conditions
- Clean up conditional logic for Retry button rendering
2026-04-10 13:02:51 -07:00
gsxdsm
a43ec905b8 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
4137dbd223 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
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
487ed993d5 feat(FN-1555): remove quick-entry textarea expand/fullscreen affordance
- Remove expand/compress chevron button from QuickEntryBox
- Remove isExpanded state and resize logic
- Remove fullscreen toggle functionality
- Remove related test cases for expand/collapse behavior
2026-04-10 12:34:38 -07:00
gsxdsm
04babf2a92 feat(FN-1411): implement plugin management API routes with project scoping
- Add GET /api/plugins and GET /api/plugins/:id for listing and retrieving plugins
- Add POST /api/plugins with mode discriminator (register/install) for plugin registration and installation
- Add POST /api/plugins/:id/enable and /disable for plugin lifecycle management
- Add PATCH /api/plugins/:id/settings for updating plugin configuration
- Add DELETE /api/plugins/:id for plugin uninstallation
- All endpoints support projectId scoping via getScopedStore() for multi-project support
- Add comprehensive test suite covering all plugin routes with project context mocking
- Document plugin API endpoints in dashboard README
2026-04-10 12:34:13 -07:00
gsxdsm
f62e4623de 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
15b27253b4 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
6f3bb57d35 feat(FN-1556): merge fusion/fn-1556 2026-04-10 12:11:27 -07:00
gsxdsm
7ad9bf6f6d feat(FN-1464): merge fusion/fn-1464 2026-04-10 12:07:01 -07:00
gsxdsm
82fc649db6 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
afc70f15e6 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
d8d961c800 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
cf43e0413e 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
4d10385f4c feat(FN-1499): add workflow step revision loop signaling
- Add WorkflowStepSignal type with 'needs-revision' support for iterative QA loops
- Extend executeWorkflowStep() to detect needs-revision signals and trigger revision sessions
- Add revision loop limit (5 iterations max) to prevent infinite loops
- Track revisionAttempts in workflow step results
- Add comprehensive tests for revision signaling, loop behavior, and limit enforcement
- Document workflow step revision behavior in docs/workflow-steps.md
2026-04-10 10:50:11 -07:00
gsxdsm
a95e965780 feat(FN-1548): merge fusion/fn-1548 2026-04-10 10:49:27 -07:00
gsxdsm
3870d0c9d8 feat(FN-1544): add viewport-gated loading and lightweight memo comparison
- Add viewport-gated fetching to TaskCard component so only visible cards load their data
- Implement lightweight memo comparison to prevent unnecessary re-renders
- Add lazy enable gates to useSessionFiles and useTaskDiffStats hooks with caching
- Add comprehensive tests for useSessionFiles and useTaskDiffStats hooks
- Document viewport-gated loading patterns in memory and dashboard-load performance docs
2026-04-10 10:44:48 -07:00
gsxdsm
4cb378477c 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