Repository navigation
Diagnostics: heed.log, a heartbeat, and a run journal for lost runs - #316
Merged
Merged
Conversation
…the last run was lost Heed has been quitting while left alone with no crash report and nothing of its own to read. It now keeps heed.log (launch, quit, sleep and wake, memory pressure, signals, a heartbeat each minute with its memory and what the domain store wrote and for which kinds of change), a run.json the next launch reads to tell a lost run from a clean quit, and the MetricKit diagnostics macOS hands over. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Mpdreamz
force-pushed
the
feature/has-quit-unexpectedly-bunch
branch
from
November 22, 2026 15:21
b20a3be to
103fcea
Compare
…fe), so lint passes Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Mpdreamz
added a commit
that referenced
this pull request
Nov 22, 2026
…conds apart (#317) macOS flagged Heed three times (Nov 19 twice, Nov 21) for excessive disk writes: `DomainStore.flush()` rewriting the ~3 MB `domain.json` at 650 KB/s to 1.3 MB/s for 30 to 55 minutes while idle. - `apply` schedules a write only when the domain actually changed. - Writes are at least `minimumInterval` (5 s) apart. A hard crash can lose the last few seconds of the cache; `flushAll` on quit still writes at once. This caps the rate whatever feeds it. If a timer commits real changes (a changing timestamp, say), the cause is still there; #316's heartbeat logs which change kinds reach the store, so it can be found. Tests: unchanged apply writes nothing, a real change is written, writes wait out the interval, `flushAll` ignores it. I broke the unchanged check and the spacing on purpose and each made a test fail. Full suite and lint pass. Separate from #316 (diagnostics), per the correctness/behaviour split. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Heed has been quitting after being left alone, with no crash report, jetsam entry or log of its own. This adds what is needed to see the next one.
heed.log(rolls at 512 KB, mirrored to the unified log, subsystembuild.heed.app): launch, quit and its reason, sleep/wake, screens, session switch, thermal state, memory pressure, SIGTERM/SIGHUP/SIGINT/SIGQUIT (logged, then re-raised so the exit is unchanged).DomainStorewrote (writes, MB, the five most frequent change kinds), which names whatever keeps rewritingdomain.jsonwhile idle.run.json: marked clean on a quit; a launch that finds it unclean logs when the last run was last alive, its size, and whether the Mac restarted in between.diagnostics/.Tests: journal/lost-run wording, log rollover, store stats (mutated each to confirm they fail). Full suite and lint pass. Not run live: I did not launch a second Heed beside the running one, so the signal and MetricKit paths are untested outside the build.
The write-churn fix is a separate PR.
🤖 Generated with Claude Code