# R01: Real native sidecar, busy then idle

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-23-22.030Z-before-R01`. After run: `/tmp/lead-24640-r1/capture/2026-10-27T14-23-20.886Z-after-R01`.

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 use the real compiled native sidecar through a transparent logging proxy. Busy/idle publications and unchanged-label window are recorded; fallback count is zero.

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)) | Δ |
|---|---|---|---|
| Background completion→next-query gaps | No subsequent background pair | No subsequent background pair | Same native busy→idle; no fallback |
| Terminal event 1 | 2026-10-27T14:23:29.084Z `fixture-thread-a/term-0` activity, seq=6, busy=True, label=`fixture-child` | 2026-10-27T14:23:27.599Z `fixture-thread-a/term-0` activity, seq=6, busy=True, label=`fixture-child` | Compare identity/sequence; subscriptions deduplicated |
| Terminal event 2 | 2026-10-27T14:23:32.143Z `fixture-thread-a/term-0` activity, seq=9, busy=False, label=`Terminal 0` | 2026-10-27T14:23:30.661Z `fixture-thread-a/term-0` activity, seq=9, busy=False, label=`Terminal 0` | Compare identity/sequence; subscriptions deduplicated |
| Terminal event 3 | 2026-10-27T14:23:32.260Z `fixture-thread-a/term-0` closed, seq=10 | 2026-10-27T14:23:30.774Z `fixture-thread-a/term-0` closed, seq=10 | Compare identity/sequence; subscriptions deduplicated |
| Peak all fallback queries | 0 | 0 | Independent closeIdle may overlap one background query |
| Peak background fallback queries | 0 | 0 | Independent closeIdle may overlap one background query |
| Native process-table request 1 | 2026-10-27T14:23:29 monotonic=921598166886710 request=b42a77eb-1334-4115-9de3-0e8d9bcde2b1 | 2026-10-27T14:23:27 monotonic=921596688876113 request=d9544143-9a21-403d-b801-657db540c5d8 | Real native payload forwarded unchanged |
| Native process-table request 2 | 2026-10-27T14:23:30 monotonic=921599208165269 request=6899dee9-38d2-4673-88cd-25d530849dbb | 2026-10-27T14:23:28 monotonic=921597722933761 request=8560b5be-1a1d-4b10-8a06-1aa06a3de158 | Real native payload forwarded unchanged |
| Native process-table request 3 | 2026-10-27T14:23:31 monotonic=921600228256450 request=0ee689e6-925a-40d1-87f4-81c14ccd34c4 | 2026-10-27T14:23:29 monotonic=921598745012476 request=e0f6b476-3858-4a8d-a40c-96d2e42e46ef | Real native payload forwarded unchanged |
| Native process-table request 4 | 2026-10-27T14:23:32 monotonic=921601246860320 request=ca14925c-459b-42b9-836e-06686a86d8ac | 2026-10-27T14:23:30 monotonic=921599764632868 request=e4cf19e3-d6fd-4048-9ce1-8ea1879ff8d7 | Real native payload forwarded unchanged |

## Before scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:23:22.221Z",
    "ms": 187.825125,
    "phase": "R01",
    "mode": "valid",
    "delay": 0
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:23:28.599Z",
    "ms": 6565.847583
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:23:28.711Z",
    "ms": 6677.727941
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:23:28.879Z",
    "ms": 6846.112286,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3395763,
    "marker": "READY_R01_0"
  },
  {
    "kind": "unchanged-label-window",
    "utc": "2026-10-27T14:23:31.221Z",
    "ms": 9187.831869,
    "queryCount": 3
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:23:32.254Z",
    "ms": 10221.103871
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:23:32.377Z",
    "ms": 10344.466214,
    "pids": [
      3394771,
      3394772,
      3395496,
      3395497,
      3395761
    ],
    "ptyPids": [
      3395761,
      3395763
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:23:34.493Z",
    "ms": 12460.021802,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:31.220Z",
    "ms": 9187.472615,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-23-22.030Z-before-R01",
        "worktreePath": null,
        "status": "running",
        "pid": 3395761,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:23:29.083Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:32.254Z",
    "ms": 10221.004656,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-23-22.030Z-before-R01",
        "worktreePath": null,
        "status": "running",
        "pid": 3395761,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": false,
        "label": "Terminal 0",
        "updatedAt": "2026-10-27T14:23:32.141Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:32.361Z",
    "ms": 10328.51748,
    "terminals": []
  }
]
```

## After scripted milestones and final observation states
```json
[
  {
    "kind": "control",
    "utc": "2026-10-27T14:23:21.059Z",
    "ms": 170.137815,
    "phase": "R01",
    "mode": "valid",
    "delay": 0
  },
  {
    "kind": "server-ready",
    "utc": "2026-10-27T14:23:27.305Z",
    "ms": 6416.786076
  },
  {
    "kind": "rpc-connected",
    "utc": "2026-10-27T14:23:27.398Z",
    "ms": 6509.417004
  },
  {
    "kind": "child-ready",
    "utc": "2026-10-27T14:23:27.545Z",
    "ms": 6656.944774,
    "threadId": "fixture-thread-a",
    "terminalId": "term-0",
    "childPid": 3395485,
    "marker": "READY_R01_0"
  },
  {
    "kind": "unchanged-label-window",
    "utc": "2026-10-27T14:23:29.733Z",
    "ms": 8844.791325,
    "queryCount": 3
  },
  {
    "kind": "scenario-complete",
    "utc": "2026-10-27T14:23:30.766Z",
    "ms": 9877.773537
  },
  {
    "kind": "cleanup-start",
    "utc": "2026-10-27T14:23:30.892Z",
    "ms": 10003.808787,
    "pids": [
      3394727,
      3394728,
      3395015,
      3395016,
      3395483
    ],
    "ptyPids": [
      3395483,
      3395485
    ]
  },
  {
    "kind": "cleanup-end",
    "utc": "2026-10-27T14:23:33.015Z",
    "ms": 12126.363279,
    "survivorsBeforeFinalKill": [],
    "remaining": []
  }
]
```
Metadata snapshots taken before and after driver cleanup:
```json
[
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:29.733Z",
    "ms": 8844.640322,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-23-20.886Z-after-R01",
        "worktreePath": null,
        "status": "running",
        "pid": 3395483,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": true,
        "label": "fixture-child",
        "updatedAt": "2026-10-27T14:23:27.597Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:30.766Z",
    "ms": 9877.65221,
    "terminals": [
      {
        "threadId": "fixture-thread-a",
        "terminalId": "term-0",
        "cwd": "/tmp/lead-24640-r1/capture/2026-10-27T14-23-20.886Z-after-R01",
        "worktreePath": null,
        "status": "running",
        "pid": 3395483,
        "exitCode": null,
        "exitSignal": null,
        "hasRunningSubprocess": false,
        "label": "Terminal 0",
        "updatedAt": "2026-10-27T14:23:30.659Z"
      }
    ]
  },
  {
    "kind": "state",
    "utc": "2026-10-27T14:23:30.874Z",
    "ms": 9985.464795,
    "terminals": []
  }
]
```

## Behaviour difference
Same native busy→idle; no fallback
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.