feat: daemon decision journal for introspection (TODO-003)#2
Merged
Conversation
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.
Summary
${VIGIL_RUNTIME_DIR}/daemon.log(src/journal.rs): one JSON line per decision change (active, want_hold, battery_capped, hold_since, on_ac, charge, wake reason, pid), a 60s heartbeat so a quiet daemon is distinguishable from a wedged one, and start/exit lines so exit reasons (idle, disabled, self-upgrade) survive the daemon.vigil statusreads the newest entry and reports the daemon's own last decision with the hold/release reason, plus a staleness verdict (wedged vs gone vs cleanly exited).Test plan
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test(28 tests) green locallyVIGIL_RUNTIME_DIR: idle lifecycle (start/decision/exit-idle), hold cycle with a live pid (holding decision with hold_since, reactive release on process death with wake=process-exit), mid-holdvigil statusrendering, and the disabled exit reason