From e503cc9e93f9d1c6452fa4d91ce364b11add7dd2 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 04:21:35 +0000 Subject: [PATCH] Drive cockpit consistency scenario with a committed mutation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: scenario 4 relied on a pending draft proposal advancing the snapshot watermark, but rdm.draft.propose commits nothing (wm:58 before and after) and draft adoption is high-danger (client cannot forge Confirmed). rdm.reqs.import with a unique probe item is a committed low-danger mutation that advances the watermark — the honest DV-R05 driver. Evidence: tsc clean, vitest green, build green (SELF); wm 58->60 probe against the seeded data recorded in session. Impact: e2e spec only. Refs: rollout I4 --- e2e/rdm-cockpit.playwright.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e/rdm-cockpit.playwright.ts b/e2e/rdm-cockpit.playwright.ts index ea7adec..fb23037 100644 --- a/e2e/rdm-cockpit.playwright.ts +++ b/e2e/rdm-cockpit.playwright.ts @@ -114,13 +114,13 @@ test.describe.serial('I4 文档驾驶舱组合验收', () => { await page.locator('.cockpit-tree-caret').first().click() await page.locator('.cockpit-tree-title', { hasText: '设计说明' }).first().click() const snapBefore = await page.locator('.cockpit-snap').innerText() - // 通过应用自身 API 采纳一个新提案(同源会话;与浏览器渲染解耦)。 - await page.request.post('/api/commands/rdm.draft.propose', { - data: { params: { projectId: (await page.locator('.cockpit-project option:checked').textContent()) || '', sectionId: '', content: '一致性探针内容——不应出现' }, meta: {} }, + // 通过应用自身 API 落一个已提交变更(需求账本新增条目,唯一键防幂等跳过; + // 采纳走高危确认卡、服务端不允许客户端伪造 Confirmed,故用低危提交面驱动)。 + await page.request.post('/api/commands/rdm.reqs.import', { + data: { params: { projectId: await page.locator('.cockpit-project').inputValue(), + items: [{ kind: 'UR', title: `UR-PROBE-${Date.now()} 一致性探针`, statement: '刷新一致性驱动条目', source: 'e2e-probe' }] } }, failOnStatusCode: false, }) - // 上面缺 sectionId 必然 400:真正的驱动是 e2e.sh 早已留好的第二个提案 - // (种子阶段 propose 未采纳的「一致性探针」),这里经面板刷新读取。 await page.getByRole('button', { name: '刷新' }).click() await expect(page.locator('.cockpit-snap')).not.toHaveText(snapBefore) // 版本块前进:出现新版本条目。