From ddf95ded041c9689a4b7204fc0946cf571f7b77b Mon Sep 17 00:00:00 2001 From: Kyle Merritt Date: Wed, 25 Nov 2026 18:56:09 -0500 Subject: [PATCH] State every enforced frontmatter and layout rule in the contract Add the frontmatter placement, two-space indent, no blank or comment lines, and real-directory rules; move the example's comment out of its value line so the example passes; name the code-point sort; and note that archive digests depend on a POSIX build host. Split the frontmatter line check into a named condition. Refs #20 Co-Authored-By: Claude Opus 5.5 --- .../instruction-package-contract.md | 25 ++++++++++++------- tools/packages.py | 3 ++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/authoritative/instruction-package-contract.md b/docs/authoritative/instruction-package-contract.md index 50cf276..fc9c106 100644 --- a/docs/authoritative/instruction-package-contract.md +++ b/docs/authoritative/instruction-package-contract.md @@ -48,6 +48,8 @@ lower-case 64-hex SHA-256 digests. Any additional field — such as `tools`, - Every file in the directory except the sidecar is declared, and every declared file is present with exactly its declared SHA-256. +- The package directory is a real directory, not a symbolic link, and the + sidecar is a regular file. - No symbolic links, executable bits, or non-regular files; at most 64 entries (files and directories), and no relative path longer than 8 segments including the file name. @@ -56,34 +58,39 @@ lower-case 64-hex SHA-256 digests. Any additional field — such as `tools`, ## `SKILL.md` frontmatter -The frontmatter allows only these keys, each at most once: +`SKILL.md` opens with a frontmatter block between `---` lines. The block +allows only these keys, each at most once: ```yaml name: description: -disable-model-invocation: true # optional; true or false; true makes the package manual-only +disable-model-invocation: true metadata: relayview-display-name: relayview-version: ``` -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 -indented keys. Any other key, such as `tools` or `allowed-tools`, fails the -check. +`disable-model-invocation` is optional and is exactly `true` or `false`; `true` +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. ## Identity and archive The package identity is the SHA-256 of `relayview-instruction-package-v1\0` followed by length-framed parts (a 4-byte big-endian length, then the bytes): -the raw sidecar bytes, then for each declared path, sorted as whole strings, -the UTF-8 path and the file bytes. +the raw sidecar bytes, then for each declared path, sorted as whole strings +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`, so the archive digest depends only on those bytes. +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/tools/packages.py b/tools/packages.py index f02a205..a795780 100644 --- a/tools/packages.py +++ b/tools/packages.py @@ -144,7 +144,8 @@ def check_package(path): top_keys.append(key) in_metadata = key == "metadata" # metadata stands alone; every other key carries an inline value. - if (line != "metadata:") if in_metadata else not re.fullmatch(r"[a-z-]+: .+", line): + valid_line = line == "metadata:" if in_metadata else re.fullmatch(r"[a-z-]+: .+", line) + if not valid_line: _fail(f"{path}: unsupported skill metadata") else: _fail(f"{path}: unsupported skill metadata")