fix(rectification): ask reverse-inference probes at engine dasha months
Keep Vimshottari/Narayana start dates instead of truncating to year, so same-year month splits can appear on the choice card. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -128,6 +128,42 @@ test("choice frames ask one biographical event from a server probe, not competin
|
||||
assert.equal(mergeChoiceCard(frame, null), null);
|
||||
});
|
||||
|
||||
test("choice frames keep the engine month lock instead of collapsing to a year", () => {
|
||||
const frame = buildChoiceFrame(
|
||||
{
|
||||
method_id: "d10_career",
|
||||
ask_theme: "dated_event",
|
||||
domain: "career",
|
||||
user_prompt_hint: "unused",
|
||||
},
|
||||
{
|
||||
evidence: [{
|
||||
status: "confirmed",
|
||||
domain: "education",
|
||||
datePrecision: "year",
|
||||
occurredFrom: "2016-01-01",
|
||||
occurredTo: null,
|
||||
}],
|
||||
probes: [{
|
||||
...MOVE_PROBE,
|
||||
year: 2018,
|
||||
month: 3,
|
||||
year_label: "2018 年 3 月前后",
|
||||
domain: "career",
|
||||
event_family: "入职、升职或职责明显加重",
|
||||
source: "dasha_boundary",
|
||||
user_meaning: "时间范围锁定 2018 年 3 月前后;领域锁定 career。",
|
||||
semantic_key: "career.2018.03.dasha_boundary",
|
||||
}],
|
||||
},
|
||||
);
|
||||
assert.ok(frame);
|
||||
assert.equal(frame.period, "2018 年 3 月前后");
|
||||
assert.match(frame.prompt, /2018 年 3 月前后/);
|
||||
assert.match(frame.why, /2018 年 3 月前后/);
|
||||
assert.doesNotMatch(frame.period, /^2018 年前后$/);
|
||||
});
|
||||
|
||||
test("server-owned card names the event family, not a generic 有没有这件事", () => {
|
||||
const frame = buildChoiceFrame(
|
||||
{
|
||||
|
||||
@@ -74,6 +74,32 @@ test("receipt parser drops invalid distinguish probes and known_event_quality",
|
||||
assert.ok((parsed[0]?.information_gain ?? 0) > 0);
|
||||
});
|
||||
|
||||
test("receipt parser keeps engine month on dasha boundary probes", () => {
|
||||
const parsed = parseDiscriminatingEventProbes([{
|
||||
year: 2018,
|
||||
month: 3,
|
||||
year_label: "2018 年 3 月前后",
|
||||
domain: "career",
|
||||
event_family: "职责变化",
|
||||
source: "dasha_boundary",
|
||||
tracks: ["vimshottari", "narayana"],
|
||||
tracks_agree: true,
|
||||
unique_minute_claim: false,
|
||||
user_meaning: "时间范围锁定 2018 年 3 月前后",
|
||||
role: "distinguish",
|
||||
information_gain: 0.4,
|
||||
semantic_key: "career.2018.03.dasha_boundary",
|
||||
candidate_ids: ["05:00", "05:20"],
|
||||
expected_outcomes: [
|
||||
{ answer_class: "yes", supports: ["05:00"], conflicts: ["05:20"] },
|
||||
{ answer_class: "no", supports: ["05:20"], conflicts: ["05:00"] },
|
||||
],
|
||||
}]);
|
||||
assert.equal(parsed[0]?.month, 3);
|
||||
assert.equal(parsed[0]?.year_label, "2018 年 3 月前后");
|
||||
assert.equal(parsed[0]?.source, "dasha_boundary");
|
||||
});
|
||||
|
||||
test("randomized hidden mutated answers change posterior only when mapped", () => {
|
||||
const probe = probeFromEngine({
|
||||
year: 2018,
|
||||
|
||||
@@ -358,6 +358,30 @@ test("dasha conflict probe jumps after four scoreable events leave three trainin
|
||||
}), "collect_evidence");
|
||||
});
|
||||
|
||||
test("dasha conflict probe keeps the engine month on the choice card", () => {
|
||||
const plan = buildMethodFollowupPlan({
|
||||
evidence: [
|
||||
datedEvidence("education", "2016"),
|
||||
datedEvidence("education", "2020"),
|
||||
datedEvidence("relationship", "2018"),
|
||||
datedEvidence("family", "2023"),
|
||||
],
|
||||
eventProbes: [{
|
||||
...CAREER_CONFLICT_PROBE,
|
||||
month: 3,
|
||||
year_label: "2018 年 3 月前后",
|
||||
source: "dasha_boundary",
|
||||
user_meaning: "时间范围锁定 2018 年 3 月前后;领域锁定 career。",
|
||||
semantic_key: "career.2018.03.dasha_boundary",
|
||||
}],
|
||||
});
|
||||
assert.equal(plan.next_followup?.source, "event_probe");
|
||||
assert.equal(plan.next_followup?.choice_frame?.period, "2018 年 3 月前后");
|
||||
assert.equal(plan.next_followup?.year_label, "2018 年 3 月前后");
|
||||
assert.equal(plan.next_followup?.probe_month, 3);
|
||||
assert.match(plan.next_followup?.user_prompt_hint ?? "", /2018 年 3 月前后/);
|
||||
});
|
||||
|
||||
test("three scoreable events in one domain still rotate methods instead of reverse-inferring", () => {
|
||||
const plan = buildMethodFollowupPlan({
|
||||
evidence: [
|
||||
|
||||
Reference in New Issue
Block a user