ID:WORK-128Status:donePriority:highComplexity:simpleSource:SPEC-037
Add source, milestone, and complexity validation to plan validate
The validate command has blind spots: source attribute references to non-existent specs/decisions go undetected, milestone references to non-existent milestones pass silently, and complexity values aren't checked at all. These gaps let broken references and invalid data persist.
Acceptance Criteria
validateresolves each comma-separated ID insourceagainst the entity index and reports broken references as errorsvalidatechecks thatmilestonevalues match an existing milestone entityvalidatechecks complexity values against the valid set (trivial,simple,moderate,complex,unknown)- Broken source references report the referencing entity ID and the missing target ID
- Tests for source validation, milestone validation, and complexity validation
Dependencies
- Fix plan schema bugs: pending status, severity mismatch, tag filtering — schema bug fixes should land first (especially the severity/complexity alignment)
References
- Plan Package Hardening — Plan Package Hardening (Part 2: Validation Gaps)
Resolution
Completed: 2026-04-12
Branch: claude/spec-037-breakdown-docs-Whj40
What was done
- Added checkSourceRefs(): validates comma-separated source IDs against entity index
- Added checkMilestoneRefs(): validates milestone values against existing milestones
- Complexity validation already handled by WORK-127
- 5 new tests for source/milestone validation
Relationships
History
- a295513statusready→done
- ☑ `validate` resolves each comma-separated ID in `source` against the entity index and reports broken references as errors
- ☑ `validate` checks that `milestone` values match an existing milestone entity
- ☑ `validate` checks complexity values against the valid set (`trivial`, `simple`, `moderate`, `complex`, `unknown`)
- +2 more criteria
- 1676387Created (ready, high, simple, SPEC-037, plan, cli, validation)