Document the LF frontmatter rule and pin it with a test
The checker already rejects CRLF frontmatter; the contract now says so and a fixture mutation keeps that statement honest. Use the parsed schema version for the schema 2 and 3 checks, and rewrap the contract. Refs #20 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddf95ded04
commit
f872770dc9
3 files changed
+9
-8
No files matched your search
+2
-2
@@ -74,14 +74,14 @@ def check_package(path):
|
||||
_fail(f"{path}: invalid source identity")
|
||||
if not isinstance(manifest["role"], str) or ROLE_STEPS.get(manifest["role"]) != manifest["step"]:
|
||||
_fail(f"{path}: incompatible role or step")
|
||||
if manifest["schemaVersion"] == 2:
|
||||
if version == 2:
|
||||
claim = manifest["issueClaim"]
|
||||
label = claim.get("statusLabel") if isinstance(claim, dict) else None
|
||||
if (manifest["role"], manifest["step"]) != ("planner", "planning") or not isinstance(claim, dict) or set(claim) != {"statusLabel"} or (
|
||||
label is not None and (not isinstance(label, str) or not re.fullmatch(r"status/[a-z][a-z0-9-]{0,63}", label) or label == "status/ready-for-agent")
|
||||
):
|
||||
_fail(f"{path}: invalid issue claim policy")
|
||||
if manifest["schemaVersion"] == 3 and (manifest["treatment"] != "communication_context" or manifest["role"] == "designer"):
|
||||
if version == 3 and (manifest["treatment"] != "communication_context" or manifest["role"] == "designer"):
|
||||
_fail(f"{path}: invalid communication treatment")
|
||||
files = manifest["files"]
|
||||
if not isinstance(files, list) or not 1 <= len(files) <= 16:
|
||||
|
||||
Reference in new issue
Block a user