feat(rectification): 出卡加精度门槛,补经历改成系统点名
宽度超过 10 分钟或头名并列时不再出交付卡,改为按大运边界逐条问、 用类型芯片和年/月选择器录入。跳过的线换问法再问一次;答「这类事 都没有过」的不再问。用户说「没有了」仍立刻给目前范围。Skill 10.0.27。 BUG-740~743
This commit is contained in:
@@ -52,7 +52,7 @@ _EVENT_PROVENANCE_FIELDS = frozenset({
|
||||
})
|
||||
_REQUEST_FIELDS = frozenset({
|
||||
"birth_date", "start_time", "end_time", "lat", "lon", "tz", "events",
|
||||
"ayanamsa", "node_mode", "asked_probe_keys", "column_times", "minute_step", "blocks",
|
||||
"ayanamsa", "node_mode", "asked_probe_keys", "declined_domains", "column_times", "minute_step", "blocks",
|
||||
"refresh_probes",
|
||||
}) | _REQUEST_PROVENANCE_FIELDS
|
||||
ASKED_PROBE_KEY_MAX_LENGTH = 200
|
||||
@@ -169,6 +169,7 @@ class RectificationRequest(TypedDict):
|
||||
timezone_source: NotRequired[str | None]
|
||||
local_time_status: NotRequired[str | None]
|
||||
asked_probe_keys: NotRequired[list[str]]
|
||||
declined_domains: NotRequired[list[str]]
|
||||
dropped_asked_probe_keys: NotRequired[int]
|
||||
column_times: NotRequired[list[str]]
|
||||
refresh_probes: NotRequired[bool]
|
||||
@@ -357,6 +358,27 @@ def normalize_rectification_request(body: Any, *, today: date | None = None) ->
|
||||
cleaned_request["asked_probe_keys"] = cleaned_keys
|
||||
if dropped:
|
||||
cleaned_request["dropped_asked_probe_keys"] = dropped
|
||||
if "declined_domains" in body:
|
||||
raw_domains = body.get("declined_domains")
|
||||
if not isinstance(raw_domains, list) or len(raw_domains) > 20:
|
||||
raise ValueError("declined_domains must contain between 0 and 20 strings")
|
||||
cleaned_domains: list[str] = []
|
||||
seen_domains: set[str] = set()
|
||||
allowed = {
|
||||
"education", "career", "relocation", "relationship",
|
||||
"family", "finance", "health_pressure",
|
||||
}
|
||||
for index, item in enumerate(raw_domains):
|
||||
if not isinstance(item, str) or not item.strip():
|
||||
raise ValueError(f"declined_domains[{index}] must be a non-empty domain name")
|
||||
domain = item.strip()
|
||||
if domain not in allowed:
|
||||
raise ValueError(f"declined_domains[{index}] is not a collect domain")
|
||||
if domain in seen_domains:
|
||||
continue
|
||||
seen_domains.add(domain)
|
||||
cleaned_domains.append(domain)
|
||||
cleaned_request["declined_domains"] = cleaned_domains
|
||||
if "column_times" in body:
|
||||
raw_times = body.get("column_times")
|
||||
if not isinstance(raw_times, list) or not 1 <= len(raw_times) <= 64:
|
||||
|
||||
Reference in New Issue
Block a user