# R09: Immediate failures through cap; real native recovery and reset

Before [e9236274a3](https://git.cafe/pingdotgg/t3code/commit/e9236274a3a6e0c731a7df4092db1e686f039068); after [63e44670dd](https://git.cafe/pingdotgg/t3code/commit/63e44670dd1d222cf63619d5e02415f2a9fd3bc2).

Before run: `/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-before-R09`. After run: `/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-after-R09`.

Environment: fs-31 Linux x86_64, Node v26.12.1; no viewport/theme/DPR/font scaling. Fresh per-run app databases. Same RPC fixture on each side. Native sidecars compiled with isolated Rust 1.99.1 where used.

The nonzero phase reaches repeated 60s gaps. Native recovery uses the checkout-built real sidecar and server.retryResourceTelemetry, then the proxy is deliberately stopped by its recorded PID. The next failed fallback uses the reset 2s gap.

Wrapper timings exclude Python startup and stream drain. Acquisition timings use the real terminal.posixProcessTableSnapshot trace span. An idle gap is END→next START, never start-to-start. Before delay=min(1000×2^failureCount,60000)ms; after delay=min(max(1000×2^failureCount,4×measured fallback acquisition),60000)ms. Native-failed production ticks increment failureCount even when fallback succeeds; successful absent-supplier harness ticks reset it. Native requests and terminal processing can add overhead.

| Event | Before ([e9236274a3](https://git.cafe/pingdotgg/t3code/commit/e9236274a3a6e0c731a7df4092db1e686f039068)) | After ([63e44670dd](https://git.cafe/pingdotgg/t3code/commit/63e44670dd1d222cf63619d5e02415f2a9fd3bc2)) | Δ |
|---|---|---|---|
| Fallback query 1 | R09-seed, background; shim START 2026-10-27T14:33:08.057Z (mono 922177179902584); END 2026-10-27T14:33:08.069Z (mono 922177191578497); 11.7ms, exit 0; acquisition 2026-10-27T14:33:08.013Z→2026-10-27T14:33:08.076Z, 63.2ms | R09-seed, background; shim START 2026-10-27T14:33:08.012Z (mono 922177134268768); END 2026-10-27T14:33:08.026Z (mono 922177148868596); 14.6ms, exit 0; acquisition 2026-10-27T14:33:07.969Z→2026-10-27T14:33:08.034Z, 65.1ms | Same cap and native reset; failure state retained |
| Fallback query 2 | R09-failure, background; shim START 2026-10-27T14:33:10.119Z (mono 922179241219505); END 2026-10-27T14:33:10.119Z (mono 922179241432085); 0.2ms, exit 7; acquisition 2026-10-27T14:33:10.080Z→2026-10-27T14:33:10.125Z, 45.6ms | R09-failure, background; shim START 2026-10-27T14:33:10.080Z (mono 922179202319462); END 2026-10-27T14:33:10.080Z (mono 922179202508126); 0.2ms, exit 7; acquisition 2026-10-27T14:33:10.038Z→2026-10-27T14:33:10.086Z, 48.6ms | Measured duration/result above |
| Fallback query 3 | R09-failure, background; shim START 2026-10-27T14:33:14.169Z (mono 922183291966205); END 2026-10-27T14:33:14.170Z (mono 922183292185897); 0.2ms, exit 7; acquisition 2026-10-27T14:33:14.128Z→2026-10-27T14:33:14.175Z, 47.7ms | R09-failure, background; shim START 2026-10-27T14:33:14.133Z (mono 922183255466354); END 2026-10-27T14:33:14.133Z (mono 922183255663614); 0.2ms, exit 7; acquisition 2026-10-27T14:33:14.089Z→2026-10-27T14:33:14.139Z, 50.2ms | Measured duration/result above |
| Fallback query 4 | R09-failure, background; shim START 2026-10-27T14:33:22.240Z (mono 922191362369812); END 2026-10-27T14:33:22.240Z (mono 922191362552775); 0.2ms, exit 7; acquisition 2026-10-27T14:33:22.177Z→2026-10-27T14:33:22.246Z, 68.8ms | R09-failure, background; shim START 2026-10-27T14:33:22.192Z (mono 922191314965886); END 2026-10-27T14:33:22.195Z (mono 922191317621297); 2.7ms, exit 7; acquisition 2026-10-27T14:33:22.141Z→2026-10-27T14:33:22.208Z, 66.6ms | Measured duration/result above |
| Fallback query 5 | R09-failure, background; shim START 2026-10-27T14:33:38.302Z (mono 922207424609118); END 2026-10-27T14:33:38.302Z (mono 922207424794306); 0.2ms, exit 7; acquisition 2026-10-27T14:33:38.256Z→2026-10-27T14:33:38.308Z, 52.3ms | R09-failure, background; shim START 2026-10-27T14:33:38.263Z (mono 922207385532975); END 2026-10-27T14:33:38.263Z (mono 922207385746906); 0.2ms, exit 7; acquisition 2026-10-27T14:33:38.210Z→2026-10-27T14:33:38.270Z, 60.8ms | Measured duration/result above |
| Fallback query 6 | R09-failure, background; shim START 2026-10-27T14:34:10.366Z (mono 922239488775233); END 2026-10-27T14:34:10.366Z (mono 922239488956763); 0.2ms, exit 7; acquisition 2026-10-27T14:34:10.313Z→2026-10-27T14:34:10.373Z, 60.3ms | R09-failure, background; shim START 2026-10-27T14:34:10.343Z (mono 922239465491284); END 2026-10-27T14:34:10.343Z (mono 922239465680259); 0.2ms, exit 7; acquisition 2026-10-27T14:34:10.273Z→2026-10-27T14:34:10.350Z, 76.8ms | Measured duration/result above |
| Fallback query 7 | R09-failure, background; shim START 2026-10-27T14:35:10.424Z (mono 922299546825180); END 2026-10-27T14:35:10.424Z (mono 922299547012401); 0.2ms, exit 7; acquisition 2026-10-27T14:35:10.374Z→2026-10-27T14:35:10.430Z, 56.5ms | R09-failure, background; shim START 2026-10-27T14:35:10.407Z (mono 922299529502724); END 2026-10-27T14:35:10.407Z (mono 922299529733928); 0.2ms, exit 7; acquisition 2026-10-27T14:35:10.353Z→2026-10-27T14:35:10.415Z, 62.1ms | Measured duration/result above |
| Fallback query 8 | R09-failure, background; shim START 2026-10-27T14:36:10.478Z (mono 922359600368941); END 2026-10-27T14:36:10.478Z (mono 922359600556373); 0.2ms, exit 7; acquisition 2026-10-27T14:36:10.432Z→2026-10-27T14:36:10.484Z, 51.9ms | R09-failure, background; shim START 2026-10-27T14:36:10.469Z (mono 922359591269481); END 2026-10-27T14:36:10.469Z (mono 922359591454840); 0.2ms, exit 7; acquisition 2026-10-27T14:36:10.418Z→2026-10-27T14:36:10.476Z, 58.3ms | Measured duration/result above |
| Fallback query 9 | R09-failure, background; shim START 2026-10-27T14:37:10.540Z (mono 922419662684561); END 2026-10-27T14:37:10.540Z (mono 922419662895607); 0.2ms, exit 7; acquisition 2026-10-27T14:37:10.487Z→2026-10-27T14:37:10.547Z, 60.3ms | R09-failure, background; shim START 2026-10-27T14:37:10.535Z (mono 922419657529070); END 2026-10-27T14:37:10.535Z (mono 922419657750305); 0.2ms, exit 7; acquisition 2026-10-27T14:37:10.479Z→2026-10-27T14:37:10.542Z, 63.0ms | Measured duration/result above |
| Fallback query 10 | R09-failure-after-reset, background; shim START 2026-10-27T14:38:12.668Z (mono 922481790904321); END 2026-10-27T14:38:12.669Z (mono 922481791078980); 0.2ms, exit 7; acquisition 2026-10-27T14:38:12.605Z→2026-10-27T14:38:12.679Z, 73.8ms | R09-failure-after-reset, background; shim START 2026-10-27T14:38:12.668Z (mono 922481790833850); END 2026-10-27T14:38:12.669Z (mono 922481791030449); 0.2ms, exit 7; acquisition 2026-10-27T14:38:12.618Z→2026-10-27T14:38:12.675Z, 57.8ms | Measured duration/result above |
| Fallback query 11 | R09-failure-after-reset, background; shim START 2026-10-27T14:38:14.720Z (mono 922483842816231); END 2026-10-27T14:38:14.721Z (mono 922483843005936); 0.2ms, exit 7; acquisition 2026-10-27T14:38:14.680Z→2026-10-27T14:38:14.729Z, 48.9ms | R09-failure-after-reset, background; shim START 2026-10-27T14:38:14.732Z (mono 922483854681348); END 2026-10-27T14:38:14.733Z (mono 922483854884039); 0.2ms, exit 7; acquisition 2026-10-27T14:38:14.678Z→2026-10-27T14:38:14.740Z, 62.0ms | Measured duration/result above |
| Background completion→next-query gaps | R09-seed→R09-failure: shim gap 2.050s, acquisition gap 2.004s<br>R09-failure→R09-failure: shim gap 4.051s, acquisition gap 4.002s<br>R09-failure→R09-failure: shim gap 8.070s, acquisition gap 8.002s<br>R09-failure→R09-failure: shim gap 16.062s, acquisition gap 16.010s<br>R09-failure→R09-failure: shim gap 32.064s, acquisition gap 32.004s<br>R09-failure→R09-failure: shim gap 60.058s, acquisition gap 60.001s<br>R09-failure→R09-failure: shim gap 60.053s, acquisition gap 60.002s<br>R09-failure→R09-failure: shim gap 60.062s, acquisition gap 60.003s<br>R09-failure→R09-failure-after-reset: shim gap 62.128s, acquisition gap 62.058s (intervening native recovery; not a fallback retry interval)<br>R09-failure-after-reset→R09-failure-after-reset: shim gap 2.052s, acquisition gap 2.001s | R09-seed→R09-failure: shim gap 2.053s, acquisition gap 2.003s<br>R09-failure→R09-failure: shim gap 4.053s, acquisition gap 4.003s<br>R09-failure→R09-failure: shim gap 8.059s, acquisition gap 8.002s<br>R09-failure→R09-failure: shim gap 16.068s, acquisition gap 16.002s<br>R09-failure→R09-failure: shim gap 32.080s, acquisition gap 32.003s<br>R09-failure→R09-failure: shim gap 60.064s, acquisition gap 60.002s<br>R09-failure→R09-failure: shim gap 60.062s, acquisition gap 60.003s<br>R09-failure→R09-failure: shim gap 60.066s, acquisition gap 60.003s<br>R09-failure→R09-failure-after-reset: shim gap 62.133s, acquisition gap 62.076s (intervening native recovery; not a fallback retry interval)<br>R09-failure-after-reset→R09-failure-after-reset: shim gap 2.064s, acquisition gap 2.002s | Same cap and native reset; failure state retained |
| Terminal event 1 | 2026-10-27T14:33:08.080Z `fixture-thread-a/term-0` activity, seq=8, busy=True, label=`fixture-child` | 2026-10-27T14:33:08.038Z `fixture-thread-a/term-0` activity, seq=4, busy=True, label=`fixture-child` | Compare identity/sequence; subscriptions deduplicated |
| Terminal event 2 | 2026-10-27T14:38:14.994Z `fixture-thread-a/term-0` closed, seq=9 | 2026-10-27T14:38:14.997Z `fixture-thread-a/term-0` closed, seq=5 | Compare identity/sequence; subscriptions deduplicated |
| Peak all fallback queries | 1 | 1 | Independent closeIdle may overlap one background query |
| Peak background fallback queries | 1 | 1 | Independent closeIdle may overlap one background query |
| Native process-table request 1 | 2026-10-27T14:38:10 monotonic=922479673501988 request=bdb45a34-7bc7-4a5e-ab0a-36039b13fa19 | 2026-10-27T14:38:10 monotonic=922479670467406 request=bcc5cf27-4d66-4667-ad8b-ecdc1698f69b | Real native payload forwarded unchanged |
| Native process-table request 2 | 2026-10-27T14:38:11 monotonic=922480707004905 request=693b26b6-045d-4de2-b4d5-4e85dc6cf208 | 2026-10-27T14:38:11 monotonic=922480716160821 request=f7529e7c-164a-4fa3-87b2-39c1fccb23bc | Real native payload forwarded unchanged |

## Before scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:00.131Z",
    "mono_ns": "922169253902897",
    "ms": 224.149767,
    "phase": "R09",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:33:07.118Z",
    "mono_ns": "922176240306929",
    "ms": 7210.557386
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:33:07.357Z",
    "mono_ns": "922176479565008",
    "ms": 7449.812388
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:07.502Z",
    "mono_ns": "922176624536402",
    "ms": 7594.778443,
    "phase": "R09-seed",
    "mode": "valid",
    "delay": 0
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:33:07.601Z",
    "mono_ns": "922176723381136",
    "ms": 7693.623197,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3420203,
    "marker": "READY_R09_0"
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:08.190Z",
    "mono_ns": "922177312470169",
    "ms": 8282.712261,
    "phase": "R09-failure",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "native-retry",
    "utc": "2026-10-27T14:37:10.801Z",
    "mono_ns": "922419924099875",
    "ms": 250894.341796
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:38:11.696Z",
    "mono_ns": "922480818365709",
    "ms": 311788.608441,
    "phase": "R09-failure-after-reset",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "native-stopped",
    "utc": "2026-10-27T14:38:11.719Z",
    "mono_ns": "922480841624670",
    "ms": 311811.869777,
    "pid": 3423352
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:38:14.978Z",
    "mono_ns": "922484100137705",
    "ms": 315070.379635
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:38:15.114Z",
    "mono_ns": "922484236300154",
    "ms": 315206.545461,
    "pids": [
      3419277,
      3419281,
      3420200,
      3420203
    ],
    "ptyPids": [
      3420200,
      3420203
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:38:17.223Z",
    "mono_ns": "922486345803540",
    "ms": 317316.052033,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:33:08.189Z",
    "mono_ns": "922177312170878",
    "ms": 8282.414081,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-before-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420200,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.078Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:37:10.801Z",
    "mono_ns": "922419923800193",
    "ms": 250894.044778,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-before-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420200,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.078Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:11.695Z",
    "mono_ns": "922480817669412",
    "ms": 311787.914158,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-before-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420200,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.078Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:14.978Z",
    "mono_ns": "922484099933892",
    "ms": 315070.178257,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-before-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420200,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.078Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:15.095Z",
    "mono_ns": "922484217891291",
    "ms": 315188.135065,
    "terminals": []
  }
]
```

## After scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:00.137Z",
    "mono_ns": "922169259952806",
    "ms": 230.295204,
    "phase": "R09",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:33:06.822Z",
    "mono_ns": "922175944474542",
    "ms": 6914.823903
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:33:07.123Z",
    "mono_ns": "922176245375327",
    "ms": 7215.719228
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:07.378Z",
    "mono_ns": "922176500721055",
    "ms": 7471.059666,
    "phase": "R09-seed",
    "mode": "valid",
    "delay": 0
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:33:07.481Z",
    "mono_ns": "922176603287330",
    "ms": 7573.626373,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3420191,
    "marker": "READY_R09_0"
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:33:08.147Z",
    "mono_ns": "922177269955436",
    "ms": 8240.294207,
    "phase": "R09-failure",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "native-retry",
    "utc": "2026-10-27T14:37:10.801Z",
    "mono_ns": "922419924099825",
    "ms": 250894.438186
  },
  {
    "kind": "control",
    "utc": "2026-10-27T14:38:11.697Z",
    "mono_ns": "922480819214291",
    "ms": 311789.553623,
    "phase": "R09-failure-after-reset",
    "mode": "fail",
    "delay": 0
  },
  {
    "kind": "native-stopped",
    "utc": "2026-10-27T14:38:11.716Z",
    "mono_ns": "922480838885583",
    "ms": 311809.22766,
    "pid": 3423353
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:38:14.986Z",
    "mono_ns": "922484108462221",
    "ms": 315078.800511
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:38:15.114Z",
    "mono_ns": "922484236207019",
    "ms": 315206.548466,
    "pids": [
      3419280,
      3419284,
      3420189,
      3420191
    ],
    "ptyPids": [
      3420189,
      3420191
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:38:17.213Z",
    "mono_ns": "922486335691320",
    "ms": 317306.041313,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:33:08.147Z",
    "mono_ns": "922177269646315",
    "ms": 8239.987602,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-after-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420189,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.036Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:37:10.801Z",
    "mono_ns": "922419923800233",
    "ms": 250894.141088,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-after-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420189,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.036Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:11.696Z",
    "mono_ns": "922480818743357",
    "ms": 311789.089633,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-after-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420189,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.036Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:14.986Z",
    "mono_ns": "922484108368324",
    "ms": 315078.708629,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-32-59.904Z-after-R09",
        "worktreePath": null,
        "status": "running",
        "pid": 3420189,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:33:08.036Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:38:15.098Z",
    "mono_ns": "922484220359471",
    "ms": 315190.699655,
    "terminals": []
  }
]
```

## Behaviour difference
Same cap and native reset; failure state retained
Raw UTC/monotonic RPC, query, signal, metadata, warnings, and cleanup records are in the paired transcripts. PID, randomly generated script terminal suffix, database path, UTC, sequence batching, and scheduler jitter naturally vary between fresh runs. No visual comparison is applicable.