Apply GH-DEC-2026-020: de-version the standard path and widen the checker.
INTENT.md's standard: path drops _v0.7.md; a version inside the path is a standard version under A12 r2. The conformance checker now rejects a version in any key or value of INTENT.md frontmatter and layer.yaml (standard_version, companion_version, versioned standard/companion paths), leaves schema_version and pep-stance.yaml alone, and prints VALIDATED_AGAINST and SCOPE on every run, following kings-guard. Tests fail if a versioned standard: path or companion_version returns. 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:
parent
2ac4a36bdd
commit
4a5c21d62b
3 changed files with 108 additions and 9 deletions
|
|
@ -60,6 +60,40 @@ class LayerDeclarationTests(unittest.TestCase):
|
|||
self.assertNotIn("standard_version", decl)
|
||||
self.assertNotIn("standard_version", front)
|
||||
|
||||
def test_intent_standard_path_is_unversioned(self):
|
||||
# GH-DEC-2026-020 §1: a version inside the standard: path is a
|
||||
# standard version under A12 r2; companion_version is one too (§2).
|
||||
front = load_mapping_text((ROOT / "INTENT.md").read_text().split("---", 2)[1])
|
||||
decl = load_mapping(LAYER)
|
||||
self.assertEqual(
|
||||
front["standard"], "net-kingdom/canon/standards/security-layer-model"
|
||||
)
|
||||
for mapping in (front, decl):
|
||||
self.assertNotIn("companion_version", mapping)
|
||||
module = _checker()
|
||||
self.assertEqual(module.find_versions(front, "INTENT.md"), [])
|
||||
self.assertEqual(module.find_versions(decl, "layer.yaml"), [])
|
||||
|
||||
def test_version_scan_leaves_schema_version_and_stance_alone(self):
|
||||
module = _checker()
|
||||
self.assertEqual(module.find_versions({"schema_version": "0.1"}, "x"), [])
|
||||
self.assertNotIn("pep-stance", module.SCOPE)
|
||||
# pep-stance.yaml keeps its version fields (GH-DEC-2026-020 §3).
|
||||
self.assertTrue(module.find_versions(load_mapping(STANCE_FILE), "stance"))
|
||||
|
||||
def test_every_run_prints_version_and_scope(self):
|
||||
module = _checker()
|
||||
for argv in ([], ["--report"]):
|
||||
result = subprocess.run(
|
||||
[sys.executable, str(SCRIPT), *argv],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd=ROOT,
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertIn(module.VALIDATED_AGAINST, result.stdout)
|
||||
self.assertIn(module.SCOPE, result.stdout)
|
||||
|
||||
def test_vocabulary_is_four_tokens_compared_after_fold(self):
|
||||
module = _checker()
|
||||
self.assertEqual(
|
||||
|
|
@ -74,6 +108,17 @@ class LayerDeclarationTests(unittest.TestCase):
|
|||
good = load_mapping(LAYER)
|
||||
cases = {
|
||||
"standard_version": dict(good, standard_version="0.7"),
|
||||
"companion_version": dict(good, companion_version="0.2"),
|
||||
"versioned standard path": dict(
|
||||
good,
|
||||
standard="net-kingdom/canon/standards/security-layer-model_v0.7.md",
|
||||
),
|
||||
"versioned companion path": dict(
|
||||
good, companion="net-kingdom/SECURITY-COMPANION.md v0.2"
|
||||
),
|
||||
"nested version key": dict(
|
||||
good, catalog_entry=dict(good["catalog_entry"], standard_version="0.8")
|
||||
),
|
||||
"not derived": dict(good, derived=False),
|
||||
"divergent layer": dict(good, layer="staff"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue