Context
/watch is currently REPL-session-local: each watch runs as an in-process asyncio task and dies when the REPL exits. The sqlite watches table already persists watch registrations, but there is no restart recovery or daemon control surface.
This issue tracks turning watch registrations into a persistent local daemon flow while keeping the existing CLI/REPL UX simple.
Scope
Add a persistent daemon mode for registered watches:
- Restart recovery from the sqlite
watches table.
- A one-shot daemon runner suitable for
systemd, launchd, tmux, or a user-managed shell.
- Control surface from REPL/one-shot CLI to list, add, remove, and inspect watch state.
- Clear status fields for active/paused/error watches.
- Safe shutdown that does not corrupt sqlite or leave in-flight ticks writing after close.
Constraints
- Keep all state local in
~/.insto/store.db.
- Do not introduce a network service, HTTP API, telemetry, or phone-home.
- Keep the 5-minute interval floor unless tests explicitly lower it.
- Keep HikerAPI/account cost and rate-limit risk visible.
- Unit tests must not require live Instagram.
Initial implementation target
Start with the smallest shippable slice:
insto watch-daemon run or equivalent daemon entrypoint.
- Load persisted
watches rows and tick them with the existing facade/watch logic.
- Update
last_ok, last_error, and status in sqlite.
- Document how to run it manually; platform service files can come later.
Acceptance criteria
- Existing
/watch, /unwatch, /watching, /diff, and /history behavior stays compatible.
- Daemon mode resumes persisted watches after process restart.
- Tests cover daemon loading, one tick, error state update, and shutdown.
- Docs explain manual daemon usage and limitations.
Context
/watchis currently REPL-session-local: each watch runs as an in-process asyncio task and dies when the REPL exits. The sqlitewatchestable already persists watch registrations, but there is no restart recovery or daemon control surface.This issue tracks turning watch registrations into a persistent local daemon flow while keeping the existing CLI/REPL UX simple.
Scope
Add a persistent daemon mode for registered watches:
watchestable.systemd,launchd,tmux, or a user-managed shell.Constraints
~/.insto/store.db.Initial implementation target
Start with the smallest shippable slice:
insto watch-daemon runor equivalent daemon entrypoint.watchesrows and tick them with the existing facade/watch logic.last_ok,last_error, andstatusin sqlite.Acceptance criteria
/watch,/unwatch,/watching,/diff, and/historybehavior stays compatible.