(scenario, mode)
| 491 | } |
| 492 | |
| 493 | function renderBenchmarkScenario(scenario, mode) { |
| 494 | const lines = [ |
| 495 | `- Purpose: ${scenario.purpose || "Not provided"}`, |
| 496 | ...(scenario.successChecklist?.length > 0 |
| 497 | ? scenario.successChecklist.map((item) => `- Success checklist: ${item}`) |
| 498 | : []), |
| 499 | ]; |
| 500 | |
| 501 | lines.push(`- Status: ${scenario.status}`); |
| 502 | lines.push(`- Duration: ${scenario.durationMs} ms`); |
| 503 | lines.push(`- Tool calls: ${scenario.telemetry?.toolCallCount || 0}`); |
| 504 | lines.push(`- Shell commands: ${scenario.telemetry?.shellCommandCount || 0}`); |
| 505 | lines.push(`- Failed shell commands: ${scenario.telemetry?.failedShellCommandCount || 0}`); |
| 506 | lines.push(`- Usage availability: ${scenario.usageAvailability || "unavailable"}`); |
| 507 | |
| 508 | if (scenario.usage) { |
| 509 | lines.push(`- Input tokens: ${scenario.usage.input_tokens || 0}`); |
| 510 | lines.push(`- Output tokens: ${scenario.usage.output_tokens || 0}`); |
| 511 | lines.push(`- Total tokens: ${scenario.usage.total_tokens || 0}`); |
| 512 | } |
| 513 | |
| 514 | if (scenario.workspaceSummary) { |
| 515 | lines.push(`- Added files: ${scenario.workspaceSummary.addedFileCount}`); |
| 516 | lines.push(`- Modified files: ${scenario.workspaceSummary.modifiedFileCount}`); |
| 517 | lines.push(`- Deleted files: ${scenario.workspaceSummary.deletedFileCount}`); |
| 518 | lines.push(`- Generated tests: ${scenario.workspaceSummary.generatedTestFileCount}`); |
| 519 | } |
| 520 | |
| 521 | if (scenario.finalMessagePreview) { |
| 522 | lines.push("", "```text", scenario.finalMessagePreview, "```"); |
| 523 | } |
| 524 | |
| 525 | if (scenario.workspaceChanges?.length > 0) { |
| 526 | lines.push("", ...scenario.workspaceChanges.map((entry) => `- ${entry.status}: ${entry.path}`)); |
| 527 | } |
| 528 | |
| 529 | if (scenario.verifierResults?.length > 0) { |
| 530 | lines.push("", ...scenario.verifierResults.map((result) => `- Verifier [${result.status}]: ${result.command}`)); |
| 531 | } |
| 532 | |
| 533 | if (scenario.generatedCode?.metrics?.length > 0) { |
| 534 | lines.push("", ...scenario.generatedCode.metrics.map((metric) => `- ${metric.id}: ${metric.value} ${metric.unit} (${metric.band})`)); |
| 535 | } |
| 536 | |
| 537 | if (scenario.generatedCode?.checks?.length > 0) { |
| 538 | lines.push("", ...scenario.generatedCode.checks.map((check) => `- [${check.status}] ${check.message}`)); |
| 539 | } |
| 540 | |
| 541 | return detailsBlock(scenario.title, lines.join("\n")); |
| 542 | } |
| 543 | |
| 544 | function renderBenchmarkRun(payload) { |
| 545 | const benchmarkPayload = ensureBenchmarkRunPayload(payload); |
no test coverage detected