Skip to main content

phase_verification_exists

Function phase_verification_exists 

Source
pub fn phase_verification_exists(evidence_root: &Path, phase: PhaseId) -> bool
Expand description

Whether /gsd-verify-work has produced a {phase:02}-VERIFICATION.md artifact for phase yet.

Per D-01 (33-CONTEXT.md), this is the sole mid-arc-vs-genuine-gaps signal a Validate→Code loop-back consults: a phase with no verification artifact is still mid-arc (its remaining plans have not been judged at all), so a loop-back must re-run the phase in full rather than dispatch --gaps-only, which matches zero plans and gates unresolvably. Mirrors [phase_review_path]’s directory-prefix-scan idiom exactly, but returns a bool — no caller needs the artifact’s path, only whether it exists. A missing .planning/phases directory returns false rather than panicking.

evidence_root is the root the Validate agent actually wrote to — the phase’s worktree when state.worktree_path is set, else the project root. .planning/ is tracked, so in worktree mode the artifact lands on feature/phase-N and is invisible from the main checkout for the phase’s entire in-flight duration. Passing the project root in worktree mode is exactly the defect this parameter name exists to prevent (33-CONTEXT.md CR-01); it is NOT interchangeable with the root used for git reads such as phase_commit_count, whose refs and object database are shared across worktrees and which therefore correctly takes the project root.