Tests cover:
- parseValidationResult with JSON extraction from markdown code blocks and malformed responses
- handleValidationPass verifying feature marked 'passed' and autopilot notified
- handleValidationFail verifying fix feature generated and retry budget decremented
- handleValidationBlocked verifying feature marked 'blocked' without fix generation
- Retry budget enforcement preventing further implementations when exhausted
- recoverActiveMissions verifying actual processTaskOutcome calls for features in validating/needs_fix states
Added 23 new tests (1916 total, up from 1893).
- Implement actual AI response parsing in parseValidationResult() with JSON extraction
from markdown code blocks, repair for common JSON issues, and assertion result parsing
- Fix notifyValidationComplete to pass feature.taskId instead of featureId to
handleTaskCompletion() in in-process-runtime, dashboard, and serve
- Fix recoverActiveMissions() to actually transition validating features back to
implementing and call processTaskOutcome for features with completed tasks
- Add comprehensive unit tests for MissionExecutionLoop lifecycle, processTaskOutcome,
recoverActiveMissions, and error handling
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 MissionExecutionLoop mock to @fusion/engine vi.mock block in
serve.test.ts. The mock provides start, stop, processTaskOutcome,
and recoverActiveMissions methods to match the actual class interface.
Also adds the scrutiny synthesis report for milestone execution-loop
which identifies 3 blocking issues in FEAT-004:
- parseValidationResult stub always returns pass
- notifyValidationComplete passes featureId instead of taskId
- recoverActiveMissions doesn't perform state transitions
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The merger's test/build verification, executor's worktreeInitCommand,
setupScript, and script-mode workflow steps all used execSync, which
blocks Node's event loop until the child process exits. A hanging
pnpm test could freeze the entire engine (no logs, heartbeats, or
other task progress) for the full 5-minute timeout.
Switch these call sites to promisify(exec) with awaited calls so the
engine keeps running while user-configured commands execute. Short
internal git plumbing (rev-parse, branch -d, worktree remove) still
uses execSync since those commands are bounded and measured in ms.
Document the rule in AGENTS.md under a new "Engine process rules"
section so future agents don't reintroduce blocking behavior.
Tests: update child_process mocks in merger.test, executor.test, and
restart.integration.test to route the new async exec through the
existing execSync mock and expose promisify.custom so destructuring
{ stdout, stderr } matches real child_process.exec semantics.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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
- 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
- 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
- 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
- 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
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>
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>
- 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
- 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
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>
- 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>
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>