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:
@@ -69,15 +69,18 @@ function discriminatorFollowup(overrides: Partial<MethodFollowup> = {}): MethodF
|
||||
function invalidStyleFollowup(
|
||||
styleOptions: readonly EventProbeStyleOption[] | undefined,
|
||||
eventFamily = "升学结果或学习环境出现明显变化",
|
||||
choiceKind: "existence" | "varga_style" | "event_quality" = "existence",
|
||||
): MethodFollowup {
|
||||
const valid = discriminatorFollowup();
|
||||
return {
|
||||
...valid,
|
||||
choice_kind: choiceKind,
|
||||
choice_frame: buildChoiceFrame({
|
||||
method_id: "dasha_events",
|
||||
ask_theme: "dated_event",
|
||||
domain: "education",
|
||||
user_prompt_hint: "ask",
|
||||
choice_kind: choiceKind,
|
||||
}, {
|
||||
probes: [{
|
||||
year: 2016,
|
||||
@@ -92,6 +95,7 @@ function invalidStyleFollowup(
|
||||
role: "distinguish",
|
||||
information_gain: 0.4,
|
||||
semantic_key: "education:2016",
|
||||
choice_kind: choiceKind,
|
||||
style_options: styleOptions,
|
||||
}],
|
||||
}),
|
||||
@@ -219,17 +223,12 @@ test("complete dynamic event options persist a server-owned focus", async () =>
|
||||
});
|
||||
});
|
||||
|
||||
test("missing, duplicate, incomplete, or illegal dynamic options skip focus persistence", async () => {
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup(undefined));
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup(DYNAMIC_STYLE_OPTIONS.slice(0, 3)));
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup([
|
||||
...DYNAMIC_STYLE_OPTIONS,
|
||||
{ label: "另一种明确发生", answer_class: "yes" },
|
||||
]));
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup([
|
||||
{ ...DYNAMIC_STYLE_OPTIONS[0], label: "08:12 左右发生" },
|
||||
...DYNAMIC_STYLE_OPTIONS.slice(1),
|
||||
]));
|
||||
test("non-renderable varga styles and empty event family skip focus persistence", async () => {
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup(
|
||||
[{ label: "巨蟹相处主动热情", answer_class: "yes" }],
|
||||
"升学结果或学习环境出现明显变化",
|
||||
"varga_style",
|
||||
));
|
||||
await assertInvalidChoiceSkipped(invalidStyleFollowup(DYNAMIC_STYLE_OPTIONS, " "));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user