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
@@ -38,6 +38,12 @@ Staging 容器日志(`deploy@118.26.111.127`,密钥 `~/.ssh/jyotisha-staging
- 未跑 `next build` / 首屏 gzip
- 未部署 staging 真机走查
## 门禁跟进
- Independent Staging Quality Gate run 2573 (`073a45b7`) validate 失败:`npm test` **fail 1 / 3136**
- 失败项:`compare failure copy and receipt detail stay user-visible without PII` 仍锁 compare catch 内联 `engine_message: engineMessageForReceipt`BUG-659 已抽到 `failReceipt`
- 源码锁改为断言 helper 写 `engine_message` 且 compare catch 调用 `failReceipt`
## 未做
- 未 push、未部署。真机:开场说两件学业,本轮不得出现 `tool_failed`;兜底或模型正文日期不重复。
@@ -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 () => {