feat(FN-1218): harden mission autopilot with self-healing recovery

- Add mission self-healing project settings for stale activation thresholds, task retry budgets, and mission health-check intervals
- Extend MissionAutopilot with failed-task retry handling, blocked feature escalation, stale activating mission recovery, and periodic feature/task consistency reconciliation
- Wire autopilot failure and recovery flows through Scheduler and InProcessRuntime, including startup recovery for watched missions after crashes
- Add blocked feature status support in core mission types and CLI mission status labels
- Expand mission-autopilot coverage for retry flows, stale/startup recovery, health checks, and regression scenarios, and include a patch changeset for @gsxdsm/fusion
This commit is contained in:
gsxdsm
2026-04-08 10:01:06 -07:00
parent cb90e33853
commit bfc3c80841
8 changed files with 904 additions and 34 deletions

View File

@@ -24,7 +24,7 @@ export const SLICE_STATUSES = ["pending", "active", "complete"] as const;
export type SliceStatus = (typeof SLICE_STATUSES)[number];
/** Status values for a Feature within a slice */
export const FEATURE_STATUSES = ["defined", "triaged", "in-progress", "done"] as const;
export const FEATURE_STATUSES = ["defined", "triaged", "in-progress", "done", "blocked"] as const;
export type FeatureStatus = (typeof FEATURE_STATUSES)[number];
/** Interview state for AI-assisted specification */

View File

@@ -967,6 +967,18 @@ export interface ProjectSettings {
* enabled and steps have non-overlapping file scopes. Range: 14.
* Default: 2. */
maxParallelSteps?: number;
/** Time in milliseconds after which a mission in `activating` state is
* considered stale and eligible for self-healing recovery.
* Default: 600000 (10 minutes). */
missionStaleThresholdMs?: number;
/** Maximum automatic retry attempts for a failed mission-linked task before
* its feature is marked as blocked for manual intervention.
* Default: 3. */
missionMaxTaskRetries?: number;
/** Interval in milliseconds between mission feature/task consistency checks.
* Set to 0 to disable periodic health checks.
* Default: 300000 (5 minutes). */
missionHealthCheckIntervalMs?: number;
/** Configurable agent role prompt templates and assignments.
* When set, allows per-project customization of system prompts
* for different agent roles (executor, triage, reviewer, merger). */
@@ -1071,6 +1083,9 @@ export const DEFAULT_PROJECT_SETTINGS: ProjectSettings = {
tokenCap: undefined,
runStepsInNewSessions: false,
maxParallelSteps: 2,
missionStaleThresholdMs: 600_000,
missionMaxTaskRetries: 3,
missionHealthCheckIntervalMs: 300_000,
agentPrompts: undefined,
reflectionEnabled: false,
reflectionIntervalMs: 3_600_000,
@@ -1160,6 +1175,9 @@ export const PROJECT_SETTINGS_KEYS: ReadonlyArray<keyof ProjectSettings> = [
"maxSpawnedAgentsGlobal",
"runStepsInNewSessions",
"maxParallelSteps",
"missionStaleThresholdMs",
"missionMaxTaskRetries",
"missionHealthCheckIntervalMs",
"agentPrompts",
"reflectionEnabled",
"reflectionIntervalMs",