Skip to content
This repository was archived by the owner on Dec 3, 2026. It is now read-only.

feat!: help says who answers each command; meta plugin list shows tool extensions; one shared error prints once [[tasks/harmony-3042]] - #158

Merged
gold-silver-copper merged 3 commits into
mainfrom
meta-help-discovery
Nov 3, 2026
Merged

gold-silver-copper merged 3 commits into
mainfrom
meta-help-discovery

Conversation

@gold-silver-copper

@gold-silver-copper gold-silver-copper commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Implements [[tasks/harmony-3042]], from the owner's talk with Matt on 2026-11-02: "we need to improve the help commands", "meta --help should show plugin help as well", "plugin identification: git plugins vs meta plugins, anything on PATH should work".

This changes what help and discovery show. What every command does stays the same, plugins that redefine commands included. One exception, item 4: a failure every repo shares is now printed once.

What changed, item by item (before → after, from a sandbox with 3 repos plus the root repo)

1. meta --help lists each plugin's commands

All three help surfaces (meta --help, meta help <word>, meta <word> --help) read one source, the plugin's info (PluginHelp.commands plus the new runs_as_typed). New commands meta-git declares (like #157's clone-*) show up with no other change.

Before:

  cargo    Run cargo across the Rust repos of a meta workspace [plugin: cargo v0.2.22]
  git      Git operations for meta repositories [plugin: git v0.2.22]
  project  Project inspection for meta repositories [plugin: project v0.2.22]

After:

  cargo    Run cargo across the Rust repos of a meta workspace [plugin: cargo v0.2.22]
           every cargo command runs as typed in each selected repo
  git      Git operations for meta repositories [plugin: git v0.2.22]
           clone, clone-missing, clone-prune, clone-sync, commit, update, worktree
           any other git command runs as typed in each selected repo
  project  Project inspection for meta repositories [plugin: project v0.2.22]
           list, check, dependents

2. meta git --help states the pass-through rule

Before: a "Pass-through Commands" section that listed only status, plus a closing note.
After:

Commands meta-git adapts:
  clone                Clone a meta repo and the repos its .meta.yaml lists (-r: nested ones too)
  ...
  worktree             Create isolated worktree sets for multi-repo branches

Pass-through: any other git command runs as typed in each selected repo, git's own extensions on PATH included (git-<name>: meta git <name>).

Examples:
  meta git clone https://github.com/org/meta-repo.git
  meta git commit --edit              # Per-repo messages
  meta git worktree create feature-x --repo api --repo web
  meta git status                     # git status in each repo
  meta git log --oneline -3           # git log, as typed

3. A command's help starts by saying who answers it

meta <word> <verb> --help and meta help <word> <verb> take the same path. meta reads the answer from the plugin's info:

  • The plugin's own command: one line, then the plugin's own help. Each adapted git command's help now ends with a Git options: line saying which of git's options it takes:
    $ meta git clone --help
    `meta git clone` is adapted by meta-git: meta's own command, not git run as typed.
    
    Clone a meta repository, then the repos its .meta.yaml lists
    ...
    Git options: of git clone's own, only --depth, given to each clone.
    
    commit: only -m and -e. update: none (it runs git pull --ff-only). clone-missing/-prune/-sync: none (git has no such command). worktree: none (its commands are meta's). A meta-project command says `meta project list` is a command of meta-project.
  • Any other command (run as typed): meta prints this help itself. The plugin is not asked. The shape is the same as before: the repos it would run in, meta's options, and where git's own help is.
    $ meta git status --help
    `meta git status` runs as typed (`git status`) in each selected repo.
    
    Usage: meta [META_OPTIONS] git status [GIT_ARGS...]
    
    Current scope: 4 repo(s): ., api, docs, web
    
    Meta options (before `git`):
      -e, --exclude <EXCLUDE>  Skip these repos: ...
      ...
    For git's own options: git status --help
    
    The scope now comes from meta's own repo selection, so --include, --tag and -r change it. The old scope, worked out inside meta-git, ignored them. The option list comes from meta's own option definitions, so it can't drift from them.
  • meta cargo --help has the same shape. The "Commands: cargo" list that repeated the plugin's own name is gone:
    Usage: meta cargo <CARGO_ARGS>...
    
    Pass-through: every cargo command runs as typed in each selected repo, cargo's own extensions on PATH included (cargo-<name>: meta cargo <name>).
    
    meta cargo build --help gets the same as-typed help as meta git status --help.

4. One error, not N copies

Before: meta git frobnicate printed git's "is not a git command" once for every repo (7 times in harmony), and then a summary line for every repo.
After:

✗ . (ws), ./api, ./docs, ./web:
git: 'frobnicate' is not a git command. See 'git --help'.

Summary: ✗ 4 out of 4 commands failed

✗ . (ws), ./api, ./docs, ./web: git frobnicate (exit code 1)

The output is grouped only when every repo fails with the same command, the same stdout and stderr, and the same exit code or signal. Differing errors still print per repo. --json still has one record per repo.

5. Discovery: meta plugins and tool extensions in one place

meta plugin list keeps its plugin table and adds a section:

Tool extensions on PATH, run as typed (part of their tool, not meta plugins):

meta git <name>      clang-format, cvsserver, hello, receive-pack, shell, upload-archive, upload-pack

For each plugin that runs a tool as typed (git, cargo), the section lists the <tool>-* executables on PATH. A name the plugin's own command shadows is left out (a git-commit on PATH never runs as meta git commit). meta git hello runs git-hello in each repo. That already worked; now it is listed.

Why a section and not --tools: one command now answers "what can I run through meta?". --json is still the plugin array that meta_list_plugins (MCP) and atc read. No caller needs extensions there, and changing that array's shape would break them. Git's own programs installed in /usr/bin (git-upload-pack …) show up too. That is the plain PATH rule, and they do run as meta git upload-pack.

The paragraph that tells the two kinds apart is in the README, meta plugin --help and meta plugin list --help: "A meta plugin (meta-) adds or adapts meta <word> .... A tool's own extension (git-) is just part of that tool, and runs through meta as typed".

6. Docs

The README's plugin section (the two kinds, how help says who answers a command, clone-* in the plugin table), docs/plugin_development.md (the commands/runs_as_typed contract and who answers --help), and the meta-plugins skill. In meta_cli/tests/docs.rs, the hard-coded list of adapted git commands is replaced by what meta-git declares, so the docs test can't fall out of step with meta-git either.

Plugin protocol change (PluginHelp)

// before
pub struct PluginHelp {
    pub usage: String,
    pub commands: IndexMap<String, String>,
    pub command_sections: IndexMap<String, IndexMap<String, String>>, // titled groups
    pub examples: Vec<String>,
    pub note: Option<String>,
}
// after
pub struct PluginHelp {
    pub usage: String,
    pub commands: IndexMap<String, String>,   // the plugin's own commands
    pub runs_as_typed: Option<String>,        // the tool every other command runs as typed
    pub examples: Vec<String>,
    pub note: Option<String>,
}

help_text(info) becomes help_text(word, info), and PluginInfo::verb(verb) answers Own, AsTyped(tool) or Unknown. Only meta-git used command_sections; gitkb/meta-plugins ships no plugins. An older plugin that still sends it parses fine, but its sections no longer show. meta-git no longer claims git status in its routed commands. It still runs as typed, and the request's words are the same. A meta-git test checks that its routed commands and its help's commands are the same set.

Decisions made without the owner

  • The protocol field change above. It is easy to undo, but it is a change to a public type. Left for you to decide if you'd rather keep command_sections.
  • Goal revision (item 4), listed here as the rules require.
    • Original target: a looped command that fails the same way in every repo prints the error once.
    • Evidence: parallel runs (the default; defaults.parallel is true) capture each repo's output, and those are grouped. --sequential writes each repo's output to the terminal live, as the command runs (execute_command_in_directory, Stdio::inherit). That is what it is for: exec.bats checks that it keeps the order and the live output. Grouping there would mean holding every repo's stdout and stderr until all have finished, so a long meta --sequential cargo build would show nothing until it ends.
    • New target: every captured run is grouped. With --sequential only the summary line is grouped (✗ ., ./api, ./web: git frobnicate (exit code 1)), and each repo's live output stays as it is.
    • Cost: meta --sequential git frobnicate still prints git's message once per repo, as it streams.
  • Tool extensions are in the text listing only, not in --json (reason above).

Tests (properties, existing patterns)

  • help.bats: meta --help, meta help fake and meta fake --help list a fake PATH plugin's own commands and its as-typed rule. meta --help lists every command meta-git declares. Verb help starts with the right owner line for adapted (clone, commit, update) and as-typed (pull) commands, and for a meta-project command. A git-hello on PATH shows in meta plugin list (a shadowed git-commit doesn't) and runs as meta git hello. The cargo help test now checks git's shape.
  • exec.bats: a failure every repo shares prints once and the summary counts 4. Differing failures print per repo. --json keeps 4 records.
  • meta_git_cli: the adapted commands are exactly the routed ones, and each one's help has a Git options: line. meta_plugin_protocol: who answers a command, and the help text, follow runs_as_typed.
  • docs.rs passes, with the adapted list read from meta-git.

Verified

  • Gate at 9e7a8b2: clippy --workspace --all-targets --all-features -D warnings; cargo nextest run --workspace (8 threads): 631/631; bats tests/: 599/599 (the 5 install.ps1 tests skip: no pwsh here); docs.rs passes. c468b5f and ef4a651 change only tests, the docs test's caching and the owner-line wording; rechecked with clippy, docs.rs, help.bats and worktree_cloud.bats (70/70). The shadowed-extension check was confirmed to fail with the shadowing filter removed.
  • A real run in a sandbox (own HOME, XDG_*, GIT_CONFIG_GLOBAL, META_DATA_DIR) with a 3-repo workspace and a git-hello on PATH: every output quoted above is from that run.

Review

Two reviewers, two rounds, as the owner set for this PR:

  • Round 1 (9e7a8b2): Opus (simplicity, tests) said yes, with 7 notes; 1–5 were taken in c468b5f. Codex Sol (correctness, user-facing) said no, on one point: --sequential isn't grouped. Answered with the goal revision above.
  • Round 2: Sol said yes on c468b5f and accepted the revision. Opus found that the new shadowed-extension check could never fail (! grep mid-test). It was fixed in ef4a651 and shown to fail with the filter removed. Opus and Sol then both said yes on ef4a651.
  • CodeRabbit: one Minor (document the command_sections removal). Answered: it is documented here, and the title is now feat!:. The thread is resolved.
  • CI is green on ef4a651.

Not verified

  • macOS and Windows (CI covers macOS). On Windows only <tool>-<name>.exe files are listed as extensions.
  • Plugins outside this repo (none ship today).

Try it

cd ~/code/gitkb-dev/harmony/open-source/meta && git fetch origin meta-help-discovery && git worktree add ~/code/gitkb-dev/harmony/.worktrees/try-meta-help FETCH_HEAD && cd ~/code/gitkb-dev/harmony/.worktrees/try-meta-help && CARGO_TARGET_DIR=$PWD/target cargo build --workspace --bins && T=$PWD/target/debug && cd ~/code/gitkb-dev/harmony && for c in "--help" "git --help" "git status --help" "git clone --help" "git frobnicate" "plugin list"; do PATH="$T:$PATH" meta $c; done

(Remove it afterwards with git -C ~/code/gitkb-dev/harmony/open-source/meta worktree remove ~/code/gitkb-dev/harmony/.worktrees/try-meta-help.)

… extensions; one shared error prints once [[tasks/harmony-3042]]

- meta --help lists each plugin's own commands under its word, and what
  becomes of the rest ("any other git command runs as typed in each
  selected repo"), from the plugin's info. meta help <word> and
  meta <word> --help read the same info.
- PluginHelp: `commands` are the plugin's own commands; new
  `runs_as_typed` names the tool every other command runs as typed.
  `command_sections` is gone (only meta-git used it).
- meta <word> <verb> --help starts with who answers it: "adapted by
  meta-git" (then the plugin's help, ending with which of git's options
  it takes) or "runs as typed (`git pull`) in each selected repo" (then
  meta's own help for it: the selected repos, meta's options from its
  clap definitions, and where git's help is). meta cargo has the same
  shape and no "Commands: cargo".
- When every repo fails with the same output and exit, meta prints the
  output once under all their names; the summary still counts each.
- meta plugin list adds the tool extensions on PATH (git-*, cargo-*) as
  `meta git <name>`; meta plugin --help and the README say how a meta
  plugin differs from a tool's own extension.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

  • Run on-demand review

This review includes 5 billable files and costs up to $1.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 41 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 1822bc82-3b13-400f-8ef0-02aa43f00593
Commits

Reviewing files that changed from the base of the PR and between 9e7a8b2 and ef4a651.

Files selected for processing: 5
  • README.md
  • meta_cli/src/main.rs
  • meta_cli/tests/docs.rs
  • tests/help.bats
  • tests/worktree_cloud.bats

Walkthrough

The plugin protocol and CLI now distinguish plugin-owned commands from commands run as typed, route command help, and report eligible tool extensions on PATH. The built-in plugins and documentation use the updated help metadata. Parallel failure output groups results when their failure details match.

Changes

Plugin Discovery and Help

Layer / File(s) Summary
Plugin help contract
meta_plugin_protocol/src/lib.rs
PluginHelp now uses a flat command map and optional runs_as_typed field. Verb classification and rendered help identify plugin-owned and typed commands.
Built-in plugin metadata and help
meta_git_cli/src/lib.rs, meta_git_cli/src/main.rs, meta_git_cli/src/clone.rs, meta_git_cli/src/clone_missing.rs, meta_git_cli/src/commands/worktree/mod.rs, meta_git_cli/src/commit.rs, meta_git_cli/src/update.rs, meta_rust_cli/src/*, meta_project_cli/src/main.rs
The Git plugin reports its adapted commands and typed-command fallback. Git command help states which Git options are supported. Cargo and project plugins use the revised metadata.
CLI help routing and extension discovery
meta_cli/src/main.rs, meta_cli/src/subprocess_plugins.rs, meta_cli/tests/docs.rs, tests/help.bats, tests/git.bats, README.md, claude-plugin/skills/meta-plugins/SKILL.md, docs/plugin_development.md
The CLI routes help by command type and lists eligible tool extensions found on PATH. Tests and documentation describe plugin discovery, help attribution, and command routing.

Parallel Failure Output

Layer / File(s) Summary
Group identical failures
loop_lib/src/lib.rs, tests/exec.bats
Failure summaries and captured output group results when their command, output, exit code, and signal match. The integration test checks grouped and distinct failures, plus JSON records.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant MetaCLI
  participant PluginInfo
  participant MetaGit
  User->>MetaCLI: Request command help
  MetaCLI->>PluginInfo: Classify the command verb
  PluginInfo-->>MetaCLI: Return Own, AsTyped, or Unknown
  alt Plugin-owned command
    MetaCLI->>MetaGit: Send help request
    MetaGit-->>MetaCLI: Return plugin command help
  else Typed command
    MetaCLI->>MetaCLI: Generate help with scope and meta options
  end
Loading

Suggested reviewers: mateodelnorte

Merge Risk: Low · previous review 9e7a8

Older plugins may lose their command descriptions in help until they migrate. Document the required metadata change before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the three main changes in the PR: help text now states which component answers each command, meta plugin list shows tool extensions found on PATH, and identical captured errors print…
Full details: Title check

Explanation

The title names the three main changes in the PR: help text now states which component answers each command, meta plugin list shows tool extensions found on PATH, and identical captured errors print once. The raw summary and objectives confirm each of these changes is in the changeset. The title is long (134 characters, 19 words) and uses a conventional-commit prefix with a tracker tag, so it is less concise than ideal. It still clearly and specifically describes the primary changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 20 functions across 17 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit reads the help at dawn,
And finds the typed commands drawn.
PATH keeps extensions in a row,
While failures join when details show.
The burrow hums; the tests all glow.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: ea4b7741-3ede-4664-be4d-9c65d6fb1274
Commits

Reviewing files that changed from the base of the PR and between 6443547 and 9e7a8b2.

Files selected for processing: 21
  • README.md
  • claude-plugin/skills/meta-plugins/SKILL.md
  • docs/plugin_development.md
  • loop_lib/src/lib.rs
  • meta_cli/src/main.rs
  • meta_cli/src/subprocess_plugins.rs
  • meta_cli/tests/docs.rs
  • meta_git_cli/src/clone.rs
  • meta_git_cli/src/clone_missing.rs
  • meta_git_cli/src/commands/worktree/mod.rs
  • meta_git_cli/src/commit.rs
  • meta_git_cli/src/lib.rs
  • meta_git_cli/src/main.rs
  • meta_git_cli/src/update.rs
  • meta_plugin_protocol/src/lib.rs
  • meta_project_cli/src/main.rs
  • meta_rust_cli/src/lib.rs
  • meta_rust_cli/src/main.rs
  • tests/exec.bats
  • tests/git.bats
  • tests/help.bats
Files with no reviewable changes: 1
  • meta_rust_cli/src/lib.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@coderabbitai
coderabbitai Bot requested a review from mateodelnorte November 3, 2026 03:20
…cs test asks meta-git once [[tasks/harmony-3042]]

The owner line of an adapted command no longer names a git command that
may not exist (`git clone-missing`): "meta's own command, not git run
as typed".

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread meta_plugin_protocol/src/lib.rs Resolved
@gold-silver-copper gold-silver-copper changed the title feat: help says who answers each command; meta plugin list shows tool extensions; one shared error prints once [[tasks/harmony-3042]] feat!: help says who answers each command; meta plugin list shows tool extensions; one shared error prints once [[tasks/harmony-3042]] Nov 3, 2026
…tasks/harmony-3042]]

A negated command mid-test (`! grep ...`) never fails a bats test.
Checked: with the shadowing filter removed, the test now fails.
@gold-silver-copper
gold-silver-copper merged commit 1c96c7e into main Nov 3, 2026
12 of 13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant