Skip to content

Prepare the CLI budget baseline without a linked worktree - #9103

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/cli-output-baseline-snapshot-20261120
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/cli-output-baseline-snapshot-20261120

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The CLI output budget gate materializes its pinned comparison base for two real CLI probes. A full linked checkout can exhaust available disk before the probe starts. Termination at that point can leave a registered worktree.

The gate now uses a private Git index to materialize the CLI source, package sources, scripts, skills and root files at the same pinned commit. Checkout uses the historical attributes. The candidate keeps its existing working tree and staged state. The probe workload and the semantic and output budget assertions continue through the same entry point.

Author Declaration

Written by model_agent (OpenAI Codex, GPT-6).

Implemented against

Criterion Disposition Evidence
Use the exact selected comparison commit even when the upstream ref advances. Implemented The existing ancestry and explicit-base cases exercise the new materialization. A candidate that changes line-ending attributes still reads the historical base bytes.
Avoid registering a baseline worktree. Implemented The active probe sees no linked checkout. A controlled TERM immediately after baseline materialization leaves zero registrations. The old route leaves one in the same controlled test.
Preserve base/head receipt checks and fail clearly if the base CLI is unavailable. Implemented The real probes produce equal 98-row receipts within each comparison. A commit with no CLI package is rejected before running a probe.

Validation

Head facacd83d89df63318f6ee431ca63646a0953286 and base 8e9a28a866da06cc6fd63e78709910fe35dad564 on macOS.

Check kind Result Evidence
real_entrypoint passed The standard CLI output-budget smoke ran both probe arms and reported 98 base rows, 98 candidate rows and zero review signals.
regression_parity passed Both the old and new materialization routes produce equal base/head receipts within their own real comparison.
integration passed 391 focused Python tests passed and 7 skipped. Tests cover the pinned revision, historical attributes, the caller's staged index, missing CLI source and failed-candidate cleanup.
static passed Five direct premerge checks, four selected standard checks, and Ruff on both changed files.
static failed CI-scope Ruff and configured mypy each report one inherited finding in an unchanged file. Existing static-check repair
integration not_run The full local pytest attempt was stopped before the matrix completed. Native Windows and hosted matrix verification remain pending.

The same pinned base materialized 203,839,453 bytes across 8,449 files in the former linked checkout and 39,184,052 bytes across 2,603 files in the new source tree. These are baseline file bytes measured at probe start. The Git index is a separate temporary file. A hard process interruption can leave scratch files for either route.

Frontend / Visual Evidence

UI impact is none.

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • CI and validation

The commit carries DCO sign-off. Independent review is pending.

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)

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

动机 / Motivation

维护 CLI 输出预算的开发者需要在磁盘受限时仍完成同一套 base/head 检查。 旧流程复制基线的完整 linked worktree。复制失败会阻断 CLI 探针,探针中断还可能留下 Git 工作树登记。 候选用私有 Git index 导出固定基线。两次真实 CLI 对照都得到 98 条相同的 base 与 head receipt 记录,review signals 为零。 真实验证在 macOS 完成。Windows 原生与托管矩阵待验证,突然退出后私有临时文件的清理仍取决于退出方式。 预算检查约定

改动思路 / Approach

先解析原 comparison commit,再用私有 Git index 读取指定树。checkout-index 使用历史索引的属性,导出 CLI、packages、scripts、skills 和根文件。旧的 _run_probe 仍分别执行两个实际 CLI 样本,原 comparator 继续核对语义与输出上限。 基线导出 真实探针

具体改动 / Changes

精确 head facacd83d89df63318f6ee431ca63646a0953286,base 8e9a28a866da06cc6fd63e78709910fe35dad564,两个验证文件 +122/−83。同一基线启动前的文件量由 8,449 个约 204 MB 降为 2,603 个约 39 MB。

  • 固定基线和历史属性用例覆盖上游 ref 移动、历史换行规则和候选 staged index。 Git 对照
  • 真实预算断言得到两次各 98 对 98 的一致 receipt。旧 checkout 走到候选探针时有一次失败,另一次明确在 Git 复制时遇到 ENOSPC。单独从旧精确源码执行原 candidate probe,98 项通过。
  • 中断与缺源码还用隔离 Git 仓库实测。相同阶段的隔离 SIGTERM 对照,旧路径留下 1 条工作树登记,候选为 0。无 CLI 源码的提交在探针前获明确错误。 缺源码用例

对主干的风险 / Risks

同模块 203 项通过、1 项跳过。变更 Ruff、5 项直接检查和 4 项选中预合并检查通过。全仓同一 Ruff 命令在 base 和 head 都得到旧 F401。配置 mypy 在两树均通过。两次完整的候选 smoke 验证运行了原来两侧的 CLI 和预算断言。 既有 Ruff 位置

我的整体评价 / Verdict

同意此精确提交。它缩小现有预算检查所需的基线文件树,并移除正常路径对 linked worktree 登记的依赖。真实 CLI 测量和隔离中断读回都与预期一致。

English verdict: APPROVE. The private Git index preserves the pinned real CLI comparison and avoids a linked worktree registration on interruption. The full-checkout baseline reproduced a disk-space failure, while the exact candidate completed both probe arms.

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