Apply GH-DEC-2026-021: identity-value pins, prose citations not reached.
The playbook detector is the estate reference (021 §3). Add its one addition to the reference and the checker: any v?N.N in a standard: or companion: value is a pin. The prose-citation note moves from pending to not reached (021 §1, A12 r3), and intent_version is noted as a key that must not be flagged. VALIDATED_AGAINST keeps accepted v0.7 and adds GH-DEC-2026-021 at gate-house@39d9287. 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
0f9ada0b0d
commit
39791526a0
3 changed files with 61 additions and 21 deletions
|
|
@ -58,12 +58,13 @@ DECL = ROOT / "layer.yaml"
|
|||
|
||||
VALID_SHAPES = {"5.1", "5.2", "5.3"}
|
||||
|
||||
# What every run checks against, printed on every run (GH-DEC-2026-020 §4, A12 r2).
|
||||
# The accepted text is v0.7 at net-kingdom@66dc491; the amendments that already
|
||||
# govern through their decision records are named with it.
|
||||
# What every run checks against, printed on every run (GH-DEC-2026-020 §4,
|
||||
# GH-DEC-2026-021 §2). The accepted text is v0.7 at net-kingdom@66dc491; the
|
||||
# decision records whose rulings this checker enforces beyond v0.7 are named with it.
|
||||
VALIDATED_AGAINST = (
|
||||
"net-kingdom/canon/standards/security-layer-model_v0.7.md (net-kingdom@66dc491) "
|
||||
"as amended by GH-DEC-2026-017 and GH-DEC-2026-020 (A9-A13, A12 r2; gate-house@d8c82a8)"
|
||||
"as amended by GH-DEC-2026-017, GH-DEC-2026-020 and GH-DEC-2026-021 "
|
||||
"(A9-A13, A12 r3; gate-house@39d9287)"
|
||||
)
|
||||
# What every run ranges over. pep-stance.yaml is deliberately outside it.
|
||||
SCOPE = "INTENT.md frontmatter, layer.yaml, src/warden/**/*.py"
|
||||
|
|
@ -72,12 +73,18 @@ SCOPE = "INTENT.md frontmatter, layer.yaml, src/warden/**/*.py"
|
|||
# declaration. Keys: anything naming a standard/companion version. Values: a
|
||||
# versioned file name or path (`_v0.7`, `-v0.8.md`) or a bare version string on a
|
||||
# version-named key. `schema_version` is the file's own schema, not reached.
|
||||
# GH-DEC-2026-021 §1/§3 (A12 r3): a version is reached only as a pin. Any version
|
||||
# token (`v?N.N`) in the value of an identity-bearing key (`standard:`,
|
||||
# `companion:`) is a pin; a revision cited in other prose is provenance and is not
|
||||
# reached. Keys such as `intent_version` name neither and are not flagged.
|
||||
VERSION_KEY = re.compile(r"(standard|companion).*version|version.*(standard|companion)", re.I)
|
||||
VERSION_IN_VALUE = re.compile(r"[_\-.]v\d+(\.\d+)*(\.md)?\b|@v?\d+\.\d+", re.I)
|
||||
NOT_REACHED_KEYS = {"schema_version"}
|
||||
IDENTITY_KEYS = {"standard", "companion"}
|
||||
IDENTITY_VERSION = re.compile(r"\bv?\d+\.\d+", re.I)
|
||||
|
||||
|
||||
def find_version_pins(node, where: str = "") -> list[str]:
|
||||
def find_version_pins(node, where: str = "", identity: bool = False) -> list[str]:
|
||||
"""Every place in a parsed declaration that carries a standard/companion version.
|
||||
|
||||
Walks every key and value (comments are gone after parsing, which is the
|
||||
|
|
@ -92,12 +99,14 @@ def find_version_pins(node, where: str = "") -> list[str]:
|
|||
if VERSION_KEY.search(str(k)):
|
||||
pins.append(f"{here} (key names a standard/companion version)")
|
||||
continue
|
||||
pins.extend(find_version_pins(v, here))
|
||||
pins.extend(find_version_pins(v, here, str(k).lower() in IDENTITY_KEYS))
|
||||
elif isinstance(node, list):
|
||||
for i, v in enumerate(node):
|
||||
pins.extend(find_version_pins(v, f"{where}[{i}]"))
|
||||
pins.extend(find_version_pins(v, f"{where}[{i}]", identity))
|
||||
elif isinstance(node, str) and VERSION_IN_VALUE.search(node):
|
||||
pins.append(f"{where} = {node!r} (value carries a version)")
|
||||
elif isinstance(node, str) and identity and IDENTITY_VERSION.search(node):
|
||||
pins.append(f"{where} = {node!r} (identity-bearing value carries a version)")
|
||||
return pins
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue