// 重构前 index.ts 只读参考：commit 6a04144d3f5103014f75b637d7e6bc2f45bf007f，blob 56e590c1a6b5ca7ad128bf2c992f60e46c355a58；可用 `git show 6a04144d3f5103014f75b637d7e6bc2f45bf007f:src/components/microservices/code-queue/src/index.ts` 查看。

import type { JudgeProbeCase } from "./types";

function nowIso(): string {
  return new Date().toISOString();
}

export const defaultJudgeProbeCases: JudgeProbeCase[] = [
  {
    id: "completed_exact_response",
    prompt: "Reply exactly: code-queue-judge-complete.",
    finalResponse: "code-queue-judge-complete.",
    expected: "complete",
    terminalStatus: "completed",
    outputs: [
      { channel: "user", text: "Reply exactly: code-queue-judge-complete.\n", method: "enqueue" },
      { channel: "assistant", text: "code-queue-judge-complete.", method: "item/agentMessage/delta" },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "completed_with_tool_evidence_but_no_current_final_response_should_retry",
    prompt: "调查 /mnt/f/Work/ConStart/docs/MDTODO 的最新进展，只读，并在最终回复中总结。",
    finalResponse: "",
    expected: "retry",
    expectedContinuePromptIncludes: [
      "最终 assistant response",
      "不能只执行工具",
    ],
    terminalStatus: "completed",
    outputs: [
      { channel: "user", text: "调查 /mnt/f/Work/ConStart/docs/MDTODO 的最新进展，只读，并在最终回复中总结。\n", method: "enqueue" },
      { channel: "tool", text: "opencode/tool: read /mnt/f/Work/ConStart/docs/MDTODO/20260419_频率判断.md status=completed; R1/R2 completed, R3 pending", method: "opencode/tool" },
      { channel: "system", text: "opencode completed status=completed exit=0 signal=null\n", method: "opencode/complete" },
    ],
    events: [{ at: nowIso(), method: "opencode/step_finish", status: "completed" }],
  },
  {
    id: "completed_but_plan_only",
    prompt: "Create /root/unidesk/tmp/judge_probe.txt containing exactly judge-probe-ok, then summarize the file path.",
    finalResponse: "I can do that. Plan: create the file under /root/unidesk/tmp and then summarize the path.",
    expected: "retry",
    terminalStatus: "completed",
    outputs: [
      { channel: "user", text: "Create /root/unidesk/tmp/judge_probe.txt containing exactly judge-probe-ok, then summarize the file path.\n", method: "enqueue" },
      { channel: "assistant", text: "I can do that. Plan: create the file under /root/unidesk/tmp and then summarize the path.", method: "item/agentMessage/delta" },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "pikapython_skill_ablation_not_run",
    prompt: "从这个结果看，是通过专门定向优化prompt解决了pikabench-4的可解性，并且使得其他组件都没有明显贡献，这个思路是错误的，输入任务prompt应当是通用的，需求导向而非精确控制内部过程的。改进方案是将专门定向的prompt改为泛化的经验型skill来注入，预期的结果是，不注入这个泛化的经验型skill，就不能跑出4/4，注入了就能跑出。将禁止针对任务定向优化prompt的原则也固化到 pipeline 长期文档。",
    finalResponse: "已把这轮“定向 prompt 解题”的路径改成“通用需求 prompt + 可消融的经验型 skill”。D601 Pipeline prompt 已去定向化，泛化经验已移入 PikaPython skill，no-skill 边界已恢复，长期规则已固化，测试已补防回归。验证已通过：npm run typecheck、npm run components:validate、npm run test，50 tests passed。我没有启动新的 PikaBench-4 baseline/no-skill 实跑，避免继续消耗 MiniMax 限额；现在代码与测试层面已经把“skill 可消融”边界重新建立起来。下一步如果要验证预期，应只跑最小对照：pikabench-4-ablation-baseline vs pikabench-4-no-skill。",
    expected: "retry",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "从这个结果看，是通过专门定向优化prompt解决了pikabench-4的可解性，并且使得其他组件都没有明显贡献，这个思路是错误的，输入任务prompt应当是通用的，需求导向而非精确控制内部过程的。改进方案是将专门定向的prompt改为泛化的经验型skill来注入，预期的结果是，不注入这个泛化的经验型skill，就不能跑出4/4，注入了就能跑出。将禁止针对任务定向优化prompt的原则也固化到 pipeline 长期文档。\n",
        method: "enqueue",
      },
      {
        channel: "command",
        text: "item/completed: bun scripts/cli.ts ssh D601 'cd /home/ubuntu/pipeline && npm run typecheck && npm run components:validate && npm run test' status=completed; 50 tests passed",
        method: "item/completed",
      },
      {
        channel: "assistant",
        text: "已把这轮“定向 prompt 解题”的路径改成“通用需求 prompt + 可消融的经验型 skill”。验证已通过：npm run typecheck、npm run components:validate、npm run test，50 tests passed。我没有启动新的 PikaBench-4 baseline/no-skill 实跑，避免继续消耗 MiniMax 限额；下一步如果要验证预期，应只跑最小对照：pikabench-4-ablation-baseline vs pikabench-4-no-skill。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "constar_docs_steer_unfinished_should_retry",
    prompt: "constar的工作目录在D601 /mnt/f/work/constar，你先摸清楚这个工程怎么用D601的skills做编译，下载等，摸熟悉之后更新长期参考文档，包括unidesk中简要引导，constar 里面补充在wsl中开发的注意事项等",
    finalResponse: "已按你的更正处理：长期文档可以留在 `constar/docs/`，不再放在 `constar/projects/` 里维护。已迁移非 docx 项目文档，已更新长期规则与索引，并验证项目文档目录只剩 docx。注意：根仓库新增/修改 `docs/reference/...`，FREQ 子仓库中 `README.md` 修改、`项目文档/quick_start_debug.md` 删除。",
    expected: "retry",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "constar的工作目录在D601 /mnt/f/work/constar，你先摸清楚这个工程怎么用D601的skills做编译，下载等，摸熟悉之后更新长期参考文档，包括unidesk中简要引导，constar 里面补充在wsl中开发的注意事项等\n",
        method: "enqueue",
      },
      {
        channel: "command",
        text: "item/completed: bun scripts/cli.ts ssh D601 skills --limit 120 status=completed; keil/serial-monitor/board-comm wrappers discovered",
        method: "item/completed",
      },
      {
        channel: "command",
        text: "item/completed: bun scripts/cli.ts ssh D601 -- 'cd /mnt/f/Work/ConStart && keil build --wait -p projects/71-00075-11/FirmWare/MDK-ARM/FREQ_Controller_FW.uvprojx -t FREQ_Controller_FW' status=completed; return_code=0 success=true",
        method: "item/completed",
      },
      {
        channel: "user",
        text: "[steer] freq项目里面的项目文档要迁移到constar/docs/ 里面(docx不迁移)，并在长期文档中说明只创建和维护constar/docs里面的长期文档\n",
        method: "turn/steer",
      },
      {
        channel: "assistant",
        text: "已按你的更正处理：长期文档可以留在 `constar/docs/`，不再放在 `constar/projects/` 里维护。已迁移非 docx 项目文档，并验证相关 Markdown。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "rate_limit_after_partial_work_should_retry",
    prompt: "不要总是刷新登录二维码，这样容易过期，只在没有获取二维码的时候获取，之后不要自动刷新，只保留手动刷新",
    finalResponse: "",
    expected: "retry",
    terminalStatus: "failed",
    terminalError: "exceeded retry limit, last status: 429 Too Many Requests, request id: 21zqfw7apcg",
    outputs: [
      {
        channel: "user",
        text: "不要总是刷新登录二维码，这样容易过期，只在没有获取二维码的时候获取，之后不要自动刷新，只保留手动刷新\n",
        method: "enqueue",
      },
      { channel: "command", text: "item/completed: git diff -- src/components/frontend/src/claudeqq.tsx status=completed", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run check status=completed", method: "item/completed" },
      { channel: "command", text: "item/completed: bun scripts/cli.ts server rebuild frontend status=completed; job succeeded", method: "item/completed" },
      { channel: "command", text: "item/completed: bun scripts/cli.ts e2e run --only frontend:claudeqq status=failed; Playwright browser/dependency issue", method: "item/completed" },
      { channel: "command", text: "item/started: bunx playwright install-deps chromium status=inProgress", method: "item/started" },
      { channel: "error", text: "exceeded retry limit, last status: 429 Too Many Requests, request id: 21zqfw7apcg\n", method: "error" },
      { channel: "error", text: "turn completed status=failed\n", method: "turn/completed" },
    ],
    events: [
      { at: nowIso(), method: "item/completed", itemType: "commandExecution", status: "failed", message: "Playwright dependency validation not complete" },
      { at: nowIso(), method: "turn/completed", status: "failed", message: "exceeded retry limit, last status: 429 Too Many Requests" },
    ],
  },
  {
    id: "codex_1778545138372_limit_error_no_final_response_should_retry",
    prompt: "基于 `https://github.com/filebrowser/filebrowser` 开发和部署一个文件管理器的用户服务，支持浏览 main server host、provider host 和 windows 文件 (wsl的/mnt/c/ 等目录，如果 provider 是 WSL，例如 D518 和 D601)",
    finalResponse: "",
    expected: "retry",
    terminalStatus: "failed",
    terminalError: "exceeded retry limit, last status: 429 Too Many Requests, request id: 9h5h8iolxwr",
    outputs: [
      {
        channel: "user",
        text: "基于 `https://github.com/filebrowser/filebrowser` 开发和部署一个文件管理器的用户服务，支持浏览 main server host、provider host 和 windows 文件 (wsl的/mnt/c/ 等目录，如果 provider 是 WSL，例如 D518 和 D601)\n",
        method: "enqueue",
      },
      {
        channel: "command",
        text: "item/completed: microservice list shows filebrowser main-server, D601 and D518 containers all Up/healthy",
        method: "item/completed",
      },
      {
        channel: "command",
        text: "item/completed: API checks returned 200 for /mnt/c/Users and /mnt/c/Windows on D601 and D518 with directory item counts",
        method: "item/completed",
      },
      {
        channel: "diff",
        text: "item/completed: file changes status=completed; M docker-compose.yml M docs/reference/microservices.md",
        method: "item/completed",
      },
      {
        channel: "command",
        text: "item/completed: docker compose up -d --no-deps --force-recreate filebrowser status=completed; filebrowser-main became healthy",
        method: "item/completed",
      },
      { channel: "error", text: "exceeded retry limit, last status: 429 Too Many Requests, request id: 9h5h8iolxwr\n", method: "error" },
      { channel: "error", text: "turn completed status=failed\n", method: "turn/completed" },
    ],
    events: [
      { at: nowIso(), method: "item/completed", itemType: "commandExecution", status: "completed", message: "filebrowser runtime checks showed partial success before interruption" },
      { at: nowIso(), method: "turn/completed", status: "failed", message: "exceeded retry limit, last status: 429 Too Many Requests" },
    ],
  },
  {
    id: "codex_1778551922480_fb2cc7_rate_limit_feedback_should_not_add_no_arg_api_requirement",
    prompt: "71-Freq 工程里面的 main.c:282 打印了 period_sum/mpu_read_num，我需要在282的后面新增两个打印，分别是打印滑动滤波前和滑动滤波后的值，你先分析要使得能够正常打印，需要哪些工作（例如初始化、配置等），并且在 period_sum/mpu_read_num 相同的条件下打印（这个打印应该是在 little_shell 触发的某个命令下进入打印状态），这个命令如果已经做好了频率测量的初始化和配置，那就不需要再配置",
    finalResponse: "",
    expected: "retry",
    expectedContinuePromptIncludes: [
      "未完成",
      "原始需求",
      "继续按照原始需求",
    ],
    expectedContinuePromptExcludes: [
      "无参",
      "无参数",
      "mpu_sensor_get_frequency_millihz()",
      "mpu_sensor_get_filtered_frequency_millihz()",
      "把 `mpu_sensor_get_frequency_millihz`",
      "return value",
      "返回 `uint32_t`",
      "FirmWare/Core/Src/main.c",
      "第 276-292 行",
    ],
    expectedContinuePromptMaxChars: 420,
    expectedContinuePromptMaxLines: 6,
    terminalStatus: "failed",
    terminalError: "exceeded retry limit, last status: 429 Too Many Requests, request id: 8qegpzommds",
    outputs: [
      {
        channel: "user",
        text: "71-Freq 工程里面的 main.c:282 打印了 period_sum/mpu_read_num，我需要在282的后面新增两个打印，分别是打印滑动滤波前和滑动滤波后的值，你先分析要使得能够正常打印，需要哪些工作（例如初始化、配置等），并且在 period_sum/mpu_read_num 相同的条件下打印（这个打印应该是在 little_shell 触发的某个命令下进入打印状态），这个命令如果已经做好了频率测量的初始化和配置，那就不需要再配置\n",
        method: "enqueue",
      },
      {
        channel: "system",
        text: "attempt 2/10 queue=constar provider=main-server cwd=/root/unidesk mode=retry model=gpt-5.5\n",
        method: "queue",
      },
      {
        channel: "system",
        text: "上一次 judge feedback 曾指定了具体 printf 形态；其中无参读取不是原始用户要求，只是 judge 推测。\n",
        method: "queue",
      },
      {
        channel: "command",
        text: "item/started: bun scripts/cli.ts debug dispatch D601 host.ssh --ssh-command 'cd /mnt/f/Work/ConStart/projects/71-00075-11 && sed -n \"276,292p\" FirmWare/Core/Src/main.c' status=inProgress",
        method: "item/started",
      },
      {
        channel: "error",
        text: "exceeded retry limit, last status: 429 Too Many Requests, request id: 8qegpzommds\n",
        method: "error",
      },
      { channel: "error", text: "turn completed status=failed\n", method: "turn/completed" },
    ],
    events: [
      { at: nowIso(), method: "item/started", itemType: "commandExecution", status: "inProgress", message: "reading D601 main.c context" },
      { at: nowIso(), method: "turn/completed", status: "failed", message: "exceeded retry limit, last status: 429 Too Many Requests" },
    ],
  },
  {
    id: "frontend_visible_change_without_rebuild_should_retry",
    prompt: "unidesk 把侧边栏的 `微服务` 改成 `用户服务`，单纯进行改名，长期文档中也要同步修改命名，明确概念，用户服务指的是在 unidesk 核心服务上挂载的用户使用的服务，unidesk 核心缺少这些服务也依然可以运行",
    finalResponse: "已完成，属于纯命名调整，没有改路由/API/CLI 的兼容命名。\n\n- 前端侧边栏主模块从 `微服务` 改为 `用户服务`：`src/components/frontend/src/navigation.ts`\n- 同步了前端可见文案，包括用户服务目录、顶部状态、各服务页 eyebrow/raw title/空状态。\n- 更新 E2E 选择器和断言，Playwright 现在点击/校验 `用户服务`。\n- 长期文档已同步概念。\n\n验证已跑：\n- `bun scripts/cli.ts check` 通过\n- `bun scripts/cli.ts help` 过滤确认 `microservice` 命令描述已改为 user services\n\n未跑完整公网 E2E；本次只做命名和文档同步。",
    expected: "retry",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "unidesk 把侧边栏的 `微服务` 改成 `用户服务`，单纯进行改名，长期文档中也要同步修改命名，明确概念，用户服务指的是在 unidesk 核心服务上挂载的用户使用的服务，unidesk 核心缺少这些服务也依然可以运行\n",
        method: "enqueue",
      },
      { channel: "diff", text: "item/completed: file changes status=completed; M src/components/frontend/src/navigation.ts M src/components/frontend/src/app.tsx M docs/reference/microservices.md", method: "item/completed" },
      { channel: "command", text: "item/completed: bun scripts/cli.ts check status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: bun scripts/cli.ts help | python3 ... status=completed; microservice descriptions mention user services", method: "item/completed" },
      {
        channel: "assistant",
        text: "已完成，属于纯命名调整。验证已跑：bun scripts/cli.ts check 通过；bun scripts/cli.ts help 过滤确认 microservice 命令描述已改为 user services。未跑完整公网 E2E；本次只做命名和文档同步。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "codex_1778483956252_c65680_mid_task_confirmation_should_retry",
    prompt: "code-queue的这个卡片已经没有意义了，因为已经能够在 TraceView 展开，所以应当取消这个卡片，只保留TraceView即可\n\n```\ncodex_1778483881863_a48b0a\n\nPrompt 全量\nqueued\nmodel=gpt-5.5\ncwd=/root/unidesk\ncreated=2026/5/11 15:18:01\n29 lines / 385 chars\n渐进式 Trace\n首屏使用后端 Summary；展开 prompt / 步骤时只按需拉取对应片段，不一次性拉取完整 transcript。\n...\n```",
    finalResponse: "我这边已完成 Code Queue 前端改动并跑过检查，但刚刚发现一个我没有修改的文件也变成了 modified：\n\n- `src/components/microservices/code-queue/src/index.ts`\n\n开始时工作树是干净的，我没有编辑这个文件。按安全规则我需要先停下确认，避免覆盖你的/其他进程的变更。\n\n请确认要我怎么处理：\n\n1. 忽略这个文件，只继续交付我已改的前端相关变更\n2. 先查看这个文件的 diff，判断来源和影响\n3. 你会自行处理，我这边只汇报已完成内容",
    expected: "retry",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "code-queue的这个卡片已经没有意义了，因为已经能够在 TraceView 展开，所以应当取消这个卡片，只保留TraceView即可\n\n```\ncodex_1778483881863_a48b0a\n\nPrompt 全量\nqueued\nmodel=gpt-5.5\ncwd=/root/unidesk\ncreated=2026/5/11 15:18:01\n29 lines / 385 chars\n渐进式 Trace\n首屏使用后端 Summary；展开 prompt / 步骤时只按需拉取对应片段，不一次性拉取完整 transcript。\n...\n```\n",
        method: "enqueue",
      },
      { channel: "diff", text: "item/completed: file changes status=completed; M docs/reference/frontend.md M scripts/src/e2e.ts M src/components/frontend/public/app.js M src/components/frontend/public/style.css M src/components/frontend/src/code-queue.tsx", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run --cwd src/components/frontend check status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run --cwd src/components/frontend build status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: bun scripts/cli.ts check status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: git status --short status=completed; M src/components/microservices/code-queue/src/index.ts also present", method: "item/completed" },
      {
        channel: "assistant",
        text: "我这边已完成 Code Queue 前端改动并跑过检查，但刚刚发现一个我没有修改的文件也变成了 modified：\n\n- `src/components/microservices/code-queue/src/index.ts`\n\n开始时工作树是干净的，我没有编辑这个文件。按安全规则我需要先停下确认，避免覆盖你的/其他进程的变更。\n\n请确认要我怎么处理：\n\n1. 忽略这个文件，只继续交付我已改的前端相关变更\n2. 先查看这个文件的 diff，判断来源和影响\n3. 你会自行处理，我这边只汇报已完成内容",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "codex_1778476426776_a2bf19_not_deployed_should_complete",
    prompt: "originprompt -> 执行过程 Summary 1 -> finalresponse1 -> judge1 -> 执行过程 Summary 2 -> finalresponse2 judge2 还不够，还要有 judge feedback prompt，例如 originprompt -> 执行过程 Summary 1 -> finalresponse1 -> judge1 -> judge feedback prompt -> 执行过程 Summary 2 -> finalresponse2 judge2",
    finalResponse: "已把 Trace 顶级链路补成：origin prompt -> Summary 1 -> final response 1 -> judge 1 -> judge feedback prompt -> Summary 2 -> final response 2 -> judge 2。后端扩展 attempt 数据，trace-summary 现在返回 feedback prompt preview/chars/lines/source，/api/tasks/:id/prompt?part=feedback&attempt=N 支持按需拉取完整内容，前端显示 feedback prompt cards。验证已通过：bun run --cwd src/components/microservices/code-queue check、bun run --cwd src/components/frontend check、bun scripts/cli.ts check、git diff --check。当前 git diff clean。我没有重建运行中的容器，但这不构成本轮完成门槛。",
    expected: "complete",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "originprompt -> 执行过程 Summary 1 -> finalresponse1 -> judge1 -> 执行过程 Summary 2 -> finalresponse2 judge2 还不够，还要有 judge feedback prompt，例如 originprompt -> 执行过程 Summary 1 -> finalresponse1 -> judge1 -> judge feedback prompt -> 执行过程 Summary 2 -> finalresponse2 judge2\n",
        method: "enqueue",
      },
      { channel: "diff", text: "item/completed: file changes status=completed; M src/components/microservices/code-queue/src/index.ts M src/components/frontend/src/code-queue.tsx", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run --cwd src/components/microservices/code-queue check status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run --cwd src/components/frontend check status=completed; ok=true", method: "item/completed" },
      {
        channel: "assistant",
        text: "已把 Trace 顶级链路补成 judge feedback prompt。验证已通过 type/check；我没有重建运行中的容器，但这不构成本轮完成门槛。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "beijing_time_deployed_after_prior_retry_feedback_should_complete",
    prompt: "unidesk 的所有 frontend 时间显示必须采用北京时间，要修改 unidesk 的前端，并在长期参考文档中要求这一点",
    finalResponse: "已完成北京时间任务并已上线验证。源码新增统一北京时间工具并替换 frontend 时间显示入口；长期参考文档已加入 Frontend Time Zone Policy，要求所有 UniDesk frontend timestamps、clocks、Trace times、Gantt labels 和 datetime-local 都固定使用 Asia/Shanghai / UTC+8。已执行 `bun scripts/cli.ts server rebuild frontend`，job succeeded，`unidesk-frontend` healthy。已用 Playwright 打开公网 UniDesk UI，并在 America/Los_Angeles 浏览器时区下验证顶部北京时间时钟、任务历史、Code Queue card、Codex Trace 和 Pipeline run 时间都显示北京时间。本轮不是只改源码未上线，运行中 served UI 已验证通过。",
    expected: "complete",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "unidesk 的所有 frontend 时间显示必须采用北京时间，要修改 unidesk 的前端，并在长期参考文档中要求这一点\n",
        method: "enqueue",
      },
      {
        channel: "system",
        text: "judge=retry confidence=0.95 source=minimax: Frontend bundle was not rebuilt/deployed; finalResponse explicitly states the frontend rebuild was skipped to avoid service restart.\n",
        method: "judge",
      },
      {
        channel: "system",
        text: "上一次 judge 判定为 retry：当前实现仍是未上线/未完成状态，不能只复述源码修改。\n",
        method: "queue",
      },
      {
        channel: "command",
        text: "item/completed: bun scripts/cli.ts server rebuild frontend status=completed; job succeeded; unidesk-frontend healthy",
        method: "item/completed",
      },
      {
        channel: "command",
        text: "item/completed: Playwright live UI verification under America/Los_Angeles timezone status=completed; topbar/task/Codex/Pipeline times use Asia/Shanghai",
        method: "item/completed",
      },
      {
        channel: "assistant",
        text: "已完成北京时间任务并已上线验证。长期参考文档已加入 Frontend Time Zone Policy。已执行 server rebuild frontend，job succeeded，unidesk-frontend healthy。Playwright live UI verification 通过。本轮不是只改源码未上线，运行中 served UI 已验证通过。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "code_queue_no_build_recreate_live_verified_should_complete",
    prompt: "修复 codex_1778762250800_82e71d 展开执行过程摘要 #1 只有 5 个 STEP 的问题；本地测试 OK 后部署到 D601 Code Queue，并验证 remote/frontdoor 能看到完整 STEP。",
    finalResponse: "已修复 Code Queue trace-steps 的 OA Event Flow 分页读取问题，并完成上线验证。\n\n部署结果：先执行 `docker compose -f src/components/microservices/code-queue/docker-compose.d601.yml up -d --build --force-recreate code-queue`，后续一次 build 受 Docker Hub mirror EOF 影响失败；为完成上线，已把当前修复同步进运行容器、commit 成 `unidesk-code-queue:d601`，并执行 `docker compose -f src/components/microservices/code-queue/docker-compose.d601.yml up -d --force-recreate code-queue`，容器 `code-queue-backend` 已 Started，status=running，health=ok。\n\nLive Verification：D601 本机 `/api/tasks/codex_1778762250800_82e71d/trace-steps?afterSeq=0&limit=500&attempt=1` 返回 `source=oa-event-flow,total=153,returned=153,hasMore=false`；main server microservice proxy 返回 httpStatus=200 且 total=153；公网 served frontend user-service API `/api/microservices/code-queue/proxy/.../trace-steps?afterSeq=0&limit=500&attempt=1` 返回 source=oa-event-flow,total=153；`/trace-summary` 返回 stepCount=153, statsSource=oa-event-flow。\n\nDockerfile 已补齐依赖，后续重建可直接跑；建议后续修 Docker daemon registry mirror，避免 rebuild 偶发 EOF。",
    expected: "complete",
    terminalStatus: "completed",
    outputs: [
      {
        channel: "user",
        text: "修复 codex_1778762250800_82e71d 展开执行过程摘要 #1 只有 5 个 STEP 的问题；本地测试 OK 后部署到 D601 Code Queue，并验证 remote/frontdoor 能看到完整 STEP。\n",
        method: "enqueue",
      },
      { channel: "diff", text: "item/completed: file changes status=completed; M src/components/microservices/code-queue/src/oa-events.ts M src/components/microservices/code-queue/src/task-view.ts M src/components/microservices/code-queue/Dockerfile", method: "item/completed" },
      { channel: "command", text: "item/completed: bun run --cwd src/components/microservices/code-queue check status=completed; ok=true", method: "item/completed" },
      { channel: "command", text: "item/completed: docker compose up -d --build --force-recreate code-queue status=failed; Docker Hub mirror EOF", method: "item/completed" },
      { channel: "command", text: "item/completed: docker commit code-queue-backend unidesk-code-queue:d601 && docker compose up -d --force-recreate code-queue status=completed; code-queue-backend Started running healthy", method: "item/completed" },
      { channel: "command", text: "item/completed: trace-steps?afterSeq=0&limit=500&attempt=1 status=completed; source=oa-event-flow total=153 returned=153 hasMore=false", method: "item/completed" },
      {
        channel: "assistant",
        text: "已修复并上线。build 曾因 Docker Hub mirror EOF 失败，但已通过 docker commit + no-build force-recreate 挂载到运行中 code-queue-backend；live API、microservice proxy 和公网 served frontend direct API 都返回 source=oa-event-flow,total=153,returned=153。Dockerfile 已补齐依赖，后续重建可直接跑；建议后续修 registry mirror。",
        method: "item/agentMessage/delta",
      },
      { channel: "system", text: "turn completed status=completed\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "completed" }],
  },
  {
    id: "transport_closed_before_terminal",
    prompt: "Refactor the queue worker and run the focused tests.",
    finalResponse: "",
    expected: "retry",
    terminalStatus: null,
    transportClosedBeforeTerminal: true,
    stderrTail: "stream disconnected before completion: upstream overloaded; app-server closed before turn/completed",
    outputs: [
      { channel: "user", text: "Refactor the queue worker and run the focused tests.\n", method: "enqueue" },
      { channel: "system", text: "attempt 1/3 mode=initial model=gpt-5.4-mini\n", method: "queue" },
    ],
    events: [{ at: nowIso(), method: "thread/status/changed", status: "inProgress" }],
  },
  {
    id: "user_interrupted",
    prompt: "Run a long shell command, then produce a report.",
    finalResponse: "",
    expected: "fail",
    terminalStatus: "interrupted",
    cancelRequested: true,
    outputs: [
      { channel: "user", text: "Run a long shell command, then produce a report.\n", method: "enqueue" },
      { channel: "system", text: "interrupt requested\n", method: "turn/interrupt" },
      { channel: "error", text: "turn completed status=interrupted\n", method: "turn/completed" },
    ],
    events: [{ at: nowIso(), method: "turn/completed", status: "interrupted" }],
  },
];
