fix(web): restore rectification discriminator cards and stop-offer path

Coverage-complete ties never persisted A/B/C/D because contrast probes were stamped with an answered education quality probe, remaining minutes were asked as window D10 signs, and 「没有了」 missed the stop pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-25 14:41:48 +08:00
parent 20ede7cadf
commit d7afe5b50d
19 changed files with 924 additions and 48 deletions
+30 -3
View File
@@ -199,6 +199,27 @@ def _pick_representatives(
contexts = _static_contexts(built)
by_time = {_context_time(item): item for item in contexts}
times = [str(_context_time(item)) for item in contexts]
remaining: list[str] = []
for raw in candidate_times:
time = str(raw or "")[:5]
if len(time) >= 5 and time in by_time and time not in remaining:
remaining.append(time)
if len(remaining) >= 2:
remaining_set = set(remaining)
for transition in scan.get("transitions") or []:
if not isinstance(transition, dict):
continue
layer = transition.get("layer")
at = str(transition.get("at") or "")[:5]
if layer not in SCORING_LAYERS or at not in by_time or at not in remaining_set:
continue
left = None
for time in remaining:
if _clock(time) < _clock(at):
left = time
if left and left != at:
return by_time[left], by_time[at]
return by_time[remaining[0]], by_time[remaining[-1]]
for transition in scan.get("transitions") or []:
if not isinstance(transition, dict):
continue
@@ -596,8 +617,8 @@ def discriminating_event_probes(
domains = _probe_domains(scan, precision_current, events)
if not domains:
return []
probes = _quality_probes(events, domains)
covered_domains = {row["domain"] for row in probes}
probes: list[dict[str, Any]] = []
covered_domains: set[str] = set()
pair = _pick_representatives(built, scan, candidate_times, representative_time)
lo, hi = birth_year + 5, min(now.year, birth_year + 80)
can_score = (
@@ -620,7 +641,7 @@ def discriminating_event_probes(
if left_narayana is not None and right_narayana is not None:
narayana_years = _boundary_years(left_narayana, right_narayana)
for domain in domains:
if domain in covered_domains or domain not in DOMAIN_CATALOG:
if domain not in DOMAIN_CATALOG:
continue
known_years = _event_years(events, domain)
boundary = sorted((vim_years | narayana_years) & set(range(lo, hi + 1)))
@@ -643,6 +664,12 @@ def discriminating_event_probes(
probes.append(found)
dasha_domains.add(domain)
covered_domains.add(domain)
quality = _quality_probes(events, domains)
for row in quality:
if row["domain"] in dasha_domains:
continue
probes.append(row)
covered_domains.add(row["domain"])
for domain in domains:
if domain in covered_domains or domain in dasha_domains or domain not in DOMAIN_CATALOG:
continue