# R6 first-read-overlap

Evidence for [#33263](https://git.cafe/pingdotgg/t3code/pull/33263). Both first reads publish A upstream/ahead 1/behind 0/default-ahead 1. Before: local-only then publishes null and the final passive snapshot is null. After: no subsequent clear; the final passive snapshot retains A.

The actual first git fetch is held by a FIFO gate. A local update is observed before explicit release; successful server refresh-span completion is observed before ending the poller.

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

| Before | After |
|---|---|
| [4c361199f4](https://git.cafe/pingdotgg/t3code/commit/4c361199f47f6ea32a2c14835df392640d0f7c63) | [456327574c](https://git.cafe/pingdotgg/t3code/commit/456327574c52ad1c7624083bb97eaf382edd1732) |
| [Full timestamped log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1bcdfec5d8073078/R6-before.log) | [Full timestamped log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/c322b5f54ab5979b/R6-after.log) |

Before environment: Linux 6.8.0-117-generic x64; Node v26.12.1; `T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --host 127.0.0.1 --port 46303 --base-dir /tmp/lead-33263-r1/evidence-capture/2026-11-10T07-13-33.440Z-before-R6/t3 --no-browser --log-level warn --dev-url http://127.0.0.1:46303`; settings: `automaticGitFetchInterval=30 seconds`. Fresh explicit base dir; Replay provisioned by `--dev-url`; forwarding git wrapper first on PATH. No dev runner or live-data seeding.

After environment: Linux 6.8.0-117-generic x64; Node v26.12.1; `T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --host 127.0.0.1 --port 45819 --base-dir /tmp/lead-33263-r1/evidence-capture/2026-11-10T07-13-33.452Z-after-R6/t3 --no-browser --log-level warn --dev-url http://127.0.0.1:45819`; settings: `automaticGitFetchInterval=30 seconds`. Fresh explicit base dir; Replay provisioned by `--dev-url`; forwarding git wrapper first on PATH. No dev runner or live-data seeding.

The recordings below preserve action/event order independently in each column. Rows align by event ordinal, not wall-clock synchronization. Full payloads, command traces, and server completion spans are in the linked logs. Bounded windows establish only the recorded absence of an update, not a full 30-second delay.

| Before recording | After recording |
|---|---|
| `2026-11-10T07:13:33.866Z +426ms` SYNTHETIC_SEED {"facts":{"A":{"status":"## feature/A...origin/feature/A [ahead 1]","divergence":"1\t0"},"B":{"status":"## feature/B...origin/feature/B [ahead 2, behind 1]","divergence":"2\t1"}}} | `2026-11-10T07:13:33.923Z +470ms` SYNTHETIC_SEED {"facts":{"A":{"status":"## feature/A...origin/feature/A [ahead 1]","divergence":"1\t0"},"B":{"status":"## feature/B...origin/feature/B [ahead 2, behind 1]","divergence":"2\t1"}}} |
| `2026-11-10T07:13:33.874Z +435ms` SERVER_SPAWNED {"pid":285435} | `2026-11-10T07:13:33.932Z +479ms` SERVER_SPAWNED {"pid":285444} |
| `2026-11-10T07:13:39.886Z +6446ms` RPC_SEND server.updateSettings automaticGitFetchInterval=30000ms | `2026-11-10T07:13:39.763Z +6310ms` RPC_SEND server.updateSettings automaticGitFetchInterval=30000ms |
| `2026-11-10T07:13:40.013Z +6573ms` RPC_RESULT server.updateSettings {"automaticGitFetchInterval":{"_id":"Duration","_tag":"Millis","millis":30000}} | `2026-11-10T07:13:39.884Z +6431ms` RPC_RESULT server.updateSettings {"automaticGitFetchInterval":{"_id":"Duration","_tag":"Millis","millis":30000}} |
| `2026-11-10T07:13:40.014Z +6574ms` SUBSCRIBE passive-1 includeRemote=False | `2026-11-10T07:13:39.885Z +6432ms` SUBSCRIBE passive-1 includeRemote=False |
| `2026-11-10T07:13:40.723Z +7283ms` VCS_EVENT passive-1 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":false,"branchChanges":{"baseRef":"origin/main","insertions":1,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[]} remote=null | `2026-11-10T07:13:40.590Z +7137ms` VCS_EVENT passive-1 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":false,"branchChanges":{"baseRef":"origin/main","insertions":1,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[]} remote=null |
| `2026-11-10T07:13:40.724Z +7284ms` SUBSCRIBE first-active-2 includeRemote=True | `2026-11-10T07:13:40.591Z +7138ms` SUBSCRIBE first-active-2 includeRemote=True |
| `2026-11-10T07:13:40.819Z +7379ms` VCS_EVENT first-active-2 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":false,"branchChanges":{"baseRef":"origin/main","insertions":1,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[]} remote=null | `2026-11-10T07:13:40.648Z +7195ms` VCS_EVENT first-active-2 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":false,"branchChanges":{"baseRef":"origin/main","insertions":1,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[]} remote=null |
| `2026-11-10T07:13:41.008Z +7568ms` GATE_READ_IN_FLIGHT {"args":["--git-dir","/tmp/lead-33263-r1/evidence-capture/2026-11-10T07-13-33.440Z-before-R6/workspace/demo/.git","fetch","--quiet","--no-tags","--no-auto-gc","--","origin"]} | `2026-11-10T07:13:40.844Z +7391ms` GATE_READ_IN_FLIGHT {"args":["--git-dir","/tmp/lead-33263-r1/evidence-capture/2026-11-10T07-13-33.452Z-after-R6/workspace/demo/.git","fetch","--quiet","--no-tags","--no-auto-gc","--","origin"]} |
| `2026-11-10T07:13:41.008Z +7568ms` EXTERNAL_EDIT {"file":"edit.txt"} | `2026-11-10T07:13:40.845Z +7392ms` EXTERNAL_EDIT {"file":"edit.txt"} |
| `2026-11-10T07:13:41.009Z +7570ms` RPC_SEND vcs.refreshStatus localOnly=True | `2026-11-10T07:13:40.846Z +7393ms` RPC_SEND vcs.refreshStatus localOnly=True |
| `2026-11-10T07:13:41.716Z +8276ms` VCS_EVENT passive-1 localUpdated {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} | `2026-11-10T07:13:41.564Z +8111ms` VCS_EVENT passive-1 localUpdated {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} |
| `2026-11-10T07:13:41.717Z +8277ms` LOCAL_UPDATE_CONFIRMED_BEFORE_GATE_RELEASE {} | `2026-11-10T07:13:41.566Z +8113ms` LOCAL_UPDATE_CONFIRMED_BEFORE_GATE_RELEASE {} |
| `2026-11-10T07:13:41.717Z +8277ms` GATE_RELEASE_REQUESTED {} | `2026-11-10T07:13:41.568Z +8115ms` GATE_RELEASE_REQUESTED {} |
| `2026-11-10T07:13:41.719Z +8279ms` GATE_RELEASE_WRITTEN {} | `2026-11-10T07:13:41.576Z +8123ms` GATE_RELEASE_WRITTEN {} |
| `2026-11-10T07:13:41.722Z +8283ms` VCS_EVENT first-active-2 localUpdated {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} | `2026-11-10T07:13:41.581Z +8128ms` VCS_EVENT first-active-2 localUpdated {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} |
| `2026-11-10T07:13:43.355Z +9915ms` VCS_EVENT passive-1 remoteUpdated remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null | `2026-11-10T07:13:41.586Z +8133ms` RPC_RESULT vcs.refreshStatus branch=feature/A remote={"hasUpstream":false,"aheadCount":0,"behindCount":0,"aheadOfDefaultCount":0} pr=null |
| `2026-11-10T07:13:43.360Z +9920ms` VCS_EVENT first-active-2 remoteUpdated remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null | `2026-11-10T07:13:43.163Z +9710ms` VCS_EVENT passive-1 remoteUpdated remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null |
| `2026-11-10T07:13:43.365Z +9925ms` RPC_RESULT vcs.refreshStatus branch=feature/A remote={"hasUpstream":false,"aheadCount":0,"behindCount":0,"aheadOfDefaultCount":0} pr=null | `2026-11-10T07:13:43.165Z +9712ms` VCS_EVENT first-active-2 remoteUpdated remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null |
| `2026-11-10T07:13:43.379Z +9939ms` VCS_EVENT passive-1 remoteUpdated remote=null | `2026-11-10T07:13:43.895Z +10442ms` REAL_SERVER_REMOTE_REFRESH_COMPLETED VcsStatusBroadcaster.refreshRemoteStatus exit=Success |
| `2026-11-10T07:13:43.380Z +9940ms` VCS_EVENT first-active-2 remoteUpdated remote=null | `2026-11-10T07:13:44.646Z +11193ms` OBSERVATION_WINDOW_CLOSED {"timeoutMs":750} |
| `2026-11-10T07:13:43.857Z +10417ms` REAL_SERVER_REMOTE_REFRESH_COMPLETED VcsStatusBroadcaster.refreshRemoteStatus exit=Success | `2026-11-10T07:13:44.647Z +11194ms` UNSUBSCRIBE first-active-2 |
| `2026-11-10T07:13:44.614Z +11174ms` OBSERVATION_WINDOW_CLOSED {"timeoutMs":750} | `2026-11-10T07:13:44.650Z +11197ms` UNSUBSCRIBED first-active-2 |
| `2026-11-10T07:13:44.615Z +11175ms` UNSUBSCRIBE first-active-2 | `2026-11-10T07:13:44.651Z +11198ms` SUBSCRIBE final-passive-3 includeRemote=False |
| `2026-11-10T07:13:44.617Z +11177ms` UNSUBSCRIBED first-active-2 | `2026-11-10T07:13:44.711Z +11258ms` VCS_EVENT final-passive-3 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null |
| `2026-11-10T07:13:44.620Z +11180ms` SUBSCRIBE final-passive-3 includeRemote=False | `2026-11-10T07:13:44.712Z +11259ms` UNSUBSCRIBE final-passive-3 |
| `2026-11-10T07:13:44.667Z +11227ms` VCS_EVENT final-passive-3 snapshot {"isRepo":true,"refName":"feature/A","isDefaultRef":false,"hasPrimaryRemote":true,"hasWorkingTreeChanges":true,"branchChanges":{"baseRef":"origin/main","insertions":2,"deletions":0}} worktree={"insertions":0,"deletions":0,"files":[{"path":"edit.txt","insertions":0,"deletions":0}]} remote=null | `2026-11-10T07:13:44.712Z +11259ms` UNSUBSCRIBED final-passive-3 |
| `2026-11-10T07:13:44.668Z +11228ms` UNSUBSCRIBE final-passive-3 | `2026-11-10T07:13:44.712Z +11259ms` UNSUBSCRIBE passive-1 |
| `2026-11-10T07:13:44.672Z +11232ms` UNSUBSCRIBED final-passive-3 | `2026-11-10T07:13:44.713Z +11260ms` UNSUBSCRIBED passive-1 |
| `2026-11-10T07:13:44.674Z +11234ms` UNSUBSCRIBE passive-1 | `2026-11-10T07:13:44.713Z +11260ms` ROW_COMPLETE {"row":"R6"} |
| `2026-11-10T07:13:44.675Z +11235ms` UNSUBSCRIBED passive-1 | `2026-11-10T07:13:45.347Z +11894ms` SERVER_STOPPED {"pid":285444,"exitCode":130,"signal":null} |
| `2026-11-10T07:13:44.675Z +11235ms` ROW_COMPLETE {"row":"R6"} |  |
| `2026-11-10T07:13:45.348Z +11908ms` SERVER_STOPPED {"pid":285435,"exitCode":130,"signal":null} |  |

Final before: remote=null

Final after: remote={"hasUpstream":true,"aheadCount":1,"behindCount":0,"aheadOfDefaultCount":1} pr=null
