diff --git a/docs/authoritative/instruction-package-contract.md b/docs/authoritative/instruction-package-contract.md index fc9c106..678827f 100644 --- a/docs/authoritative/instruction-package-contract.md +++ b/docs/authoritative/instruction-package-contract.md @@ -74,8 +74,8 @@ metadata: makes the package manual-only. Every key other than `metadata` is written `key: value` with a non-empty value. `metadata:` stands alone on its line, followed by exactly those two keys, each indented two spaces. The block has no -blank or comment lines. Any other key, such as `tools` or `allowed-tools`, -fails the check. +blank or comment lines, and its lines end in LF, not CRLF. Any other key, such +as `tools` or `allowed-tools`, fails the check. ## Identity and archive @@ -87,10 +87,10 @@ by Unicode code point, the UTF-8 path and the file bytes. The release archive is an uncompressed ZIP containing the repository `LICENSE` and `NOTICE.md`, then every package file under `/`, sorted segment by segment (so `a/b.md` precedes `a-b/c.md`, unlike the -whole-string order the identity uses). Every entry carries the timestamp 1980-01-01 00:00:00 and -mode `0644`. ZIP headers also record the creating system, so release -digests are computed on a POSIX host, as this repository's CI does; on such a -host the archive digest depends only on those bytes. +whole-string order the identity uses). Every entry carries the timestamp +1980-01-01 00:00:00 and mode `0644`. ZIP headers also record the creating +system, so release digests are computed on a POSIX host, as this repository's +CI does; on such a host the archive digest depends only on those bytes. RelayView's `scripts/verify-first-party-skills-source.py` recomputes both values from a tagged release and compares them with its diff --git a/tests/test_role_steps.py b/tests/test_role_steps.py index e0d7135..fd4cbbc 100644 --- a/tests/test_role_steps.py +++ b/tests/test_role_steps.py @@ -240,6 +240,7 @@ class RoleStepRejectionTests(unittest.TestCase): def test_rejects_unsafe_or_undeclared_content(self): cases = ( ("BOM", lambda copy: copy.write_file("SKILL.md", b"\xef\xbb\xbf" + (copy.path / "SKILL.md").read_bytes()), "invalid text"), + ("CRLF frontmatter", lambda copy: copy.write_file("SKILL.md", (copy.path / "SKILL.md").read_bytes().replace(b"\n", b"\r\n")), "incompatible skill metadata"), ("NUL", lambda copy: copy.write_file("notes.md", "a\x00b\n"), "invalid text"), ("invalid UTF-8", lambda copy: copy.write_file("notes.md", b"\xff\xfe\n"), "invalid UTF-8"), ("empty resource", lambda copy: copy.write_file("notes.md", b""), "text bounds"), diff --git a/tools/packages.py b/tools/packages.py index a795780..6b37d7f 100644 --- a/tools/packages.py +++ b/tools/packages.py @@ -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: