R13: Empty/exited/reopened sessions — after 63e44670dd1d222cf63619d5e02415f2a9fd3bc2
Run directory: /tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13
Environment: fs-31, Linux x86_64, Node v26.12.1; real apps/server RPC unless explicitly labelled harness; viewport/theme/DPR/font scaling=N/A; fresh isolated database, no copied user data.
All clocks are live except harness TestClock times, explicitly named test_ms.

===== namespace.json =====
{
  "launcherPid": 3435641,
  "mountNamespace": "mnt:[4026532153]",
  "hostPid1MountNamespace": "mnt:[4026531841]",
  "psSha256": "2adfa9f0fbe37ad192240fdb144c7fc9b1cf45acb6345174f812d650c33852ac",
  "shimSha256": "2adfa9f0fbe37ad192240fdb144c7fc9b1cf45acb6345174f812d650c33852ac",
  "psMountInfo": [
    "168 93 254:0 /tmp/lead-24640-r1/capture-r13/ps-shim.py /usr/bin/ps rw,relatime - ext4 /dev/root rw,errors=remount-ro"
  ]
}

===== summary.json =====
{
  "side": "after",
  "row": "R13",
  "sha": "63e44670dd1d222cf63619d5e02415f2a9fd3bc2",
  "queries": [
    {
      "kind": "start",
      "pid": 3436766,
      "ppid": 3435641,
      "utc": "2026-10-27T15:16:52",
      "mono_ns": 924801367052681,
      "wall_ns": 1793114212248017000,
      "phase": "R13",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "control": {
        "phase": "R13",
        "mode": "valid",
        "delay": 0
      }
    },
    {
      "kind": "start",
      "pid": 3436800,
      "ppid": 3435641,
      "utc": "2026-10-27T15:16:58",
      "mono_ns": 924807435309893,
      "wall_ns": 1793114218316274400,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "control": {
        "phase": "R13-post-reopen",
        "mode": "valid",
        "delay": 0
      }
    },
    {
      "kind": "start",
      "pid": 3436802,
      "ppid": 3435641,
      "utc": "2026-10-27T15:17:00",
      "mono_ns": 924809499225730,
      "wall_ns": 1793114220380190000,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "control": {
        "phase": "R13-post-reopen",
        "mode": "valid",
        "delay": 0
      }
    },
    {
      "kind": "start",
      "pid": 3436818,
      "ppid": 3435641,
      "utc": "2026-10-27T15:17:04",
      "mono_ns": 924813565376627,
      "wall_ns": 1793114224446340900,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "control": {
        "phase": "R13-post-reopen",
        "mode": "valid",
        "delay": 0
      }
    }
  ],
  "ended": [
    {
      "kind": "end",
      "pid": 3436766,
      "ppid": 3435641,
      "utc": "2026-10-27T15:16:52",
      "mono_ns": 924801380365525,
      "wall_ns": 1793114212261329700,
      "phase": "R13",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "code": 0,
      "bytes": 3867,
      "elapsed_ms": 13.35873
    },
    {
      "kind": "end",
      "pid": 3436800,
      "ppid": 3435641,
      "utc": "2026-10-27T15:16:58",
      "mono_ns": 924807447951347,
      "wall_ns": 1793114218328915200,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "code": 0,
      "bytes": 3878,
      "elapsed_ms": 12.658336
    },
    {
      "kind": "end",
      "pid": 3436802,
      "ppid": 3435641,
      "utc": "2026-10-27T15:17:00",
      "mono_ns": 924809512376590,
      "wall_ns": 1793114220393340700,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "code": 0,
      "bytes": 3884,
      "elapsed_ms": 13.15112
    },
    {
      "kind": "end",
      "pid": 3436818,
      "ppid": 3435641,
      "utc": "2026-10-27T15:17:04",
      "mono_ns": 924813578594342,
      "wall_ns": 1793114224459558400,
      "phase": "R13-post-reopen",
      "argv": [
        "/bin/ps",
        "-eo",
        "pid=,ppid=,comm="
      ],
      "code": 0,
      "bytes": 3813,
      "elapsed_ms": 13.24705
    }
  ],
  "events": [],
  "finalState": []
}

===== rpc.jsonl =====
{"kind":"manifest","utc":"2026-10-27T15:16:37.534Z","mono_ns":"924786654076081","ms":214.325257,"driverPid":3435572,"side":"after","row":"R13","sha":"63e44670dd1d222cf63619d5e02415f2a9fd3bc2","checkout":"/home/ubuntu/wt/pr-24640","run":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","port":23131,"node":"v26.12.1","platform":"linux","arch":"x64","db":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13/home/userdata/statev2.sqlite","nativeBinary":null,"nativeSource":"df0f74267229608b4cce04f10b64a9b8af859aacbbeecb9f861d6d349d35c4b2","driver":"11ce0be6bba6331dcd9f0030bb62e1806061ef2cc32af0dbcae4b89918917b55","shim":"2adfa9f0fbe37ad192240fdb144c7fc9b1cf45acb6345174f812d650c33852ac","sourceStatus":"","environment":"Linux fs-31; real apps/server; private mount namespace ps interception; fresh DB; no viewport/theme/DPR/font scaling"}
{"kind":"control","utc":"2026-10-27T15:16:37.536Z","mono_ns":"924786655885896","ms":216.129372,"phase":"R13","mode":"valid","delay":0}
{"kind":"spawn","utc":"2026-10-27T15:16:37.541Z","mono_ns":"924786660142000","ms":220.387239,"pid":3435640,"argv":["sudo","unshare","-m","--propagation","private","bash","launch.sh","/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","/home/ubuntu/wt/pr-24640",23131,"/home/ubuntu/.local/share/vite-plus/js_runtime/node/26.12.1/bin/node"]}
{"kind":"server-ready","utc":"2026-10-27T15:16:48.800Z","mono_ns":"924797919672368","ms":11479.918849}
{"kind":"rpc-connected","utc":"2026-10-27T15:16:48.893Z","mono_ns":"924798012376684","ms":11572.623666}
{"kind":"request","utc":"2026-10-27T15:16:48.893Z","mono_ns":"924798012526424","ms":11572.768767,"id":"1","tag":"subscribeTerminalEvents","payload":{}}
{"kind":"request","utc":"2026-10-27T15:16:48.894Z","mono_ns":"924798013225827","ms":11573.46855,"id":"2","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"request","utc":"2026-10-27T15:16:48.894Z","mono_ns":"924798013820162","ms":11574.062886,"id":"3","tag":"projects.mutate","payload":{"type":"project.create","commandId":"ea26ced1-6c6e-41fe-8d1c-750bd3702302","projectId":"fixture-project","title":"Synthetic polling fixture","workspaceRoot":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13"}}
{"kind":"wire","utc":"2026-10-27T15:16:48.908Z","mono_ns":"924798027936362","ms":11588.182052,"message":{"_tag":"Chunk","requestId":"2","values":[{"type":"snapshot","terminals":[]}]}}
{"kind":"wire","utc":"2026-10-27T15:16:48.920Z","mono_ns":"924798039951001","ms":11600.196801,"message":{"_tag":"Exit","requestId":"3","exit":{"_tag":"Success","value":{"id":"fixture-project","title":"Synthetic polling fixture","workspaceRoot":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","repositoryIdentity":null,"faviconPath":null,"projectIcon":null,"defaultModelSelection":null,"defaultThreadEnvMode":null,"autoPull":false,"scripts":[],"createdAt":"2026-10-27T15:16:48.905Z","updatedAt":"2026-10-27T15:16:48.905Z","deletedAt":null}}}}
{"kind":"receipt","utc":"2026-10-27T15:16:48.921Z","mono_ns":"924798040062831","ms":11600.303952,"id":"3","tag":"projects.mutate","value":{"id":"fixture-project","title":"Synthetic polling fixture","workspaceRoot":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","repositoryIdentity":null,"faviconPath":null,"projectIcon":null,"defaultModelSelection":null,"defaultThreadEnvMode":null,"autoPull":false,"scripts":[],"createdAt":"2026-10-27T15:16:48.905Z","updatedAt":"2026-10-27T15:16:48.905Z","deletedAt":null}}
{"kind":"request","utc":"2026-10-27T15:16:48.921Z","mono_ns":"924798040221118","ms":11600.462278,"id":"4","tag":"orchestration.dispatchCommand","payload":{"type":"thread.create","commandId":"e05392e3-7b4a-4838-98ad-71be7bb34929","threadId":"fixture-thread-a","projectId":"fixture-project","title":"fixture-thread-a","modelSelection":{"instanceId":"codex","model":"gpt-5"},"runtimeMode":"full-access","interactionMode":"default","branch":null,"worktreePath":null,"createdBy":"user","creationSource":"web"}}
{"kind":"wire","utc":"2026-10-27T15:16:48.957Z","mono_ns":"924798076853808","ms":11637.09616,"message":{"_tag":"Exit","requestId":"4","exit":{"_tag":"Success","value":{"sequence":5}}}}
{"kind":"receipt","utc":"2026-10-27T15:16:48.957Z","mono_ns":"924798076941553","ms":11637.182373,"id":"4","tag":"orchestration.dispatchCommand","value":{"sequence":5}}
{"kind":"request","utc":"2026-10-27T15:16:48.957Z","mono_ns":"924798077025049","ms":11637.266079,"id":"5","tag":"orchestration.dispatchCommand","payload":{"type":"thread.create","commandId":"778f70f1-047c-4e9d-b150-afacd692f709","threadId":"fixture-thread-b","projectId":"fixture-project","title":"fixture-thread-b","modelSelection":{"instanceId":"codex","model":"gpt-5"},"runtimeMode":"full-access","interactionMode":"default","branch":null,"worktreePath":null,"createdBy":"user","creationSource":"web"}}
{"kind":"wire","utc":"2026-10-27T15:16:48.970Z","mono_ns":"924798090001111","ms":11650.243204,"message":{"_tag":"Exit","requestId":"5","exit":{"_tag":"Success","value":{"sequence":6}}}}
{"kind":"receipt","utc":"2026-10-27T15:16:48.971Z","mono_ns":"924798090058409","ms":11650.299328,"id":"5","tag":"orchestration.dispatchCommand","value":{"sequence":6}}
{"kind":"negative-empty-start","utc":"2026-10-27T15:16:48.972Z","mono_ns":"924798091442705","ms":11651.684267,"queries":0}
{"kind":"negative-empty-end","utc":"2026-10-27T15:16:51.474Z","mono_ns":"924800593193124","ms":14153.435597,"queries":0}
{"kind":"request","utc":"2026-10-27T15:16:51.474Z","mono_ns":"924800593545135","ms":14153.786586,"id":"6","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:16:51.476Z","mono_ns":"924800595893871","ms":14156.135793,"message":{"_tag":"Chunk","requestId":"6","values":[{"type":"snapshot","terminals":[]}]}}
{"kind":"state","utc":"2026-10-27T15:16:51.574Z","mono_ns":"924800693491566","ms":14253.734661,"terminals":[]}
{"kind":"request","utc":"2026-10-27T15:16:51.574Z","mono_ns":"924800693956438","ms":14254.197869,"id":"7","tag":"terminal.open","payload":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","cols":100,"rows":24,"env":{"HOME":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13/shell-home","PS1":"fixture> ","BASH_ENV":"/dev/null","ENV":"/dev/null","NO_COLOR":"1","FORCE_COLOR":"0"}}}
{"kind":"wire","utc":"2026-10-27T15:16:51.598Z","mono_ns":"924800717456222","ms":14277.698485,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":1,"type":"started","snapshot":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z","sequence":1}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:51.599Z","mono_ns":"924800718106992","ms":14278.348604,"message":{"_tag":"Exit","requestId":"7","exit":{"_tag":"Success","value":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z","sequence":1}}}}
{"kind":"receipt","utc":"2026-10-27T15:16:51.599Z","mono_ns":"924800718166524","ms":14278.407375,"id":"7","tag":"terminal.open","value":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z","sequence":1}}
{"kind":"request","utc":"2026-10-27T15:16:51.599Z","mono_ns":"924800718262474","ms":14278.503414,"id":"8","tag":"terminal.observe","payload":{"threadId":"fixture-thread-a","terminalId":"term-0"}}
{"kind":"wire","utc":"2026-10-27T15:16:51.599Z","mono_ns":"924800718934756","ms":14279.176277,"message":{"_tag":"Chunk","requestId":"2","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:51.600Z","mono_ns":"924800719360734","ms":14279.601965,"message":{"_tag":"Chunk","requestId":"6","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:51.605Z","mono_ns":"924800724519592","ms":14284.761014,"message":{"_tag":"Chunk","requestId":"8","values":[{"type":"snapshot","snapshot":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.593Z","sequence":1}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:51.605Z","mono_ns":"924800724922669","ms":14285.163849,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":2,"type":"output","data":"\u001b[?2004hubuntu@fs-31:/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13$ "}]}}
{"kind":"wire","utc":"2026-10-27T15:16:51.606Z","mono_ns":"924800725210077","ms":14285.451148,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":2,"type":"output","data":"\u001b[?2004hubuntu@fs-31:/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13$ "}]}}
{"kind":"request","utc":"2026-10-27T15:16:52.421Z","mono_ns":"924801540176758","ms":15100.421606,"id":"9","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:16:52.423Z","mono_ns":"924801542866113","ms":15103.108356,"message":{"_tag":"Chunk","requestId":"9","values":[{"type":"snapshot","terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.603Z"}]}]}}
{"kind":"state","utc":"2026-10-27T15:16:52.521Z","mono_ns":"924801640495458","ms":15200.739414,"terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436764,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:51.603Z"}]}
{"kind":"pre-exit-query-completed","utc":"2026-10-27T15:16:52.522Z","mono_ns":"924801641189179","ms":15201.431302,"query":{"kind":"start","pid":3436766,"ppid":3435641,"utc":"2026-10-27T15:16:52","mono_ns":924801367052681,"wall_ns":1793114212248017000,"phase":"R13","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"control":{"phase":"R13","mode":"valid","delay":0}},"end":{"kind":"end","pid":3436766,"ppid":3435641,"utc":"2026-10-27T15:16:52","mono_ns":924801380365525,"wall_ns":1793114212261329700,"phase":"R13","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"code":0,"bytes":3867,"elapsed_ms":13.35873}}
{"kind":"request","utc":"2026-10-27T15:16:52.522Z","mono_ns":"924801641381951","ms":15201.623543,"id":"10","tag":"terminal.write","payload":{"threadId":"fixture-thread-a","terminalId":"term-0","data":"exit\r"}}
{"kind":"wire","utc":"2026-10-27T15:16:52.527Z","mono_ns":"924801646574662","ms":15206.816904,"message":{"_tag":"Exit","requestId":"10","exit":{"_tag":"Success","value":null}}}
{"kind":"receipt","utc":"2026-10-27T15:16:52.527Z","mono_ns":"924801646652538","ms":15206.893368,"id":"10","tag":"terminal.write","value":null}
{"kind":"wire","utc":"2026-10-27T15:16:52.534Z","mono_ns":"924801653323272","ms":15213.564663,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":3,"type":"output","data":"exit\r\n\u001b[?2004l\rexit\r\n"}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.534Z","mono_ns":"924801653665955","ms":15213.907045,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":3,"type":"output","data":"exit\r\n\u001b[?2004l\rexit\r\n"}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.534Z","mono_ns":"924801654015961","ms":15214.257372,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":4,"type":"exited","exitCode":0,"exitSignal":0}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.535Z","mono_ns":"924801654453933","ms":15214.695264,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":4,"type":"exited","exitCode":0,"exitSignal":0}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.535Z","mono_ns":"924801654765477","ms":15215.006588,"message":{"_tag":"Chunk","requestId":"2","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.536Z","mono_ns":"924801655202507","ms":15215.444159,"message":{"_tag":"Chunk","requestId":"6","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:52.536Z","mono_ns":"924801655609731","ms":15215.851353,"message":{"_tag":"Chunk","requestId":"9","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}}]}}
{"kind":"request","utc":"2026-10-27T15:16:52.547Z","mono_ns":"924801666992635","ms":15227.235298,"id":"11","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:16:52.549Z","mono_ns":"924801668856171","ms":15229.098243,"message":{"_tag":"Chunk","requestId":"11","values":[{"type":"snapshot","terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}]}]}}
{"kind":"state","utc":"2026-10-27T15:16:52.648Z","mono_ns":"924801767398177","ms":15327.642033,"terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}]}
{"kind":"negative-exited-start","utc":"2026-10-27T15:16:52.648Z","mono_ns":"924801767955242","ms":15328.196753,"queries":1,"inFlight":0}
{"kind":"negative-exited-end","utc":"2026-10-27T15:16:57.652Z","mono_ns":"924806771570512","ms":20331.813046,"queries":1,"newQueries":0}
{"kind":"request","utc":"2026-10-27T15:16:57.652Z","mono_ns":"924806771718600","ms":20331.960171,"id":"12","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:16:57.655Z","mono_ns":"924806774260037","ms":20334.501769,"message":{"_tag":"Chunk","requestId":"12","values":[{"type":"snapshot","terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}]}]}}
{"kind":"state","utc":"2026-10-27T15:16:57.753Z","mono_ns":"924806872696777","ms":20432.940142,"terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"exited","pid":null,"exitCode":0,"exitSignal":0,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:52.528Z"}]}
{"kind":"control","utc":"2026-10-27T15:16:57.754Z","mono_ns":"924806873087059","ms":20433.329512,"phase":"R13-post-reopen","mode":"valid","delay":0}
{"kind":"reopen-start","utc":"2026-10-27T15:16:57.754Z","mono_ns":"924806873132193","ms":20433.372984}
{"kind":"request","utc":"2026-10-27T15:16:57.754Z","mono_ns":"924806873198989","ms":20433.439739,"id":"13","tag":"terminal.restart","payload":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","cols":100,"rows":24}}
{"kind":"wire","utc":"2026-10-27T15:16:57.766Z","mono_ns":"924806885767095","ms":20446.009209,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":5,"type":"restarted","snapshot":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z","sequence":5}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.767Z","mono_ns":"924806886548381","ms":20446.791967,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":5,"type":"restarted","snapshot":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z","sequence":5}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.768Z","mono_ns":"924806887177892","ms":20447.418953,"message":{"_tag":"Exit","requestId":"13","exit":{"_tag":"Success","value":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z","sequence":5}}}}
{"kind":"receipt","utc":"2026-10-27T15:16:57.768Z","mono_ns":"924806887285204","ms":20447.526104,"id":"13","tag":"terminal.restart","value":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z","sequence":5}}
{"kind":"reopen-complete","utc":"2026-10-27T15:16:57.768Z","mono_ns":"924806887392405","ms":20447.633605,"snapshot":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"history":"","exitCode":null,"exitSignal":null,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z","sequence":5}}
{"kind":"request","utc":"2026-10-27T15:16:57.768Z","mono_ns":"924806887452548","ms":20447.693748,"id":"14","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:16:57.768Z","mono_ns":"924806887832841","ms":20448.074422,"message":{"_tag":"Chunk","requestId":"2","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.769Z","mono_ns":"924806888185733","ms":20448.426813,"message":{"_tag":"Chunk","requestId":"6","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.769Z","mono_ns":"924806888443016","ms":20448.683986,"message":{"_tag":"Chunk","requestId":"9","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.769Z","mono_ns":"924806888881458","ms":20449.122428,"message":{"_tag":"Chunk","requestId":"11","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.770Z","mono_ns":"924806889174739","ms":20449.415839,"message":{"_tag":"Chunk","requestId":"12","values":[{"type":"upsert","terminal":{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.770Z","mono_ns":"924806889476734","ms":20449.717905,"message":{"_tag":"Chunk","requestId":"14","values":[{"type":"snapshot","terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}]}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.794Z","mono_ns":"924806913802378","ms":20474.04467,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":6,"type":"output","data":"\u001b[?2004h\u001b]0;ubuntu@fs-31: /tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13\u0007\u001b[01;32mubuntu@fs-31\u001b[00m:\u001b[01;34m/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13\u001b[00m$ "}]}}
{"kind":"wire","utc":"2026-10-27T15:16:57.795Z","mono_ns":"924806914260467","ms":20474.501527,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":6,"type":"output","data":"\u001b[?2004h\u001b]0;ubuntu@fs-31: /tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13\u0007\u001b[01;32mubuntu@fs-31\u001b[00m:\u001b[01;34m/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13\u001b[00m$ "}]}}
{"kind":"state","utc":"2026-10-27T15:16:57.868Z","mono_ns":"924806987722095","ms":20547.964839,"terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.763Z"}]}
{"kind":"request","utc":"2026-10-27T15:17:04.616Z","mono_ns":"924813735936613","ms":27296.179888,"id":"15","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:17:04.619Z","mono_ns":"924813738299496","ms":27298.54251,"message":{"_tag":"Chunk","requestId":"15","values":[{"type":"snapshot","terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.792Z"}]}]}}
{"kind":"state","utc":"2026-10-27T15:17:04.717Z","mono_ns":"924813836812458","ms":27397.056193,"terminals":[{"threadId":"fixture-thread-a","terminalId":"term-0","cwd":"/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13","worktreePath":null,"status":"running","pid":3436785,"exitCode":null,"exitSignal":null,"hasRunningSubprocess":false,"label":"Terminal 0","updatedAt":"2026-10-27T15:16:57.792Z"}]}
{"kind":"post-reopen-three-queries-completed","utc":"2026-10-27T15:17:04.718Z","mono_ns":"924813837697408","ms":27397.939661,"queries":[{"kind":"start","pid":3436800,"ppid":3435641,"utc":"2026-10-27T15:16:58","mono_ns":924807435309893,"wall_ns":1793114218316274400,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"control":{"phase":"R13-post-reopen","mode":"valid","delay":0}},{"kind":"start","pid":3436802,"ppid":3435641,"utc":"2026-10-27T15:17:00","mono_ns":924809499225730,"wall_ns":1793114220380190000,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"control":{"phase":"R13-post-reopen","mode":"valid","delay":0}},{"kind":"start","pid":3436818,"ppid":3435641,"utc":"2026-10-27T15:17:04","mono_ns":924813565376627,"wall_ns":1793114224446340900,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"control":{"phase":"R13-post-reopen","mode":"valid","delay":0}}],"ends":[{"kind":"end","pid":3436800,"ppid":3435641,"utc":"2026-10-27T15:16:58","mono_ns":924807447951347,"wall_ns":1793114218328915200,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"code":0,"bytes":3878,"elapsed_ms":12.658336},{"kind":"end","pid":3436802,"ppid":3435641,"utc":"2026-10-27T15:17:00","mono_ns":924809512376590,"wall_ns":1793114220393340700,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"code":0,"bytes":3884,"elapsed_ms":13.15112},{"kind":"end","pid":3436818,"ppid":3435641,"utc":"2026-10-27T15:17:04","mono_ns":924813578594342,"wall_ns":1793114224459558400,"phase":"R13-post-reopen","argv":["/bin/ps","-eo","pid=,ppid=,comm="],"code":0,"bytes":3813,"elapsed_ms":13.24705}]}
{"kind":"scenario-complete","utc":"2026-10-27T15:17:04.718Z","mono_ns":"924813837802556","ms":27398.043726}
{"kind":"request","utc":"2026-10-27T15:17:04.718Z","mono_ns":"924813837911550","ms":27398.15256,"id":"16","tag":"terminal.close","payload":{"threadId":"fixture-thread-a","terminalId":"term-0"}}
{"kind":"wire","utc":"2026-10-27T15:17:04.726Z","mono_ns":"924813845351707","ms":27405.59371,"message":{"_tag":"Chunk","requestId":"1","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":7,"type":"closed"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.726Z","mono_ns":"924813845777205","ms":27406.019037,"message":{"_tag":"Chunk","requestId":"8","values":[{"threadId":"fixture-thread-a","terminalId":"term-0","sequence":7,"type":"closed"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.727Z","mono_ns":"924813846163490","ms":27406.404601,"message":{"_tag":"Exit","requestId":"16","exit":{"_tag":"Success","value":null}}}
{"kind":"receipt","utc":"2026-10-27T15:17:04.727Z","mono_ns":"924813846208695","ms":27406.449495,"id":"16","tag":"terminal.close","value":null}
{"kind":"request","utc":"2026-10-27T15:17:04.727Z","mono_ns":"924813846247988","ms":27406.488668,"id":"17","tag":"subscribeTerminalMetadata","payload":{}}
{"kind":"wire","utc":"2026-10-27T15:17:04.727Z","mono_ns":"924813846563030","ms":27406.80407,"message":{"_tag":"Chunk","requestId":"2","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.727Z","mono_ns":"924813846830371","ms":27407.071451,"message":{"_tag":"Chunk","requestId":"6","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.728Z","mono_ns":"924813847950723","ms":27408.191974,"message":{"_tag":"Chunk","requestId":"9","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.729Z","mono_ns":"924813848302272","ms":27408.543333,"message":{"_tag":"Chunk","requestId":"11","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.729Z","mono_ns":"924813848759801","ms":27409.000841,"message":{"_tag":"Chunk","requestId":"12","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.730Z","mono_ns":"924813849052680","ms":27409.294121,"message":{"_tag":"Chunk","requestId":"14","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.730Z","mono_ns":"924813849385264","ms":27409.626444,"message":{"_tag":"Chunk","requestId":"15","values":[{"type":"remove","threadId":"fixture-thread-a","terminalId":"term-0"}]}}
{"kind":"wire","utc":"2026-10-27T15:17:04.730Z","mono_ns":"924813849684054","ms":27409.925165,"message":{"_tag":"Chunk","requestId":"17","values":[{"type":"snapshot","terminals":[]}]}}
{"kind":"state","utc":"2026-10-27T15:17:04.828Z","mono_ns":"924813947296297","ms":27507.539852,"terminals":[]}
{"kind":"cleanup-start","utc":"2026-10-27T15:17:04.844Z","mono_ns":"924813963378726","ms":27523.624486,"pids":[3435640,3435641,3436785],"ptyPids":[3436764,3436785]}
{"kind":"cleanup-end","utc":"2026-10-27T15:17:06.941Z","mono_ns":"924816060082270","ms":29620.33329,"survivorsBeforeFinalKill":[],"remaining":[]}


===== shim.jsonl =====
{"kind": "start", "pid": 3436766, "ppid": 3435641, "utc": "2026-10-27T15:16:52", "mono_ns": 924801367052681, "wall_ns": 1793114212248016946, "phase": "R13", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "control": {"phase": "R13", "mode": "valid", "delay": 0}}
{"kind": "end", "pid": 3436766, "ppid": 3435641, "utc": "2026-10-27T15:16:52", "mono_ns": 924801380365525, "wall_ns": 1793114212261329769, "phase": "R13", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "code": 0, "bytes": 3867, "elapsed_ms": 13.35873}
{"kind": "start", "pid": 3436800, "ppid": 3435641, "utc": "2026-10-27T15:16:58", "mono_ns": 924807435309893, "wall_ns": 1793114218316274428, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "control": {"phase": "R13-post-reopen", "mode": "valid", "delay": 0}}
{"kind": "end", "pid": 3436800, "ppid": 3435641, "utc": "2026-10-27T15:16:58", "mono_ns": 924807447951347, "wall_ns": 1793114218328915301, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "code": 0, "bytes": 3878, "elapsed_ms": 12.658336}
{"kind": "start", "pid": 3436802, "ppid": 3435641, "utc": "2026-10-27T15:17:00", "mono_ns": 924809499225730, "wall_ns": 1793114220380189955, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "control": {"phase": "R13-post-reopen", "mode": "valid", "delay": 0}}
{"kind": "end", "pid": 3436802, "ppid": 3435641, "utc": "2026-10-27T15:17:00", "mono_ns": 924809512376590, "wall_ns": 1793114220393340754, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "code": 0, "bytes": 3884, "elapsed_ms": 13.15112}
{"kind": "start", "pid": 3436818, "ppid": 3435641, "utc": "2026-10-27T15:17:04", "mono_ns": 924813565376627, "wall_ns": 1793114224446340740, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "control": {"phase": "R13-post-reopen", "mode": "valid", "delay": 0}}
{"kind": "end", "pid": 3436818, "ppid": 3435641, "utc": "2026-10-27T15:17:04", "mono_ns": 924813578594342, "wall_ns": 1793114224459558305, "phase": "R13-post-reopen", "argv": ["/bin/ps", "-eo", "pid=,ppid=,comm="], "code": 0, "bytes": 3813, "elapsed_ms": 13.24705}


===== native.jsonl =====
{"kind": "native-fail", "pid": 3435899, "mono_ns": 924792077869133}
{"kind": "native-fail", "pid": 3436733, "mono_ns": 924797698542747}
{"kind": "native-fail", "pid": 3436768, "mono_ns": 924803719775874}
{"kind": "native-fail", "pid": 3436804, "mono_ns": 924810729658171}


===== server.log =====
[15:16:42.781] DEBUG (#44): Running migration
  migration_name: OrchestrationEvents
  migration_id: 1
[15:16:42.783] DEBUG (#44): Running migration
  migration_name: OrchestrationCommandReceipts
  migration_id: 2
[15:16:42.784] DEBUG (#44): Running migration
  migration_name: CheckpointDiffBlobs
  migration_id: 3
[15:16:42.785] DEBUG (#44): Running migration
  migration_name: ProviderSessionRuntime
  migration_id: 4
[15:16:42.787] DEBUG (#44): Running migration
  migration_name: Projections
  migration_id: 5
[15:16:42.791] DEBUG (#44): Running migration
  migration_name: ProjectionThreadSessionRuntimeModeColumns
  migration_id: 6
[15:16:42.792] DEBUG (#44): Running migration
  migration_name: ProjectionThreadMessageAttachments
  migration_id: 7
[15:16:42.792] DEBUG (#44): Running migration
  migration_name: ProjectionThreadActivitySequence
  migration_id: 8
[15:16:42.793] DEBUG (#44): Running migration
  migration_name: ProviderSessionRuntimeMode
  migration_id: 9
[15:16:42.794] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsRuntimeMode
  migration_id: 10
[15:16:42.794] DEBUG (#44): Running migration
  migration_name: OrchestrationThreadCreatedRuntimeMode
  migration_id: 11
[15:16:42.795] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsInteractionMode
  migration_id: 12
[15:16:42.795] DEBUG (#44): Running migration
  migration_name: ProjectionThreadProposedPlans
  migration_id: 13
[15:16:42.797] DEBUG (#44): Running migration
  migration_name: ProjectionThreadProposedPlanImplementation
  migration_id: 14
[15:16:42.798] DEBUG (#44): Running migration
  migration_name: ProjectionTurnsSourceProposedPlan
  migration_id: 15
[15:16:42.799] DEBUG (#44): Running migration
  migration_name: CanonicalizeModelSelections
  migration_id: 16
[15:16:42.803] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsArchivedAt
  migration_id: 17
[15:16:42.804] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsArchivedAtIndex
  migration_id: 18
[15:16:42.804] DEBUG (#44): Running migration
  migration_name: ProjectionSnapshotLookupIndexes
  migration_id: 19
[15:16:42.805] DEBUG (#44): Running migration
  migration_name: AuthAccessManagement
  migration_id: 20
[15:16:42.806] DEBUG (#44): Running migration
  migration_name: AuthSessionClientMetadata
  migration_id: 21
[15:16:42.810] DEBUG (#44): Running migration
  migration_name: AuthSessionLastConnectedAt
  migration_id: 22
[15:16:42.811] DEBUG (#44): Running migration
  migration_name: ProjectionThreadShellSummary
  migration_id: 23
[15:16:42.813] DEBUG (#44): Running migration
  migration_name: BackfillProjectionThreadShellSummary
  migration_id: 24
[15:16:42.815] DEBUG (#44): Running migration
  migration_name: CleanupInvalidProjectionPendingApprovals
  migration_id: 25
[15:16:42.815] DEBUG (#44): Running migration
  migration_name: CanonicalizeModelSelectionOptions
  migration_id: 26
[15:16:42.816] DEBUG (#44): Running migration
  migration_name: ProviderSessionRuntimeInstanceId
  migration_id: 27
[15:16:42.817] DEBUG (#44): Running migration
  migration_name: ProjectionThreadSessionInstanceId
  migration_id: 28
[15:16:42.819] DEBUG (#44): Running migration
  migration_name: ProjectionThreadDetailOrderingIndexes
  migration_id: 29
[15:16:42.819] DEBUG (#44): Running migration
  migration_name: ProjectionThreadShellArchiveIndexes
  migration_id: 30
[15:16:42.820] DEBUG (#44): Running migration
  migration_name: AuthAuthorizationScopes
  migration_id: 31
[15:16:42.821] DEBUG (#44): Running migration
  migration_name: AuthPairingProofKeyThumbprint
  migration_id: 32
[15:16:42.822] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsSettled
  migration_id: 33
[15:16:42.823] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsSnoozed
  migration_id: 34
[15:16:42.825] DEBUG (#44): Running migration
  migration_name: ProjectionThreadTitleRegeneration
  migration_id: 35
[15:16:42.826] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsPinned
  migration_id: 36
[15:16:42.827] DEBUG (#44): Running migration
  migration_name: ProjectionTurnsKeysetIndex
  migration_id: 37
[15:16:42.827] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsPinOrderKey
  migration_id: 38
[15:16:42.828] DEBUG (#44): Running migration
  migration_name: ProjectionProjectsDefaultThreadEnvMode
  migration_id: 39
[15:16:42.829] DEBUG (#44): Running migration
  migration_name: ProjectionProjectFaviconPath
  migration_id: 40
[15:16:42.830] DEBUG (#44): Running migration
  migration_name: AuthSessionClientConnection
  migration_id: 41
[15:16:42.831] DEBUG (#44): Running migration
  migration_name: ProjectionThreadLinkedPullRequest
  migration_id: 42
[15:16:42.832] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsUnsettledAt
  migration_id: 43
[15:16:42.833] DEBUG (#44): Running migration
  migration_name: ClearAutomaticProjectModelDefaults
  migration_id: 44
[15:16:42.834] DEBUG (#44): Running migration
  migration_name: ProjectionProjectsAutoPull
  migration_id: 45
[15:16:42.835] DEBUG (#44): Running migration
  migration_name: RepairAutomaticSettlementTimestamps
  migration_id: 46
[15:16:42.835] DEBUG (#44): Running migration
  migration_name: ProjectionProjectIcon
  migration_id: 47
[15:16:42.836] DEBUG (#44): Running migration
  migration_name: ProjectionThreadBranchPullRequest
  migration_id: 48
[15:16:42.837] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsActiveOrderKey
  migration_id: 49
[15:16:42.838] DEBUG (#44): Running migration
  migration_name: ProjectionThreadPullRequests
  migration_id: 50
[15:16:42.839] DEBUG (#44): Running migration
  migration_name: ProjectionThreadMessageContext
  migration_id: 51
[15:16:42.840] DEBUG (#44): Running migration
  migration_name: ProjectionThreadTitleState
  migration_id: 52
[15:16:42.840] DEBUG (#44): Running migration
  migration_name: PullRequestFilesViewed
  migration_id: 53
[15:16:42.841] DEBUG (#44): Running migration
  migration_name: ProjectionThreadsAutoSettleDisabledAt
  migration_id: 54
[15:16:42.842] DEBUG (#44): Running migration
  migration_name: OrchestrationV2
  migration_id: 55
[15:16:42.881] DEBUG (#44): Running migration
  migration_name: RemoveRedundantProjectionIndexes
  migration_id: 56
[15:16:42.882] DEBUG (#44): Running migration
  migration_name: ScheduledTaskWebhooks
  migration_id: 57
[15:16:42.884] DEBUG (#44): Running migration
  migration_name: WebhookRelayDeliveries
  migration_id: 58
[15:16:42.885] DEBUG (#44): Running migration
  migration_name: McpAppModelContext
  migration_id: 59
[15:16:42.886] DEBUG (#44): Running migration
  migration_name: ThreadSnapshotWindowIndexes
  migration_id: 60
[15:16:42.886] DEBUG (#44): Running migration
  migration_name: PullRequestReviewGuides
  migration_id: 61
[15:16:42.887] DEBUG (#44): Running migration
  migration_name: ThreadFailureLookupIndex
  migration_id: 62
[15:16:42.887] DEBUG (#44): Running migration
  migration_name: DropUnusedV1Projections
  migration_id: 63
[15:16:42.889] DEBUG (#44): Running migration
  migration_name: CanonicalizeThreadPullRequestLinks
  migration_id: 64
[15:16:42.890] DEBUG (#44): Running migration
  migration_name: CodexUsageNativeTurnIndex
  migration_id: 65
[15:16:42.891] DEBUG (#44): Running migration
  migration_name: RepairClientSettlementTimestamps
  migration_id: 66
[15:16:42.892] DEBUG (#44): Running migration
  migration_name: WebhookDedupe
  migration_id: 67
[15:16:42.894] DEBUG (#44): Running migration
  migration_name: ShellStopRequestIndex
  migration_id: 68
[15:16:42.895] DEBUG (#44): Running migration
  migration_name: ThreadMessageSearch
  migration_id: 69
[15:16:42.897] DEBUG (#44): Migrations complete
  latest_migration_name: ThreadMessageSearch
  latest_migration_id: 69
[15:16:42.901] INFO (#44): Migrations ran successfully
  migrations: [
    '1_OrchestrationEvents',
    '2_OrchestrationCommandReceipts',
    '3_CheckpointDiffBlobs',
    '4_ProviderSessionRuntime',
    '5_Projections',
    '6_ProjectionThreadSessionRuntimeModeColumns',
    '7_ProjectionThreadMessageAttachments',
    '8_ProjectionThreadActivitySequence',
    '9_ProviderSessionRuntimeMode',
    '10_ProjectionThreadsRuntimeMode',
    '11_OrchestrationThreadCreatedRuntimeMode',
    '12_ProjectionThreadsInteractionMode',
    '13_ProjectionThreadProposedPlans',
    '14_ProjectionThreadProposedPlanImplementation',
    '15_ProjectionTurnsSourceProposedPlan',
    '16_CanonicalizeModelSelections',
    '17_ProjectionThreadsArchivedAt',
    '18_ProjectionThreadsArchivedAtIndex',
    '19_ProjectionSnapshotLookupIndexes',
    '20_AuthAccessManagement',
    '21_AuthSessionClientMetadata',
    '22_AuthSessionLastConnectedAt',
    '23_ProjectionThreadShellSummary',
    '24_BackfillProjectionThreadShellSummary',
    '25_CleanupInvalidProjectionPendingApprovals',
    '26_CanonicalizeModelSelectionOptions',
    '27_ProviderSessionRuntimeInstanceId',
    '28_ProjectionThreadSessionInstanceId',
    '29_ProjectionThreadDetailOrderingIndexes',
    '30_ProjectionThreadShellArchiveIndexes',
    '31_AuthAuthorizationScopes',
    '32_AuthPairingProofKeyThumbprint',
    '33_ProjectionThreadsSettled',
    '34_ProjectionThreadsSnoozed',
    '35_ProjectionThreadTitleRegeneration',
    '36_ProjectionThreadsPinned',
    '37_ProjectionTurnsKeysetIndex',
    '38_ProjectionThreadsPinOrderKey',
    '39_ProjectionProjectsDefaultThreadEnvMode',
    '40_ProjectionProjectFaviconPath',
    '41_AuthSessionClientConnection',
    '42_ProjectionThreadLinkedPullRequest',
    '43_ProjectionThreadsUnsettledAt',
    '44_ClearAutomaticProjectModelDefaults',
    '45_ProjectionProjectsAutoPull',
    '46_RepairAutomaticSettlementTimestamps',
    '47_ProjectionProjectIcon',
    '48_ProjectionThreadBranchPullRequest',
    '49_ProjectionThreadsActiveOrderKey',
    '50_ProjectionThreadPullRequests',
    '51_ProjectionThreadMessageContext',
    '52_ProjectionThreadTitleState',
    '53_PullRequestFilesViewed',
    '54_ProjectionThreadsAutoSettleDisabledAt',
    '55_OrchestrationV2',
    '56_RemoveRedundantProjectionIndexes',
    '57_ScheduledTaskWebhooks',
    '58_WebhookRelayDeliveries',
    '59_McpAppModelContext',
    '60_ThreadSnapshotWindowIndexes',
    '61_PullRequestReviewGuides',
    '62_ThreadFailureLookupIndex',
    '63_DropUnusedV1Projections',
    '64_CanonicalizeThreadPullRequestLinks',
    '65_CodexUsageNativeTurnIndex',
    '66_RepairClientSettlementTimestamps',
    '67_WebhookDedupe',
    '68_ShellStopRequestIndex',
    '69_ThreadMessageSearch'
  ]
[15:16:48.272] DEBUG (#1579): Codex rate-limit read failed.
  {
    cause: {
      _tag: 'CodexAppServerRequestError',
      code: -32600,
      errorMessage: 'chatgpt authentication required to read rate limits',
      method: 'account/rateLimits/read',
      requestId: '6',
      operation: 'receive-response',
      cause: {
        code: -32600,
        message: 'chatgpt authentication required to read rate limits'
      }
    }
  }
[15:16:48.391] DEBUG (#6829): startup phase: starting keybindings runtime
[15:16:48.573] INFO (#6832): Listening on http://127.0.0.1:23131
[15:16:48.582] DEBUG (#6829): startup phase: starting server settings runtime
[15:16:48.602] INFO (#6829): agent activity publishing standby; waiting for T3 Connect link reconciliation
[15:16:48.713] INFO (#6829): V2 orchestration recovery completed
  {
    terminalizedRuns: 0,
    stoppedSessions: 0,
    closedRequests: 0,
    retiredEffects: 0,
    requeuedEffects: 0
  }
[15:16:48.716] DEBUG (#6829): startup phase: waiting for http listener
[15:16:48.716] DEBUG (#6829): startup phase: publishing welcome event
  {
    environmentId: 'cb0f16d3-28e4-4c6a-aec7-a753980d261b',
    cwd: '/home/ubuntu/wt/pr-24640/apps/server',
    projectName: 'server',
    bootstrapProjectId: '38068b77-3a04-4f5a-a308-b7f7a4c074a1',
    bootstrapThreadId: 'thread:project:38068b77-3a04-4f5a-a308-b7f7a4c074a1:5d032636-73ad-48e9-84ad-35dc31be25d5'
  }
[15:16:48.726] DEBUG (#6829): Accepting commands
[15:16:48.726] DEBUG (#6829): startup phase: publishing ready event
[15:16:48.726] DEBUG (#6829): startup phase: complete
[15:16:48.727] DEBUG (#7304): startup phase: recording startup heartbeat
[15:16:48.771] DEBUG (#7304): startup phase: browser open check
[15:16:48.784] INFO (#7304): Authentication required. Open T3 Code using the pairing URL.
  pairingUrl: [REDACTED]
[15:16:48.858] INFO (#7443) http.span=12ms: Sent HTTP response
  http.method: POST
  http.url: /api/auth/browser-session
  http.status: 200
[15:16:48.871] INFO (#7448) http.span=3ms: Sent HTTP response
  http.method: POST
  http.url: /api/auth/websocket-ticket/rpc
  http.status: 200
[15:16:48.950] DEBUG (#7091): agent activity publishing queued thread publish
  { eventType: 'thread.created', threadId: 'fixture-thread-a' }
[15:16:48.955] DEBUG (#6827): agent activity publish skipped; publication disabled
  { threadId: 'fixture-thread-a' }
[15:16:48.966] DEBUG (#7091): agent activity publishing queued thread publish
  { eventType: 'thread.created', threadId: 'fixture-thread-b' }
[15:16:48.969] DEBUG (#6827): agent activity publish skipped; publication disabled
  { threadId: 'fixture-thread-b' }
[15:16:49.727] DEBUG (#7090): agent activity snapshot skipped; relay link credentials unavailable
[15:16:54.729] DEBUG (#7090): agent activity snapshot skipped; relay link credentials unavailable
[15:17:04.730] DEBUG (#7090): agent activity snapshot skipped; relay link credentials unavailable
[15:17:04.878] INFO (#7451) http.span=16003ms:
  InterruptError: All fibers interrupted without error
      at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)
      at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)
      at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)
      at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47) {
    [cause]: InterruptCause: The fiber was interrupted by:
        at fiber (#7706)
        at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)
        at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)
        at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)
        at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)
        at fiber (#7706)
        at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)
        at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)
        at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)
        at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)
        at fiber (#7706)
        at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)
        at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)
        at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)
        at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)
  }
  http.method: GET
  http.url: /ws
  http.status: 503
[15:17:04.909] INFO (#2): V2 orchestration shutdown reconciliation completed
  {
    terminalizedRuns: 0,
    stoppedSessions: 0,
    closedRequests: 0,
    retiredEffects: 0,
    requeuedEffects: 0
  }


===== Relevant application trace spans (original start/end/duration/parent IDs; unrelated auth/provider/analytics spans excluded) =====
{"type": "effect-span", "name": "terminal.resolvePosixPsCommand", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "934e5d5be616895b", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114208193496841", "endTimeUnixNano": "1793114208196954277", "durationMs": 3.457436, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.resolveLaunchInputEnvironment", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "8ebf26b224bd43cc", "parentSpanId": "d882642d400bd9d7", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211577504272", "endTimeUnixNano": "1793114211577610051", "durationMs": 0.105779, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.assertValidCwd", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "f3e3e2fe0c3e24bf", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211578216218", "endTimeUnixNano": "1793114211578534234", "durationMs": 0.318016, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "ca1f68a3adfd3c20", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211578627289", "endTimeUnixNano": "1793114211578726024", "durationMs": 0.098735, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.flushPersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "0da08834acae47a1", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211578760940", "endTimeUnixNano": "1793114211578941598", "durationMs": 0.180658, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.readHistory", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "078bcaf1ad7bf39c", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211578975292", "endTimeUnixNano": "1793114211579753361", "durationMs": 0.778069, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.evictInactiveSessionsIfNeeded", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "db3e486903e10062", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211580239874", "endTimeUnixNano": "1793114211580439389", "durationMs": 0.199515, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.stopProcess", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "de7e10db90148f18", "parentSpanId": "b5a156f5022e92a6", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211580721467", "endTimeUnixNano": "1793114211580895003", "durationMs": 0.173536, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.trySpawn", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "342f65919ee42da3", "parentSpanId": "b5a156f5022e92a6", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211583576113", "endTimeUnixNano": "1793114211592540219", "durationMs": 8.964106, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "b4d4afaa61087a1a", "parentSpanId": "b5a156f5022e92a6", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211593482577", "endTimeUnixNano": "1793114211593573918", "durationMs": 0.091341, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "6099c917f41b9f97", "parentSpanId": "b5a156f5022e92a6", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211595469073", "endTimeUnixNano": "1793114211595630766", "durationMs": 0.161693, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "6f0249b7d82cfe89", "parentSpanId": "b5a156f5022e92a6", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211595757364", "endTimeUnixNano": "1793114211595824620", "durationMs": 0.067256, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.startSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "b5a156f5022e92a6", "parentSpanId": "52ebdb7ac751d331", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211580496515", "endTimeUnixNano": "1793114211595873221", "durationMs": 15.376706, "attributes": {"terminal.thread_id": "fixture-thread-a", "terminal.id": "term-0", "terminal.event_type": "started", "terminal.cwd": "/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.openLocked", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "52ebdb7ac751d331", "parentSpanId": "d882642d400bd9d7", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211577792032", "endTimeUnixNano": "1793114211595914047", "durationMs": 18.122015, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "ws.rpc.terminal.open", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "d882642d400bd9d7", "parentSpanId": "da9c152c64abf3e0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211577427879", "endTimeUnixNano": "1793114211596455262", "durationMs": 19.027383, "attributes": {"rpc.transport": "websocket", "rpc.system": "effect-rpc", "rpc.method": "terminal.open", "rpc.aggregate": "terminal"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "4559b4535d040abd", "parentSpanId": "0a16b0b816d54637", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211601080720", "endTimeUnixNano": "1793114211601105055", "durationMs": 0.024335, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.requireSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "0a16b0b816d54637", "parentSpanId": "f1cf5b2ad7a696f9", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211600980662", "endTimeUnixNano": "1793114211601160529", "durationMs": 0.179867, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.queuePersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "bcc627a7a1af378e", "parentSpanId": "11bf93f3e21d1baa", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211602963051", "endTimeUnixNano": "1793114211603416030", "durationMs": 0.452979, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.drainProcessEvents", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "11bf93f3e21d1baa", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211601997951", "endTimeUnixNano": "1793114211603901321", "durationMs": 1.90337, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistoryWorker", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "481e36c8c37de6ba", "parentSpanId": "17c6b299cc639590", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211604453878", "endTimeUnixNano": "1793114211855374144", "durationMs": 250.920266, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "processRunner.runProcessCore", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c5e9975e413a9b8b", "parentSpanId": "4488cdbd3b40bc14", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212205881116", "endTimeUnixNano": "1793114212269003187", "durationMs": 63.122071, "attributes": {"process.command": "ps"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.posixProcessTableSnapshot", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "4488cdbd3b40bc14", "parentSpanId": "f5e55318574f83ed", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212205594798", "endTimeUnixNano": "1793114212270136423", "durationMs": 64.541625, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.checkSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a7571ea8db51bb52", "parentSpanId": "f5e55318574f83ed", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212270467866", "endTimeUnixNano": "1793114212271367132", "durationMs": 0.899266, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.pollSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "f5e55318574f83ed", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212203537209", "endTimeUnixNano": "1793114212271424089", "durationMs": 67.88688, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "bcf6bfe41c00ebfd", "parentSpanId": "af686ab89a847214", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212524267673", "endTimeUnixNano": "1793114212524322856", "durationMs": 0.055183, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.requireSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "af686ab89a847214", "parentSpanId": "a72fd8dc0ad506c4", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212524235443", "endTimeUnixNano": "1793114212524370355", "durationMs": 0.134912, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.write", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a72fd8dc0ad506c4", "parentSpanId": "207d70253a5715b7", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212524059492", "endTimeUnixNano": "1793114212524646023", "durationMs": 0.586531, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "ws.rpc.terminal.write", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "207d70253a5715b7", "parentSpanId": "da9c152c64abf3e0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212523999259", "endTimeUnixNano": "1793114212524892555", "durationMs": 0.893296, "attributes": {"rpc.transport": "websocket", "rpc.system": "effect-rpc", "rpc.method": "terminal.write", "rpc.aggregate": "terminal"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.queuePersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "92b949eabe444a79", "parentSpanId": "7719152f1563aa6b", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212525886690", "endTimeUnixNano": "1793114212526101753", "durationMs": 0.215063, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.drainProcessEvents", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "7719152f1563aa6b", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212525660676", "endTimeUnixNano": "1793114212526446100", "durationMs": 0.785424, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.clearKillFiber", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c0c8257a6763de64", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212528122444", "endTimeUnixNano": "1793114212528371672", "durationMs": 0.249228, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a04c2c486f670830", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212528652779", "endTimeUnixNano": "1793114212528702132", "durationMs": 0.049353, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "cfbfeffd11567d5e", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212529136336", "endTimeUnixNano": "1793114212529185609", "durationMs": 0.049273, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "f0bf0c5e9a86d289", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212529299813", "endTimeUnixNano": "1793114212529337253", "durationMs": 0.03744, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "5705773d7250ad78", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212529551515", "endTimeUnixNano": "1793114212529599685", "durationMs": 0.04817, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.evictInactiveSessionsIfNeeded", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "d46c311871992bb0", "parentSpanId": "238d2061a3878547", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212529676870", "endTimeUnixNano": "1793114212529720031", "durationMs": 0.043161, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.drainProcessEvents", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "238d2061a3878547", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212527925525", "endTimeUnixNano": "1793114212529735370", "durationMs": 1.809845, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistoryWorker", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "2f7e6ff7242ff49a", "parentSpanId": "17c6b299cc639590", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114212526636266", "endTimeUnixNano": "1793114212777431748", "durationMs": 250.795482, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.resolveLaunchInputEnvironment", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "24e032cfe724f818", "parentSpanId": "3e1b3ebb4b40b0a1", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217756109297", "endTimeUnixNano": "1793114217756130667", "durationMs": 0.02137, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.assertValidCwd", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "5a5ce775c198dbb3", "parentSpanId": "9c7c2bb2d0739249", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217756713491", "endTimeUnixNano": "1793114217756944153", "durationMs": 0.230662, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c90273449a69b3b5", "parentSpanId": "9c7c2bb2d0739249", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217756980091", "endTimeUnixNano": "1793114217757001140", "durationMs": 0.021049, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.stopProcess", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "1c944c759e8bde48", "parentSpanId": "9c7c2bb2d0739249", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217757020196", "endTimeUnixNano": "1793114217757027610", "durationMs": 0.007414, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistoryWorker", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "16a5519dec954880", "parentSpanId": "17c6b299cc639590", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217757557644", "endTimeUnixNano": "1793114217757862716", "durationMs": 0.305072, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.flushPersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "3f71b322e72f8a29", "parentSpanId": "53eca5dc446f94e2", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217757298207", "endTimeUnixNano": "1793114217757988332", "durationMs": 0.690125, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistory", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "53eca5dc446f94e2", "parentSpanId": "9c7c2bb2d0739249", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217757092782", "endTimeUnixNano": "1793114217758001777", "durationMs": 0.908995, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.stopProcess", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "5db3fbafccc551d7", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217758047433", "endTimeUnixNano": "1793114217758092167", "durationMs": 0.044734, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.trySpawn", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "061af19b7ffa6fa7", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217759211005", "endTimeUnixNano": "1793114217762983432", "durationMs": 3.772427, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "9e6247ccbf8548e1", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217763184310", "endTimeUnixNano": "1793114217763269159", "durationMs": 0.084849, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "f974f751f8359e7d", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217763780167", "endTimeUnixNano": "1793114217763874965", "durationMs": 0.094798, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c13bb87d52e68cec", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217764136766", "endTimeUnixNano": "1793114217764223098", "durationMs": 0.086332, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "36316d66d7c0ba17", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217764541605", "endTimeUnixNano": "1793114217764607019", "durationMs": 0.065414, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a847c055dbd3282a", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217764666069", "endTimeUnixNano": "1793114217764696987", "durationMs": 0.030918, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "dc07b3b0a96c99ad", "parentSpanId": "d6b7c4015cbb8495", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217764728756", "endTimeUnixNano": "1793114217764749065", "durationMs": 0.020309, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.startSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "d6b7c4015cbb8495", "parentSpanId": "9c7c2bb2d0739249", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217758032205", "endTimeUnixNano": "1793114217764795081", "durationMs": 6.762876, "attributes": {"terminal.thread_id": "fixture-thread-a", "terminal.id": "term-0", "terminal.event_type": "restarted", "terminal.cwd": "/tmp/lead-24640-r1/capture-r13/2026-10-27T15-16-37.317Z-after-R13"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "ws.rpc.terminal.restart", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "3e1b3ebb4b40b0a1", "parentSpanId": "da9c152c64abf3e0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217755979984", "endTimeUnixNano": "1793114217765049438", "durationMs": 9.069454, "attributes": {"rpc.transport": "websocket", "rpc.system": "effect-rpc", "rpc.method": "terminal.restart", "rpc.aggregate": "terminal"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.queuePersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "1e14283a2fa2a124", "parentSpanId": "a809049ca081db5b", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217792562511", "endTimeUnixNano": "1793114217792955017", "durationMs": 0.392506, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.drainProcessEvents", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a809049ca081db5b", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217792035101", "endTimeUnixNano": "1793114217793437281", "durationMs": 1.40218, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistoryWorker", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "2dfbee397ed446fe", "parentSpanId": "17c6b299cc639590", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114217793658797", "endTimeUnixNano": "1793114218043537359", "durationMs": 249.878562, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "processRunner.runProcessCore", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "ad06b760ff6b52a5", "parentSpanId": "a18860bcff131b51", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114218273099398", "endTimeUnixNano": "1793114218334593326", "durationMs": 61.493928, "attributes": {"process.command": "ps"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.posixProcessTableSnapshot", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "a18860bcff131b51", "parentSpanId": "c62b074dc99028bc", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114218272986597", "endTimeUnixNano": "1793114218335373770", "durationMs": 62.387173, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.checkSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "2b159a51066b0596", "parentSpanId": "c62b074dc99028bc", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114218335533810", "endTimeUnixNano": "1793114218335793237", "durationMs": 0.259427, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.pollSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c62b074dc99028bc", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114218272510003", "endTimeUnixNano": "1793114218335813916", "durationMs": 63.303913, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "processRunner.runProcessCore", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "2245d89b7b4f759c", "parentSpanId": "05e24ffb954346df", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114220337778587", "endTimeUnixNano": "1793114220400739427", "durationMs": 62.96084, "attributes": {"process.command": "ps"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.posixProcessTableSnapshot", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "05e24ffb954346df", "parentSpanId": "fd1fce1500569cc7", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114220337624549", "endTimeUnixNano": "1793114220401508119", "durationMs": 63.88357, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.checkSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "6b01fee55defd95b", "parentSpanId": "fd1fce1500569cc7", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114220401696432", "endTimeUnixNano": "1793114220402019839", "durationMs": 0.323407, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.pollSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "fd1fce1500569cc7", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114220337183992", "endTimeUnixNano": "1793114220402043774", "durationMs": 64.859782, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "processRunner.runProcessCore", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "d0dbb779a4ca5af2", "parentSpanId": "603803df947433c0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224403691738", "endTimeUnixNano": "1793114224466362123", "durationMs": 62.670385, "attributes": {"process.command": "ps"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.posixProcessTableSnapshot", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "603803df947433c0", "parentSpanId": "5b85a7c5ac2f8058", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224403559270", "endTimeUnixNano": "1793114224467099145", "durationMs": 63.539875, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.checkSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "1ed979ed8f453e68", "parentSpanId": "5b85a7c5ac2f8058", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224467260458", "endTimeUnixNano": "1793114224467560340", "durationMs": 0.299882, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.pollSubprocessActivity", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "5b85a7c5ac2f8058", "parentSpanId": "b60788cffae4145f", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224403073408", "endTimeUnixNano": "1793114224467592912", "durationMs": 64.519504, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.getSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "ae39e3027992c582", "parentSpanId": "c8be485af7cecd8a", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721069823", "endTimeUnixNano": "1793114224721102755", "durationMs": 0.032932, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.clearKillFiber", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "6c05b85f8186e507", "parentSpanId": "b29c184f6ea99086", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721289836", "endTimeUnixNano": "1793114224721372431", "durationMs": 0.082595, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.registerKillFiber", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c4488be7cef5c075", "parentSpanId": "194cefc831dd8cf8", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721732476", "endTimeUnixNano": "1793114224721874663", "durationMs": 0.142187, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.startKillEscalation", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "194cefc831dd8cf8", "parentSpanId": "b29c184f6ea99086", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721512524", "endTimeUnixNano": "1793114224721897546", "durationMs": 0.385022, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.evictInactiveSessionsIfNeeded", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "565b6265b46114c5", "parentSpanId": "b29c184f6ea99086", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721923084", "endTimeUnixNano": "1793114224721976254", "durationMs": 0.05317, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.stopProcess", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "b29c184f6ea99086", "parentSpanId": "c8be485af7cecd8a", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224721155534", "endTimeUnixNano": "1793114224721986803", "durationMs": 0.831269, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistoryWorker", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "e2aa22a756fff471", "parentSpanId": "17c6b299cc639590", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224723110862", "endTimeUnixNano": "1793114224723700338", "durationMs": 0.589476, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.flushPersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "4d7b2fd4c1f3b2f2", "parentSpanId": "bce519f9f45c12c8", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224722270235", "endTimeUnixNano": "1793114224723830833", "durationMs": 1.560598, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.persistHistory", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "bce519f9f45c12c8", "parentSpanId": "c8be485af7cecd8a", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224722044362", "endTimeUnixNano": "1793114224723845209", "durationMs": 1.800847, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.flushPersist", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "07f518f8a8be74b0", "parentSpanId": "c8be485af7cecd8a", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224723872200", "endTimeUnixNano": "1793114224723909009", "durationMs": 0.036809, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "terminal.closeSession", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "c8be485af7cecd8a", "parentSpanId": "7e8b816d99d4c365", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224720852616", "endTimeUnixNano": "1793114224724540514", "durationMs": 3.687898, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "ws.rpc.terminal.close", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "7e8b816d99d4c365", "parentSpanId": "da9c152c64abf3e0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224720558735", "endTimeUnixNano": "1793114224724797666", "durationMs": 4.238931, "attributes": {"rpc.transport": "websocket", "rpc.system": "effect-rpc", "rpc.method": "terminal.close", "rpc.aggregate": "terminal"}, "events": [], "links": [], "exit": {"_tag": "Success"}}
{"type": "effect-span", "name": "ws.rpc.terminal.observe", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "f1cf5b2ad7a696f9", "parentSpanId": "da9c152c64abf3e0", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114211600459244", "endTimeUnixNano": "1793114224885124917", "durationMs": 13284.665673, "attributes": {"rpc.transport": "websocket", "rpc.system": "effect-rpc", "rpc.method": "terminal.observe", "rpc.aggregate": "terminal"}, "events": [], "links": [], "exit": {"_tag": "Interrupted", "cause": "InterruptError: All fibers interrupted without error\n    at ws.rpc.terminal.observe (file:///home/ubuntu/wt/pr-24640/apps/server/src/observability/RpcInstrumentation.ts:246:12)\n    at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)\n    at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)\n    at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)\n    at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47) {\n  [cause]: InterruptCause: The fiber was interrupted by:\n      at fiber (#7454)\n      at fiber (#7454)\n      at fiber (#7454)\n      at fiber (#7454)\n      at fiber (#7454)\n      at fiber (#7454)\n}"}}
{"type": "effect-span", "name": "terminal.runKillEscalation", "traceId": "a2dc7e36561ebb6814bdcb453bd2cd06", "spanId": "7bb4a41152709acf", "parentSpanId": "194cefc831dd8cf8", "sampled": true, "kind": "internal", "startTimeUnixNano": "1793114224722460843", "endTimeUnixNano": "1793114224955232974", "durationMs": 232.772131, "attributes": {}, "events": [], "links": [], "exit": {"_tag": "Interrupted", "cause": "InterruptError: All fibers interrupted without error\n    at terminal.runKillEscalation (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1786:26)\n    at terminal.runKillEscalation (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1715:36)\n    at terminal.startKillEscalation (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:2234:12)\n    at terminal.startKillEscalation (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1781:38)\n    at terminal.stopProcess (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:2481:14)\n    at terminal.stopProcess (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:2209:30)\n    at terminal.closeSession (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:3315:18)\n    at terminal.closeSession (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:2471:31)\n    at ws.rpc.terminal.close (file:///home/ubuntu/wt/pr-24640/apps/server/src/observability/RpcInstrumentation.ts:246:12)\n    at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17) {\n  [cause]: InterruptCause: The fiber was interrupted by:\n      at fiber (#14179)\n      at TerminalManager.makeWithOptions (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1492:17)\n      at TerminalManager.makeWithOptions (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1508:39)\n      at TerminalManager.make (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:3390:52)\n      at TerminalManager.make (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1475:28)\n      at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)\n      at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)\n      at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)\n      at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)\n      at fiber (#14179)\n      at TerminalManager.makeWithOptions (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1492:17)\n      at TerminalManager.makeWithOptions (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1508:39)\n      at TerminalManager.make (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:3390:52)\n      at TerminalManager.make (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1475:28)\n      at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)\n      at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)\n      at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)\n      at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)\n      at fiber (#14179)\n      at TerminalManager.makeWithOptions (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1492:17)\n      at TerminalManager.makeWithOptions (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1508:39)\n      at TerminalManager.make (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:3390:52)\n      at TerminalManager.make (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1475:28)\n      at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)\n      at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)\n      at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)\n      at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)\n      at fiber (#14179)\n      at TerminalManager.makeWithOptions (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1492:17)\n      at TerminalManager.makeWithOptions (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1508:39)\n      at TerminalManager.make (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:3390:52)\n      at TerminalManager.make (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/terminal/Manager.ts:1475:28)\n      at server.runServerCommand (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:68:17)\n      at server.runServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:23:33)\n      at server.runDefaultServerCommand (file:///home/ubuntu/wt/pr-24640/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/cli/internal/command.js:54:93)\n      at server.runDefaultServerCommand (definition) (file:///home/ubuntu/wt/pr-24640/apps/server/src/cli/server.ts:48:47)\n}"}}

===== Exact capture scripts =====

--- driver.mjs SHA256 11ce0be6bba6331dcd9f0030bb62e1806061ef2cc32af0dbcae4b89918917b55 ---
import fs from 'node:fs';
import cp from 'node:child_process';
import path from 'node:path';
import crypto from 'node:crypto';
const ROOT='/tmp/lead-24640-r1/capture-r13';
const [side='after',row='R02',delayArg='0',nArg='1',queryArg='3',modeArg='valid']=process.argv.slice(2);
const checkout=side==='before'?'/home/ubuntu/wt/pr-24640-before':'/home/ubuntu/wt/pr-24640';
const run=path.join(ROOT,`${new Date().toISOString().replaceAll(':','-')}-${side}-${row}`);fs.mkdirSync(run,{recursive:true});fs.mkdirSync(run+'/shell-home');
for(const name of ['driver.mjs','launch.sh','ps-shim.py','preload.mjs','native-fail.py','native-proxy.py'])fs.copyFileSync(ROOT+'/'+name,run+'/'+name);
fs.writeFileSync(run+'/native-real-path',ROOT+'/native-'+side+'/release/t3-resource-monitor');
const nativePath=['R01','R14'].includes(row)?ROOT+'/native-proxy.py':ROOT+'/native-fail.py';fs.writeFileSync(run+'/native-path',nativePath);
const port=Number(process.env.CAPTURE_PORT||21000+Math.floor(Math.random()*20000));
const token=crypto.randomBytes(24).toString('hex');
const start=process.hrtime.bigint();
const log=(kind,data={})=>fs.appendFileSync(run+'/rpc.jsonl',JSON.stringify({kind,utc:new Date().toISOString(),mono_ns:process.hrtime.bigint().toString(),ms:Number(process.hrtime.bigint()-start)/1e6,...data})+'\n');
const hash=f=>crypto.createHash('sha256').update(fs.readFileSync(f)).digest('hex');
const sha=cp.execFileSync('git',['rev-parse','HEAD'],{cwd:checkout,encoding:'utf8'}).trim();
log('manifest',{driverPid:process.pid,side,row,sha,checkout,run,port,node:process.version,platform:process.platform,arch:process.arch,db:run+'/home/userdata/statev2.sqlite',nativeBinary:fs.existsSync(ROOT+'/native-'+side+'/release/t3-resource-monitor')?hash(ROOT+'/native-'+side+'/release/t3-resource-monitor'):null,nativeSource:hash(checkout+'/native/resource-monitor/src/main.rs'),driver:hash(ROOT+'/driver.mjs'),shim:hash(ROOT+'/ps-shim.py'),sourceStatus:cp.execFileSync('git',['status','--short'],{cwd:checkout,encoding:'utf8'}),environment:'Linux fs-31; real apps/server; private mount namespace ps interception; fresh DB; no viewport/theme/DPR/font scaling'});
console.log(run);
let phase=row;
const control=(mode,delay,extra={})=>{const c={phase,mode,delay,...extra};fs.writeFileSync(run+'/control.json',JSON.stringify(c));log('control',c)};
control(modeArg,Number(delayArg));
const server=cp.spawn('sudo',['-n','--preserve-env=CAPTURE_TOKEN','unshare','-m','--propagation','private','bash',ROOT+'/launch.sh',run,checkout,String(port),process.execPath],{env:{...process.env,CAPTURE_TOKEN:token},stdio:['ignore','pipe','pipe']});
log('spawn',{pid:server.pid,argv:['sudo','unshare','-m','--propagation','private','bash','launch.sh',run,checkout,port,process.execPath]});
const clean=s=>s.replaceAll(token,'[REDACTED]').replace(/(token=)[^\s"&]+/g,'$1[REDACTED]');
for(const stream of [server.stdout,server.stderr])stream.on('data',b=>{fs.appendFileSync(run+'/server.log',clean(b.toString()));});
let ws; let next=1;const pending=new Map(),events=[],state=new Map(),allPids=new Set();
const sleep=ms=>new Promise(r=>setTimeout(r,ms));
const until=async(fn,ms=60000,label='condition')=>{const end=Date.now()+ms;while(!fn()){if(Date.now()>end)throw Error('deadline '+label);await sleep(20)}return fn()};
const shims=()=>{try{return fs.readFileSync(run+'/shim.jsonl','utf8').trim().split('\n').filter(Boolean).map(l=>JSON.parse(l))}catch{return []}};
const interceptions=()=>{try{return fs.readFileSync(run+'/interception.jsonl','utf8').split('\n').filter(Boolean).map(l=>JSON.parse(l))}catch{return []}};
const queries=()=>[...shims().filter(e=>e.kind==='start'),...interceptions().filter(e=>e.kind==='spawn-failure-start').map(e=>({...e,kind:'start'}))].sort((a,b)=>Number(a.mono_ns)-Number(b.mono_ns));
const phaseQueries=()=>queries().filter(q=>q.phase===phase);
const ended=()=>[...shims().filter(e=>['end','signal','broken-pipe'].includes(e.kind)),...interceptions().filter(e=>e.kind==='spawn-failure-end').map(e=>({...e,kind:'end'}))].sort((a,b)=>Number(a.mono_ns)-Number(b.mono_ns));
const send=x=>ws.send(JSON.stringify(x));
const rpc=(tag,payload={},stream=false)=>{const id=String(next++);log('request',{id,tag,payload});return new Promise((resolve,reject)=>{pending.set(id,{resolve,reject,tag,stream});send({_tag:'Request',id,tag,payload,headers:[]});if(stream)resolve(id)})};
const metadata=async()=>{await rpc('subscribeTerminalMetadata',{},true);await sleep(100);log('state',{terminals:[...state.values()]})};
const command=(type,fields)=>rpc('orchestration.dispatchCommand',{type,commandId:crypto.randomUUID(),...fields});
const tinput=(i)=>({threadId:i<10?'fixture-thread-a':'fixture-thread-b',terminalId:`term-${i}`});
const opened=[];
async function open(i,busy=true){const input={...tinput(i),cwd:run,cols:100,rows:24,env:{HOME:run+'/shell-home',PS1:'fixture> ',BASH_ENV:'/dev/null',ENV:'/dev/null',NO_COLOR:'1',FORCE_COLOR:'0'}};const snapshot=await rpc('terminal.open',input);opened.push(i);if(snapshot?.pid)allPids.add(snapshot.pid);await rpc('terminal.observe',tinput(i),true);if(busy){const marker=`READY_${row}_${i}`;await rpc('terminal.write',{...tinput(i),data:`${process.execPath} -e 'process.title="fixture-child";console.log("${marker} "+process.pid);process.stdin.resume();process.stdin.on("data",d=>{if(d.toString().includes("EXIT"))process.exit(0)})'\r`});await until(()=>events.some(e=>e.type==='output'&&e.terminalId===`term-${i}`&&e.data.includes(marker)&&new RegExp(marker+" [0-9]+").test(e.data)),15000,'child ready '+i);const ready=events.find(e=>e.type==='output'&&e.terminalId===`term-${i}`&&new RegExp(marker+" [0-9]+").test(e.data));const childPid=Number(ready.data.match(new RegExp(marker+" ([0-9]+)"))[1]);allPids.add(childPid);log('child-ready',{...tinput(i),childPid,marker})}return snapshot}
try{
 await until(()=>{try{return fs.readFileSync(run+'/server.log','utf8').includes('listening')||fs.readFileSync(run+'/server.log','utf8').includes('pairingUrl')}catch{return false}},90000,'server listening');
 log('server-ready');
 let response=await fetch(`http://127.0.0.1:${port}/api/auth/browser-session`,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({credential:token})});
 const body=await response.json();if(!response.ok)throw Error('auth '+JSON.stringify(body));
 const cookie=response.headers.getSetCookie().map(s=>s.split(';')[0]).join('; ');
 response=await fetch(`http://127.0.0.1:${port}/api/auth/websocket-ticket/rpc`,{method:'POST',headers:{Authorization:'Bearer '+token}});const ticket=await response.json();if(!response.ok)throw Error('ticket '+JSON.stringify(ticket));
 const rawTicket=ticket.ticket?.token||ticket.token||ticket.ticket;
 ws=new WebSocket(`ws://127.0.0.1:${port}/ws?orchestrationProtocol=2&wsTicket=${encodeURIComponent(rawTicket)}`);
 ws.addEventListener('message',event=>{let msgs;try{const m=JSON.parse(event.data);msgs=Array.isArray(m)?m:[m]}catch{log('wire-error',{data:String(event.data)});return}for(const m of msgs){log('wire',{message:m});if(m._tag==='Ping')send({_tag:'Pong'});if(m._tag==='Chunk'){send({_tag:'Ack',requestId:m.requestId});const p=pending.get(String(m.requestId));for(const e of m.values||[]){events.push(e);if(e.type==='upsert')state.set(e.terminal.threadId+'/'+e.terminal.terminalId,e.terminal);if(e.type==='remove')state.delete(e.threadId+'/'+e.terminalId);if(e.type==='snapshot'&&e.terminals)for(const t of e.terminals)state.set(t.threadId+'/'+t.terminalId,t)}}if(m._tag==='Exit'){const p=pending.get(String(m.requestId));if(p){if(m.exit?._tag==='Success'){log('receipt',{id:m.requestId,tag:p.tag,value:m.exit.value});p.resolve(m.exit.value)}else p.reject(Error(JSON.stringify(m.exit)));pending.delete(String(m.requestId))}}}});
 await new Promise((r,j)=>{ws.addEventListener('open',r,{once:true});ws.addEventListener('error',()=>j(Error('websocket failed')),{once:true})});log('rpc-connected');
 await rpc('subscribeTerminalEvents',{},true);await rpc('subscribeTerminalMetadata',{},true);
 if(row==='DRY'){await open(0);await until(()=>ended().length>=1,30000);await metadata();}
 else {await seedThreads();await runScenario();}
 log('scenario-complete');
}catch(e){log('error',{message:e.message,stack:e.stack});console.error(e)}finally{
 if(ws?.readyState===1){for(const i of opened){try{await Promise.race([rpc('terminal.close',tinput(i)),sleep(3000)])}catch{}}await metadata().catch(()=>{});ws.close()}
 // The recorded wrapper pid is root-owned; identify the direct real-server descendant of our sudo before signaling it.
 const descendants=()=>{const rows=cp.execFileSync(ROOT+'/real-ps',['-eo','pid=,ppid=,comm='],{encoding:'utf8'}).trim().split('\n').map(l=>l.trim().split(/\s+/));let ids=new Set([server.pid]);for(let n=0;n<8;n++)for(const [pid,ppid] of rows)if(ids.has(+ppid))ids.add(+pid);return [...ids]};
 const owned=descendants();log('cleanup-start',{pids:owned,ptyPids:[...allPids]});
 for(const pid of owned.reverse()){try{cp.execFileSync('sudo',['-n','kill','-TERM',String(pid)])}catch{}}
 await sleep(1800);
 const survivors=[...new Set([...owned,...allPids,...shims().map(q=>q.pid)])].filter(pid=>fs.existsSync('/proc/'+pid));
 for(const pid of survivors){try{cp.execFileSync('sudo',['-n','kill','-KILL',String(pid)])}catch{}}
 await sleep(250);log('cleanup-end',{survivorsBeforeFinalKill:survivors,remaining:survivors.filter(pid=>fs.existsSync('/proc/'+pid)).map(pid=>({pid,stat:fs.readFileSync('/proc/'+pid+'/stat','utf8')}))});
 fs.writeFileSync(run+'/summary.json',JSON.stringify({side,row,sha,queries:queries(),ended:ended(),events:events.filter(e=>e.type==='activity'),finalState:[...state.values()]},null,2));
 console.log('DONE '+run);
}
async function seedThreads(){
 await rpc('projects.mutate',{type:'project.create',commandId:crypto.randomUUID(),projectId:'fixture-project',title:'Synthetic polling fixture',workspaceRoot:run});
 if(row==='R19')await rpc('server.updateSettings',{patch:{defaultProjectScripts:[{id:'fixture-settle',name:'Controlled settle fixture',command:`${process.execPath} -e 'const fs=require("fs");process.title="fixture-script";console.log("SCRIPT_READY");fs.watch("${run}",()=>{if(fs.existsSync("${run}/release-script")){console.log("SCRIPT_DONE");process.exit(0)}})'`,icon:'play',runOnWorktreeCreate:false,runOnSettle:true,async:true}]}});
 for(const threadId of ['fixture-thread-a','fixture-thread-b'])await command('thread.create',{threadId,projectId:'fixture-project',title:threadId,modelSelection:{instanceId:'codex',model:'gpt-5'},runtimeMode:'full-access',interactionMode:'default',branch:null,worktreePath:row==='R19'?run:null,createdBy:'user',creationSource:'web'});
}
async function waitCount(count,timeout=400000){await until(()=>phaseQueries().length>=count,timeout,'query count '+phase);await until(()=>ended().some(e=>e.pid===phaseQueries().at(-1).pid),25000,'last query end');await sleep(150);await metadata()}
function settledSpans(){try{return fs.readFileSync(run+'/trace.jsonl','utf8').split('\n').filter(Boolean).map(l=>JSON.parse(l)).filter(s=>s.name==='ThreadSettlementServiceV2.cleanUpSettledThread')}catch{return []}}
async function settle(threadId='fixture-thread-a'){const prior=settledSpans().length;const receipt=await command('thread.settle',{threadId});await until(()=>settledSpans().length>prior,15000,'settlement cleanup completed span');log('settlement-cleanup-completed',{threadId,span:settledSpans().at(-1)});return receipt}

function nativeQueries(){try{return fs.readFileSync(run+'/native-protocol.jsonl','utf8').split('\n').filter(Boolean).map(l=>JSON.parse(l)).filter(e=>e.kind==='native-request'&&e.type==='processTable')}catch{return []}}
async function runScenario(){
 const n=Number(nArg),delay=Number(delayArg),count=Number(queryArg);
 if(row==='R14F'){await open(0,false);await waitCount(3);log('fallback-idle-no-quiet-suppression');return;}
 if(row==='R06'){
  phase='R06-seeding';control('fail',0);for(let i=0;i<20;i++)await open(i);log('all-twenty-ready');phase='R06-shared-slow';control('valid',5000);await waitCount(2);return;
 }
 if(row==='R01'){
  await open(0);await until(()=>events.some(e=>e.type==='activity'&&e.hasRunningSubprocess),15000,'native busy');await until(()=>nativeQueries().length>=3,15000,'native repeated unchanged labels');await metadata();log('unchanged-label-window',{queryCount:nativeQueries().length});await rpc('terminal.write',{...tinput(0),data:'EXIT\r'});await until(()=>events.some(e=>e.type==='activity'&&!e.hasRunningSubprocess),15000,'native idle');await metadata();return;
 }
 if(row==='R14'){
  await open(0,false);await until(()=>nativeQueries().length>=2,15000,'quiet earning snapshots');log('quiet-two-snapshots',{queries:nativeQueries()});await until(()=>nativeQueries().length>=3,45000,'30th quiet refresh');log('quiet-refresh',{queries:nativeQueries()});
  const base=nativeQueries().length;await rpc('terminal.write',{...tinput(0),data:'echo INPUT_WAKE\r'});await until(()=>nativeQueries().length>base,5000,'input wake');log('input-wake-refresh');
  await until(()=>nativeQueries().length>=base+2,5000,'quiet after input');await sleep(1500);const shell=[...state.values()].find(t=>t.terminalId==='term-0');const tty=fs.readlinkSync('/proc/'+shell.pid+'/fd/1');const afterOutput=nativeQueries().length;log('external-pty-output',{tty});fs.writeFileSync(tty,'ASYNC_EXTERNAL_OUTPUT_WAKE\r\n');await until(()=>events.some(e=>e.type==='output'&&e.data.includes('ASYNC_EXTERNAL_OUTPUT_WAKE')),5000,'asynchronous PTY output');await until(()=>nativeQueries().length>afterOutput,5000,'output wake');log('output-wake-refresh');await open(1,true);await until(()=>events.some(e=>e.type==='activity'&&e.terminalId==='term-1'&&e.hasRunningSubprocess),10000,'new child busy');await metadata();return;
 }
 if(row==='R19'){
  log('script-success-phase');await settle();await until(()=>events.some(e=>e.type==='output'&&e.data.includes('SCRIPT_READY\r\n')),20000,'script readiness');
  const target=[...state.values()].find(t=>t.terminalId.startsWith('settle-'));if(!target)throw Error('script target missing');log('script-target',{terminalId:target.terminalId,pid:target.pid});allPids.add(target.pid);
  await open(0,false);await until(()=>state.get(target.threadId+'/'+target.terminalId)?.hasRunningSubprocess,30000,'script busy publication');fs.writeFileSync(run+'/release-script','release');log('release-script');await until(()=>events.some(e=>e.type==='closed'&&e.terminalId===target.terminalId),20000,'successful script target closed');await metadata();
  await rpc('terminal.write',{...tinput(0),data:'echo SIBLING_ALIVE\r'});await command('thread.unsettle',{threadId:'fixture-thread-a',reason:'user'});
  await rpc('server.updateSettings',{patch:{defaultProjectScripts:[{id:'fixture-fail',name:'Failed settle fixture',command:`${process.execPath} -e 'const fs=require("fs");process.title="fixture-script";console.log("FAILED_SCRIPT_READY");fs.watch("${run}",()=>{if(fs.existsSync("${run}/release-failed")){console.log("FAILED_SCRIPT_DONE");process.exit(7)}})'`,icon:'play',runOnWorktreeCreate:false,runOnSettle:true,async:true}]}});
  await settle();await until(()=>events.some(e=>e.type==='output'&&e.data.includes('FAILED_SCRIPT_READY\r\n')),20000,'failed script readiness');const failed=[...state.values()].find(t=>t.terminalId.startsWith('settle-'));allPids.add(failed.pid);await open(1,false);await until(()=>state.get(failed.threadId+'/'+failed.terminalId)?.hasRunningSubprocess,30000,'failed script busy publication');fs.writeFileSync(run+'/release-failed','release');log('release-failed-script',{terminalId:failed.terminalId});await until(()=>events.some(e=>e.type==='output'&&e.data.includes('FAILED_SCRIPT_DONE\r\n')),10000,'failed script completed');await until(()=>state.get(failed.threadId+'/'+failed.terminalId)?.hasRunningSubprocess===false,30000,'failed script idle refresh');await metadata();return;
 }

 if(['R08','R09','R10','R11','R12'].includes(row)){
  phase=row+'-seed';control('valid',0);await open(0);await until(()=>events.some(e=>e.type==='activity'&&e.hasRunningSubprocess),20000,'seed busy');await metadata();
  phase=row+'-failure';control(modeArg,delay);await waitCount(count);if(row==='R12'){control('valid',0);await waitCount(count+1);log('spawn-failure-recovery');}
  if(row==='R09'){
   phase='R09-native-recovery';fs.writeFileSync(run+'/native-recover','recover');log('native-retry');await rpc('server.retryResourceTelemetry',{});await until(()=>nativeQueries().length>=2,70000,'native recovery snapshots');await metadata();
   // Stop only the native proxy PID it recorded, then prove the next fallback starts at the reset delay.
   const native=fs.readFileSync(run+'/native-protocol.jsonl','utf8').split('\n').filter(Boolean).map(l=>JSON.parse(l)).find(e=>e.kind==='native-spawn');phase='R09-failure-after-reset';control('fail',0);fs.unlinkSync(run+'/native-recover');cp.execFileSync('sudo',['-n','kill','-TERM',String(native.pid)]);log('native-stopped',{pid:native.pid});await waitCount(2,30000);
  }
  return;
 }
 if(row==='R15'||row==='R16'){
  await open(0);if(row==='R15')await open(1);
  await until(()=>queries().length>=1,20000,'inflight query');log('interaction',{action:row==='R15'?'close captured candidate':'restart captured candidate, open new candidate',query:queries()[0]});
  if(row==='R15')await rpc('terminal.close',tinput(0));
  else {const snap=await rpc('terminal.restart',{...tinput(0),cwd:run,cols:100,rows:24});if(snap.pid)allPids.add(snap.pid);await rpc('terminal.write',{...tinput(0),data:`${process.execPath} -e 'process.title="fixture-child";console.log("RESTART_READY "+process.pid);process.stdin.resume()'\r`});await open(1)}
  await waitCount(count);return;
 }
 if(['R20','R21'].includes(row)){
  phase=row+'-seed';control('valid',0);await open(0);await open(10);await until(()=>events.some(e=>e.type==='activity'&&e.hasRunningSubprocess),20000,'seed busy');
  phase=row+'-slow';control(row==='R20'?'hang':'valid',delay);
  if(row==='R21')await until(()=>phaseQueries().length>=1,20000,'background slow start');
  const prior=queries().length;log('settle-start');const settled=settle();await until(()=>queries().length>prior,10000,'closeIdle query start');
  const resize=rpc('terminal.resize',{...tinput(0),cols:80,rows:30});const other=rpc('terminal.resize',{...tinput(10),cols:80,rows:30});await other;log('other-thread-resize-complete');await settled;await resize;log('same-thread-resize-complete');
  await until(()=>ended().some(e=>e.pid===queries().at(-1).pid),25000,'cleanup query finished');if(row==='R21')await until(()=>ended().some(e=>e.pid===phaseQueries()[0].pid),25000,'background finished');await metadata();return;
 }
 if(row==='R17'){
  log('settle-empty');await settle();await sleep(1500);await metadata();await command('thread.unsettle',{threadId:'fixture-thread-a',reason:'user'});await open(0,false);await rpc('terminal.write',{...tinput(0),data:'exit\r'});await until(()=>events.some(e=>e.type==='exited'),10000,'shell exit');await sleep(1500);phase='R17-exited';control('valid',0);const base=queries().length;await settle();await sleep(2000);log('negative-window',{queryCount:queries().length-base});await metadata();return;
 }
 if(row==='R18'||row==='R22'){
  await open(0,false);await open(1,row==='R18');await open(10,true);
  if(row==='R22'){await until(()=>queries().length>=1,10000,'initial background query');await until(()=>ended().some(e=>e.pid===queries()[0].pid),10000,'initial background completed');log('first-background-completed');}
  await sleep(200);phase=row+'-settle';control('valid',row==='R22'?500:0);const base=queries().length;const done=settle();
  if(row==='R22'){await until(()=>queries().length>base,10000,'cleanup start');await rpc('terminal.write',{...tinput(0),data:'echo INPUT_DURING_QUERY\r'});}
  await done;await until(()=>events.some(e=>e.type==='closed'&&e.terminalId===(row==='R18'?'term-0':'term-1')),20000,'idle sibling closed');await rpc('terminal.write',{...tinput(row==='R18'?1:0),data:row==='R18'?'PING\r':'echo STILL_ALIVE\r'});await sleep(500);await metadata();
  if(row==='R22'){
   await command('thread.unsettle',{threadId:'fixture-thread-a',reason:'user'});await open(2,false);const firstBackground=queries().filter(q=>q.phase!=='R22-settle').length;await until(()=>queries().length>=3,20000,'next background query');await until(()=>ended().some(e=>e.pid===queries().at(-1).pid),10000,'next background completed');log('second-background-completed');phase='R22-output-during-query';control('valid',500);const prior=queries().length;const settled=settle();await until(()=>queries().length>prior,10000,'output-phase cleanup start');const shell=[...state.values()].find(t=>t.terminalId==='term-0');const tty=fs.readlinkSync('/proc/'+shell.pid+'/fd/1');log('external-pty-output',{tty});fs.writeFileSync(tty,'OUTPUT_DURING_QUERY\r\n');await settled;await until(()=>events.some(e=>e.type==='closed'&&e.terminalId==='term-2'),10000,'unchanged sibling closed after output');await rpc('terminal.write',{...tinput(0),data:'echo STILL_ALIVE_AFTER_OUTPUT\r'});await metadata();
  }
  return;
 }
 if(row==='R13'){
  log('negative-empty-start',{queries:queries().length});await sleep(2500);log('negative-empty-end',{queries:queries().length});
  if(queries().length!==0)throw Error('unexpected query while empty');await metadata();
  await open(0,false);await waitCount(1);log('pre-exit-query-completed',{query:queries().at(-1),end:ended().find(e=>e.pid===queries().at(-1).pid)});
  await rpc('terminal.write',{...tinput(0),data:'exit\r'});await until(()=>events.some(e=>e.type==='exited'),10000,'shell exited');await metadata();
  const exitedBase=queries().length;log('negative-exited-start',{queries:exitedBase,inFlight:queries().filter(q=>!ended().some(e=>e.pid===q.pid)).length});
  await sleep(5000);log('negative-exited-end',{queries:queries().length,newQueries:queries().length-exitedBase});
  if(queries().length!==exitedBase)throw Error('unexpected query while exited');await metadata();
  phase='R13-post-reopen';control('valid',0);log('reopen-start');
  const reopened=await rpc('terminal.restart',{...tinput(0),cwd:run,cols:100,rows:24});if(reopened.pid)allPids.add(reopened.pid);log('reopen-complete',{snapshot:reopened});await metadata();
  await waitCount(3,30000);log('post-reopen-three-queries-completed',{queries:phaseQueries(),ends:ended().filter(e=>phaseQueries().some(q=>q.pid===e.pid))});return;
 }
 for(let i=0;i<n;i++)await open(i);
 await waitCount(count);
}


--- launch.sh SHA256 14af43e96ae7298d80d299494d212eb6f039635913e54becc28fd7afd3183240 ---
#!/bin/bash
set -eu
run=$1
checkout=$2
port=$3
runtime=$4
mount --bind /tmp/lead-24640-r1/capture-r13/ps-shim.py /usr/bin/ps
python3 - "$run" <<'PYSCRIPT'
import os,sys,json,hashlib
from pathlib import Path
root=Path(sys.argv[1])
(root/'namespace.json').write_text(json.dumps({'launcherPid':os.getppid(),'mountNamespace':os.readlink('/proc/self/ns/mnt'),'hostPid1MountNamespace':os.readlink('/proc/1/ns/mnt'),'psSha256':hashlib.sha256(Path('/usr/bin/ps').read_bytes()).hexdigest(),'shimSha256':hashlib.sha256(Path('/tmp/lead-24640-r1/capture-r13/ps-shim.py').read_bytes()).hexdigest(),'psMountInfo':[line for line in Path('/proc/self/mountinfo').read_text().splitlines() if ' /usr/bin/ps ' in line]},indent=2))
PYSCRIPT
cd "$checkout/apps/server"
exec setpriv --reuid=ubuntu --regid=ubuntu --init-groups env HOME=/home/ubuntu CAPTURE_RUN="$run" T3CODE_DEV_SEED=0 T3CODE_RESOURCE_MONITOR_PATH="$(cat "$run/native-path")" T3CODE_DEV_AUTH_TOKEN="$CAPTURE_TOKEN" T3CODE_LOG_LEVEL=Debug T3CODE_TRACE_FILE="$run/trace.jsonl" T3CODE_HOME="$run/home" "$runtime" --import /tmp/lead-24640-r1/capture-r13/preload.mjs src/bin.ts --port "$port" --host 127.0.0.1 --base-dir "$run/home" --dev-url "http://127.0.0.1:$port" --no-browser


--- ps-shim.py SHA256 2adfa9f0fbe37ad192240fdb144c7fc9b1cf45acb6345174f812d650c33852ac ---
#!/usr/bin/python3
import os,sys,json,time,signal,subprocess
from pathlib import Path
root=Path(os.environ['CAPTURE_RUN'])
control=json.loads((root/'control.json').read_text())
qid=str(os.getpid()); begin=time.monotonic_ns()
def log(kind,**kw):
 with (root/'shim.jsonl').open('a') as f: f.write(json.dumps(dict(kind=kind,pid=os.getpid(),ppid=os.getppid(),utc=time.strftime('%Y-%m-%dT%H:%M:%S',time.gmtime()),mono_ns=time.monotonic_ns(),wall_ns=time.time_ns(),phase=control.get('phase'),argv=sys.argv,**kw))+'\n')
def stop(sig,frame):
 log('signal',signal=sig,elapsed_ms=(time.monotonic_ns()-begin)/1e6)
 sys.exit(128+sig)
signal.signal(signal.SIGTERM,stop); signal.signal(signal.SIGINT,stop)
log('start',control=control)
try:
 time.sleep(control.get('delay',0)/1000)
 mode=control.get('mode','valid')
 if mode=='hang':
  while True: signal.pause()
 if mode=='fail': log('end',code=7); sys.exit(7)
 if mode=='truncate':
  sys.stdout.write('1 0 bash\n'+'9 1 node\n'*100000); sys.stdout.flush(); log('end',code=0); sys.exit(0)
 out=subprocess.run(['/tmp/lead-24640-r1/capture-r13/real-ps',*sys.argv[1:]],capture_output=True)
 sys.stdout.buffer.write(out.stdout); sys.stdout.flush();sys.stderr.buffer.write(out.stderr)
 log('end',code=out.returncode,bytes=len(out.stdout),elapsed_ms=(time.monotonic_ns()-begin)/1e6)
 sys.exit(out.returncode)
except BrokenPipeError: log('broken-pipe')


--- preload.mjs SHA256 e9de91d77987401e4d4b3d931c77a5085e57e1ad7c431df6cad148a9a1440582 ---
import fs from 'node:fs';
import cp from 'node:child_process';
import {syncBuiltinESMExports} from 'node:module';
const original=cp.spawn;let sequence=0;
if(process.env.CAPTURE_RUN&&process.argv[1]?.endsWith('src/bin.ts')){
 cp.spawn=function(command,args,options){
  if(['/bin/ps','/usr/bin/ps','ps'].includes(String(command))&&JSON.stringify(args)===JSON.stringify(['-eo','pid=,ppid=,comm='])){
   const root=process.env.CAPTURE_RUN;
   const control=JSON.parse(fs.readFileSync(root+'/control.json','utf8'));
   if(control.mode==='spawnfail'){
    fs.appendFileSync(root+'/interception.jsonl',JSON.stringify({kind:'spawn-redirect',utc:new Date().toISOString(),mono_ns:process.hrtime.bigint().toString(),command,args,replacement:root+'/deliberately-nonexistent-ps',phase:control.phase})+'\n');
    command=root+'/deliberately-nonexistent-ps';
    const id='spawn-failure-'+(++sequence);const child=original.call(this,command,args,options);
    fs.appendFileSync(root+'/interception.jsonl',JSON.stringify({kind:'spawn-failure-start',pid:id,utc:new Date().toISOString(),mono_ns:process.hrtime.bigint().toString(),phase:control.phase})+'\n');
    child.once('error',error=>fs.appendFileSync(root+'/interception.jsonl',JSON.stringify({kind:'spawn-failure-end',pid:id,utc:new Date().toISOString(),mono_ns:process.hrtime.bigint().toString(),phase:control.phase,code:error.code,message:error.message})+'\n'));
    return child;
   }
  }
  return original.call(this,command,args,options);
 };
 syncBuiltinESMExports();
}


--- native-fail.py SHA256 842cfef1a89280513c751b8b66e4e66fcd845a6a2bcdd952e6165193e0b4ab41 ---
#!/usr/bin/python3
import os,time,json
with open(os.environ['CAPTURE_RUN']+'/native.jsonl','a') as f: f.write(json.dumps({'kind':'native-fail','pid':os.getpid(),'mono_ns':time.monotonic_ns()})+'\n')
if os.path.exists(os.environ['CAPTURE_RUN']+'/native-recover'):
 os.execv('/tmp/lead-24640-r1/capture-r13/native-proxy.py',['/tmp/lead-24640-r1/capture-r13/native-proxy.py'])
raise SystemExit(7)


--- native-proxy.py SHA256 cc9d81fdf02fa8e480597bb491856ebf43fbba4e3a96dc008f4e7b55ac441c08 ---
#!/usr/bin/python3
import os,sys,json,time,subprocess,threading,signal
from pathlib import Path
root=Path(os.environ['CAPTURE_RUN']); binary=(root/'native-real-path').read_text()
lock=threading.Lock()
def log(kind,**kw):
 with lock:
  with (root/'native-protocol.jsonl').open('a') as f:f.write(json.dumps(dict(kind=kind,utc=time.strftime('%Y-%m-%dT%H:%M:%S',time.gmtime()),mono_ns=time.monotonic_ns(),wall_ns=time.time_ns(),pid=os.getpid(),**kw))+'\n')
child=subprocess.Popen([binary],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=sys.stderr,bufsize=0)
log('native-spawn',childPid=child.pid,binary=binary)
def stop(sig,frame):
 log('native-signal',signal=sig);child.send_signal(sig)
 try:child.wait(timeout=2)
 except subprocess.TimeoutExpired:child.kill();child.wait()
 sys.exit(128+sig)
signal.signal(signal.SIGTERM,stop);signal.signal(signal.SIGINT,stop)
def outputs():
 for line in iter(child.stdout.readline,b''):
  try:
   event=json.loads(line)
   if event.get('type') in ['hello','processTable','error']:
    log('native-response',type=event.get('type'),requestId=event.get('requestId'),processCount=len(event.get('processes',[])))
  except Exception:log('native-invalid-output')
  sys.stdout.buffer.write(line);sys.stdout.buffer.flush()
thread=threading.Thread(target=outputs,daemon=True);thread.start()
for line in sys.stdin.buffer:
 try:
  command=json.loads(line)
  if command.get('type') in ['configure','processTable','shutdown']:log('native-request',type=command.get('type'),requestId=command.get('requestId'))
 except Exception:log('native-invalid-input')
 try:child.stdin.write(line);child.stdin.flush()
 except BrokenPipeError:break
child.stdin.close();child.wait();thread.join(timeout=2);log('native-exit',code=child.returncode)
