Skip to content

[Infra] Add deterministic readiness invariant tests#100

Merged
shchukins merged 1 commit into
mainfrom
codex/issue-99-readiness-invariants
May 20, 2026
Merged

[Infra] Add deterministic readiness invariant tests#100
shchukins merged 1 commit into
mainfrom
codex/issue-99-readiness-invariants

Conversation

@shchukins
Copy link
Copy Markdown
Owner

Summary

  • extend readiness invariant coverage with deterministic monotonicity checks across load, recovery, and readiness
  • add regression-style tests for missing-HRV recovery days and numerically valid fallback outputs
  • keep the change local to backend/tests/test_readiness_invariants.py with concise comments explaining why each invariant matters

Tests

  • PYTHONPATH=. ./venv/bin/pytest tests/test_readiness_invariants.py tests/test_readiness_fallbacks.py tests/test_load_state_v2.py tests/test_readiness_query.py

Assumptions

  • current readiness baseline remains 0.6 * freshness_norm + 0.4 * recovery_score_simple
  • missing HRV should degrade gracefully by using neutral HRV contribution rather than failing the recovery pipeline
  • fallback modes (full, load_only, recovery_only) are part of the supported deterministic contract

Risks / Gaps

  • coverage is focused on service-level invariants and does not add new DB integration fixtures
  • no_data still remains covered via existing 404 behavior tests rather than a new end-to-end pipeline test

Refs #99

@shchukins shchukins merged commit fc887c3 into main May 20, 2026
2 checks passed
@shchukins shchukins deleted the codex/issue-99-readiness-invariants branch May 20, 2026 22:34
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