fix: await owned daemon retirement on request timeout

Closed
TH
2mo ago
+362-254

Summary

A local request timeout could remove daemon metadata before its daemon exited. Socket and HTTP timeouts now await the same ownership-checked retirement operation before reporting reset. Unconfirmed exit retains state and is included in the primary timeout error.

Removes the client’s raw metadata-removal and takeover-stop exports. Read-only command policies, remote behavior, Apple runner pattern bytes and request fallback rules stay intact. Health probes reserve time for a fallback and count requester loading and response completion within their budget.

Depends on #3130. Ref #3116. Eight files, 616 gross changed lines; production: 107 additions/143 deletions. The final enforcement commit acknowledges one implementation-only health-reader change, with no RPC payload or protocol-version change.

Validation

Tested 2afb5ec51ab198cc380f6db6a2c6d88d44965241:

  • 61 focused tests, including actual socket/HTTP requests and owned children; zero skips.
  • Removing the await fails both force-retirement controls. Removing fallback reservation or loader accounting each fails its control.
  • Remaining retirement-owner tests catch premature unlink: 31 passes → 3 failures/28 passes. Obsolete wrapper tests and seams were removed together.
  • 42 wire compatibility/closure/mutation controls pass.
  • pnpm check:quick, Fallow, and pnpm check:affected --base fix/daemon-startup-contention --run pass; 925 related tests.
  • Independent read-only review: no findings. CI-owned coverage, provider and device evidence remains pending.