# R04: 750ms successful fallback

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-27-58.761Z-before-R04`. After run: `/tmp/lead-24640-r1/capture/2026-10-27T14-27-58.779Z-after-R04`.

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.

Both accept the table. The changed duration floor increases the first idle gap from about 2s to about 4× acquisition duration (roughly 3.2s including wrapper/spawn overhead).

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 | R04, background; shim START 2026-10-27T14:28:08.892Z (mono 921878014509055); END 2026-10-27T14:28:09.664Z (mono 921878786550822); 772.0ms, exit 0; acquisition 2026-10-27T14:28:08.854Z→2026-10-27T14:28:09.671Z, 817.4ms | R04, background; shim START 2026-10-27T14:28:08.747Z (mono 921877870202978); END 2026-10-27T14:28:09.513Z (mono 921878635655384); 765.5ms, exit 0; acquisition 2026-10-27T14:28:08.706Z→2026-10-27T14:28:09.522Z, 815.8ms | ~2s idle → ~3.2s duration floor |
| Fallback query 2 | R04, background; shim START 2026-10-27T14:28:11.716Z (mono 921880838336854); END 2026-10-27T14:28:12.481Z (mono 921881603973977); 765.6ms, exit 0; acquisition 2026-10-27T14:28:11.676Z→2026-10-27T14:28:12.488Z, 812.4ms | R04, background; shim START 2026-10-27T14:28:12.829Z (mono 921881951762610); END 2026-10-27T14:28:13.594Z (mono 921882716425395); 764.7ms, exit 0; acquisition 2026-10-27T14:28:12.788Z→2026-10-27T14:28:13.601Z, 813.4ms | Measured duration/result above |
| Background completion→next-query gaps | R04→R04: shim gap 2.052s, acquisition gap 2.005s | R04→R04: shim gap 3.316s, acquisition gap 3.266s | ~2s idle → ~3.2s duration floor |
| Terminal event 1 | 2026-10-27T14:28:09.676Z `fixture-thread-a/term-0` activity, seq=5, busy=True, label=`fixture-child` | 2026-10-27T14:28:09.526Z `fixture-thread-a/term-0` activity, seq=6, busy=True, label=`fixture-child` | Compare identity/sequence; subscriptions deduplicated |
| Terminal event 2 | 2026-10-27T14:28:12.748Z `fixture-thread-a/term-0` closed, seq=6 | 2026-10-27T14:28:13.870Z `fixture-thread-a/term-0` closed, seq=7 | 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 |

## Before scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:27:59.017Z",
    "mono_ns": "921868140503408",
    "ms": 253.856284,
    "phase": "R04",
    "mode": "valid",
    "delay": 750
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:28:07.476Z",
    "mono_ns": "921876598285365",
    "ms": 8711.639624
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:28:07.738Z",
    "mono_ns": "921876860481804",
    "ms": 8973.838387
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:28:08.161Z",
    "mono_ns": "921877284194505",
    "ms": 9397.545507,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3413114,
    "marker": "READY_R04_0"
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:28:12.739Z",
    "mono_ns": "921881862138924",
    "ms": 13975.489425
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:28:12.866Z",
    "mono_ns": "921881988872576",
    "ms": 14102.226183,
    "pids": [
      3410902,
      3410907,
      3413107,
      3413114
    ],
    "ptyPids": [
      3413107,
      3413114
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:28:14.982Z",
    "mono_ns": "921884104553309",
    "ms": 16217.905825,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:28:12.739Z",
    "mono_ns": "921881862003289",
    "ms": 13975.357187,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-27-58.761Z-before-R04",
        "worktreePath": null,
        "status": "running",
        "pid": 3413107,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:28:09.674Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:28:12.849Z",
    "mono_ns": "921881971335186",
    "ms": 14084.68705,
    "terminals": []
  }
]
```

## After scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:27:58.986Z",
    "mono_ns": "921868109431881",
    "ms": 203.847902,
    "phase": "R04",
    "mode": "valid",
    "delay": 750
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:28:07.390Z",
    "mono_ns": "921876512272963",
    "ms": 8606.69226
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:28:07.684Z",
    "mono_ns": "921876806929555",
    "ms": 8901.349463
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:28:08.110Z",
    "mono_ns": "921877232369695",
    "ms": 9326.785867,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3413092,
    "marker": "READY_R04_0"
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:28:13.863Z",
    "mono_ns": "921882985216605",
    "ms": 15079.630813
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:28:13.989Z",
    "mono_ns": "921883111488030",
    "ms": 15205.907087,
    "pids": [
      3410881,
      3410885,
      3413084,
      3413092
    ],
    "ptyPids": [
      3413084,
      3413092
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:28:16.098Z",
    "mono_ns": "921885220889465",
    "ms": 17315.305947,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:28:13.862Z",
    "mono_ns": "921882985071994",
    "ms": 15079.489017,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-27-58.779Z-after-R04",
        "worktreePath": null,
        "status": "running",
        "pid": 3413084,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:28:09.524Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:28:13.971Z",
    "mono_ns": "921883093994644",
    "ms": 15188.412139,
    "terminals": []
  }
]
```

## Behaviour difference
~2s idle → ~3.2s duration floor
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.