Run scanner as a launchd service; ARB_NO_POLLER guard

The local server kept dying because it ran as a background/agent process under
~/Desktop (a macOS TCC-protected folder): once the launching session ended the
orphaned process lost Desktop access and every file read hit PermissionError.
Permanent fix lives outside git -- the project now sits at
~/prediction-market-arb (not TCC-protected) and runs via a login LaunchAgent
(RunAtLoad + KeepAlive: starts at login, restarts on crash, survives reboot).

Code side: server.py honors ARB_NO_POLLER=1 to skip the local SMS poller (the
LaunchAgent sets it) so the always-on server doesn't double-text alongside the
GitHub Actions alerter; gitignore the service's *.log.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Casey Judice
2026-06-03 17:55:00 -04:00
parent 9b66b28eae
commit 5b1e68c580
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -14,6 +14,9 @@ __pycache__/
# pairs.json backup written by scripts/roll_month.py on every roll
*.bak
# server log (LaunchAgent / manual run)
*.log
# Local Claude Code config (launch.json, settings.local.json, worktrees, etc.)
.claude/
+4 -1
View File
@@ -125,7 +125,10 @@ def main():
print("Arb scanner running -> http://127.0.0.1:%d" % port)
print("Press Ctrl+C to stop.")
from arb import alerts
alerts.start_poller()
if os.environ.get("ARB_NO_POLLER") == "1":
print("ARB_NO_POLLER=1 -> local SMS poller off (GitHub Actions alerts).")
else:
alerts.start_poller()
try:
srv.serve_forever()
except KeyboardInterrupt: