Skip to content

work-unit: control plane — shared status model and admin status surface #1414

Closed

Description

@strawgate

work-unit: control plane — shared status model and admin status surface

Purpose

Introduce the shared typed status model that the control plane will speak and use it to build the canonical rich admin status surface.

This is the first substrate execution slice under #1306: typed shared status objects, snapshot assembly, and /admin/v1/status payload shape. It is not a generic diagnostics catch-all.

Repo footprint

  • crates/logfwd-types/src/diagnostics.rs or adjacent status modules
  • crates/logfwd-io/src/diagnostics.rs
  • diagnostics serialization / endpoint tests
  • contract/doc touch-ups only if payload names must stay aligned with #1303

In scope

# Type Why included
#1306 architecture owns the shared status substrate and rich status surface
#1303 architecture payload semantics and vocabulary must match the control-plane contract
#1445 meta downstream dashboard/API cleanup depends on this typed status surface existing first

Related metas / phases

  • process/pipeline probe truth: #1413
  • input lifecycle status wiring: #1415
  • output lifecycle status wiring: #1416
  • temporary cleanup-wave coordination only: #1450

Non-goals

  • no /live or /ready phase-behavior ownership (that stays in #1413)
  • no pipeline transition extraction (that stays in #1440)
  • no input/output lifecycle wiring beyond what is needed to populate snapshot shape

Done when

  • typed shared status objects exist for process, pipeline, and component snapshots
  • /admin/v1/status is built from those shared types rather than ad hoc payload assembly
  • serialization and endpoint tests lock the payload structure in place
  • the implementation no longer depends on the older split represented by closed #1437

Activity

  1. added
    enhancementNew feature or request
    productionRequired for production readiness
    P2: mediumMinor bug, missing validation, metric inaccuracy
    work-unitScheduling ticket for one agent run
    architectureSystemic design improvements that eliminate classes of bugs
    on Apr 6, 2026
  2. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    tl;dr: Outcome A (Ready for implementation) — the codebase currently has no shared status snapshot types and no /admin/v1/status; this can be implemented mechanically by introducing shared status models in logfwd-types and wiring a typed admin status endpoint in logfwd-io.

    Recommendation

    Implement this issue now as a focused substrate slice:

    1. Add shared status snapshot types (state, reason, transition timestamp fields, readiness_impact) to logfwd-types.
    2. Add /admin/v1/status in diagnostics server and build payloads from shared types (not ad hoc format!).
    3. Keep /health and /ready for compatibility, but derive readiness status from the same snapshot model.
    4. Add serialization/endpoint tests that assert JSON structure (parsed JSON), not substring checks.
    Findings (evidence)
    • crates/logfwd-types/src/lib.rs:10-24 exports pipeline, diagnostics, etc., but no status module.
    • crates/logfwd-types/src/diagnostics.rs:10 defines pub struct ComponentStats (counters only), no shared status/state model.
    • crates/logfwd-io/src/diagnostics.rs:484-493 router exposes /health, /ready, /api/*; no /admin/v1/status.
    • crates/logfwd-io/src/diagnostics.rs:532-537 serve_health builds ad hoc JSON: {"status":"ok",...}.
    • crates/logfwd-io/src/diagnostics.rs:553-567 serve_ready returns only {"status":"ready|not_ready"}.
    • crates/logfwd-io/src/diagnostics.rs:913-1036 serve_pipelines builds large JSON via format!/string interpolation (not shared typed snapshots).
    • crates/logfwd-io/src/diagnostics.rs:1634-1666 ready endpoint tests assert body.contains(...) instead of schema.
    • Diagnostics runtime wiring entrypoint is crates/logfwd/src/main.rs:932-940 (DiagnosticsServer::new, add_pipeline, start).
    • User docs currently describe /health + /ready only:
      • book/src/config/reference.md:453-454
      • book/src/deployment/monitoring.md:14-15
      • book/src/troubleshooting.md:197-198
    Verification

    I validated current readiness behavior with existing tests (confirms current API shape before planning changes):

    $ cargo test -p logfwd-io diagnostics::tests::test_ready_endpoint_no_pipelines_returns_503 -- --nocapture
    running 1 test
    test diagnostics::tests::test_ready_endpoint_no_pipelines_returns_503 ... ok
    
    $ cargo test -p logfwd-io diagnostics::tests::test_ready_endpoint_with_pipeline_returns_200 -- --nocapture
    running 1 test
    test diagnostics::tests::test_ready_endpoint_with_pipeline_returns_200 ... ok
    
    Detailed Action Plan (mechanical)
    1. Add shared status types in logfwd-types

    2. Wire canonical admin endpoint from shared model

      • File: crates/logfwd-io/src/diagnostics.rs
        • Extend router at handle_request (:484-493) with "/admin/v1/status".
        • Add serve_admin_status(&self, request: tiny_http::Request) -> Result<...>.
        • Add internal builders:
          • process snapshot builder from server/process state
          • pipeline/component snapshot builders from self.pipelines + PipelineMetrics
        • Serialize with serde_json::to_string from shared structs (avoid ad hoc status JSON assembly for this surface).
        • Keep /ready response behavior (200/503) for compatibility, but derive its decision and status string from the same snapshot source.
    3. Lock payload shape with tests

      • File: crates/logfwd-types/src/status.rs (or adjacent test module)
        • Add serialization tests asserting exact keys and enum string forms.
      • File: crates/logfwd-io/src/diagnostics.rs tests module
        • Add test_admin_status_endpoint_returns_structured_payload.
        • Parse response JSON and assert required fields exist/types for process + pipeline + component snapshots.
        • Add readiness consistency test: /ready status and /admin/v1/status readiness-derived state do not contradict.
        • Update/augment ready tests (:1634-1666) to include structural assertions via serde_json::Value.
    4. Documentation touch-up for endpoint surface

      • Files:
        • book/src/config/reference.md
        • book/src/deployment/monitoring.md
        • book/src/troubleshooting.md
      • Add /admin/v1/status as canonical structured status surface; clarify /health and /ready are probe endpoints.
    5. Verification command sequence for implementation PR

      • cargo test -p logfwd-types
      • cargo test -p logfwd-io diagnostics::tests::
      • cargo fmt --all
      • cargo clippy --all-targets -- -D warnings
    Related Items
    Type Item Relevance
    Issue #1414 This work-unit
    Issue #1306 Control-plane substrate semantics (/live, /ready, /admin/v1/status)
    Issue #1303 Contract vocabulary for status payload fields
    File crates/logfwd-types/src/diagnostics.rs:10 Existing diagnostics type is counters-only (ComponentStats)
    File crates/logfwd-io/src/diagnostics.rs:484-493 Current route table (no /admin/v1/status)
    File crates/logfwd/src/main.rs:932-940 Diagnostics server wiring point

    Open PRs in this exact area were not reliably enumerable in this environment due integrity-gated search responses; no directly conflicting approved result was found during this triage.

    Note

    🔒 Integrity filtering filtered 4 items

    Integrity filtering activated and filtered the following items during workflow execution.
    This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.


    What is this? | From workflow: Issue Triage

    Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

  3. added
    component:diagnosticsDiagnostics endpoints, dashboard, health, probes, and trace explorer
    on Apr 6, 2026
  4. changed the title [-]work-unit: logfwd-types + diagnostics — shared status snapshots and admin surface[/-] [+]work-unit: control plane — shared status model and admin status surface[/+] on Apr 6, 2026
  5. strawgate commented on Apr 7, 2026

    @strawgate
    OwnerAuthor

    Resolved by PRs #1454, #1509. Verified: typed ComponentHealth, ComponentStats, per-pipeline snapshots.

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

    P2: mediumMinor bug, missing validation, metric inaccuracyarchitectureSystemic design improvements that eliminate classes of bugscomponent:diagnosticsDiagnostics endpoints, dashboard, health, probes, and trace explorerenhancementNew feature or requestproductionRequired for production readinesswork-unitScheduling ticket for one agent run

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions