Repository navigation
fix(cli): classify anti-entropy on its command help surface - #8129
Conversation
Signed-off-by: NIU-123370 <191000457+NIU-123370@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max.
动机 / Motivation
维护 CLI 命令目录的人运行可见性检查时,会因已注册的 anti-entropy 没有明确归类而失败。
之前 anti-entropy 已能显示自己的帮助,却不在两种目录分类的任何一边;现在只把它补入既有 help-only 集合,目录检查通过,用户原来的帮助入口和正文保持一致。
可见性测试由基线 1 failed/1 passed 变为当前 2 passed;六种真实 CLI 输出与完整 manpage 逐字相同,唯一集合差异为新增 anti-entropy。
本 PR 只补目录维护元数据,不启用 anti-entropy,不新增命令、帮助正文、安装行为或执行权限。
改动思路 / Approach
命令注册、帮助渲染和执行权限各有既有归属;这一行只应留在现有可见性元数据中,由原检查消费。 当前 PR 的完整边界是一项 help-only 归类,不新增核心手册段落、状态或能力开关。
删除检查会丢掉已有的目录维护约束;给核心手册加一整段,又会扩大用户表面。这里命令本来就存在,也有独立帮助,复用现有 help-only 归类足够。搜索全部调用方后,分类集合只被两个既有仓库检查读取,渲染仍从 COMMAND_GROUPS 生成,执行继续由原 capability 负责。因此这是一项 coverage/维护边界修复,不是新能力、默认启用或新操作入口。
具体改动 / Changes
完整 6c7145803733dd94e7daf118c77d468b7febd499 仅一文件 +1/-0。没有独立 accepted RFC/契约文档或 linked issue 专门规定这一项归类;验收来自不可变基线 1b636dee161f5ec0039b2c0121ef7ff7060dcb72 的既有 owner 注释、完整/互斥测试约束和已注册 parser,而不是作者新造的要求。
关键代码讲解
- MANPAGE_COMMAND_HELP_ONLY 添加现有名称 anti-entropy;它不是权限或启用集合,仍由可见性检查消费。
- manpage_top_level_commands 未改,继续从核心 COMMAND_GROUPS 推导手册目录;render_manpage 的完整输出也逐字不变。
- register_anti_entropy_commands 原本已注册命令、verify/inspect 及各自帮助。新归类没有新增 parser、参数、提示正文或能力执行逻辑。
已比较后提交的 #8132,其 stable patch-id 相同但作者不同;那是重复提案,不构成本 PR 的额外交付收益,也没有另作第三项正式评审。
对主干的风险 / Risks
没有发现阻塞问题。最强风险是借归类隐藏错误命令,或顺带改变帮助/执行默认。原检查仍同时要求完整与互斥,基线实际为 1 failed/1 passed,报告唯一未分类项 anti-entropy;当前 head 为 2 passed。六种真实 CLI(无参数、--help、commands、anti-entropy 及 inspect/verify 的帮助)共 16,469 字节 stdout,加 11,414 字节完整 manpage,全部原样相等;parser 和核心手册集合也相等,未归一化输出。
完整 head manpage smoke 仍为 failed,失败在临时目录退出时的 Err66 清理。随后对固定 target main 和该 head 运行同一原安装阶段,两者均复现同一完整错误栈;仅规范化临时 fixture 路径,源码 fixture、检查器和环境摘要一致。分类常量没有安装、渲染或清理调用方,六种 CLI 输出和完整 manpage 又独立逐字相等,因此该清理失败归为无关既有问题;不宣称完整安装 smoke 通过或原作者的 npm TLS 原因已解决。
配置 mypy 在双方通过(17 source files),变更文件 Ruff 通过;quick premerge 的六个直接检查及三个选中检查完成,语义、CLI 输出预算、编译和双语检查通过。单文件公开边界扫描 exit 0、errors/warnings 0/0。原始 maintainability ratchet 仍失败:固定 target main 与 head 的完整 JSON 仅去除 repository_root 后相同,唯一未审查项仍为未改动的 _admitted_interaction_next_cli_actions(62 decision points,阈值 60)。保留 failed 和原阈值,不以此要求本 PR 修改无关函数。 CQR 对原始 ratchet 和独立安装阶段只采用当前 exact-scope 的可复核 optional 归因,失败仍写为 failed。未查询或等待 CI。
语义与 CI 对齐
diff advisory 明确报出既有 Python closed set 新增一个名字。判断是留在原 local metadata owner:它不是共享状态协议、用户 prose 分类或运行时资格门;不能从“帮助可见”推出“能力已启用”。仓库检查的强制性保持不变,没有把硬约束称为建议。
我的整体评价 / Verdict
goal_achieved 只针对遗漏分类的维护修复。long_horizon 和 user_experience 均为 preserved:原续跑和能力行为不变,现有帮助无需新配置、信息重填或确认,用户路径没有增加轮次。本次只补测试与治理读取的分类集合,实际 CLI 帮助和 manpage 全文逐字相同,未改变 frontend/Lark 或页面布局。 完整安装 smoke 的临时目录清理失败仍保留;不宣称原生 Windows 或实际能力执行已验证。
命令注册、帮助渲染和执行权限各有既有归属;这一行只应留在现有可见性元数据中,由原检查消费。 当前 PR 的完整边界是一项 help-only 归类,不新增核心手册段落、状态或能力开关。 这一行是当前最小改动,不需要为单一 metadata 项再提取 helper 或增加核心手册内容。记忆中的产品旅程建议在这里适用于核对真实 help 入口,不能扩成要求实现新功能。现有 exact-scope CQR 有效;批准不等于完整安装 smoke 通过,也不授予合并、修复无关清理路径或推广能力的权限。
English verdict: APPROVE — the existing command gains its missing help-only classification, while all inspected public help and manual bytes remain unchanged. The full installer/manual smoke remains failed at an independently reproduced, unchanged cleanup stage; no runtime activation or merge authority is granted.
Goal And Delivered Outcome
Full Public Smokescli-help-manpage-smoke.pyfailure after feat(capability): introduce opt-in anti-entropy code governance #7545 introduced theanti-entropycommand.COMMAND_GROUPSor explicitly kept on its command-specific help surface.anti-entropywas added by feat(capability): introduce opt-in anti-entropy code governance #7545 but was in neither, so the smoke reportedunclassified: ['anti-entropy']. This change classifies it on its command help surface, consistent with the other capability commands such asmaterial-lifecycleanddecision-context.assert_top_level_commands_are_explicitly_classified()raises on base; after this change it passes. The full smoke then proceeds to its npm-backed installer checks.loopx-project/loopx:main.Author Declaration
Implemented against
examples/cli-help-manpage-smoke.pyat1b636dee16, classification assertion at line 102;loopx/help_surface.pyowner comment at lines 365-367.COMMAND_GROUPSorMANPAGE_COMMAND_HELP_ONLYloopx/help_surface.py:368assert_top_level_commands_are_explicitly_classified()anti-entropykeeps a command-specific help surface without entering the core manualMANPAGE_COMMAND_HELP_ONLYexamples/cli-help-manpage-smoke.py:101Scope And Continuation
Validation
6c7145803733dd94e7daf118c77d468b7febd499unitpassedpython3 -m py_compile loopx/help_surface.py;assert_top_level_commands_are_explicitly_classified()→classification assertion ok.regression_paritypassedunclassified: ['anti-entropy']on base1b636dee16and passes on this head.integrationnot_runassert_installer_manpage_surface()atnpm cibecause this host cannot validate the registry certificate (UNABLE_TO_GET_ISSUER_CERT_LOCALLY). Hosted CI has working npm; that step is not affected by this diff.staticpassedgit diff --check.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).