MAS-WP-0005-T07: v0.2 draft bundle; mas_core accepts v0.1 and v0.2 statutes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 252470@bnt-lap001
Assistant-Session: ad628c8f-4be2-4979-94c9-76c7ed6f8241
This commit is contained in:
tegwick 2026-10-18 22:19:34 +02:00
parent 3709fbb54b
commit a12e1c4370
17 changed files with 1814 additions and 20 deletions

View file

@ -87,3 +87,26 @@ def test_intake_for_lint():
assert "intake-unknown-type" not in _with_address({"kind": "function", "intake_for": "ticket"})
assert _with_address({"kind": "function", "intake_for": "invoice"})["intake-unknown-type"] == ERROR
assert _with_address({"kind": "group", "intake_for": "ticket"})["intake-not-function"] == ERROR
def _v02(**extra):
doc = statute_document("valid-great-service.json")
doc["mas_version"] = "0.2"
doc.update(extra)
return doc
def test_v02_statute_builds_with_new_fields():
doc = _v02(alternate_syntax={"resource": True, "interaction": True})
doc["equivalence"]["resource_id_case"] = "insensitive"
st = build_statute(doc, "great-service.example")
assert (st.mas_version, st.alt_resource, st.alt_interaction, st.resource_id_case) == \
("0.2", True, True, "insensitive")
plain = build_statute(_v02(), "great-service.example")
assert (plain.alt_resource, plain.alt_interaction, plain.resource_id_case) == (False, False, "exact")
def test_v01_statute_rejects_v02_fields():
doc = statute_document("valid-great-service.json")
doc["alternate_syntax"] = {"resource": True}
assert any(f.severity == ERROR and f.layer == "schema" for f in lint(doc, "great-service.example"))