Relationships
#1174 Committed .swamp-sources.yaml relative paths resolve against worktree cwd, not the main checkout — and missing sources are now skipped silently
Opened by anthony · 7/16/2026· Shipped 7/16/2026
Summary
.swamp-sources.yaml relative path: entries are resolved against the process cwd (the worktree's physical location), not the repository's main checkout. Inside a nested git worktree (e.g. .claude/worktrees/<name>), a committed sibling source like ../spor-infra/extensions resolves to a nonexistent path — and as of the current build the missing source is silently skipped (exit 0, no warning at default log level), so type-touching operations quietly run without the sibling's extensions instead of failing loudly.
Steps to reproduce
- A repo
~/repos/my-repowith a committed.swamp-sources.yaml:and the sibling checkout atsources: - path: ../sibling-repo/extensions only: [models, reports]
~/repos/sibling-repo(works fine from the main checkout). - Create a nested worktree:
git -C ~/repos/my-repo worktree add --detach .claude/worktrees/test HEAD cd ~/repos/my-repo/.claude/worktrees/test && swamp model list
Observed
- swamp attempts to open
~/repos/my-repo/.claude/worktrees/sibling-repo/extensions/.swamp.yaml(verified withstrace -e trace=openat: 3× ENOENT) — i.e.../sibling-reporelative to the worktree directory. - The command exits 0 with no warning; models still list from the datastore, but the sibling source's model types are not loaded. In an earlier build this failed loudly; the silent skip is worse because it can mask stale-type behavior in scripted/CI use.
Expected
Relative path: entries in a committed .swamp-sources.yaml should resolve against the repository's main checkout — e.g. against git rev-parse --git-common-dir's parent (or git worktree list's first entry) — so every worktree of a repo sees the same sibling sources the main checkout does. A committed file cannot carry per-worktree paths, so cwd-relative resolution makes worktree use impossible without filesystem workarounds. Failing that, an unresolvable declared source should at least warn loudly rather than skip silently.
Workaround in use
A symlink at the worktrees container level (.claude/worktrees/sibling-repo -> ~/repos/sibling-repo) so ../sibling-repo happens to resolve from every worktree in that directory. Works, but it's gitignored local state every contributor must rediscover.
Environment
- swamp 20260716.010800.0-sha.41b2f5f0 (also present in 20260627.002632.0, where it failed loudly instead of silently)
- Linux 6.12, git worktrees nested under the main checkout at
.claude/worktrees/<name> - Note:
SWAMP_EXTENSIONS_DIR/--extensions-dir(#381/#388) covers the localextensions/dir split, but does not affect.swamp-sources.yamlpath:resolution, which is what breaks here.
Shipped
Click a lifecycle step above to view its details.