From 6499e173909583d053cf019bd1ab75f6c459f1ad Mon Sep 17 00:00:00 2001 From: egregore Date: Mon, 2 Feb 2026 19:58:25 +0000 Subject: [PATCH] Add README documentation Documents service purpose, endpoints, cron format, and configuration. Co-Authored-By: Claude Opus 4.5 --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..757bc87 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# Schedule Service + +Task scheduler for Egregore. + +## Purpose + +Cron-like scheduler that triggers AI tasks on a schedule. Wakes the reason service at configured times to perform automated work. + +## Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/schedules` | GET/POST | List or create schedules | +| `/schedules/{id}` | GET/PATCH/DELETE | Manage a schedule | +| `/schedules/{id}/run` | POST | Manually trigger a schedule | +| `/schedules/{id}/history` | GET | View execution history | +| `/health` | GET | Health check | + +## Configuration + +Schedules stored in `~/data/schedules/`. + +Each schedule has: +- `name` - Descriptive name +- `cron` - Cron expression (e.g., `0 9 * * *`) +- `instruction` - What to tell the reason service +- `enabled` - Active flag + +## Running + +```bash +# Activate venv +source ~/.venv/bin/activate + +# Run directly +python main.py + +# Or via systemd +sudo systemctl start schedule +sudo systemctl status schedule +``` + +## Cron Format + +Standard 5-field cron: `minute hour day month weekday` + +Examples: +- `0 9 * * *` - Daily at 9am +- `*/15 * * * *` - Every 15 minutes +- `0 0 * * 0` - Weekly on Sunday midnight + +## Dependencies + +- FastAPI +- APScheduler (cron scheduling) +- httpx (to call reason service)