refactor(FN-1353): simplify mission autopilot to single toggle

- Deprecate autoAdvance field in favor of autopilotEnabled as the sole control
- Remove autoAdvance guard logic from MissionAutopilot engine class
- Simplify MissionManager UI to use single autopilot toggle with visual state indicator
- Update MissionAutopilot tests to use autopilotEnabled instead of autoAdvance
- Update MissionManager component tests for simplified UI
- Update AGENTS.md documentation to reflect the simplified autopilot model
This commit is contained in:
gsxdsm
2026-04-09 13:45:19 -07:00
parent 0c3e46e4e0
commit b5b37c4fa6
7 changed files with 76 additions and 244 deletions

View File

@@ -1787,7 +1787,7 @@ Missions can run in **autopilot mode** for autonomous progression through slices
### How It Works
1. **User enables autopilot** on a mission via the dashboard UI
1. **User enables autopilot** on a mission via the dashboard UI (the only control needed)
2. The `MissionAutopilot` class starts watching the mission
3. As tasks complete, the scheduler notifies the autopilot
4. Autopilot checks if the current slice is complete
@@ -1803,12 +1803,15 @@ Missions can run in **autopilot mode** for autonomous progression through slices
| `activating` | Progressing to the next slice |
| `completing` | Wrapping up the mission |
### Relationship Between autopilotEnabled and autoAdvance
### autopilotEnabled
- **`autoAdvance`** — When a slice completes, automatically activate the next pending slice (existing behavior)
- **`autopilotEnabled`** — Enable the autopilot monitoring system for this mission (new behavior)
- Both can be true simultaneously. `autopilotEnabled: true` with `autoAdvance: true` provides full automation
- `autopilotEnabled: true` with `autoAdvance: false` provides monitoring but manual slice activation
The `autopilotEnabled` flag is the sole control for autopilot behavior. When enabled:
- Autopilot automatically watches the mission and monitors task completion
- When a slice completes, autopilot auto-advances to the next pending slice
- The autopilot toggle in the mission edit form is the only control needed
**Note:** The `autoAdvance` field is deprecated and superseded by `autopilotEnabled`. It is kept for backward compatibility with existing mission data but is no longer user-facing.
### Key Implementation
@@ -1822,8 +1825,8 @@ Missions can run in **autopilot mode** for autonomous progression through slices
- `GET /api/missions/:missionId/autopilot` — Returns autopilot status
- `PATCH /api/missions/:missionId/autopilot` — Enable/disable autopilot (`{ enabled: boolean }`)
- `POST /api/missions/:missionId/autopilot/start` — Manually start watching
- `POST /api/missions/:missionId/autopilot/stop` — Manually stop watching
- `POST /api/missions/:missionId/autopilot/start` — Manually start watching (programmatic access)
- `POST /api/missions/:missionId/autopilot/stop` — Manually stop watching (programmatic access)
## Workflow Steps