# H04 — Uninitialized state and whole-phase failure

Labelled deterministic service harness using the unmodified StorageCleanup source, fixture service layers, Deferred delivery milestones and TestClock. Windows cases use HostProcess.Platform=win32 plus NodePath.layerWin32 and a virtual Windows filesystem. JSON records below are captured stdout, not predicted behavior.

| Before<br>[dc84b0962e](https://github.com/pingdotgg/t3code/commit/dc84b0962efa4f4e05ef392c08986a9cd7c994d1) | After<br>[06c0db5ad7](https://github.com/pingdotgg/t3code/commit/06c0db5ad787d743bd95e64935c0d111ad68f8e1) | Diff |
| --- | --- | --- |
| recovery {"entries":[],"omittedCount":0,"counts":{"removed":0,"kept":0,"failed":0}}<br>post-recovery-outside-stop {"reads":1}<br>preinitialization-stop {"reads":2,"report":{"trigger":"automatic","counts":{"removed":0,"kept":0,"failed":0},"reasons":[]}} | recovery {"entries":[],"omittedCount":0,"counts":{"removed":0,"kept":0,"failed":0}}<br>post-recovery-outside-stop {"reads":0}<br>preinitialization-stop {"reads":2,"report":{"trigger":"automatic","counts":{"removed":0,"kept":0,"failed":0},"reasons":[]}} | Both conservatively retry before initialization/after whole-phase failure; head suppresses an outside stop after empty recovery. |

## Before — [dc84b0962e](https://github.com/pingdotgg/t3code/commit/dc84b0962efa4f4e05ef392c08986a9cd7c994d1)

```text
{"row":"H04","phase":"whole-phase-failed","testClock":"2026-06-10","data":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"failed","reason":"synthetic readThreads failure","path":null,"projectPath":null,"threadId":null,"threadTitle":null,"bytes":null,"files":null}],"counts":{"removed":0,"kept":0,"failed":1},"bytesFreed":0,"omittedCount":0}}
{"row":"H04","phase":"recovery","testClock":"2026-06-10","data":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[],"counts":{"removed":0,"kept":0,"failed":0},"bytesFreed":0,"omittedCount":0}}
{"row":"H04","phase":"post-recovery-outside-stop","testClock":"2026-06-10","data":{"reads":1}}
 × ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H04 whole worktree phase read failure then recovery 112ms
{"row":"H04","phase":"preinitialization-stop","testClock":"2026-06-10","data":{"reads":2,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[],"counts":{"removed":0,"kept":0,"failed":0},"bytesFreed":0,"omittedCount":0}}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H04 stop before initial phase publishes 74ms
 FAIL  ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H04 whole worktree phase read failure then recovery
⎯⎯⎯⎯⎯⎯ Failed Tests 11 ⎯⎯⎯⎯⎯⎯⎯
 Test Files  1 failed (1)
      Tests  11 failed | 42 passed | 130 skipped (183)
   Start at  18:33:37
   Duration  19.55s (tests 66%, import 22%, transform 12%)
```

## After — [06c0db5ad7](https://github.com/pingdotgg/t3code/commit/06c0db5ad787d743bd95e64935c0d111ad68f8e1)

```text
{"row":"H04","phase":"whole-phase-failed","testClock":"2026-06-10","data":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"failed","reason":"synthetic readThreads failure","path":null,"projectPath":null,"threadId":null,"threadTitle":null,"bytes":null,"files":null}],"counts":{"removed":0,"kept":0,"failed":1},"bytesFreed":0,"omittedCount":0}}
{"row":"H04","phase":"recovery","testClock":"2026-06-10","data":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[],"counts":{"removed":0,"kept":0,"failed":0},"bytesFreed":0,"omittedCount":0}}
{"row":"H04","phase":"post-recovery-outside-stop","testClock":"2026-06-10","data":{"reads":0}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H04 whole worktree phase read failure then recovery 88ms
{"row":"H04","phase":"preinitialization-stop","testClock":"2026-06-10","data":{"reads":2,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[],"counts":{"removed":0,"kept":0,"failed":0},"bytesFreed":0,"omittedCount":0}}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H04 stop before initial phase publishes 125ms
 Test Files  1 passed (1)
      Tests  53 passed | 130 skipped (183)
   Start at  18:33:36
   Duration  18.99s (tests 68%, import 21%, transform 11%)
```
