fix(rectification): offer representative time once event-fit is enough
Keep unique-top and width on confirmation only, and stop lagna-frame follow-ups from blocking cards on an already-scored cluster. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import unittest
|
||||
from scripts.rectification.decision_policy import build_candidate_decisions, build_decision_receipt
|
||||
from scripts.rectification.refinement_packet import (
|
||||
build_refinement_packet,
|
||||
cluster_scan,
|
||||
dasha_agreement,
|
||||
match_level,
|
||||
precision_stage,
|
||||
@@ -145,6 +146,32 @@ class RefinementPacketTest(unittest.TestCase):
|
||||
self.assertEqual(ready["current"], "ready_to_adopt")
|
||||
self.assertFalse(ready["unique_minute_claim"])
|
||||
|
||||
def test_precision_stage_uses_candidate_cluster_not_full_declared_range(self):
|
||||
built = {
|
||||
"static_contexts": [
|
||||
feature("12:00", d1=3, d9=1, d10=4),
|
||||
feature("13:37", d1=4, d9=1, d10=4),
|
||||
feature("15:50", d1=4, d9=1, d10=4),
|
||||
feature("15:51", d1=4, d9=1, d10=4),
|
||||
feature("16:03", d1=5, d9=1, d10=4),
|
||||
]
|
||||
}
|
||||
scan = window_scan(built)
|
||||
self.assertEqual(scan["d1_lagna_count"], 3)
|
||||
self.assertTrue(scan["d1_candidates_differ"])
|
||||
cluster = cluster_scan(built, ["15:50", "15:51"], "15:50", 14)
|
||||
self.assertEqual(cluster["d1_lagna_count"], 1)
|
||||
self.assertFalse(cluster["d1_candidates_differ"])
|
||||
packet = build_refinement_packet(
|
||||
request_events(),
|
||||
built,
|
||||
representative_time="15:50",
|
||||
candidate_times=["15:50", "15:51"],
|
||||
cluster_width_minutes=14,
|
||||
)
|
||||
self.assertEqual(packet["window_scan"]["d1_lagna_count"], 3)
|
||||
self.assertNotEqual(packet["precision_stage"]["current"], "lagna_frame")
|
||||
|
||||
def test_window_scan_reports_d24_and_fine_minute_changes_without_unique_claim(self):
|
||||
scan = window_scan({
|
||||
"static_contexts": [
|
||||
|
||||
Reference in New Issue
Block a user