Validation: JSON Schemas + validator (the discipline, enforced)

The README claimed 'validated by JSON Schema' — now it is true.

/schemas holds a JSON Schema for each entity type (Person, Body,
Candidate, Jurisdiction): a stricter profile over OKF's permissive
base, tolerating unknown keys by design.

scripts/validate.py checks all 17,506 files with no third-party deps
(hand-rolled frontmatter parser + minimal schema engine):
  1. OKF conformance — every file has frontmatter with a non-empty type
  2. Schema conformance — required fields, property types, enums
  3. Link integrity — internal /-rooted links resolve

Non-zero exit on failure, so it is a CI gate. Verified with a negative
test: it catches bad enums and dead links. All 17,506 files pass today.

Makefile ties it together: make build / validate / check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Fabio
2026-07-03 23:43:56 -04:00
parent 5b0712c31f
commit aefa65f5b3
6 changed files with 304 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
# Republic OS — repeatable pipeline commands.
# The build is deterministic: `make build` twice yields a byte-identical tree.
.PHONY: build validate check
build: ## Regenerate the entity tree from raw exports in data/
python3 scripts/build.py
validate: ## Check every entity file: OKF, schema, and link integrity
python3 scripts/validate.py
check: build validate ## Build, then validate — the full gate