Repository navigation
test(release): preserve fenced commands and explicit settlement selection - #6493
Conversation
…tion Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval). Exact head 9dc4ad6edf9648893c631afd7b5ded982a47eb5a.
动机
运行发布验证的维护者,以及依赖这些测试保护真实交付的 DSH 用户。DSH 集成在没有选择 Todo 时要求结算计划而失败,合法 Bash 注释也会被发布校验器当作新章节,令完整发布说明被拒绝。测试先验证未选择时没有计划,再显式选择并核对原身份升级和单次扣额;发布校验按代码围栏识别章节,合法命令可通过而代码内伪标题不能补足缺失章节。仅修复现有两个验证入口,不修改 runtime 接纳、权限、扣额或发布要求,也不声明整个 release 已通过。
改动思路
DSH 测试直接消费现有 quota should-run 的选择与回执,不重新实现选择权威;发布工具继续在原 section helper 中解析章节,只有 fence 外的标题参与起止定位。复用既有校验 owner 与真实 Core 入口,不复制选择规则、不增加 runtime 状态或依赖。当前 PR 只修复两个已复现的验证缺口,不承诺全渠道 release 已交付。两处都保留原拒绝条件:未选定时不能写回/扣额,缺实际章节或生命周期字段仍不能发布。无需新框架或依赖,局部解析状态只是当前文档的派生状态。
具体改动
依据 docs/reference/protocols/turn-envelope-v0.md 在 3e611660af8e27aa8a97a8364606dad92e91ae7b 的 quota_action_portfolio_v2:推荐不绑定身份,selection_required 必须同 Turn 显式选择后重验;DSH 测试现在完整实现这个既有验收点。另依据 docs/product/release-readiness.md 的 Final Release Body Usage Gate,合法 Bash 示例不得变成章节分隔,真实章节也不能由代码内伪标题冒充;现有双语字段与兼容拒绝规则没有改动。
关键代码讲解
examples/release/release-readiness-doc-smoke.py:98 的 section 同时在起点和终点搜索时跟踪 backtick/tilde fence,并保留原正文返回;缺少真实标题仍抛错。现有 self-test 增加带注释命令的通过例与代码内唯一标题的拒绝例。packages/dsh-loopx-plugin/tests/admission-closeout.integration.spec.ts:250 的集成先验证无选择时 selection_required 且无 settlement_plan,再指定原 Todo 重验并重放。结尾不只是把数量改大:验证一条无 effect 的观察、一条指向原事件的 identity_upgrade、唯一原 effect,以及依旧只有一次 quota_slot_spent 和同身份 closeout。
对主干的风险
风险是“修测试”掩盖了真正权限或重复结算问题。真实 CLI 的负例、选择重放、因果边与 run-index 单次扣额断言一起覆盖这个反例;runtime 未改,原审批/选择规则没有放宽。相同14项双语候选稿在不可变 base 上拒绝、当前 parser 上通过;代码内伪章节及原缺 rollback/模糊 breaking 的 self-test 仍拒绝。DSH 全质量阶段含类型检查、207测试和 peer-range 检查均通过,Python 编译/Ruff、diff 和两路径公开扫描零问题。按既有配置未查询 PR CI。这是与验证工具风险相称的等价检查集,未伪装成完整发布矩阵或真实模型执行;原失败与环境依赖安装记录保留。
我的整体评价
APPROVE,goal_achieved针对两个验证缺口。long_horizon保留:测试穿过原身份、重放、持久写回与单次结算;user_experience改善:维护者可以直接验证正常命令示例,不必迎合错误解析。复用既有校验 owner 与真实 Core 入口,不复制选择规则、不增加 runtime 状态或依赖。当前 PR 只修复两个已复现的验证缺口,不承诺全渠道 release 已交付。没有新增共享词表、默认开关、协议或迁移;局部 helper 足够,相关重构检查后不引入 Markdown 框架或另一套 Core 选择规则。仍须精确 head readiness 和维护者授权后合并,整体1.4.1测试、制品与指南由后续独立验证。
English verdict: APPROVE at 9dc4ad6edf9648893c631afd7b5ded982a47eb5a. Two existing validators now honor actual fenced Markdown and current explicit Todo selection. Same-body base/head CLI, positive/negative self-tests, real DSH original-effect closeout with207tests/typecheck/peer-range, compile/Ruff/diff/public-boundary pass. No Core authority, threshold or runtime policy changes; full release qualification remains separate.
Resolve admission-closeout.integration.spec.ts against #6493: - Keep main's unselected-then-selected admission structure and its strict two-receipt assertions (initial admission with delivery_allowed false, then the identity_upgrade admission caused by it). - Keep this branch's explicit Todo claim, moved between the unselected and selected calls, and keep --todo-id on the selected call only. The three-way merge had also spliced --todo-id into main's unselected call, which would have contradicted its selection_required assertion. Signed-off-by: huangruiteng <huangrt01@163.com>
Release qualification exposed two validator defects at the existing public entrypoints. Fix the DSH admission-to-closeout integration to follow the current explicit Todo selection contract, and make release-note section parsing honor Markdown fences.
Before, the DSH test requested a settlement plan before selecting an eligible Todo. It now proves that the unselected response has no plan, explicitly selects the original Todo, replays that selection, and verifies one causal identity upgrade plus exactly one quota spend and original-effect closeout. The initial observation and selected receipt remain distinct; this does not change or weaken quota admission.
The release-note parser previously treated Bash comments beginning with
#as section headings, and could accept a surface heading that existed only inside a code block. It now recognizes backtick/tilde fences while locating both section starts and ends. Existing required fields, bilingual lifecycle checks and rejection conditions remain unchanged; self-tests cover legal commented commands and rejection of code-only headings.Validation: the unchanged DSH test reproduced the missing-plan failure; the updated real CLI integration passes, and the full DSH quality phase passes typecheck, all 207 tests and peer-range checks. The release-note public CLI rejected a real 14-surface candidate before the fix and accepts it after; existing self-tests, new fence regressions, Python compile/Ruff, semantic advisory, diff hygiene and the two-path public-boundary check pass. No model, benchmark or remote source is needed to qualify this test-only repair. No PR CI was consulted under the resolved maintainer policy.
This is a complete validator repair, not a claim that the named release has passed its broader source, model, install or published-artifact qualification. The future-facing pass keeps both rules in their existing owners, with no new module, flag, schema or runtime policy. The local fence tracker is test-tool parsing state only. Maintainer authorization covers this release repair batch after exact-head review and merge readiness.