diff --git a/scripts/repin-ci-workflows.sh b/scripts/repin-ci-workflows.sh index fdab47e3c66..dc3a156a9fc 100755 --- a/scripts/repin-ci-workflows.sh +++ b/scripts/repin-ci-workflows.sh @@ -6,6 +6,7 @@ shopt -s inherit_errexit UPSTREAM=melodic-software/ci-workflows # The standards sync owns this file's pin. MANAGED=.github/workflows/pr-check-managed-files-hosted.yml +FORMAL_MODELS='.claude/skills/formal-*/model/**' DOC=docs/conventions/pr-pipeline/pr-run-activity.md SHA_RE='^[0-9a-f]{40}$' TAG_RE='^v[0-9]+\.[0-9]+\.[0-9]+$' @@ -96,7 +97,7 @@ apply() { done <<<"$files" rm -f "$rewritten" - left="$(git -C "$root" grep -l "$old" -- . ":(exclude)${MANAGED}" || true)" + left="$(git -C "$root" grep -l "$old" -- . ":(exclude)${MANAGED}" ":(exclude,glob)${FORMAL_MODELS}" || true)" [[ -z "$left" ]] || die "${old} still appears after the rewrite in: $(tr '\n' ' ' <<<"$left")" outside="$(git -C "$root" status --porcelain | cut -c4- | grep -vxF "$files" || true)" [[ -z "$outside" ]] || die "paths outside the re-pin set changed: $(tr '\n' ' ' <<<"$outside")" diff --git a/scripts/repin-ci-workflows.test.sh b/scripts/repin-ci-workflows.test.sh index 36dfd445270..5260a0b135a 100755 --- a/scripts/repin-ci-workflows.test.sh +++ b/scripts/repin-ci-workflows.test.sh @@ -155,4 +155,21 @@ git_test_config "$scratch/left" commit -qm notes run 1 'apply fails when the old SHA remains outside the set' apply "$OLD" v0.74.0 "$NEW" v0.75.0 --root "$scratch/left" contains 'the failure names the file' 'still appears after the rewrite in: tests/notes.md' +mk_repo "$scratch/model" +mkdir -p "$scratch/model/.claude/skills/formal-lanes/model" +echo "\\* checked against ${OLD}" >"$scratch/model/.claude/skills/formal-lanes/model/Lanes.tla" +git_test_config "$scratch/model" add .claude +git_test_config "$scratch/model" commit -qm model +run 0 'apply leaves a formal model citing the old SHA' apply "$OLD" v0.74.0 "$NEW" v0.75.0 --root "$scratch/model" +LAST_OUTPUT="$(cat "$scratch/model/.claude/skills/formal-lanes/model/Lanes.tla")" +contains 'the model keeps its checked commit' "$OLD" + +mk_repo "$scratch/skilldoc" +mkdir -p "$scratch/skilldoc/.claude/skills/formal-lanes" +echo "pinned at ${OLD}" >"$scratch/skilldoc/.claude/skills/formal-lanes/SKILL.md" +git_test_config "$scratch/skilldoc" add .claude +git_test_config "$scratch/skilldoc" commit -qm skilldoc +run 1 'apply still fails on a formal skill file outside its model' apply "$OLD" v0.74.0 "$NEW" v0.75.0 --root "$scratch/skilldoc" +contains 'the failure names the skill file' 'still appears after the rewrite in: .claude/skills/formal-lanes/SKILL.md' + test_harness::report