fix(rectification): ask from the scored probe catalog, not snapshot leftovers
Independent Staging Quality Gate / validate (push) Successful in 9m30s
Independent Staging Quality Gate / publish (push) Has been cancelled

Empty snapshot candidates were starving remaining D24 splits, so the
TypeScript follow-up chain asked the low-gain Python career probe.
Read paths now share one inference+engine catalog and yield a stale
low-gain distinguish card to the current winner.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-28 09:48:57 +08:00
co-authored by Cursor
parent 4bf074b2bf
commit ca6252ecb6
9 changed files with 417 additions and 139 deletions
@@ -80,8 +80,11 @@ export type EngineContrastProbe = Readonly<{
information_gain?: number;
expected_outcomes?: readonly Readonly<{
answer_class?: string;
outcomeId?: string;
supports?: readonly string[];
supportsCandidateIds?: readonly string[];
conflicts?: readonly string[];
conflictsCandidateIds?: readonly string[];
}>[];
left_time?: string;
right_time?: string;
@@ -312,11 +315,12 @@ export function buildCandidateContrastPacket(input: {
candidateTimes: input.candidateTimes ?? [],
transitions: input.transitions ?? [],
});
const presentKeys = new Set(fromEngine.map((item) => item.semanticKey));
const fromVarga = vargaProbe(
remainingSplits,
input.candidateSetVersion,
input.calculationResultId ?? null,
asked,
new Set([...asked, ...presentKeys]),
);
const probes = [...fromEngine, ...(fromVarga ? [fromVarga] : [])]
.sort((left, right) => right.informationGain - left.informationGain);
@@ -515,15 +519,30 @@ export function conflictProbesFromContrast(
});
}
function inferredContrastChoiceKind(
semanticKey: string,
explicit?: ContrastChoiceKind,
): ContrastChoiceKind {
if (explicit === "varga_style" || explicit === "event_quality" || explicit === "existence") {
return explicit;
}
const layer = semanticKey.match(/^varga\.(d\d+)/)?.[1];
if (layer === "d9" || layer === "d10") return "varga_style";
if (layer === "d24" || layer === "d5") return "event_quality";
return "existence";
}
function probeFromEngine(
probe: EngineContrastProbe,
candidateSetVersion: string,
calculationResultId: string | null,
): CandidateDiscriminatorProbe | null {
const outcomes = (probe.expected_outcomes ?? []).flatMap((row) => {
const outcomeId = typeof row.answer_class === "string" ? row.answer_class : "";
const supports = row.supports ?? [];
const conflicts = row.conflicts ?? [];
const outcomeId = typeof row.answer_class === "string" && row.answer_class.trim()
? row.answer_class
: typeof row.outcomeId === "string" ? row.outcomeId : "";
const supports = row.supports ?? row.supportsCandidateIds ?? [];
const conflicts = row.conflicts ?? row.conflictsCandidateIds ?? [];
if (!outcomeId) return [];
return [{ outcomeId, supportsCandidateIds: supports, conflictsCandidateIds: conflicts }];
});
@@ -553,7 +572,7 @@ function probeFromEngine(
domain: probe.domain ?? null,
year: probe.year ?? null,
semanticKey,
choiceKind: probe.choice_kind,
choiceKind: inferredContrastChoiceKind(semanticKey, probe.choice_kind),
styleOptions: styleOptionsFromEngine(probe.style_options),
};
}