tests: make the worktree-discipline remote-resolution test hermetic (kotkan/claude-plugin-inference-arbitrage#30) #32

Merged
admin merged 2 commits from fix/issue-30-stale-repo-name into main 2026-07-30 23:40:50 +03:00
Owner

Summary

Fixes kotkan/claude-plugin-inference-arbitrage#30bash tests/run-all.sh reported:

FAIL repo = kotkan/worktree-discipline (want kotkan/claude-plugin-worktree-discipline)

Investigation found no stale reference in this repo's source or fixtures. Verified via search_repos that only kotkan/claude-plugin-worktree-discipline exists 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-discipline in tests/filing.test.sh) already matched reality, and bin/filing-plan's resolve_repo()/parse_remote() contain no hardcoded repo-name table — they just read git remote get-url origin off 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-discipline checkout 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 whose origin was 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 bare alpine container in .woodpecker/test.yaml has no sibling checkout at all, so the test just printed skip (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 -d tmpdir, with origin set explicitly to git@git.oleks.space:kotkan/claude-plugin-worktree-discipline.git. This exercises the exact same resolve_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

$ bash tests/run-all.sh; echo "EXIT: $?"
... (all suites) ...
FINAL EXIT: 0

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:

FAIL repo = kotkan/worktree-discipline (want kotkan/claude-plugin-worktree-discipline)

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

## Summary Fixes kotkan/claude-plugin-inference-arbitrage#30 — `bash tests/run-all.sh` reported: ``` FAIL repo = kotkan/worktree-discipline (want kotkan/claude-plugin-worktree-discipline) ``` **Investigation found no stale reference in this repo's source or fixtures.** Verified via `search_repos` that only `kotkan/claude-plugin-worktree-discipline` exists 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-discipline` in `tests/filing.test.sh`) already matched reality, and `bin/filing-plan`'s `resolve_repo()`/`parse_remote()` contain no hardcoded repo-name table — they just read `git remote get-url origin` off 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-discipline` checkout 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 whose `origin` was 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 bare `alpine` container in `.woodpecker/test.yaml` has no sibling checkout at all, so the test just printed `skip (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 -d` tmpdir, with `origin` set explicitly to `git@git.oleks.space:kotkan/claude-plugin-worktree-discipline.git`. This exercises the exact same `resolve_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 ``` $ bash tests/run-all.sh; echo "EXIT: $?" ... (all suites) ... FINAL EXIT: 0 ``` 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: ``` FAIL repo = kotkan/worktree-discipline (want kotkan/claude-plugin-worktree-discipline) ``` 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](https://claude.com/claude-code)
oleks added 1 commit 2026-07-30 23:27:42 +03:00
tests: make the worktree-discipline remote-resolution test hermetic
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/test Pipeline failed
832b07b248
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.
oleks added 1 commit 2026-07-30 23:33:21 +03:00
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
6901f924c1
admin merged commit 83a74363c3 into main 2026-07-30 23:40:50 +03:00
Sign in to join this conversation.