fix(tests): pin test-check-rtk-prefix.sh's pre-#113 corpus to a fixed SHA
The "pre-#113 corpus on main trips the gate" case reconstructed the historical (pre-sweep) corpus from the live `main` ref. `main` is the moving integration branch, and the #113 fix (ed8c99e) landed back onto it — so the moment that fix merged, `main` stopped containing the bare `git remote get-url origin` drift the case exists to catch, and the assertion "the gate should fail on this corpus" silently flipped to false. This blocked `git push` on every branch via the run-tests pre-push hook, unrelated to whatever was actually being pushed. Pin to598a7c3, the last commit beforeed8c99ewhere gitea-issues/SKILL.md still had the unprefixed call. A specific commit SHA is immutable, unlike `main`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PDj6F7SPXzh3FtPN78dZ88
This commit is contained in:
@@ -4,9 +4,16 @@ set -euo pipefail
|
||||
# Tests for scripts/check-rtk-prefix.sh — ADR-0023 clause 1.
|
||||
#
|
||||
# Case 1 is the one that earns the rest: it runs the gate against the corpus as
|
||||
# it stood on `main` BEFORE the #113 sweep, and asserts it fails there. A gate
|
||||
# that only passes on the already-fixed tree proves nothing about whether it
|
||||
# would have caught the drift it was written for.
|
||||
# it stood BEFORE the #113 sweep, and asserts it fails there. A gate that only
|
||||
# passes on the already-fixed tree proves nothing about whether it would have
|
||||
# caught the drift it was written for.
|
||||
#
|
||||
# Pinned to a commit SHA, not the `main` ref: `main` is the moving integration
|
||||
# branch, and the #113 fix (ed8c99e) landed back on it, so querying live
|
||||
# `main` for the "pre-sweep" corpus stopped reproducing the drift the moment
|
||||
# that fix merged — the case silently started asserting the opposite of what
|
||||
# it says. 598a7c3 is the last commit where gitea-issues/SKILL.md still had
|
||||
# the bare `git remote get-url origin` call ed8c99e fixed.
|
||||
#
|
||||
# Everything after that is synthetic. The false-NEGATIVE cases (a bare command
|
||||
# the gate must catch) and the false-POSITIVE cases (correct content the gate
|
||||
@@ -48,12 +55,15 @@ expect() {
|
||||
fi
|
||||
}
|
||||
|
||||
echo "--- the pre-#113 corpus on main trips the gate ---"
|
||||
echo "--- the pre-#113 corpus trips the gate ---"
|
||||
|
||||
# Derived from git, not hardcoded: the point is "the drift this gate exists for",
|
||||
# and a hardcoded path list goes stale the moment a file is renamed.
|
||||
if ! git -C "$REPO_ROOT" rev-parse --verify -q main >/dev/null; then
|
||||
echo "SKIP: no local 'main' ref — the historical-corpus case cannot be reconstructed"
|
||||
# The commit set is derived from git, not hardcoded, at this fixed SHA: the
|
||||
# point is "the drift this gate exists for", and a hardcoded path list goes
|
||||
# stale the moment a file is renamed. The SHA itself is deliberately hardcoded
|
||||
# — see the header comment for why it must NOT be a moving ref like `main`.
|
||||
PRE_SWEEP_REF="598a7c326a4bbfa4a39007eb95d944c4150686e8"
|
||||
if ! git -C "$REPO_ROOT" rev-parse --verify -q "$PRE_SWEEP_REF" >/dev/null; then
|
||||
echo "SKIP: pre-sweep commit $PRE_SWEEP_REF not reachable locally (shallow clone?) — the historical-corpus case cannot be reconstructed"
|
||||
exit 77
|
||||
fi
|
||||
|
||||
@@ -67,16 +77,16 @@ while IFS= read -r PRE_REL; do
|
||||
PRE_FILES+=("$PRE_REL")
|
||||
PRE_PATHS+=("$PRE/$PRE_REL")
|
||||
done < <(
|
||||
git -C "$REPO_ROOT" ls-tree -r --name-only main -- 'plugins' \
|
||||
git -C "$REPO_ROOT" ls-tree -r --name-only "$PRE_SWEEP_REF" -- 'plugins' \
|
||||
| grep -E '^plugins/[^/]+/\.apm/(skills/.*\.md|agents/.*\.agent\.md)$' \
|
||||
| grep -v '/README\.md$'
|
||||
)
|
||||
if [[ ${#PRE_FILES[@]} -eq 0 ]]; then
|
||||
fail "no plugin skill/agent files found on main — the historical case checked nothing"
|
||||
fail "no plugin skill/agent files found at $PRE_SWEEP_REF — the historical case checked nothing"
|
||||
else
|
||||
for f in ${PRE_FILES[@]+"${PRE_FILES[@]}"}; do
|
||||
mkdir -p "$PRE/$(dirname "$f")"
|
||||
git -C "$REPO_ROOT" show "main:$f" > "$PRE/$f"
|
||||
git -C "$REPO_ROOT" show "$PRE_SWEEP_REF:$f" > "$PRE/$f"
|
||||
done
|
||||
if bash "$SCRIPT" ${PRE_PATHS[@]+"${PRE_PATHS[@]}"} > "$RUN_TMP/pre.out" 2>&1; then
|
||||
fail "the pre-sweep corpus passed — the gate would not have caught the #113 drift"
|
||||
|
||||
Reference in New Issue
Block a user