From e2802d194e2a57bd7918681da08e6790091a0b38 Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Fri, 17 Jul 2026 11:39:24 +0800 Subject: [PATCH] fix: align merged quality gate contracts --- scripts/audit_capabilities.py | 2 ++ tests/run_all.py | 2 +- tests/test_restricted_technique_statuses.py | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/audit_capabilities.py b/scripts/audit_capabilities.py index cfcf5a40..2e590757 100644 --- a/scripts/audit_capabilities.py +++ b/scripts/audit_capabilities.py @@ -28,6 +28,8 @@ ALLOWED_STATUS = { "workflow-only", "not-integrated", "missing", + "guarded", + "comparison-only", } REQUIRED_TECHNIQUE_FIELDS = { "name": str, diff --git a/tests/run_all.py b/tests/run_all.py index dab037df..0b5a5806 100644 --- a/tests/run_all.py +++ b/tests/run_all.py @@ -262,7 +262,7 @@ def t48(): def t49(): from tajika import calc_all_sahams from datetime import datetime - r = calc_all_sahams({'Sun': 80, 'Moon': 105, 'Mars': 220, 'Mercury': 75, 'Jupiter': 310, 'Venus': 350, 'Saturn': 180, 'Rahu': 45, 'Ketu': 225}, 15.0, datetime(1990,6,15,12,0)) + r = calc_all_sahams({'Sun': 80, 'Moon': 105, 'Mars': 220, 'Mercury': 75, 'Jupiter': 310, 'Venus': 350, 'Saturn': 180, 'Rahu': 45, 'Ketu': 225}, 15.0, datetime(1990,6,15,12,0), lat=39.9042, lon=116.4074, tz=8) assert len(r) >= 30 @test("Chart renderer SVG") diff --git a/tests/test_restricted_technique_statuses.py b/tests/test_restricted_technique_statuses.py index 66b4ae8a..42590ea2 100644 --- a/tests/test_restricted_technique_statuses.py +++ b/tests/test_restricted_technique_statuses.py @@ -3,6 +3,8 @@ from __future__ import annotations import json from pathlib import Path +from scripts.audit_capabilities import ALLOWED_STATUS + ROOT = Path(__file__).resolve().parents[1] REGISTRY = ROOT / "references" / "technique_registry.json" @@ -21,3 +23,16 @@ def test_restricted_techniques_keep_canonical_status_boundaries() -> None: assert techniques[key]["verification_level"]["prediction"] == "support_only" assert techniques["rangacharya_jaimini_variant"]["verification_level"]["prediction"] == "blocked" + + +def test_restricted_statuses_are_accepted_by_capability_audit() -> None: + techniques = json.loads(REGISTRY.read_text(encoding="utf-8"))["techniques"] + restricted_statuses = { + techniques["prashna"]["status"], + techniques["prashna_integration"]["status"], + techniques["upagraha_gulika_maandi"]["status"], + techniques["panchavargiya_bala"]["status"], + techniques["rangacharya_jaimini_variant"]["status"], + } + + assert restricted_statuses <= ALLOWED_STATUS