feat: auto-create Integration phase for multi-leaf initiatives
When an initiative has multiple end phases (leaf nodes with no dependents), queueAllPhases now auto-creates an Integration phase that depends on all of them. This catches cross-phase incompatibilities (type mismatches, conflicting exports, broken tests) before review.
This commit is contained in:
@@ -93,6 +93,18 @@ InitiativeChangesRequestedEvent { initiativeId, phaseId, taskId }
|
||||
4. **Auto-queue tasks** — When phase starts (branches confirmed), pending execution tasks are queued (planning-category tasks excluded)
|
||||
5. **Events** — `phase:queued`, `phase:started`, `phase:completed`, `phase:blocked`
|
||||
|
||||
### Auto-Integration Phase
|
||||
|
||||
When `queueAllPhases` is called (i.e. the user clicks "Execute"), it auto-creates an **Integration** phase if the initiative has multiple end phases (leaf nodes with no dependents). This catches cross-phase incompatibilities before the initiative reaches review.
|
||||
|
||||
- **Trigger**: `queueAllPhases` in `apps/server/trpc/routers/phase-dispatch.ts`
|
||||
- **Guard**: Only created when `endPhaseIds.length > 1` and no existing "Integration" phase
|
||||
- **Status**: Created as `approved` (same pattern as Finalization in orchestrator.ts)
|
||||
- **Dependencies**: Integration depends on all end phases — dispatched last
|
||||
- **Task**: A single `verify` category task instructs the agent to build, run tests, check types, and review cross-phase imports
|
||||
- **Idempotency**: Name-based check prevents duplicates on re-execution
|
||||
- **Coexistence**: Independent of the Finalization phase (different purpose, different trigger)
|
||||
|
||||
### PhaseDispatchManager Methods
|
||||
|
||||
| Method | Purpose |
|
||||
|
||||
Reference in New Issue
Block a user