This change aligns agent editing surfaces across dashboard UI, API payloads,
and import/template flows so every first-class editable agent field is
round-trippable.
Backend changes:
- Add memory and bundleConfig fields to POST/PATCH /api/agents routes
- Fix agent-companies-parser to use first-class fields (title, icon, role,
reportsTo, instructionsText) instead of metadata fallbacks
- Update import dry-run preview to show more manifest fields
UI changes:
- Enable identity field editing (name, title, icon, role, reportsTo) in
AgentDetailView ConfigTab
- Add instruction bundle configuration (mode, entry file, files, external
path) to ConfigTab
- Add memory field to NewAgentDialog
- Fix AI generation mapping to preserve systemPrompt as instructionsText
- Update AgentImportModal preview to show icon, reportsTo, and instructions
Test fixes:
- Update parser tests for new first-class field behavior
- Add MissionExecutionLoop mock for serve tests
Documentation:
- Add agent field parity matrix to docs/agents.md
- Create changeset for @gsxdsm/fusion
- 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>
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>
- 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
- 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
- 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
- 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
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>
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>
- 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
- 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
- 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
- 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
- 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
- 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
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>
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>
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>
- Update GitHub Actions workflows to use Node.js 24 (actions/setup-node@v5)
- Add private packages to .changeset/config.json ignore array
- Fix version string tests to read dynamically from package.json
- Add FN-1537 documentation to .fusion/memory.md
- Add ChatStore mock to all dashboard route tests that mock @fusion/core,
since server.ts now instantiates ChatStore(store.getFusionDir(), ...)
- Add getFusionDir to createMockStore in server.test.ts
- Gate AI session cleanup scheduling behind shouldScheduleAiSessionCleanup()
(returns false in test env) to prevent open handle warnings
- Fix desktop tests: DASHBOARD_URL is now exported as a function alias,
update assertions to call DASHBOARD_URL() instead of using as string
- Add node:os mocks to system-metrics.test.ts for deterministic results
- Replace hardcoded maxWorkers=16 with availableParallelism()-based
calculation in all vitest configs to prevent OOM on 2-core CI runners
- Add --workspace-concurrency=2 to pnpm test commands
- Fix TaskCard tests: update mission badge title assertions to full titles
- Remove unused /api/mesh/state route
- Fix plugin-auto-label: add isError field, async onTaskCreated, "tests" keyword
- Fix plugin-ci-status: add module-level logger, tighten test assertions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add composite indexes for dashboard boot query paths
- Optimize taskList queries with (column, updatedAt) and (column, status, updatedAt) indexes
- Optimize activityLog queries with (timestamp DESC, taskId) index
- Add idempotent CREATE INDEX IF NOT EXISTS pattern for migrations
- Document index patterns in memory.md for future schema changes
- Update schema version assertions in db.test.ts and task-documents.test.ts
- Add changeset for dashboard load performance improvement
- Add /api/ai/summarize-title endpoint for AI-generated task titles
- Integrate title summarization into task creation flow when autoSummarizeTitles is enabled
- Add debug logging and error checking to summarizeTitle in ai-summarize.ts
- Add error logging to route handler and task store for failed summaries
- Add comprehensive integration tests for the summarize-title API endpoint
- Add memory entry documenting the auto-summarize titles bug fix
- Add in-memory cache to GlobalSettingsStore for fast settings reads
- Add getSettingsFast() to TaskStore that uses the cached settings
- Update GET /settings route to use getSettingsFast() for faster responses
- Add invalidateCache() method for testing and external process scenarios
- Document write-through cache pattern in .fusion/memory.md
- Add assigneeUserId field to Task type and SQLite schema for human assignment
- Add reviewHandoffPolicy setting to control automatic handoff behavior
- Implement handoff detection in executor: detect user assignment during review and auto-transition task
- Add dashboard API routes for user assignment, handoff queries, and completion
- Add frontend API functions: getHandoffTask, assignTaskToUser, completeHandoff
- Add comprehensive tests for store methods, API routes, and executor handoff logic
- Update memory documentation with review handoff pattern
- Add explicit always-green test suite instructions to executor agent prompts
- Update executor to enforce test-suite validation before task completion
- Add tests for agent prompt generation and executor behavior
- Ensure test failures block merge-ready state rather than allowing broken builds
- Update AGENTS.md with authoritative run lifecycle semantics documentation
- Add API-level regression test for repeated manual run prevention
- Update run lifecycle tests to match corrected behavior
- Refactor AgentStore to use structured run records as the authoritative source for run state
- Improve run status queries with better filtering and ordering
- Add run-audit event types and SQLite schema migration
- Implement typed store read/write/query APIs for run audit
- Make audit writes atomic with task updates (transactional writes)
- Fix SQLite parameter type casting in db layer
- Add comprehensive tests for RunMutationContext and audit functionality
- Add MemoryInsights class in @fusion/core for AI-powered memory audit generation
- Add post-run hook to CronRunner for triggering memory summarization after scheduled tasks
- Wire memory background processing in both dashboard and serve commands
- Add memoryAuditEnabled and memoryAuditSchedule settings for configurable automation
- Fix startup ordering: sync automation before cronRunner.start() to prevent race conditions
- Add comprehensive tests for memory-insights and dashboard/serve integration
- Update contributing.md and settings-reference.md with documentation
- Fix mission autopilot slice activation when tasks complete
- Fix state refresh in MissionManager to properly reflect autopilot status
- Fix scheduler to correctly trigger autopilot progression events
- Add unit tests for mission store autopilot state transitions
- Add component tests for MissionManager autopilot toggle and state display
- Add e2e tests for mission autopilot lifecycle (enable → task completion → slice progression)
- Update documentation with autopilot state machine details