From eded9c724ee849e4c4f1247033dd3baf7c6a353a Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Thu, 1 Oct 2026 00:28:56 +0800 Subject: [PATCH] test(rectification): isolate the open-route domain test from the account-deletion freeze merged on staging; local Docker DB checklist (BUG-1131) Staging 96adbce3 added refuseWhenAccountDeletionPending to the open route; the domain test's call counter saw its service RPC. The freeze has its own suite, so the test mocks it as not frozen; the invalid-source assertion is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8 --- ...tification-varga-resolution-db-20261001.md | 51 +++++++++++++++++++ ...rectification-product-domain-route.test.ts | 2 + 2 files changed, 53 insertions(+) create mode 100644 docs/testing/rectification-varga-resolution-db-20261001.md diff --git a/docs/testing/rectification-varga-resolution-db-20261001.md b/docs/testing/rectification-varga-resolution-db-20261001.md new file mode 100644 index 00000000..8eb4cb28 --- /dev/null +++ b/docs/testing/rectification-varga-resolution-db-20261001.md @@ -0,0 +1,51 @@ +# 本地真 Docker 复核:盘型口径修复(BUG-1131)数据库测试 + +> 给产品负责人在自己电脑上跑。Claude 的验收机没有 Docker,用独立 PostgreSQL 17.9 + 本地替身跑过全量数据库测试;这份清单用真 `postgres:17-alpine` 容器再确认一次,作为合入前的正式证据。 + +## 你需要 + +- 已安装并启动 Docker Desktop(或 Linux 上的 Docker Engine + Compose)。 +- Node 22(`node -v` 显示 v22.x)。 + +## 步骤 + +1. 取代码(在仓库目录里): + + ```bash + git fetch origin + git worktree add .worktrees/varga-db-check origin/codex/rectification-varga-resolution-fix-20261001 + cd .worktrees/varga-db-check/frontend + npm ci + ``` + +2. 跑数据库测试(约 15–30 分钟),保存结果: + + ```bash + npm run test:db 2>&1 | tee ../../varga-db-fix.log + ``` + +3. 看最后几行: + + ```bash + grep -E "^# (tests|pass|fail|cancelled|skipped)" ../../varga-db-fix.log + grep -E "^not ok" ../../varga-db-fix.log + ``` + +## 怎样算通过 + +| 看什么 | 期望 | +| --- | --- | +| `# fail` | **0**(Claude 的替身环境里有 3 条与基线相同的环境失败:备份加密、数据库环境变量校验、管理员身份隔离——它们依赖真容器,真 Docker 下应当通过;若仍失败,请在 `origin/staging` 上同样跑一遍,失败名单一致即可) | +| `# cancelled` | 0 | +| 下面几条必须是 `ok` | `segment opening PostgreSQL owns stable domain…`(开案,BUG-1131 本体);`post-bump historical exact Skill survives…`(旧校正会话升级后仍能打开);`segment adoption persists a noncandidate midnight minute…`(两条);`D7 PostgreSQL recomputes priority…`;`saved segment civil tuple flows…`(两条) | + +## 把结果发给 Claude + +把 `varga-db-fix.log` 最后 30 行和 `grep "^not ok"` 的输出贴回会话即可。 + +## 跑完清理 + +```bash +cd ../../.. +git worktree remove .worktrees/varga-db-check +``` diff --git a/frontend/tests/rectification-product-domain-route.test.ts b/frontend/tests/rectification-product-domain-route.test.ts index 61873b4b..a8f900f3 100644 --- a/frontend/tests/rectification-product-domain-route.test.ts +++ b/frontend/tests/rectification-product-domain-route.test.ts @@ -66,6 +66,8 @@ test("production open route reads owned consultation themes and fixes new-case t })}}); mock.module('@/lib/supabase/admin',{namedExports:{createAdminSupabaseClient:()=>accounting}}); mock.module('@/lib/product-access',{namedExports:{isProductEnabled:async()=>true}}); + // Account-deletion freeze (staging 96adbce3) has its own suite; here the account is not frozen. + mock.module('@/lib/account-deletion-server',{namedExports:{refuseWhenAccountDeletionPending:async()=>null}}); const {POST}=await import(pathToFileURL(process.cwd()+'/src/app/api/rectification/cases/open/route.ts').href); const post=async(body)=>POST(new Request('https://example.invalid/api/rectification/cases/open',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)})); const body={intent:'homepage',requestId:'55555555-5555-4555-8555-555555555555',sourceSessionId:sourceId};