From b4031eff8cbd2b6ae564c756b52abca9cba45d58 Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Fri, 14 Aug 2026 00:45:05 +0800 Subject: [PATCH] test(database): include rectification regenerations in schema snapshot --- docs/BUG_HISTORY.md | 4 ++-- frontend/tests/database-local-business.test.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index 7967feab..57839522 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -3149,6 +3149,6 @@ - 触发条件:同一公开校正工具在一个 NDJSON run 中出现 `failed → started → completed`;或查看任意已完成的 V9 Assistant 消息。 - 根因:客户端 Activity 聚合只保留“曾经失败”的集合,后续成功没有覆盖同工具旧失败;旧版生时校正运行时退役时删除了消息操作 JSX、状态和 handler,而 V9 入口没有迁入,虽然对应 CSS 仍被保留。 - 修复:Activity 改为按工具记录最终终态,后续 `completed` 清除同工具旧失败,只有最终仍为 `failed` 才显示失败凭证。V9 恢复赞、踩、复制与重新生成操作栏,并保持 `完成凭证 → Agent 正文 → 操作栏` 的 DOM 顺序。重新生成使用独立只读 Jyotisha Agent,仅可读取当前 Case,免费且原位替换最新 completed Assistant 正文;不新增 Turn、不写证据或候选、不修改 Case 状态、不调用计费。 -- 验证:新增 Activity reducer、重新生成 runner、公开 stream、UI DOM 与数据库迁移合同回归;聚焦测试、目标 ESLint、TypeScript 与 `git diff --check` 结果以本次本地验证记录为准。真实剪贴板权限、键盘焦点和登录态重新生成仍需浏览器验收。 -- 防复发:Activity 必须以每个工具的最终终态为准,不能把历史瞬时失败永久化;V9 消息动作不得依赖已退役组件。任何“重新生成”都必须是最新回复的只读原位替换,严禁复用普通 message 发送链导致重复证据、重复 Turn 或重复计费。 +- 验证:新增 Activity reducer、重新生成 runner、公开 stream、UI DOM 与数据库迁移合同回归;聚焦测试、目标 ESLint、TypeScript 与 `git diff --check` 结果以本次本地验证记录为准。首次 staging quality gate 还发现全库 schema 快照漏列新表 `agentic_rectification_turn_regenerations`,现已同步更新并纳入全门禁。真实剪贴板权限、键盘焦点和登录态重新生成仍需浏览器验收。 +- 防复发:Activity 必须以每个工具的最终终态为准,不能把历史瞬时失败永久化;V9 消息动作不得依赖已退役组件。任何“重新生成”都必须是最新回复的只读原位替换,严禁复用普通 message 发送链导致重复证据、重复 Turn 或重复计费;新增迁移表时必须同步全库 schema 快照测试。 - 相关记录:BUG-049、BUG-050、BUG-181、BUG-184 diff --git a/frontend/tests/database-local-business.test.ts b/frontend/tests/database-local-business.test.ts index 6cb6bb12..c735d18f 100644 --- a/frontend/tests/database-local-business.test.ts +++ b/frontend/tests/database-local-business.test.ts @@ -50,6 +50,7 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic assert.match(migration.stdout, /applied 20260811010000_consultation_status_service_role_read\.sql/); assert.match(migration.stdout, /applied 20260812010000_agentic_rectification_v9_runtime\.sql/); assert.match(migration.stdout, /applied 20260813010000_agentic_rectification_v9_agent_api\.sql/); + assert.match(migration.stdout, /applied 20260813060000_rectification_turn_regeneration\.sql/); assert.equal( fixture.psql(` @@ -116,6 +117,7 @@ test("local PostgreSQL applies the reviewed business schema and serves authentic "agentic_rectification_results", "agentic_rectification_run_phases", "agentic_rectification_tool_receipts", + "agentic_rectification_turn_regenerations", "agentic_rectification_turns", "billing_products", "birth_time_rectification_action_receipts",