feat(rectification): range delivery needs 4 dated events across 3 domains (R1, BUG-1193)
Product decision 2026-10-02 (TASK-upstream-sync5 R1): a time range is offered
only with at least 4 dated, primary-scoreable events covering 3 domains,
counted on all of them (training + reserved holdout). Was 3 training events /
2 domains in three TS copies and the Python acceptance gate while the policy
file already said 4/3.
- One definition: references/rectification_policy.v1.json
(minConfirmationEvents / minConfirmationDomains). TS core/types MIN_DATED_*,
rectification-decision MIN_STANDALONE_*, evidence-model MIN_ACCEPTANCE_*,
the convergence evaluator and the post-inference trainingGateOpen all read
it; Python decision_policy MIN_ACCEPTANCE_* alias MIN_CONFIRMATION_*.
- Python receipt counts all scoreable events / domains for event_quality and
domain_diversity; decision policy identity v3 -> v4 (candidate UUIDs carry
it). Candidate scores unchanged (77 v5 cases A/B identical), so the
algorithm stays rectification-v5-matrix-scoring-10.
- Memoization golden v3 written by write_golden; v2 frozen by sha256 with a
test that its scores equal v3 and only the receipt policy moved.
- Collect gap copy names the exact gap ("再来两件……其中至少一件不是……")
instead of always "再来一件"; VOICE.md updated. Legacy life-events form copy
4/3 as well.
- 30 frontend test files, 4 Python tests: fixtures extended to the same
scenario at 4/3, or assertions changed with 原值/新值/原因 notes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7fb165ecf6
commit
758fee954b
@@ -26,13 +26,16 @@ from scripts.rectification_policy import (
|
||||
MIN_CONFIRMATION_MARGIN_PERCENT,
|
||||
)
|
||||
|
||||
POLICY_VERSION = "rectification-candidate-policy-v3"
|
||||
POLICY_VERSION = "rectification-candidate-policy-v4"
|
||||
RECEIPT_VERSION = "candidate-decision-receipt-v2"
|
||||
EXECUTION_LEDGER_VERSION = "rectification-execution-ledger-v2"
|
||||
SCORE_QUANTUM = Decimal("0.0001")
|
||||
TIE_ABSOLUTE_TOLERANCE = Decimal("0.0001")
|
||||
MIN_ACCEPTANCE_EVENTS = 3
|
||||
MIN_ACCEPTANCE_DOMAINS = 2
|
||||
# R1 (2026-10-02, BUG-1193): a range is accepted only with at least 4 dated
|
||||
# scoreable events across 3 domains, counted on all of them (training + the
|
||||
# reserved holdout). Single definition: references/rectification_policy.v1.json.
|
||||
MIN_ACCEPTANCE_EVENTS = MIN_CONFIRMATION_EVENTS
|
||||
MIN_ACCEPTANCE_DOMAINS = MIN_CONFIRMATION_DOMAINS
|
||||
MIN_DATE_QUALITY_MEAN = Decimal("0.65")
|
||||
MIN_DIAGNOSTIC_RETENTION = Decimal("0.75")
|
||||
MIN_ACCEPTANCE_MARGIN_PERCENT = Decimal("10")
|
||||
@@ -543,17 +546,19 @@ def build_decision_receipt(
|
||||
if str(event.get("id") or "") not in holdout
|
||||
]
|
||||
domains = sorted({event["domain"] for event in training_events})
|
||||
scoreable_domains = sorted({event["domain"] for event in scoreable_events})
|
||||
candidate_presence = _gate(bool(candidate_decisions), candidate_count=len(candidate_decisions))
|
||||
event_quality = _gate(
|
||||
len(training_events) >= MIN_ACCEPTANCE_EVENTS,
|
||||
scoreable_event_count=len(training_events),
|
||||
len(scoreable_events) >= MIN_ACCEPTANCE_EVENTS,
|
||||
scoreable_event_count=len(scoreable_events),
|
||||
training_event_count=len(training_events),
|
||||
minimum=MIN_ACCEPTANCE_EVENTS,
|
||||
)
|
||||
domain_diversity = _gate(
|
||||
len(domains) >= MIN_ACCEPTANCE_DOMAINS,
|
||||
scoreable_domain_count=len(domains),
|
||||
len(scoreable_domains) >= MIN_ACCEPTANCE_DOMAINS,
|
||||
scoreable_domain_count=len(scoreable_domains),
|
||||
minimum=MIN_ACCEPTANCE_DOMAINS,
|
||||
domains=domains,
|
||||
domains=scoreable_domains,
|
||||
)
|
||||
date_quality = _date_quality(training_events)
|
||||
top_tied_count = candidate_decisions[0]["tied_minute_count"] if candidate_decisions else 0
|
||||
|
||||
Reference in New Issue
Block a user