A local-first multi-agent app development platform, built on PenguinHarness
fix(benchmarks): a refused delete keeps its confirmation and the reason (7.21)
lmliheng35a51e549f33
diff --git a/changelog/unreleased/2026-10-21-benchmark-delete-refusal.md b/changelog/unreleased/2026-10-21-benchmark-delete-refusal.mdnew file mode 100644index 00000000..57d893a6--- /dev/null+++ b/changelog/unreleased/2026-10-21-benchmark-delete-refusal.md@@ -0,0 +1,33 @@+# A refused Benchmark delete keeps its confirmation and the reason in it++- **Date:** 2026-10-21+- **Type:** fix+- **Scope:** `web`+- **Breaking:** no++[中文版](2026-10-21-benchmark-delete-refusal.zh.md)++Deleting a Benchmark on the evaluation center asks first, and that card used to close from a `finally`:+success or refusal alike. A refused delete therefore left the Benchmark's card on the page (nothing was+deleted) but took the reason with it, and that reason arrived as a toast that dismissed itself after six+seconds and floated over the card instead of in it.++The card now closes only once the delete landed. When the server refuses one, the card stays with its+sentence — the Benchmark's title, unchanged — and the server's own words drawn under it, so the retry is+the same button rather than a hunt for a card that is still there.++## Details++- The rule is the model library's and the scheduled tasks' (`ConfirmModal`'s `refusal` slot): the reason is+ drawn inside the card that asked for the write, and opening the card clears the previous attempt's reason+ first — that sentence was about the previous attempt.+- `features/benchmark/benchmark-page.tsx`: `setDeleting(null)` moved into the success path, the `catch`+ hands the server's words to a `deleteRefusal` state instead of a toast.+- No toast is raised for the refusal any more: the card is the only place it is said, so there is nothing+ that dismisses itself while the user is still looking at the question.+- New browser spec `e2e/benchmark-delete-refusal.spec.mjs` (two tests): a refused delete keeps the card, its+ sentence and the Benchmark, and raises no toast; the retry writes it and only a written one closes the card.++## Compatibility++- No API, wire-format or dependency change: this is only when the card closes and where its refusal is drawn.diff --git a/changelog/unreleased/2026-10-21-benchmark-delete-refusal.zh.md b/changelog/unreleased/2026-10-21-benchmark-delete-refusal.zh.mdnew file mode 100644index 00000000..72e17151--- /dev/null+++ b/changelog/unreleased/2026-10-21-benchmark-delete-refusal.zh.md@@ -0,0 +1,29 @@+# 删除 Benchmark 被拒时,确认框留着,原因也留在框里++- **Date:** 2026-10-21+- **Type:** fix+- **Scope:** `web`+- **Breaking:** no++[English](2026-10-21-benchmark-delete-refusal.md)++评估中心里删除一个 Benchmark 要先确认,而那张卡片过去在 `finally` 里关掉:成功与失败一样关。于是被拒的+删除虽然什么都没删(卡片仍在页面上),原因却跟着框一起没了;那句话只出现在一条六秒后自己消失、且浮在框+上方的 toast 里。++现在只有删除真的落地,卡片才关。服务端拒绝时,卡片留着它的句子 —— Benchmark 的标题一字未改 —— 服务端的+原话画在句子下面,于是重试就是同一个按钮,而不是去找一张「明明还在」的卡片。++## 细节++- 规则来自模型库与定时任务那两轮(`ConfirmModal` 的 `refusal` 槽):原因画在发起写入的那张卡片里,而+ 打开这张卡片时先撤掉上一次的原因 —— 那句话说的事是上一次。+- `features/benchmark/benchmark-page.tsx`:`setDeleting(null)` 搬进成功那一条,`catch` 把服务端的原话+ 交给 `deleteRefusal` 状态,不再弹 toast。+- 被拒时不再弹 toast:卡片是唯一说这句话的地方,也就没有一件会在用户还看着问题时自己消失的东西。+- 新增浏览器用例 `e2e/benchmark-delete-refusal.spec.mjs`(两条):被拒的删除留着卡片、句子与那个+ Benchmark,且不弹 toast;重试真的写进去,而只有写成功的那一次才关框。++## 兼容性++- 没有接口、传输格式或依赖变化;只改了卡片什么时候关、拒绝提示画在哪。diff --git a/docs/FORK-PROGRESS.md b/docs/FORK-PROGRESS.mdindex 1a485c29..8ae314a4 100644--- a/docs/FORK-PROGRESS.md+++ b/docs/FORK-PROGRESS.md@@ -1270,6 +1270,16 @@ mock 路由导入序、`chat-page.tsx` 的旧探针体),自带 4 份用例给 `ui` 加的那个),画在句子下面、重试按钮正上方,重试就是同一个按钮。启停开关不动(没有框可留,被拒仍用 toast)。细节、两态读数与反证见该节。+- [x] **7.21 删除 Benchmark 被拒时,确认框留着,原因也留在框里**(**2026-10-21 第一百轮**落地,+ 提交见该节;1 处源码 `packages/web/src/features/benchmark/benchmark-page.tsx` + 1 个新文件+ `packages/web/e2e/benchmark-delete-refusal.spec.mjs`(2 条用例)+ changelog 一对,+ **无新依赖、不碰接口**):接过 7.19 / 7.20 那条「原因随框留着」的线,7.20 末尾点名的余下页面里+ 最便宜的一页 —— 评估中心的 `confirmDelete` 也在 `finally` 里关框:**被拒的删除什么都没删**+ (卡片仍在、服务器仍持有它),原因只出现在一条六秒后自己消失、且浮在框上方的 toast 里。+ **现在**:只有删除真的落地才 `setDeleting(null)`;被拒时把服务端原话交给 `ConfirmModal` 的+ `refusal` 槽,画在句子下面、重试按钮正上方,重试就是同一个按钮;打开这张卡片时先清掉上一次的+ 原因(一次尝试一条原因)。细节、两态读数与反证见该节。+## 发布 v0.2.0(2026-10-05)用户要求「先发布最新版本到 GitHub,说明是基于 penguin harness 做的」。这一版是**源码版**:@@ -1888,6 +1898,7 @@ v0.2.2」——它只加台账里 v0.2.2 那一节与两行表格,**跟本轮| 2026-10-21 | 7.18 | **缩放视口后的取样等过渡落定:`chat.spec` 那两处 `waitForTimeout(200)` 恰好等于侧栏宽度过渡的 200 ms**(不是移植:`packages/web/e2e/settle.mjs` 加一个 `settledTransitions()`(先让一帧落地,再等 `document.getAnimations()` 里每个正在跑的 `CSSTransition` 各自 `finished`,循环到列表为空;超时带着「还剩哪几个过渡、落在谁身上」报错)+ `chat.spec.mjs` 两处 `waitForTimeout(200)` 改成它,**无新依赖、不碰产品代码、不写 changelog**):第九十五轮末尾点的「唯一没核过的一处」—— 那两条用例先 `setViewportSize`(1280×900 → 877×438)再量工具栏里两个 span 是否重叠。**逐帧量到的实情**:`aside` 是 `hidden md:block w-64 lg:w-72` 且带 `transition … width 0.2s`,877 正好跨过 `lg` 档,于是侧栏 288 → 256 滑了**整整 200 ms**(280.39 → 273.34 → … → 256.11 → 256),把工具栏左半边一起拖着走(标题 x 304 → 272、「运行中」chip 487.73 → 455.73),而右对齐的 Token chip 同一帧就跳到 785.39 —— 旧等待与过渡时长一字不差,实测停稳要 **210 / 219 ms**(两次缩放),余量为零。**为什么不用 `settledBox`**:过渡开头 50 ms 只挪 7.6 px,「连续两帧一致」会把缩放前的 288 认成停稳。至此「等动画落定再量」这一族收口(停靠栏 / 全屏 / 抽屉 / 竖栏 / 弹入 / 缩放) | 六包 `typecheck` **`EXIT=0`**(六个 `Done`;`gen:ifaces` 报 **`src/ifaces.json unchanged`(193 接口 / 589 类型)** —— 本笔不碰源码)· 两份改动文件 `prettier --check` 干净、`npx oxlint` **0 警告 0 错误**、`git diff --check` 干净 · 逐包 test **`EXIT=0`、0 失败**:core **67 文件 / 1399 通过 / 6 跳过** · ui **129 / 1043** · cli **38 / 561** · web **261 文件 / 3212 通过 / 2 跳过** · server **202 文件 / 2955 通过 / 4 跳过** · **整套 e2e**(一次性 `mktemp` 数据根、mock 8931 / 服务端 8930):**105 passed(7.6m)、0 failed**;改到的 `chat.spec` 先单跑 **1 passed(11.4s)** · **反证(同页同一条缩放,老等待与新等待并排量,侧栏过渡放慢到 1.4 s 让差别看得见)**:去 877 时老等待读到侧栏 **284.77** / chip x **484.5**(停稳 256 / 455.73,差 28.77 px),新等待 1413 ms 后读到 256 / 455.73;回 1280 时老等待读到 **257.88** / **457.61**(停稳 288 / 487.73),新等待读到 288 / 487.73;真速下两套读数一致(`settledTransitions` 花 210 / 219 ms)· **这条用例的断言(两 chip 不重叠)今天两态都过** —— 修的是「量的是停稳的布局」这个前提,台账不写成抓到了假绿 · **两处 `layout.spec` 的 390 缩放**本轮量过、不是同一类:390 下 `aside` 是 `display: none`(宽度过渡不参与),200 ms 后只剩一枚 `rotate@svg`,页宽 200 ms 与停稳后逐字相同(390 / 390),故未改 · **真看一眼**:`r96/shots/{look-877,look-toolbar-877,look-1280}.png`,877 下顶栏「运行中」与 Token `0` / 耗时 `0s` 并列不重叠,console 只有按设计的 `GET …/machines` **403**,无其它 error / ≥400;1280 下 `scrollWidth = clientWidth = 1280` · 探针 `r96/probe-{viewport,who-moves,settle-transitions,old-vs-new,resize-390}.mjs` 在 scratchpad · 端口只用 8940 / 8930 / 8931(跑完都已停),3003 / 3004 / 4000 / 7364 / 7369 一个没碰;数据只落在一次性 `/tmp/r96data.*` 与 e2e 的 `mktemp` 根,一个字节没往 `~/.penguin` / `~/.adelie` 里写 · 没有切版本号、没发 npm、没发安装包、没发发布汇总 · **汇报邮件仍发不出去**(993 / 465 的 TCP 都建不起来,同时 github 200,与第九十五轮同一类) | `d3bde807` || 2026-10-21 | 7.19 | **写入被拒的原因留在那张确认框里**(不是移植:`packages/ui` 的 `ConfirmModal` 多一个 `refusal` 槽(有内容时在句子下画一条 `NoticeStrip tone="danger" role="alert"`,没有时槽不画),`packages/web` 新增 `features/models/write-outcome.ts`(`WriteOutcome` / `refusalOf`)把 `persist` 的返回从 `boolean` 换成「写成了 / 被拒了 + 服务端原话」,模型库六处写入选各自把这句话画在哪:配置框四个动作画进它的确认框、删除分组与同步预置画进各自的框、分组密钥与工具栏同步预置与导入分组没有框可留故保留 toast;`common.refused()` 两句文案 + 四份 spec 收紧断言(`cardText()` 助手、`通知` 区必须没有 toast)、changelog 一对):第九十四轮逐处摸过「点击即关、失败只弹 toast」那一族之后留下的那件 —— 框留住了(7.9、7.11–7.15),**原因**却只在一条 6 秒后自己消失、还浮在框上方的 toast 里(`ui` 的时长表 error = 6000 ms)| 六包 `typecheck` **`EXIT=0`**(`gen:ifaces` = `src/ifaces.json unchanged`,193 接口 / 589 类型)· 11 份改动文件 `prettier --check` 干净、`npx oxlint` **0 警告 0 错误**、`git diff --check` 干净 · 逐包 test **`EXIT=0`、0 失败**:core **67 文件 / 1399 通过 / 6 跳过** · ui **129 / 1044** · cli **38 / 561** · web **262 文件 / 3215 通过 / 2 跳过** · server **202 文件 / 2955 通过 / 4 跳过**(中间红过一次:`todo-notice.test.ts` 的守卫读 `onAction` 里第一个 setter,改成先开框再清原因后转绿,没动守卫)· **整套 e2e 105 passed(7.4m)、0 failed**,改到的四份 spec 先单跑 **9 passed(18.4s)** · **反证**:把 `models-page.tsx` 暂存回去重建产物后同一批 spec **5 failed**(红的就是新的两类断言),`stash pop` 重建后 9 passed · **真看一眼**:`r97/look-refusal-card.png` 里句子下面就是 danger 色的「操作被拒绝:models store is closed」,`look-refusal-after-6s.png` 证明 6.5 秒后仍在框里,`通知` 区按钮数 **0**,1280 下 `scrollWidth = clientWidth`,console 只有按设计的 `/machines` 403 与注入的 500 · 端口只用 8941 / 8931(跑完已停),3003 / 3004 / 4000 / 7364 / 7369 一个没碰,数据只落 `/tmp/r97data.*` · 没有切版本号、没发 npm、没发安装包 | `449c27fb` || 2026-10-21 | 7.20 | **删除定时任务被拒时,确认框留着,原因也留在框里**(不是移植:三个界面各一处真修复(`packages/web/src/features/schedules/schedules-page.tsx`、`features/schedules/schedule-panel.tsx`、`features/agents/schedules-tab.tsx` —— `confirmRemove` 只有写成功后 `setDeleting(null)`,被拒时 `setDeleteRefusal(apiErrorText(e))` 交给 `ConfirmModal` 的 `refusal` 槽,打开框时先清掉上一次的原因)+ 1 个新文件 `packages/web/e2e/schedule-delete-refusal.spec.mjs`(4 条用例)+ changelog 一对,**无新依赖、不碰接口**):7.19 末尾点的「这一族还有十几个页面」的第一个 —— 定时任务的三个界面列的是同一批行(`ScheduleRow`)、共用同一张确认框,三处的删除都在 `finally` 里关框,于是**被拒的删除什么都没删**(那一行仍在、服务器仍持有它)却把原因带走了,那句话只在一条六秒后自己消失、且浮在框上方的 toast 里。**量出来的缺陷**(改前,真服务 + 真浏览器,`DELETE …/schedules/look_probe` 拒成 500 `schedule store is closed`):`dialogs 0`、`reasonInDialog 0`、`通知` 区 1 个按钮(文字正是服务端那句话)、`rows 1`、6.5 秒后 `reasonAfter6s 0`;**现在**:`dialogs 1`、`reasonInDialog 1`、`toasts 0`、`rows 1`、6.5 秒后那句话仍在框里。启停开关不动(没有框可留,被拒仍用 toast) | 六包 `typecheck` **`EXIT=0`**(六个 `Done`;`gen:ifaces` 报 **`src/ifaces.json unchanged`(193 接口 / 589 类型)** —— 本笔不动服务契约)· `npx oxlint` 全仓 **0 警告 0 错误**(2241 文件)· 改动的六个文件 `prettier --check` 干净 · `git diff --check` 干净 · 逐包 test **`EXIT=0`、0 失败**:ui **129 文件 / 1044** · web **262 文件 / 3215 通过 / 2 跳过** · core **67 文件 / 1399 通过 / 6 跳过** · cli **38 / 561** · server **202 文件 / 2955 通过 / 4 跳过**(web 与上轮同数:本笔没有新增纯逻辑,规则是界面状态,由 e2e 钉住)· **真服务 + 真浏览器整套 e2e**(`SKIP_BUILD=1 pnpm -C packages/web test:e2e`,脚本自己的 `mktemp` 数据根、mock 8931 / 服务端 8930):**110 passed(7.7m)、0 failed**(原 105 + 本笔 4 + 同一工作树另一条线的 `version-line` 1)· 新 spec 单跑 **4 passed(8.2s)**(项目页一条、重试一条、停靠面板一条、Agent 设置页一条)· **反证**:三处源码 `git stash` 回 `HEAD` 并重建 web → 同一份 spec **4 failed**(每条都死在 `dialog.getByText("schedule store is closed")` 找不到元素),`stash pop` 重建后 **4 passed** · 两态探针(一次性数据根 `/tmp/r98data.*`、`localhost:8990` + mock 8991、1280×900)读数见左栏;两态 console 都只有按设计的 `GET …/machines` **403** 与刻意造的 500,无其它 error / ≥400 · **真看一眼**:`r98/{before,after}-2-after-confirm.png`(改前那张框已经没了、顶上一条 toast;改后那张句子下面就是 danger 色的「操作被拒绝:schedule store is closed」)与 `r98/after-3-after-6s.png`,探针 `r98/probe.mjs` 在 scratchpad · 端口只用 8990 / 8991 与 e2e 自己的 8930 / 8931(跑完都已停),3003 / 3004 / 4000 / 7364 / 7369 一个没碰;数据只落在一次性 `/tmp/r98data.*` 与 e2e 的 `mktemp` 根,一个字节没往 `~/.penguin` / `~/.adelie` 里写(`packages/*/dist`、`test-results/` 都是产物,未 `git add`)· 没有切版本号、没发 npm、没发安装包、没发发布汇总 · **同一工作树里另有一轮(第九十八轮,条目 6.3)在跑**,两笔改动不相交 | `59b8425c` |+| 2026-10-21 | 7.21 | **删除 Benchmark 被拒时,确认框留着,原因也留在框里**(不是移植:`packages/web/src/features/benchmark/benchmark-page.tsx` 一处真修复 —— `confirmDelete` 的 `finally` 里关框改成只有写成功才 `setDeleting(null)`,`catch` 不再 `toastError`、把服务端原话交给新加的 `deleteRefusal` 状态,确认框传 `refusal={…S.common.refused(…)}`(7.19 给 `ui` 加的那个槽);打开卡片时先 `setDeleting(b.id)` 再清原因,一次尝试一条原因;新增 `packages/web/e2e/benchmark-delete-refusal.spec.mjs`(2 条用例)+ changelog 一对,**无新依赖、不碰接口**):7.20 末尾点名的余下页面里最便宜的一页 —— 被拒的删除什么都没删,原因却跟着 `finally` 一起没了,只剩一条六秒后自己消失、且浮在框上方的 toast | 六包 `typecheck` **`EXIT=0`**(六个 `Done`;`gen:ifaces` 报 **`src/ifaces.json unchanged`**,193 接口 / 589 类型)· `npx oxlint` **0 警告 0 错误**(2242 文件)· 改动的三份文件(源码 / 新 spec / 两份 changelog)`prettier --check` 干净 · `git diff --check` 干净 · 逐包 test **`EXIT=0`、0 失败**:ui **129 文件 / 1044** · core **67 / 1399 通过 / 6 跳过** · cli **38 / 561** · web **262 / 3215 通过 / 2 跳过** · server **202 / 2955 通过 / 4 跳过**(与上一轮同数:本笔没有新增纯逻辑,规则是界面状态,由 e2e 钉住)· **整套浏览器 e2e**:`SKIP_BUILD=1 pnpm -C packages/web test:e2e` → **112 passed(7.6m)、0 failed**(原 110 + 本笔 2);新 spec 单跑 **2 passed(4.1s)** · **反证**:`git stash push --` 那一个源码文件 + 重建 web 产物 + 同一数据根 → 同一份 spec **2 failed**(每条都死在 `dialog.getByText("benchmark store is closed")`:框在写入前就关了,element(s) not found),`git stash pop` + 重建后 **2 passed** · **真看一眼**(真服务 + 真浏览器,一次性数据根 `/root/adelie-fork-data/r100-look`、`localhost:8960` + mock 8961、1280×900,`DELETE …/benchmarks/look_probe` 被 `page.route` 拒成 500):改后 `dialogs 1`、框里 **1** 处 `benchmark store is closed`、`通知` 区 **0** 个按钮、卡片仍在、**6.5 秒后那句话仍在**(`reasonAfter6s 1`);截图 `r100/after-2-card.png`(框特写:danger 色「操作被拒绝:benchmark store is closed」在句子下面、按钮上方)与 `r100/after-3-after-6s.png`(整页:框与 `Probe look_probe` 那张卡片都还在);两态 console 只有按设计的 `GET …/machines` **403**与刻意注入的 500 · 端口只用 8950 / 8951(spec)与 8960 / 8961(探针),e2e 是它自己的 8930 / 8931,跑完都已停;3003 / 3004 / 4000 / 7364 / 7369 一个没碰;数据只落在 `/root/adelie-fork-data/r100-*` 与 e2e 的 `mktemp` 根,一个字节没往 `~/.penguin` / `~/.adelie` 里写(`packages/*/dist`、`test-results/` 都是产物,未 `git add`)· 没有切版本号、没发 npm、没发安装包、没发发布汇总 | 见本行提交 |> **2026-10-11 与另一条线的交汇(第三十七轮)**:定时任务触发时(07:00)`git status --short` **不干净**> —— 另一条线(会话 `session-2026-10-05-20-32-50-2ee69aba`)正在做**用户点单**的「回复能复制成纯文本」@@ -12782,3 +12793,86 @@ Token 两枚 chip);探针在页面里用一个 rAF 采样器逐帧读盒子**5.6** / **5.10**;7.1–7.20 已勾掉。- 上游尖端仍是 **`8aa76123`**(本轮重拉过,0 个新提交)。- 7.20 的下一半:把「原因随框留着」铺到余下那些页面(按页面一个个来,每页一条用例)。++## 第一百轮:删除 Benchmark 被拒时,确认框留着,原因也留在框里(2026-10-21,条目 7.21)++### 开工自检与选活++- 同步:开工时(15:00)`git status --short` **干净**,`main` 停在 `838e59a9`;`git fetch origin &&+ git merge --ff-only origin/main` = Already up to date(没切分支、没碰 `legacy/main`、没推 upstream)。+ 上游按 URL 现拉到 `refs/adelie-tmp/upstream-main-r100`,尖端仍是 **`8aa76123`**,+ `git rev-list --count 8aa76123..refs/adelie-tmp/upstream-main-r100` = **0**,没有可移植的新提交。+ 整轮没有别的线往这棵树里提交(`git log` 开工与收尾都是 `838e59a9`)。+- 选活:待办里最靠前的未勾选条目仍是 **2.2c**(剩下的全在桌面壳写侧、`adelie-app.service` 单元与发布动作+ 那一侧)、3.5 / 3.6 / 4.1–4.3 / 5.6 / 5.10(要拍板、要 key、要新依赖或明令不动)。于是接过 7.20 末尾+ 点名的那件事:「原因随框留着」铺到余下页面。本轮取**评估中心的删除** —— 7.20 列的那串页面里它最小:+ 一页、一张确认框、一处 `finally`,正好一轮做完并做足反证。++### 先量清楚(不是推测)++- 读代码就够确定的一半:`benchmark-page.tsx` 的 `confirmDelete` 在 `finally { setDeleteBusy(false) }` 之前+ 无论成败都 `setDeleting(null)`,`catch` 里唯一一句话是 `toastError(apiErrorText(e))`;而 `ui` 的 toast+ 时长表 error = **6000 ms**,且 toast 是 portal 到 `body` 的一层,不在框里、也不随框留着。+- 第一版用例用「页面上第一个『删除 Benchmark』按钮」定位卡片 —— **实测踩到**:新数据根里本来就有一张+ 内置的 **Example Benchmark**,于是点到它、框里写的是「确定删除「Example Benchmark」吗?」(第一条用例+ 当场在 `expect(sentence).toContain("Probe refuse_probe")` 上红)。改法是按卡片定位(见下),不是放宽断言。++### 改了什么(4 个文件 + 台账:1 处源码、1 个新 spec、changelog 一对)++- `packages/web/src/features/benchmark/benchmark-page.tsx`:+ - 新状态 `deleteRefusal`,注释写明为什么它必须活得比 toast 久(卡片还在 = 什么都没删,重试是下一件事)。+ - `confirmDelete` 的 `finally` 只留 `setDeleteBusy(false)`;`setDeleting(null)` 留在**成功**那一条;+ `catch` 改成 `setDeleteRefusal(apiErrorText(e))`。`toastError` 因此在本文件里没有使用点了,导入一并删掉。+ - 打开卡片的 `onDelete` 里**先** `setDeleting(b.id)`、**再** `setDeleteRefusal(null)`(「让打开先落」,+ 与 7.19 / 7.20 同一条写法:一次尝试一条原因,上一句话说的是上一次)。+ - 确认框传 `refusal={deleteRefusal === null ? undefined : S.common.refused(deleteRefusal)}` —— 7.19 给+ `ui` 加的那个槽,画在句子下面、重试按钮正上方。+- `packages/web/e2e/benchmark-delete-refusal.spec.mjs`(新,2 条用例):被拒(框、服务端原话、卡片都在,+ `通知` 区**没有** toast,整卡文字去掉拒绝那一行后与写入前逐字相同,服务端列表条数不变,取消不决定任何事)、+ 重试(放行后同一张框里写进去、框关、卡片与服务端记录都没了)。夹具幂等(同 id 先 DELETE 再 POST;+ 用例材料是 `CASE-1` 一句陈述 + 一句评分标准,不跑任何模型)。卡片按「带这个标题、且带删除按钮」的+ 最内层容器定位(`.last()`),避免点到内置的 Example Benchmark。+- changelog 一对 `changelog/unreleased/2026-10-21-benchmark-delete-refusal{.zh,}.md`(用户可见的行为变化)。++### 验证++- 六包 `typecheck` **`EXIT=0`**(六个 `Done`;`gen:ifaces` 报 **`src/ifaces.json unchanged`**,193 接口 /+ 589 类型 —— 本笔不碰契约)。注:包名早已是 `@adelie/*`,prompt 里那串 `@prismshadow/penguin-*` 过滤不到+ 任何项目(`No projects matched the filters`),按 `@adelie/*` 跑的。+- 改动的两份源码 / 用例文件与两份 changelog `prettier --check` 干净(第一版 spec 格式不过,已 `--write`);+ `npx oxlint` **0 警告 0 错误**(2242 文件);`git diff --check` 干净。+- 逐包 test **`EXIT=0`、0 失败**:ui **129 文件 / 1044** · core **67 / 1399 通过 / 6 跳过** ·+ cli **38 / 561** · web **262 / 3215 通过 / 2 跳过** · server **202 / 2955 通过 / 4 跳过**。+ 与上一轮同数:本笔没有新增纯逻辑(规则是界面状态),由 e2e 钉住。+- **整套浏览器 e2e**:`SKIP_BUILD=1 pnpm -C packages/web test:e2e`(脚本自己的 `mktemp` 数据根、+ mock 8931 / 服务端 8930)→ **112 passed(7.6m)、0 failed**(原 110 + 本笔 2)。新 spec 单跑+ **2 passed(4.1s)**。+- **反证(真的把源码改回去再跑)**:`git stash push -- packages/web/src/features/benchmark/benchmark-page.tsx`+ + 重建 web 产物 + 同一份 spec、同一套端口 → **2 failed**,两条都死在+ `dialog.getByText("benchmark store is closed")`(element(s) not found,15 s 超时)—— 改前框在写入前就关了,+ 这条断言真能区分「原因在框里」与「原因只在一条自己消失的 toast 里」。`git stash pop` + 重建 → **2 passed**。+- **真看一眼**(真服务 + 真浏览器,一次性数据根 `/root/adelie-fork-data/r100-look`、`localhost:8960` + mock 8961、+ 1280×900,`DELETE …/benchmarks/look_probe` 被 `page.route` 拒成 500 `benchmark store is closed`):+ `dialogs 1`、框里 **1** 处那句话、`通知` 区 **0** 个按钮、`Probe look_probe` 那张卡片仍在、+ **6.5 秒之后**那句话仍在框里(`reasonAfter6s 1`、`toastsAfter6s 0`)。截图+ `r100/after-2-card.png`(框特写:danger 色「操作被拒绝:benchmark store is closed」在句子下面、取消 / 删除上方)、+ `r100/after-3-after-6s.png`(整页:框与卡片都还在)、`r100/after-1-dialog.png`(按下之前);+ 两态 console 只有按设计的 `GET …/machines` **403**(成员读机器列表)与刻意注入的 500。探针+ `r100/probe.mjs` 在 scratchpad。+- 端口:spec 用 8950 / 8951,探针用 8960 / 8961,e2e 是它自己的 8930 / 8931(跑完都已停);+ 3003 / 3004 / 4000 / 7364 / 7369 一个没碰;数据只落在 `/root/adelie-fork-data/r100-*` 与 e2e 的+ `mktemp` 根,一个字节没往 `~/.penguin` / `~/.adelie` 里写(`packages/*/dist`、`test-results/` 都是产物,未 `git add`)。+- 没有切版本号、没发 npm、没发安装包、没发发布汇总。++### 没做 / 还差什么++- 「原因随框留着」这一族**余下的页面**(`machines`(启停没有框、被拒仍是 toast)、`company`(组织、频道、+ 员工、工单、日程、手册)、`plugins`(模块插件的装 / 卸、单 Agent 的卸载 / 更新、删除插件)、`settings`+ (Agent API 的关、插件、快捷指令、沙箱后端提示)、`chat`(上下文压缩、工作区浏览器那七张框)、+ `agents`(技能 / 钩子 / 保险库 / 记忆 / API / MCP)等):同一条规则,只差逐页接 `refusal` 与各自的用例,+ 下一轮按页面一个个来(`plugins` 那五张框最值得先做 —— 装插件失败是最常见的那种拒绝)。++### 收尾:提交、推送与汇报++- 提交见下一笔(只 add 本轮 4 个文件 + 本台账)。+- 汇报邮件按 csu-mail 技能发往日中;网络仍不通时按第九十九轮的办法改走飞书。diff --git a/packages/web/e2e/benchmark-delete-refusal.spec.mjs b/packages/web/e2e/benchmark-delete-refusal.spec.mjsnew file mode 100644index 00000000..1f510be8--- /dev/null+++ b/packages/web/e2e/benchmark-delete-refusal.spec.mjs@@ -0,0 +1,187 @@+/**+ * Regression: deleting a Benchmark asks first, and a refused delete keeps that question — with+ * the server's words inside it — instead of closing on the way out of the request.+ *+ * The page used to close the confirmation from a `finally`: the card was still there (nothing was+ * deleted — the server refused) but the reason arrived as a toast that dismissed itself after six+ * seconds and sat above the card rather than in it. The card now closes only once the write+ * landed, and a refusal leaves it open with the refusal drawn under its sentence+ * (`ConfirmModal`'s `refusal` slot), so the retry is the same button.+ *+ * Both tests seed a Benchmark through the API rather than the create form: the form is its own+ * surface with its own tests, and what is measured here is the delete.+ */+import { test, expect } from "@playwright/test";+import { provisionAndLogin } from "./auth.mjs";++const BASE = process.env.BASE_URL;+const MOCK = process.env.MOCK_URL;+const P = "password123";++/** The delete call the page makes; a 500 with its own words proves the reason came back. */+const REFUSAL = { code: "benchmark_store_closed", message: "benchmark store is closed" };++/**+ * Provision the user, give the Project a model (the onboarding overlay covers the page without+ * one), and seed one Benchmark by hand. The seed drops a leftover of the same id first: a rerun of+ * this file alone shares one data root with earlier runs.+ */+async function projectWithBenchmark(page, user, id) {+ await provisionAndLogin(page.request, user, P);+ const projectId = (await (await page.request.get(`${BASE}/api/projects`)).json()).projects[0]+ .projectId;+ const put = await page.request.put(`${BASE}/api/projects/${projectId}/models`, {+ data: {+ defaultModel: { provider: "custom", modelId: "claude-4-8" },+ models: [+ {+ provider: "custom",+ modelId: "claude-4-8",+ apiKey: "sk-mock",+ baseUrl: MOCK,+ contextWindow: 200000,+ },+ ],+ },+ });+ expect(put.ok(), "put models").toBeTruthy();++ const base = `${BASE}/api/projects/${projectId}/benchmarks`;+ await page.request.delete(`${base}/${id}`);+ const created = await page.request.post(base, {+ data: {+ id,+ title: `Probe ${id}`,+ runs: 1,+ cases: [+ {+ id: "CASE-1",+ title: "A case that never runs",+ statement: "Nothing is evaluated in this test.",+ rubric: "Nothing is scored in this test.",+ },+ ],+ },+ });+ expect(created.status(), "seed the Benchmark").toBe(201);++ /** The Project's Benchmarks as the server holds them: what the page reads. */+ const listed = async () => (await (await page.request.get(base)).json()).benchmarks;++ return { projectId, listed };+}++/** Refuse every delete with a code the app has no local copy for, so the server's words show. */+async function refuseDeletes(page, seen) {+ await page.route("**/api/projects/*/benchmarks/*", async (route) => {+ if (route.request().method() !== "DELETE") return route.fallback();+ seen.push(route.request().url());+ await route.fulfill({+ status: 500,+ contentType: "application/json",+ body: JSON.stringify({ error: REFUSAL }),+ });+ });+}++/**+ * The seeded Benchmark's own card. The page always lists the built-in Example Benchmark too, so+ * the delete button has to be reached through the card that carries the seeded title rather than+ * through the first one on the page — `.last()` picks the innermost element holding both, which is+ * the card's own row.+ */+function cardOf(page, id) {+ return page+ .locator("div")+ .filter({ has: page.getByText(`Probe ${id}`, { exact: true }) })+ .filter({ has: page.getByRole("button", { name: "删除 Benchmark" }) })+ .last();+}++/** The card's trash button → the shared confirmation. */+async function openDeleteDialog(page, id) {+ await cardOf(page, id).getByRole("button", { name: "删除 Benchmark" }).click();+ const dialog = page.getByRole("dialog");+ await expect(dialog).toBeVisible();+ return dialog;+}++/**+ * The card's own text with the refusal line dropped: a refused write adds one line under the+ * sentence ("操作被拒绝:…"), and that line is the only thing the refusal may change.+ */+async function cardText(dialog) {+ return (await dialog.innerText()).replace(/\n操作被拒绝:[^\n]*/, "");+}++test("a refused delete keeps the card, its sentence and the Benchmark", async ({ page }) => {+ const id = "refuse_probe";+ const { listed } = await projectWithBenchmark(page, "r100bench1", id);+ const before = await listed();++ await page.goto("/benchmark");+ const title = page.getByText(`Probe ${id}`, { exact: true });+ await expect(title).toBeVisible();+ const dialog = await openDeleteDialog(page, id);+ const sentence = await dialog.innerText();+ expect(sentence).toContain(`Probe ${id}`);++ const deletes = [];+ await refuseDeletes(page, deletes);+ await dialog.getByRole("button", { name: "删除", exact: true }).click();++ // The reason is in the card that asked, and it is not a toast: the notification region holds+ // no dismissible button, and the card reads exactly as it did before the attempt plus the one+ // refusal line.+ await expect(dialog.getByText(REFUSAL.message)).toBeVisible();+ await expect(page.getByRole("region", { name: "通知" }).getByRole("button")).toHaveCount(0);+ expect(deletes).toHaveLength(1);+ await expect(dialog).toBeVisible();+ expect(await cardText(dialog)).toBe(sentence);++ // Nothing was deleted anywhere: the card is still on the page and the server still holds it.+ await expect(title).toBeVisible();+ expect((await listed()).length).toBe(before.length);++ // Closing the card decides nothing.+ await dialog.getByRole("button", { name: "取消" }).click();+ await expect(dialog).toHaveCount(0);+ await expect(title).toBeVisible();+});++test("the retry after a refused delete writes it, and only a written one closes the card", async ({+ page,+}) => {+ const id = "retry_probe";+ const { listed } = await projectWithBenchmark(page, "r100bench2", id);++ const deletes = [];+ let refuse = true;+ await page.route("**/api/projects/*/benchmarks/*", async (route) => {+ if (route.request().method() !== "DELETE") return route.fallback();+ deletes.push(route.request().url());+ if (!refuse) return route.fallback();+ await route.fulfill({+ status: 500,+ contentType: "application/json",+ body: JSON.stringify({ error: REFUSAL }),+ });+ });++ await page.goto("/benchmark");+ const title = page.getByText(`Probe ${id}`, { exact: true });+ await expect(title).toBeVisible();+ const dialog = await openDeleteDialog(page, id);+ await dialog.getByRole("button", { name: "删除", exact: true }).click();+ await expect(dialog.getByText(REFUSAL.message)).toBeVisible();+ await expect(dialog).toBeVisible();+ expect(deletes).toHaveLength(1);++ // The retry is the same card, and this time the write lands: card gone, Benchmark gone.+ refuse = false;+ await dialog.getByRole("button", { name: "删除", exact: true }).click();+ await expect(dialog).toHaveCount(0);+ expect(deletes).toHaveLength(2);+ await expect(title).toHaveCount(0);+ expect((await listed()).some((b) => b.id === id)).toBe(false);+});diff --git a/packages/web/src/features/benchmark/benchmark-page.tsx b/packages/web/src/features/benchmark/benchmark-page.tsxindex 4fd7dffa..ab6856a0 100644--- a/packages/web/src/features/benchmark/benchmark-page.tsx+++ b/packages/web/src/features/benchmark/benchmark-page.tsx@@ -31,7 +31,6 @@ import {Skeleton,SkeletonCard,Sparkline,- toastError,toastSuccess,} from "@adelie/ui";import * as api from "../../api/endpoints";@@ -349,6 +348,10 @@ export function BenchmarkPage() {const [using, setUsing] = useState<string | null>(null);const [deleting, setDeleting] = useState<string | null>(null);const [deleteBusy, setDeleteBusy] = useState(false);+ // The server's words for a delete it refused, drawn inside that same confirmation: the card is+ // still there (nothing was deleted), and retrying is the next thing the user does, so the reason+ // has to outlive the six-second toast that used to be its only home.+ const [deleteRefusal, setDeleteRefusal] = useState<string | null>(null);// Benchmarks belong to the Project, so the page reads one list, merged over this server and// the machines it holds — and a Project change starts it over rather than showing the previous@@ -435,7 +438,9 @@ export function BenchmarkPage() {}setDeleting(null);} catch (e) {- toastError(apiErrorText(e));+ // The card stays up: a refused delete left the Benchmark exactly where it was, and the+ // reason belongs on the same card that asks the question (7.19 / 7.20's rule app-wide).+ setDeleteRefusal(apiErrorText(e));} finally {setDeleteBusy(false);}@@ -480,7 +485,12 @@ export function BenchmarkPage() {canDelete={isOwner && b.machineIds.includes(null)}onOpen={() => open(b.id)}onUse={() => setUsing(b.id)}- onDelete={() => setDeleting(b.id)}+ onDelete={() => {+ // The card opens first, then the last attempt's reason is dropped: one try, one+ // reason — the same order the other confirmations in this family use.+ setDeleting(b.id);+ setDeleteRefusal(null);+ }}/>))}</div>@@ -599,6 +609,7 @@ export function BenchmarkPage() {confirmLabel={S.common.delete}cancelLabel={S.common.cancel}busy={deleteBusy}+ refusal={deleteRefusal === null ? undefined : S.common.refused(deleteRefusal)}><p className="text-sm text-gray-700 dark:text-gray-200">{S.benchmark.deleteConfirm(deletingBenchmark?.title ?? deleting ?? "")}