You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
porch approve plan-approval fails with 'Plan not found' when plan is in builder worktree #676
porch approve NNN plan-approval fails with "Plan not found" when run from the main workspace root. The plan file exists in the builder's worktree (.builders/<spir-NNN-slug>/codev/plans/NNN-slug.md), but the plan_exists check looks in cwd/codev/plans/ instead of the resolved project's worktree.
Repro Steps
afx spawn NNN --protocol spir
Builder writes plan to .builders/spir-NNN-slug/codev/plans/NNN-slug.md
Architect runs porch approve NNN plan-approval --a-human-explicitly-approved-this from repo root
Porch prints "CHECKS FAILED. Cannot approve gate." with "Plan not found"
But state.yaml in the worktree sometimes flips to approved anyway
Observed On
At least 3 projects (568, 615, 629) on the Shannon workspace. Behavior is inconsistent — sometimes approval silently goes through, sometimes it doesn't take effect until retry.
Root Cause
The plan_exists check (and likely spec_exists) resolves file paths relative to cwd rather than the project's resolved worktree. porch status NNN correctly resolves the worktree (via findStatusPath which was fixed in PR #674 to search .builders/ first), but the artifact existence checks don't use the same resolution logic.
Additionally, the approve command appears to write the state update BEFORE consulting the check result — so the gate flips to approved even when the check fails. This should be audited: either run checks before the write, or roll back on failure.
Expected Behavior
plan_exists (and any other path-based checks) should resolve the project's worktree from the project ID — same logic porch status uses — and check for the plan file in <worktree>/codev/plans/ instead of cwd/codev/plans/.
Impact
Architects give up on porch CLI for plan approvals and edit status.yaml by hand, which defeats the point of porch.
Activity
waleedkadous commentedon Apr 17, 2026
On it! Working on a fix now.
[Bugfix #676] Scope porch check artifact resolution to the worktree
Merge pull request #679 from cluesmith/builder/bugfix-676-porch-appro…