07 — Real Smoke Harness
— 07 REAL SMOKE HARNESS
Artifact: rp-production-smoke.sh (staged on VPS at /opt/incomex/docs/mcp-writes/rp-production-api-fix-2026-06-06/ and locally at /Users/nmhuyen/). One command, one verdict, exit 0 = ready / exit 1 = not ready.
What it does:
- Probes the page (/, /knowledge/registries, /knowledge/registries-pivot, /knowledge/pivot) and all RP APIs with a configurable BASE and timeout.
- For HEALTHY APIs it asserts both the expected 200 AND the presence of an expected JSON key (e.g. counts->total, system-issues->totals, registries-pivot/summary->integrity) so a 200 with an empty/wrong body still fails — guarding against false-green.
- For the previously-broken three it asserts 200 plus a key (matrix->summary, pivot-query->definitions, registries/index 200).
- For the four PARAM_REQUIRED routes it asserts 400 (by design) and does not count them as failures.
- A slow-watch lane times species-matrix and warns if it crosses 20s.
- Prints the PIVOT_MISSING expectation (14, all explained) with the psql one-liner to confirm the guard verdict.
- Exits non-zero with a clear "DO NOT mark UI production-ready" message if any real break is present.
Proof it is real (run against CURRENT production, 2026-06-06 05:11 UTC): the harness reported OK for all 12 healthy and 4 param routes, FAIL 500 for matrix, FAIL 500 for pivot-query, FAIL 404 for registries/index, species-matrix time_total ~17.8s, and RESULT: FAIL — 3 real break(s), exit 1. This demonstrates the harness detects exactly the known breaks and cannot be fooled by the page returning 200.
The smoke contract is also encoded in the DB as v_rp_production_api_smoke_expectation (route -> method -> expected_status -> expected_json_key) so the expectations are versioned alongside the views.
Usage: BASE=https://vps.incomexsaigoncorp.vn ./rp-production-smoke.sh . After the operator applies the fixes, a PASS (exit 0) with no FAIL lines is the readiness signal.