Repository navigation
test: boman edge cases and phase3 vs pipeline safety threshold contract - #23
Merged
Merged
Conversation
…ct (#23) - boman_index: all-non-canonical (XXX/BBBBB) → 0.0 via .get(aa, 0.0) fallback - boman_activity_score: verify tanh formula constant (0.5*(1+tanh(bi/2)) ≈ 0.7311 at bi=1.0) - test_phase3_config_has_stricter_safety_filter_than_pipeline: asserts phase3.yaml max_safety_risk=0.40 (safety≥0.60) is stricter than pipeline.yaml 0.70 (safety≥0.30); a candidate with safety=0.50 passes pipeline but is blocked by phase3
- Move `import math` to module top level (ruff PLC0415)
- Replace vacuous tanh assertion (tested math.tanh locally) with a test that
actually calls boman_activity_score("K") and compares to formula-derived
expected value — any change to bi/2.0 divisor will now be caught
- Move `from pathlib import Path` and `from openamp_foundry.config import load_config`
from inside test function to module top level (ruff PLC0415)
3 tasks done
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.
Summary
tests/test_boman_scorer.py— two new edge-case tests:test_all_non_canonical_returns_zero: verifiesboman_index("XXX")andboman_index("BBBBB")return0.0via the.get(aa, 0.0)fallback — ensures non-standard AAs are silently neutral, not errorstest_amp_threshold_bi_maps_to_expected_score: pins the tanh formula constant0.5*(1+tanh(bi/2)) ≈ 0.7311at bi=1.0 (_AMP_THRESHOLD), making any future formula drift a test failuretests/test_pipeline_filters.py— one new integration test:test_phase3_config_has_stricter_safety_filter_than_pipeline: loads bothconfigs/pipeline.yamlandconfigs/phase3.yaml, asserts phase3max_safety_risk=0.40(safety≥0.60) is strictly tighter than pipeline's0.70(safety≥0.30), and shows that a candidate withsafety=0.50is admitted by pipeline but blocked by phase3 — critical pre-synthesis gate contractTest plan
pytest tests/test_boman_scorer.py tests/test_pipeline_filters.py— 52 passedpytest— 774 passed, 0 failuresContext
This is iteration #23 of the pre-wet-lab quality loop. Previous PRs (#20–22) added coverage for certificate, mutation, external_predict, config, safety, and activity scoring. This PR closes the last two identified gaps from the agent survey:
🤖 Generated with Claude Code