Skip to content

fix(skills): allow narrower SkillSource to upgrade preload flag (#956)#970

Merged
chaholl merged 2 commits intomainfrom
fix/956-skill-dedup-preload-merge
Apr 13, 2026
Merged

fix(skills): allow narrower SkillSource to upgrade preload flag (#956)#970
chaholl merged 2 commits intomainfrom
fix/956-skill-dedup-preload-merge

Conversation

@chaholl
Copy link
Copy Markdown
Contributor

@chaholl chaholl commented Apr 13, 2026

Summary

  • Registry.Discover now OR-combines the preload flag across duplicate SkillSource entries, so a broad path: skills/ entry followed by a narrower per-directory entry with preload: true works as users expect.
  • First source still wins for path/metadata; preload is never downgraded.
  • Demotes the noisy "duplicate skill ignored" log from Warn to Debug — it's expected when layering sources.
  • Updates examples/workflow-skills to 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)
  • Coverage on registry.go: 88.6% (threshold 80%)
  • golangci-lint run --new-from-rev=main — 0 issues
  • make build-arena && promptarena run -c examples/workflow-skills/config.arena.yaml --ciDiscovered skills count=5 preloaded=1

chaholl added 2 commits April 13, 2026 12:38
…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).
@sonarqubecloud
Copy link
Copy Markdown

@chaholl chaholl merged commit 69bf228 into main Apr 13, 2026
26 checks passed
@chaholl chaholl deleted the fix/956-skill-dedup-preload-merge branch April 13, 2026 11:51
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.

skills: Registry.Discover first-wins dedup drops preload flag from per-directory entries

1 participant