fix(rectification): close round A/2 tail gaps in tests, CI, and stale-score reuse
Window_scan assertions now match the public from_sign/to_sign contract, the staging quick gate runs the rectification Python suite, and compare-candidates rescores when stored policy lags the live engine identity. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -120,6 +120,8 @@ class RectificationDiagnosticsClustersTest(unittest.TestCase):
|
||||
"layer": "d9",
|
||||
"at": "05:14",
|
||||
"user_meaning": "D9 在 05:14 发生变化",
|
||||
"from_sign": "金牛座",
|
||||
"to_sign": "天蝎座",
|
||||
}])
|
||||
encoded = str(scan)
|
||||
self.assertIn("金牛座", encoded)
|
||||
@@ -128,6 +130,11 @@ class RectificationDiagnosticsClustersTest(unittest.TestCase):
|
||||
self.assertNotIn("Scorpio", encoded)
|
||||
self.assertFalse(scan["unique_minute_claim"])
|
||||
|
||||
def test_staging_quick_gate_runs_rectification_python_suite(self) -> None:
|
||||
from pathlib import Path
|
||||
text = Path("scripts/run_quality_gate.py").read_text(encoding="utf-8")
|
||||
self.assertIn('"tests/test_rectification_*.py"', text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -675,11 +675,26 @@ class RectificationV5ServicesTest(unittest.TestCase):
|
||||
"rectification-v5-candidate-features": "/api/rectification/v5/candidate-features",
|
||||
"rectification-v5-score": "/api/rectification/v5/score",
|
||||
"rectification-v5-diagnostics": "/api/rectification/v5/diagnostics",
|
||||
"rectification-v5-versions": "/api/rectification/v5/versions",
|
||||
}
|
||||
for command, endpoint in expected.items():
|
||||
self.assertEqual(API_COMMAND_MAP[command], endpoint)
|
||||
self.assertIn(endpoint, TECHNIQUE_EXAMPLE_ENDPOINTS)
|
||||
|
||||
def test_engine_scoring_versions_match_score_identity(self):
|
||||
from scripts.rectification.api_service import engine_scoring_versions
|
||||
from scripts.rectification.decision_policy import POLICY_VERSION
|
||||
from scripts.rectification.scoring_service import ALGORITHM_VERSION
|
||||
|
||||
versions = engine_scoring_versions()
|
||||
self.assertEqual(versions["algorithm_version"], ALGORITHM_VERSION)
|
||||
self.assertEqual(versions["decision_policy_version"], POLICY_VERSION)
|
||||
handler = object.__new__(JyotishAPIHandler)
|
||||
payload = handler._compute_rectification_v5_versions()
|
||||
self.assertEqual(payload["algorithm_version"], ALGORITHM_VERSION)
|
||||
self.assertEqual(payload["decision_policy_version"], POLICY_VERSION)
|
||||
self.assertEqual(payload["endpoint"], "rectification_v5_versions")
|
||||
|
||||
def test_zero_evidence_returns_declared_window_report(self):
|
||||
body = request(start_time="23:58", end_time="00:02")
|
||||
body["events"] = []
|
||||
|
||||
Reference in New Issue
Block a user