---
phase: 14-parallel-phase-execution
plan: 05
type: execute
wave: 3
depends_on: ["14-01"]
files_modified:
- src/trpc/context.ts
- src/trpc/router.ts
autonomous: true
---
Add tRPC procedures for phase dependencies and dispatch.
Purpose: Expose phase dependency and dispatch operations via API.
Output: tRPC procedures for creating dependencies and managing phase queue.
@~/.claude/get-shit-done/workflows/execute-plan.md
@~/.claude/get-shit-done/templates/summary.md
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/14-parallel-phase-execution/14-01-SUMMARY.md
# Reference implementations:
@src/trpc/router.ts
@src/trpc/context.ts
Task 1: Add PhaseDispatchManager to tRPC context
src/trpc/context.ts
Add optional phaseDispatchManager to AppContext:
- phaseDispatchManager?: PhaseDispatchManager
Import PhaseDispatchManager from dispatch module.
Follow same pattern as agentManager (optional, undefined by default).
npx tsc --noEmit passes
PhaseDispatchManager available in tRPC context
Task 2: Add phase dependency and dispatch procedures
src/trpc/router.ts
Add procedures under existing phase group:
createPhaseDependency:
- input: { phaseId: string, dependsOnPhaseId: string }
- validates both phases exist
- calls phaseRepository.createDependency()
- returns { success: true }
getPhaseDependencies:
- input: { phaseId: string }
- returns { dependencies: string[] } from phaseRepository.getDependencies()
Add new phase dispatch procedures:
queuePhase:
- input: { phaseId: string }
- requires phaseDispatchManager
- calls phaseDispatchManager.queuePhase()
- returns { success: true }
dispatchNextPhase:
- no input
- requires phaseDispatchManager
- calls phaseDispatchManager.dispatchNextPhase()
- returns PhaseDispatchResult
getPhaseQueueState:
- no input
- requires phaseDispatchManager
- returns queue state
Follow existing router patterns for error handling and input validation.
npx tsc --noEmit passes
Phase dependency and dispatch procedures available via tRPC
Before declaring plan complete:
- [ ] `npm run build` succeeds without errors
- [ ] `npm test` passes all tests
- [ ] New procedures type-check correctly
- All tasks completed
- All verification checks pass
- Procedures follow existing naming conventions
- Error handling consistent with other procedures