Skip to content

fix(agent-guard): discover skill guards on a marketplace install - #1762

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:agent-guard-marketplace-guards
Oct 23, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:agent-guard-marketplace-guards

Conversation

@potiuk

@potiuk potiuk commented Oct 22, 2026

Copy link
Copy Markdown
Member

A marketplace caches every plugin on its own, as <marketplace>/<plugin>/<version>/, so the published magpie-agent-guard plugin has no framework tree above it and framework_root() returns None there.
The skill-owned guards (mention, mark_ready, security_language) were therefore never discovered on a marketplace install — only the bundled guards.d ran.
#1757 fixed discovery for checkouts and snapshots; this closes the remaining marketplace case, raised in its review.

Summary

  • New installed_plugin_guard_dirs(): when the engine runs from <marketplace>/magpie-agent-guard/<version>/ (no framework tree), scan skills/*/guards of the sibling family plugins in the same cache.
  • Version choice: each sibling's copy at the engine's own version (the families are released together), else its most recently installed version.
  • A framework checkout or snapshot is unaffected: framework_root() still wins, and plugins/ in a checkout is never mistaken for a plugin cache.
  • Plugin copy of the engine synced, isolated-setup fingerprint regenerated, tools/agent-guard/README.md and the marketplace-distribution spec updated.

Test plan

  • Four new tests in tools/agent-guard/tests/test_discovery.py on a fake plugin cache: siblings discovered, own version preferred over a newer leftover, latest-install fallback, a checkout never scans a cache.
  • Full tools/agent-guard suite passes.
  • prek hooks pass on the changed files.

Gen-AI disclosure

Generated with Claude Code (Claude Opus 5); reviewed by the committer.

🤖 Generated with Claude Code

A marketplace caches every plugin on its own, as
<marketplace>/<plugin>/<version>/, so the published magpie-agent-guard
plugin has no framework tree above it and framework_root() is None there.
The skill-owned guards (mention, mark-ready, security-language) were
therefore never discovered on a marketplace install, leaving only the
bundled guards.d active.

When there is no framework tree, the engine now scans the skills/*/guards
of the family plugins cached beside its own, using each one's copy at the
engine's own version (the families are released together), else its most
recently installed version.

Generated-by: Claude Opus 5
@github-actions github-actions Bot added family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) substrate:action-guard Tool substrate: deterministic pre-tool-use command guards labels Oct 22, 2026
@potiuk
potiuk enabled auto-merge (squash) October 22, 2026 23:56
@potiuk
potiuk merged commit bde9c88 into apache:main Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* substrate:action-guard Tool substrate: deterministic pre-tool-use command guards

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant