fix(web): stop rectification interview when remaining minutes no longer split

Coverage-complete ties stayed in discrimination because whole-window D9/D24 follow-ups were treated as probes, and restated dates inserted duplicate evidence. Skip encoded remaining layers, ask leftover D4 or offer a provisional range, and dedupe dated rows by kind and date.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-25 19:02:35 +08:00
co-authored by Cursor
parent 946f11185e
commit a658ef8d2b
18 changed files with 1019 additions and 141 deletions
@@ -340,5 +340,6 @@ function phaseFor(status: ResultStatus, fallback: RectificationPhase): Rectifica
if (status === "converged" || status === "credible_range") return "completed";
if (status === "max_rounds_reached" || status === "validation_failed") return "stopped";
if (status === "insufficient_evidence") return "event_collection";
if (status === "discriminating") return "discrimination";
return fallback;
}
@@ -67,29 +67,13 @@ export type EngineContrastProbe = Readonly<{
right_time?: string;
}>;
const D10_PREDICTIONS: Readonly<Record<string, string>> = {
: "某一阶段身份独立、承担主导职责",
: "稳定技术或事务执行、在组织内慢慢积累",
: "沟通、写作或频繁切换任务",
: "照顾、家庭或情感劳动更重的职责",
: "站到台前、带人、或公开担责",
: "稳定技术执行、组织内分析或服务",
: "跨领域合作、工作环境或合作模式变化",
: "研究、转化、或把一件事做深",
: "跨领域、教学或更开阔的工作环境",
: "管理职责、长期结构、延迟回报",
: "独立技术路线、非传统协作",
: "服务、艺术或界限更模糊的工作",
};
const REMAINING_LAYER_ORDER = ["d24", "d5", "d10", "d9"] as const;
const DUTY_ANSWERED_RE = /技术执行|算法|分析|数据处理|系统维护|组织型|第三个|照顾、家庭|台前|带人|公开担责/;
const REMAINING_LAYER_ORDER = ["d24", "d5", "d10", "d9", "d4"] as const;
const DUTY_ANSWERED_RE = /技术执行|算法|分析|数据处理|系统维护|组织型|第三个|照顾、家庭|台前|带人|公开担责|程序员|前端|工程师|开发/;
const EXAM_QUALITY_RE = /失利|失常|复读|没考好|考砸|发挥不好|发挥失常|压力很大/;
const RELOCATION_RE = /搬家|离乡|迁居|长期异地|离开家/;
const LIVE_EVIDENCE = new Set(["confirmed", "draft", "pending_confirmation"]);
const ANSWER_CLASSES: ReadonlySet<string> = new Set(["yes", "weak_yes", "no", "unsure"]);
function signKey(value: string): string {
return value.replace(/座$/, "").trim();
}
function clockMinutes(time: string): number {
const [hour, minute] = time.split(":").map(Number);
return hour * 60 + minute;
@@ -136,19 +120,39 @@ export function remainingVargaSplits(
return rows;
}
export function askedKeysFromOccupationEvidence(
export function askedKeysFromLedgerEvidence(
evidence: readonly Readonly<{
status?: string | null;
domain?: string | null;
eventKind?: string | null;
summary?: string | null;
}>[],
): string[] {
const keys = new Set<string>();
for (const item of evidence) {
if (item.status && !LIVE_EVIDENCE.has(item.status)) continue;
const summary = item.summary ?? "";
const occupation = item.domain === "occupation" || item.eventKind === "occupation_note";
if (!occupation) continue;
if (DUTY_ANSWERED_RE.test(item.summary ?? "")) return ["varga.d10"];
if (occupation || DUTY_ANSWERED_RE.test(summary)) keys.add("varga.d10");
if (item.domain === "education" && EXAM_QUALITY_RE.test(summary)) {
keys.add("varga.d24");
keys.add("varga.d5");
}
const relocation = item.domain === "relocation" || item.eventKind === "home_change";
if (relocation || RELOCATION_RE.test(summary)) keys.add("varga.d4");
}
return [];
return [...keys];
}
export function askedKeysFromOccupationEvidence(
evidence: readonly Readonly<{
status?: string | null;
domain?: string | null;
eventKind?: string | null;
summary?: string | null;
}>[],
): string[] {
return askedKeysFromLedgerEvidence(evidence);
}
export function buildCandidateContrastPacket(input: {
@@ -179,7 +183,6 @@ export function buildCandidateContrastPacket(input: {
transitions: input.transitions ?? [],
});
const fromVarga = vargaProbe(
vargaDifferences,
remainingSplits,
input.candidateSetVersion,
input.calculationResultId ?? null,
@@ -293,48 +296,14 @@ function probeFromEngine(
}
function vargaProbe(
differences: readonly VargaDifference[],
remainingSplits: readonly RemainingVargaSplit[],
candidateSetVersion: string,
calculationResultId: string | null,
asked: ReadonlySet<string>,
): CandidateDiscriminatorProbe | null {
const remaining = remainingSplits.find((item) => !vargaLayerAsked(asked, item.layer));
if (remaining) {
return vargaProbeFromRemaining(remaining, candidateSetVersion, calculationResultId);
}
const d10 = differences.find((item) => item.layer === "d10" && item.signs.length >= 2);
const d9 = differences.find((item) => item.layer === "d9" && item.signs.length >= 2);
const chosen = d10 && !vargaLayerAsked(asked, "d10")
? d10
: d9 && !vargaLayerAsked(asked, "d9")
? d9
: null;
if (!chosen) return null;
const semanticKey = `varga.${chosen.layer}.${chosen.signs.join("|")}`;
if (asked.has(semanticKey)) return null;
const predictions = chosen.signs.map((sign) => D10_PREDICTIONS[signKey(sign)] ?? `${sign} 这一段更常见的前事`);
const outcomes: ContrastExpectedOutcome[] = chosen.signs.map((sign, index) => ({
outcomeId: `supports_${signKey(sign)}`,
supportsCandidateIds: [sign],
conflictsCandidateIds: chosen.signs.filter((_, other) => other !== index),
}));
const layerLabel = chosen.layer.toUpperCase();
const question = chosen.layer === "d10"
? `当前几个候选在事业盘上还分得开。请核对一段还没用进评分的职业前事:更接近${predictions.join(",还是")}`
: `当前几个候选在关系盘上还分得开。请核对一段还没用进评分的感情前事,用来对照 ${layerLabel} 差异。`;
return {
probeId: `contrast:${semanticKey}`,
candidateSetVersion,
question,
expectedOutcomes: outcomes,
candidateSplitHash: semanticKey,
informationGain: 0.12,
sourceFeatures: [{ technique: layerLabel, calculationResultId }],
domain: chosen.layer === "d10" ? "career" : "relationship",
year: null,
semanticKey,
};
if (!remaining) return null;
return vargaProbeFromRemaining(remaining, candidateSetVersion, calculationResultId);
}
function vargaLayerAsked(asked: ReadonlySet<string>, layer: string): boolean {
@@ -354,12 +323,8 @@ function vargaProbeFromRemaining(
const outcomes = remainingOutcomes(split.groups, allMinutes);
const semanticKey = `varga.${split.layer}.${split.groups.map((group) => group.join("|")).join("/")}`;
const layerLabel = split.layer.toUpperCase();
const education = split.layer === "d24" || split.layer === "d5";
const question = education
? "当前几个候选在学业盘上还分得开。请核对一段还没用进评分的学业前事:那次高考或重要考试有没有发挥明显失常、压力很大?"
: split.layer === "d10"
? "当前几个候选在事业盘上还分得开。请核对一段还没用进评分的职业前事:长期更接近照顾或家庭,还是台前带人,还是技术执行或分析?"
: `当前几个候选在关系盘上还分得开。请核对一段还没用进评分的感情前事,用来对照 ${layerLabel} 差异。`;
const domain = remainingDomain(split.layer);
const question = remainingQuestion(split.layer, layerLabel);
return {
probeId: `contrast:${semanticKey}`,
candidateSetVersion,
@@ -368,12 +333,32 @@ function vargaProbeFromRemaining(
candidateSplitHash: semanticKey,
informationGain: split.layer === "d24" || split.layer === "d5" ? 0.16 : 0.12,
sourceFeatures: [{ technique: layerLabel, calculationResultId }],
domain: education ? "education" : split.layer === "d10" ? "career" : "relationship",
domain,
year: null,
semanticKey,
};
}
function remainingDomain(layer: string): string {
if (layer === "d24" || layer === "d5") return "education";
if (layer === "d10") return "career";
if (layer === "d4") return "relocation";
return "relationship";
}
function remainingQuestion(layer: string, layerLabel: string): string {
if (layer === "d24" || layer === "d5") {
return "当前几个候选在学业盘上还分得开。请核对一段还没用进评分的学业前事:那次高考或重要考试有没有发挥明显失常、压力很大?";
}
if (layer === "d10") {
return "当前几个候选在事业盘上还分得开。请核对一段还没用进评分的职业前事:长期更接近照顾或家庭,还是台前带人,还是技术执行或分析?";
}
if (layer === "d4") {
return "当前几个候选在居所盘上还分得开。请核对一段还没用进评分的搬家或离乡:那几年有没有明显搬家、离乡或长期异地?";
}
return `当前几个候选在关系盘上还分得开。请核对一段还没用进评分的感情前事,用来对照 ${layerLabel} 差异。`;
}
function remainingOutcomes(
groups: readonly (readonly string[])[],
allMinutes: readonly string[],
@@ -28,6 +28,7 @@ export type RectificationChoiceFrame = Readonly<{
question_id: string;
method_id: string;
period: string;
prompt: string;
varga: string | null;
why: string;
option_a_hint: string;
@@ -296,6 +297,7 @@ export function buildChoiceFrame(
question_id: `${followup.method_id}:${followup.ask_theme}:${scoring ? "score" : "holdout"}`,
method_id: followup.method_id,
period: periodFor(input.evidence, domain, input.probes, input.birthDate),
prompt: hypothesis.prompt,
varga: hypothesis.varga,
why: hypothesis.why,
option_a_hint: hypothesis.a,
@@ -318,7 +320,8 @@ function clippedCopy(value: unknown, min: number, max: number): string | null {
}
export function serverOwnedChoiceCopy(frame: RectificationChoiceFrame): AgentChoiceCopy | null {
const prompt = clippedCopy(`${frame.period},有没有这件事?`, 4, 80)
const prompt = clippedCopy(frame.prompt, 4, 80)
?? clippedCopy(`${frame.period},有没有这件事?`, 4, 80)
?? clippedCopy(frame.period, 4, 80);
const optionA = clippedCopy(frame.option_a_hint, 4, 80);
const optionB = clippedCopy(frame.option_b_hint, 4, 80);
@@ -10,7 +10,7 @@ import {
import { isDuplicateProbe } from "../core/duplicate-probes.ts";
import { probeFromEngine } from "../core/probes-from-engine.ts";
import { selectHighestGainProbe } from "../core/select-probe.ts";
import { askedKeysFromOccupationEvidence } from "../core/candidate-contrast-packet.ts";
import { askedKeysFromLedgerEvidence } from "../core/candidate-contrast-packet.ts";
import type { AnswerClass, ConflictProbe, InferenceState } from "../core/types.ts";
import {
isHoldoutVerificationQuote,
@@ -58,7 +58,7 @@ export function askedDiscriminatorKeys(
): string[] {
return [
...askedProbeKeysFromReceipt(receipt),
...askedKeysFromOccupationEvidence(evidence),
...askedKeysFromLedgerEvidence(evidence),
];
}
@@ -71,7 +71,9 @@ export function compactInferenceProjection(state: InferenceState | null | undefi
algorithm_version: state.algorithm_version,
candidate_set_id: state.candidate_set_id,
revision: state.revision,
phase: state.phase,
phase: state.result_status === "discriminating" && state.phase === "event_collection"
? "discrimination"
: state.phase,
result_status: state.result_status,
entropy: state.entropy,
representative_time: state.representative_time,
@@ -6,7 +6,7 @@
*/
import {
askedKeysFromOccupationEvidence,
askedKeysFromLedgerEvidence,
buildCandidateContrastPacket,
} from "../core/candidate-contrast-packet.ts";
import { evaluateCandidateSeparation } from "../core/candidate-separation.ts";
@@ -71,7 +71,7 @@ export function choiceCardFromCaseDossier(dossier: {
const candidateScores = candidateScoresFromDossier(dossier.latestResult);
const askedProbeKeys = [
...askedProbeKeysFromReceipt(dossier.latestResult?.decisionReceipt),
...askedKeysFromOccupationEvidence(dossier.evidence),
...askedKeysFromLedgerEvidence(dossier.evidence),
];
const contrastPacket = buildCandidateContrastPacket({
candidateSetVersion: inference?.candidate_set_id ?? dossier.latestResult?.resultId ?? "none",
@@ -46,7 +46,7 @@ import {
type HoldoutValidationStatus,
} from "../core/decide-next-action.ts";
import {
askedKeysFromOccupationEvidence,
askedKeysFromLedgerEvidence,
selectDiscriminatorProbe,
type CandidateContrastPacket,
type CandidateDiscriminatorProbe,
@@ -151,16 +151,63 @@ function evidenceYear(item: MethodFollowupEvidence): number | null {
return year >= 1900 && year <= 2100 ? year : null;
}
function hasDatedEvidenceInYear(
/** 高考与当年 9 月入学通常是同一学年;年龄带常落在入学年的前一年。 */
const EDUCATION_EXISTENCE_NEARBY_YEARS = 1;
const RECORDED_KIND_LABEL: Readonly<Record<string, string>> = {
education_start: "入学",
education_completion: "毕业",
education_interruption: "学业中断",
education_change: "转学或学业变化",
education_milestone: "学业节点",
relationship_start: "感情开始",
relationship_commitment: "关系确认",
relationship_separation: "感情分开",
relationship_end: "感情结束",
career_entry: "入职",
career_change: "事业变化",
promotion: "升职",
relocation: "搬家",
home_change: "住处变化",
};
function existenceNearbyYears(domain: string): number {
return domain === "education" ? EDUCATION_EXISTENCE_NEARBY_YEARS : 0;
}
function probeYearAlreadyCovered(
evidence: readonly MethodFollowupEvidence[],
domain: string,
year: number,
): boolean {
return evidence.some((item) =>
(item.status === "confirmed" || item.status === "draft" || item.status === "pending_confirmation")
&& item.domain === domain
&& evidenceYear(item) === year
);
const nearby = existenceNearbyYears(domain);
return evidence.some((item) => {
if (item.status !== "confirmed" && item.status !== "draft" && item.status !== "pending_confirmation") {
return false;
}
if (item.domain !== domain) return false;
const itemYear = evidenceYear(item);
if (itemYear === null) return false;
return Math.abs(itemYear - year) <= nearby;
});
}
function recordedKindYearHint(evidence: readonly MethodFollowupEvidence[]): string {
const labels: string[] = [];
const seen = new Set<string>();
for (const item of evidence) {
if (!isConfirmedDated(item)) continue;
const year = evidenceYear(item);
if (year === null) continue;
const kindLabel = RECORDED_KIND_LABEL[item.eventKind ?? ""] ?? null;
if (!kindLabel) continue;
const token = `${year}:${kindLabel}`;
if (seen.has(token)) continue;
seen.add(token);
labels.push(`${year}${kindLabel}`);
}
if (labels.length === 0) return "";
return `已记下 ${labels.join("、")}。不要再问这些事发生在哪一年。`;
}
function isOccupationNote(item: MethodFollowupEvidence): boolean {
@@ -264,7 +311,7 @@ function remainingReverseVerifyProbes(
for (const probe of probes ?? []) {
if (probe.source === "known_event_quality" || probe.role === "distinguish") continue;
if (declined.has(probe.domain)) continue;
if (hasDatedEvidenceInYear(evidence, probe.domain, probe.year)) continue;
if (probeYearAlreadyCovered(evidence, probe.domain, probe.year)) continue;
if (CONFLICT_PROBE_SOURCES.has(probe.source)) {
dasha.push(probe);
} else {
@@ -284,7 +331,7 @@ function remainingConflictProbes(
for (const probe of probes ?? []) {
if (!CONFLICT_PROBE_SOURCES.has(probe.source)) continue;
if (declined.has(probe.domain)) continue;
if (hasDatedEvidenceInYear(evidence, probe.domain, probe.year)) continue;
if (probeYearAlreadyCovered(evidence, probe.domain, probe.year)) continue;
const semantic = probe.semantic_key ?? `${probe.domain}.${probe.year}`;
const split = probe.candidate_split_hash ?? "";
if (askedKeys.has(semantic) || (split && askedKeys.has(split))) continue;
@@ -302,12 +349,22 @@ function coverage(
return { method_id: methodId, status };
}
function collectHint(why: string, varga: string, extra = ""): string {
return `${why}本题绑定 ${varga}${extra}用自然语言问一件带大概年份的经历。不要调用 set-focus,界面不出点选卡。允许模糊年份。`.replace(/\s+/g, " ").trim();
function collectHint(
why: string,
varga: string,
extra = "",
evidence: readonly MethodFollowupEvidence[] = [],
): string {
return `${why}本题绑定 ${varga}${extra}${recordedKindYearHint(evidence)}用自然语言问一件带大概年份的经历。不要调用 set-focus,界面不出点选卡。允许模糊年份。不得把未证实的年份说成已经发生。`.replace(/\s+/g, " ").trim();
}
function agentHint(why: string, varga: string, extra = ""): string {
return `${why}本题绑定 ${varga}${extra}点选卡已由服务器按 choice_frame 持久化。用简体中文只问这一句已持久化的题干;年份和事件家族以 choice_frame.period 与探针为准,不得发明年份。不要调用 set-focus。正文不要复述选项。`.replace(/\s+/g, " ").trim();
function agentHint(
why: string,
varga: string,
extra = "",
evidence: readonly MethodFollowupEvidence[] = [],
): string {
return `${why}本题绑定 ${varga}${extra}${recordedKindYearHint(evidence)}点选卡已由服务器按 choice_frame 持久化。用简体中文只问这一句已持久化的题干;年份和事件家族以 choice_frame.period 与探针为准,不得发明年份,不得把探针年份说成已经发生的事实。不要调用 set-focus。正文不要复述选项。`.replace(/\s+/g, " ").trim();
}
export function shouldAttachChoiceFrame(
@@ -394,11 +451,10 @@ export function isOfferBlockingFollowup(
function discriminatorFromFollowup(followup: MethodFollowup | null): CandidateDiscriminatorProbe | null {
if (!followup) return null;
const discriminator = followup.source === "event_probe"
|| followup.source === "varga_observation"
|| followup.source === "precision_stage"
|| followup.intent === "distinguish_candidates";
if (!discriminator) return null;
const realProbe = followup.source === "event_probe"
|| followup.source === "reverse_verify"
|| (followup.source === "active_focus" && followup.intent === "distinguish_candidates");
if (!realProbe) return null;
const split = followup.candidate_split_hash ?? followup.semantic_key ?? followup.method_id;
return {
probeId: split,
@@ -441,7 +497,9 @@ export function conversationalSessionOutcome(input: {
selectionAllowed: input.selectionAllowed,
snapshotCurrent: input.snapshotCurrent,
candidateScores: input.candidateScores ?? [],
discriminatorProbe: input.discriminatorProbe ?? discriminatorFromFollowup(input.nextFollowup),
discriminatorProbe: input.discriminatorProbe !== undefined
? input.discriminatorProbe
: discriminatorFromFollowup(input.nextFollowup),
holdoutValidation: input.holdoutValidation,
});
return sessionKindFromNextAction(decided.type);
@@ -576,6 +634,10 @@ export function buildMethodFollowupPlan(input: {
: null,
};
};
const collect = (why: string, varga: string, extra = "") =>
collectHint(why, varga, extra, input.evidence);
const ask = (why: string, varga: string, extra = "") =>
agentHint(why, varga, extra, input.evidence);
const declined = declinedDomains(input.declinedTopics ?? []);
const dashaCovered = input.evidence.some(isConfirmedDated);
const relationshipCovered = hasConfirmedDomain(input.evidence, "relationship");
@@ -666,7 +728,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: theme,
domain: probe.domain,
kind_hint: REVERSE_VERIFY_KIND[probe.domain],
user_prompt_hint: agentHint(
user_prompt_hint: ask(
`当前排盘已采用。按该分钟核对:${probe.year_label} 是否有${probe.event_family}。对得上写入账本并重算;对不上可以改选其他候选。不确认唯一分钟。`,
REVERSE_VERIFY_VARGA[probe.domain],
),
@@ -688,7 +750,7 @@ export function buildMethodFollowupPlan(input: {
const stage = input.precisionStage ?? null;
const askedKeys = new Set([
...(input.askedProbeKeys ?? []),
...askedKeysFromOccupationEvidence(input.evidence),
...askedKeysFromLedgerEvidence(input.evidence),
]);
const conflictProbe = dashaCovered
? remainingConflictProbes(input.eventProbes, input.evidence, declined, askedKeys)[0] ?? null
@@ -700,7 +762,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "dated_event",
domain: null,
kind_hint: null,
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"可以先从最容易想起的一件带大概时间的经历开始。",
"本命 Dasha + 行运(方法1",
"不要求一次列出 1015 条。",
@@ -714,7 +776,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: REVERSE_VERIFY_THEME[conflictProbe.domain],
domain: conflictProbe.domain,
kind_hint: REVERSE_VERIFY_KIND[conflictProbe.domain],
user_prompt_hint: agentHint(
user_prompt_hint: ask(
`当前候选时间还分不开。按冲突分钟反推:${conflictProbe.year_label} 是否有${conflictProbe.event_family}。对得上写入账本并重算以筛窗;对不上关闭该问。不要问两套盘哪个更像。不确认唯一分钟。`,
REVERSE_VERIFY_VARGA[conflictProbe.domain],
),
@@ -731,7 +793,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "relationship_style",
domain: "relationship",
kind_hint: "relationship_start",
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"可以先说一段记得大概时间的感情或关系变化。",
"D9",
"对照 D9 上升类型表(白羊主动热情、天蝎深刻占有等)只作校时方法,不是命运承诺。",
@@ -745,7 +807,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "career_style",
domain: "career",
kind_hint: "career_entry",
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"可以先说一段记得大概时间的工作或事业变化。同一件事会同时对照本命第 10 宫和 D10。",
"D10",
"可用 D10 事业类型表作校时对照。",
@@ -759,7 +821,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "family_event",
domain: "family",
kind_hint: "family_event",
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"可以先说一段记得大概时间的家人相关变化。同一件事会对照 D12 父母盘、D7 子女盘和 D3 兄弟盘。",
"D12 / D7 / D3",
"六亲用 Raman 六步:前三步可执行,后三步标方法论层。",
@@ -773,7 +835,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "occupation",
domain: "occupation",
kind_hint: "occupation_note",
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"你长期做什么工作?对照本命第 10 宫和 D10。",
"D1-H10 + D10",
"可用事业类型表(白羊领导创业、天蝎研究转化等)作校时方法。",
@@ -788,7 +850,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: REVERSE_VERIFY_THEME[domain],
domain,
kind_hint: REVERSE_VERIFY_KIND[domain],
user_prompt_hint: agentHint(
user_prompt_hint: ask(
contrastProbe.question,
REVERSE_VERIFY_VARGA[domain],
"按候选盘面差异核对前事,不要问两套盘哪个更像。",
@@ -806,7 +868,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "dated_event",
domain: null,
kind_hint: null,
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"窗口里本命上升还可能落在两段。按 choice_frame.period 与探针问一件前事是否发生,用来筛这两段。不要问两套盘哪个更像。",
"本命上升 / Dasha",
),
@@ -819,7 +881,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "relationship_style",
domain: "relationship",
kind_hint: "relationship_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"关系盘仍会换升。按探针年份问感情这条线的前事是否发生,用来筛窗。不要问两套盘哪个更像。",
"D9",
"对照 D9 上升类型表只作校时方法。",
@@ -833,7 +895,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "career_style",
domain: "career",
kind_hint: "career_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"事业盘仍会换升。按探针年份问事业这条线的前事是否发生,用来筛窗。不要问两套盘哪个更像。",
"D10",
"可用 D10 事业类型表作校时对照。",
@@ -847,7 +909,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "home_change",
domain: "relocation",
kind_hint: "home_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"居所盘仍会换升。按探针年份问搬家或住处变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D4",
),
@@ -860,7 +922,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "education_style",
domain: "education",
kind_hint: "education_milestone",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"成就盘或学业盘仍会换升。按探针年份问学业或考试变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D5 / D24",
),
@@ -882,7 +944,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "relationship_style",
domain: "relationship",
kind_hint: "relationship_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在关系主题上仍分不开。按探针年份问感情前事是否发生,用来筛窗。不要问两套盘哪个更像。",
"D9",
"对照 D9 上升类型表只作校时方法。",
@@ -896,7 +958,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "career_style",
domain: "career",
kind_hint: "career_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在事业主题上仍分不开。按探针年份问事业前事是否发生,用来筛窗。不要问两套盘哪个更像。",
"D10",
"可用事业类型表作校时对照。",
@@ -910,7 +972,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "home_change",
domain: "relocation",
kind_hint: "home_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在居所主题上仍分不开。按探针年份问搬家或住处变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D4",
),
@@ -923,7 +985,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "education_style",
domain: "education",
kind_hint: "education_milestone",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在学业或成就主题上仍分不开。按探针年份问学业或考试变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D5 / D24",
),
@@ -936,7 +998,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "family_event",
domain: "family",
kind_hint: "family_event",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在家人主题上仍分不开。按探针年份问家人变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D12 / D7 / D3",
),
@@ -949,7 +1011,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "finance_change",
domain: "finance",
kind_hint: "finance_change",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在财务主题上仍分不开。按探针年份问财务变化是否发生,用来筛窗。不要问两套盘哪个更像。",
"D2 / D11",
),
@@ -962,7 +1024,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "health_pressure",
domain: "health_pressure",
kind_hint: "self_health_event",
user_prompt_hint: agentHint(
user_prompt_hint: ask(
"当前候选在健康压力主题上仍分不开。按探针年份问健康或压力变化是否发生,用来筛窗。这不是医学判断。不要问两套盘哪个更像。",
"D30",
),
@@ -997,7 +1059,7 @@ export function buildMethodFollowupPlan(input: {
ask_theme: "horary",
domain: "horary",
kind_hint: "horary_query",
user_prompt_hint: collectHint(
user_prompt_hint: collect(
"有没有第一次认真问起这件事的时间?",
"占问观察盘",
"有的话可以按那个时间观察;没有也不挡给出时间卡。状态是 observation_only。",
@@ -1037,7 +1099,7 @@ export function projectRectificationChoiceCard(
methods: plan.methods,
userStopped: input.userStopped,
candidateScores: input.candidateScores,
discriminatorProbe: selectDiscriminatorProbe(input.contrastPacket ?? null),
discriminatorProbe: selectDiscriminatorProbe(input.contrastPacket ?? null) ?? undefined,
holdoutValidation: input.holdoutValidation,
});
if (