4 Commits

Author SHA1 Message Date
admin 83a74363c3 Merge pull request 'tests: make the worktree-discipline remote-resolution test hermetic (kotkan/claude-plugin-inference-arbitrage#30)' (#32) from fix/issue-30-stale-repo-name into main
ci/woodpecker/push/test Pipeline was successful
2026-07-30 23:40:49 +03:00
Oleks 6901f924c1 ci: install git — required by the new hermetic filing.test.sh fixture (#30)
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
2026-07-30 23:32:53 +03:00
Oleks 832b07b248 tests: make the worktree-discipline remote-resolution test hermetic
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/test Pipeline failed
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.
2026-07-30 23:27:11 +03:00
oleks 0482278270 Merge pull request 'Add bin/candidate-digest: script the inv.json/scan.json join' (#28) from fix/issue-24-candidate-digest into main
ci/woodpecker/push/test Pipeline was successful
2026-07-30 19:57:32 +03:00
2 changed files with 26 additions and 11 deletions
+3 -1
View File
@@ -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
+23 -10
View File
@@ -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-<name> 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"