Summary
The Reaper's LiveDaemonPID wiring in startEnginePlane
(internal/daemon/engineplane.go) is load-bearing but has no test coverage.
Because the sweep is fail-closed (#5933), deleting that line silently disables
orphan-watcher reaping forever — no error, no log, no failing test.
Mutation evidence
Delete the LiveDaemonPID: line from the ReaperConfig literal in
startEnginePlane, then:
go build ./... -> OK
go test ./internal/daemon/ -run 'Split|Engine|Serve|Reaper|Watch' -count=1 -> ok
Fully green with the wiring removed. Reproduced independently twice (by the
adversarial reviewer and by the implementer).
Why it could not be covered in #5933
startEnginePlane / RunEngine have no direct test coverage; the only harness
that reaches them is the full daemon.Run path in phaseb_test.go.
Reaper.Start has a hardcoded ~30s startup delay before its first sweep, and a
5-minute sweep interval.
ReaperConfig.Interval is never set by engineplane.go, so the interval is not
test-injectable.
Any real end-to-end assertion would therefore take 30s+ — out of scope for a
bounded fix, and it would land as a slow test in the default suite.
What #5933 does and does not cover
TestReaper_sweepWatchers_LiveDaemonPIDFromPidfile enforces the reaper/watchreg
contract using the exact closure shape engineplane.go wires (real pidfile,
real ReadPIDFile parse path, match-survives / mismatch-reaped). It does not
detect removal of the wiring line itself, because it constructs its own
ReaperConfig rather than going through startEnginePlane.
Suggested fix
- Make
ReaperConfig.Interval (and ideally the startup delay) test-injectable,
and have engineplane.go pass an explicit value.
- Add a
RunEngine/startEnginePlane-level test asserting the constructed
Reaper resolves LiveDaemonPID from the daemon pidfile — gated opt-in like the
existing GRAFEL_FSNOTIFY_TESTS pattern if it remains slow.
Alternatively, a cheap structural guard: have startEnginePlane fail loudly (or
log Warn at startup) if it ever builds a watcher-reaping ReaperConfig with a nil
LiveDaemonPID, converting a silent permanent degradation into an observable one.
Related
Summary
The Reaper's
LiveDaemonPIDwiring instartEnginePlane(
internal/daemon/engineplane.go) is load-bearing but has no test coverage.Because the sweep is fail-closed (#5933), deleting that line silently disables
orphan-watcher reaping forever — no error, no log, no failing test.
Mutation evidence
Delete the
LiveDaemonPID:line from theReaperConfigliteral instartEnginePlane, then:Fully green with the wiring removed. Reproduced independently twice (by the
adversarial reviewer and by the implementer).
Why it could not be covered in #5933
startEnginePlane/RunEnginehave no direct test coverage; the only harnessthat reaches them is the full
daemon.Runpath inphaseb_test.go.Reaper.Starthas a hardcoded ~30s startup delay before its first sweep, and a5-minute sweep interval.
ReaperConfig.Intervalis never set byengineplane.go, so the interval is nottest-injectable.
Any real end-to-end assertion would therefore take 30s+ — out of scope for a
bounded fix, and it would land as a slow test in the default suite.
What #5933 does and does not cover
TestReaper_sweepWatchers_LiveDaemonPIDFromPidfileenforces the reaper/watchregcontract using the exact closure shape
engineplane.gowires (real pidfile,real
ReadPIDFileparse path, match-survives / mismatch-reaped). It does notdetect removal of the wiring line itself, because it constructs its own
ReaperConfigrather than going throughstartEnginePlane.Suggested fix
ReaperConfig.Interval(and ideally the startup delay) test-injectable,and have
engineplane.gopass an explicit value.RunEngine/startEnginePlane-level test asserting the constructedReaper resolves
LiveDaemonPIDfrom the daemon pidfile — gated opt-in like theexisting
GRAFEL_FSNOTIFY_TESTSpattern if it remains slow.Alternatively, a cheap structural guard: have
startEnginePlanefail loudly (orlog Warn at startup) if it ever builds a watcher-reaping
ReaperConfigwith a nilLiveDaemonPID, converting a silent permanent degradation into an observable one.Related