pi-flow v2: user-defined flows with per-stage model and HITL/AFK orchestration - #9
Merged
Conversation
ADR-0001 records making flows user-authored data run by one generic engine; CONTEXT.md glossary updated (Flow, Stage, Mode, Model). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…AFK modes
Replaces the three hardcoded pipelines with user-defined flows read from the top-level pi-flow key in settings.json, merged over three built-in flows. Each stage is { skill, model?, mode? }: omitting model keeps the current model, mode defaults to HITL. AFK stages auto-advance on agent_end (guarded by a generic anti-signal check) so an all-AFK flow traverses unattended; HITL stages wait for /pi-flow:next.
Adds run/next/skip/retry/cancel/status/show, run-start model validation, failure halts, and session restore with unknown-flow clearing. Removes pipelines.ts, the per-flow commands, setup, and the per-skill completion detector.
Implements #2, #3, #4, #5, #6, #7, #8 (parent #1). 55 tests via the pure-function and fake-ExtensionAPI seams.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Documents user-defined flows, the pi-flow settings.json schema, built-ins, modes, and the new command set; removes the old pipeline and design/code model-pair docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the pi-flow v2 redesign from #1: the three hardcoded pipelines become user-defined flows — an ordered list of skills, each with its own model and a HITL/AFK mode — read from a top-level
pi-flowkey insettings.jsonand merged over three built-in flows.Highlights
resolveFlowsvalidates and defaults user config (mode→HITL,model→no-switch) and overlays it onBUILTIN_FLOWS. See ADR-0001.agent_end(guarded by a generic anti-signal check) — an all-AFK flow traverses unattended; HITL stages wait for/pi-flow:next.run(with flow-name autocomplete),next,skip,retry,cancel,status,show.pipelines.ts, the per-flow commands,setup, thedesign/codemodel binary, and the per-skill completion detector.Tests
55 passing (
vitest run), through the two seams the PRD specified — pure functions (flows,detector) and a fakeExtensionAPI/ExtensionContext(pi-flow.test.ts).Caveats
readUserFlows(thesettings.jsonfs adapter) is the one untested boundary — deliberately thin, below the seam.agent_end/ skill invocation is the manual integration check).2.0.0bump at release (handled by the tag-driven workflow).Closes #2
Closes #3
Closes #4
Closes #5
Closes #6
Closes #7
Closes #8
🤖 Generated with Claude Code