Skip to content

feat(daemon): unified DaemonStatus model consumed by all surfaces #774

Closed

Description

@Sinity

Problem

From the convergence architecture spec: daemon status should be a typed model computed from durable component state plus recent event facts, not ad hoc live checks. One DaemonStatus consumed by CLI status, TUI dashboard, web status strip, browser-extension popup, polylogue-mcp, and health probes.

Current gaps (deep audit 2026-05-03)

The current daemon_status_payload() in daemon/status.py is a thin wrapper with significant gaps:

  • No daemon liveness check — status never reads the pidfile, never verifies the daemon process is actually running. Will report "ok": True regardless of whether the daemon is alive.
  • last_ingestion_batch always None — get_last_ingestion_batch() queries for kind="ingestion_batch" events, but no code ever emits them. emit_daemon_event is only called from the reset endpoint (http.py:439).
  • get_recent_operations() queries for never-emitted events — kind="operation" events are never emitted.
  • Rich readiness diagnostics collapsed — ReadinessReport.to_dict() produces per-check structured output, but the health endpoint collapses it to {"ok": bool, "quick_check": "N check(s) in error state"}.
  • 10 modules bypass structlog — use logging.getLogger(__name__) instead of get_logger(__name__), so daemon log output isn't structured.
  • configure_logging() never called at daemon startup — daemon runs with structlog defaults.

Fields

Daemon liveness, component state, source lag, failing/excluded files, current operations, reset queue, ingestion throughput, slow batches, DB/WAL/blob sizes, reclaimable blob bytes, disk free, quick-check status, FTS/action-event readiness, insight freshness, browser capture status, privacy-safe paths.

This replaces doctor as read-only diagnostics (#717 says status replaces doctor).

Acceptance criteria

  • DaemonStatus is a typed Pydantic model
  • All surfaces consume the same model (CLI, TUI, web, extension, MCP)
  • Status includes daemon liveness (reads pidfile + verifies process)
  • last_ingestion_batch populated by emitting events from the ingest pipeline
  • emit_daemon_event called for ingestion batches and operations
  • Health endpoint exposes full structured readiness report, not just boolean
  • Logging configured at daemon startup; all daemon modules use structlog

Ref: deep audit C2, P3-7, 14. Ref #717, #771.

Activity

  1. Sinity commented on May 3, 2026

    @Sinity
    OwnerAuthor

    Concrete acceptance criteria from the architecture spec

    • One typed Pydantic DaemonStatus model (not ad hoc JSON assembly)
    • Fields: daemon liveness, component state, source lag, failing/excluded files, current operations, reset queue, ingestion throughput, slow batches, DB/WAL/blob sizes, reclaimable blob bytes, disk free, quick-check status, FTS/action-event readiness, insight freshness, browser capture status, privacy-safe paths
    • Consumed by: CLI polylogue status, TUI dashboard, web status strip, browser-extension popup, polylogue-mcp, health probes
    • Replaces polylogue doctor as read-only diagnostics (feat(surfaces): implement polylogued local reader and query-native CLI UX #717 says status replaces doctor)
  2. Sinity commented on May 4, 2026

    @Sinity
    OwnerAuthor

    Resolved by PRs #792 (typed DaemonStatus Pydantic model), #797 (ingestion_batch events emitted from pipeline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions