fix(relink): discover skills structurally so browse is materialized#2263
Open
topcoder1 wants to merge 1 commit into
Open
fix(relink): discover skills structurally so browse is materialized#2263topcoder1 wants to merge 1 commit into
browse is materialized#2263topcoder1 wants to merge 1 commit into
Conversation
`gstack-relink` gated skill discovery on a hardcoded meta-directory name list (`bin|browse|design|docs|extension|lib|node_modules|scripts|test|.git|.github`). `browse` is a real, live skill — `browse/SKILL.md` (name: browse, v1.1.0), depended on by `benchmark` and `setup-browser-cookies` — so the name collision meant relink never materialized it. It only appeared to work historically because a tracked `skills/browse` symlink in a downstream consumer papered over the gap; once that was removed, `browse` went permanently missing on fresh installs and could not self-heal via relink. `browse` was the only one of the nine non-dot excluded names that actually carries a SKILL.md; the structural guard `[ -f "$skill_dir/SKILL.md" ]` on the next line already handles every genuinely SKILL-less support dir. Drop the redundant name list and let that structural test be the sole gate. This matches gstack's canonical discovery (`scripts/discover-skills.ts`, whose SKIP set is only node_modules/.git/dist) and the companion `gstack-patch-names` (structural, no name list), and future-proofs `design`/`docs`/`test` should any ever become real skills. Adds regression tests: a real-payload assertion that every top-level `*/SKILL.md` materializes (fails on exactly `browse` pre-fix), a future-proofing test over all former-exclusion names, and a companion test that SKILL-less dirs stay skipped.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Contributor
|
@topcoder1 Restore reserved-directory exclusions while keeping structural discovery for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
gstack-relinkgates skill discovery on a hardcoded meta-directory name list:browseis in that list — butbrowseis a real, live skill:browse/SKILL.mdexists withname: browse,version: 1.1.0, "Fast headless browser for QA testing and site dogfooding". Two shipped skills depend on it by name:benchmark("Performance regression detection using the browse daemon") andsetup-browser-cookies("Import cookies … into the headless browse session").The result:
gstack-relinknever materializesskills/browse, so thebrowseskill is unavailable. It only appeared to work historically because a downstream consumer tracked askills/browsesymlink that papered over the exclusion. Once that symlink is removed,browseis permanently missing on any fresh install (or after anyskills/rebuild) and cannot self-heal via relink.Fix
browseis the only one of the nine non-dot excluded names that actually carries aSKILL.md. The eight others (bin,design,docs,extension,lib,node_modules,scripts,test) have none — so the structural guard already on the next line handles them for free:This PR drops the redundant name list and makes that structural test the sole gate. A directory is a skill iff it carries a
SKILL.md.This is not a new convention — it aligns relink with the two sibling discovery paths that are already structural:
scripts/discover-skills.ts(canonical shared discovery, used by CI + doc-gen): its skip set is only{ node_modules, .git, dist }— it already treatsbrowseas a skill.bin/gstack-patch-names: iterates the same dirs using only[ -f "$skill_dir/SKILL.md" ], no name list.It also future-proofs
design/docs/testshould any ever become real skills.Safety
relink's glob is top-level
*/only and stats just$dir/SKILL.md. The three names in discover-skills' skip set are already handled:.gitis excluded by the glob (dotdirs never match*/), and neithernode_modules/SKILL.mdnor a top-leveldist/SKILL.mdexists (distonly appears nested, e.g.browse/dist). No top-leveltest//docs/SKILL.mdexists, so no fixture is mistaken for a skill.Tests
test/relink.test.tsgains three regression tests (suite: 27 pass, 0 fail — was 25 pass + 2 fail before the fix):*/SKILL.mdin the repo and asserts each materializes — fails on exactlybrowsewithout the fix.SKILL.md, and asserts all materialize.SKILL.mdare still skipped.Before:
Relinked 53 skills. After:Relinked 54 skills, withbrowse/SKILL.mdpresent.