From b50a8f94acd0e6c8aa67405273587f28f3f3f103 Mon Sep 17 00:00:00 2001 From: jesse-ux Date: Mon, 14 Sep 2026 13:43:03 +0800 Subject: [PATCH] fix(ci): update DESIGN contract after hanging spoken questions (BUG-679) Quality gate run 2598 failed because the unwritten-evidence test still required the old persisted-question DESIGN sentence. Align the assertion with the BUG-678 hang-back contract. --- docs/BUG_HISTORY.md | 18 +++++++++++++++++- ...ESS-rectification-spoken-orphan-20260914.md | 6 ++++++ .../rectification-unwritten-evidence.test.ts | 7 ++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index 20f1d860..a1a0cac2 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -10561,6 +10561,22 @@ - 修复:无 `askedTurnId` 的活动焦点一律可挂到最后一条尚无题的助手消息;采集 schema 允许短于 8 字的题干。`persisted_question` 纯文本块只留给一条助手消息都没有的兜底。年份追问仍是口述,不做点选卡。 - 验证:`frontend/tests/rectification-spoken-orphan-20260914.test.ts`;`rectification-collect-prompt.test.ts` 补口述挂回。 - 防复发:挂回规则不得再按 `choice` 排除口述题。不得把年份追问改成点选卡来绕过渲染。不得新增第二套问题组件。 -- 相关记录:BUG-675、BUG-673、BUG-671 +- 相关记录:BUG-675、BUG-673、BUG-671、BUG-679 - 复发自:BUG-675(同一块兜底只修了选择题) - 修复版本:待发布 + +## BUG-679 | staging quality gate 因 DESIGN 合同仍锁旧 persisted-question 文案失败 + +- 状态:resolved +- 首次发现:2026-09-14 +- 最近更新:2026-09-14 +- 影响面:Gitea `Independent Staging Quality Gate` validate「Validate backend, package, frontend, and database contracts」、`frontend/tests/rectification-unwritten-evidence.test.ts`、`frontend/DESIGN.md` +- 用户现象:推送 `2dbcf266` 后门禁 run `2598` 在校验步骤失败;publish/deploy skipped。依赖安装已通过,不是 BUG-677 的 `.venv` mkdir。 +- 触发条件:`npm test --prefix frontend` 在 Linux runner 上跑全量套件。 +- 根因:BUG-678 把 DESIGN 的 persisted-question 从「completed turn that claimed to record evidence」改成「only when no assistant message can carry the prompt」,合同测试仍按旧句匹配,3179 通过、1 失败。产品行为测试未红。 +- 修复:合同断言改跟新 DESIGN:question-live 含无 `asked_turn_id` 的挂回,persisted-question 只留给没有助手消息可挂;旧句不得再出现。不改产品代码。 +- 验证:`frontend/tests/rectification-unwritten-evidence.test.ts` 该条;Gitea gate 对修复 SHA 复跑。 +- 防复发:改 `frontend/DESIGN.md` 校正状态表必须同步源码合同测试。不得为了过门禁把 DESIGN 改回旧裸行口径。 +- 相关记录:BUG-678、BUG-635、BUG-677 +- 复发自:BUG-678(DESIGN 与合同测试分叉) +- 修复版本:待发布 diff --git a/docs/tasks/PROGRESS-rectification-spoken-orphan-20260914.md b/docs/tasks/PROGRESS-rectification-spoken-orphan-20260914.md index dee29d00..e48cb3f9 100644 --- a/docs/tasks/PROGRESS-rectification-spoken-orphan-20260914.md +++ b/docs/tasks/PROGRESS-rectification-spoken-orphan-20260914.md @@ -21,3 +21,9 @@ - 相关单测 46/46:`rectification-spoken-orphan-20260914.test.ts` 3/3,加上 collect-prompt / collection-question-pool / case-receipt-projection / unstampable-probe / surface-state - `npm test`:2989 tests,2822 pass / 153 fail / 14 skip。比上一轮 Windows 基线(2985 / 2818 / 153 / 14)多 4 条全绿用例;失败清单仍是 Caddy/CRLF、Docker、bash、workflow YAML、Skill SHA、page.tsx 源码正则,没有新的校正产品失败 - `next build`:本工作树 `frontend/node_modules` 是 junction,Turbopack 拒绝软链;`--webpack` 编译与 tsc 通过,收集 page data 时因本机 Skill 10.0.26 SHA 与 registry 不一致失败(环境问题,未改 skill 包)。`/` 是否仍 `○ Static` 需在有真实 `node_modules` 且 skill 哈希匹配的树上复核 + +## 门禁修复(BUG-679) + +- Gitea run `2598`(SHA `2dbcf266`)validate 失败:`npm test` 3180 条里 3179 通过、1 失败。失败原文:`not ok 2518 - chat live question only reads the last settled assistant message`,断言 `/completed turn that claimed to record evidence/` 对不上已更新的 `DESIGN.md`。 +- 安装步骤已绿,不是 BUG-677。publish skipped。 +- 合同断言改跟新 DESIGN(原值/新值/原因已写)。产品代码未再改。 diff --git a/frontend/tests/rectification-unwritten-evidence.test.ts b/frontend/tests/rectification-unwritten-evidence.test.ts index 46a24779..b07cf294 100644 --- a/frontend/tests/rectification-unwritten-evidence.test.ts +++ b/frontend/tests/rectification-unwritten-evidence.test.ts @@ -366,5 +366,10 @@ test("chat live question only reads the last settled assistant message", () => { ); assert.doesNotMatch(chat, /const liveQuestionOnMessages = messages\.some/); const design = readFileSync(new URL("../DESIGN.md", import.meta.url), "utf8"); - assert.match(design, /completed turn that claimed to record evidence/); + // 原值: DESIGN.md persisted-question 行写 “completed turn that claimed to record evidence” + // 新值: question-live 写无 asked_turn_id 的口述/选择题挂回最后一条助手消息;persisted-question 只留给没有助手消息可挂 + // 原因: BUG-678 口述题也挂回消息后,已记录证据但焦点未答的完成轮不再走 persisted_question 裸行(BUG-679) + assert.match(design, /without `asked_turn_id` hangs on the last assistant message/); + assert.match(design, /only when no assistant message can carry the prompt/); + assert.doesNotMatch(design, /completed turn that claimed to record evidence/); });