Repository navigation
feat: parent-delegated consultation mode for porch - #623
timeleft-- wants to merge 3 commits into
Conversation
When af-config.json has porch.consultation: "parent", porch emits scoped phase-review gates instead of consult commands. The builder blocks, the parent session reviews and approves. - config.ts: loadConsultationMode() reads from af-config.json - next.ts: gate-intercept in handleBuildVerify() + gate check in next() - index.ts: porch status shows CONSULTATION mode when configured - config.test.ts: 8 new tests for loadConsultationMode All 225 porch tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address GPT 5.3 Codex review findings: - Scope phase-review gate check to current phase/planPhase/iteration instead of scanning all phase-review-* keys (prevents stale gate deadlocks after rollback) - Improve handleVerifyApproved messaging for empty reviews (parent mode says "Approved via parent-delegated phase-review gate") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
loadConsultationMode() used findConfigRoot() which is from the artifact resolver feature (not yet upstream). Since af-config.json is symlinked into builder worktrees, we can resolve it directly from workspaceRoot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hey — thanks for this work! Just a heads up: PR #624 (merged as part of the v3.0.0-rc.8 config overhaul) added pluggable consultation models to porch, including a Could you take a look and let us know whether #624 already covers what this PR was doing, or if there's still functionality here that's additive? The main things I'd want to compare are the gate naming convention and the rollback-safety logic. Also note that |
|
Closing — v3.0.0 (PR #624) implemented pluggable consultation models including parent-delegated mode via porch.consultation.models: 'parent'. This PR's functionality is fully covered by the new architecture. |
Summary
Adds a new consultation mode to porch that delegates phase reviews to the parent session instead of spawning cold-start
consultAPI calls.porch.consultationis set to"parent"inaf-config.json, porch emitsphase-review-*gates at phase boundaries instead of runningconsultcommandsporch approve"default"mode (standard consult commands) when config is missing or invalidCloses #614
Changes
config.ts: NewloadConsultationMode()function readsporch.consultationfromaf-config.jsonnext.ts: Gate-intercept logic inhandleBuildVerify()— emitsphase-review-{phase}-{planPhase}-iter{N}gates;next()checks for pending phase-review gates before advancingindex.ts: ShowsCONSULTATION: parentinporch statusoutputconfig.test.ts: 8 unit tests forloadConsultationMode()Configuration
{ "porch": { "consultation": "parent" } }Gate format
Example:
phase-review-implement-phase_1-iter1Dogfooding
This feature has been dogfooded extensively on the MachineWisdomAI fork:
Test plan
loadConsultationMode()returns"parent"when configured,"default"otherwise (8 unit tests)porch statusdisplays consultation mode🤖 Generated with Claude Code