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
Open
Conversation
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
Contributor
|
@cla-assistant check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
check_migrate_reader_contract()tosrc/health-check.pythat runstests/migrate-reader-contract.test.pyas a live health probe. AnyCLASS_RULESmisclassification 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 juststand-identity.json. Both probes are additive.Probe behavior
okokerrorFAIL/Errorline from outputwarnTest plan
tests/health-check-migrate-reader-contract.test.py— 5 regression tests: missing file, passing, failing, timeout, live-repo pass. All 5 pass.python3 src/health-check.pyshows✓ migrate-reader-contract ok all CLASS_RULES compatible with reader contracts🤖 Generated with Claude Code
https://claude.ai/code/session_01KXQJogmVSdYrKtYX1LwzwT