# Issue 24797 evidence index

Before: a96cf0818eff4a113c3ff52ae702683e51a5803b.
After: d9033f42f3fa3757fb54eddff31013d15568ef11.
Red-test revision: 0da3aa95d92197b5db76914abb6a34718a72b22c (reported run).

## Scope and visual matrix

Visual matrix: **EMPTY**. Only ThreadPullRequestService.ts and its focused test changed (100 insertions, 3 deletions). The service checks for worktree/.git instead of the worktree folder before choosing the PR lookup cwd; Effect Path is added to production dependencies and test layers. No UI, contracts, client rendering, layout, motion or timing surface changed. No screenshot or recording was captured or is claimed.

[Original proof matrix](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/203479e4ca9f0c7f/matrix.md) is an earlier proof plan; its pending entries are superseded by the observations below.

## Provenance and independent checks

Lead captured a real Node server via vp run dev on Linux fs-01 (server 16541, Vite 8501), using T3 collaborative Chromium at 1280x800 and isolated worktree .t3 state. No agent turn was started. After captures followed the server watch restart at 08:44:12 UTC on the after revision. Revision, fixture conditions, event triggers and runtime environment are lead-reported provenance; this packaging agent did not repeat the runtime reproduction.

Independently performed by this packaging agent: read the complete before-to-after diff, read every supplied JSON transcript and procedure, fetched the EMPTY visual matrix, resolved the three full revision hashes, and verified all 9 extracted timestampNs values occur in the read-only raw server.trace.ndjson. No tests, server or browser were run; no checkout or lead scratch was modified. The complete raw trace was not published because these scoped extracts are sufficient and avoid unrelated runtime data.

## Tests and checks (reported, not independently run here)

- Red agent at 0da3aa95d9: focused regression suite 1 failed, 6 passed. Expected ['/workspace/project']; actual ['/workspace/worktree']. This is the intended cwd regression, not a setup failure.
- Green at d9033f42f3: focused ThreadPullRequestService suite 7 passed.
- Server typecheck passed.
- Scoped lint: only a preexisting unused layer warning reported.

Raw test command/output artifacts were not among the supplied files; these results are explicitly reports from the lead/red agent, not independently executed evidence.

## Runtime observations

Success below means the real GitManager.branchPullRequest.remotes span completed successfully. It proves local Git operation/cwd behavior, not remote PR API success or a detected matching PR. Paths are under /tmp/issue-24797-repro/.

- [before-runtime.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3330e86fd9bc0280/before-runtime.json): Before: valid linked worktree succeeds at worktree; after .git removal, two refreshes fail with not_a_repository at the same worktree path. UTC timestamps: 2026-10-25T08:39:25.731956+00:00, 2026-10-25T08:40:05.049900+00:00, 2026-10-25T08:40:33.506091+00:00. Exact nanoseconds remain in the JSON.
- [after-empty-worktree.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5bbc1a07fcb265e8/after-empty-worktree.json): After: existing empty worktree folder without .git falls back to repo on two explicit refreshes; both succeed. UTC timestamps: 2026-10-25T08:44:35.489237+00:00, 2026-10-25T08:46:14.919008+00:00. Exact nanoseconds remain in the JSON.
- [after-valid-linked-worktree.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4e563950035c00e3/after-valid-linked-worktree.json): After: restored valid linked-worktree .git file preserves worktree cwd; succeeds. UTC timestamps: 2026-10-25T08:44:26.770040+00:00. Exact nanoseconds remain in the JSON.
- [after-regular-repository.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2605a3e11c59d24f/after-regular-repository.json): After: regular .git directory preserves regular-repo cwd; succeeds. UTC timestamps: 2026-10-25T08:44:41.515642+00:00. Exact nanoseconds remain in the JSON.
- [after-missing-worktree.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a19698e8ff7ea7f4/after-missing-worktree.json): After: absent worktree folder falls back to repo; succeeds. UTC timestamps: 2026-10-25T08:46:02.021858+00:00. Exact nanoseconds remain in the JSON.
- [baseline-missing-directory.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f0bfb680b6c24282/baseline-missing-directory.json): Baseline control: missing directory uses repo and succeeds (revision/condition attributed by lead; this JSON itself contains spans only). UTC timestamps: 2026-10-25T08:42:05.252499+00:00. Exact nanoseconds remain in the JSON.

## Procedure and coverage limits

[Reproduction steps / RPC driver procedure](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1a0b0e7d062767c9/reproduction.md) records fixture setup, projects.mutate, thread.create and settle/unsettle refresh events. No standalone executable driver file was supplied; none is fabricated. Before and procedure links are reused from lead uploads; all after/control JSON files are newly uploaded.

Source inspection confirms branch is retained and the selected cwd is shared by initial lookup and freshGitState revalidation. The extracted remotes spans do not contain branch arguments or prove a matching-PR revalidation occurred. The focused test covers startup sweep; runtime events exercise the shared synchronization worker. Null worktreePath is source-reviewed only. No exhaustive per-trigger/client/provider testing is claimed. Marker existence does not validate malformed or stale .git contents; those remain outside this demonstrated fix.

## FRICTION

category | cause | remedy
--- | --- | ---
PROVENANCE | Test outputs are reports; runtime extracts do not independently encode all fixture transitions/revisions | Label reported results and keep procedure, revision context and raw-timestamp cross-check together
FETCH | Web fetch could not read the public matrix | Read the same public artifact with curl; confirmed EMPTY
SCOPE_BOUNDARY | Successful remotes spans do not prove remote PR API success; .git presence does not validate corrupt metadata | Limit claims to missing-marker cwd fallback and preservation of valid file/directory markers

