tests: make the worktree-discipline remote-resolution test hermetic (kotkan/claude-plugin-inference-arbitrage#30) #32
Reference in New Issue
Block a user
Delete Branch "fix/issue-30-stale-repo-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes kotkan/claude-plugin-inference-arbitrage#30 —
bash tests/run-all.shreported:Investigation found no stale reference in this repo's source or fixtures. Verified via
search_reposthat onlykotkan/claude-plugin-worktree-disciplineexists on Gitea today (the pre-rename bare-name slug is a redirect only, per the 2026-07-22 kotkan org rename documented in~/projects/claude-plugins/CLAUDE.md). The test fixture's expected value (kotkan/claude-plugin-worktree-disciplineintests/filing.test.sh) already matched reality, andbin/filing-plan'sresolve_repo()/parse_remote()contain no hardcoded repo-name table — they just readgit remote get-url originoff whatever checkout is handed to them.Root cause: the failing assertion (
tests/filing.test.sh, "a writable target resolves through its own checkout's remote") read the live git remote of a sibling../worktree-disciplinecheckout on disk — a directory that lives outside this repo and outside version control. That checkout's remote can drift independently of anything in this repo (e.g. an old local clone whoseoriginwas never repointed after the rename). When it's stale, the test fails; when it's current, the test passes — either way, nothing here changes. This is also why the failure never showed up in CI: the barealpinecontainer in.woodpecker/test.yamlhas no sibling checkout at all, so the test just printedskip (no sibling worktree-discipline checkout).Fix
Replaced the dependency on the external sibling checkout with a throwaway git repo created inside the test's own
mktemp -dtmpdir, withoriginset explicitly togit@git.oleks.space:kotkan/claude-plugin-worktree-discipline.git. This exercises the exact sameresolve_repo()/parse_remote()code path deterministically, with zero dependency on what else happens to be checked out on the machine running the suite, and the assertion now always runs instead of silently skipping.Verification
Also confirmed the new test actually catches the original failure mode — temporarily pointing the fixture's remote at the stale pre-rename slug reproduces the exact reported failure line:
and reverting it passes again, proving the hermetic version has the same discriminating power as the original while being deterministic.
Other stale-reference sweep
Grepped the repo for any other pre-rename bare-name references to kotkan's six renamed plugin repos (
token-budget,sirpa-agents,statusline,claude-profiles,messenger,worktree-discipline) — none found.🤖 Generated with Claude Code