From 832b07b248244575b9cc0aea9d41148a53b1c7d0 Mon Sep 17 00:00:00 2001 From: Oleks Date: Thu, 30 Jul 2026 23:27:11 +0300 Subject: [PATCH 1/2] tests: make the worktree-discipline remote-resolution test hermetic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kotkan/claude-plugin-inference-arbitrage#30 reported "FAIL repo = kotkan/worktree-discipline (want kotkan/claude-plugin-worktree-discipline)". Investigation found no stale reference in this repo's source or fixtures — the expected value already matches the live repo (verified: only kotkan/claude-plugin-worktree-discipline exists on Gitea; the pre-rename bare-name slug is a redirect only). The failure came entirely from the live git remote of the sibling ../worktree-discipline checkout on disk, which is outside this repo and outside version control, so it can drift independently (e.g. an old clone never repointed after the 2026-07-22 kotkan rename). That also meant the assertion silently never ran in CI, since the bare CI container has no sibling checkout and the test just printed "skip". Replace the dependency on that external checkout with a throwaway git repo created inside the test's own tmpdir, with its remote set explicitly to the current repo slug. Same code path (resolve_repo/parse_remote in bin/filing-plan) is exercised deterministically, and the assertion now always runs instead of skipping outside a workspace with that sibling checkout present. Verified the new test both passes against the correct remote and correctly reproduces the exact original failure signature when pointed at the stale pre-rename slug. --- tests/filing.test.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/filing.test.sh b/tests/filing.test.sh index 1eaa1e6..27f9396 100755 --- a/tests/filing.test.sh +++ b/tests/filing.test.sh @@ -201,15 +201,28 @@ else fi echo "== a writable target resolves through its own checkout's remote ==" -if [ -d ../worktree-discipline/.git ]; then - $BIN queries --classified "$tmp/cls.json" --judgments "$JUD" \ - --target-path ../worktree-discipline >"$tmp/wd-q.json" - check "repo" "$(q "$tmp/wd-q.json" "d['repo']")" "kotkan/claude-plugin-worktree-discipline" - check "filing" "$(q "$tmp/wd-q.json" "d['filing']")" "available" - check "label scan is the authoritative query" \ - "$(q "$tmp/wd-q.json" "d['queries']['label_scan']['labels']")" "['token-offload']" -else - echo " skip (no sibling worktree-discipline checkout)" -fi +# Was: read the live remote of a sibling ../worktree-discipline checkout on +# disk. That checkout is outside this repo and outside version control, so +# its remote can drift independently of anything here — e.g. a stale clone +# still pointing at the pre-rename slug `kotkan/worktree-discipline` instead +# of `kotkan/claude-plugin-worktree-discipline` (kotkan org repos were +# renamed to the claude-plugin- convention on 2026-07-22). That drift +# produced a false "repo" mismatch (kotkan/claude-plugin-inference-arbitrage#30) +# with nothing to fix in this repo's source or fixtures — both already agreed +# with the current live repo name. It also meant this assertion silently +# never ran in CI, since the bare CI container has no sibling checkout at all +# and the test just printed "skip". A synthetic git repo with a fixed remote +# tests the same resolve_repo()/parse_remote() code path deterministically, +# with no dependency on what else happens to be checked out next door. +wd_git="$tmp/wd-fixture" +mkdir -p "$wd_git" +git -C "$wd_git" init -q +git -C "$wd_git" remote add origin git@git.oleks.space:kotkan/claude-plugin-worktree-discipline.git +$BIN queries --classified "$tmp/cls.json" --judgments "$JUD" \ + --target-path "$wd_git" >"$tmp/wd-q.json" +check "repo" "$(q "$tmp/wd-q.json" "d['repo']")" "kotkan/claude-plugin-worktree-discipline" +check "filing" "$(q "$tmp/wd-q.json" "d['filing']")" "available" +check "label scan is the authoritative query" \ + "$(q "$tmp/wd-q.json" "d['queries']['label_scan']['labels']")" "['token-offload']" exit "$fail" -- 2.54.0 From 6901f924c15b239dda205e3701a6b90624710054 Mon Sep 17 00:00:00 2001 From: Oleks Date: Thu, 30 Jul 2026 23:32:53 +0300 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20install=20git=20=E2=80=94=20required?= =?UTF-8?q?=20by=20the=20new=20hermetic=20filing.test.sh=20fixture=20(#30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index edb3e5c..f81d81a 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -14,7 +14,9 @@ steps: - name: suites image: alpine:3 commands: - - apk add --no-cache bash python3 wget >/dev/null + # git is required by tests/filing.test.sh's hermetic worktree-discipline + # remote-resolution fixture (kotkan/claude-plugin-inference-arbitrage#30). + - apk add --no-cache bash python3 wget git >/dev/null # bin/offload-scan (design decision 0.1) deliberately never vendors # token-budget's pricing/token-accounting logic -- it imports the real # cc-tokens module and fails loudly if it's missing. This bare alpine -- 2.54.0