Commit Graph

1926 Commits

Author SHA1 Message Date
gsxdsm
164053ad83 chore: add data-model milestone scrutiny synthesis
Scrutiny validation for data-model milestone:
- All 3 features pass (FEAT-001, FEAT-002, FEAT-003)
- 28 VAL-DM validation contract items addressed
- Test suite passes (2212 core + 1889 engine tests)
- Typecheck passes
- Lint has pre-existing errors unrelated to data-model features
2026-04-11 17:46:02 -07:00
gsxdsm
90e6824232 feat(FEAT-003): add validator failures, fix features, snapshot methods and loop state transitions
- Add recordValidatorFailures() method to store assertion failures with generated IDs
- Add createGeneratedFixFeature() to create fix features with lineage tracking
- Add getFeatureLoopSnapshot() to return complete loop state with retryBudgetRemaining
- Add getValidatorRunsByFeature() returning runs ordered by startedAt DESC
- Add getFailuresForRun() returning failures ordered by createdAt ASC
- Add transitionLoopState() with validation for all valid loop state transitions
- Implement retry budget enforcement: blocks implementing when budget exhausted
- Add rowToFailure() and rowToLineage() converters
- Add generateFailureId() and generateLineageId() ID generators
- Add DEFAULT_IMPLEMENTATION_RETRY_BUDGET constant (3 attempts)
- Update MissionFeatureLoopSnapshot interface to include retryBudgetRemaining

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-11 17:32:29 -07:00
gsxdsm
a5344f369e feat(FEAT-002): add startValidatorRun and completeValidatorRun methods
- Add validator-run:started and validator-run:completed events to MissionStoreEvents
- Add rowToValidatorRun converter method
- Add generateValidatorRunId method
- Implement startValidatorRun: creates run with status='running', sets startedAt, increments feature validatorAttemptCount, updates lastValidatorRunId, sets loopState to 'validating', emits event
- Implement completeValidatorRun: handles passed/failed/blocked/error transitions with correct loop state updates and durationMs computation
- Add tests for all validator run methods covering VAL-DM-015 through VAL-DM-020

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-11 17:23:44 -07:00
gsxdsm
429d5855ee feat(FEAT-001): add loop state columns and validator run tables for mission execution loop
This commit adds the schema migration and types for the mission execution loop validation system:
- Adds loop state tracking columns to mission_features table (loopState, implementationAttemptCount, validatorAttemptCount, lastValidatorRunId, lastValidatorStatus, generatedFromFeatureId, generatedFromRunId)
- Creates mission_validator_runs table for tracking validation runs
- Creates mission_validator_failures table for assertion failure records
- Creates mission_fix_feature_lineage table for tracking fix feature relationships
- Adds workflowStepRetries column to tasks table for retry tracking
- Adds FEATURE_LOOP_STATES and VALIDATOR_RUN_STATUSES enums
- Updates TaskStore to support workflowStepRetries field
- Updates TaskExecutor to handle workflow step failures with retry logic

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-11 17:06:41 -07:00
gsxdsm
aa1866cc82 chore: add mission infrastructure for execution loop validation system
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-11 16:06:24 -07:00
gsxdsm
b76a1011b6 feat(FN-1445): add project-scoping and fallback handling for AI routes and missions
- Add projectId parameter to refineText API and TaskForm for proper scoping
- Update mission routes to require projectId and add regression tests
- Add mission interview fallback to mission-level context when target not found
- Add AI refine route scoping tests for project isolation
- Update component tests to expect projectId argument
- Update prompt-keys test counts for new system prompts
2026-04-11 15:23:03 -07:00
gsxdsm
18f242b2bc feat(FN-1420): add pluggable memory backend system
- Add FileMemoryBackend with atomic writes, persistence, and conflict resolution
- Add ReadOnlyMemoryBackend for read-only/external memory management
- Add memoryBackendType setting to select backend type (file or readonly)
- Add GET /api/memory/backend endpoint to query current backend status and capabilities
- Update AGENTS.md, README.md, and docs with architecture and settings guidance
- Add memory-backend.test.ts with comprehensive tests for all backends
- Add routes.test.ts coverage for /api/memory/backend endpoint
- Fix settings parity test to include new memoryBackendType key
2026-04-11 12:13:25 -07:00
gsxdsm
12c38ef0ea feat(FN-1588): add truncated-prompt retry for merger context-limit recovery
- Detect when merge prompt exceeds context limit and gets truncated
- Retry merge with compacted prompt when truncation is detected
- Create fresh session after context limit recovery
- Add comprehensive tests for truncation detection and recovery flow
- Update merge prompt generation to include truncation signal
2026-04-11 11:39:50 -07:00
gsxdsm
98dc20b3d3 feat(FN-1584): add step-change dependency and polling to useTaskDiffStats
- Add step-based dependency to useTaskDiffStats hook to trigger refetch when task steps change
- Implement 5-second polling interval for live diff statistics updates
- Add comprehensive test coverage for polling behavior and step-change detection
- Update TaskCard to pass step information to useTaskDiffStats
- Add TaskCard unit tests for diff statistics display
2026-04-11 11:27:32 -07:00
gsxdsm
fee27abb56 feat(FN-1571): merge fusion/fn-1571 2026-04-11 11:04:04 -07:00
gsxdsm
03d72f06b1 feat(FN-1545): fix mobile More sheet safe-area padding
- Fix More sheet content padding on iOS devices with notched screens
- Add CSS regression tests for safe-area-inset-* rules in mobile nav bar
- Ensure consistent padding for content area across different device safe areas
2026-04-11 11:00:52 -07:00
gsxdsm
84ae3e0163 feat(FN-1501): enhance workflow step output rendering
- Add expanded view modal for workflow step output with full-screen display
- Add markdown/plain text toggle for output rendering in WorkflowResultsTab
- Add output rendering CSS styles with markdown and code block styling
- Update workflow steps documentation with output rendering features
- Add comprehensive tests for WorkflowResultsTab component (259 tests)
2026-04-11 09:39:32 -07:00
gsxdsm
05a310dc07 feat(FN-1495): merge fusion/fn-1495 2026-04-11 09:01:29 -07:00
gsxdsm
b40c9b5406 feat(FN-1433): wire prompt overrides into mission interview service
- Import resolvePrompt and PromptOverrideMap from @fusion/core
- Add promptOverrides parameter to all agent creation paths:
  - createMissionInterviewSession
  - submitMissionInterviewResponse
  - retryMissionInterviewSession
  - initializeAgent
  - createMissionInterviewAgent
  - ensureMissionInterviewAgent
- Use resolvePrompt('planning-system', promptOverrides) for effective prompt
- Fall back to MISSION_INTERVIEW_SYSTEM_PROMPT when override absent
- Update module docs to reflect prompt override behavior
2026-04-11 08:52:39 -07:00
gsxdsm
e48e034754 feat(FN-1416): merge fusion/fn-1416 2026-04-11 08:31:32 -07:00
gsxdsm
98ad63abcb fix(auto-merge): unblock review tasks stranded past retry limit
Broaden the auto-heal pattern to cover build-verification failures and
add a 30m idle cooldown so tasks that exhausted mergeRetries without
matching the narrow heal pattern get another sweep-driven attempt
instead of being stranded until a human clears the counter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 07:48:17 -07:00
gsxdsm
29a09d697f test: fix mission manager icon mock 2026-04-11 07:03:07 -07:00
gsxdsm
6dd66f6a31 fix(merger): truncate verification output and retry via in-progress
Deterministic verification failures were embedding the raw stderr/stdout
(up to 50MB per VERIFICATION_COMMAND_MAX_BUFFER) in a second log entry,
flooding logs/stdout and crashing the app. The runVerificationCommand
helper already wrote a truncated summary, so verifyDeterministicBuild
now just references it.

When the failure surfaces in the dashboard merge handler, kick the task
back to in-progress with a steering comment so the agent can fix the
failing test/build instead of parking it in in-review with a fatal
error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 06:56:18 -07:00
gsxdsm
302394b5f5 feat(FN-1489): reorganize Task Detail modal footer with split menus
- Add SplitMenu component for reusable dropdown menus in modal footers
- Update TaskDetailModal footer to use LeftMenu (Plan, Subtask, Models) and RightMenu (Save, Close)
- Add comprehensive tests for dropdown menu behavior in modal footers
- Update QuickEntryBox and NewTaskModal tests to match new menu patterns
- Add testing patterns for modal dropdown menus to project memory
2026-04-11 06:51:20 -07:00
gsxdsm
c8831f7b3b feat(FN-1553): reduce memory bloat with selective save behavior
- Update project memory instructions to encourage selective writes instead of unconditional appends
- Instruct agents to consolidate existing entries rather than add duplicates
- Add guidance to skip memory updates when no durable learnings were discovered
- Clarify what qualifies as durable learnings vs task-specific trivia
- Update user-facing memory documentation to reflect new selective behavior
- Add test coverage for selective memory write instructions
2026-04-11 00:38:42 -07:00
gsxdsm
afa2e153ee fix(FN-1488): add showQuickChatFAB setting to control Quick Chat FAB visibility
- Add showQuickChatFAB boolean setting to ProjectSettings type
- Add useAppSettings hook function for accessing the setting
- Wire QuickChatFAB visibility in App.tsx based on setting
- Hide QuickChatFAB in MobileNavBar when setting is false
- Add Settings UI toggle for the new setting
- Add CSS for hiding QuickChatFAB on mobile when disabled
- Add comprehensive tests for all affected components
- Fix QuickChatFAB onOpenChange test to use controlled mode
- Update settings reference documentation
2026-04-11 00:18:22 -07:00
gsxdsm
5efe862c68 feat(FN-1413): merge fusion/fn-1413 2026-04-10 23:20:39 -07:00
gsxdsm
2a0e9bc5e5 docs(FN-1426): restore memory file with vite alias pitfall 2026-04-10 22:43:28 -07:00
gsxdsm
7576331a6c docs(FN-1426): update project memory with vite alias pitfall 2026-04-10 22:42:28 -07:00
gsxdsm
8c1fce0011 feat(FN-1426): update docs with new Prompts section in Settings modal 2026-04-10 22:38:52 -07:00
gsxdsm
a9e9abed9e fix(FN-1426): re-export PROMPT_KEY_CATALOG from types.ts for vite alias compatibility 2026-04-10 22:37:58 -07:00
gsxdsm
33cfef2592 feat(FN-1426): add tests for prompt override edit/reset/save behavior 2026-04-10 22:33:29 -07:00
gsxdsm
72d7de1835 feat(FN-1426): add Prompts section to Settings modal with per-prompt editor UI 2026-04-10 22:27:41 -07:00
gsxdsm
3fdd04d6cb feat(FN-1583): merge fusion/fn-1583 2026-04-10 22:20:39 -07:00
gsxdsm
05229a5c0f 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
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
c812bdbc2a feat(FN-1578): merge fusion/fn-1578 2026-04-10 21:23:06 -07:00
gsxdsm
39ffb4b456 feat(FN-1562): merge fusion/fn-1562 2026-04-10 21:22:59 -07:00
gsxdsm
7be8c17279 feat(FN-1490): merge fusion/fn-1490 2026-04-10 21:22:50 -07:00
gsxdsm
ed700ba1d1 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
1bf4db2277 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
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
534fcf20b6 docs(FN-1567): add project memory for mission contract assertions pattern 2026-04-10 21:10:26 -07:00
gsxdsm
d953258c72 docs(FN-1567): add inline documentation for assertion lifecycle, linkage, and rollup precedence 2026-04-10 21:09:17 -07:00
gsxdsm
23570465bc feat(FN-1567): complete Step 2 — add assertion APIs, links, and rollup tests 2026-04-10 21:00:06 -07:00
gsxdsm
a5e02694de test(FN-1567): update schema version assertions to v29 2026-04-10 20:58:47 -07:00
gsxdsm
a28a86e1c7 feat(FN-1567): complete Step 1 — add mission contract model types and schema v29 2026-04-10 20:58:03 -07:00
gsxdsm
429eb4c4f9 feat(FN-1444): complete Step 2 — include soul in agent instructions assembly 2026-04-10 20:47:04 -07:00
gsxdsm
37c91e806d 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
402eac6cb4 feat(FN-1444): complete Step 1 — add soul to POST/PATCH agent routes with validation 2026-04-10 20:41:48 -07:00
gsxdsm
1fe55b22f1 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
54fdeb66df Merge fusion/fn-1446 into main (dashboard perf + FN-1446 planning work) 2026-04-10 20:17:57 -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
c9a1e94bbe 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