Story
As a maintainer trusting Bob's Dev Notes,
I want validation to confirm every references and target_surface path in the plan resolves in the checkout, flagging hallucinated anchors,
so that stories can't ship citing files that don't exist, so dev-lead never chases a phantom path.
Acceptance Criteria
- A grounding check (in validate-plan.py or a sibling script invoked alongside it) strips any
#anchor suffix and verifies each references/target_surface entry that looks like a repo path resolves against the repo root.
- A path that does not resolve fails the check with a message naming the story id and the missing path, exiting non-zero (consistent with validate-plan.py's fail() contract).
- Entries that are clearly not file paths (a bare
discussion #593, a URL) are not treated as paths and do not cause false failures; the heuristic is documented in code.
- The repo root is resolved explicitly (e.g.
git rev-parse --show-toplevel or the script location), not from the current working directory.
- Existing fixtures (which cite real paths) still pass; a new bats case adds a story citing a nonexistent path and asserts the failure.
Tasks / Subtasks
Dev Notes
- references/target_surface are free-form strings in plan.schema.json; the schema example uses
scripts/engine.sh#tier-routing (with anchor) and the fixture uses scripts/engine.sh. Split on the first # for the file-existence test.
- validate-plan.py runs in the workflow checkout (.github/workflows/initiative-planner.yml:147-156 runs it after gather-context with the repo checked out), so relative paths resolve against the repo root — establish that root explicitly rather than relying on cwd.
- Document the heuristic for path vs prose: e.g. only enforce entries containing
/ or ending in a known extension, and skip anything starting with http/discussion/# — see open_questions.
- Keep it a HARD validation failure consistent with validate-plan.py's fail() at validate-plan.py:23-27, so the workflow stops before apply-plan runs.
- Testing: extend tests/test_initiative_planner.bats with a fabricated-path fixture variant; the suite already drives validate-plan.py directly.
Project Structure Notes
Fits cleanly into validate-plan.py (the existing semantic-gate home) or a sibling invoked from the same workflow step. Prefer extending validate-plan.py to keep one validation entry point.
References
- scripts/initiative-planner/validate-plan.py#L23-L70
- scripts/initiative-planner/plan.schema.json
- .github/workflows/initiative-planner.yml#L147-L156
- tests/test_initiative_planner.bats
Likely target surface
scripts/initiative-planner/validate-plan.py
tests/test_initiative_planner.bats
Story prepared by the BMAD Scrum Master (Bob) for epic #597. Status: ready-for-dev.
Story
As a maintainer trusting Bob's Dev Notes,
I want validation to confirm every
referencesandtarget_surfacepath in the plan resolves in the checkout, flagging hallucinated anchors,so that stories can't ship citing files that don't exist, so dev-lead never chases a phantom path.
Acceptance Criteria
#anchorsuffix and verifies eachreferences/target_surfaceentry that looks like a repo path resolves against the repo root.discussion #593, a URL) are not treated as paths and do not cause false failures; the heuristic is documented in code.git rev-parse --show-toplevelor the script location), not from the current working directory.Tasks / Subtasks
#anchorbefore testing existence. (AC: test issue from agent #1, Optimize review: small-PR and incremental fast paths #4)Dev Notes
scripts/engine.sh#tier-routing(with anchor) and the fixture usesscripts/engine.sh. Split on the first#for the file-existence test./or ending in a known extension, and skip anything starting withhttp/discussion/#— see open_questions.Project Structure Notes
Fits cleanly into validate-plan.py (the existing semantic-gate home) or a sibling invoked from the same workflow step. Prefer extending validate-plan.py to keep one validation entry point.
References
Likely target surface
scripts/initiative-planner/validate-plan.pytests/test_initiative_planner.batsStory prepared by the BMAD Scrum Master (Bob) for epic #597. Status: ready-for-dev.