Spaces:
Sleeping
Sleeping
Download test_supabase_numeric_gate_contract.py from shazhass/phytoevidence-api: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/shazhass/phytoevidence-api/resolve/main/test_supabase_numeric_gate_contract.py
- Command line
-
hf download hf://spaces/shazhass/phytoevidence-api/test_supabase_numeric_gate_contract.py
-
curl -L -o test_supabase_numeric_gate_contract.py https://huggingface.co/spaces/shazhass/phytoevidence-api/resolve/main/test_supabase_numeric_gate_contract.py
1.02 kB
| """Guard the production Supabase numeric validation contract against source drift.""" | |
| from pathlib import Path | |
| SOURCE = ( | |
| Path(__file__).parent | |
| / "supabase" | |
| / "functions" | |
| / "pubmed-rag-v3" | |
| / "index.ts" | |
| ).read_text(encoding="utf-8") | |
| def test_med_service_contract_includes_numeric_endpoint(): | |
| assert '| "/validate-numeric"' in SOURCE | |
| assert '"/validate-numeric",' in SOURCE | |
| def test_numeric_validation_is_strict_and_fail_closed(): | |
| assert "relative_tolerance: 0.0" in SOURCE | |
| assert "numeric_candidate_coverage_gap:" in SOURCE | |
| assert "failClosed: true" in SOURCE | |
| assert "numericValidation.allValid" in SOURCE | |
| def test_numeric_validation_and_salvage_are_exposed(): | |
| assert "numericValidation," in SOURCE | |
| assert "numericSalvage:" in SOURCE | |
| def test_numeric_candidate_detection_ignores_identifier_suffixes(): | |
| assert r"(?<![\w.,-])[-+]?" in SOURCE | |
| assert "extractNumericTokensForCoverage(claim)" in SOURCE | |
| assert "if (!/\\d/.test(claim))" not in SOURCE | |