Skip to content

feat(seedling): doctor healthcheck via the OI API (SDH)#689

Open
dannash100 wants to merge 6 commits into
mainfrom
feature/tam-6872-seedling-x-canopy-healthchecks
Open

feat(seedling): doctor healthcheck via the OI API (SDH)#689
dannash100 wants to merge 6 commits into
mainfrom
feature/tam-6872-seedling-x-canopy-healthchecks

Conversation

@dannash100

@dannash100 dannash100 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

TAM-6872. On a seedling host, bestool tamanu doctor gathers seedling-specific health from the local seedling daemon's OI control interface and folds it into the sweep, so it rides to Canopy like every other check.

Spec

SDH (.workhorse/specs/seedling/healthchecks.md): when the seedling checks apply, that the daemon is the source of truth (OI, not the DB), and the subsystems reported — reverse proxy, DNS resolver, managed apps. Cross-refs DOC for the shared doctor mechanics.

Implementation

Three host checks in crates/alertd/src/doctor/checks/seedling.rsseedling_proxy, seedling_resolver, seedling_apps — sharing a single OI query resolved once per sweep:

  • detects a seedling host (SEEDLING_DATA_DIR + the daemon's oi.key present), skips otherwise;
  • pins the local daemon's fingerprint from its published oi.fingerprint file (falling back to a strictly read-only parse of oi.key for daemons that predate it) and connects to 127.0.0.1:7891 over the OI (QUIC + raw-key mTLS, via seedling-protocol, pinned at v0.3.0);
  • calls /infra/status (proxy/resolver) + /server/status (apps): proxy/resolver down → fail, apps partially up → warning, daemon unreachable/unauthorised or response missing expected fields → broken, no seedling → skip.

cargo check / fmt / clippy clean; alertd test suite passes.

@dannash100 dannash100 changed the title docs(seedling): seedling healthchecks spec (SDH) feat(seedling): doctor healthcheck via the OI API (SDH) Jul 8, 2026
- read the daemon's key strictly read-only instead of load_or_generate,
  which could create a fresh key at the daemon's path if the file
  vanished between the existence check and the load
- report missing fields in daemon responses as broken per SDH, instead
  of failing (proxy/resolver "unknown") or silently passing (apps
  defaulting to zero total)
- pin seedling-protocol to the v0.3.0 tag it was already locked at
@dannash100
dannash100 marked this pull request as ready for review July 16, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant