# Publish protocol evidence

Evidence for [#18717](https://git.cafe/pingdotgg/t3code/pulls/18717), also [#18717](https://github.com/pingdotgg/t3code/pull/18717).

12/12 matrix rows covered; no missing rows. Six actual authenticated dev-server WebSocket publish requests captured. 103 tests passed: 59 in the two requested scoped files, 16 in an external temporary gap harness, and 28 in the scoped VcsProcess file. Four additional fail-closed boundary assertions passed. No UI changed or browser used.

Before: [7fd2e09e38](https://github.com/pingdotgg/t3code/commit/7fd2e09e38). After: [9456cd2a68](https://github.com/pingdotgg/t3code/commit/9456cd2a687586d9e9fcc827c33303bc2dad649f). Full SHAs and SHA-256 production-source hashes are in source-manifest.json. Environment: Linux x86_64, machine fs-31, Node 26.12.1, real /usr/bin/gh 2.45.0. Checkout /home/ubuntu/wt/pr-18717 was clean before and after; no source files modified by this task. An external merge advanced HEAD to [48c105a776](https://github.com/pingdotgg/t3code/commit/48c105a776999d5d2ddaeac5b52febce8616ac92). Final evidence pins production modules to the requested SHAs without resetting that external merge.

## Runtime results

S denotes the inert SSH fixture URL; H denotes its HTTPS equivalent. Exact strings are preserved in runtime-transcripts.json.

| Row | Real GH_CONFIG_DIR | Before | After | Evidence |
|---|---|---|---|---|
| P1 | git_protocol: ssh | S | S | before-ssh / after-ssh request, creation stub, selected URL, response; after logs real gh output ssh, exit 0 |
| P2 | git_protocol: https | S | H | before-https / after-https; after logs real gh output https, exit 0 |
| P3 | Empty directory, no config file | S | H | before-unset / after-unset; real gh reports https, exit 0; empty directory enumerated in config probe |

Each run starts a new dev server with explicit --no-seed --home-dir /tmp/ev-18717 and T3CODE_DEV_SEED=0. The owned scratch home is recreated sequentially. HOME, XDG directories, GH_CONFIG_DIR and Git global config are isolated. Final six runs disable repository dotenv loading before it executes; the subprocess environment is allowlisted and excludes ambient GitHub/provider/T3 credentials. Authentication uses a synthetic local credential, excluded from published logs. No VITE_HTTP_URL or VITE_WS_URL is supplied by the harness; dev:server's own existing runner behavior constructs its normal internal environment.

The runtime capture is the actual server /ws?orchestrationProtocol=2 handler calling SourceControlRepositoryService.publishRepository, not a standalone service harness. The dev runner launches the normal apps/server/src/bin.ts entrypoint directly in place of Vite+'s watch launcher. All other server composition remains production. Original RPC request ID and response are recorded. Creation is intercepted at the GitHub provider createRepository function body, before viewer lookup or REST. It returns only deterministic fixture metadata. The actual provider preferredCloneProtocol, SourceControlHost.process.run, VcsProcess and real gh config execution remain in place (VcsProcess only adds output logging). The service resolver is unmodified. At the git.ensureRemote call boundary the fixture records the URL and throws EVIDENCE_URL_SELECTED_STOP before remote mutation, head checks or push. Therefore the RPC deliberately returns a defect, not publish success. This proves URL selection only, not repository creation or push.

The loader also denies non-loopback sockets and unapproved subprocesses. Explicit boundary checks verify denial of a GitHub socket, gh API POST, git push and git remote add. No forge repository was created. Normal provider startup probes are denied and appear in startup logs; they do not affect this RPC.

Before and after use exact git-show blobs for the three changed protocol production modules under their original module URLs. A fourth production module, ACP clientTerminals.ts, is also pinned in each run to exclude the external main merge. These four overlays account for all tracked production differences from the checkout; tests are not part of the server module graph. Both revisions run the same creation/stop/network boundaries. No hard-coded baseline result or original-fork substitution is used. See source-manifest.json and module-overlay events. Pinned source blobs and pin-sources.py are included.

## Remaining matrix rows

| Row | Proof |
|---|---|
| P4 | Requested scoped service tests: omitted and auto both enumerate SSH and HTTPS preferences. |
| P5 | Scoped result tests plus external service-gap tests: explicit SSH/HTTPS select requested URLs and invoke preference zero times; lookup throws if called. |
| P6 | Missing capability and explicit null both select SSH in external service-gap tests; missing also covered by scoped tests. |
| G1 | Scoped exact host argv assertions plus external adapter-gap tests whose ghe.test setting differs from global fallback. |
| G2 | Scoped successful empty output and external adapter-gap successful empty/arbitrary non-SSH output all select HTTPS. |
| G3 | External adapter-gap typed VcsProcessSpawnError becomes null; external service-gap null selects SSH. Scoped VcsProcess tests cover actual process nonzero rejection. This is layered failure proof, not a runtime network-failure simulation. |
| C1 | Scoped auto HTTPS prepareClone and external omitted/auto prepareClone tests use real temporary destination parent. |
| C2 | External explicit SSH/HTTPS prepareClone tests assert URL and zero preference calls; direct URL test preserves the supplied SSH URL even with explicit HTTPS. |
| C3 | Scoped direct-URL retry/no-retry tests; external provider-backed auto selects SSH and retries HTTPS after authentication rejection; explicit SSH control records one attempt and failure. Git execution is stubbed. |

Commands (each exited 0):

- vp test run apps/server/src/sourceControl/SourceControlRepositoryService.test.ts packages/source-control-github/src/server/GitHubSourceControlProvider.test.ts — 2 files, 59 tests.
- vp test run --config /tmp/evidence-18717/vite.config.ts — 2 external harness files, 16 tests.
- vp test run apps/server/src/vcs/VcsProcess.test.ts — 1 file, 28 tests.

After detecting the external merge, the 87 scoped cases were repeated using pinned-tests.config.ts with exact requested-head production sources; all 87 passed and module interceptions were recorded. The 16 gap cases were also repeated through that pinned plugin; all 16 passed. Thus 103 unique cases passed against the pinned scope (additional earlier runs are retained, not double-counted). The first scoped invocations ran in the externally merged checkout; the affected source/test files were byte-identical to the requested head.

No typecheck or repo-wide checks were run in this evidence task. Temporary tests are outside the checkout and are not proposed PR tests. They borrow the existing fixture constructors and add observable URL/call/failure assertions; build-harness.py records their derivation. The public run.py regenerates a synthetic credential rather than retaining the fixed synthetic credential used for capture.

## Cleanup and FRICTION

All tracked spawn PIDs were stopped and then checked absent (stopped-pids.jsonl). The server's graceful interrupt exit 130 is expected. No pushes, comments, review posts, watches or PR changes. The required T3 PR link was registered. No reads/copies/writes of ~/.t3 were performed.

Scratch retained for owner cleanup: /tmp/evidence-18717 (private raw startup/pilot logs, source blobs, temporary harness, fixtures and public evidence), and /tmp/ev-18717 (owned final isolated server state). Remove only these task-owned paths when finished. No other checkout touched.

FRICTION: another process merged main into this shared checkout while capture was active. The branch was left at that external merge, clean; resetting it to the requested SHA would overwrite another worker's branch operation. All final runtime and focused test evidence uses pinned requested production sources instead. The stock dev runner loads optional dotenv files and normally delegates to a watch launcher; an external loader disables dotenv and launches the normal server entrypoint directly. One preliminary pilot preceded that dotenv correction and is excluded from public evidence; all six accepted captures contain dotenv-disabled events. Fail-closed subprocess blocking produces expected provider-probe/login-shell warnings. REST creation precedes protocol selection, so a gh shim alone would have been unsafe; provider-body interception was necessary. The supplied original fork commit's provenance is not established by this capture; the supplied mergebase is the before baseline. No missing matrix proof rows remain.

## Downloads

[evidence-18717-scripts-and-transcripts.tar.gz](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/7dd8613cbd828fed/evidence-18717-scripts-and-transcripts.tar.gz)
[runtime-transcripts.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/e8792a4baaaed2ff/runtime-transcripts.json)
[gh-config-fixtures.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0ebaa0cc34546cf0/gh-config-fixtures.json)
