test(rectification): lock failReceipt engine_message for compare failures
Independent Staging Quality Gate / validate (push) Successful in 12m27s
Independent Staging Quality Gate / publish (push) Successful in 7m46s

BUG-659 moved compare tool_failed fingerprints into failReceipt; keep the
source lock on the shared helper so the staging gate still requires a
redacted engine_message.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-13 11:03:20 +08:00
co-authored by Cursor
parent 073a45b73e
commit 5d54d0597d
2 changed files with 12 additions and 1 deletions
@@ -223,7 +223,12 @@ test("compare failure copy and receipt detail stay user-visible without PII", ()
assert.match(agentRun, /withCompareFailedRetryNotice/);
assert.match(agentRun, /rectification-compare-candidates/);
const tools = readFileSync(new URL("../src/mastra/rectification-v9-tools.ts", import.meta.url), "utf8");
assert.match(tools, /engine_message: engineMessageForReceipt/);
// 原值: /engine_message: engineMessageForReceipt/ 写在 compare catch 里
// 新值: failReceipt 统一写 engine_messagecompare catch 调用它
// 原因: BUG-659 失败回执抽成共享 helper,源码锁仍要保住脱敏原文
assert.match(tools, /const message = engineMessageForReceipt\(error\)/);
assert.match(tools, /engine_message: message/);
assert.match(tools, /failReceipt\("rectification-compare-candidates"/);
});
test("idle persist on a stale snapshot calls candidate score once", async () => {