# Scoped test proof

Production file: `apps/server/src/vcs/GitVcsDriverCore.ts`; tests: existing `GitVcsDriverCore.test.ts`.


## Provenance

```json
{
  "recordedUTC": "2026-10-24T23:29:28.571478+00:00",
  "command": "vp test run apps/server/src/vcs/GitVcsDriverCore.test.ts",
  "before": {
    "method": "Temporarily replace ONLY production file using git show BASE:path > path; tests remain final committed tests; restore production before runtime capture",
    "productionSourceSHA": "7fd2e09e381a61f427da09dd7a8f2c9c1558fe59",
    "productionGitBlob": "5a9aa74af60aaff36eccb501cf0290a3b0fb180d",
    "testSourceSHA": "cefc1ace94bfe0d9f0bd97655a899fc4eccdffe3",
    "testGitBlob": "9679f7f41693e0585a618a01be04ebb4ff931824",
    "result": "163 passed, 2 failed (healthy and hung new tests)",
    "startUTC": "2026-10-24T23:24:44Z",
    "durationSeconds": 43.67
  },
  "after": {
    "productionSourceSHA": "cefc1ace94bfe0d9f0bd97655a899fc4eccdffe3",
    "productionGitBlob": "017f61ec848b26f5ca12c22be5e266e410961300",
    "testSourceSHA": "cefc1ace94bfe0d9f0bd97655a899fc4eccdffe3",
    "testGitBlob": "9679f7f41693e0585a618a01be04ebb4ff931824",
    "result": "165 passed",
    "startUTC": "2026-10-24T23:25:47Z",
    "durationSeconds": 42.16
  },
  "deadlines": "Deferred + TestClock; virtual 31s healthy; pending 299s and failure 300s hung; no wall-clock waits/assertions added to tests",
  "existingCoverage": "Entire existing driver test file run on both, including scoped remote resolution, missing remote ref and ref-lock retry; no repository-wide checks."
}
```

## Before: two expected new-test failures

```text
note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead.

 RUN  v5.0.5 /home/ubuntu/wt/pr-18537

stdout | src/vcs/GitVcsDriverCore.test.ts > bounds a healthy remote fetch at five minutes
[23:24:58.368] ERROR (#4313): Error [AssertionError]: expected 'Git command timed out.' to equal 'fetched'
    at /home/ubuntu/wt/pr-18537/apps/server/src/vcs/GitVcsDriverCore.test.ts:921:12 {
  actual: 'Git command timed out.',
  expected: 'fetched',
  showDiff: true,
  operator: 'strictEqual',
  [cause]: undefined
}

stdout | src/vcs/GitVcsDriverCore.test.ts > bounds a hung remote fetch at five minutes
[23:24:58.380] ERROR (#4349): Error [AssertionError]: expected { _id: 'Exit', _tag: 'Success', …(1) } to equal undefined
    at /home/ubuntu/wt/pr-18537/apps/server/src/vcs/GitVcsDriverCore.test.ts:916:14 {
  actual: {
    _id: 'Exit',
    _tag: 'Success',
    value: { _id: 'Result', _tag: 'Failure', failure: [Object] }
  },
  expected: undefined,
  showDiff: true,
  operator: 'strictEqual',
  [cause]: undefined
}

 ❯ |t3| src/vcs/GitVcsDriverCore.test.ts (165 tests | 2 failed) 34992ms
   × bounds a healthy remote fetch at five minutes 20ms
   × bounds a hung remote fetch at five minutes 9ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  |t3| src/vcs/GitVcsDriverCore.test.ts > bounds a healthy remote fetch at five minutes
AssertionError: expected 'Git command timed out.' to equal 'fetched'

Expected: "fetched"
Received: "Git command timed out."

 ❯ src/vcs/GitVcsDriverCore.test.ts:921:12
    919|
    920|     const result = yield* Fiber.join(fetching);
    921|     assert.equal(
       |            ^
    922|       Result.isFailure(result) ? result.failure.detail : "fetched",
    923|       fetch === "healthy" ? "fetched" : "Git command timed out.",
 ❯ ~effect/Effect/successCont ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28
 ❯ ~effect/Effect/evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:971:30
 ❯ FiberImpl.runLoop ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41
 ❯ FiberImpl.evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23
 ❯ FiberImpl.evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:589:27
 ❯ Array.<anonymous> ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1025:13
 ❯ MixedSchedulerDispatcher.runTasks ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/Scheduler.ts:254:17

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯

 FAIL  |t3| src/vcs/GitVcsDriverCore.test.ts > bounds a hung remote fetch at five minutes
AssertionError: expected { _id: 'Exit', _tag: 'Success', …(1) } to equal undefined

- Expected:
undefined

+ Received:
{
  "~effect/Effect/args": {
    "failure": GitCommandError {
      "message": "Git command failed in GitVcsDriver.fetchRemote (/tmp/git-vcs-driver-test-zZfJ3L): Git command timed out.",
      "_tag": "GitCommandError",
      "operation": "GitVcsDriver.fetchRemote",
      "command": "git",
      "cwd": "/tmp/git-vcs-driver-test-zZfJ3L",
      "argumentCount": 4,
      "detail": "Git command timed out.",
    },
  },
}

 ❯ src/vcs/GitVcsDriverCore.test.ts:916:14
    914|     else {
    915|       yield* TestClock.adjust("268 seconds");
    916|       assert.isUndefined(fetching.pollUnsafe());
       |              ^
    917|       yield* TestClock.adjust("1 second");
    918|     }
 ❯ ~effect/Effect/successCont ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28
 ❯ ~effect/Effect/evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30
 ❯ FiberImpl.runLoop ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41
 ❯ FiberImpl.evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23
 ❯ FiberImpl.evaluate ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:589:27
 ❯ ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1159:17
 ❯ Array.<anonymous> ../../node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:804:44

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯


 Test Files  1 failed (1)
      Tests  2 failed | 163 passed (165)
   Start at  23:24:44
   Duration  43.67s (tests 82%, transform 15%, import 2%, setup 2%)

```

## After: all 165 pass

```text
note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead.

 RUN  v5.0.5 /home/ubuntu/wt/pr-18537


 Test Files  1 passed (1)
      Tests  165 passed (165)
   Start at  23:25:47
   Duration  42.16s (tests 83%, transform 11%, setup 3%, import 3%)

```
