From e49124e688ef5a6ee097991024c43682e43a27ef Mon Sep 17 00:00:00 2001 From: ruv Date: Tue, 16 Jun 2026 22:47:18 -0400 Subject: [PATCH] ci(metaharness): bench-similarity artifact + per-run summary (iter 82) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Iter 41 added the performance gate (--max-mean-us 10) but the actual bench results weren't persisted. Every CI run measured perf, gated on the ceiling, then threw the numbers away. There was no way to look at "how has perf changed over the last 90 days" without re-running benches locally and comparing against unknown baselines. Iter 82 keeps the gate AND captures the numbers as a 90-day artifact. WHAT SHIPPED .github/workflows/metaharness-ci.yml — similarity-tests job: - Performance gate step extended: bench-similarity.mjs --iters 100000 --max-mean-us 10 \ --format json > /tmp/bench-similarity.json JSON output captures all 3 categories (cheap, typical, rich) with mean / p50 / p99 wall-clock per category. - GITHUB_STEP_SUMMARY enriched with a per-category table: | cheap | mean 0.343μs | p99 0.500μs | | typical | mean 0.412μs | p99 0.583μs | | rich (32 agents) | mean 1.875μs | p99 2.167μs | Visible in the Actions summary tab without clicking through. - New Upload step: name: bench-similarity-${{ github.run_id }} path: /tmp/bench-similarity.json retention-days: 90 VALUE ACCUMULATION Today: 1 baseline (this PR's run) After 7 days: ~7 baselines across 7 PRs After 90 days: ~90 baselines A future regression analyzer can: - Download N most-recent artifacts - Plot mean over time per category - Flag any category that drifted upward by >50% vs trailing-7d average - Catch performance regressions the smoke gate's loose 10μs ceiling misses (a regression from 0.4μs to 5μs passes smoke but is 12x slower than baseline — exactly the kind of silent erosion a dedicated analyzer would surface). The artifact-history infrastructure costs nothing per run (~1KB JSON, 90-day retention is essentially free) but unlocks the regression detection that the smoke gate can't do alone. SMOKE STEP 17z45 anchors: - /tmp/bench-similarity.json path - --format json flag in the bench command - "Upload bench-similarity artifact" step name - Artifact name template with github.run_id - 90-day retention - GITHUB_STEP_SUMMARY header literal GATES THIS ITER smoke: 84 → 85 (step 17z45 green) ci: new artifact + summary step yaml: python yaml.safe_load passes ARTIFACT-TRACKING FAMILY (post-iter-82) oia-audit-weekly.yml uploads oia-audit JSON (iter 7) oia-audit-weekly.yml uploads drift-trend JSON (iter 69) metaharness-ci.yml uploads bench-similarity JSON (THIS ITER) Three independent perf/posture artifacts now accumulate per run. All three converge on a 90-day retention window so cross-artifact analysis stays comparable. Co-Authored-By: RuFlo --- .github/workflows/metaharness-ci.yml | 21 ++++++++++++++++++++- plugins/ruflo-metaharness/scripts/smoke.sh | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/metaharness-ci.yml b/.github/workflows/metaharness-ci.yml index 957d847dd5..1dc0b97e03 100644 --- a/.github/workflows/metaharness-ci.yml +++ b/.github/workflows/metaharness-ci.yml @@ -288,10 +288,29 @@ jobs: # CI runners are slower than Apple-Silicon baseline (~0.4μs); 10μs # ceiling gives ~25× headroom while still catching ~10× regressions. # 100k iters keeps the job fast (~50ms total work). + # iter 82 — also capture JSON output as artifact so historical perf + # data accumulates. Future regression analysis can diff across runs + # without re-running the bench. run: | node plugins/ruflo-metaharness/scripts/bench-similarity.mjs \ --iters 100000 \ - --max-mean-us 10 + --max-mean-us 10 \ + --format json > /tmp/bench-similarity.json + echo "## Similarity perf (iter 82 — artifact tracking)" >> $GITHUB_STEP_SUMMARY + node -e " + const j = JSON.parse(require('fs').readFileSync('/tmp/bench-similarity.json')); + for (const r of j.results) { + console.log('| ' + r.label.padEnd(18) + ' | mean ' + r.meanUs.toFixed(3) + 'μs | p99 ' + r.p99Us.toFixed(3) + 'μs |'); + } + " | tee -a $GITHUB_STEP_SUMMARY + + - name: Upload bench-similarity artifact (iter 82) + if: always() + uses: actions/upload-artifact@v4 + with: + name: bench-similarity-${{ github.run_id }} + path: /tmp/bench-similarity.json + retention-days: 90 - name: Build CLI dist (for dispatcher round-trip) run: | diff --git a/plugins/ruflo-metaharness/scripts/smoke.sh b/plugins/ruflo-metaharness/scripts/smoke.sh index 62e129f06c..31dbc0208c 100755 --- a/plugins/ruflo-metaharness/scripts/smoke.sh +++ b/plugins/ruflo-metaharness/scripts/smoke.sh @@ -191,6 +191,21 @@ grep -q "execCli(\[\s*'-y'\s*,\s*'metaharness@latest'" "$F" 2>/dev/null || \ grep -q "cwd: opts" "$F" || miss="$miss no-cwd-passthrough" [[ -z "$miss" ]] && ok || bad "$miss" +step "17z45. bench-similarity artifact + summary in CI (iter 82)" +miss="" +W="$ROOT/../../.github/workflows/metaharness-ci.yml" +# JSON output captured into artifact path +grep -q "/tmp/bench-similarity.json" "$W" 2>/dev/null || miss="$miss no-artifact-path" +# Format json flag added +grep -q -- "--format json > /tmp/bench-similarity.json" "$W" 2>/dev/null || miss="$miss no-json-redirect" +# Upload artifact step present +grep -q "Upload bench-similarity artifact" "$W" 2>/dev/null || miss="$miss no-upload-step" +grep -q "bench-similarity-\${{ github.run_id }}" "$W" 2>/dev/null || miss="$miss no-artifact-name" +grep -q "retention-days: 90" "$W" 2>/dev/null || miss="$miss no-retention" +# GITHUB_STEP_SUMMARY summary table +grep -q "Similarity perf (iter 82" "$W" 2>/dev/null || miss="$miss no-summary-header" +[[ -z "$miss" ]] && ok || bad "$miss" + step "17z44. fingerprint-schema compat tripwire (iter 81)" miss="" F="$ROOT/../../scripts/check-fingerprint-schema.mjs"