fix(rectification): surface dropped probes and filter tools by the decision
Silent unrenderable discriminators, a missing question-contract golden, and a always-on tool table were hiding fail-closed drops behind the prompt wall. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -568,6 +568,7 @@ test("time-selection cards appear under the latest settled agent bubble only aft
|
||||
assert.doesNotMatch(chat, /send\("message", choiceCard\?\.stop_message/);
|
||||
assert.doesNotMatch(chat, /choiceCardUserMessage/);
|
||||
assert.match(caseRoute, /choice_card: choiceCardFromCaseDossier/);
|
||||
assert.match(caseRoute, /current_question: projectCurrentQuestion/);
|
||||
assert.match(caseRoute, /overlayPublicDecision/);
|
||||
assert.match(caseRoute, /interview: publicDecisionFields/);
|
||||
assert.doesNotMatch(chat, /已完成验证/);
|
||||
@@ -618,20 +619,12 @@ test("rectification Agent output stays natural and keeps tool execution silent",
|
||||
new URL("../../skills/jyotish-birth-time-rectification/references/conversation-strategy.md", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
assert.match(agent, /工具执行过程保持静默/);
|
||||
assert.match(agent, /思考过程必须用简体中文/);
|
||||
assert.match(agent, /对用户说的话必须自己写在正文里,不要只写规划等服务器代写/);
|
||||
assert.match(agent, /本轮做了什么/);
|
||||
assert.match(agent, /完成凭证完全由服务端公开 Activity\/receipt 展示/);
|
||||
assert.match(agent, /禁止只说记下了、会话会保留、以后再继续/);
|
||||
assert.match(agent, /根据用户自然语言语义区分“当前问题没有证据”“停止整个证据收集”和“恢复继续校正”/);
|
||||
assert.match(agent, /rectification-read-case 传 resume=true/);
|
||||
assert.match(agent, /工具执行保持静默/);
|
||||
assert.match(agent, /思考用简体中文写在思维链/);
|
||||
assert.match(agent, /对用户说的话必须自己写在正文里/);
|
||||
assert.doesNotMatch(route, /action === "message" && caseStatus === "paused"/);
|
||||
assert.match(agent, /前者调用 rectification-resolve-focus/);
|
||||
assert.match(agent, /全局停止则调用 rectification-stop-and-review/);
|
||||
assert.doesNotMatch(agent, /USER_STOP_PATTERN|USER_STOP_NEGATION_PATTERN/);
|
||||
assert.match(agent, /skill_verification_report/);
|
||||
assert.match(agent, /D9\/D10 类型对照/);
|
||||
assert.doesNotMatch(agent, /分盘句和宫位表由界面展示/);
|
||||
assert.match(skill, /不得叙述读取 Skill/);
|
||||
assert.match(skill, /完整回复可以(?:是)?零(?:个)?问题/);
|
||||
@@ -640,7 +633,7 @@ test("rectification Agent output stays natural and keeps tool execution silent",
|
||||
assert.match(strategy, /没有更多事件/);
|
||||
assert.match(strategy, /(?:无需|不要求)结束、暂停或保存进度/);
|
||||
assert.match(strategy, /不要一进场就出 A\/B\/C\/D/);
|
||||
assert.match(agent, /不要提点选卡/);
|
||||
assert.match(agent, /没有持久化选择题时,用自然语言问一件带大概年份的经历/);
|
||||
});
|
||||
|
||||
test("clear current-turn events go through the batch evidence service", () => {
|
||||
@@ -648,9 +641,7 @@ test("clear current-turn events go through the batch evidence service", () => {
|
||||
new URL("../src/mastra/rectification-v9-tools.ts", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
assert.match(agent, /当前轮新事件一律走 rectification-record-evidence-batch/);
|
||||
assert.match(agent, /rectification-confirm-evidence 只用于用户对已有 pending 明确说“对\/是”/);
|
||||
assert.match(agent, /不得要求用户把已说清的事件再发一遍/);
|
||||
assert.match(agent, /新事件走 rectification-record-evidence-batch/);
|
||||
assert.doesNotMatch(agent, /分别调用 rectification-propose-evidence 和 rectification-confirm-evidence/);
|
||||
assert.doesNotMatch(agent, /“是\/对”只能确认当前 pending draft/);
|
||||
assert.match(tools, /同一轮有两件及以上可拆分事件时必须改用 rectification-record-evidence-batch/);
|
||||
@@ -658,20 +649,15 @@ test("clear current-turn events go through the batch evidence service", () => {
|
||||
});
|
||||
|
||||
test("the Agent prompt cannot offer candidates while asking for more evidence", () => {
|
||||
// The hard boundary lives in the prompt; no tool input carries an
|
||||
// offer_selection boolean anymore.
|
||||
assert.match(agent, /不得在同一回复中一边要求继续补证据,一边提供候选采用/);
|
||||
assert.match(agent, /id 不是 adopt_representative、validated_range、provisional_range 或 provisional_range_user_stopped 时不得调用 rectification-offer-candidates/);
|
||||
assert.match(agent, /verify_adopted_time/);
|
||||
assert.match(agent, /event_probe/);
|
||||
assert.match(agent, /至少 3 条训练事件/);
|
||||
assert.match(agent, /2 个领域/);
|
||||
assert.match(agent, /发挥质量/);
|
||||
assert.match(agent, /selection_allowed 只表示可以采用代表性时间/);
|
||||
assert.doesNotMatch(agent, /offer_selection/);
|
||||
assert.doesNotMatch(agent, /id 不是 adopt_representative、validated_range、provisional_range 或 provisional_range_user_stopped 时不得调用 rectification-offer-candidates/);
|
||||
const tools = readFileSync(
|
||||
new URL("../src/mastra/rectification-v9-tools.ts", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
assert.match(tools, /function agentToolKeysForDecision/);
|
||||
assert.match(tools, /dropped_probes: inspectDiscriminatorProbes/);
|
||||
assert.match(tools, /dropped_probes: decision.droppedProbes/);
|
||||
assert.doesNotMatch(tools, /offer_selection/);
|
||||
});
|
||||
|
||||
@@ -696,7 +682,7 @@ test("adopted time offers a consultation handoff without unique-minute copy", ()
|
||||
assert.match(chat, /choiceAttachment/);
|
||||
assert.match(page, /startConsultationAfterRectification/);
|
||||
assert.match(page, /createSession\(modelCatalog\.defaultModelId\)/);
|
||||
assert.match(agent, /start_consultation/);
|
||||
assert.doesNotMatch(agent, /start_consultation/);
|
||||
assert.doesNotMatch(agent, /本会话以代表性时间收口|本轮校正已收口/);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user