Skip to content

[OPS-PTC D5] 让用户能选择两档并验证设置往返 #989

Closed

Description

@Thatgfsj

D5 · 让用户能选择两档并验证设置往返

总计划 #978,所属工作流 #979。

问题:界面上选择全量后,模型必须真的能执行全部获准业务工具;不能只检查开关是否亮起。

前置条件:等待 D3、D4 及 P1 的无 loader 路径。

从哪里读

  • src/client/row-schema.ts
  • src/client/locales.ts
  • test/settings-rows.test.mjs

认领前记录当前 main SHA。以上为优先检查的范围,需要扩大写域时先说明文件与原因。

按顺序执行

  1. 先定义“按需”“全量”两条用户文案和旧配置的展示方式,明确区别是完整声明出现的时机。
  2. 在隔离 profile 保存一次,重新打开设置,读取有效配置,再新建 OPS-PTC 会话。
  3. 对比首步 SDK 与实际调用;按需档加载后检查下一请求,全量档检查无 loader 教学。另测取消编辑及修改其他选项。

验收清单

  • 保存后再打开仍是用户选的档位;全量首步不用 loader 就能执行允许的读取,按需档分两步完成。
  • 旧 profile 仅查看或保存其他字段,不会被迁成全量;中英文设置项与文档说法一致。

范围边界与停手条件:不改用户当前 web profile,不顺手调整默认 preset 或全局 Native 设置。

验证与交付

先运行 npm run build;依赖 native worker 的测试先运行 npm run build:ptc。定向入口:node test/run.mjs settings。确认过滤器命中目标套件,记录实际 pass / skip / fail。

认领模板:编号 / 当前 SHA / 目标文件 / 第一个失败样例。提交时贴修改前与修改后结果,以及撤掉改动后会失败的断言。已有 PR 请先在原讨论协作。行为及中英文文档同 PR。

Activity

  1. Thatgfsj commented on Nov 19, 2026

    @Thatgfsj
    CollaboratorAuthor

    认领:989 / main@58f6e28 / 分支 card/d5-settings-entry(基于 card/d4-integration-diagnostics @ 27af626)

    目标文件(优先范围):src/client/row-schema.ts、src/client/locales.ts、test/settings-rows.test.mjs

    扩大写域(原因):

    • src/settings/merged.ts:宿主设置描述符须先把 ptc/ops-ptc 行的 disclosurePolicy 声明为 volatile 可编辑键(与 bashPath 同一模式),页面才有可写路径
    • src/client/row-form.tsx:选择项的渲染与保存/重置接线(现有 enum 范式 = executor 卡的 radio)
    • test/settings-ui.test.mjs / test/settings-host.test.mjs / test/ptc-disclosure-policy.test.mjs:DOM 交互、真实宿主写者往返、D2「入口归 D5」钉的翻转
    • 新增 test/settings-disclosure-e2e.test.mjs:真实 worker 端到端(设置写入 → 保存值 → 新会话首轮)
    • docs/configuration-reference.md、docs/配置参考.md、docs/CHANGELOG.md:双语说明与升级示例

    第一个失败样例(改前):

    $ DSH_OPS_WORKER_BIN=$PWD/runtime/linux-x64/dsh-ops-worker node test/run.mjs settings
    settings-rows.test.mjs: SyntaxError: ... row-schema.js does not provide an export named 'disclosureDiffers'
    settings-ui.test.mjs:   FAIL the disclosure card picks the tier...
           AssertionError: the disclosure card renders  (2 of 26 checks failed)
    $ node test/run.mjs ptc-disclosure-policy
      FAIL input class 2 (legal value): on-demand and full parse and ride the settings path
           false !== true  ('disclosurePolicy' in Config.dict['ops-ptc'].dict)
    

    settings 过滤共 4/6 套件红,均为设置项缺失所致;settings-client / settings-runtime 保持绿。

  2. Thatgfsj commented on Nov 19, 2026

    @Thatgfsj
    CollaboratorAuthor

    D5 完成,PR #1022(card/d5-settings-entry @ e916d4e,基于 card/d4-integration-diagnostics @ 27af626)。

    设置页新增「PTC 披露档位」卡片:一次选择统一 ptc 与 ops-ptc 两行,随页面同一次版本校验的保存写入;旧档案默认按需且不被写入,选回按需把两行还原为键缺失(与从未见过卡片的档案逐字一致),两行不一致点名 mixed 由下一次选择统一,取消编辑零写入;动态工具总开关关闭期间点名暂停并保留已存选择。

    断点定位记录(先红后绿):

    1. 卡片未实现/未注册 → settings-ui 2 项红(the disclosure card renders / querySelectorAll of undefined);
    2. e2e 用设置 describe 视图启动会话,该视图剥离 YAML-only 键(allowedTools 上限、worker 路径),导致全量档发布整 16 名默认池 → 2 项红。改为从 loader 合并后的 profile 配置(真实生产链路)启动后修复,并断言保存不丢 allowedTools 上限。

    验证(全绿):npm run build ✅;settings 全套 69 项(client 3 / host 11 / runtime 14 / rows 15 / ui 26,e2e 无 worker 时按规则跳过);ptc-disclosure-policy 8 项;DSH_OPS_WORKER_BIN=runtime/linux-x64/dsh-ops-worker 下 settings-disclosure e2e 3 项;npm run check:size ✅(826 文件均 ≤1000 行)。无新增依赖,lib//runtime/ 未动,发布语义/教学正文/诊断未改。

  3. Thatgfsj commented on Nov 20, 2026

    @Thatgfsj
    CollaboratorAuthor

    已由 #1033 合入 main 交付(18 张卡并集,见 PR 描述与 docs/CHANGELOG.md 的 Unreleased 条目)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions