Apply GH-DEC-2026-017: INTENT.md governs, the sidecar is derived, no version
- Remove standard_version from layer.yaml and INTENT.md frontmatter (§5, A12). - Mark layer.yaml derived: true, derived_from: INTENT.md (§1, A11). - Checker and tests change in the same commit: standard_version is no longer a required key (it is now rejected in either form), the derived marking is required, both layer values are checked against the closed four-token vocabulary, and the two forms are compared after an ASCII case fold (A9). A disagreement surviving the fold is reported as a finding. - Nothing re-spelled: INTENT.md keeps "Engine", layer.yaml keeps "engine". Scope check (§9.5 / GH-DEC-2026-017 §4): maturity-engine does not score layer declarations anywhere. scoring.py grades gap-register conformance states, and seed gaps concern capabilities, not §11 declarations, so no non-§4 repository is graded. No scoring change required. 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
d1c72d10aa
commit
30236955c6
4 changed files with 121 additions and 23 deletions
|
|
@ -15,6 +15,16 @@ DECL = ROOT / "layer.yaml"
|
|||
INTENT = ROOT / "INTENT.md"
|
||||
|
||||
|
||||
def _fold(value: object) -> str:
|
||||
return str(value).strip().encode("ascii", "ignore").decode().lower()
|
||||
|
||||
|
||||
def _intent_frontmatter() -> dict:
|
||||
match = re.match(r"^---\n(.*?)\n---\n", INTENT.read_text(), re.DOTALL)
|
||||
assert match
|
||||
return yaml.safe_load(match.group(1))
|
||||
|
||||
|
||||
def _run(*args: str) -> subprocess.CompletedProcess[str]:
|
||||
return subprocess.run(
|
||||
[sys.executable, str(SCRIPT), *args],
|
||||
|
|
@ -27,21 +37,42 @@ def test_declaration_exists_and_declares_engine_pip():
|
|||
assert DECL.exists()
|
||||
data = yaml.safe_load(DECL.read_text())
|
||||
assert data["repository"] == "maturity-engine"
|
||||
assert data["layer"] == "engine"
|
||||
assert data["role"] == "pip"
|
||||
assert _fold(data["layer"]) == "engine"
|
||||
assert _fold(data["role"]) == "pip"
|
||||
assert data["framework"] == "netkingdom-security-layer-model"
|
||||
assert data["standard_version"] == "0.7"
|
||||
assert "pep_stance" not in data or not data.get("pep_stance")
|
||||
|
||||
|
||||
def test_frontmatter_agrees_with_layer_yaml():
|
||||
text = INTENT.read_text()
|
||||
match = re.match(r"^---\n(.*?)\n---\n", text, re.DOTALL)
|
||||
assert match
|
||||
meta = yaml.safe_load(match.group(1))
|
||||
def test_intent_md_carries_the_governing_layer_key():
|
||||
"""GH-DEC-2026-017 §1: the INTENT.md frontmatter key is the declaration."""
|
||||
assert _fold(_intent_frontmatter()["layer"]) == "engine"
|
||||
|
||||
|
||||
def test_sidecar_is_marked_derived_and_names_its_source():
|
||||
data = yaml.safe_load(DECL.read_text())
|
||||
assert str(meta["layer"]).lower() == str(data["layer"]).lower()
|
||||
assert str(meta["role"]).lower() == str(data["role"]).lower()
|
||||
assert data["derived"] is True
|
||||
assert data["derived_from"] == "INTENT.md"
|
||||
|
||||
|
||||
def test_frontmatter_agrees_with_layer_yaml_once_case_is_folded():
|
||||
"""A11 agreement, A9 fold. Deliberately a fold, not an equality: an
|
||||
equality would silently demand the re-spelling the ruling declined."""
|
||||
meta = _intent_frontmatter()
|
||||
data = yaml.safe_load(DECL.read_text())
|
||||
assert _fold(meta["layer"]) == _fold(data["layer"])
|
||||
assert _fold(meta["role"]) == _fold(data["role"])
|
||||
|
||||
|
||||
def test_both_layer_values_are_in_the_closed_vocabulary():
|
||||
vocabulary = {"taxonomy", "tooling", "engine", "staff"}
|
||||
assert _fold(_intent_frontmatter()["layer"]) in vocabulary
|
||||
assert _fold(yaml.safe_load(DECL.read_text())["layer"]) in vocabulary
|
||||
|
||||
|
||||
def test_no_declaration_carries_a_standard_version():
|
||||
"""GH-DEC-2026-017 §5 / A12."""
|
||||
assert "standard_version" not in yaml.safe_load(DECL.read_text())
|
||||
assert "standard_version" not in _intent_frontmatter()
|
||||
|
||||
|
||||
def test_no_tooling_contacts_or_pep():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue