{
 "model": "claude-haiku-5-5",
 "category": "background",
 "scenarios": [
  {
   "id": "d1-two-servers",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "Both http.server tasks started (bg-d57bf2eb on 8810, bg-4ea5a6f8 on 8811) and curl got 200 from each. TaskStop stopped only 8810 (stopped, exit 143) and curl then failed with exit 7, while 8811 stayed up. TaskOutput reported both states correctly. Checked: exit code 0, 8/8 tool pairs, the tasks frames, and background-tasks.jsonl, where 8811 is 'stopped, exit code 143' with endedWithProcess true (it was stopped at session end). No 8810/8811 listener or http.server process remains, result.json leftovers are empty, and driver.err is empty.",
   "notes": "Recomputed cost $0.00214184 matches result.json (7 requests, cacheRead 93,724). The request has 31 tools, including Skill with its 6-skill catalog and TeamMemoryWrite. No MCP, DSH or auth artifacts."
  },
  {
   "id": "d2-bad-bg-command",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "definitely-not-a-command was reported at once as failed with exit 127 and 'command not found'. The sh -c command was reported as failed with exit 3 and output 'starting\\ncrashed'. The tasks frames show both as failed with the right exit codes. Both Bash cards ended 'failed' (the commands ran and exited non-zero). TaskOutput reports 'failed, exit code N'. Nothing hung. Exit code 0, 4/4 pairs.",
   "notes": "The exit code appears three times in the result, as designed and already known. stderr is merged into the combined output without a stream label, and the model said so correctly. Cost $0.00113021 matches."
  },
  {
   "id": "d3-unicode-bg",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "All six lines of Chinese text, ✅, 🚀 and the 👩‍💻 ZWJ sequence are intact in every tasks-frame tail. Each tail is an exact prefix of the expected output, and both TaskOutput results contain the full expected text byte for byte. There is no U+FFFD and no lone surrogate. ANSI ESC bytes pass through raw. Task completed with exit 0.",
   "notes": "Model behaviour: Haiku sent both TaskOutput calls in one batch after the task had already finished, so neither read was taken while it was running. Its claim that the first TaskOutput showed lines 1-4 is wrong: those lines came from the Bash start result's 'Output so far'. It also guessed that the ESC bytes were stripped, but they are present in the tool result. G-Code reported the state correctly. Cost $0.00125792 matches."
  },
  {
   "id": "d4-watcher-left-running",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "node --watch served 'ok'. After the FileEdit, curl returned 'updated' and TaskOutput showed 'Change detected… Restarting'. The watcher was left running as asked and was stopped at session end ('stopped, exit code 0', endedWithProcess true). After exit, port 8825 is free and no server.mjs or node process remains. server.mjs now contains \"updated\". The Changes record has a baseline.",
   "notes": "Cost $0.00159405 matches. 7/7 pairs."
  },
  {
   "id": "d5-max-bg",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "Calls 1-8 started. Call #9 returned 'Error: 8 background tasks are already running. Stop one with TaskStop first.' and its state is 'failed'. Call #10 was refused by the repeat guard ('Not run: this exact Bash call failed…') and its state is 'refused'; it has no tool-use frame, as designed. TaskList listed all 8 shells as running. Eight TaskStops each said 'Stopped … exit code 143' exactly once. The second TaskList showed all 8 stopped, and pgrep found no sleep 300. Leftovers are empty. 21/21 pairs.",
   "notes": "The repeat guard treats #10 as identical to #9 even though only the description differs, which is reasonable. Haiku sent all 10 calls in one batch, and they ran serially. Its report is accurate. Cost $0.002906635 matches."
  },
  {
   "id": "d6-interrupt-resume",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "SIGINT arrived after 6 tools, during the batch that held TaskStop and a curl Bash call. The running Bash call settled as 'cancelled' with 'Stopped before it finished: the turn was cancelled (it did not time out)', and the error frame read 'Stopped before this turn finished.'. The saved turn is marked interrupted ('Stopped by user'), every tool_use is paired, and the incomplete-turn note is present. The resumed session (same id, no 400 error) checked that pid 3022 was gone and that nothing listened on 8835. It did not repeat npm init, the install or the FileWrite. It added /time, ran the app as a run_in_background task, verified /health and /time, then stopped it. I ran index.js myself on port 18935: /health returns {ok:true} and /time returns an ISO time. I stopped it afterwards.",
   "notes": "In turn 1 the model started the server with '&' in a foreground Bash call. G-Code adopted the group as bg-b5ae320c and TaskStop stopped it with no exit code, which is correct for an adopted group. The 250 ms debounced tasks frame for that stop was never emitted, because the CLI closed about 30 ms later and repl.ts:602 clears the timer at close by design. A desktop would get the new process's list on resume. This is cosmetic, not counted. Cost $0.004277515 matches (12 requests across both turns)."
  },
  {
   "id": "d7-sigkill-orphan",
   "status": "pass",
   "product_defects": [],
   "task_outcome": "The background server answered 200 'ok', and the CLI was killed with kill -9 during the foreground sleep 200. result.json sigkill shows killed: true and serverGoneMs: 372, so the watchdog stopped the group well inside 5 s. Driver exit code is 137 with exitedEarly, which is expected. Leftovers are empty and no node server.mjs process or 8840 listener remains. The saved session marks the turn interrupted ('the process ended before this turn finished'), the sleep call reads 'invocation requested; completion unverified', and all 3 tool_uses are paired.",
   "notes": "background-tasks.jsonl still says 'running', which is expected after SIGKILL: a later process explains it. The summary 'errors' list is empty; the error by design shows up as exit code 137 / exitedEarly. Cost $0.00087982 matches. All 7 driver.err files are empty, and no DSH bridge process, ~/.gcode/dsh, ~/.gcode/auth or learned/patterns.json exists in any run HOME."
  }
 ]
}