Validate Tester and Coordinator role/step pairs
Check instruction packages / check (push) Successful in 4s
Check instruction packages / check (pull_request) Successful in 8s

Accept tester/testing and coordinator/coordination under schemas 1 and 3,
reject a JSON boolean schemaVersion and an inline metadata frontmatter value,
and cover the new pairs with valid fixtures plus single-mutation rejections.
The tests mirror RelayView's identity and archive computation and pin the
identity framing. Document the full instruction package contract and the
RelayView sidecar changes required before pinning v0.15.0 and v0.17.0.

Refs #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-11-25 18:50:23 -05:00
1 parent c103def91b
commit 8c7d967efd
17 files changed
+553 -8

No files matched your search

+25 -7
View File
@@ -10,6 +10,25 @@ import zipfile
from pathlib import Path
# Each role guides exactly one workflow step. RelayView's owner admits a pair
# only once its own sidecar contract lists it; see
# docs/authoritative/instruction-package-contract.md.
ROLE_STEPS = {
"planner": "planning",
"implementer": "implementation",
"reviewer": "review",
"designer": "design",
"tester": "testing",
"coordinator": "coordination",
}
MANIFEST_FIELDS = {
1: {"schemaVersion", "source", "role", "step", "files"},
2: {"schemaVersion", "source", "role", "step", "files", "issueClaim"},
3: {"schemaVersion", "source", "role", "step", "files", "treatment"},
}
class PackageError(ValueError):
pass
@@ -44,19 +63,16 @@ def check_package(path):
manifest = json.loads(_text(raw_manifest, str(sidecar)))
except (ValueError, TypeError) as error:
_fail(f"{sidecar}: invalid JSON: {error}")
if not isinstance(manifest, dict) or (
(manifest.get("schemaVersion") == 1 and set(manifest) != {"schemaVersion", "source", "role", "step", "files"}) or
(manifest.get("schemaVersion") == 2 and set(manifest) != {"schemaVersion", "source", "role", "step", "files", "issueClaim"}) or
(manifest.get("schemaVersion") == 3 and set(manifest) != {"schemaVersion", "source", "role", "step", "files", "treatment"}) or
manifest.get("schemaVersion") not in (1, 2, 3)
):
version = manifest.get("schemaVersion") if isinstance(manifest, dict) else None
# type() rather than isinstance(): JSON true must not pass as schema 1.
if type(version) is not int or version not in MANIFEST_FIELDS or set(manifest) != MANIFEST_FIELDS[version]:
_fail(f"{path}: unsupported manifest fields")
source = manifest["source"]
if not isinstance(source, dict) or set(source) != {"kind", "reference"}:
_fail(f"{path}: invalid source")
if source["kind"] not in ("first-party", "user") or not isinstance(source["reference"], str) or not re.fullmatch(r"[A-Za-z0-9._:-]{1,128}", source["reference"]):
_fail(f"{path}: invalid source identity")
if (manifest["role"], manifest["step"]) not in (("planner", "planning"), ("implementer", "implementation"), ("reviewer", "review"), ("designer", "design")):
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:
claim = manifest["issueClaim"]
@@ -127,6 +143,8 @@ def check_package(path):
key = line.split(":", 1)[0]
top_keys.append(key)
in_metadata = key == "metadata"
if in_metadata and line != "metadata:":
_fail(f"{path}: unsupported skill metadata")
else:
_fail(f"{path}: unsupported skill metadata")
if len(top_keys) != len(set(top_keys)) or set(top_keys) - {"name", "description", "metadata", "disable-model-invocation"} or len(nested_keys) != len(set(nested_keys)) or set(nested_keys) != {"relayview-display-name", "relayview-version"}: