Skip to content

Add plugin-vended cargo agents subcommands#219

Draft
gme-muriuki wants to merge 4 commits into
symposium-dev:mainfrom
gme-muriuki:plugin-subcommands
Draft

Add plugin-vended cargo agents subcommands#219
gme-muriuki wants to merge 4 commits into
symposium-dev:mainfrom
gme-muriuki:plugin-subcommands

Conversation

@gme-muriuki
Copy link
Copy Markdown
Contributor

Audience enum + Subcommand struct; validation for reserved names, character set, and description length. Inline command form promoted via the existing resolve_or_promote pipeline.

9 tests including one that loads a fixture plugin through the real directory scanner.

Design doc and SUMMARY entry. No dispatch behavior yet.

What does this PR do?

Part of #199 -- manifest schema only. Dispatch, help-text grouping, and agent guidance follow as commits on this draft.

Disclosure questions

AI disclosure.

  • I used an AI tool for research, autocomplete, or in other minimal ways

Confidence level.

  • Early draft, want feedback

Questions for reviewers.

  • Design decisions in md/design/subcommands.md haven't been validated yet -- flagging the whole doc for review (audience default, reserved-name list, last-loaded conflict policy, workspace filtering).
  • Subcommand-level crates predicate is included for symmetry with [[mcp_servers]] / [[skills]] groups, but has no consumer yet (dispatch lands in a later commit). Keep, or drop until there's a real use case?

Copy link
Copy Markdown
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ~right to me, I've not read the full code yet, wasn't clear if you were asking for feedback on that or not

gme-muriuki and others added 4 commits May 15, 2026 10:16
Audience enum + Subcommand struct; validation for reserved names,
charset, and description length. Inline command form promoted via the
existing resolve_or_promote pipeline.

9 tests including one that loads a fixture plugin through the real
directory scanner.

Design doc and SUMMARY entry. No dispatch yet.
Handle unknown names to a new `Commands::External(argv)` arm with clap's
`allow_external_subcommands`

Walk the `PluginRegistry` with `find_subcommand`, applying the
plugin-level `crates` predicate against the workspace, looks up
`argv[0]` in `plugin.subcommands`, then re-checks any subcommand-level
predicate.

Two or more matches is a hard error - collisions are a config bug worth
surfacing.

`dispatch_external` looks up the named `Installation`, resolves it via
`installation::resolve_runnable`, and spawns with stdio inherited. The
exit byte propagates back: binary wraps in `ExitCode::from`, library
treats non-zero as an error so tests can assert on it.

- Unit tests cover predicate combinations and the conflict error.
- Integration test spawn `rustc --version` through a fixture; avoids
  `sh` so it passes on windows.
- Design docs updated (`module-structure.md`, `important-flows.md`, and
  `subcommands.md`).

`Runnable::Script` still uses `sh`, mirroring hook dispatch; tracked as
a follow-up.

Co-authored-by: Claude <claude@anthropic.com>
@gme-muriuki gme-muriuki force-pushed the plugin-subcommands branch from 92d72ed to a9d1188 Compare May 15, 2026 07:32
@gme-muriuki gme-muriuki requested a review from nikomatsakis May 15, 2026 07:37
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.

2 participants