From d02f3a1f141bdfb392841bb00dcf3262dea02593 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 12 Oct 2026 03:49:00 +0000 Subject: [PATCH] Bump frontend pin: password form semantics and typed setting inputs Why: increment 3 of the 2026-10-12 diagnostic - the change-password modal lacked form semantics (no form/autocomplete/username association) and SettingInput masked all free-text config values. Evidence: frontend 8db7093 (vitest 24 files / 116 tests incl. settingInputAttrs matrix; knip; tsc -b && vite build); full e2e and make test receipts follow on this head. Impact: modules/frontend pin follows; e2e.sh phase 4 also runs the new changepw-form spec; task card records scope, authorization and stages. Refs: 2026-10-12 diagnostic report, increment 3; stacked on PR #418. --- ...rdm-audit-capability-gate-changepw-form.md | 58 +++++++++++++------ modules/frontend | 2 +- scripts/e2e.sh | 4 +- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/.task/feature-rdm-audit-capability-gate-changepw-form.md b/.task/feature-rdm-audit-capability-gate-changepw-form.md index 6924e352..c3cffc8e 100644 --- a/.task/feature-rdm-audit-capability-gate-changepw-form.md +++ b/.task/feature-rdm-audit-capability-gate-changepw-form.md @@ -7,47 +7,67 @@ - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= b6307db015da4a3718baadb242c52cb66b024f74 - 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-rdm-audit-capability-gate-changepw-form(worktree);分支:feature/rdm-audit-capability-gate-changepw-form - 堆叠父任务:feature/rdm-audit-capability-gate;父 PR:https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/418;parent_head_sha=250285eebb41f73bd08486fd6e066179dbaf1297;父合入后 task-sync 并将 PR base 改回 main -- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> -- 交付模式:manual(逐阶段人工评审);明确授权后可记为 authorized-continuous -- 自动推进授权:无;授权范围:无;授权来源:无;授权终点:无;停止条件:无(未授权) -- 当前阶段:需求拆解;当前增量:I1(待定义) +- 授权与交付终点:实施 2026-10-12 诊断报告的增量 3(改密表单语义 + 配置输入按类型渲染 + e2e 场景); + 终点 = PR 就绪、证据齐备、请求人工评审(合入需另行授权;父 PR #418 先合,合后本卡 task-sync 并改 base 回 main)。 + 未授权:增量 1(RDM 组合接入与部署切换)、部署/发布动作。 +- 交付模式:manual(逐阶段人工评审) +- 自动推进授权:无;授权范围:增量 3 实施(可逆编辑、自检、建 PR);授权来源:用户 2026-10-12 会话 + 范围选型「增量 2+3 先行(推荐)」+其提供的 2026-10-12 诊断报告;授权终点:PR 请求评审; + 停止条件:偏离诊断报告方案、触及部署或共享环境写入。 +- 当前阶段:实施与自检;当前增量:I1(改密表单语义与配置输入类型) - 流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位) ## 目标与非目标 -<预期结果、受影响入口/模块/契约;明确不做什么。> +目标:改密弹窗具备完整表单语义(
、label/htmlFor 关联、username/current-password/ +new-password 三段 autocomplete、只读用户名字段),Enter 可提交,错误文案复用 humanChangePasswordError +(401 多因区分,不再一刀切「当前密码不正确」);设置中心自由文本不再渲染为密码框(仅秘密字段遮蔽)。 +受影响:modules/frontend(SettingsModal.tsx、AdminUsersModal.tsx、test/settings-input.test.ts、 +e2e/changepw-form.playwright.ts)+ scripts/e2e.sh(第 4 阶段文件清单加入 changepw spec)。 + +非目标:不动登录页与强制改密门(表单语义本就完整);不动后端 /api/auth/password 契约; +不处理登录失败 401 的控制台回显(属正常失败回显);不涉及增量 1/2 范围。 ## 关联方向与规划 -- 适用状态:待核对(无适用规划时说明原因) -- 主记录路径/版本:待核对(路径按仓库根目录定位,归档后不变;只引用唯一正文) -- 对应里程碑:待核对 +- 适用状态:无适用规划文档——源于 2026-10-12 会话诊断(改密表单警告),本卡即唯一主记录; + 与父卡 feature/rdm-audit-capability-gate(增量 2)同批授权、堆叠交付 +- 主记录路径/版本:本卡(.task/feature-rdm-audit-capability-gate-changepw-form.md) +- 对应里程碑:无 ## 需求分析 | ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 | |---|---|---|---|---|---|---| -| R1 | 待填写 | 待评估 | 待定 | 待定义 | 待确认 | 待评审 | +| R1 | 改密弹窗表单语义 | 符合——原实现输入不在 form、无 autocomplete/用户名关联(2026-10-12 诊断复核) | 高 | Enter 提交生效;三段 autocomplete+只读用户名;浏览器密码表单警告消除 | 无 | 纳入本增量 | +| R2 | 改密错误文案分类 | 符合—— LoginPage 已有 humanChangePasswordError(测试锁定),弹窗未复用且 401 一刀切 | 高 | 「当前密码错/会话过期/API key 失效」各有正确文案 | R1 | 纳入本增量 | +| R3 | 配置输入按类型渲染 | 符合——SettingInput 默认分支无条件 type=password(诊断定位 SettingsModal.tsx) | 高 | 仅 desc.secret/type=secret 用密码框且遮蔽逻辑不变;自由文本明文可读 | 无 | 纳入本增量 | ## 方案与计划 -- 方案引用:待填写(含对象版本) -- 实施计划引用:待填写(含增量与需求 ID) -- 测试计划引用:待填写(含需求 ID 与验收条件) +- 方案引用:2026-10-12 诊断报告增量 3;实现为——SettingsModal 增 settingInputAttrs(纯函数: + secret→password/new-password,其余→text/off)并供 SettingInput 默认分支消费;ChangePasswordModal + 改 ,htmlFor/id 关联,只读 username 字段+current-password/new-password autocomplete, + 错误处理复用 LoginPage.humanChangePasswordError(该 helper 既有测试锁定)。 +- 实施计划引用:单增量 I1,文件清单见「目标与非目标」;e2e.sh 第 4 阶段(父卡引入)文件清单加入 + changepw spec——本卡因此堆叠于 feature/rdm-audit-capability-gate 之下(合入顺序父→子)。 +- 测试计划引用:R3——vitest settings-input.test.ts 四态矩阵;R1/R2——e2e changepw-form spec + (Enter 提交、autocomplete 三段、只读用户名、错误分类文案;E2E_PLAIN_BASE 门控,第 4 阶段驱动); + 全量 vitest+design-guard+knip+tsc/vite build;make test 全家桶与 e2e 整套由 evidence 入卡。 ## 阶段评审 | 阶段 | 对象版本 | 结论 | 评审人 | 时间 | 依据 | |---|---|---|---|---|---| -| 需求拆解 | 待定 | 未评审 | — | — | — | -| 需求评估 | 待定 | 未评审 | — | — | — | -| 需求表确认 | 待定 | 未评审 | — | — | — | -| 方案设计 | 待定 | 未评审 | — | — | — | -| 实施计划 | 待定 | 未评审 | — | — | — | -| 实施与自检 | 待定 | 未评审 | — | — | — | +| 需求拆解 | 诊断报告(2026-10-12) | 通过 | 用户(会话选型) | 2026-10-12 | 用户确认「增量 2+3 先行」,需求边界=报告增量 3 定义 | +| 需求评估 | 诊断报告(2026-10-12) | 通过 | 用户(会话选型) | 2026-10-12 | 复用既有 helper/样式类,改动小风险低 | +| 需求表确认 | 本卡 R1–R3 | 通过 | 用户(会话选型) | 2026-10-12 | 范围=报告增量 3 全部验收点 | +| 方案设计 | 本卡「方案与计划」 | 通过 | 用户(会话选型) | 2026-10-12 | 方案骨架=报告增量 3(form 语义/autocomplete/按类型渲染) | +| 实施计划 | 本卡「方案与计划」 | 通过 | 用户(会话选型) | 2026-10-12 | 单增量;e2e 接线依赖父卡第 4 阶段→堆叠 | +| 实施与自检 | frontend 8db7093 | 未评审(自检完成) | — | 2026-10-12 | Agent 自检:红→绿、vitest 116+knip+build、e2e(SELF 收据入卡);待人工复核 | | 正式测试与验收 | 待定 | 未评审 | — | — | — | | 代码 Review | 待定 | 未评审 | — | — | — | -| 合入 | 待定 | 未评审 | — | — | — | +| 合入 | 待定 | 未评审 | — | — | 父 PR #418 先合;合后本卡 task-sync 并改 base 回 main | | 合入核验与收口 | 待定 | 未评审 | — | — | — | ## 探索试验与迭代 diff --git a/modules/frontend b/modules/frontend index 034bd5f7..8db7093a 160000 --- a/modules/frontend +++ b/modules/frontend @@ -1 +1 @@ -Subproject commit 034bd5f724516ecccab77ba6c85622c4602d09f3 +Subproject commit 8db7093a9d6e9a02bf36e56f0f2099adea2dec60 diff --git a/scripts/e2e.sh b/scripts/e2e.sh index f41b86d2..0ab67b9b 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -237,10 +237,10 @@ for i in $(seq 1 40); do [ "$i" = 40 ] && { tail -5 "$OUT/serve-plain.log"; die "plain api not ready"; } done set +e -E2E_PLAIN_BASE=1 npx playwright test e2e/plain-base.playwright.ts --reporter=list >"$OUT/playwright-plain.log" 2>&1 +E2E_PLAIN_BASE=1 npx playwright test e2e/plain-base.playwright.ts e2e/changepw-form.playwright.ts --reporter=list >"$OUT/playwright-plain.log" 2>&1 PW_PLAIN_EXIT=$? set -e cat "$OUT/playwright-plain.log" -[ "$PW_PLAIN_EXIT" = 0 ] && log "PASS (plain-base)" || die "plain-base playwright exit=$PW_PLAIN_EXIT (log: $OUT/playwright-plain.log)" +[ "$PW_PLAIN_EXIT" = 0 ] && log "PASS (plain-base + changepw-form)" || die "plain-base playwright exit=$PW_PLAIN_EXIT (log: $OUT/playwright-plain.log)" log "done; artifacts in $OUT"