This repository was archived by the owner on Nov 3, 2026. It is now read-only.
Repository navigation
fix(exec): run commands as typed, never through a plugin - #39
Merged
Merged
Conversation
`meta exec -- cargo --version` printed meta-rust's help instead of running cargo: exec offered every command to plugins first, and a plugin claiming `cargo build` also took every other `cargo ...` command by its first word. `meta exec` now always runs the command in each repo. Plugins are only consulted for `meta <command>`, matched on whole argv words: the longest claimed command wins, otherwise the plugin owning the first word gets the whole command and handles subcommands it does not implement. The unused `handles_command` copy of the old matching is gone. Implements [[tasks/harmony-2745]]
Implements [[tasks/harmony-2745]]
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
gold-silver-copper
added a commit
to gitkb/meta-archive
that referenced
this pull request
Oct 24, 2026
meta exec runs commands as typed (gitkb/meta_cli#39); meta cargo passes any cargo command through (gitkb/meta_rust_cli#15). Skill copies come from meta_cli via make skills; Cargo.lock follows meta_rust_cli's deps. Implements [[tasks/harmony-2743]]
Matches gitkb/meta_rust_cli#15, which drops meta rust build/test. Also covers the reported cargo --version shape in the routing test. Implements [[tasks/harmony-2745]]
meta exec -- git runs plain git, without meta-git's no-prompt env, so the exec help no longer uses git fetch as its example and the skill says so. Six plugin_git tests only re-ran copies of the old clone detection and arg splitting inline; route and plugin_routing cover the real code. Implements [[tasks/harmony-2745]]
gold-silver-copper
added a commit
to gitkb/meta-archive
that referenced
this pull request
Oct 25, 2026
#110) fix(build): make install overwrites untracked binaries; drop meta-rust cargo install --path always rebuilds, so --force only changes the case where a binary cargo doesn't track (a release download) is in the way. meta-rust leaves make install to match what releases ship. Implements [[tasks/harmony-2743]] fix(build): make uninstall still removes meta-rust Earlier make installs put meta-rust in ~/.cargo/bin; leaving it there keeps breaking meta exec -- cargo commands other than build and test. Implements [[tasks/harmony-2743]] docs(readme): meta-rust is optional; name both install script dirs Implements [[tasks/harmony-2743]] fix(build): install and ship meta-rust again make install keeps installing meta-rust, and releases now ship it too (archives, Homebrew, install scripts), so every install path agrees. Implements [[tasks/harmony-2743]] docs: describe meta exec and meta cargo as the sibling PRs ship them meta exec runs commands as typed (gitkb/meta_cli#39); meta cargo passes any cargo command through (gitkb/meta_rust_cli#15). Skill copies come from meta_cli via make skills; Cargo.lock follows meta_rust_cli's deps. Implements [[tasks/harmony-2743]] test(help): cargo help as meta_rust_cli#15 ships it Implements [[tasks/harmony-2743]] docs(skills): sync meta-plugins skill from meta_cli#39 Implements [[tasks/harmony-2743]] docs: README routing matches meta_cli#39; bump the Claude plugin for … …its skill changes Implements [[tasks/harmony-2743]] docs(skills): sync meta-exec skill from meta_cli#39 Implements [[tasks/harmony-2743]] docs(architecture): meta exec -- git is plain git; use meta git Implements [[tasks/harmony-2743]]
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What and why
With the optional
meta-rustplugin installed (make installinstalled it for years),meta exec -- cargo --versionprinted meta-rust's help instead of running cargo:Two causes:
Execbranch offered every command to subprocess plugins before running it.SubprocessPluginManager::executegave a plugin any command whose first word matched one of its claimed commands, so meta-rust'scargo buildclaim also tookcargo --version,cargo fmt,cargo update, …The routing rule (now)
meta exec -- <cmd>meta <cmd>meta execis this repo's rule: it never consults plugins, so no plugin can shadow a raw command, whatever name it claims.meta <cmd>routing: the plugin whose claimed command is the longest whole-word prefix of the args wins (git snapshot create x→ meta-git'sgit snapshot create). Otherwise the plugin that claims commands under the first word owns that namespace and gets the whole command.meta git pullworks). meta-rust passing any cargo subcommand through is fix: pass every meta cargo command through to cargo meta_rust_cli#15 (it claims justcargo, which routes here as a one-word claim).handles_commandwas dead code that copied the old matching; it is deleted.Behavior changes (intended)
Nothing in gitkb/meta or harmony relied on exec reaching a plugin: every
meta exec -- git|cargo …in docs and skills expects the raw command. These still change:meta exec -- git status/git commit …now run plain git in each repo instead of meta-git's versions. Usemeta git status/meta git commitfor those.meta exec -- git fetch|pull|push …no longer gets meta-git's environment (GIT_TERMINAL_PROMPT=0,GIT_PAGER=cat, shared SSH connections), so a credential prompt can hang in parallel runs.meta git <any subcommand>passes through to git with that environment; the exec help and skill now point there (the exec help'sgit fetch --allexample is nowcargo fmt --check).meta exec -- git clone <url>no longer acts asmeta git clone(the bootstrap that works without a.meta). It needs a.metalike any exec. Usemeta git clone.meta exec -- git commit -m "two words"needs the whole command quoted;meta git commit -m "two words"keeps the args intact.The
meta-execskill text that documented the hijack ("fails if meta-rust is installed") is updated here, and themeta-pluginsskill now describes meta-rust as gitkb/meta_rust_cli#15 ships it (meta cargo <any cargo args>;meta rust build/testare gone). The copies in gitkb/meta (claude-plugin/skills/meta-exec/SKILL.md,.meta/skills/…) still have the old text; they follow this file.How it was verified
tests/plugin_routing.rsinstalls a fake plugin that claimstouchand logs requests:exec_runs_a_plugin_claimed_command_verbatim:meta exec -- touch rancreatesranin the root and both repos and the plugin gets nothing. Fails on main (the plugin took it), passes here.plugin_subcommand_still_routes_to_the_plugin:meta touch ranreaches the plugin withcommand: "touch",args: ["ran"], and nothing runs raw.tests/plugin_git.rstests that re-ran inline copies of the old clone detection and arg splitting, not the real code.test_route_matches_whole_words: longest claim wins,cargo buildxis notcargo build, unknown first words don't route,cargo --versiongoes to the plugin that ownscargo.cargo test -p meta,cargo clippy -p meta --all-targets --all-features -D warnings,cargo fmt --check. (Locally, tworegistry"fails outside workspace" tests fail only because my temp dir is under$HOME, which has a~/.meta; unrelated to this change.)CARGO_INSTALL_ROOT, in a scratch meta-repo with reposaandb:Look closely at
SubprocessPluginManager::routeinsrc/subprocess_plugins.rs: the matching rule.handle_command_dispatchinsrc/main.rs: exec now checksis_explicit_execbefore plugins, in both the worktree and the normal path, and skips thegit clonebootstrap.Related
meta cargo <anything>passes through to cargo.make install --forceand putsmeta-rustback intomake installonce these land. Its root copies of the skills must match this repo's byte for byte (tests/init.bats), so they follow this PR.Task: [[tasks/harmony-2745]]