Skip to content

refactor(quota): stop regenerating retired view flags - #9055

Merged
huangruiteng merged 1 commit into
mainfrom
codex/c1-generated-command-aliases-20261119
Nov 19, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/c1-generated-command-aliases-20261119

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

C1 uses the complete v1 contract for new quota work. Before this change, an accepted historical view flag still propagated through new heartbeat bootstrap, guard, selection and settlement recovery commands. Those commands now use the ordinary v1 entry. The guard uses the same detail selection after recording an automatic stall.

Saved wrappers still reload on wake. The bootstrap reader recognizes their exact historical bytes and the CLI accepts their existing flags under the original input restrictions. Same-Turn selection, replay and recovery retain the original binding. With explicit context and Delta Off, the guard returns the full inline contract.

C1 consumption chain and cutover

Author declaration

Written by model_agent using OpenAI Codex. Target branch main.

Criterion Disposition Evidence
New work enters the current complete contract Implemented New bootstrap, guard, thin regeneration, selection, and recovery use the ordinary entry.
In-flight work keeps its original identity and recovery Implemented The CLI recognizes saved wrappers and retains capture options, effect identity and the original receipt.
Retire duplicate current routes once consumers are migrated Implemented for generated view flags Historical matching is confined to the saved-wrapper reader. Other Host consumers are outside this slice.

Validation

Tested revision 3b4eef4de70fb4aeaa4d8d103a6461502ff91996. The inputs were synthetic project fixtures.

Check Result Evidence
Paired real CLI and isolated Core install Passed File and SQLite each replayed both saved flags from main 41ea75e89892. The original wrapper and guard still executed, newly generated commands excluded the flags, and selection/replay retained the same Todo, Turn, and effect. The six changed product files matched the non-editable wheel.
Real CLI selection, delivery and recovery Passed The worker matrix exercised inline Off, native context and private handoff on File and SQLite with once-only settlement. Recovery and dated-wait checks preserved existing receipts and avoided a debit for wait.
Focused regressions Passed 350 tests and both selected heartbeat smoke checks passed. Two PowerShell 7 cases skipped because the executable was unavailable.
Static and local validation Passed Ruff, configured mypy, bilingual diff and the public boundary scan passed. Standard premerge passed six direct and 19 selected checks, with one maintainability advisory in the untouched interaction contract.
Task-body finalization Passed Compared 288 prompt cases before and after consolidating settlement binding and Host budget validation. Each kept the same result or error, including 75 fine-grained bodies and 57 Host budget refusals. The heartbeat builder is now within the maintainability threshold.

Scope and continuation

This slice retires flag generation and keeps the same quota and settlement owners. Actual App adoption, remaining historical-reader exits, and matched single-session outcomes and full costs remain open. UI impact is none. DCO sign-off is present.

@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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)

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

动机 / Motivation

已保存 LoopX 心跳的宿主在每次唤醒时重新读取当前契约,也要恢复仍欠结算的旧 Turn。普通 quota guard 已经输出完整 v1,之前生成的 bootstrap、guard、选择和恢复却仍传旧格式别名。更新后的命令沿同一 v1 入口生成,旧 wrapper 逐字识别,明确关闭渐进和 Delta 后仍能拿到完整内联契约。验证范围是新命令生成、旧输入兼容、原 Turn 选区和恢复,不涉及实际 App 切换。

改动思路 / Approach

普通 quota 的完整组合仍在既有 typed owner。旧 wrapper 的逐字识别留在读取边界,新命令由同一生成器输出。刷新恢复沿原回执查找 identity。生产改动触及六个入口与适配模块,测试覆盖宿主启动、捕获、等待和结算。旧捕获的读回继续走现有来源与摘要。用 base 生成两种历史 wrapper,再用实际 CLI 跨版本载入。另测显式 Off、身份偏离、同 Turn 选择和结算。

具体改动 / Changes

精确 head 3b4eef4de70fb4aeaa4d8d103a6461502ff91996,diff base 41ea75e89892ed88d0ae543e97e31aad0a181c47,11 个文件 +188/-176。逐项复核 one-generated-entry、saved-wrapper-scope、original-turn-recovery、explicit-transport-off。验收约定

关键代码讲解

  • 读取旧 wrapper 时重建原字节,仍按完整相等识别。改写正文或换到另一二进制均未取得原路径资格。源码
  • 新生成的 guard 和 thin 入口保留捕获和交付参数。任务正文先绑定原 Turn,再按宿主限额检查。源码
  • 同 Turn 选择继续携带原捕获根、显式 Context/Delta 和 handoff 参数。已有存档不改写。源码
  • 自动 stall 回读采用用户已请求的 agent-todos 范围。日期等待的原事件仍可重放,未产生扣额。源码
  • 刷新失败的恢复命令按原 Goal、Agent、Todo 和 Turn 组成。在 File 与 SQLite 的拒绝和重试路径验证只结算一次。源码

对主干的风险 / Risks

四组配对验证跨 File 和 SQLite。原 capture 字节与回执均相同。发布前已核对 79 项聚焦测试通过,2 项 PowerShell 用例跳过,另有 12 项宿主启动测试通过。已安装的 Codex App 和 Lark 采用仍待核验。

语义与 CI 对齐

旧别名继续经过原输入限制,新命令退出格式选择。历史捕获保留原摘要,读页、等待和验证回执均不扩大执行或花费范围。

我的整体评价 / Verdict

通过当前精确提交。新命令使用统一 v1 入口,旧 wrapper 逐字读回,显式 Off 与两种持久化后端的同轮身份和恢复均通过。后续 C1 的 App 和 Lark 实际采用、历史入口退役和完整成本需继续按原验收验证。

English verdict: APPROVE. New generated commands use the ordinary v1 route. Saved wrappers, explicit full-inline delivery, and original File/SQLite Turn and settlement recovery passed.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng force-pushed the codex/c1-generated-command-aliases-20261119 branch from 3b4eef4 to 45dce4c Compare November 19, 2026 06:59

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · GPT-5 · OpenAI · self_reported

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

动机 / Motivation

受影响 caller 是跟随 quota guard、bootstrap、selection 或 refresh recovery 的 Agent。旧行为让当前路由依赖一个已不承担准入意义的展示别名:新选择命令可能附加 --turn-envelope / --complete-turn,命令更长,也让历史命令兼容和当前生成混在一起。候选只为新命令生成当前完整契约,保存下来的旧命令保持原样。

具体 affected_caller_or_operator 是 agents executing quota commands;before_after_scenario 是新命令不再附加 retired alias,而已保存 command 继续保留。observable_outcome 是当前 routes 使用 complete v1 source,saved aliases 仍可执行且不改变 settlement identity;non_goals 是不修改 quota eligibility、provider、settlement identity 或 saved capture schema。

改动思路 / Approach

命令构造仍由 quota context reader 和 heartbeat builder 持有。新 selector 复用当前交互契约,不再推断或重写 view alias;已经存储的 command_args_template 和 bootstrap 则沿其记录的 reader 执行。这样把“历史读回”与“当前准入/选择”分成两条明确路径,不新增迁移,也不改变 exact Turn、settlement identity 或 host write 的所有者。Current generation uses the existing complete contract, while saved routes retain their recorded commands. 本次 current_pr_boundary 是 Stop regenerating retired view aliases for fresh quota routes while preserving saved selectors and bootstraps.

具体改动 / Changes

精确 head 45dce4c4c83c1bbcd38e126e21f81c0011a4a4a6,diff base 036a95fb1a,11 个文件 +188/-176。规范引用 docs/reference/protocols/turn-envelope-v0.md @ 036a95fb1aac866526dc2409e0468c25bc656a3d。new-routes-have-one-source 与 saved-alias-compatibility 均实现。

关键代码讲解

  • bind_capture_selection_transport 不再给新选择命令追加两个旧 view alias。
  • host_bootstrap_binding 只识别已保存 wrapper 的历史别名,新生成的 bootstrap 使用当前契约。
  • _heartbeat_prompt_commands 继续传播 capture/delivery 选项,但不再把呈现别名当成下一次准入所需参数。

对主干的风险 / Risks

最强风险是误删已保存 selector 仍需要的 alias。当前实现没有重写保存命令,并且对冲突 alias 仍 fail closed;fresh 与 saved 路径分别有测试。PASS:244 项通过、2 项 opt-in native 跳过;quick premerge 通过,包含 quota routing、scheduler ACK 和 public boundary。继承的 maintainability advisory 位于本轮 diff 之外。

语义与 CI 对齐

当前契约不只靠一个 flag 证明,仍读取 Goal、Agent、Turn、capture digest 和原结算身份。历史命令可以继续执行,但它不会因此获得新的准入或 freshness。

我的整体评价 / Verdict

批准当前精确提交。Current generation uses the existing complete contract, while saved routes retain their recorded commands; 本次边界是 Stop regenerating retired view aliases for fresh quota routes while preserving saved selectors and bootstraps. 当前命令更短、更一致,历史 capture 没有失去可读性。剩余安装态采用和两项环境跳过已明确记录。

English verdict: APPROVE at 45dce4c. Fresh quota routes stop regenerating retired view aliases, saved commands and captures remain readable, and 244 focused tests plus quick premerge pass.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · GPT-5 · OpenAI · self_reported

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

动机 / Motivation

受影响 caller 是跟随 quota guard、bootstrap、selection 或 refresh recovery 的 Agent。旧行为让当前路由依赖一个已不承担准入意义的展示别名:新选择命令可能附加 --turn-envelope / --complete-turn,命令更长,也让历史命令兼容和当前生成混在一起。候选只为新命令生成当前完整契约,保存下来的旧命令保持原样。

具体 affected_caller_or_operator 是 agents executing quota commands;before_after_scenario 是新命令不再附加 retired alias,而已保存 command 继续保留。observable_outcome 是当前 routes 使用 complete v1 source,saved aliases 仍可执行且不改变 settlement identity;non_goals 是不修改 quota eligibility、provider、settlement identity 或 saved capture schema。

改动思路 / Approach

命令构造仍由 quota context reader 和 heartbeat builder 持有。新 selector 复用当前交互契约,不再推断或重写 view alias;已经存储的 command_args_template 和 bootstrap 则沿其记录的 reader 执行。这样把“历史读回”与“当前准入/选择”分成两条明确路径,不新增迁移,也不改变 exact Turn、settlement identity 或 host write 的所有者。Current generation uses the existing complete contract, while saved routes retain their recorded commands. 本次 current_pr_boundary 是 Stop regenerating retired view aliases for fresh quota routes while preserving saved selectors and bootstraps.

具体改动 / Changes

精确 head 45dce4c4c83c1bbcd38e126e21f81c0011a4a4a6,diff base 036a95fb1a,11 个文件 +188/-176。规范引用 docs/reference/protocols/turn-envelope-v0.md @ 036a95fb1aac866526dc2409e0468c25bc656a3d。new-routes-have-one-source 与 saved-alias-compatibility 均实现。

关键代码讲解

  • bind_capture_selection_transport 不再给新选择命令追加两个旧 view alias。
  • host_bootstrap_binding 只识别已保存 wrapper 的历史别名,新生成的 bootstrap 使用当前契约。
  • _heartbeat_prompt_commands 继续传播 capture/delivery 选项,但不再把呈现别名当成下一次准入所需参数。

对主干的风险 / Risks

最强风险是误删已保存 selector 仍需要的 alias。当前实现没有重写保存命令,并且对冲突 alias 仍 fail closed;fresh 与 saved 路径分别有测试。PASS:244 项通过、2 项 opt-in native 跳过;quick premerge 通过,包含 quota routing、scheduler ACK 和 public boundary。继承的 maintainability advisory 位于本轮 diff 之外。

语义与 CI 对齐

当前契约不只靠一个 flag 证明,仍读取 Goal、Agent、Turn、capture digest 和原结算身份。历史命令可以继续执行,但它不会因此获得新的准入或 freshness。

我的整体评价 / Verdict

批准当前精确提交。Current generation uses the existing complete contract, while saved routes retain their recorded commands; 本次边界是 Stop regenerating retired view aliases for fresh quota routes while preserving saved selectors and bootstraps. 当前命令更短、更一致,历史 capture 没有失去可读性。剩余安装态采用和两项环境跳过已明确记录。

English verdict: APPROVE at 45dce4c. Fresh quota routes stop regenerating retired view aliases, saved commands and captures remain readable, and 244 focused tests plus quick premerge pass.

@huangruiteng
huangruiteng merged commit c71b4ff into main Nov 19, 2026
21 of 44 checks passed
@huangruiteng
huangruiteng deleted the codex/c1-generated-command-aliases-20261119 branch November 19, 2026 07:32
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