Parent: #126
What
Each phase invocation gets a fresh PhasePayload built by a factory function. No shared mutation between phases. Factory takes orchestrator state + previous phase output and produces a minimal, scoped context.
function buildPhasePayload(
state: OrchestratorState,
previousOutput: PhaseOutcome,
materials: PromptMaterial[],
): PhasePayload
Scope
Estimate
~100 lines. Medium risk — depends on #131 and #132 landing clean.
Depends on
#131 (split context), #132 (dispatch loop).
Parent: #126
What
Each phase invocation gets a fresh
PhasePayloadbuilt by a factory function. No shared mutation between phases. Factory takes orchestrator state + previous phase output and produces a minimal, scoped context.Scope
packages/pipeline/src/pipeline/context.ts—buildPhasePayloadfactoryEstimate
~100 lines. Medium risk — depends on #131 and #132 landing clean.
Depends on
#131 (split context), #132 (dispatch loop).