feat(doctor): catch a Touch Bar module that failed to load - #8
Merged
Conversation
A module that fails to load is the one macarchy breakage nothing reports. The daemon logs `module <id> failed to load: <exc>` once, then runs happily without that widget: the unit stays active, macarchy-doctor.service fires no toast, and the bar simply lacks a button. It is what a rename in macarchy-touchbar costs every OTHER repo that ships a module. Installed modules are COPIES, so the 2026-09-04 macarchy-dfr -> macarchy-touchbar rename left ~/.config/omarchy/plugins/macarchy.jarvis importing macarchy_dfr, and Jarvis was off the bar for an hour with every other check green. migrate_legacy cannot fix this one: jarvis is not in REPOS, and this script has no business reinstalling a repo it does not own. So the doctor reports it instead, by module id, from any repo, for every future rename. The daemon hot-reloads on the file change, so a failure can be repaired later in the same boot -- only the last word on each module counts, which is what case (b) of the new suite pins down. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SYBhT1xfp3MQ1w3687F4Mp
Contributor
Author
|
22 tasks
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.
Why
A Touch Bar module that fails to load is the one macarchy breakage nothing reports. The daemon logs
module <id> failed to load: <exc>once, then runs happily without that widget: the unit staysactive,macarchy-doctor.servicefires no toast, and the bar simply lacks a button.It is what a rename in
macarchy-touchbarcosts every other repo that ships a module. Installed modules are COPIES, so themacarchy-dfr→macarchy-touchbarrename left~/.config/omarchy/plugins/macarchy.jarvis/touchbar.pyimportingmacarchy_dfr:Jarvis was off the bar for an hour with every other check green.
Why not in
migrate_legacyThe obvious fix — re-run the owning repo's
install.shafter a migration — does not belong here.jarvisis not inREPOS; this script neither clones nor manages it, and reinstalling a repo it does not own would be an inverted dependency that still only covered Jarvis. The doctor reports it instead: by module id, from any repo, for every future rename.The subtle part
The daemon hot-reloads on the file change, so a failure can be repaired later in the same boot — only the last word on each module counts. Otherwise the doctor would still be crying about a module that came back at 23:30:05. That is case (b) of the new suite, and it is the assertion that matters.
Test
tests/test_doctor_touchbar_modules.sh, hermetic (temp HOME + PATH stubs,journalctlreplays a fixture):Full suite 3/3,
bash -nclean oninstall.sh/boot.sh/doctor.sh, and the real doctor on the affected laptop now printsok Touch Bar modules loaded.🤖 Generated with Claude Code
https://claude.ai/code/session_01SYBhT1xfp3MQ1w3687F4Mp