fix: a deliberate no-op exits 0, not 1 - #12
Merged
Conversation
macarchy-auto-appearance and macarchy-bar-contrast each detected that their
precondition was absent, said so, correctly declined to act -- and then returned
1. Both are timer-driven oneshots, so that parked them in `systemctl --user
--failed` for ever and fired their OnFailure= notifier, on every machine with no
coordinates set or no compositor installed. macarchy-install#9 carries the
journals; they were two of the three units that had been failing there.
This is not a CI artifact. Boot a real laptop before grim is installed, or
before coordinates are set, and the same two units go permanently failed.
auto-appearance: "macarchy-sun could not compute today's sun; theme left alone"
is a decision, and the script ALREADY uses exit 0 for the sibling decision two
screens down ("user chose something else; leave it alone"). The sun case now
matches its own convention. A genuine failure still reds: the final
`exec omarchy theme set` propagates that command's status.
bar-contrast: a missing capture tool and an absent bar layer both mean there is
nothing on screen to sample. A grim that EXISTS and then breaks, or a sample
that comes back malformed, still exits 1 -- that side is unchanged and still
pinned by the "bad sample exits 1" case.
Three test cases asserted the old behaviour and are updated with the reasoning,
because they encoded the bug: the invariant they defend is "it must not GUESS a
theme", which is the `does not switch` assertion beside each of them, and that
one is untouched. The error stays legible where an error belongs -- `status`
still reports `error=sun`, and both messages still reach the journal.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SYBhT1xfp3MQ1w3687F4Mp
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.
The bug
macarchy-auto-appearanceandmacarchy-bar-contrasteach detect that their precondition is absent, say so, correctly decline to act — and then return1.Both are timer-driven oneshots, so a non-zero exit parks them in
systemctl --user --failedfor ever and fires theirOnFailure=notifier. They were two of the three units failing in macarchy/macarchy-install#9 — the journals are in that issue, printed by the dump that PR added.Not a CI artifact. Boot a real laptop before
grimis installed, or before coordinates are set, and the same two units go permanently failed.The fix
auto-appearance— "theme left alone" is a decision. And the script already usesexit 0for the sibling decision two screens down:The sun case now matches its own convention. A genuine failure still reds: the final
exec omarchy theme set "$want_theme"propagates that command's status.bar-contrast— a missing capture tool and an absent bar layer both mean there is nothing on screen to sample. Agrimthat exists and then breaks, or a sample that comes back malformed, still exits 1 — unchanged, and still pinned by the existingbad sample exits 1case.About the three tests I changed
They asserted the old behaviour, so they encoded the bug. Worth being explicit, since changing a test to match code is usually the wrong move:
The invariant those cases defend is "it must not GUESS a theme" — that is the
does not switchassertion sitting beside each of them, and it is untouched. Only the exit-code half moved, and all three inputs (FAKE_SUN_FAIL,'not json','{"state":""}') reach the same "no answer, changed nothing" branch, so they move together.The error stays legible where an error belongs:
statusstill reportserror=sun, and both messages still reach the journal.Test
tests/test_auto_appearance.sh·tests/test_bar_contrast.sh— including a new case that a missing capture tool is a skip and leaves the config untouched. Full suite: 3 shell suites pass, 14 pytest cases pass,bash -nclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01SYBhT1xfp3MQ1w3687F4Mp