Files
ruflo/.github
ruv 853586bfe5 ci(metaharness): promote bench-recordpair-overhead to a CI regression gate (iter 25)
Iter 24 shipped the micro-benchmark as informational only. Iter 25
turns it into a CI gate: if a future PR accidentally inflates the
iter-12 dispatch overhead beyond 500ns/call, the PR FAILS.

NEW FLAG
  --max-overhead-ns N
    Exit 1 if (meanNsPerCall of envCheck OFF − meanNsPerCall of
    baseline) > N. Default: not set (informational only).

THRESHOLD RATIONALE
500ns chosen as ~3.5× headroom over the iter-24 measured baseline of
~147ns on Apple Silicon / Node 22. The headroom absorbs:
  - GitHub-Actions runners are slower (~2-3× ARM laptops)
  - V8 JIT variability between runs
  - Future Node version JIT regressions

If the gate ever fires, that's a real signal — something added work
to the default-path env check. The benchmark output points at
model-router.ts route() for inspection.

CI WIRING (metaharness-ci.yml)
- New step after the MCP-tool runtime test
- Runs `bench --max-overhead-ns 500 --format json` (exits non-zero on
  regression)
- Pretty-prints "Measured overhead: Xns; Headroom: Yns" to the
  workflow log
- Uploads the JSON artifact with 90-day retention so trend tracking
  is possible without grepping past workflow runs

VERIFIED
  --max-overhead-ns 500:  exit 0 (measured 150ns ≤ 500ns)
  --max-overhead-ns 10:   exit 1 (regression detected)
  No flag:                exit 0 (informational only — backward compat)

SMOKE STEP 17p — broadened
- --max-overhead-ns flag present
- "REGRESSION" message present
- process.exit(1) for fail-closed
- CI workflow wires the 500ns threshold (drift guard — fails CI if
  someone removes the gate from the workflow)

Smoke: 32 (step 17p broadens, no count change). Fleet: 33/33.

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