fix(rectification): equal-weight collect, year-cue questions, classifier no/unsure (BUG-641–643)

Ask finance and health like other domains, put year-cued collect questions first, and let the classifier distinguish decline vs skip. Skill 10.0.22.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-10 21:53:10 +08:00
co-authored by Cursor
parent 71eaeb2e8b
commit 52db714ba9
46 changed files with 1033 additions and 160 deletions
+4 -12
View File
@@ -49,8 +49,8 @@ from scripts.rectification.refinement_packet import match_level
# three domains keep two years plus a couple of activation fallbacks without
# flooding the ask layer, which still ranks globally by information_gain.
MAX_PROBES = 8
# Collection still asks at most three missing-domain age-band questions.
MAX_COLLECTION_PROBES = 3
# Collection asks an age-band cue for every missing catalog domain.
MAX_COLLECTION_PROBES = 7
# N: keep the top scored probes per domain (boundary years, plus at most one
# activation if the domain is still under this cap).
MAX_PROBES_PER_DOMAIN = 3
@@ -142,7 +142,6 @@ LAYER_DOMAIN = {
"d11": "finance",
"d30": "health_pressure",
}
VOLUNTEER_ONLY = frozenset({"finance", "health_pressure"})
LAYER_VARGA = {
"d9": "D9",
"d10": "D10",
@@ -334,15 +333,10 @@ def _differing_layers(contexts: Sequence[dict[str, Any]]) -> set[str]:
def _probe_domains(
remaining_layers: set[str],
events: Sequence[dict[str, Any]],
_events: Sequence[dict[str, Any]],
*,
d1_differs: bool = False,
) -> list[str]:
volunteered = {
str(event.get("domain"))
for event in events
if isinstance(event, dict) and event.get("domain")
}
ordered: list[str] = []
for layer in SCORING_LAYERS:
domain = LAYER_DOMAIN.get(layer)
@@ -350,8 +344,6 @@ def _probe_domains(
continue
if layer not in remaining_layers:
continue
if domain in VOLUNTEER_ONLY and domain not in volunteered:
continue
ordered.append(domain)
if not ordered and d1_differs:
ordered.append("education")
@@ -1440,7 +1432,7 @@ def evidence_collection_probes(
return []
now = today or date.today()
events = [item for item in (request.get("events") or []) if isinstance(item, dict)]
missing = missing_collection_domains(events, list(DOMAIN_CATALOG), VOLUNTEER_ONLY)
missing = missing_collection_domains(events, list(DOMAIN_CATALOG), frozenset())
rows: list[dict[str, Any]] = []
for domain in missing:
year = _age_band_year(birth_year, domain, now)