修正PWA升级验收跨导航等待(09-06-release-gate-integrity / 09-17-company-loan-principal-repayment)

N3 第二轮候选 18315d11:浏览器 371 通过、1 失败;报销付款主链路通过。
PWA 自动导航会销毁旧执行环境,原 expect.poll 回调直接 page.evaluate 因此提前抛错。
改为当前 html 的版本属性断言,保持 45 秒期限、同会话 A/B 联合见证及全部否定断言。
受管定向 1 项通过,无失败、跳过或重试,环境及清理通过;任务/治理检查通过。
应用、资金规则、迁移、门禁范围和并发/重试配置未改。两个失败回执完整保留。
第三轮完整候选验证以新回执为准;独立代码复核及真实还款待验。
仅本地提交,不推送、不部署,不访问生产或真实 OCR。
这个提交包含在:
2026-10-09 08:24:15 +08:00
父节点 18315d1183
当前提交 98bab39798
共修改 7 个文件,包含 45 行新增和 4 行删除
@@ -349,6 +349,7 @@ test.beforeEach(async ({ page }) => {
- Synthetic APIs must be served by a loopback HTTP harness. Do not use `page.route` or `context.route`, because a real Service Worker owns worker-originated requests.
- Switch the same server/origin from build A to B, close the A page while retaining the BrowserContext, then revisit the same route. Do not change port, hostname or profile.
- After switching to B, test code must not reload, clear cookie/cache, unregister a worker, create another BrowserContext or emulate hard refresh. Application-owned update behavior is the subject under test.
- Wait for B's document version with a locator attribute assertion within the existing convergence deadline. A raw `page.evaluate` inside `expect.poll` can throw when the application's expected navigation destroys the old execution context. Keep the version expectation, deadline and all joint witnesses; do not hide arbitrary errors or add test-owned navigation.
- Prove B with a joint witness: controller change or worker version change, controller equals the active registration, browser-fetched no-store `sw.js` fingerprint matches build B, document SHA is B and a B-only hashed asset loaded successfully. The constant `/sw.js` URL alone is not version evidence.
- Assert the business route and synthetic session survive, old-only hashed assets leave Cache Storage, and there are no login fallbacks, JS/CSS 404s, chunk/preload errors, page errors or reload loops.
- If the first B witness fails, freeze the safe ledger and stop. Do not add a second navigation or reload to turn the first failure into an intermittent result.