Parent
#1
What to build
Replace the hardcoded pipeline engine with user-defined flows read from settings.json. A pure resolveFlows(userFlows) turns the top-level pi-flow.flows key in settings.json into a validated flow map: each flow has a description? and an ordered stages[]; each stage resolves to { skill, model?, mode } with defaults applied — missing mode → HITL, missing model → no model switch. Invalid shapes (a flow with no stages, a stage with no skill, a mode outside HITL/AFK) are rejected with a clear message.
Add /pi-flow:run <name> [input]. Its argument autocompletes resolved flow names (name + description as autocomplete items). Running a flow creates FlowState { flowId, stageIndex: 0, phase: "running", input, startedAt }, persists it, switches to the first stage's model if one is set, sends a generic kickoff message naming the skill (stage 1's kickoff carries the input), and renders the progress widget. Starting while a flow is active is refused with a "cancel first" notice; an unknown flow name errors.
This slice removes pipelines.ts, the /pi-flow:new-feature|improve-arch|debug commands, and the obsolete /pi-flow:setup (which configured the old design/code model pair). No stage advancement yet — that is the next slice.
Agreed contract:
interface FlowStage { skill: string; model?: string; mode?: "HITL" | "AFK" }
interface FlowDefinition { description?: string; stages: FlowStage[] }
// resolveFlows(userFlows) -> Record<string, FlowDefinition>, mode defaulted to "HITL"
Acceptance criteria
Blocked by
None - can start immediately
Parent
#1
What to build
Replace the hardcoded pipeline engine with user-defined flows read from
settings.json. A pureresolveFlows(userFlows)turns the top-levelpi-flow.flowskey in settings.json into a validated flow map: each flow has adescription?and an orderedstages[]; each stage resolves to{ skill, model?, mode }with defaults applied — missingmode→HITL, missingmodel→ no model switch. Invalid shapes (a flow with no stages, a stage with noskill, amodeoutsideHITL/AFK) are rejected with a clear message.Add
/pi-flow:run <name> [input]. Its argument autocompletes resolved flow names (name + description as autocomplete items). Running a flow createsFlowState { flowId, stageIndex: 0, phase: "running", input, startedAt }, persists it, switches to the first stage's model if one is set, sends a generic kickoff message naming the skill (stage 1's kickoff carries theinput), and renders the progress widget. Starting while a flow is active is refused with a "cancel first" notice; an unknown flow name errors.This slice removes
pipelines.ts, the/pi-flow:new-feature|improve-arch|debugcommands, and the obsolete/pi-flow:setup(which configured the old design/code model pair). No stage advancement yet — that is the next slice.Agreed contract:
Acceptance criteria
resolveFlowsapplies defaults (missingmode→ HITL, missingmodel→ no switch) and returns a flow map keyed by nameresolveFlowsrejects a flow with zero stages, a stage missingskill, or an invalidmode/pi-flow:run <name> "input"sets state to running at stage 0 with the given input and persists itpipelines.tsand thenew-feature/improve-arch/debug/setupcommands are removedExtensionAPIseamsBlocked by
None - can start immediately