fix(rectification): anchor candidate windows to civil dates across midnight
Carry explicit local date intervals instead of inferring the day from clock order. Cluster width, delivery, adoption, and reports keep the actual civil date; adopted date is stored separately from the reported birth_date. Algorithm identity is scoring-9 / spec-v5. Scoring weights, confirmation thresholds, and Skill version are unchanged. Isolated Linux final-3 gates passed; four pre-existing Python failures remain. This is not a production release.
This commit is contained in:
@@ -53,7 +53,7 @@ _EVENT_PROVENANCE_FIELDS = frozenset({
|
||||
_REQUEST_FIELDS = frozenset({
|
||||
"birth_date", "start_time", "end_time", "lat", "lon", "tz", "events",
|
||||
"ayanamsa", "node_mode", "asked_probe_keys", "declined_domains", "column_times", "minute_step", "blocks",
|
||||
"refresh_probes",
|
||||
"refresh_probes", "candidate_intervals",
|
||||
}) | _REQUEST_PROVENANCE_FIELDS
|
||||
ASKED_PROBE_KEY_MAX_LENGTH = 200
|
||||
_EVENT_FIELDS = frozenset({"id", "domain", "event_kind", "date_start", "date_end", "precision", "summary"}) | _EVENT_PROVENANCE_FIELDS
|
||||
@@ -175,6 +175,7 @@ class RectificationRequest(TypedDict):
|
||||
refresh_probes: NotRequired[bool]
|
||||
minute_step: NotRequired[int]
|
||||
blocks: NotRequired[list[dict[str, Any]]]
|
||||
candidate_intervals: NotRequired[list[dict[str, str]]]
|
||||
|
||||
|
||||
JsonObject = dict[str, Any]
|
||||
@@ -406,4 +407,7 @@ def normalize_rectification_request(body: Any, *, today: date | None = None) ->
|
||||
cleaned_request["minute_step"] = minute_step
|
||||
if "blocks" in body:
|
||||
cleaned_request["blocks"] = _normalize_blocks(body, start_time, end_time)
|
||||
if "candidate_intervals" in body:
|
||||
from scripts.rectification.candidate_window import candidate_intervals
|
||||
cleaned_request["candidate_intervals"] = candidate_intervals(body)
|
||||
return cast(RectificationRequest, cleaned_request)
|
||||
|
||||
Reference in New Issue
Block a user