fix(organize,identity,sites,pi): W10-pre backend fixes from v0.2 visual QA

- slot: new manual_verify event (attention -> verifying, with reason); a
  successful organize of a download whose slot is in attention goes back
  through verifying and lands by verify_passed on the actually imported
  assets; the download's organize_blocked decision is resolved with
  resolution {key: manual_organize | organize_retry, organizationRecordId} (U1)
- acquisition: plan purpose is upgrade only when the slot already has a
  current asset; a movie slot gap is a fill (U7)
- identity: entities created from TMDB details get metadata fields projected
  in the same transaction; TMDB aliases deduped by normalized text, site-title
  aliases skipped when the text already exists (U9)
- pi: auth-mode test of a custom Base URL no longer marks the upstream ok, and
  says to use the minimal completion to probe the endpoint (U2)
- sites: PUT /sites/{id}/credentials replaces same-kind secrets in place and
  names new secrets with site id + random suffix (secret.name is unique; was a
  500 on update); M-Team user data uses config/definition apiBaseUrl instead
  of deriving api.<domain> from the site URL (Invalid URL on IP/local bases)
- copy: setup error says 初始化口令; backup job points at umt backup
- tests: schema expected tables add site_user_data; migration round-trip
  timeout 60s; fake secrets honor label as name; vertical/resolve/pi/slot/
  site-center tests for the above
- docs: 09-visual-qa W10-pre status table (U3 root cause: outbox events are
  never mirrored to SSE)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 16:29:29 +08:00
1 parent b7a7fd3958
commit 2b8fe667a5
20 files changed
+298 -42

No files matched your search

+33
View File
@@ -144,3 +144,36 @@
3. `apps/web/test/screenshots/qa-v02/66-organize-wizard-1-d.png`:批量整理向导识别步骤(整季包 + 电影 + 待选作品)
4. `apps/web/test/screenshots/qa-v02/45-dl-organize-exec-d.png`:预览失败仍能执行产生的失败记录(#2,已修)
5. `apps/web/test/screenshots/qa-v02/V11-pi-test-network-hint-d.png`:不存在的端点「测试」通过、状态变「可用」(U2)
## W10-pre 后端复核(未修项状态)
2026-09-28。只改后端;前端项留给前端波。验证:HEAD + 本轮改动的独立 worktree 跑 `deno task ci`。
| # | 归属 | 状态 | 说明 |
| --- | --- | --- | --- |
| U1 | 后端 | 已修 | 协调者拍板:状态机新增 `manual_verify`(attention → verifying,带原因)。下载任务的整理成功入库时,Slot 若是 attention 先回核验,再由 `verify_passed` 按实际入库资产落 satisfied / empty(部分覆盖);同一下载任务的「整理冲突 / 做种义务阻止移动」事项(`organize_blocked:<下载任务>`)自动 resolved,`resolution = { key: "manual_organize", organizationRecordId, by }`,自动重试成功记 `organize_retry`。纵切测试覆盖 |
| U2 | 后端 | 已修 | 自定义 Base URL(非 OAuth)的「测试」只核对凭证和模型,不再把状态改成「可用」、不记核验时间,返回提示「没有连接 Base URL;用「最小补全」确认端点可达」。前端直接显示 `message` 即可 |
| U3 | 后端 + 前端 | 未修,需定 | 根因比报告写的大:`ctx.outbox.emit` 写的事件(`feed.fetched`、`decision.*`、`download.status_changed`、`organization.changed` 等)只进 outbox 路由成任务,**没有任何一条镜像到 SSE 总线**;浏览器只收得到直接 `ctx.events.publish` 的事件(agent、settings、files、schedule、heartbeat)。首页订阅的这些类型实际从未到达。要补一个 outbox → SSE 的桥(提交后可见、顺序与裁剪策略),属于设计改动,超出本轮。桥接好后前端来源健康 / 站点详情订阅 `feed.fetched` 失效列表 |
| U4 | 前端 | 未修 | 表单级错误定位 |
| U5 | 前端 | 未修 | `FormField` 间距 |
| U6 | 前端 | 未修 | FAB 定位 |
| U7 | 后端 | 已修 | 电影 Slot 缺口的 mode 仍记 `upgrade`(`determineMode` 的 slot_gap),但计划用途只在 Slot 已有当前资产时才是「升级」,否则「补缺」;时间线随之显示「创建下载计划(补缺)」 |
| U8 | 后端 | 不改 | 观众站定义(照搬 MP 的 `audiences.json`)没有 `hr` 选择器,H&R 三态按设计为 unknown;mock 页面上的 `hitandrun` 标记不会被读取。要补选择器需先在真实站点核对 |
| U9 | 后端 | 已修 | 按 TMDB 建档(自动识别 / 手动指定 / 按候选建)时同事务写入 TMDB 字段并投影,不再等下一次刷新(不记 `last_metadata_refresh_at`,剧集季总集数仍由首次刷新补);别名按规范化文本去重(TMDB 译名/别名列表与主标题、原名重复的不再登记,站点标题与已有别名同文本时也不登记)。已有数据里的重复别名不回溯清理 |
| U10 | 后端 | 不改 | fake 仅用于演示,行为与 runbook 一致 |
| U11 | 前端 / 文案 | 未修 | 全站标点规范 |
| U12 | 前端 | 未修 | 文件管理单击进入 |
| U13 | 前端 | 未修 | 移动目标树先拦「目标 = 源所在目录」 |
| U14 | 前端 | 未修 | 浮层材质 |
| U15 | 前端 | 未修 | 指标卡文案缩短 |
| U16 | 前端 | 未修 | 身份指定弹窗 select / 标签 |
| U17 | 后端 | 已核 | `/health` 与 `/system/health` 都读 `apps/server/deno.json`,当前为 0.2.0;rc 镜像构建早于版本号提交,下次构建复核 |
文案清单里的后端项已改:服务端初始化报错改为「初始化口令无效…」(与页面字段同词);定时任务「备份」说明改为「目前用 umt backup(宿主机 cron 调用)」。其余文案(TMDB 空格、API Key 重复小节、「每 7 天」、「最高级别:提示」、「延后:已有计划在途」、失败记录「未生成目标路径」、「默认模型」)在前端。
其他:`packages/db/test/schema.test.ts` 补 `site_user_data`(0031),迁移往返用例超时放宽到 60s(35 个迁移 down/up 在共用开发库上超过默认 5s);`db-sync` 在 HEAD 上已齐。迁移 0031–0035 连续无冲突(0017 历史上空缺,迁移器按文件名排序,不影响);0035 仍是 W9-E 未提交改动,`types.ts` 已含其列。
前端联调追加的两条站点中心后端 bug(同一提交修):
- `PUT /sites/{id}/credentials` 更新已有账号凭证 500:secret 名 `site_account:<label>` 撞 `secret.name` 唯一约束(各站点都有 `default`,换凭证时新 secret 与旧 secret 同名)。改为同账号同类凭证(主凭证 / passkey / TOTP)原地 `replace`,需要新建时名字带站点 id 与随机后缀;会话 Cookie、`POST /site-accounts` 同样处理。测试夹具的 fake secret 现在按 label 落 `name`,能复现唯一约束。
- 馒头刷新登录 "Invalid URL":用户数据解析器在没有 `config.apiBaseUrl` 时按站点地址推 `https://api.<根域>`,站点地址是 IP / 本地 mock 时拼成非法 URL。改为与适配器一致:站点配置 > 定义里的 `apiBaseUrl`(`https://api.m-team.cc`)。