fix(rectification): unify discriminator question contract and rank by information gain
Python and TypeScript now share a four-option probe contract, persist Focus before asking, and pick the highest-value renderable probe instead of preferring low-gain career events over D24. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,7 @@ from scripts.rectification.candidate_contrast import (
|
||||
opportunity_from_probe,
|
||||
)
|
||||
from scripts.rectification.case_holdout import holdout_domain_years
|
||||
from scripts.rectification.probe_question_contract import complete_style_options
|
||||
from scripts.rectification.refinement_packet import match_level
|
||||
|
||||
MAX_PROBES = 3
|
||||
@@ -564,6 +565,9 @@ def _public_probe(
|
||||
payload.update(extra)
|
||||
if payload["role"] == "distinguish":
|
||||
payload["candidate_ids"] = candidate_ids_from_outcomes(payload.get("expected_outcomes") or [])
|
||||
style_options = complete_style_options(payload.get("choice_kind"), payload.get("style_options"))
|
||||
if style_options:
|
||||
payload["style_options"] = style_options
|
||||
return payload
|
||||
|
||||
|
||||
@@ -717,6 +721,7 @@ def _evaluate_contexts(
|
||||
version = set_version or candidate_set_version([yes_times, no_times])
|
||||
outcomes = [
|
||||
{"answer_class": "yes", "supports": yes_times, "conflicts": no_times},
|
||||
{"answer_class": "weak_yes", "supports": yes_times, "conflicts": no_times},
|
||||
{"answer_class": "no", "supports": no_times, "conflicts": yes_times},
|
||||
{"answer_class": "unsure", "supports": [], "conflicts": []},
|
||||
]
|
||||
@@ -752,7 +757,7 @@ def _evaluate_contexts(
|
||||
"calculationResultId": None,
|
||||
}],
|
||||
)
|
||||
if distinguish_contract_errors(probe):
|
||||
if not probe or distinguish_contract_errors(probe):
|
||||
return None
|
||||
return probe
|
||||
|
||||
|
||||
Reference in New Issue
Block a user