Implements AGENTS.md section 7 front-matter schema as a single-file, standard-library-only Python validator; no third-party YAML dependency and no framework. Adds the `make validate` gate, a 20-case fixture set and docs/content-schema.md. DoD satisfied: - make validate runs and exits 0 on an empty/clean content/ tree (missing dir and empty dir both exit 0; fixture ok-empty covers it). - Every violation class has a fixture under test/fixtures/fail-*; each exits non-zero with one line per violation (file:line: field: rule). `make test` runs all 20 cases: 20/20 pass. - Dangling artefact reference is fatal (fail-dangling-artefact; artefacts[].url must resolve to an existing in-repo L3 stub or asset). - Unknown front-matter field is fatal (fail-unknown-field), including unknown keys nested inside artefacts[]/metrics[]. - docs/content-schema.md committed; states the frozen schema, links to AGENTS.md section 7, and records that any later schema change is a breaking change requiring Sam's approval. - Scope respected: no content authored, no rendering, no site code. Files: Makefile, tools/validate_content.py, test/fixtures/**, docs/content-schema.md, .gitignore (__pycache__).
20 lines
483 B
Makefile
20 lines
483 B
Makefile
# Ai Resume - build entry points.
|
|
#
|
|
# `make validate` is the single gate: it is what CI and deploy.sh call.
|
|
# It exits 0 only on a clean content tree.
|
|
|
|
PYTHON ?= python3
|
|
VALIDATOR := $(PYTHON) tools/validate_content.py
|
|
|
|
.PHONY: validate test help
|
|
|
|
help:
|
|
@echo "make validate validate content/** front-matter against the frozen schema"
|
|
@echo "make test run the validator self-test (fixtures under test/fixtures/)"
|
|
|
|
validate:
|
|
@$(VALIDATOR)
|
|
|
|
test:
|
|
@$(VALIDATOR) --self-test
|