Skip to content

fix(sourcewalk): never skip the source root as a target dotdir - #514

Merged
runkids merged 1 commit into
mainfrom
runkids/fix-issue-511-dotdir-source-root
Oct 10, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/fix-issue-511-dotdir-source-root

Conversation

@runkids

@runkids runkids commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #511: a source root named .skillshare (or any target dotdir such as .claude) was skipped entirely during discovery, so skillshare list returned [] and sync pruned previously managed links. Regression from 881d08e (v0.24.4).

Root cause

config.ProjectTargetDotDirs() always includes .skillshare. sourcewalk.SkipTargetDotDir checked filepath.Dir(path) != walkRoot but never exempted path == walkRoot, so at the root callback the parent comparison was true and the helper returned SkipDir for the whole source.

Fix

Exempt the walk root in the shared helper (internal/sourcewalk/walk.go): if path == walkRoot || !info.IsDir() || .... Callers (internal/sync/discover_walk.go, internal/resource/skill.go) are unchanged and already pass a symlink-resolved walkRoot.

Verification (devcontainer, worktree mounted in a temporary container)

  • New TestSkipTargetDotDir: root named .skillshare not skipped; nested some-skill/.claude skipped; first-level .cursor not skipped.
  • New TestDiscoverSourceSkills_SourceRootNamedAsTargetDotDir: .skillshare/skills/demo/SKILL.md is discovered.
  • Both new tests fail on the previous walk.go and pass with the fix.
  • Issue repro script against a freshly built binary now prints [{"name":"skills__demo","kind":"skill","relPath":"skills/demo"}].
  • make check (docs-check, fmt-check, vet, unit + integration tests) passes.

Follow-ups (not in this PR)

  • internal/resource/agent.go:55 skips every hidden directory including the walk root, so an agents source with a hidden basename would be skipped the same way.
  • internal/install/install_discovery.go hand-rolls its own copy of the nested-dotdir rule; it differs in behaviour (also skips first-level dotdirs), so merging it is not behaviour-neutral.

SkipTargetDotDir only exempted dotdirs directly under the walk root, never
the root itself. ProjectTargetDotDirs() always contains ".skillshare", so a
source whose basename is a target dotdir (".skillshare", ".claude", ...) had
its first Walk callback return SkipDir. Discovery then saw an empty source:
`skillshare list` returned [] and sync pruned previously managed links.

Exempt path == walkRoot in the shared helper so both callers
(sync discovery and resource skill discovery) are fixed. Nested target
dotdirs are still skipped and first-level ones stay visible.

Fixes #511
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:40:50.539685Z 24dd887 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit d2f5936 into main Oct 10, 2026
8 checks passed
@runkids
runkids deleted the runkids/fix-issue-511-dotdir-source-root branch October 10, 2026 13:43
runkids added a commit that referenced this pull request Oct 10, 2026
AgentKind.Discover and the skill detail file listing skipped every
hidden directory, including the walk root itself. The `!= "."` guard in
agent.go never fires because walkRoot is an absolute resolved path, so a
sources.agents directory such as ~/.agents discovered zero agents.

Exempt the walk root (`path != walkRoot`), matching the other walks in
the repo. Nested hidden directories are still skipped.

Related to #511 (same class as #514).
runkids added a commit that referenced this pull request Oct 10, 2026
…515

Release Please regenerated the entry when #513 landed on main. Restore
the user-facing version and describe the three fixes merged since: the
skills source named like a tool folder (#511, via #514), the hidden
agents source folder (#515) and moved installed skills (#513).
runkids added a commit that referenced this pull request Oct 10, 2026
* chore(main): release 0.25.4

* chore(release): synchronize release metadata

* docs(changelog): restore the curated 0.25.4 entry and add #511, #513, #515

Release Please regenerated the entry when #513 landed on main. Restore
the user-facing version and describe the three fixes merged since: the
skills source named like a tool folder (#511, via #514), the hidden
agents source folder (#515) and moved installed skills (#513).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Willie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source root named .skillshare is skipped during discovery (regression since v0.24.4)

1 participant