Add plugin-vended cargo agents subcommands#219
Draft
gme-muriuki wants to merge 4 commits into
Draft
Conversation
Member
nikomatsakis
left a comment
There was a problem hiding this comment.
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
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>
92d72ed to
a9d1188
Compare
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.
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.
Confidence level.
Questions for reviewers.
md/design/subcommands.mdhaven't been validated yet -- flagging the whole doc for review (audience default, reserved-name list, last-loaded conflict policy, workspace filtering).cratespredicate 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?