fix(demo): keep each operator-report label on one line
Quality gates / quality (push) Waiting to run
Quality gates / quality (push) Waiting to run
The first recorded card split 'ANALYZE REQUESTS' and every 'FAILURE' label across two lines, detaching each label from its count. Long CLI labels are now folded into values (one wrapped failures line), the key column holds only short keys, and the card was geometry-probed at the recording's phone viewport before rebuilding: 706px of content in a 706px panel, no clipped key.
This commit is contained in:
1 parent
ef83ad93bb
commit
664a909957
1 file changed
+29
-10
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user