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:
@@ -1255,6 +1255,10 @@ test("public tool surface stays at 14 and new cases bind 10.0.13", () => {
|
||||
assert.match(skill, /D9\/D10 类型表是校时方法/);
|
||||
assert.doesNotMatch(skill, /±5 分钟确定性/);
|
||||
assert.doesNotMatch(skill, /KP 政策跳过不挡提出门/);
|
||||
const tools = readFileSync(new URL("../src/mastra/rectification-v9-tools.ts", import.meta.url), "utf8");
|
||||
assert.match(tools, /function agentVisibleLatestProjection/);
|
||||
assert.match(tools, /candidate_contrast_packet: _packet/);
|
||||
assert.match(tools, /current_probe: null/);
|
||||
});
|
||||
|
||||
test("Mastra hides active candidates when the receipt range excludes one of them", () => {
|
||||
@@ -1780,6 +1784,47 @@ test("answered duty language skips window D10 and uses remaining D24", () => {
|
||||
assert.doesNotMatch(plan.next_followup?.semantic_key ?? "", /varga\.d10/);
|
||||
});
|
||||
|
||||
test("low-gain career event probe does not outrank a renderable high-gain D24 contrast probe", () => {
|
||||
const plan = buildMethodFollowupPlan({
|
||||
evidence: CLASSIC_COVERAGE.filter((item) => item.domain !== "horary"),
|
||||
eventProbes: [{
|
||||
...CAREER_CONFLICT_PROBE,
|
||||
year: 2023,
|
||||
year_label: "2023 年前后",
|
||||
semantic_key: "career.2023.dasha_activation",
|
||||
information_gain: 0.56,
|
||||
candidate_split_hash: "set-test:career:2023",
|
||||
}],
|
||||
contrastPacket: {
|
||||
candidateSetVersion: "05:00-05:14",
|
||||
vargaDifferences: [],
|
||||
probes: [{
|
||||
probeId: "contrast:varga.d24.05:00/05:07|05:10|05:14",
|
||||
candidateSetVersion: "05:00-05:14",
|
||||
question: "当前几个候选在学业盘上还分得开。",
|
||||
expectedOutcomes: [
|
||||
{ outcomeId: "yes", supportsCandidateIds: ["05:00"], conflictsCandidateIds: ["05:07", "05:10", "05:14"] },
|
||||
{ outcomeId: "no", supportsCandidateIds: ["05:07", "05:10", "05:14"], conflictsCandidateIds: ["05:00"] },
|
||||
],
|
||||
candidateSplitHash: "varga.d24.05:00/05:07|05:10|05:14",
|
||||
informationGain: 2.503258,
|
||||
sourceFeatures: [{ technique: "D24", calculationResultId: RESULT_ID }],
|
||||
domain: "education",
|
||||
year: null,
|
||||
semanticKey: "varga.d24.05:00/05:07|05:10|05:14",
|
||||
choiceKind: "event_quality",
|
||||
}],
|
||||
},
|
||||
candidatesSeparated: false,
|
||||
});
|
||||
assert.equal(plan.next_followup?.semantic_key, "varga.d24.05:00/05:07|05:10|05:14");
|
||||
assert.equal(plan.next_followup?.choice_frame?.option_d_answer_class, "unsure");
|
||||
assert.equal(plan.next_followup?.choice_frame?.period, "当前这几个候选");
|
||||
assert.match(plan.next_followup?.choice_frame?.prompt ?? "", /学业|考试发挥|学习压力/);
|
||||
assert.doesNotMatch(plan.next_followup?.choice_frame?.prompt ?? "", /入职、升职/);
|
||||
assert.ok((plan.next_followup?.selection_score ?? 0) > 0.56);
|
||||
});
|
||||
|
||||
const DUMP_COVERAGE = [
|
||||
{
|
||||
status: "confirmed" as const,
|
||||
|
||||
Reference in New Issue
Block a user