mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 06:36:49 +09:00
Two related correctness fixes.
PROBLEM A — STALE SUBCOMMAND DESCRIPTION
`v3/@claude-flow/cli/src/commands/metaharness.ts` exposed `options[]`
with a description string that listed only the iter-3 set:
"One of: score | genome | mcp-scan | threat-model | mint"
5 subcommands were missing from the description: oia-audit (iter 7),
audit-list (iter 16), audit-trend (iter 15), similarity (iter 36),
drift-from-history (iter 53). The help text would surface those via
`metaharness help`, but `metaharness --help` (the auto-generated
option-list output) still claimed only 5.
PROBLEM B — NO ANTI-MINT-MCP GUARD
ADR-150 §Sandboxing explicitly says mint must NEVER be exposed via
MCP because it writes to the filesystem with explicit --confirm. The
9 metaharness MCP tools deliberately omit metaharness_mint.
But there's no test enforcing the omission. A future iter that mass-
generates MCP tools from the SUBCOMMANDS map (a tempting refactor)
would silently include metaharness_mint and violate the sandboxing
rule. The agent-callable mint would let LLMs scaffold harnesses
without the human confirmation gate.
WHAT SHIPPED
1. v3/@claude-flow/cli/src/commands/metaharness.ts — description
string now lists all 10 dispatchable subcommands, with a comment
reminding maintainers to keep it in sync with the SUBCOMMANDS map.
2. plugins/ruflo-metaharness/scripts/smoke.sh — step 17z36:
- Positive: all 10 subcommand names appear in metaharness.ts
- NEGATIVE (the load-bearing guard): grep returns no match for
`name: 'metaharness_mint'` in metaharness-tools.ts. If it ever
does, miss="mint-leaked-to-mcp" and smoke fails.
WHY THE NEGATIVE GREP MATTERS
This is the kind of gap that doesn't surface in normal testing — no
existing test exercises mint via MCP because it isn't supposed to
exist. A regression that adds it would simply ADD a passing test
case alongside the 9 existing ones. The negative grep is the only
shape of check that catches this class of bug.
GATES THIS ITER
smoke: 75 → 76 (step 17z36 green)
tsc: clean rebuild of metaharness.ts
--help: now lists all 10 subcommands accurately
ITER 53-73 MCP-CLI SAFETY MATRIX
CLI subcommands: 10 (score, genome, mcp-scan, threat-model,
oia-audit, audit-list, audit-trend,
similarity, drift-from-history, mint)
MCP tools: 9 (= 10 - mint per ADR-150 §Sandboxing)
Help text: CURRENT (was iter-3 stale)
Anti-MCP guard: PRESENT (was: implicit, now: smoke-asserted)
The 10:9 asymmetry between CLI and MCP is now contract-anchored.
Co-Authored-By: RuFlo <ruv@ruv.net>