Skip to content

perf(cli): focus task update help without changing its grammar - #7731

Merged
huangruiteng merged 1 commit into
mainfrom
codex/progressive-task-help
Oct 30, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/progressive-task-help

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

todo update --help 原先回退到整个 Todo 命令的联合帮助,显示不适用的完成/后继等参数;usage 又重复整套可选参数,容易在真正的选项说明前被工具截断。现在复用现有 mutable-field owner 投影 update 的帮助,并让已有 action-help 仅在 usage 保留 parser-required 输入;完整选项声明和条件说明仍在下方。

实际输入 grammar、校验、ownership/lease、状态和 root 完整帮助均不改变;Host 专用参数继续隐藏。没有新增 flag、配置或并行规则。公共 argparse Action 只用于格式化,不加入真实 parser;保留 Python 3.12/3.14 兼容性。

验证:真实 CLI 在不存在 registry 时查询帮助、必需输入、更新选项、Host 参数隐藏、parser 重用和现有 claim 参数恢复共 34 项通过。Python 3.12 真实入口也已通过;开发中的私有 argparse API 方案在 3.14 失败并已撤回。一次 pytest 临时目录清理 warning 保留,不影响测试断言。相同入口的 update 帮助为 27,118→15,658 UTF-8 bytes(−42.3%);claim 为 3,427→2,911B,inspect 为 717→695B,后二者的选项声明集合未变。这是帮助传输测量,不是模型费用或任务收益。

基线 e8f4c6f,head 39fe6bb。公共扫描和 diff-scoped semantic advisory 已完成。标准 premerge 全部通过(4 项 direct checks、1 项 Python compile、10 项 catalog、8 项 risk profile 及公共边界扫描);CLI 输出预算 smoke 在原 120 秒限制下 92.34 秒通过。另一同基线工作此前的两次超时仍保留,其精确 head 同一 smoke 随后在原限制下 80.83 秒通过,未修改阈值。尚未合并/安装/实验采用,需独立评审、要求验证及精确 head readiness。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

未发现当前 head 的阻塞问题。此为独立代码评审结论;合并仍需单独的权限与 readiness。

Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max

Exact head: 39fe6bbe39e0c778a955802f2d0f097ab2bb87f9;whole-PR base: d3d9ad209d0a8f57a7582e0165f2fad19df26dcf。审阅完整 base-to-head diff,并核对当前 target main 225698b313f3bcd5c967220013b4a2254c586792;没有沿用作者验证作为独立验收。

动机

受影响调用方:按动作发现任务命令参数的贡献者或 Agent,尤其是需要更新 Todo 的调用方。

原 update 帮助打印全部生命周期参数和冗长 usage;新帮助只列已有 update 参数,usage 保留必需项和 [options],完整参数说明仍在下方。

可观察结果:实际 17 类 CLI 帮助均可在无 Goal/lease 下读取;更新帮助从 27118 降至 15658 UTF-8 字节,原 parser、有效输入和拒绝语义不变。

边界:不改变任务语法、状态、授权或调度,不宣称模型理解、持续延迟、已安装宿主或长期完整成本收益。

改动思路

接受契约为 docs/reference/canonical-lease-renew.md,spec_revision d3d9ad209d0a8f57a7582e0165f2fad19df26dcf;对应 criterion_id Action help and argument recovery。按既有动作展示参数,保留条件约束和真实 grammar。该契约没有把较短输出本身当作权限或验收。

复用现有 ActionHelp 与 mutable-field owner 是合适的边界。没有新增 parser、手写第二份帮助、配置或状态。[options] 只传给 formatter;没有注册成可解析的 positional argument。usage 和 update 帮助的默认展示有意改变,下方完整声明仍承担具体参数说明。

复用现有 ActionHelp、真实 argparse actions 和既有 mutable-field 集合;仅把未注册的公开 Action 交给 formatter 表示 [options],不改 parser。

本次边界:只缩短既有动作的 usage 并补齐 update 的帮助过滤;完整参数声明、条件和状态检查保留。

具体改动

  • ActionHelp.__call__ 从现有 actions 生成必需项和 [options],随后仍打印所选参数的完整说明;条件要求、全局参数顺序和 authority 提示保留。
  • TODO_ACTION_FIELDS 的 update 项直接复用 _TODO_UPDATE_MUTABLE_FIELDS 和既有路由/operation 字段。真实 update validator 没有变成新的字段白名单,也没有放宽输入。

完整 diff 为三路径 +28/-3。独立验证:Python 3.14.8 下原 help、task-lease recovery 和 claim recovery 共 74 项通过;另在实际 Python 3.12 环境运行原 help/lease recovery,54 项通过,均无跳过。Ruff、changed-path Ruff、配置的 mypy 及标准 canary premerge --from-git-diff 通过,后者执行 6 项 direct checks 和 18/18 项 selected checks,零失败、零 manual hold。

最强反例不是检查某个字符串:同一冻结 probe 在 immutable base/head 上实际调用 17 类帮助,每次后重用同一个 parser,并运行三个有效输入及四个真实 CLI 拒绝用例。base 只在新 scoped-update usage 的预期断言失败,head 通过;跨版本 grammar/namespace 相同,11 类原 scoped 帮助的完整参数声明/条件正文相同,complete、supersede、todo、task-lease 和 root 的五份 fallback 全文逐字相同,未创建 registry/runtime。比较仅归一化三个已记录 checkout-root 默认值与唯一临时夹具路径,没有归一化参数、指令或拒绝语义。

对主干的风险

主要风险是帮助缩短掩盖条件要求,或 formatter 意外修改共享 parser。完整声明、before/after parser 快照和实际拒绝行为对照覆盖了这两点。update 仍显示 --claim-operation-id、operation/revision、validator、resume 等既有字段;不会暴露隐藏的 host lease 参数。27118 → 15658 UTF-8 字节是该固定实际输出的观测,不能外推为持续延迟、模型采用或完整成本收益。

已核对分支全部 DCO trailer、GH 路径与本地完整 diff、公私边界和干净 source。wait_for_ci=false,没有查询、轮询或等待 CI。本次只有 CLI 文本变化,没有需要截图的渲染视口;已安装宿主和真实模型效果仍未验证。

我的整体评价

当前切片解决了动作帮助中可复现的冗余,保持真实解析、条件/authority 规则和 fallback。复用和简化已落在现有 owner 内,无需引入额外抽象或扩大产品入口。独立正向、反向及主干风险验证足以支持当前 exact head 的代码批准。

English verdict: APPROVE. Focused action help preserves the actual parser and conditional authority rules, independently verified at this exact head.

@huangruiteng
huangruiteng merged commit 8d48efa into main Oct 30, 2026
31 of 37 checks passed
@huangruiteng
huangruiteng deleted the codex/progressive-task-help branch October 30, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants