Repository navigation
feat(daemon): expose a passive host disk diagnostic - #177
Merged
ChesterRa merged 1 commit intoOct 23, 2026
Merged
Conversation
Contributor
Author
|
CI note: on current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows the narrower direction requested on #167: one passive diagnostic
for the volume containing
CCCC_HOME, independent of Group notice ticks.ping.diagnostics.diskexposes the cached free/total capacity, sample times,attempt count and sampling error. No Mail, foreman notice, ledger event or
notification policy is added.
How we built it. The daemon starts one host sampler after acquiring its
exclusive home lock. It samples immediately and every 60 seconds, skips missed
intervals, uses a blocking worker for the filesystem probe, and ends with the
daemon. Status requests only clone the cached result. There is no disk cache
file. An in-flight
statvfscall cannot be cancelled: the sampler bounds itsasync shutdown wait to 500 ms, but Tokio runtime shutdown can still wait for a
stalled filesystem call. This does not promise bounded daemon shutdown.
The production
inbox::notices::NoticeStateandinbox::projection::duepaths are unchanged; no legacy reducer is extended.The diagnostic enters
lowbelow 3 GiB available and recovers at or above4 GiB, with both thresholds exposed in the result. The recovery margin avoids
flapping near the low boundary. These are observations, not write-admission
rules. Failed sampling reports
unavailableand keeps the last successfulsample/time and previous hysteresis state; only a later successful sample can
establish recovery.
unknowndistinguishes the initial unsampled state.How we tested it. Policy cases replay the original filesystem counts
from three captured Linux
statvfssamples; the fixture preserves theircapture timestamps, but the policy tests do not replay those timestamps.
Filesystem paths are redacted; no capacity samples are generated and no
large files are allocated.
The cases cover low entry, the recovery band, healthy recovery, exact boundaries
placed at captured values, and a real failed probe preserving low state. A
small real-filesystem test samples a temporary directory and a missing path,
with no free-space floor. Service cases prove an independent cadence without
Groups or notice ticks, cached reads, home scoping and shutdown cleanup.
Two black-box checks start an isolated actual daemon, read its public IPC,
verify sampling without any Group and verify repeated status polls do not
resample. Their cleanup stops only their own test daemon. The tests-only stock
reference contains these same two checks without any runtime change. Its exact
missing-feature result must be two failures, with compile/setup failures
rejected as negative evidence. The six policy/probe/service cases are tested
on the candidate; they are not claimed as executable against stock APIs.
The check merge
71d8739b899c31a77bd840d52c4c92f6527583c0combines thisfeature with #175's test-profile correction. An independently reconstructed
tree matches the check merge exactly: all nine implementation, test, fixture
and documentation files match feature
33798b21, and only the nextestconfiguration differs. The original paired evidence remains bound to its
actual feature and stock source pins.
Six-job check CI is green at that exact merge head: 2,726 workspace tests
pass, with zero failures and 60 skipped. All six new unit cases pass, both
actual-daemon cases pass in the serial suite, and formatting, workspace clippy,
native-session verification and Windows smoke pass. Counterexample review found no blocking issue. Upstream posting remains held
until #175 merges and the PR's own CI is green.
Tested on: GitHub-hosted
ubuntu-26.04(x86_64 Linux), Rust 1.88.0,on the fork. Windows smoke passes at check
71d8739b.