From b5cc6706b95a7e639a89429aee1a4f4a4ead405f Mon Sep 17 00:00:00 2001 From: tegwick Date: Mon, 21 Sep 2026 09:36:53 +0200 Subject: [PATCH] Apply GH-DEC-2026-017 and GH-DEC-2026-020 to the layer declaration. This repository never received GH-DEC-2026-017 (gate-house's gap, recorded in GH-DEC-2026-020), so both rulings land here together. - INTENT.md frontmatter: remove standard_version: "0.7" (017 section 5) and de-version the standard: path to net-kingdom/canon/standards/ security-layer-model (020 section 1). layer: Staff is unchanged and INTENT.md remains the declaration (017 section 1); no layer.yaml added. - tests/test_layer_declaration.py: stop asserting the old standard_version; case-fold the layer comparison (017 section 2); fail if any frontmatter key or value carries a standard or companion version, including a versioned standard: path or companion_version (020 sections 1-2); comments are not reached. Known-bad forms are exercised. conformance_state is left untouched pending gate-house's open question. 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 | 3 +- tests/test_layer_declaration.py | 51 +++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/INTENT.md b/INTENT.md index 1e44891..6fbd468 100644 --- a/INTENT.md +++ b/INTENT.md @@ -1,8 +1,7 @@ --- layer: Staff role: null -standard: net-kingdom/canon/standards/security-layer-model_v0.7.md -standard_version: "0.7" +standard: net-kingdom/canon/standards/security-layer-model companion: net-kingdom/SECURITY-COMPANION.md declared_at: "2026-09-01" conformance_state: blocked-clean diff --git a/tests/test_layer_declaration.py b/tests/test_layer_declaration.py index 0475f42..c0dd53f 100644 --- a/tests/test_layer_declaration.py +++ b/tests/test_layer_declaration.py @@ -1,12 +1,53 @@ +import re from pathlib import Path +# A version of the standard or its companion, anywhere in a key or value: +# `_v0.7`, `v0.8`, `"0.7"` and the like (GH-DEC-2026-017 §5, GH-DEC-2026-020 §1-§2). +VERSION_PATTERN = re.compile(r"(?:^|[^0-9A-Za-z])v?\d+\.\d+(?:\.\d+)?(?![0-9])", re.IGNORECASE) + + +def _frontmatter(): + text = Path("INTENT.md").read_text(encoding="utf-8") + assert text.startswith("---\n") + return text, text.split("---\n", 2)[1] + + +def _entries(frontmatter): + for line in frontmatter.splitlines(): + line = line.split(" #", 1)[0].rstrip() # comments are not reached + if not line or line.lstrip().startswith("#") or ":" not in line: + continue + key, value = line.split(":", 1) + yield key.strip(), value.strip().strip('"').strip("'") + def test_intent_declares_staff_in_own_voice(): - text = Path("INTENT.md").read_text(encoding="utf-8") - assert text.startswith("---\n") - frontmatter = text.split("---\n", 2)[1] - assert "layer: Staff" in frontmatter - assert 'standard_version: "0.7"' in frontmatter + text, frontmatter = _frontmatter() + layers = [v for k, v in _entries(frontmatter) if k == "layer"] + # ASCII case-fold before comparing; nobody re-spells (GH-DEC-2026-017 §2). + assert [v.casefold() for v in layers] == ["staff"] assert "conformance_state: blocked-clean" in frontmatter assert "gate-house insert that used to sit here is" in text assert "does not author our probes" in text + + +def test_declaration_carries_no_standard_or_companion_version(): + _, frontmatter = _frontmatter() + for key, value in _entries(frontmatter): + if key == "declared_at": + continue # a date, not a version of the standard + assert key not in {"standard_version", "companion_version"}, key + assert "version" not in key.casefold(), key + assert not VERSION_PATTERN.search(value), f"{key}: {value}" + + +def test_version_detector_catches_known_bad_forms(): + bad = [ + 'standard: net-kingdom/canon/standards/security-layer-model_v0.7.md', + 'standard_version: "0.7"', + 'companion_version: "0.2"', + 'companion: net-kingdom/SECURITY-COMPANION_v0.2.md', + ] + for line in bad: + key, value = next(_entries(line)) + assert "version" in key or VERSION_PATTERN.search(value), line