Skip to content

[CLI-003] Implement ori doctor #5

@AdeGneus

Description

@AdeGneus

Context

Operators need one command that explains runtime health, sensor freshness, alert channel posture, and tier availability without reading raw socket JSON.

Scope

  • Implement ori doctor.
  • Read runtime health socket.
  • Render human text and --output json.
  • Use SDK health helper contracts where available.

Non-Goals

  • Does not directly inspect SQLite.
  • Does not make cloud calls.

Technical Specification

ori doctor calls the runtime health socket, parses RuntimeHealthStatus, summarizes freshness/posture/tier capability, and respects output mode.

Acceptance Criteria

  • Human output is readable.
  • JSON output is stable.
  • Unavailable runtime returns clear error.
  • go test ./... and go vet ./... pass.

Tests Required

Test Verifies
TestDoctorRuntimeHealthText Text output.
TestDoctorRuntimeHealthJSON JSON output.
TestDoctorRuntimeUnavailable Error path.

Additional Test Coverage / Edge Cases

  • Runtime socket missing, permission denied, malformed JSON, and timeout must all produce clear operator errors.
  • JSON output must be valid JSON and contain no ANSI/color formatting.
  • Text output should degrade gracefully when optional posture fields are absent.
  • Sensor freshness should cover stale, fresh, missing timestamp, and future timestamp readings.
  • Tier capability output should distinguish unavailable gateway, unavailable SMS/WhatsApp, and local SLM degraded.

Invariants — Do Not Violate

  • CLI must not bypass runtime authority.

Dependencies

Blocked by:

Unblocks:

  • Nothing

Contract References

  • Runtime health socket
  • SDK health helpers

Priority

poc-critical

Suggested Labels

blocked, poc-critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedWaiting on another issue or external dependency.poc-criticalMust be complete before PoC deployment.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions