get2knowio / get2knowio/maverick
feat: validate 'created' date format in flight-plan validator (V6b)
- Dominant language
- Python
- Stars
- 4
- Forks
- 0
- Avg merge
- 17h 37m
- Merged PRs (30d)
- 7
Description
## Context
The V6 validation rule in `src/maverick/flight/validator.py` only checks that the `created` field is _present_ in the frontmatter. The spec acceptance scenario 3 explicitly lists "invalid `created` date format" as something the validator should report, but the current implementation accepts any non-None value (e.g., `created: not-a-date`).
## Expected behaviour (per spec)
A flight plan with `created: not-a-date` or `created: 2024/01/99` should produce a `ValidationIssue` identifying the invalid date format.
## Suggested fix
Add a V6b check after the V6 presence check:
```python
import datetime
if created_val is not None:
# V6b: created must be a valid date
if not isinstance(created_val, datetime.date):
# YAML auto-parses ISO dates (2024-01-15) to datetime.date.
# Non-date strings stay as str — flag them.
issues.append(ValidationIssue(
rule="V6b",
location="frontmatter",
message="'created' must be a valid ISO date (YYYY-MM-DD)",
))
```
Also add a corresponding unit test in `tests/unit/flight/test_validator.py` and a test in `tests/unit/cli/commands/flight_plan/test_validate_cmd.py`.
## Origin
Flagged during spec compliance review of branch `040-flight-plan-cli` (severity LOW).
Contributor guide
Research direction
Start in src/maverick/flight/validator.py by reading the V6 frontmatter validation, then review the related tests in tests/unit/flight/test_validator.py and tests/unit/cli/commands/flight_plan/test_validate_cmd.py. Run those test files first; done means invalid created values produce the specified V6b issue while valid dates remain accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100