Skip to content

Keep the complete quota Vision audit within the CLI budget - #9062

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/repair-complete-quota-cli-budget-20261119
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/repair-complete-quota-cli-budget-20261119

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Outcome

The complete quota should-run contract now fits the existing 59,000-character ceiling for the 36-Todo, 12-run Vision fixture. On the same input, the complete body fell from 60,840 to 58,844 characters. The root still carries the full Vision audit. The CLI channel can refer to its exact view within that packet, with the same required clauses and judge state. The producer keeps differing channel facts inline.

完整配额包仍保留原始 Vision 审核。CLI 通道只在内容完全一致时引用原包中的对应视图。36 条 Todo、12 次运行的同一负载从 60,840 降到 58,844 字符,保留原 59,000 字符门槛。

The CLI tests now verify the shipped complete Turn paths for selected Todo provenance, goal-boundary authority, Todo diagnostics, Markdown and selector parity. Each selector reply verifies its own source and content digests before the test compares equivalent facts. The host-binding test reads the original saved decision through its emitted reader command.

Validation

Exact candidate 9728962da36ed6d4658d5bef123eb214907343bf against main at 5cfd6ae7d571f2f97da40982db23f76540723c89. Authored by an OpenAI Codex model agent.

Check Result
CLI output and contract suite 47 passed. The previous suite on main had 10 failures. The budget ceiling and workload are preserved.
Installed macOS CLI File emitted 58,844 characters and SQLite emitted 58,858. Both restored the former CLI audit view, validated a saved inline capture, read the original App-profile capture and rejected a wrong digest. The original bytes survived both reads.
Adjacent checks 263 Python and 103 TypeScript checks passed. TypeScript typecheck, Ruff and bilingual diff checks passed.
Local integration with #8716 The combined tree 5f3545e1844afb2b0a1dd9b1ac8ca1bc60ef25f7 passed all 47 budget checks and emitted 58,825 characters on the same Vision fixture. Its parents were this candidate and reviewed #8716 head 37b85e877c0e. Related PR
Premerge The Goal-managed gate passed five direct checks and all required checks across 15 selected runs. One maintainability advisory remains. Exact change-quality receipt cqr_c50d49c35cad005676f3.

New references use the complete Turn reader that ships with the writer. The current reader accepts earlier inline captures. Installed Windows and live hosted rollout remain open. This change affects CLI capture serialization and leaves visual surfaces outside the diff.

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.

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 原生选读漏交付 Vision 审核的必读步骤

在 File 和 SQLite 安装包上跟完 App 首读及剩余选读。主干送达 required_before_closeout 与 registry 读取说明。这个头只送达 required、continue 和根引用,既有 CLI 子路径选读返回指针缺失。通过同一捕获的根路径能读回原义务。 相关代码

动机 / Motivation

Codex App 和普通 CLI Agent 读 quota 当前工作契约,再判断 Vision 是否可以收尾。36 条 Todo 与 12 次运行的完整输出曾超过 59,000 字符。CLI 通道重复携带根审核里的多项义务。允许同一捕获复用完整审核。现有正常计划仍需送达原收尾条件和先读登记材料的顺序。本轮核验完整输出和原生首读接续。生产采纳、收费及跨平台安装仍需各自证明。

改动思路 / Approach

完整 Turn 先生成根审核。CLI 投影精确比较这一个 owner 的派生视图,再决定是否压成引用。原生选读仍按发布后的字段地址规划,新增引用缺少同一捕获的必读交接。四个路径涉及 TypeScript 完整包、协议说明与 Python、TypeScript 测试。根数据与已保存旧包均可读回。使用两份独立安装的 Core wheel,对同一规模的 File 和 SQLite 工作负载先度量完整正文。再用真实原生 SessionStart、首读、后续选读和错误摘要走一遍调用路径。

具体改动 / Changes

精确 head 9728962da36ed6d4658d5bef123eb214907343bf,diff base 5cfd6ae7d571f2f97da40982db23f76540723c89,4 个文件 +197/-121。逐项复核 same-fixture-full-body、original-capture-reader、planned-read-obligation。验收约定

关键代码讲解

  • cliVisionAuditView 从根 audit 取原 CLI 规则和 judge 字段。源码
  • requireVisionAuditReferences 校验引用作用域和候选字段的精确一致性。源码
  • referenceVisionContinuation 将同值 CLI 视图换为短引用。原生首读需要消费这一语义。源码
  • 既有渐进读计划发出 CLI 通道,复验必须同时覆盖其余选读和同捕获回退。源码

对主干的风险 / Risks

完整正文实测 File 60,964→58,968,SQLite 60,978→58,982,均保留 59,000 上限。普通完整包根审核和旧内联 capture 可读,错误摘要拒绝。App 在主干的首读与后续选读送达 registry 规则,候选只给 required 和 continue。向内联 CLI 子路径选读会令现有批次失败。显式改用同一文件的根路径可读回五条原义务。46 项 Python 通过、1 项跳过,103 项 TypeScript 通过。

语义与 CI 对齐

先查看登记材料,再做外部调研,是已载入审核的顺序义务。证据不足则保持 Vision 活跃。根审核保留这些条款。生成的渐进选读应沿同一摘要交付根路径,让 Agent 在依赖这项决策前按原顺序读取。预算数字只衡量完整输出。

我的整体评价 / Verdict

请求修改。保留现在的精确去重,把根审核安排进现有原生选读流程,携带原使用时机。用已安装 CLI 复测 App 的实读和补读,同时保留 59,000 字符上限与旧内联捕获回读。

English verdict: REQUEST_CHANGES. At 9728962, both installed backends fit 59,000 characters. The native selected read drops the registry-first closeout rule and the existing nested selection fails. The original root still reads successfully.

if (!shareCliView || path[1] !== "cli_channel" || !supportsCliVisionAuditView(owner)) return audit;
const view = cliVisionAuditView(owner);
const scopedReference = visionAuditReference(view, true);
return candidate === identity(view, ["vision_continuation_audit"]) &&

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.

完整包的同值去重通过预算。现有 App 原生选读仍请求 CLI 通道。File 和 SQLite 跟完正常首读与余量入口后均缺失原收尾步骤和先读登记材料的说明。请让现有渐进读计划在看到此引用时从同一摘要选读根 audit,带回原依赖时机。

@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 · Gemini · Google (self_reported)

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 原生渐进读取与子路径选读未解引用 projection_view: "cli_channel",导致 Vision 审校必读指令丢失

在 File 与 SQLite 后端上以相同 SCENARIOS[1](36 条 Todo、12 次运行、include_agent_vision=True)对不变基线 5cfd6ae7d5 与本提交 9728962da3 做配对反事实实测:完整 JSON 输出确已成功压进 59,000 字符预算上限(File:60,840 -> 58,844;SQLite:60,854 -> 58,858),根路径 --select /vision_continuation_audit 也能正常返回全部字段(退出码 0)。但当开启 --codex-app --context-delivery on 走原生渐进读取(first_read_command + remaining_read_command)时,loopx/control_plane/quota/progressive_context.ts#L1168-L1178(initialContextReadGroups)仍然只选取 /interaction_contract/cli_channel/vision_continuation_audit 而未补选根 /vision_continuation_audit(实测 has /vision_continuation_audit=False),导致原生首读仅返回 4 个字段的存根 {projection_ref, projection_view, required, vision_gap_judge: {decision, done}},静默丢失 required_before_closeout、recommended_action、reason、registry_read_instruction、evidence_read_instruction、agent_judge_instruction、done_only_when、continue_when 与 otherwise;同时恢复子路径 --select /interaction_contract/cli_channel/vision_continuation_audit/required_before_closeout 从基线 rc=0(471 字节)退化为 rc=1(context_selection_missing_pointer)。请在 progressive_context.ts 中识别 projection_view: "cli_channel" / projection_ref: "$.vision_continuation_audit" 并同步调度选读根 /vision_continuation_audit,补齐 File 与 SQLite 原生渐进读回归测试。相关代码

动机 / Motivation

本 PR 面向在 36 条 Todo、12 次运行的 Vision 负载下执行 quota should-run 的 CLI 调度链路,以及依赖 --codex-app --context-delivery on 首读与后续选读获取 required_before_closeout 和 registry_read_instruction 等 Vision 审校约束的 Agent。改动前(5cfd6ae7d5),quota should-run --context-delivery off 在 File/SQLite 下分别输出 60,840 / 60,854 字符(超过 59,000 上限),但 --codex-app --context-delivery on 的原生首读与后续选读以及 --select /interaction_contract/cli_channel/vision_continuation_audit/required_before_closeout 都能完整拿回 required_before_closeout、recommended_action 与 9 个 vision_gap_judge 字段。改动后(9728962da3),--context-delivery off 完整响应分别降至 58,844 / 58,858 字符(稳定低于 59,000 上限),但 progressive_context.ts#L1168-L1178 仍只选取 /interaction_contract/cli_channel/vision_continuation_audit 而未补选根 /vision_continuation_audit,导致原生渐进读取仅拿到 4 个字段的引用存根并丢失 required_before_closeout 与 registry_read_instruction 等约束,同时既有子路径 --select /interaction_contract/cli_channel/vision_continuation_audit/required_before_closeout 返回退出码 1(context_selection_missing_pointer)。完整 JSON 预算目标已在 File(58,844 字符)与 SQLite(58,858 字符)两侧达标,根 /vision_continuation_audit 与旧内联捕获回读兼容保持完好;但 --codex-app --context-delivery on 原生渐进读取和子路径 --select 发生义务丢失,必须补齐读取端联动。本 PR 不调整 59,000 字符硬上限阈值,不更改 goal_frontier_projection.vision_continuation_audit 已有引用契约,也不修复基线既有的 test_quota_vision_audit_references.py 完整性哈希测试、test_vision_budget_cli.py wait 收尾测试或 maintainability ratchet 遗留告警。

改动思路 / Approach

在 TS 控制面既有拥有者 turn_envelope.ts 内复用 referenceVisionContinuation 消重是正确的架构归属(无需修改预算上限或增加 Python 并行规则);当前边界仅缺同一 TS 包内的 progressive_context.ts 消费端联动。完整 Turn 决策仍先以根 $.vision_continuation_audit 为单一真源,再在 composeCompleteTurnDecision(turn_envelope.ts#L2140)传入 shareCliView = true,用精确结构对比确认 cli_channel.vision_continuation_audit 与根完全等价后替换为轻量引用;未开启 shareCliView 的路径与历史内联捕获仍完整保留。

当前 PR 仅覆盖 turn_envelope.ts 生产端、单测与协议文档,尚未联动 progressive_context.ts#L1168-L1178 读取规划,必须补齐该边界后才可合并。不直接放宽 59,000 字符上限可以真实剔除同包重复文本,也不引入独立状态的同步负担;唯一的边界缺口是下游原生读取计划仍假设全部字段内联在 cli_channel 下,导致真实 --codex-app 调用链未能把引用解引用回根对象。

具体改动 / Changes

审阅基线为 5cfd6ae7d571f2f97da40982db23f76540723c89,精确提交为 9728962da36ed6d4658d5bef123eb214907343bf(4 个文件 +197/-121),依据协议契约 docs/reference/protocols/quota-cli-hot-path-compaction-v0.md(固定版本 5cfd6ae7d571f2f97da40982db23f76540723c89)逐项判定:

  • same-workload-cli-budget-ceiling:implemented — turn_envelope.ts#L2140 使 File/SQLite default_off 降至 58,844 / 58,858 字符(<= 59,000)。
  • complete-packet-and-default-off-parity:implemented — 根 /vision_continuation_audit 与旧内联捕获回读均完整保留。
  • native-progressive-read-obligation-parity:not_met — progressive_context.ts#L1168-L1178 未在 projection_view: "cli_channel" 场景下补选 /vision_continuation_audit,原生首读与子路径 --select 丢字段/报错。
  • protocol-projection-view-consumer-sync:not_met — 协议文档第 113–125 行与 turn_envelope.ts 一致,但下游渐进读取消费端尚未对齐。

关键代码讲解

  1. cliVisionAuditView(turn_envelope.ts#L533-L543):提取 required、required_before_closeout、recommended_action 与 9 个 vision_gap_judge 字段构成规范 CLI 视图,供消重前精确比对,避免字段语义被局部覆盖时误压缩。
  2. visionAuditReference(turn_envelope.ts#L549-L564):新增 cliView 分支,输出带 projection_ref: "$.vision_continuation_audit" 与 projection_view: "cli_channel" 的 4 字段存根,同时保持默认 goal_frontier_projection 引用结构不变。
  3. requireVisionAuditReferences(turn_envelope.ts#L583-L599):强校验 projection_view === "cli_channel" 仅允许出现在 cli_channel 路径且满足 supportsCliVisionAuditView(owner) 及结构完全一致,否则拒绝构造决策。
  4. referenceVisionContinuation(turn_envelope.ts#L601-L620、#L2140):composeCompleteTurnDecision 传入 shareCliView = true 执行就地视图压缩,但仅作用于生产者输出。
  5. initialContextReadGroups(progressive_context.ts#L1168-L1178,未随本 PR 修改):仍硬编码选取 ("interaction_contract", "cli_channel", "vision_continuation_audit"),未在 projection_view: "cli_channel" 出现时附带根 /vision_continuation_audit,成为原生读丢字段的直接触发点。

对主干的风险 / Risks

  • 回归触发路径与最小修复:见顶部 [P2];若合入当前 HEAD,所有启用 --codex-app --context-delivery on 的长程 Vision Turn 将在首读阶段失去 required_before_closeout 与先读登记材料/证据指令,且子路径 --select 失败。最小修复是在 progressive_context.ts#L1168-L1178 识别 projection_view: "cli_channel" 后把 /vision_continuation_audit 纳入初始/剩余读组,并在 File 与 SQLite 后端重测原生读取与子路径语义。
  • 本地验证实测:
    • tsc --project tsconfig.control-plane.json --noEmit(symlink node_modules 隔离下):PASS
    • TypeScript 测试:tests/control_plane_ts/{turn_envelope,context_selection,context_delivery,context_projection_root,diagnostic_projection}.test.ts 124/124 PASS;tests/control_plane_ts/{progressive_context,interaction_context_readback,context_source_identity}.test.ts 31/31 PASS。
    • ruff check loopx/control_plane/quota tests/control_plane/test_cli_output_budget.py:PASS;mypy(17 files):PASS;check_rfc_bilingual.py:PASS;loopx check --scan-path 公开边界扫描(4 files):PASS。
    • Python pytest:test_cli_output_budget.py、test_complete_host_request.py、test_turn_envelope.py、test_quota_vision_audit_references.py 共 153 passed, 2 failed,其中 2 例失败均位于 test_quota_vision_audit_references.py 的 test_real_guard_capture_and_recovery_preserve_vision_before_effects[file|sqlite](已在不变基线 5cfd6ae7d5 上复现同等 2 failed, 20 passed 与相同报错 EffectRuntimeRejected: complete Turn decision content integrity mismatch,属 pre_existing_unrelated);test_quota_cli_projection.py、test_progressive_native_context.py、test_vision_budget_cli.py 共 143 passed, 2 failed,2 例失败位于 test_authoring_example_material_closeout_has_no_missing_path_replan[file-wait|sqlite-wait](已在不变基线 5cfd6ae7d5 上复现同等 2 failed, 6 passed, 14 deselected 与 test_vision_budget_cli.py:315 相同断言失败,同属 pre_existing_unrelated)。
    • canary premerge:direct checks 4/4、python_compile 1/1、risk_profile_smokes 8/8、public_boundary 1/1、quota-plan/quota-work-lane-policy/monitor-scheduler-contract smoke 3/3 均 PASS;examples/control_plane/cli-output-budget-regression-smoke.py 在并行 premerge 争用下超时(175.444s),但独立复跑直接通过(cli-output-budget-regression-smoke ok);semantic-vocabulary-drift-smoke.py 在剥离 worktree 下缺 node_modules 失败,补齐临时只读 symlink 后 PASS;control-plane-maintainability-ratchet-smoke.py 对 2 个未修改历史文件报 advisory fail。
    • File/SQLite --context-delivery off(58,844/58,858):PASS;File/SQLite --codex-app --context-delivery on 原生渐进读取与子路径 --select 反事实:FAIL。

语义与 CI 对齐

cli_channel.vision_continuation_audit 新增 projection_view: "cli_channel"(属于扩展共享投影语义,未新增域专用或非类型化字符串规则),但共享协议文档与 turn_envelope.ts 已切换为引用视图,而 progressive_context.ts 仍按旧内联契约读取,构成 semantic_alignment 违例(violated),导致 native-progressive-read-obligation-parity 无法闭环。CI rollups 按目标配置不作阻塞依据(wait_for_ci: false)。

我的整体评价 / Verdict

当前评估为 fragmented,long_horizon 与 user_experience 均判定为 regression(observable_semantics 为 unintended_drift、semantic_alignment 为 violated、code_volume 为 necessary 且兼容性保留得当、change_proportionality 为 proportionate)。视觉审阅结论:仅变更 TypeScript 控制面上下文编排 turn_envelope.ts、协议文档与单测,不修改任何前端渲染组件或 UI 视图(未验证范围:无(纯 CLI / 控制面 JSON 投影契约改动,不涉及前端界面渲染))。请保留 turn_envelope.ts 精确结构消重与 <= 59,000 字符预算成果,补齐 progressive_context.ts 对 projection_view: "cli_channel" 的根 /vision_continuation_audit 自动选读并附 File/SQLite 回归测试后,再重新提交复审。

English verdict: REQUEST_CHANGES. At 9728962da36ed6d4658d5bef123eb214907343bf, default_off fits 59,000 chars on both File (58,844) and SQLite (58,858), but progressive_context.ts#L1168-L1178 omits root /vision_continuation_audit during --codex-app --context-delivery on progressive reads and --select /interaction_contract/cli_channel/vision_continuation_audit/required_before_closeout fails with context_selection_missing_pointer.

This branch has not been deployed

No deployments
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.

1 participant