test: enforce skill version lockstep

This commit is contained in:
Ahmed Mohammed
2026-08-09 16:45:37 +03:00
parent 88aeb7a339
commit cccdb15481
2 changed files with 21 additions and 2 deletions
+11 -2
View File
@@ -76,16 +76,25 @@ module names — see `test/relay/index.mjs`) skips the rest of the matrix.
A changed relay also wants a direct run — `--help` plus a read-only or no-write run against a
throwaway repo. The full pre-publish list is in [AGENTS.md](AGENTS.md).
Before changing completion detection or `touchedFiles`, read the relevant skill's result contract.
Exercise clean, pre-dirty, same-dirty-path, dirty-submodule, and git-unavailable worktrees, and assert
the exact `delegate-relay.result.v1` fields instead of generic success or failure.
## Shared relay helpers
Shared relay helpers are byte-identical by CI contract. Edit one relay, run
`node test/relay-parity.mjs`, then paste its helper into the copies the test names.
Shared relay helpers are byte-identical by contract. Before making them identical, inspect every
divergent sibling and carry the strongest behavior forward, including bounds and timeouts. Then run
`node test/relay-parity.mjs` and `node test/relay-smoke.mjs`.
## Review
One maintainer reviews these and reads the relay line by line. Expect questions about anything the
verification line claims.
Automated reviewers such as CodeRabbit, Codex, and Greptile are advisory. If one is unavailable,
rate-limited, or silent, record that and continue; do not wait or retry. Required project gates plus
maintainer review determine readiness.
Where two pull requests cover the same implementer, this checklist decides — the one that satisfies
more of it merges. Ties break on verification evidence, then on the earlier claim. The other pull
request's distinct improvements get pulled in and credited by number in the commit that lands them.
+10
View File
@@ -35,6 +35,16 @@ export function runPackageShape(h) {
h.check(`${dir}: listed in skills.sh.json`, registered.has(dir));
h.check(`${dir}: in the utility carve-out`, onDiskUtility.includes(dir));
}
const metadataVersions = [...onDiskDelegate, ...onDiskUtility].map((dir) => {
const skillFile = join(skillsDir, dir, "SKILL.md");
return existsSync(skillFile)
? readFileSync(skillFile, "utf8").match(/^metadata:\r?\n version:\s*(\S+)\s*$/m)?.[1] ?? "(missing)"
: "(missing)";
});
h.check(
"all skill metadata.version values are present and in lockstep",
!metadataVersions.includes("(missing)") && new Set(metadataVersions).size === 1,
);
h.check("smoke matrix has no entry without a directory", h.SKILLS.every((s) => onDiskDelegate.includes(`${s}-delegate`)));
h.check(
"skills.sh.json has no entry without a directory",