fix(skills): allow narrower SkillSource to upgrade preload flag (#956)#970
Merged
fix(skills): allow narrower SkillSource to upgrade preload flag (#956)#970
Conversation
…plicate name Registry.Discover previously dropped any SkillSource whose skill name was already registered, with a Warn-level noise log. This broke the common "broad path: skills/ then per-directory override" pattern — the override's preload flag was silently ignored. Now: first source still wins for path/metadata, but a later source with preload=true upgrades the existing entry. preload is never downgraded. The dedup log is demoted to Debug since it's expected when layering sources. Updates examples/workflow-skills to exercise the pattern end-to-end. Fixes #956
…ctory Both packc validators (standalone and compiler-integrated) tracked seen names as a bool, so the broad "path: skills/" + narrower "path: skills/brand-voice" pattern — which the runtime now uses to upgrade the preload flag — was rejected with "duplicate skill name". Switch to name -> canonical path map: duplicates are flagged only when they point to different skill directories. Inline names still collide with each other (no path to disambiguate).
|
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.



Summary
Registry.Discovernow OR-combines thepreloadflag across duplicateSkillSourceentries, so a broadpath: skills/entry followed by a narrower per-directory entry withpreload: trueworks as users expect.preloadis never downgraded.examples/workflow-skillsto use the broad-then-narrow pattern, exercising the fix end-to-end.Fixes #956.
Test plan
go test ./runtime/skills/... -count=1 -race— passes (new tests:TestDiscoverPreloadUpgrade,TestDiscoverInlinePreloadUpgrade,TestDiscoverPreloadNotDowngraded)registry.go: 88.6% (threshold 80%)golangci-lint run --new-from-rev=main— 0 issuesmake build-arena && promptarena run -c examples/workflow-skills/config.arena.yaml --ci—Discovered skills count=5 preloaded=1