From 36fb4adbc967e9c628cef2012dbce490f4ad7f68 Mon Sep 17 00:00:00 2001 From: Shakker Date: Thu, 7 May 2026 15:21:14 +0100 Subject: [PATCH] refactor: focus report paste handoff --- src/reporting/report.mjs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/reporting/report.mjs b/src/reporting/report.mjs index fffd449..b401dcc 100644 --- a/src/reporting/report.mjs +++ b/src/reporting/report.mjs @@ -816,7 +816,14 @@ export function renderPasteSummary(report) { lines.push(""); } - for (const record of records) { + const recordsForPaste = selectPasteRecords(records); + const omittedRecords = records.length - recordsForPaste.length; + if (omittedRecords > 0) { + lines.push(`Records omitted from paste handoff: ${omittedRecords} passing/uninteresting record(s). See summary JSON for the complete sample list.`); + lines.push(""); + } + + for (const record of recordsForPaste) { const failed = firstFailedCommand(record); lines.push(`Scenario: ${record.scenario}`); lines.push(`Result: ${record.status}`); @@ -824,7 +831,7 @@ export function renderPasteSummary(report) { if (record.status === "PASS" || record.status === "DRY-RUN") { lines.push(`Evidence: ${record.phases?.length ?? 0} phases recorded.`); if (record.measurements) { - pushMeasurementBrief(lines, record.measurements, { compact: false }); + pushMeasurementBrief(lines, record.measurements, { compact: true }); } } else if (record.violations?.length > 0) { if (record.measurements) { @@ -864,6 +871,24 @@ export function renderPasteSummary(report) { return lines.join("\n"); } +function selectPasteRecords(records) { + const failing = records.filter((record) => + record.status !== "PASS" || + (record.violations?.length ?? 0) > 0 || + record.measurements?.officialPluginEvidence?.ok === false + ); + if (failing.length > 0) { + return failing.slice(0, 8); + } + const interestingPasses = records.filter((record) => + (record.measurements?.agentTurns?.length ?? 0) > 0 || + record.measurements?.officialPluginEvidence?.available === true || + record.measurements?.gatewaySessionPreProviderAttribution?.count > 0 || + record.measurements?.agentCliPreProviderAttribution?.count > 0 + ); + return (interestingPasses.length > 0 ? interestingPasses : records).slice(0, 4); +} + function buildFailureBrief(report) { const records = report.records ?? []; const blockingCards = (report.gate?.cards ?? []).filter((card) => card.severity === "blocking");