Skip to content

fix(health-check): run migrate-reader-contract suite as health probe (closes #1543 layer 2b)#1868

Open
bassilkhilo-ag2 wants to merge 2 commits into
sonichi:mainfrom
bassilkhilo-ag2:fix/health-check-migrate-reader-probe
Open

fix(health-check): run migrate-reader-contract suite as health probe (closes #1543 layer 2b)#1868
bassilkhilo-ag2 wants to merge 2 commits into
sonichi:mainfrom
bassilkhilo-ag2:fix/health-check-migrate-reader-probe

Conversation

@bassilkhilo-ag2

Copy link
Copy Markdown
Contributor

What

Adds check_migrate_reader_contract() to src/health-check.py that runs tests/migrate-reader-contract.test.py as a live health probe. Any CLASS_RULES misclassification that would cause silent reader fall-back surfaces immediately at startup rather than only in CI.

Why

Layer 2 of issue #1543's bug-prevention plan. Layer 1 (tests/migrate-reader-contract.test.py) catches contract drift in CI. This probe brings that signal into the runtime health dashboard so operators don't need to check CI to know their local install is contract-clean.

Complements PR #1706 (narrow check_stand_identity() probe for the known incident file): this probe is general — it validates all CLASS_RULES entries against their reader contracts, not just stand-identity.json. Both probes are additive.

Probe behavior

Condition Status Detail
Test file absent (pre-#1543 install) ok "test not found (pre-#1543 install)"
Test exits 0 ok "all CLASS_RULES compatible with reader contracts"
Test exits 1 error First FAIL / Error line from output
Test times out (>15s) warn "timed out after 15s"

Test plan

  • tests/health-check-migrate-reader-contract.test.py — 5 regression tests: missing file, passing, failing, timeout, live-repo pass. All 5 pass.
  • Live run: python3 src/health-check.py shows ✓ migrate-reader-contract ok all CLASS_RULES compatible with reader contracts

🤖 Generated with Claude Code

https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT

bassilkhilo-ag2 and others added 2 commits June 30, 2026 18:07
 layer 2b)

Runs tests/migrate-reader-contract.test.py as a health-check probe so any
CLASS_RULES misclassification is surfaced at startup, not just in CI.

- `check_migrate_reader_contract()`: subprocess-runs the Layer 1 contract
  test; ok on exit 0, error on exit 1 with first FAIL/Error line, warn on
  timeout, graceful skip when the test file is absent (pre-sonichi#1543 installs).
- `tests/health-check-migrate-reader-contract.test.py`: 5 regression tests
  covering missing test file, passing/failing/timeout, and the live repo.

Complements PR sonichi#1706 (narrow stand-identity.json probe): this probe is
general — it validates all CLASS_RULES entries, not just one file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@cla-assistant check

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