feat: Linux support — graceful automation skip on non-macOS (fixes #31)#51
Open
YasienDwieb wants to merge 1 commit into
Open
feat: Linux support — graceful automation skip on non-macOS (fixes #31)#51YasienDwieb wants to merge 1 commit into
YasienDwieb wants to merge 1 commit into
Conversation
Select the scheduler adapter at the composition root: launchd on macOS, a no-op UnsupportedSchedulerAdapter elsewhere. setup/config no longer crash on launchctl off macOS; render reports scheduling unavailable from the adapter's actual outcome via a new AutomationTaskApplyResult.scheduled field.
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.
Fixes #31.
Problem
codealmanac setup --yes(andconfig set automation.*) crash on Linux:create_appunconditionally wiresAutomationServicewithLaunchdSchedulerAdapter, which shells out to macOSlaunchctl. The crash also left a half-configured global state (config.tomlwritten before the scheduler failed).Approach — Option A: graceful skip, not a rewrite
Every lifecycle/read command is already platform-neutral; the only macOS blocker is scheduled automation, and
SchedulerAdapteris already a port. So:UnsupportedSchedulerAdapter— a no-op implementation of the existingSchedulerAdapterport (no subprocess, no~/Library/LaunchAgentswrites; reports "not installed").core/platform.scheduler_supported()— single platform predicate.create_appselects launchd on macOS, the unsupported adapter elsewhere. Platform detection lives only at the composition root.AutomationTaskApplyResultgains ascheduledfield set from the adapter's real result (install().installed). Setup output now says "Scheduled automation unavailable" with a "runsync/gardenmanually" pointer instead of falsely claiming schedules were installed. Render stays free ofsys.platformchecks.Because nothing fails on the unsupported path, the half-configured-state bug is gone as a side effect —
setupcompletes and exits 0.Real Linux scheduling (systemd user timers) is deliberately left as a follow-up (Option B); this PR unblocks all Linux usage today.
Verification
uv run ruff check .clean; 570 tests pass (6 new intests/test_linux_support.py, platform forced viasys.platformso they're host-independent).config set automation.sync.enabled true) exits 0,automation statusworks, no launchd artifacts created.install().installedisTrue, so every existing render branch is taken as before.A design writeup is in
docs/plans/2026-07-24-linux-support-option-a.md.