From 856ccc6613ae2fa8cf7f689ca486f4f4a974eb72 Mon Sep 17 00:00:00 2001 From: tegwick Date: Mon, 21 Sep 2026 07:34:00 +0200 Subject: [PATCH] Apply GH-DEC-2026-017 to audit-core's layer declaration. Remove standard_version from layer.yaml and INTENT.md frontmatter (A12), mark layer.yaml derived from INTENT.md (A11), and add tests asserting the derived markers, the absence of a standard version, and agreement of the two forms after an ASCII case fold over the closed four-token vocabulary (A9). Layer values are left as spelled: INTENT.md Engine, layer.yaml engine. Co-Authored-By: Claude Opus 5 Assistant: claude-code Assistant-Model: opus Assistant-Process: 63291@bnt-lap001 Assistant-Session: 8bd77868-ca68-4f49-bb1e-d539ecc0d703 --- INTENT.md | 1 - layer.yaml | 5 ++++- tests/test_layer_conformance.py | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/INTENT.md b/INTENT.md index dabdc46..5cbd922 100644 --- a/INTENT.md +++ b/INTENT.md @@ -5,7 +5,6 @@ layer: Engine role: Evidence standard: canon/standards/security-layer-model_v0.7.md -standard_version: "0.7" declared_by: intakes/intakes.md AUDIT-IN-0001 declared_at: "2026-08-29" --- diff --git a/layer.yaml b/layer.yaml index 4655c89..f5cbaa7 100644 --- a/layer.yaml +++ b/layer.yaml @@ -12,7 +12,10 @@ schema_version: "0.1" framework: netkingdom-security-layer-model -standard_version: "0.7" +# GH-DEC-2026-017 / amendment A11: INTENT.md frontmatter governs; this file is +# its derived machine-readable form. A12: no standard version in a declaration. +derived: true +derived_from: INTENT.md repository: audit-core layer: engine role: evidence # §3.3 engine typing diff --git a/tests/test_layer_conformance.py b/tests/test_layer_conformance.py index 54b8540..931a5ab 100644 --- a/tests/test_layer_conformance.py +++ b/tests/test_layer_conformance.py @@ -146,3 +146,38 @@ def test_the_declared_freshness_window_matches_the_contract(): assert surface["window_hours"] == 168 contract = (ROOT / surface["contract"]).read_text() assert "168 hours" in contract + + +# GH-DEC-2026-017 (amendments A9, A11, A12): INTENT.md governs, layer.yaml is +# derived from it, the §3 vocabulary is closed at four tokens compared after an +# ASCII case fold, and a declaration carries no standard version. +VOCABULARY = {"taxonomy", "tooling", "engine", "staff"} + + +def _intent_frontmatter() -> dict: + text = (ROOT / "INTENT.md").read_text() + assert text.startswith("---\n"), "INTENT.md must carry frontmatter" + return yaml.safe_load(text.split("---\n", 2)[1]) + + +def _fold(value: str) -> str: + return value.encode("ascii").lower().decode("ascii") + + +def test_layer_yaml_is_marked_derived_from_intent(): + assert LAYER["derived"] is True + assert LAYER["derived_from"] == "INTENT.md" + + +def test_the_two_forms_agree_after_folding_and_nobody_re_spells(): + intent_layer = _intent_frontmatter()["layer"] + assert _fold(intent_layer) in VOCABULARY + assert _fold(LAYER["layer"]) in VOCABULARY + # Assert the fold, not equality: a casing difference is conforming, a + # layer divergence that survives folding is a finding and must fail. + assert _fold(intent_layer) == _fold(LAYER["layer"]) + + +def test_no_standard_version_in_either_form(): + assert "standard_version" not in LAYER + assert "standard_version" not in _intent_frontmatter()