Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#3694 extension_source_add_test globs the real home directory and flakes when a file in ~ disappears mid-walk

Opened by stack72 · 10/21/2026· Shipped 10/21/2026

What happens

src/cli/commands/extension_source_add_test.ts ("extension source add --only: behaviors is persisted as models", swamp-club#3410) failed once in verify-build while verifying swamp-club#3686:

NotFound: No such file or directory (os error 2): stat '~/.claude.json.lock'
  at expandGlob (@std/fs expand_glob.ts)
  at expandSourcePaths (src/infrastructure/persistence/swamp_sources_repository.ts:121)
  at resolveExtensionKindsForSource (src/infrastructure/persistence/swamp_sources_repository.ts:516)

The rerun on the same commit passed, and the file passes 5 of 5 locally.

Why

The test adds the unexpanded source ~/swamp-source-add-test-*. resolveExtensionKindsForSource expands that glob against the real home directory, so the walk stats every entry in ~. Any file another process creates and deletes mid-walk (here Claude Code's ~/.claude.json.lock) fails the test. This also breaks the AGENTS.md rule that tests stay out of the real HOME.

Expected

The test points the glob at a path under its temp directory (or mocks HOME through the repo's home-dir seam), so it never reads the real home directory.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 6 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

10/21/2026, 6:27:25 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/21/2026, 5:52:36 PM

Sign in to post a ripple.