Add strict team owner validation and team listing to plans CLI
Problem
Require task and initiative owners to resolve to a known person or role under tasks/team, with clear errors for unknown owners. Add team-focused CLI commands to list valid people/roles and show owner mappings so operators can discover allowed values instead of guessing slugs. Keep creation/update flows ergonomic and document the canonical owner model.
Context
Owner field in task/initiative frontmatter accepted any string without validation. Team members and roles are defined in tasks/team/ and tasks/team/roles/ as markdown files with YAML frontmatter. No CLI existed to discover valid owner values.
Possible Solutions
Recommended: Collect valid owners from file stems of tasks/team/*.md (excluding index) and tasks/team/roles/*.md (excluding index). Validate owner at write time (create/update) and at validate time. Add team list and team show CLI commands for discoverability.
Plan
- Add
_collect_valid_owners()→ frozenset of valid owner slugs - Add
_validate_owner()that calls_collect_valid_owners()and raisesSystemExiton mismatch - Wire validation into
task_create,task_update,initiative_create,initiative_update,task_validate - Add
team_list()andteam_show()functions + parser entries - Tests for all new behavior
Implementation Progress
- Added
_collect_valid_owners(): scanstasks/team/*.mdandtasks/team/roles/*.mdstems (excluding index) - Added
_validate_owner(): raisesSystemExitwith helpful message listing valid owners - Wired into all 5 write/validate paths:
task_create,task_update,initiative_create,initiative_update,task_validate - Added
team listcommand with--peopleand--rolesfilters - Added
team show --slug <slug>command showing frontmatter details for person or role - 15 new tests covering owner validation and team commands; all 57 tests pass
QA Exploration
- [x] N/A — CLI-only changes, no UI
Review Feedback
- [ ] Review cleared