Phase 1a: content schema validator (freeze the schema)
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__).
This commit is contained in:
1
test/fixtures/fail-level-enum/content/assets/audio-rack.svg
vendored
Normal file
1
test/fixtures/fail-level-enum/content/assets/audio-rack.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"/>
|
||||
|
After Width: | Height: | Size: 65 B |
21
test/fixtures/fail-level-enum/content/edge/audio.md
vendored
Normal file
21
test/fixtures/fail-level-enum/content/edge/audio.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
id: audio
|
||||
area: edge
|
||||
level: 4
|
||||
title: "Distributed Audio"
|
||||
claim: "Eight synchronised endpoints with music ducking for voice."
|
||||
confidence: running
|
||||
period: "2023-"
|
||||
tech: [Snapcast, Mopidy, Spotify]
|
||||
metrics: [{label: "endpoints", value: 8}]
|
||||
artefacts:
|
||||
- type: doc
|
||||
label: "Architecture note"
|
||||
url: "content/edge/l3/audio-architecture.md"
|
||||
- {type: image, label: "Rack diagram", url: "content/assets/audio-rack.svg"}
|
||||
public: true
|
||||
last_verified: 2026-10-20
|
||||
tags: [audio, snapcast]
|
||||
---
|
||||
|
||||
# Distributed Audio
|
||||
17
test/fixtures/fail-level-enum/content/edge/l3/audio-architecture.md
vendored
Normal file
17
test/fixtures/fail-level-enum/content/edge/l3/audio-architecture.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: audio-architecture
|
||||
area: edge
|
||||
level: 3
|
||||
title: "Audio architecture note"
|
||||
claim: "How the eight endpoints stay in sync."
|
||||
confidence: running
|
||||
period: "2023-"
|
||||
tech: []
|
||||
metrics: []
|
||||
artefacts: []
|
||||
public: true
|
||||
last_verified: 2026-10-20
|
||||
tags: [audio]
|
||||
---
|
||||
|
||||
# Audio architecture note
|
||||
1
test/fixtures/fail-level-enum/expect.txt
vendored
Normal file
1
test/fixtures/fail-level-enum/expect.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
level: must be the integer 1, 2 or 3
|
||||
Reference in New Issue
Block a user