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 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 63291@bnt-lap001
Assistant-Session: 8bd77868-ca68-4f49-bb1e-d539ecc0d703
This commit is contained in:
tegwick 2026-09-21 09:36:53 +02:00
parent 2488be84db
commit b5cc6706b9
2 changed files with 47 additions and 7 deletions

View file

@ -1,8 +1,7 @@
--- ---
layer: Staff layer: Staff
role: null role: null
standard: net-kingdom/canon/standards/security-layer-model_v0.7.md standard: net-kingdom/canon/standards/security-layer-model
standard_version: "0.7"
companion: net-kingdom/SECURITY-COMPANION.md companion: net-kingdom/SECURITY-COMPANION.md
declared_at: "2026-09-01" declared_at: "2026-09-01"
conformance_state: blocked-clean conformance_state: blocked-clean

View file

@ -1,12 +1,53 @@
import re
from pathlib import Path 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(): def test_intent_declares_staff_in_own_voice():
text = Path("INTENT.md").read_text(encoding="utf-8") text, frontmatter = _frontmatter()
assert text.startswith("---\n") layers = [v for k, v in _entries(frontmatter) if k == "layer"]
frontmatter = text.split("---\n", 2)[1] # ASCII case-fold before comparing; nobody re-spells (GH-DEC-2026-017 §2).
assert "layer: Staff" in frontmatter assert [v.casefold() for v in layers] == ["staff"]
assert 'standard_version: "0.7"' in frontmatter
assert "conformance_state: blocked-clean" in frontmatter assert "conformance_state: blocked-clean" in frontmatter
assert "gate-house insert that used to sit here is" in text assert "gate-house insert that used to sit here is" in text
assert "does not author our probes" 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