From 1dac614c028105709b09ddc1e470ee9547af2b90 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 15 Nov 2026 16:08:52 -0800 Subject: [PATCH] Prepare idle-only Foundry migration to non-root boot services --- docs/foundry-boot-services.md | 13 +++ scripts/foundry_boot_services.py | 160 ++++++++++++++++++++++++++++ tests/test_foundry_boot_services.py | 48 +++++++++ 3 files changed, 221 insertions(+) create mode 100644 docs/foundry-boot-services.md create mode 100644 scripts/foundry_boot_services.py create mode 100644 tests/test_foundry_boot_services.py diff --git a/docs/foundry-boot-services.md b/docs/foundry-boot-services.md new file mode 100644 index 0000000..fad7bfd --- /dev/null +++ b/docs/foundry-boot-services.md @@ -0,0 +1,13 @@ +# Foundry boot services + +Requested 2026-11-15; tracked in issue #72. This host-specific migration moves the existing Ollama, Forge controller and Curator LaunchAgents to system LaunchDaemons. Services continue to run as the existing non-root account, with explicit HOME/USER/LOGNAME and unchanged executables, state, ports, environment and credentials. Curator reports boot startup when its managed service receives CURATOR_SERVICE_STARTUP=boot. + +Run `python3 scripts/foundry_boot_services.py` for a read-only plan. Once reviewed, run `sudo /usr/bin/python3 scripts/foundry_boot_services.py --apply` on Foundry. The script requires idle Curator and no unfinished Forge jobs, stops login services before installing boot services, removes the original login definitions only after saving them, checks Curator/Forge/Ollama readiness, and automatically restores login services if installation fails. It does not reboot or start any processing queue. + +Private rollback definitions are retained under `/Library/Application Support/FoundryServiceMigration/`. Use `sudo /usr/bin/python3 scripts/foundry_boot_services.py --rollback ""` while the original user's GUI session exists. Changed definitions are preserved for inspection rather than overwritten. Do not reinstall the old login services while boot services are active. Existing Forge `mac_services.py` start/stop/status commands address the GUI domain; use `sudo launchctl print system/