feat: phase 2 — am lab (benchmark N agents) + plugins d'événements (contrat JSON)

- #62: am lab --agents a,b --task <f> — séquentiel ou --parallel, capture
  durée/exit/sortie/coût estimé, rapport comparatif tableau + --json stable,
  tâches versionnables dans <state>/lab/ (--list), rejouables à l'identique
- #75: plugins/ sous state_dir, déclenchés sur on_install/on_start/on_stop/
  on_update (App::emit), contrat JSON stdin/stdout, timeout configurable,
  échec non bloquant, garde anti-récursion AM_PLUGINS_RUNNING, am plugins
  + am plugins --test <name> (CI), exemples notify + ci-webhook
- intégration REPL (parse, complétion, bannière, is_am_command), help, tips,
  man pages (am-lab.1, am-plugins.1), README, ROADMAP (26/27), v0.5.4
- 334 tests verts (309 + 25)

closes #62
closes #75
This commit is contained in:
2026-08-18 14:17:30 -04:00
parent aa0d8e43eb
commit 4c7866a25a
29 changed files with 2123 additions and 8 deletions
+38
View File
@@ -339,6 +339,44 @@ pub static HELP_SPECS: &[HelpSpec] = &[
HelpExample { desc: "Replay without asking, with a variable.", code: "playbook deploy.yaml --yes --var agent=claude-code" },
],
},
HelpSpec {
name: "lab",
category: "Commands",
usage: "lab --agents a,b --task <file> {flags}",
about: "Benchmark: run the same task on several agents and compare duration, exit code, output and estimated cost (issue #62).",
search_terms: &["benchmark", "compare", "comparer", "bench", "perf"],
flags: &[
HelpFlag { short: "", long: "--agents", value: "LIST", desc: "Comma-separated agent names (or aliases) to benchmark (required)" },
HelpFlag { short: "", long: "--task", value: "FILE", desc: "Task file (bare name resolves under state_dir/lab/, .yaml appended)" },
HelpFlag { short: "", long: "--parallel", value: "", desc: "Run every agent concurrently instead of one after another" },
HelpFlag { short: "", long: "--timeout", value: "SECS", desc: "Override the task timeout in seconds" },
HelpFlag { short: "", long: "--list", value: "", desc: "List the task files of the lab directory" },
],
subcommands: &[],
parameters: &[],
io: None,
examples: &[
HelpExample { desc: "Run the task sequentially on two agents.", code: "lab --agents claude-code,aider --task hello.yaml" },
HelpExample { desc: "Machine-readable comparative report.", code: "lab --agents claude-code,codex --task bench.yaml --json --parallel" },
],
},
HelpSpec {
name: "plugins",
category: "Commands",
usage: "plugins {flags}",
about: "List the event plugins of the state directory and test one against a synthetic event (issue #75).",
search_terms: &["plugin", "extension", "hooks", "notify", "webhook"],
flags: &[
HelpFlag { short: "", long: "--test", value: "NAME", desc: "Run one plugin on a synthetic event and print its response (CI hook)" },
],
subcommands: &[],
parameters: &[],
io: Some(("JSON (stdin)", "JSON object (stdout)")),
examples: &[
HelpExample { desc: "List the installed plugins.", code: "plugins" },
HelpExample { desc: "Exercise the contract of one plugin.", code: "plugins --test notify" },
],
},
HelpSpec {
name: "top",
category: "Commands",