# H02 — Settle grace and activity/ownership rechecks

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 |
| --- | --- | --- |
| after-grace-outside-stop {"reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"first-recheck-activity","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"measurement-activity","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"measurement-ownership","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}} | after-grace-outside-stop {"reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"first-recheck-activity","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"measurement-activity","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}}<br>restored-child-outside-stop {"variant":"measurement-ownership","reads":1,"exists":false,"report":{"trigger":"automatic","counts":{"removed":1,"kept":0,"failed":0},"reasons":["Thread was deleted"]}} | Both retain during grace or changed activity/ownership, then retry on a later outside stop. No grace-only timer is created. |

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

```text
{"row":"H02","phase":"grace-baseline","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":"kept","reason":"Settled moments ago","path":"/tmp/storage-cleanup-MpqhgI/worktrees/feature","projectPath":"/tmp/cleanup-repo-C5k9mW","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0}}
{"row":"H02","phase":"after-grace-outside-stop","testClock":"2026-06-10","data":{"reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:01:01.000Z","finishedAt":"2026-06-10T12:01:01.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-MpqhgI/worktrees/feature","projectPath":"/tmp/cleanup-repo-C5k9mW","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H02 settled child grace then outside stop 252ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"first-recheck-activity","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-rh2BXS/worktrees/feature","projectPath":"/tmp/cleanup-repo-XYj22F","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"first-recheck-activity","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-rh2BXS/worktrees/feature","projectPath":"/tmp/cleanup-repo-XYj22F","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H02 changed child first-recheck-activity 277ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"measurement-activity","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-26za6x/worktrees/feature","projectPath":"/tmp/cleanup-repo-xf1Hdy","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"measurement-activity","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-26za6x/worktrees/feature","projectPath":"/tmp/cleanup-repo-xf1Hdy","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H02 changed child measurement-activity 235ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"measurement-ownership","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-iWC8aN/worktrees/feature","projectPath":"/tmp/cleanup-repo-fzH48h","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"measurement-ownership","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-iWC8aN/worktrees/feature","projectPath":"/tmp/cleanup-repo-fzH48h","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-before/evidence.test.ts > deleted thread worktrees > evidence H02 changed child measurement-ownership 232ms
⎯⎯⎯⎯⎯⎯ 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":"H02","phase":"grace-baseline","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":"kept","reason":"Settled moments ago","path":"/tmp/storage-cleanup-pfLPI0/worktrees/feature","projectPath":"/tmp/cleanup-repo-EnQ8Gw","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0}}
{"row":"H02","phase":"after-grace-outside-stop","testClock":"2026-06-10","data":{"reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:01:01.000Z","finishedAt":"2026-06-10T12:01:01.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-pfLPI0/worktrees/feature","projectPath":"/tmp/cleanup-repo-EnQ8Gw","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H02 settled child grace then outside stop 230ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"first-recheck-activity","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-BWmU8I/worktrees/feature","projectPath":"/tmp/cleanup-repo-tvWO6q","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"first-recheck-activity","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-BWmU8I/worktrees/feature","projectPath":"/tmp/cleanup-repo-tvWO6q","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H02 changed child first-recheck-activity 226ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"measurement-activity","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-rQofDc/worktrees/feature","projectPath":"/tmp/cleanup-repo-GdsJYy","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"measurement-activity","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-rQofDc/worktrees/feature","projectPath":"/tmp/cleanup-repo-GdsJYy","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H02 changed child measurement-activity 221ms
{"row":"H02","phase":"changed-child-baseline","testClock":"2026-06-10","data":{"variant":"measurement-ownership","report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"kept","reason":"Thread activity or shared worktree changed since check","path":"/tmp/storage-cleanup-hH9VRi/worktrees/feature","projectPath":"/tmp/cleanup-repo-mi8XWj","threadId":"thread-1","threadTitle":"Thread","bytes":null,"files":null}],"counts":{"removed":0,"kept":1,"failed":0},"bytesFreed":0,"omittedCount":0},"exists":true}}
{"row":"H02","phase":"restored-child-outside-stop","testClock":"2026-06-10","data":{"variant":"measurement-ownership","reads":1,"report":{"trigger":"automatic","startedAt":"2026-06-10T12:00:00.000Z","finishedAt":"2026-06-10T12:00:00.000Z","entries":[{"kind":"worktree","outcome":"removed","reason":"Thread was deleted","path":"/tmp/storage-cleanup-hH9VRi/worktrees/feature","projectPath":"/tmp/cleanup-repo-mi8XWj","threadId":"thread-1","threadTitle":"Thread","bytes":12288,"files":null}],"counts":{"removed":1,"kept":0,"failed":0},"bytesFreed":12288,"omittedCount":0},"exists":false}}
 ✓ ../../../../../../tmp/lead-26038-r1/evidence-capture/harness-after/evidence.test.ts > deleted thread worktrees > evidence H02 changed child measurement-ownership 233ms
 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%)
```
