tests/run-bats.sh's test-discovery walk excluded apm_modules/ and .claude/skills/ (apm-installed copies of the same *.bats files, one directory level shallower than their plugins/*/.apm/ source) but was missing the same exclusion for build/ — the apm pack staging output, which hits the identical failure mode from a different apm subcommand.
A stray local apm pack run leaves build/<package>-<version>/ on disk (gitignored, regenerable). Its staged .bats copies carry the same hardcoded six-levels-up REPO_ROOT walk in each test's setup(), which overshoots the real repo root when run from the shallower build/ layout and fails to find the tests/test_helper/bats-support submodule — silently doubling the suite (846 tests instead of 423) with 423 of them failing.
Added -not -path "*/build/*" to the find walk and the matching git ls-files grep exclusion, mirroring the existing apm_modules//.claude/skills/ entries.
Extended tests/test-run-bats.sh with a regression case following the same pattern as the existing exclusion-bug fixtures.
Verification
bash tests/run-bats.sh (with a stray build/holocron-*/ still on disk): 846/423-failing → 423/0-failing after the fix.
bash tests/run-tests.sh --strict (the actual run-tests pre-commit/pre-push hook entry): exit 0, === Summary: 21 passed, 0 skipped, 0 failed ===.
## Summary
- `tests/run-bats.sh`'s test-discovery walk excluded `apm_modules/` and `.claude/skills/` (apm-installed copies of the same `*.bats` files, one directory level shallower than their `plugins/*/.apm/` source) but was missing the same exclusion for `build/` — the `apm pack` staging output, which hits the identical failure mode from a different apm subcommand.
- A stray local `apm pack` run leaves `build/<package>-<version>/` on disk (gitignored, regenerable). Its staged `.bats` copies carry the same hardcoded six-levels-up `REPO_ROOT` walk in each test's `setup()`, which overshoots the real repo root when run from the shallower `build/` layout and fails to find the `tests/test_helper/bats-support` submodule — silently doubling the suite (846 tests instead of 423) with 423 of them failing.
- Added `-not -path "*/build/*"` to the `find` walk and the matching `git ls-files` grep exclusion, mirroring the existing `apm_modules/`/`.claude/skills/` entries.
- Extended `tests/test-run-bats.sh` with a regression case following the same pattern as the existing exclusion-bug fixtures.
## Verification
- `bash tests/run-bats.sh` (with a stray `build/holocron-*/` still on disk): 846/423-failing → 423/0-failing after the fix.
- `bash tests/run-tests.sh --strict` (the actual `run-tests` pre-commit/pre-push hook entry): exit 0, `=== Summary: 21 passed, 0 skipped, 0 failed ===`.
- `bash tests/test-run-bats.sh`: 15 passed, 0 failed (was 14).
- `apm audit --ci` and `apm pack --check-clean`: pass.
- Pushed and verified against the live pre-push gate on `git.rkdr.net`.
## Test plan
- [x] `bash tests/run-tests.sh --strict` passes
- [x] `bash tests/test-run-bats.sh` passes with the new case
- [x] `apm audit --ci` / `apm pack --check-clean` pass
Unrelated to and independent of the separate `chore/git-host-migration` PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_011EBLjPSWgt4N5Q47sH8bSV
Why
tests/run-bats.sh's discovery walk already excludes apm_modules/ and
.claude/skills/ because those hold apm-installed copies of the same
*.bats files one directory level shallower than their plugins/*/.apm/
source, which overshoots the hardcoded six-levels-up REPO_ROOT walk
each test's setup() does and fails to find the bats-support helper.
build/ was missing the same exclusion: apm pack stages an identical
copy under build/<package>-<version>/ before archiving, hitting the
exact same failure mode from a different apm subcommand. A stray
local `apm pack` run leaves that directory on disk (gitignored,
regenerable) and silently doubles the suite (846 tests instead of
423) with 423 of them failing.
Implementation Notes
Added `-not -path "*/build/*"` to the find walk and the matching
git ls-files grep exclusion, mirroring the existing apm_modules/ and
.claude/skills/ entries. Extended tests/test-run-bats.sh with a case
following the same pattern as the existing exclusion-bug fixtures.
Impact
Unblocks the run-tests pre-commit/pre-push hook for any checkout that
has ever run a bare `apm pack` locally.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
tests/run-bats.sh's test-discovery walk excludedapm_modules/and.claude/skills/(apm-installed copies of the same*.batsfiles, one directory level shallower than theirplugins/*/.apm/source) but was missing the same exclusion forbuild/— theapm packstaging output, which hits the identical failure mode from a different apm subcommand.apm packrun leavesbuild/<package>-<version>/on disk (gitignored, regenerable). Its staged.batscopies carry the same hardcoded six-levels-upREPO_ROOTwalk in each test'ssetup(), which overshoots the real repo root when run from the shallowerbuild/layout and fails to find thetests/test_helper/bats-supportsubmodule — silently doubling the suite (846 tests instead of 423) with 423 of them failing.-not -path "*/build/*"to thefindwalk and the matchinggit ls-filesgrep exclusion, mirroring the existingapm_modules//.claude/skills/entries.tests/test-run-bats.shwith a regression case following the same pattern as the existing exclusion-bug fixtures.Verification
bash tests/run-bats.sh(with a straybuild/holocron-*/still on disk): 846/423-failing → 423/0-failing after the fix.bash tests/run-tests.sh --strict(the actualrun-testspre-commit/pre-push hook entry): exit 0,=== Summary: 21 passed, 0 skipped, 0 failed ===.bash tests/test-run-bats.sh: 15 passed, 0 failed (was 14).apm audit --ciandapm pack --check-clean: pass.git.rkdr.net.Test plan
bash tests/run-tests.sh --strictpassesbash tests/test-run-bats.shpasses with the new caseapm audit --ci/apm pack --check-cleanpassUnrelated to and independent of the separate
chore/git-host-migrationPR.🤖 Generated with Claude Code
https://claude.ai/code/session_011EBLjPSWgt4N5Q47sH8bSV