feat(v0.6): route lease-freshness callsites through IsStale

InspectLease, CleanupStaleLease, runActiveLeaseCheck, and statusAt now
use the PID-aware IsStale predicate. A dead local owner PID makes a lease
stale immediately; SessionStatus / list / info reflect this with no
display-code change.

Corrects three cmd-package session-display test fixtures that built
"active" leases with the local hostname but synthetic PIDs — now that
freshness is PID-aware, an active session must be owned by a live
process, so the fixtures use os.Getpid().
This commit is contained in:
2026-05-15 14:29:50 -04:00
parent f379a6d059
commit d575ddd0f5
7 changed files with 70 additions and 10 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func statusAt(wsDir string, now time.Time) Status {
}
state := SessionStateStale
if IsFresh(&l, now, StaleLeaseAfter) {
if !IsStale(&l, now, StaleLeaseAfter) {
state = SessionStateActive
}