Problem
The daemon-client timeout reset path in src/daemon-client/daemon-client-timeout.ts (resetDaemonState, around line 191) unlinks daemon.json and daemon.lock without proving that this client's daemon is the process those files describe. It is the client-side twin of #3087: a client giving up on a slow daemon deletes the metadata of a daemon that is alive and simply busy, or of a successor that took over meanwhile.
Direction
Route the cleanup through the same fence the daemon uses — readRegisteredDaemonOwnership for the info file, and the existing liveness proof for the lock — and decline with a typed reason instead of unlinking. Client cleanup is what makes an absent record normal for the daemon at exit, so this path must stay fail-closed rather than simply deleting less.
Refs #3087, #3102
Problem
The daemon-client timeout reset path in
src/daemon-client/daemon-client-timeout.ts(resetDaemonState, around line 191) unlinksdaemon.jsonanddaemon.lockwithout proving that this client's daemon is the process those files describe. It is the client-side twin of #3087: a client giving up on a slow daemon deletes the metadata of a daemon that is alive and simply busy, or of a successor that took over meanwhile.Direction
Route the cleanup through the same fence the daemon uses —
readRegisteredDaemonOwnershipfor the info file, and the existing liveness proof for the lock — and decline with a typed reason instead of unlinking. Client cleanup is what makes anabsentrecord normal for the daemon at exit, so this path must stay fail-closed rather than simply deleting less.Refs #3087, #3102