diff --git a/scripts/record_release_demo.mjs b/scripts/record_release_demo.mjs index 4f21c14..78affe5 100644 --- a/scripts/record_release_demo.mjs +++ b/scripts/record_release_demo.mjs @@ -1573,26 +1573,45 @@ for (const line of reportRun.stdout.split('\n')) { } } if (sections !== 3) throw new Error(`the operator report must separate the app, queue, and model boundaries, not ${sections} of them`); -const analyzeRow = parsedRows.find(([key]) => /^analyze requests$/i.test(key)); -if (!analyzeRow || Number(analyzeRow[1]) < 1) { +const rowValue = pattern => { + const found = parsedRows.find(([key]) => pattern.test(key)); + if (!found) throw new Error(`the operator report is missing the ${pattern} row: ${reportRun.stdout}`); + return found[1]; +}; +const failureRows = parsedRows.filter(([key]) => /^failure /i.test(key)); +if (failureRows.length !== 8) throw new Error(`the report must print all eight enumerated failure classes, not ${failureRows.length}`); +const failureList = failureRows.map(([key, value]) => `${key.replace(/^failure /i, '')} ${value}`).join(' · '); +const analyzeCount = Number(rowValue(/^analyze requests$/i)); +if (!Number.isFinite(analyzeCount) || analyzeCount < 1) { throw new Error(`the report must count this recording's own requests, not a zero: ${reportRun.stdout}`); } const metricsCard = await evidenceCard({ id: 'operator-health-report', title: 'OPERATOR HEALTH REPORT', - subtitle: 'command line, not app UI — this recording’s own server, demo token', + // Long CLI labels are folded into values on purpose: a key column narrow enough to fit the phone + // splits `analyze requests` across two lines and detaches it from its count. + subtitle: 'command line, not app UI — loopback :4173, demo token', rows: [ - ['command', 'node scripts/model_metrics_report.mjs'], - ['target', 'http://127.0.0.1:4173 · loopback only'], + ['section', 'APP'], + ['uptime', rowValue(/^uptime$/i)], + ['requests', `${analyzeCount} analyzed · ${rowValue(/^refused before model$/i)} refused before the model`], + ['section', 'QUEUE'], + ['in flight', rowValue(/^in flight$/i)], + ['accepted', rowValue(/^accepted$/i)], + ['at capacity', rowValue(/^at capacity$/i)], + ['section', 'MODEL'], + ['readiness', rowValue(/^readiness$/i)], + ['outcomes', rowValue(/^outcomes$/i)], + ['abstention', rowValue(/^abstention$/i)], + ['latency', rowValue(/^latency$/i)], + ['failures', failureList], ['—', ''], - ...parsedRows, - ['—', ''], - ['wrong token', 'refused · exit 1 · no counters returned'], + ['wrong token', 'refused · exit 1 · no counters'], ], font: '600 9.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace', - keyWidth: 74, + keyWidth: 72, gap: '1px', - rowGap: '5px', + rowGap: '6px', }); await sleep(420); const metricsCardProof = await evidenceCardProof('operator-health-report');