Files
Jyotisha/frontend/tests/rectification-copy-voice-20261007.test.ts
T
Jesse_ChenandClaude Opus 5.5 6ec8efd5d2
Independent Staging Quality Gate / validate (push) Successful in 13m22s
Independent Staging Quality Gate / publish (push) Successful in 3m42s
feat(rectification): server-written lines in the same warm voice (BUG-1258)
About 30 fixed rectification lines lose the receipt tone: no 「已记录。」
openings (收到 when the range holds, 好 when it moves), 麻烦 instead of 请,
时间 instead of 候选 in what the user reads, and no 「新建对话」 after
adoption. Numbers, clocks, ranges and the honesty boundaries are unchanged.
CHOICE_ACK_RE also recognises the new acknowledgements, so a model sentence
that repeats one is still dropped; the delivery guard matches the delivery
sentence by containment and does not depend on the opening.

Full suite 4973 / fail 24, identical to 61d6f248; build keeps / Static.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
2026-10-07 11:39:34 +08:00

43 lines
2.4 KiB
TypeScript

// BUG-1258 (2026-10-07): the server-written rectification lines speak in the
// same warm voice as the agent (BUG-1257). No 「已记录。」 receipts, no 「请」,
// no 「新建对话」, and a model sentence that repeats a new server
// acknowledgement is still dropped.
import assert from "node:assert/strict";
import test from "node:test";
import { RECTIFICATION_USER_COPY, postAdoptCheckLead, postAdoptVerifyDoneCopy } from "../src/lib/rectification-agentic/user-copy.ts";
import { composeChoiceNarration } from "../src/lib/rectification-agentic/v9/choice-action.ts";
import { bindSpokenToOpenQuestion } from "../src/lib/rectification-agentic/v9/turn-narration.ts";
test("choice acknowledgements open with 收到 / 好, never a 已记录 receipt (BUG-1258)", () => {
const lines = [
composeChoiceNarration({ optionId: "skip_probe" } as never),
composeChoiceNarration({ optionId: "A", answerClass: "unsure" } as never),
composeChoiceNarration({ optionId: "A", scoring: false } as never),
composeChoiceNarration({ optionId: "A", scoring: true, appliedInference: true } as never),
composeChoiceNarration({ optionId: "A", scoring: true, appliedInference: false } as never),
];
for (const line of lines) {
assert.doesNotMatch(line, /^已记录/, line);
assert.match(line, /^(收到|好)/, line);
}
assert.match(composeChoiceNarration({ optionId: "stop" } as never), /^好,这次校正先到这里/);
});
test("server lines carry no 请-style orders and no 新建对话 (BUG-1258)", () => {
for (const [key, value] of Object.entries(RECTIFICATION_USER_COPY)) {
if (typeof value !== "string") continue;
assert.doesNotMatch(value, /新建对话/, key);
assert.doesNotMatch(value, /请再说|请先到/, key);
}
assert.equal(postAdoptVerifyDoneCopy("05:00", false), "已采用 05:00,之后的对话都按这个时间来看。");
assert.doesNotMatch(postAdoptVerifyDoneCopy("05:00", true), /新建对话/);
assert.match(postAdoptCheckLead("05:00"), /^已采用 05:00。我们再核对一件过去的事。/);
});
test("a model sentence repeating a new server acknowledgement is dropped (BUG-1258)", () => {
const spoken = "收到,这一题没有让范围变窄。\n\n2016 年 9 月上大学记下了。";
const kept = bindSpokenToOpenQuestion(spoken, "2014 年前后,有没有升学、转学或换学习环境?");
assert.doesNotMatch(kept, /这一题没有让范围变窄/);
});