T-D -- Validator: one rule per E_/W_/I_ code #69
No reviewers
Labels
No labels
in-progress
in-review
ready-for-agent
seam-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
patrick/Polaris!69
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/validator-rules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Adds the plan validator: the independent check that re-derives whether a draft plan is actually feasible, separately from whatever the solver believed when it built it. Every rule from the validator table in the design docs is now a small, independently-testable function that looks only at the plan snapshot and the proposed result — shift overtime, double-booked crews or vehicles, missing skills, sites that aren't suitable for the job, jobs outside their allowed dates, windows the plan doesn't actually fit in, and a handful of informational flags like idle crews or a fallback travel matrix.
20 of the 27 documented rules are covered here; the other 7 are either explicitly owned by a later ticket (triage, scoring, locks, diffing) or, in one case, can't be checked yet because the plan data doesn't carry what's needed — flagged as a follow-up rather than guessed at.
Related Issues
Closes #19 (T-D). Docs:
docs/04-lifecycles.mdvalidator table.Type of Change
Breaking Changes
None.
Test Plan
Every rule has its own hand-built bad plan that trips only that rule, plus one good plan that passes everything clean — 23 tests, all green, alongside the existing check that keeps the validator from ever depending on the solver.
Checklist
docs/updated for any behavioural changepolaris.domainAdditional Context
Two judgment calls worth a reviewer's eyes: the two vehicle-overlap rules read almost identically in the docs, so this PR splits them on whether the overlapping visits are at the same site or different ones; and the "including return travel" clause on one shift-length rule isn't checkable with the data the engine currently hands back, so only the outbound half is enforced for now.
🤖 Generated with Claude Code
https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM