{"record":{"id":"7e31527808ddbe75","repo":"chenglou/pretext","slug":"missing-keep-all-result-for-testcase-label","errorCode":null,"errorMessage":"Missing keep-all result for ${testCase.label}","messagePattern":"Missing keep-all result for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/keep-all-check.ts","lineNumber":160,"sourceCode":"      const batchReport = await loadPostedReport(\n        session,\n        url,\n        () => reportServer.waitForReport(null),\n        requestId,\n        reportBrowser,\n        timeoutMs,\n      )\n      if (batchReport.status === 'error') {\n        throw new Error(batchReport.message ?? 'keep-all batch failed')\n      }\n\n      const batchResults = batchReport.results ?? []\n      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))\n      for (const testCase of KEEP_ALL_ORACLE_CASES) {\n        if (!caseRunsInBrowser(testCase, browser)) continue\n        const report = reportsByLabel.get(testCase.label)\n        if (report === undefined) {\n          throw new Error(`Missing keep-all result for ${testCase.label}`)\n        }\n        printCaseResult(browser, testCase, report)\n        if (!reportIsExact(report)) ok = false\n      }\n    } finally {\n      reportServer.close()\n    }\n  } finally {\n    session?.close()\n    serverProcess?.kill()\n    lock.release()\n  }\n\n  return ok\n}\n\nconst port = await getAvailablePort(requestedPort === 0 ? null : requestedPort)\nlet overallOk = true","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/chenglou/pretext/blob/ac49b09b7d83ede19581fa94a8b892b07d309baf/scripts/keep-all-check.ts#L142-L178","documentation":"After a successful (status='ready') batch report, runBrowser() iterates KEEP_ALL_ORACLE_CASES and looks up each case's label in the results map. If a defined case has no corresponding entry in the batch results, this throws. It means the batch round-tripped fine but is incomplete relative to the oracle case set.","triggerScenarios":"The probe page ran and posted a 'ready' report, but omitted a result for one of the KEEP_ALL_ORACLE_CASES labels — e.g. a case was added to src/test-data.ts but the probe page's batch handler was not updated to emit it, or a case threw silently on the page and was skipped.","commonSituations":"Adding a new oracle case to test-data.ts without wiring it into the probe batch renderer; or a per-case exception in the page swallowed the result.","solutions":["Open src/test-data.ts KEEP_ALL_ORACLE_CASES and the probe batch page, and confirm every label defined in the former is produced by the latter.","Inspect the browser console / page logs for a per-case exception that swallowed a result.","If the missing case is genuinely not applicable to the current probe, gate it via its `browsers` field or remove it from KEEP_ALL_ORACLE_CASES."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// After receiving the batch report, assert coverage before iterating\nconst produced = new Set((batchReport.results ?? []).map(r => r.label))\nconst missing = KEEP_ALL_ORACLE_CASES.filter(c => caseRunsInBrowser(c, browser) && !produced.has(c.label))\nif (missing.length) {\n  console.error(`Probe omitted labels: ${missing.map(c => c.label).join(', ')}`)\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When adding a case to KEEP_ALL_ORACLE_CASES, update the probe batch renderer in the same change.","Log per-case exceptions on the probe page instead of swallowing them."],"tags":["browser-automation","probe","test-data","keep-all"],"backgroundTag":null,"analyzedSha":"ac49b09b7d83ede19581fa94a8b892b07d309baf","analyzedAt":"2026-08-12T17:03:16.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}