fix(web): update consult source contracts for the declared-window path

BUG-341 added a third agentic consultation stream and renamed the homepage draft entrypoint, but the exact-count contracts still described two paths, so staging validate failed before publish.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-21 17:59:07 +08:00
co-authored by Cursor
parent a03756bf18
commit 6a0394aa57
5 changed files with 36 additions and 16 deletions
+17
View File
@@ -5162,3 +5162,20 @@
- 相关记录:BUG-009、BUG-073、BUG-202、BUG-273
- 复发自:BUG-202(服务端公共日盘已修好,首页无分钟入口后来又把 entrypoint 丢掉,普通 session 仍走整题拒绝;校正还被当成功能门)
- 修复版本:9958e00a
## BUG-342 | BUG-341 未更新咨询源码合同,staging quality gate 连续失败
- 状态:resolved
- 首次发现:2026-08-21
- 最近更新:2026-08-21
- 影响面:Gitea `backend-quality-gate` `validate`、`frontend/tests/application-billing-contract.test.ts`、`frontend/tests/consultation-stream-recovery.test.ts`、`frontend/tests/chat-navigation-a11y-contract.test.ts`、`frontend/tests/composer-isolation-contract.test.ts`;点选卡提交因此无法发布
- 用户现象:向 `staging` 推送后质量门失败,镜像未发布,站点仍停在 `e7f4030e`。run `2026`(BUG-341)与 run `2027`(点选卡)均是 `validate` 失败、`publish` 跳过。前端测试摘要 `# tests 1871 / pass 1865 / fail 6`。
- 触发条件:`npm test --prefix frontend`。BUG-341 增加声明窗口咨询路径并改了首页草稿变量后,精确计数合同仍按两条 agentic 路径与 `setDraftEntrypoint(entrypoint)` 断言。
- 根因:咨询路由现有三条 agentic 首流(公共/百科、声明窗口、本命)及对应重试,`continueAfterDisconnect`、`abortSignal`、`settleRun` onError/onCancel 都变成 3/5。首页 `send()` 把草稿 entrypoint 收成 `consultEntrypoint`,且校正交接会在积分检查前清一次草稿。合同仍用 `send()` 里第一次 `setDraft("")` 当发送清草稿标记,切片失效。这是 BUG-308 同类:产品改了字面,源码合同没一起改。
- 修复:把计量次数改成三条路径的实际次数;失败回填断言 `consultEntrypoint`;积分不足合同改为对照真正发送清草稿(`conversationAnchor.anchorToLatest()` 之后),不再误伤校正交接。
- 验证:上述四份合同测试本地 35/35;此前失败的 6 项均通过。
- 防复发:再增加咨询 agent 路径时必须同步 `usages.push`、`retryForAnswer`、`continueAfterDisconnect`、`abortSignal: agentAbortSignal` 与 `settleRun` onError/onCancel 的精确计数。切 `send()` 清草稿不得用文件里第一次 `setDraft("")`。失败回填的 entrypoint 变量名必须随 `send()` 一起改。
- 相关记录:BUG-308、BUG-341
- 复发自:BUG-308(源码合同锚点过期把无关提交打红);BUG-341(第三条咨询路径与草稿变量未改合同)
- 修复版本:pending