Create Structural Validation Script for Docs Doctrine Compliance
taskdone
Build the validation script described in docs-doctrine §10.1 that enforces all structural rules programmatically.
The script runs pre-commit and in CI. It replaces human memory with pattern-based, automated compliance checking.
Acceptance Criteria
- [ ] Write
scripts/validate-docs(Python or Node) - [ ] Check: YAML header presence on all managed files
- [ ] Check: classification correctness (derived files have source, no orphan derived)
- [ ] Check: duplicate canonical detection (two files claiming canonical for same content)
- [ ] Check: directory boundary violations (cross-domain leakage)
- [ ] Check: naming convention violations (_v2, .bak, wrong casing)
- [ ] Check: zombie file detection (unreferenced, non-canonical, non-generated)
- [ ] Exit non-zero on any violation with clear error messages
- [ ] Wire into pre-commit hooks
Source
docs/governance/docs-doctrine.md — Migration Phase 5 ("Enforce") + §10.1