refactor(gates): rename the rtk-prefix opt-out marker to rtk-bare:

check-rtk-prefix now exempts a deliberately bare git command only when
the line carries `rtk-bare: <reason>`. The old literal `ADR-0023` is no
longer accepted: plugin content is consumed by other repos and must not
cite this repo's ADRs. The test pins the new marker and adds a case
showing the old string no longer exempts a line. gates.md and an
ADR-0023 addendum record the rename.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-06 18:16:08 +00:00
1 parent b5bb0314d1
commit 435ea59e93
5 files changed
+43 -25

No files matched your search

+9 -5
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
# Tests for scripts/check-rtk-prefix.sh — ADR-0023 clause 1.
# Tests for scripts/check-rtk-prefix.sh — clause 1 of the rtk-prefix rule (ADR-0023).
#
# Case 1 is the one that earns the rest: it runs the gate against the corpus as
# it stood BEFORE the #113 sweep, and asserts it fails there. A gate that only
@@ -91,7 +91,7 @@ else
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"
else
hits="$(grep -c '^ADR-0023: ' "$RUN_TMP/pre.out" || true)"
hits="$(grep -c '^check-rtk-prefix: ' "$RUN_TMP/pre.out" || true)"
if [[ "$hits" -lt 20 ]]; then
fail "the pre-sweep corpus produced only $hits findings — too few to be the known drift"
elif ! grep -q 'gitea-issues/SKILL.md.*git remote get-url origin' "$RUN_TMP/pre.out"; then
@@ -135,8 +135,12 @@ rtk git push
```' "prefixed commands"
expect clean '```bash
git stash list # rtk-bare: rtk prints "No stashes" where git prints nothing
```' "a bare command carrying the rtk-bare: opt-out marker"
expect dirty '```bash
git stash list # bare per ADR-0023: rtk prints "No stashes" where git prints nothing
```' "a bare command carrying the ADR-0023 opt-out marker"
```' "the retired ADR-0023 marker no longer exempts a bare command"
expect clean '```text
git worktree list --porcelain -z
@@ -167,7 +171,7 @@ expect clean '| Operation | Run |
expect clean '| Operation | Run |
|---|---|
| List | `git worktree list -v` — bare per ADR-0023 |' \
| List | `git worktree list -v` — rtk-bare: the output is parsed |' \
"a bare Run cell carrying the opt-out marker"
# The clause-2 shapes that made an every-span check unusable. Both are real rows
@@ -225,7 +229,7 @@ if [[ ${#LIVE[@]} -eq 0 ]]; then
elif (cd "$REPO_ROOT" && bash "$SCRIPT" ${LIVE[@]+"${LIVE[@]}"} > "$RUN_TMP/live.out" 2>&1); then
pass "the ${#LIVE[@]} in-scope corpus files pass"
else
fail "the live corpus has ADR-0023 clause-1 violations"
fail "the live corpus has clause-1 violations"
sed 's/^/ /' "$RUN_TMP/live.out"
fi