# R04 — Surviving native child — authorized named-unit fallback

Run the exact named test on both SHAs. This is the explicitly authorized service-harness fallback; no real native-child runtime is claimed.

| Before<br>[dc84b0962e](https://github.com/pingdotgg/t3code/commit/dc84b0962efa4f4e05ef392c08986a9cd7c994d1) | After<br>[06c0db5ad7](https://github.com/pingdotgg/t3code/commit/06c0db5ad787d743bd95e64935c0d111ad68f8e1) | Diff |
| --- | --- | --- |
| ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once a live thread's session in it stops 210ms | ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once a live thread's session in it stops 183ms | Both pass the exact service test: live native-child session protection clears and the deleted owner’s path is removed. |

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

```text
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once its session stops 271ms
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once a live thread's session in it stops 210ms
stdout | src/storageCleanup.test.ts > deleted thread worktrees > does not sweep for a deleted thread whose cleanup effect failed when a session elsewhere stops
[17:56:18.591] ERROR (#261): Error [AssertionError]: expected 1 to be +0 // Object.is equality
    at /home/ubuntu/wt/pr-26038-before/apps/server/src/storageCleanup.test.ts:1191:23 {
  actual: 1,
  expected: 0,
  showDiff: true,
  operator: 'strictEqual',
  [cause]: undefined
}

 ↓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once its terminal closes and its session stops
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > retries a deleted thread's worktree kept for another reason when a session in it stops
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > does not sweep for a kept deleted worktree when a session elsewhere stops
 × src/storageCleanup.test.ts > deleted thread worktrees > does not sweep for a deleted thread whose cleanup effect failed when a session elsewhere stops 198ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
 Test Files  1 failed (1)
      Tests  1 failed | 3 passed | 126 skipped (130)
   Start at  17:56:13
   Duration  5.78s (import 56%, transform 26%, tests 16%, setup 2%)
```

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

```text
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once its session stops 271ms
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once a live thread's session in it stops 183ms
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree once its terminal closes and its session stops
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > retries a deleted thread's worktree kept for another reason when a session in it stops
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > does not sweep for a kept deleted worktree when a session elsewhere stops
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > does not sweep for a deleted thread whose cleanup effect failed when a session elsewhere stops 118ms
 ✓ src/storageCleanup.test.ts > deleted thread worktrees > removes a deleted thread's worktree when its session stops during the deletion's sweep 241ms
 ↓ src/storageCleanup.test.ts > deleted thread worktrees > waits out the settle grace of a subagent that just settled
 ↓ src/storageCleanup.test.ts > orphan worktree reports > keeps orphan results visible when thread results fill the report
 ↓ src/storageCleanup.test.ts > orphan worktree reports > skips an ancestor of a referenced thread worktree (canonical)
 ↓ src/storageCleanup.test.ts > orphan worktree reports > skips an ancestor of a referenced thread worktree (win32)
 ↓ src/storageCleanup.test.ts > orphan worktree reports > skips an ancestor of a referenced thread worktree (linux)
 ↓ src/storageCleanup.test.ts > orphan worktree reports > continues reporting when a project root cannot be probed
 ↓ src/storageCleanup.test.ts > orphan worktree reports > reports a linked orphan's size without removing its files (nested)
 ↓ src/storageCleanup.test.ts > orphan worktree reports > reports a linked orphan's size without removing its files (direct)
 ↓ src/storageCleanup.test.ts > orphan worktree reports > does not report a folder referenced by a thread (active)
 Test Files  1 passed (1)
      Tests  4 passed | 126 skipped (130)
   Start at  17:56:11
   Duration  5.64s (import 56%, transform 27%, tests 15%, setup 2%)
```
