Repository navigation
Description
Summary
Add production-grade daemon operations features on top of the already-landed daemon/status substrate: tiered health, backup/portability, notifications, CI-facing checks, and scheduled maintenance.
Prior comments supersede the older broad body: WAL checkpointing, pidfile/single-instance locking, typed DaemonStatus, and FTS startup readiness already exist.
Remaining scope
Tiered health
Extend DaemonStatus with typed health checks and alert severity:
- fast checks: daemon heartbeat, disk/WAL size, source availability;
- medium checks: FTS readiness, insight freshness, stale live attempts, repeated stage failures;
- expensive checks: blob integrity, embedding coverage, deeper DB integrity.
Represent alerts with a typed model such as HealthAlert(check_name, severity, message, checked_at, consecutive_failures).
Production failure visibility
Use concrete 2026-05-06 evidence as design cases:
- DB locked writer contention;
- embed-stage event-loop failures;
- insight rebuild failures;
- slow vs stuck convergence/backlog;
- inactive-by-design vs unexpectedly stopped daemon state.
Backup and portability
Define practical local-first backup/export surfaces:
- SQLite/WAL backup guidance or Litestream integration;
- blob store backup guidance or restic integration;
- portable archive export if it fits the storage model.
Notifications and maintenance
Notifications should be config-driven (#829) and initially cover health alerts, budget/cost thresholds, schema staleness, and session-complete/hook events where #802 supplies data.
Scheduled maintenance should distinguish daemon-owned fast tasks from systemd/cron-heavy tasks.
Non-goals
- Do not keep or revive
polylogue-run.service/ publicpolylogue runas an operations model. - Do not implement config here; feat(config): unified config system — polylogue.toml, four-layer precedence, shared daemon/CLI config #829 owns config shape.
- Do not duplicate daemon convergence logic; refactor(daemon): replace polylogue run with performant convergence #845 owns workload shape and write convergence.
Dependencies
- refactor(daemon): replace polylogue run with performant convergence #845 for daemon convergence/status fields.
- feat(config): unified config system — polylogue.toml, four-layer precedence, shared daemon/CLI config #829 for thresholds, notification routes, and backup settings.
- feat(daemon): post-ingest embedding task — voyage-4 integration, cost tracking, status surface #828 for embedding coverage/cost once daemon embeddings exist.
- feat(acquisition): Claude Code + Codex hook integration for 100% session data coverage #802 for hook/session-complete notification inputs.
Acceptance criteria
- Health checks are grouped by cost/frequency and expose severity/escalation.
- Status/MCP/CLI can report slow, stuck, disabled, and failing convergence distinctly.
- Recent stage/source/path/error-class failures are bounded and structured.
- Backup/portable export plan is implemented or split into focused child issues with exact storage boundaries.
- Notifications are config-driven and have at least one tested backend or explicit dry-run surface.
- CI-facing health/check command has deterministic exit behavior.
- Docs explain daemon-owned vs systemd/cron-owned maintenance tasks.
Activity
Sinity commentedon May 4, 2026
Related: #717 (daemon owns health monitoring — status API is the contract), #829 (config system provides thresholds and notification rules), #828 (embedding task is a post-ingest daemon job).
Sinity commentedon May 4, 2026
Status update (2026-05-04)
Several items in this issue are already implemented in the running daemon:
Already done:
_periodic_wal_checkpoint()runs every 5 minutes (cli.py:110-128)_verify_pidfile()+_acquire_pidfile()via fcntl.flock (cli.py:39-60, 157-171)daemon_status_payload()exists in daemon/status.py_ensure_fts_startup_readiness()runs on daemon start (cli.py:63-107)Still needed from this issue:
polylogue backupor export-all commandThe daemon is operational; these are the production-grade hardening items.
Sinity commentedon May 6, 2026
Production evidence to feed daemon health/status design
The 2026-05-06 system update surfaced concrete conditions that the daemon operations surface should report, not merely log.
Observed while
polylogued.servicewas active:Observed while the legacy Sinnix catch-up service was running:
polylogued.servicewas intentionally stopped by Sinnix refactor: drop config files and move runtime defaults into paths #56 to avoid concurrent writers.polylogue-run.servicecontinued processing large Codex ingest for 20+ minutes.Ingesting (901/3,752 raw...)and slow batch/write timings.#845 owns replacing the legacy
polylogue runservice with daemon convergence. This issue should own the operations-facing part of that experience.Suggested health/status requirements:
asyncio.run()in a running loop.Sinity commentedon May 6, 2026
Backlog hygiene note after #845/#847 production evidence
This issue is still useful, but the body is now broader than the remaining actionable scope.
Already implemented or no longer the center of this issue, per prior comments:
DaemonStatusmodel and status payload.Remaining operational scope should be interpreted as:
Do not use this issue as a reason to keep
polylogue-run.serviceorpolylogue run; those are part of the migration away from the legacy batch model.[-]feat(daemon): operations surface — health monitoring, backup, notifications, CI integration[/-][+]feat(daemon): add tiered health, backup, alerts, maintenance[/+]Sinity commentedon May 6, 2026
Execution supplement
Mass-execution wave: #852 Wave 2 after #829 and coordinated with #845/#844 status fields.
Focused verification:
devtools verify --quick, then fulldevtools verifybefore PR.Keep this issue operational; embedding work stays in #828 and raw failure taxonomy stays in #844.
Sinity commentedon May 7, 2026
Gap-audit adjacent operations issues
New issues now split adjacent responsibilities:
Interpretation for #830: keep this issue on tiered health, backup, alerts, and maintenance visibility. It should expose the status/alert vocabulary that #871/#869 consume, but not become the whole planner/onboarding/security/performance issue.
Refs #871 #869 #868 #872 #852.
feat(daemon): add tiered health checks, backup command, and notificat…
fix: resolve mypy errors from agent PR merges
fix: close scope gaps — FTS/quarantine tests, health check wiring (#882/
10 remaining items
feat(daemon): tiered health and config-driven notifications (#920)
fix(mcp,daemon): param parity, embedding test, health probe (#924)
feat(daemon): tiered health, backup command, notifications (#898)
fix(daemon,mcp,rendering): tag types, status format, payload imports
fix(daemon): break circular import between status and health
fix(types,daemon,mcp): mypy and ruff repair after agent-PR wave
fix(daemon,test): regression tests and health-check loop wiring (#903)
fix(daemon): use a set for health check tier set
feat(daemon): tiered health and config-driven notifications (#920)
fix(mcp,daemon): param parity, embedding test, health probe (#924)
Sinity commentedon May 9, 2026
Tracker filed at #999 — health-check tests, non-log notification backends, and restore-roundtrip backup tests carried forward.
feat(onboarding): autodetect chat sources and first-run setup (#869) (#…
test(daemon): per-tier health check failure and recovery (#1146) (#1151)
feat(daemon): webhook notifications for health alerts (#1150) (#1159)
feat(daemon): notification backends — webhook/journald/email/Apprise (#…