Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a070b5-4994-7271-bd8b-7c3dbcedec4b
28 lines
1.5 KiB
Python
28 lines
1.5 KiB
Python
import re
|
|
|
|
from info_tech_canon.generation import concept_ownership
|
|
from info_tech_canon.service import load_context
|
|
|
|
|
|
def test_shared_evidence_has_one_retrievable_owner():
|
|
context = load_context()
|
|
concepts = concept_ownership(context)["concepts"]
|
|
for name in ["Evidence", "Evidence Source", "Adjudication Outcome", "Evidence strength"]:
|
|
assert {item["owner"] for item in concepts if item["concept"] == name} == {"model/evidence"}
|
|
artifacts = {item.id: item for item in context.infospace.artifacts}
|
|
assert "model/evidence" in artifacts
|
|
assert "model/evidence" in (context.infospace_root / "artifacts/index.yaml").read_text()
|
|
|
|
|
|
def test_live_governance_ownership_lists_do_not_reclaim_evidence():
|
|
root = load_context().infospace_root
|
|
for path in [*(root / "models").rglob("*.md"), *(root / "standards").rglob("*.md")]:
|
|
text = path.read_text()
|
|
for clause in re.findall(r"Governance owns([^.\n]*)", text, re.I):
|
|
owned_clause = re.split(r"\band imports\b", clause, flags=re.I)[0]
|
|
assert not re.search(r"\bevidence\b", owned_clause, re.I), str(path)
|
|
for block in re.findall(r"(?:The )?Governance Model owns[^\n]*:\n\n```[^\n]*\n(.*?)```", text, re.S):
|
|
assert "Evidence" not in block.splitlines(), str(path)
|
|
gov = (root / "models/governance/InfoTechCanonGovernanceModel.md").read_text()
|
|
assert "**Evidence** is" not in gov
|
|
assert "itc-evid:Evidence (assertion drawn_from itc-evid:Evidence Source)" in gov
|