fix: centralize daemon startup ownership and retirement

Merged
TH
2mo ago
+3600-1563

Summary

Centralize daemon registration, startup ownership and retirement. Replace the bespoke lock with process-lock exclusion; signal only a proven process lifetime and remove metadata/private state after confirmed exit and protected registration checks.

A monitored child can recover a missed birth probe from matching held-lock/registration records. Recovery and client observation share the identity predicate. Includes retained-guard diagnostics and legacy-concurrency policy. Consolidates six original layers across 41 files. Related to #3116.

Rebased onto the landed session stack at 052cba83c1. Repair markers keep scoped owner checks and clearing of owned expired markers, together with strict parser validation and fail-closed cleanup scanning. Per-call cancellation remains separate from awaited timeout retirement.

Validation

5b12609ef5: pnpm check:affected --run passed 6,579 related tests in 803 files, twelve documentation controls and selected tooling. All 96 focused controls pass. The new hanging restart-health probe control rejects a planted missing-abort-check mutation and proves zero timeout-retirement calls. Earlier birth-recovery regression proof remains at its original head. No quality baseline changed.

Fresh exact-head GitHub CI and review remain pending. User handles merges.