diff --git a/plugins/ruflo-metaharness/scripts/oia-audit.mjs b/plugins/ruflo-metaharness/scripts/oia-audit.mjs index 9f5f347740..d2e37b4494 100755 --- a/plugins/ruflo-metaharness/scripts/oia-audit.mjs +++ b/plugins/ruflo-metaharness/scripts/oia-audit.mjs @@ -114,11 +114,13 @@ async function main() { } const startedAt = new Date().toISOString(); + const wallStart = Date.now(); // iter 56 — run the 5 sub-audits in parallel (was sequential pre-iter-56). // Worst-case wall-clock improves from 5×TIMEOUT to 1×TIMEOUT in the // unreachable-registry case; the happy path improves from sum-of-durations // to max-of-durations (typically ~2-4× faster). const all = await runAllParallel(ARGS.path); + const wallMs = Date.now() - wallStart; const { oiaManifest: oia, threatModel: tm, mcpScan: mcp, score, genome } = all; // If all FIVE say "metaharness not available", surface the degraded @@ -147,10 +149,23 @@ async function main() { } } + // iter 59 — surface parallelization metrics. wallMs is the actual + // time the 5 subprocess race took (max of components); the sum of + // component.durationMs is what a SERIAL implementation would have + // taken. A future smoke gate compares them to catch silent + // serialization regression. + const sumComponentMs = Object.values(all).reduce( + (a, c) => a + (c?.durationMs ?? 0), 0); const payload = { path: ARGS.path, startedAt, finishedAt: new Date().toISOString(), + timing: { + wallMs, + sumComponentMs, + parallelSpeedup: sumComponentMs > 0 + ? Math.round((sumComponentMs / Math.max(wallMs, 1)) * 100) / 100 : 0, + }, composite: { worst: compositeWorst, threatModelWorst: tmWorst, mcpScanWorst: mcpWorst }, components: { oiaManifest: oia, threatModel: tm, mcpScan: mcp, score, genome }, // iter 38 — denormalized harness fingerprint for cheap similarity(). diff --git a/plugins/ruflo-metaharness/scripts/smoke.sh b/plugins/ruflo-metaharness/scripts/smoke.sh index 911fe30292..35b934ac8b 100755 --- a/plugins/ruflo-metaharness/scripts/smoke.sh +++ b/plugins/ruflo-metaharness/scripts/smoke.sh @@ -191,6 +191,25 @@ 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 "17z22. oia-audit timing field + parallel-speedup gate (iter 59)" +miss="" +OIA="$ROOT/scripts/oia-audit.mjs" +grep -q "wallStart\|wallMs = Date.now" "$OIA" 2>/dev/null || miss="$miss no-wall-start" +grep -q "timing: {" "$OIA" 2>/dev/null || miss="$miss no-timing-field" +grep -q "sumComponentMs" "$OIA" 2>/dev/null || miss="$miss no-sum-field" +grep -q "parallelSpeedup" "$OIA" 2>/dev/null || miss="$miss no-speedup-field" +# Runtime: speedup must be > 2x (sanity — sequential would be ~1x) +OUT=$(node "$OIA" --dry-run --format json 2>&1) +SPEEDUP=$(echo "$OUT" | python3 -c " +import json, sys, re +m = re.search(r'\{[\s\S]*\}', sys.stdin.read()) +d = json.loads(m.group()) +print(d.get('timing', {}).get('parallelSpeedup', 0)) +" 2>/dev/null) +# Compare as float — speedup should exceed 2.0 (5 sequential calls → max-of-5 parallel) +python3 -c "import sys; sys.exit(0 if float('$SPEEDUP') > 2.0 else 1)" || miss="$miss serial-regression-detected:speedup=$SPEEDUP" +[[ -z "$miss" ]] && ok || bad "$miss" + step "17z21. drift-from-history parallelizes audit-list + oia-audit (iter 58)" miss="" F="$ROOT/scripts/drift-from-history.mjs"