# SSH agent lifetime — final runtime evidence index

Requested branch `fix/issue-11872`; requested HEAD `d2298847909b2d80ad4ebea8751368fd3ab6c479`; base `3b95e7831b11b17627dff16843bc087bfca397ec`; final observed HEAD `a96bd98149a3f5b444ba28e54489433816ac3b76`. Worktree `/home/ubuntu/wt/issue-11872`.

**Runtime coverage: 5/5 rows; 0 visual rows. Final branch proof: INCOMPLETE because parent advanced HEAD during capture and supplied green test evidence predates that test-only commit.** No runtime source changed: requested/final `tunnel.ts` blob is `5757233e1d393df3f220bbb2988707c5d29fd264`. Individual runtime logs record observed HEAD. No implementation edits or commits by this agent. Parent should attach fresh green tests at current HEAD and confirm provenance before treating this as final branch approval.

[Consolidated actual runtime transcript, configuration, commands, raw base/head logs, red/green logs and cleanup](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2842789e399219d8/final-runtime-transcript.txt).

## Runtime matrix

| Row | Expected base/head observations | Actual evidence | Disposition |
| --- | --- | --- | --- |
| R1 managed fresh launch, ForwardAgent=yes, no login-shell agent | Base server inherits dead short-session socket; head gets stable link to live tunnel session; actual server env authenticates | Final forwarded-before/after sections: base PID 695613, socket/ssh-add/fetch/pull fail; head PID 697070, all four exit 0 | Covered; final observed HEAD runtime equals requested source |
| R2 captured tunnel termination, reconnect, disconnect | Same managed server PID; head link refreshes to new live socket; final disconnect releases owned server and forwarding session | Head PID 697070 stays; link changes from agent.697735 to agent.698504; all auth checks exit 0 twice; post-disconnect server gone, live_socket=False. Base retains dead original socket/auth failures | Covered; detailed target and release inspection included |
| R3 effective ForwardAgent=no, no login-shell agent | HTTP manager launch/reconnect succeed; no server socket/link and no forced agent; Git auth failure expected | Base PID 666077; head PID 667907. Each same PID on reconnect, socket None/link absent; test-S=1, ssh-add=2, fetch=128, pull=1 twice; manager exits 0; servers gone after disconnect | Covered at requested HEAD |
| R4 effective ForwardAgent=no, remote login-shell stable override | Independent remote agent works after short launch and reconnect, survives managed lifecycle | Base PID 674638 inherits stable-agent.sock directly; head PID 677844 inherits agent.sock link to stable-agent.sock. Same PID across reconnect; test-S/ssh-add/fetch/pull all 0 twice. Remote agent remains usable for subsequent independent server | Covered at requested HEAD |
| R5 independently owned actual server, ForwardAgent=yes, no login-shell override during adoption | Manager reports external; server PID/original stable env unchanged; tunnel link may change; disconnect leaves server/independent agent alive | Final external sections: PID 698931 both revisions; serverKind=external; original stable-agent.sock retained, auth checks all 0 twice per revision. Head link changes forwarded sessions agent.702162 to agent.702970; post-disconnect state=S, independent agent ssh-add succeeds | Covered at final observed HEAD; same runtime source as requested |

Correction: raw harness MANAGER_SOURCE labels name requested d229 runtime content even in later runs; HEAD lines identify checkout provenance. Raw static COMMAND labels say local-agent.sock; final forwarded/external runs actually use PROOF_LOCAL_SOCK=<fixture>/proof-local-agent.sock, as explained in transcript. Initial extra forwarding attempts against parent's connection-refused agent were discarded and replaced; no invalid attempts are presented as passing proof. Base manager is a scratch git-show copy of base tunnel.ts, using unchanged dependencies and same actual source server. This is a real-manager comparison, not a full detached base checkout.

## Render paths and limits

**Empty visual matrix (0 rows):** only SSH/server process environment, session lifetime and readiness changed; no components, styles, navigation, contracts, IPC schema or rendering changed. Runtime transcripts plus red regression are appropriate. No screenshots, recordings, browser, Vite or computer use occurred.

- Desktop SSH ensure/reconnect/disconnect: Linux actual manager/sshd boundary verified; **cannot-verify desktop macOS UI**, Electron/macOS login shell or packaged runtime.
- Web: actual server and HTTP tunnel readiness verified; Git commands run as fixture user with exact server /proc environment, not through a browser or Git RPC.
- Mobile: no changed native/rendering/navigation code; no mobile verification claimed.
- Provider adapters, MCP tools and scheduler: unchanged; authentication proof is at shared subprocess environment boundary, not individual provider execution.
- Local/relay: unchanged; SSH tunnel path exercised.

## Regression and existing artifacts

- [Red regression](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b0a0abe635425635/red-test.log): base implementation fails agent-after-launch/reconnect while sameServer=true. Parent supplied; no intrinsic full SHA in that raw log.
- [Existing green log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2cdeec6d0783bf2c/green-tests.log): parent supplied 22/22, four files; predates final test-only commit. Not claimed current.
- [Parent before transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8f58dc44cb2007ac/before-runtime-transcript.txt) and [parent after transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/13655071cd089506/after-runtime-transcript.txt).
- [Initial audit matrix](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5d53cc37105ec2d9/proof-matrix.md): initial missing R3/R4/R5 runtime rows are now captured above. New test-only commit contains readiness/harness changes; fresh test execution belongs to parent/current-HEAD proof.

## Isolation and cleanup

Disposable Linux user/home and real sshd only. No developer live T3 home or credentials uploaded. Scratch harness/probe files only; no tracked source edits, commits, PRs or forge writes. Private key, agent-env, raw external server startup log, server runtime auth fields and pairing tokens excluded. Sanitized transcript includes public test identity fingerprint only.

Fixture ssh_config and login .profile restored byte-for-byte; external PID, independent remote-agent PID and separately owned local-agent PID all gone. Managed servers stopped by manager. Parent sshd retained; parent's original local agent never stopped or modified. Dangling stable links may remain after disconnect; no live forwarded socket remains. Tracked git status clean.

FRICTION
category|what|prevention
---|---|---
infra|Login-shell command initialization stalled read-only calls|Use login=false for scratch fixture commands
infra|Parent local agent socket became connection-refused during work|Verify ssh-add first; use separately owned agent/PID and replace invalid forwarding captures
brief|Parent advanced HEAD during evidence capture|Record per-run HEAD and runtime blob; require fresh current-HEAD green result
runbook|Original probe assumed a managed PID and existing SSH_AUTH_SOCK|Use explicit external PID, absence-aware exact-env probes and cleanup inspection

EVIDENCE_CAPTURE_INCOMPLETE
