fix(flight-finder): require fresh search evidence and improve PDF layout
This commit is contained in:
@@ -14,6 +14,13 @@ import {
|
||||
function samplePayload(): FlightReportPayload {
|
||||
return {
|
||||
request: normalizeFlightReportRequest(DFW_BLQ_2026_PROMPT_DRAFT).request,
|
||||
searchExecution: {
|
||||
freshSearch: true,
|
||||
startedAt: "2026-03-30T20:45:00Z",
|
||||
completedAt: "2026-03-30T21:00:00Z",
|
||||
artifactsRoot: "/Users/stefano/.openclaw/workspace/reports/dfw-blq-flight-report-2026-03-30-exec",
|
||||
notes: ["Fresh bounded search executed for this report."]
|
||||
},
|
||||
sourceFindings: [
|
||||
{
|
||||
source: "kayak",
|
||||
@@ -74,3 +81,21 @@ test("renderFlightReportPdf rejects incomplete report payloads", async () => {
|
||||
ReportValidationError
|
||||
);
|
||||
});
|
||||
|
||||
test("renderFlightReportPdf rejects payloads that are not marked as fresh-search output", async () => {
|
||||
const outputPath = path.join(os.tmpdir(), `flight-finder-stale-${Date.now()}.pdf`);
|
||||
await assert.rejects(
|
||||
() =>
|
||||
renderFlightReportPdf(
|
||||
{
|
||||
...samplePayload(),
|
||||
searchExecution: {
|
||||
...samplePayload().searchExecution,
|
||||
freshSearch: false
|
||||
}
|
||||
},
|
||||
outputPath
|
||||
),
|
||||
ReportValidationError
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user