# B3 before runtime recording

Revision: [53bcb9af7a](https://git.cafe/pingdotgg/t3code/commit/53bcb9af7a37dd0b4df11a7d6fa0106e9e5b7356)

Environment: Linux-6.1.102-x86_64-with-glibc2.39, Node v26.13.0. Production-runtime harness, synthetic config and stub connector. Real CloudManagedEndpointRuntime and Node spawner (passive exit-result observer). Not a real Cloudflare tunnel.

A/B: NodeRuntime.runMain, group signal. C2/C3: Effect.runPromise host intentionally survives parent-only OS signals, explicit runtime scope closure.

Stub registration is an age-based model only: <2000ms stop takes 2300ms, otherwise 15ms. “past-registering-window” is synthetic, never Cloudflare readiness. Runner gates use events, not guessed readiness sleeps. The predecessor/backoff/stub timers are deliberate fixture behavior.

AI-assisted; verified with the tests and tools listed above.

## Measured result

```json
{
  "row": "B3",
  "side": "before",
  "sha": "53bcb9af7a37dd0b4df11a7d6fa0106e9e5b7356",
  "stopMs": 3955,
  "failure": null,
  "output": "/tmp/lead-33628-r1/capture-1/B3-before-20261110T013018.577774Z",
  "scriptSha256": {
    "driver.ts": "ec3fc57d6aae729c9d28d06370977a052e66acf71e633e9786dd552b091ee423",
    "cloudflared-stub.sh": "d6bece305c6bdc22b6b9511fc2e5210801777f54445f659e9d242f1732ad5f99",
    "cloudflared-stub.mjs": "4f0cb55a5a434d6a0c2148455c58683eba0f8d81993785ff34ffca3503e780df",
    "runner.py": "88a0c74d1385c4454291076b74a7c8a8ba4ab4a7ec06e337be788f5d23c5c402",
    "run.sh": "dc4d7379c91708d38ae3a6d3db279e254b71ad67901cd3e703addc66248fd879"
  },
  "recoveryRequests": [
    {
      "timestamp": "2026-11-10T01:30:20.149Z",
      "source": "driver",
      "event": "recovery-request",
      "phase": "ordinary",
      "count": 1,
      "config": {
        "providerKind": "cloudflare_tunnel",
        "connectorToken": "synthetic-token",
        "tunnelId": "tunnel-1"
      }
    },
    {
      "timestamp": "2026-11-10T01:30:21.204Z",
      "source": "driver",
      "event": "recovery-request",
      "phase": "ordinary",
      "count": 2,
      "config": {
        "providerKind": "cloudflare_tunnel",
        "connectorToken": "synthetic-token",
        "tunnelId": "tunnel-1"
      }
    }
  ],
  "listeners": [
    {
      "timestamp": "2026-11-10T01:30:20.022Z",
      "source": "driver",
      "event": "listeners",
      "phase": "before-build",
      "identities": {
        "SIGINT": [
          1
        ],
        "SIGTERM": [
          2
        ]
      },
      "counts": {
        "SIGINT": 1,
        "SIGTERM": 1
      },
      "baselineRestored": true
    },
    {
      "timestamp": "2026-11-10T01:30:20.070Z",
      "source": "driver",
      "event": "listeners",
      "phase": "ordinary:after-build",
      "identities": {
        "SIGINT": [
          1,
          3
        ],
        "SIGTERM": [
          2,
          3
        ]
      },
      "counts": {
        "SIGINT": 2,
        "SIGTERM": 2
      },
      "baselineRestored": false
    }
  ],
  "scopeStops": [],
  "relayCounts": {
    "Relay client process started; waiting for tunnel connection": 3,
    "Relay client exited; restarting": 2,
    "Relay client stopped": 3,
    "Relay client is crash-looping; delaying restart": 1
  },
  "exitResults": [
    {
      "timestamp": "2026-11-10T01:30:20.135Z",
      "source": "driver",
      "event": "child-exit-observed",
      "pid": 1534405,
      "exitCode": 1
    },
    {
      "timestamp": "2026-11-10T01:30:20.192Z",
      "source": "driver",
      "event": "child-exit-observed",
      "pid": 1534412,
      "exitCode": 1
    }
  ]
}
```

## Runner milestones

```text
{"timestamp": "2026-11-10T01:30:18.597+00:00", "source": "runner", "event": "environment", "row": "B3", "side": "before", "sha": "53bcb9af7a37dd0b4df11a7d6fa0106e9e5b7356", "os": "Linux-6.1.102-x86_64-with-glibc2.39", "node": "v26.13.0", "harness": "real CloudManagedEndpointRuntime + real Node spawner with passive exit observer + stub cloudflared; not a real Cloudflare tunnel", "attribution": "AI-assisted; verified with the tests and tools listed above.", "slowMs": 1600}
{"timestamp": "2026-11-10T01:30:18.598+00:00", "source": "runner", "event": "spawned-driver", "pid": 1534367, "pgid": 1534367}
{"timestamp": "2026-11-10T01:30:20.083+00:00", "source": "runner", "event": "gate-satisfied", "gate": "runtime applied; no server signal", "observed": {"timestamp": "2026-11-10T01:30:20.083Z", "source": "driver", "event": "driver-ready", "row": "B3"}}
{"timestamp": "2026-11-10T01:30:20.116+00:00", "source": "runner", "event": "gate-satisfied", "gate": "stub attempt 1 started", "observed": {"timestamp": "2026-11-10T01:30:20.115Z", "source": "stub", "event": "file-line", "line": "{\"timestamp\":\"2026-11-10T01:30:20.115Z\",\"source\":\"stub\",\"event\":\"started\",\"pid\":1534405,\"attempt\":1,\"ageMs\":1}", "record": {"timestamp": "2026-11-10T01:30:20.115Z", "source": "stub", "event": "started", "pid": 1534405, "attempt": 1, "ageMs": 1}}}
{"timestamp": "2026-11-10T01:30:20.116+00:00", "source": "runner", "event": "send-child-only-signal", "pid": 1534405, "signal": "SIGUSR1", "purpose": "controlled nonzero exit 1, no server signal"}
{"timestamp": "2026-11-10T01:30:20.149+00:00", "source": "runner", "event": "gate-satisfied", "gate": "first crash recovery establishes next backoff", "observed": {"timestamp": "2026-11-10T01:30:20.149Z", "source": "driver", "event": "recovery-request", "phase": "ordinary", "count": 1, "config": {"providerKind": "cloudflare_tunnel", "connectorToken": "synthetic-token", "tunnelId": "tunnel-1"}}}
{"timestamp": "2026-11-10T01:30:20.184+00:00", "source": "runner", "event": "gate-satisfied", "gate": "stub attempt 2 started", "observed": {"timestamp": "2026-11-10T01:30:20.184Z", "source": "stub", "event": "file-line", "line": "{\"timestamp\":\"2026-11-10T01:30:20.183Z\",\"source\":\"stub\",\"event\":\"started\",\"pid\":1534412,\"attempt\":2,\"ageMs\":1}", "record": {"timestamp": "2026-11-10T01:30:20.183Z", "source": "stub", "event": "started", "pid": 1534412, "attempt": 2, "ageMs": 1}}}
{"timestamp": "2026-11-10T01:30:20.184+00:00", "source": "runner", "event": "send-child-only-signal", "pid": 1534412, "signal": "SIGUSR1", "purpose": "controlled nonzero exit 1, no server signal"}
{"timestamp": "2026-11-10T01:30:20.193+00:00", "source": "runner", "event": "gate-satisfied", "gate": "recorded positive crash-loop backoff", "observed": {"timestamp": "2026-11-10T01:30:20.193Z", "source": "relay", "event": "file-line", "line": "{\"message\":[\"Relay client is crash-looping; delaying restart\",{\"pid\":1534412,\"uptimeMillis\":44,\"restartDelayMillis\":1000,\"tunnelId\":\"tunnel-1\"}],\"level\":\"WARN\",\"timestamp\":\"2026-11-10T01:30:20.192Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#37\"}", "record": {"message": ["Relay client is crash-looping; delaying restart", {"pid": 1534412, "uptimeMillis": 44, "restartDelayMillis": 1000, "tunnelId": "tunnel-1"}], "level": "WARN", "timestamp": "2026-11-10T01:30:20.192Z", "annotations": {}, "spans": {}, "fiberId": "#37"}}}
{"timestamp": "2026-11-10T01:30:20.193+00:00", "source": "runner", "event": "signal-during-recorded-backoff", "delayRecord": {"message": ["Relay client is crash-looping; delaying restart", {"pid": 1534412, "uptimeMillis": 44, "restartDelayMillis": 1000, "tunnelId": "tunnel-1"}], "level": "WARN", "timestamp": "2026-11-10T01:30:20.192Z", "annotations": {}, "spans": {}, "fiberId": "#37"}, "predecessorMs": 1600}
{"timestamp": "2026-11-10T01:30:20.193+00:00", "source": "runner", "event": "send-group-signal", "pid": 1534367, "pgid": 1534367, "signal": "SIGTERM"}
{"timestamp": "2026-11-10T01:30:24.149+00:00", "source": "runner", "event": "backend-stopped", "stopMs": 3955, "returncode": 130}
{"timestamp": "2026-11-10T01:30:24.158+00:00", "source": "runner", "event": "tracked-process-group-cleanup", "members": []}
```

## Driver and forwarded timestamped relay/stub events

```text
{"timestamp":"2026-11-10T01:30:20.020Z","source":"driver","event":"actual-node-version","node":"v26.13.0","executable":"/home/ubuntu/.local/share/vite-plus/js_runtime/node/26.13.0/bin/node"}
{"timestamp":"2026-11-10T01:30:20.022Z","source":"driver","event":"listeners","phase":"before-build","identities":{"SIGINT":[1],"SIGTERM":[2]},"counts":{"SIGINT":1,"SIGTERM":1},"baselineRestored":true}
{"timestamp":"2026-11-10T01:30:20.070Z","source":"driver","event":"listeners","phase":"ordinary:after-build","identities":{"SIGINT":[1,3],"SIGTERM":[2,3]},"counts":{"SIGINT":2,"SIGTERM":2},"baselineRestored":false}
{"timestamp":"2026-11-10T01:30:20.080Z","source":"driver","event":"real-child-spawned","pid":1534405}
[01:30:20.081] INFO (#1): Relay client process started; waiting for tunnel connection {
  pid: 1534405,
  source: 'path',
  version: '2026.10.4',
  protocol: 'auto',
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:20.083Z","source":"driver","event":"connector-applied","phase":"ordinary","status":{"status":"running","providerKind":"cloudflare_tunnel","pid":1534405,"tunnelId":"tunnel-1"}}
{"timestamp":"2026-11-10T01:30:20.083Z","source":"driver","event":"driver-ready","row":"B3"}
{"timestamp":"2026-11-10T01:30:20.087Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client process started; waiting for tunnel connection\",{\"pid\":1534405,\"source\":\"path\",\"version\":\"2026.10.4\",\"protocol\":\"auto\",\"tunnelId\":\"tunnel-1\"}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:20.081Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#1\"}"}
{"timestamp":"2026-11-10T01:30:20.115Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:20.115Z\",\"source\":\"stub\",\"event\":\"started\",\"pid\":1534405,\"attempt\":1,\"ageMs\":1}"}
{"timestamp":"2026-11-10T01:30:20.116Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:20.116Z\",\"source\":\"stub\",\"event\":\"controlled-crash\",\"pid\":1534405,\"attempt\":1,\"ageMs\":2,\"exitCode\":1}"}
{"timestamp":"2026-11-10T01:30:20.135Z","source":"driver","event":"child-exit-observed","pid":1534405,"exitCode":1}
[01:30:20.139] INFO (#29): Relay client stopped { pid: 1534405 }
[01:30:20.139] WARN (#29): Relay client exited; restarting {
  pid: 1534405,
  exitCode: 1,
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:20.147Z","source":"driver","event":"real-child-spawned","pid":1534412}
[01:30:20.148] INFO (#29): Relay client process started; waiting for tunnel connection {
  pid: 1534412,
  source: 'path',
  version: '2026.10.4',
  protocol: 'auto',
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:20.149Z","source":"driver","event":"recovery-request","phase":"ordinary","count":1,"config":{"providerKind":"cloudflare_tunnel","connectorToken":"synthetic-token","tunnelId":"tunnel-1"}}
{"timestamp":"2026-11-10T01:30:20.150Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client stopped\",{\"pid\":1534405}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:20.139Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#29\"}"}
{"timestamp":"2026-11-10T01:30:20.151Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client exited; restarting\",{\"pid\":1534405,\"exitCode\":1,\"tunnelId\":\"tunnel-1\"}],\"level\":\"WARN\",\"timestamp\":\"2026-11-10T01:30:20.139Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#29\"}"}
{"timestamp":"2026-11-10T01:30:20.151Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client process started; waiting for tunnel connection\",{\"pid\":1534412,\"source\":\"path\",\"version\":\"2026.10.4\",\"protocol\":\"auto\",\"tunnelId\":\"tunnel-1\"}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:20.148Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#29\"}"}
{"timestamp":"2026-11-10T01:30:20.184Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:20.183Z\",\"source\":\"stub\",\"event\":\"started\",\"pid\":1534412,\"attempt\":2,\"ageMs\":1}"}
{"timestamp":"2026-11-10T01:30:20.185Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:20.184Z\",\"source\":\"stub\",\"event\":\"controlled-crash\",\"pid\":1534412,\"attempt\":2,\"ageMs\":1,\"exitCode\":1}"}
{"timestamp":"2026-11-10T01:30:20.192Z","source":"driver","event":"child-exit-observed","pid":1534412,"exitCode":1}
[01:30:20.192] WARN (#37): Relay client is crash-looping; delaying restart {
  pid: 1534412,
  uptimeMillis: 44,
  restartDelayMillis: 1000,
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:20.193Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client is crash-looping; delaying restart\",{\"pid\":1534412,\"uptimeMillis\":44,\"restartDelayMillis\":1000,\"tunnelId\":\"tunnel-1\"}],\"level\":\"WARN\",\"timestamp\":\"2026-11-10T01:30:20.192Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#37\"}"}
{"timestamp":"2026-11-10T01:30:20.193Z","source":"driver","event":"host-signal-received","signal":"SIGTERM","signals":1}
{"timestamp":"2026-11-10T01:30:20.194Z","source":"driver","event":"shutdown-started","recoveryCount":1}
{"timestamp":"2026-11-10T01:30:20.194Z","source":"driver","event":"predecessor-finalizer-start","delayMs":1600,"recoveryCount":1}
[01:30:21.195] INFO (#37): Relay client stopped { pid: 1534412 }
[01:30:21.195] WARN (#37): Relay client exited; restarting {
  pid: 1534412,
  exitCode: 1,
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:21.202Z","source":"driver","event":"real-child-spawned","pid":1534429}
[01:30:21.202] INFO (#37): Relay client process started; waiting for tunnel connection {
  pid: 1534429,
  source: 'path',
  version: '2026.10.4',
  protocol: 'auto',
  tunnelId: 'tunnel-1',
  tunnelName: undefined
}
{"timestamp":"2026-11-10T01:30:21.203Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client stopped\",{\"pid\":1534412}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:21.195Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#37\"}"}
{"timestamp":"2026-11-10T01:30:21.203Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client exited; restarting\",{\"pid\":1534412,\"exitCode\":1,\"tunnelId\":\"tunnel-1\"}],\"level\":\"WARN\",\"timestamp\":\"2026-11-10T01:30:21.195Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#37\"}"}
{"timestamp":"2026-11-10T01:30:21.203Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client process started; waiting for tunnel connection\",{\"pid\":1534429,\"source\":\"path\",\"version\":\"2026.10.4\",\"protocol\":\"auto\",\"tunnelId\":\"tunnel-1\"}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:21.202Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#37\"}"}
{"timestamp":"2026-11-10T01:30:21.204Z","source":"driver","event":"recovery-request","phase":"ordinary","count":2,"config":{"providerKind":"cloudflare_tunnel","connectorToken":"synthetic-token","tunnelId":"tunnel-1"}}
{"timestamp":"2026-11-10T01:30:21.242Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:21.242Z\",\"source\":\"stub\",\"event\":\"started\",\"pid\":1534429,\"attempt\":3,\"ageMs\":1}"}
{"timestamp":"2026-11-10T01:30:21.795Z","source":"driver","event":"predecessor-finalizer-end-relay-next","recoveryCount":2}
{"timestamp":"2026-11-10T01:30:21.799Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:21.799Z\",\"source\":\"stub\",\"event\":\"stop-signal\",\"pid\":1534429,\"attempt\":3,\"ageMs\":558,\"signal\":\"SIGTERM\",\"delayMs\":2300,\"state\":\"registering-model\"}"}
{"timestamp":"2026-11-10T01:30:23.344Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:23.343Z\",\"source\":\"stub\",\"event\":\"past-registering-window\",\"pid\":1534429,\"attempt\":3,\"ageMs\":2102,\"syntheticOnly\":true}"}
{"timestamp":"2026-11-10T01:30:24.102Z","source":"stub","event":"file-line","line":"{\"timestamp\":\"2026-11-10T01:30:24.101Z\",\"source\":\"stub\",\"event\":\"exit\",\"pid\":1534429,\"attempt\":3,\"ageMs\":2860,\"exitCode\":0}"}
[01:30:24.108] INFO (#1): Relay client stopped { pid: 1534429 }
{"timestamp":"2026-11-10T01:30:24.111Z","source":"relay","event":"file-line","line":"{\"message\":[\"Relay client stopped\",{\"pid\":1534429}],\"level\":\"INFO\",\"timestamp\":\"2026-11-10T01:30:24.108Z\",\"annotations\":{},\"spans\":{},\"fiberId\":\"#1\"}"}
{"timestamp":"2026-11-10T01:30:24.111Z","source":"driver","event":"process-exit","code":130,"recoveryCount":2,"signals":1}
```

## Full raw relay-client log

```text
{"message":["Relay client process started; waiting for tunnel connection",{"pid":1534405,"source":"path","version":"2026.10.4","protocol":"auto","tunnelId":"tunnel-1"}],"level":"INFO","timestamp":"2026-11-10T01:30:20.081Z","annotations":{},"spans":{},"fiberId":"#1"}
{"message":["Relay client stopped",{"pid":1534405}],"level":"INFO","timestamp":"2026-11-10T01:30:20.139Z","annotations":{},"spans":{},"fiberId":"#29"}
{"message":["Relay client exited; restarting",{"pid":1534405,"exitCode":1,"tunnelId":"tunnel-1"}],"level":"WARN","timestamp":"2026-11-10T01:30:20.139Z","annotations":{},"spans":{},"fiberId":"#29"}
{"message":["Relay client process started; waiting for tunnel connection",{"pid":1534412,"source":"path","version":"2026.10.4","protocol":"auto","tunnelId":"tunnel-1"}],"level":"INFO","timestamp":"2026-11-10T01:30:20.148Z","annotations":{},"spans":{},"fiberId":"#29"}
{"message":["Relay client is crash-looping; delaying restart",{"pid":1534412,"uptimeMillis":44,"restartDelayMillis":1000,"tunnelId":"tunnel-1"}],"level":"WARN","timestamp":"2026-11-10T01:30:20.192Z","annotations":{},"spans":{},"fiberId":"#37"}
{"message":["Relay client stopped",{"pid":1534412}],"level":"INFO","timestamp":"2026-11-10T01:30:21.195Z","annotations":{},"spans":{},"fiberId":"#37"}
{"message":["Relay client exited; restarting",{"pid":1534412,"exitCode":1,"tunnelId":"tunnel-1"}],"level":"WARN","timestamp":"2026-11-10T01:30:21.195Z","annotations":{},"spans":{},"fiberId":"#37"}
{"message":["Relay client process started; waiting for tunnel connection",{"pid":1534429,"source":"path","version":"2026.10.4","protocol":"auto","tunnelId":"tunnel-1"}],"level":"INFO","timestamp":"2026-11-10T01:30:21.202Z","annotations":{},"spans":{},"fiberId":"#37"}
{"message":["Relay client stopped",{"pid":1534429}],"level":"INFO","timestamp":"2026-11-10T01:30:24.108Z","annotations":{},"spans":{},"fiberId":"#1"}
```

## Full raw stub log

```text
{"timestamp":"2026-11-10T01:30:20.115Z","source":"stub","event":"started","pid":1534405,"attempt":1,"ageMs":1}
{"timestamp":"2026-11-10T01:30:20.116Z","source":"stub","event":"controlled-crash","pid":1534405,"attempt":1,"ageMs":2,"exitCode":1}
{"timestamp":"2026-11-10T01:30:20.183Z","source":"stub","event":"started","pid":1534412,"attempt":2,"ageMs":1}
{"timestamp":"2026-11-10T01:30:20.184Z","source":"stub","event":"controlled-crash","pid":1534412,"attempt":2,"ageMs":1,"exitCode":1}
{"timestamp":"2026-11-10T01:30:21.242Z","source":"stub","event":"started","pid":1534429,"attempt":3,"ageMs":1}
{"timestamp":"2026-11-10T01:30:21.799Z","source":"stub","event":"stop-signal","pid":1534429,"attempt":3,"ageMs":558,"signal":"SIGTERM","delayMs":2300,"state":"registering-model"}
{"timestamp":"2026-11-10T01:30:23.343Z","source":"stub","event":"past-registering-window","pid":1534429,"attempt":3,"ageMs":2102,"syntheticOnly":true}
{"timestamp":"2026-11-10T01:30:24.101Z","source":"stub","event":"exit","pid":1534429,"attempt":3,"ageMs":2860,"exitCode":0}
```

