Files
ruflo/.github
ruv 3ce5a6c896 test(metaharness): MCP tool runtime contract — 65 assertions across 7 tools (iter 23)
Closes the last verification gap. tsc proves metaharness-tools.ts
COMPILES; structural smoke proves the source DECLARES the right
shape; this test proves the HANDLERS actually run correctly at
runtime against the compiled dist.

THE CONTRACT EACH TOOL MUST SATISFY
- handler is async-callable as `await tool.handler({...})`
- returns { success, data, degraded, exitCode } object
- never throws (even with bad/missing optional dep — graceful)
- honors a 30s timeout per invocation (no hangs)

VERIFIED LOCALLY (post npm run build, 48s wall, 65/65 assertions)
  Phase 1 — module shape:
    metaharnessTools is an array ✓
    7 tools registered ✓
    All 7 expected names present ✓
  Phase 2 — per-tool shape (5 fields × 7 tools = 35 checks):
    {name, description, category, handler, inputSchema} ✓
    category === 'metaharness' ✓
  Phase 3 — handler invocations (5 contract fields × 7 tools = 35 checks):
    handler does not throw ✓
    returns object ✓
    has 'success' / 'data' / 'degraded' / 'exitCode' keys ✓

GRACEFUL SKIP
When `dist/src/mcp-tools/metaharness-tools.js` doesn't exist (no
build), the script prints SKIPPED + a "build first" hint and exits 0.
This keeps the smoke contract fast — the test only runs in CI
post-build OR when developers explicitly build + run.

CI INTEGRATION
metaharness-ci.yml router-compat job extended:
  - Installs CLI deps + runs `npm run build`
  - Then runs the runtime test
  - Slow path (~50s) acceptable for the value (proves the iter-20/21
    MCP-tool wiring is actually invokable, not just type-correct)

SMOKE STEP 17o
- 4 contract-field assertions present in source
- All 7 tool names enumerated
- SKIPPED-doc present (graceful pre-build path)

Smoke: 30 → 31. Fleet: 33/33. tsc clean.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-16 15:15:36 -04:00
..