Skip to content

[Work Packet]: Verify health checks validate schema presence #66

Description

@juscghwe

Goal

Confirm that the backend health checks validate the correct database/table availability semantics instead of accidentally checking table contents.

The checks should prove that required tables/schema are reachable and usable without depending on rows being present.

Suggested branch name

backend/verify-health-schema-checks

Expected task size

Small: one focused session

Scope

  • Review existing backend health check queries.
  • Confirm they check table/schema availability, not row contents.
  • Replace any content-dependent checks such as broad SELECT * FROM ... probes with minimal schema/table checks where appropriate.
  • Document the intended health-check semantics in nearby code or module docs if needed.

Explicit non-goals / boundaries

  • Do not redesign the full health model.
  • Do not add frontend health UI work here.
  • Do not change medication-domain schema decisions.
  • Do not require seeded table contents for a healthy state.

Files / areas likely affected

  • backend health modules
  • SQLite/persistence health helpers
  • dev-notes health checks
  • backend tests or smoke checks
  • docs near health/persistence modules

Definition of done

  • Health checks do not depend on table rows existing.
  • Required tables/schema are still validated meaningfully.
  • Any previous SELECT * FROM ...-style content probe is either removed or justified.
  • Tests or local validation cover an empty-table healthy state.
  • Any follow-up health behavior questions are captured separately.

Validation

  • Run the backend health checks against an empty but migrated database.
  • Run existing backend smoke/integration checks.
  • Confirm health output stays healthy when required tables exist but contain zero rows.

Follow-up ideas

  • Add dedicated schema migration validation later.
  • Add deeper readiness diagnostics after the M1 foundation is stable.

Metadata

Metadata

Assignees

Projects

Status
In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions