WORK-128
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

  • 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)
  • Broken source references report the referencing entity ID and the missing target ID
  • Tests for source validation, milestone validation, and complexity validation

Dependencies

References

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

  1. a295513
    statusreadydone
    • ☑ `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
  2. 1676387
    Created (ready, high, simple, SPEC-037, plan, cli, validation)