fix(rectification): keep dated precision cards after empty dated discriminator pool (BUG-651)

Staging gate 2558 failed because leftover tests still expected D9/D10 or leftover collect after the pool emptied. Discriminate sessions still deliver; dated precision cards still ask.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-11 15:22:55 +08:00
co-authored by Cursor
parent 035865d4c1
commit f870d3d757
13 changed files with 184 additions and 90 deletions
@@ -1103,6 +1103,16 @@ function isYearlessPersonalityRow(row: RankedDiscriminator): boolean {
return discriminatorChoiceKind(row) === "varga_style";
}
/** Dated reverse-inference only. D9/D10 / nakshatra never count (BUG-651). */
function followupLocksDatedPeriod(followup: MethodFollowup | null | undefined): boolean {
if (!followup) return false;
if (followup.choice_kind === "varga_style") return false;
if (followup.source === "nakshatra_boundary") return false;
if ((followup.probe_year ?? 0) > 0) return true;
const period = followup.choice_frame?.period ?? "";
return /(?:19|20)\d{2}/.test(period);
}
export function yearlessPersonalityCanAsk(input: {
datedCount: number;
candidatesSeparated: boolean;
@@ -2492,13 +2502,24 @@ export function buildMethodFollowupPlan(input: {
if (!next) {
const precisionCard = takeRenderableDistinguish(precisionStageFollowup());
const datedPoolEmpty = rankedDiscriminators.length === 0;
const datedPrecision = Boolean(
precisionCard?.choice_frame && followupLocksDatedPeriod(precisionCard),
);
if (collectingByPool) {
next = null;
} else if (datedPoolEmpty && meetsAcceptanceEventQuality(input.evidence)) {
} else if (datedPrecision) {
next = precisionCard;
} else if (
datedPoolEmpty
&& meetsAcceptanceEventQuality(input.evidence)
&& sessionOutcome === "discriminate_candidates"
) {
// BUG-651: discriminating with no dated probe must not pick yearless
// personality or leftover method collect as the next discriminator.
next = null;
} else if ((renderableYearless = firstRenderableYearlessFollowup())) {
next = renderableYearless;
} else if (
next = renderableYearless;
} else if (
// BUG-547: a renderable precision card beats dated collect, but only
// after the training gate is open. lagna_frame can borrow an unrelated
// probe into choice_frame while holdout is still short.