Skip to content

test(canary): isolate no-worktree fixtures from ancestor Git discovery - #7804

Merged
loopx-agent merged 1 commit into
mainfrom
codex/catalog-git-probe-isolation-20261101
Nov 1, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/catalog-git-probe-isolation-20261101

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

当 TMPDIR 位于 Git checkout 内时,catalog e2e 的“无 worktree”临时目录会向上发现父仓库,把应跳过的 Git-only 检查误当作可执行检查,随后因夹具里没有检查器而失败。这会阻断标准 premerge,#7800 已披露同类失败。

本次让该夹具创建真正没有 worktree 的 bare repository,阻止祖先发现;使用既有 repo_root 参数替换全局模块变量的修改/恢复。保留全部原始 skip、failure count 和 selected-check 断言;运行时检查、测试预算和生产代码不变。

  • Intended base: main; implementation base 938efb1efd4515ff3f54b008eebb5c820c05dbb3.

Author Declaration

  • Written by: model_agent; OpenAI Codex, GPT-6 family (exact runtime variant unknown).
  • Implemented against: docs/development/good-smokes.md 的独立语义 oracle/真实入口要求,以及 docs/development/README.md 的 bounded refactoring,revision 938efb1efd4515ff3f54b008eebb5c820c05dbb3。
Criterion Disposition Path / evidence
Git-only 检查在没有 worktree 时跳过,且原断言仍能发现误执行 implemented examples/canary/catalog-run-e2e-smoke.py; 普通/仓库内 TMPDIR 与误执行反例
同域有界简化 implemented 复用显式 repo_root,删除模块全局状态修改及恢复,不增加 helper

Scope And Continuation

Complete within this scope: 修复标准验收路径的确定性夹具缺陷,可单独回滚。#7800 的原生模型消费、C1/C2 完整采用和长期效果/完整成本仍由各自交付验收,本修复不认证这些结果。

Validation

  • Tested revision: cee58b9339cbb6da47592a3dd55a6fa12dc625f0 (tests ran on the same source before commit).
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
regression_parity passed 同一 base 普通 TMPDIR 通过、仓库内 TMPDIR 在原断言失败(selected subprocess exit 2);head 两种环境完整 catalog smoke 均通过。
real_entrypoint passed uv run --extra test python examples/canary/catalog-run-e2e-smoke.py,包含真实 catalog-selected CLI 检查;不是仅调用归一化 helper。
regression_parity passed 独立进程强制取消 Git-required skip 后,原断言失败、selected subprocess exit 2;恢复未修改的 helper 后通过。生产源码未改。
unit passed tests/canary/test_repository_root.py、test_git_path_framing.py、test_smoke_fixture_cleanup.py:16 passed,0 skipped。
integration passed 既有 catalog-planner-smoke.py 和 smoke-suite-runner-smoke.py 通过。
static passed changed-file Ruff、diff-scoped semantic advisory、diff hygiene、bilingual RFC check 和 public boundary scan 通过;没有新增协议词汇或 RFC 变更。
integration passed 原基线 938efb1 的 CQR cqr_2645206a28736c92ac19 与仓库内 TMPDIR 标准 premerge 通过:5 direct + 14 selected executions(含既有重复选择),0 hold。目标随后推进到 70f643153,仅涉及 updater 和 frontend-delivery 文档;本 fixture/runner 与根指令无变化。已复核原 head 不变并为当前 base 重录/验证 CQR cqr_92595dd2552b8bf5c521;未将原测试/premerge冒称新 base 重跑。
integration not_run 未运行全量 CI、原生 Windows 或真实模型会话;本 PR 仅修复合成 Git 夹具,无生产运行时或 backend 变更。

Frontend / Visual Evidence

  • UI impact: none. N/A:无界面或呈现变更。

Change Type / LoopX Area

  • Test update
  • Build, packaging, installer, or CI

Boundary Checklist

  • Diff 和本文不含私人状态、原始日志、凭据、内网链接或本机路径。
  • 没有新增 benchmark/model 运行或改变其它任务的权限。
  • 无成对 RFC 变更;原检查和预算保留。
  • DCO Signed-off-by 已包含于提交。

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.1-sol; OpenAI; runtime_reported; reasoning_effort=max.

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

动机

运行 catalog canary 或标准 premerge 的维护者,会在临时目录位于 Git checkout 内时遇到这个问题。
原来的“无工作区”目录会继续向父目录发现 Git,因此本应跳过的 Git 专用检查被执行,并因 fixture 没有对应脚本而退出2;本次用真实 bare repository 截止祖先搜索,并通过既有 repo_root 参数传入 fixture。
独立完整 smoke 在相同实际 base/head 上对照:临时目录在 checkout 外,两端通过;在 checkout 内,base 失败而当前 head 通过,原 skip、失败数与结果身份断言全部保留。
本次只修复现有集成 smoke 的隔离,不修改运行时跳过规则、额度、调度、权限或产品界面,不声称实际模型或长程净收益。

改动思路

fixture 必须实际处于无工作区状态,不能只因目录里没有 .git 就假定 Git 不会向上搜索。真实 bare repository 有 Git 元数据但没有工作区,既可截止祖先搜索,也能让现有 runner 的工作区判断按原规则运行。它没有通过 mock 或删除断言制造通过。

本次保留现有 runner 对 Git eligibility 的所有权,测试通过已存在的 repo_root 参数隔离输入,删除对全局 REPO_ROOT 的修改和恢复分支。当前 PR 边界是一个现有集成测试的可靠隔离;不需要新 helper、状态、CLI 或产品设置。

具体改动

关键代码讲解

  1. assert_git_required_smoke_skips_without_git_worktree L108 创建临时目录后执行 git init --bare --quiet,并显式传入 repo_root=temp_root。原有 failure_count=0、skip_count=1、skipped_git_required、脚本身份及完整 skips 列表断言均保留。
  2. _git_worktree_probe L196 是未改动的生产 owner,实际执行 git rev-parse --is-inside-work-tree。_git_required_skip 仍只在专用脚本且无工作区时给出 skip;测试修复没有改变这项规则。

接受依据为 docs/development/good-smokes.md,固定修订 938efb1efd4515ff3f54b008eebb5c820c05dbb3。Start With The Contract 由现有 catalog→runner→CLI 消费链满足;Prefer Semantic Pressure 由独立反例与 mutation 满足;Consolidate Without Losing Coverage 由既有覆盖对照及保留原集成入口满足。这里的依据是改动前合同,并非作者新写的验收说明。

对主干的风险

独立同一完整 smoke 对照如下,全部绑定实际 base 938efb1efd4515ff3f54b008eebb5c820c05dbb3 与当前 head cee58b9339cbb6da47592a3dd55a6fa12dc625f0:

临时目录位置 base head
checkout 外 PASS PASS
checkout 内 FAIL,专用子检查退出2、skip=0 PASS,原 skip 断言成立

另把真实 runner 的 _git_required_skip 在进程内故意改为不跳过,同一 smoke 立即失败:专用脚本退出2、skip=0、原 payload["ok"] 断言拒绝。正常 head 通过,说明原测试仍能发现错误执行,没有把失败吞掉。所有测试数据为合成临时仓库,没有修改生产源文件或活动 Goal。

三个 owning pytest 文件 16 passed,既有 planner 与 suite-runner smokes、Ruff、compile、diff hygiene 和公开边界扫描通过。当前 exact-scope 质量记录 cqr_2645206a28736c92ac19 已验证有效;带该策略的 standard premerge 为 5 direct + 14 selected 全通过,0 blocking failure、advisory 或 manual hold。重复进入不同 profile 的检查不计成独立测试数。未查询、轮询或等待 CI,CI 未知不构成本次否决依据。

覆盖检索确认,既有 repository-root 单测验证路径隔离、并发及写保护,git-path 与 cleanup 验证不同边界;均不能替代本例的祖先 Git 发现行为。当前是修复原 smoke,没有新增重复脚本或一次性样板;也没有已证实的重复违规需要升级限制建议。剩余风险是 Git 实现/平台差异,原生 Windows 本次未运行。

我的整体评价

APPROVE,限 cee58b9339cbb6da47592a3dd55a6fa12dc625f0。改动关闭了可复现的 fixture 隔离缺口,保留独立错误 oracle,并用现有显式参数简化测试。长期续行控制保持原样;维护者少一次误导性的验证失败,不代表模型效果、运行性能或长期完整成本已改善。

已检查现有 canary CLI、runner 和标准 premerge 消费链;本次只有测试 fixture 变化,没有渲染页面,visual_review 不适用。
原生 Windows 未运行;无页面改动,未测试模型采用或实际长期成本。

本记录采用同作者 COMMENTED fallback;平台 formal approval、merge readiness 与合并权限仍分别判断,本次不合并或 dismiss。

English verdict: APPROVE — the nested-TMPDIR fixture is isolated without weakening skip/failure checks at cee58b9339cbb6da47592a3dd55a6fa12dc625f0.

@loopx-agent
loopx-agent merged commit 3d52fd8 into main Nov 1, 2026
25 of 34 checks passed
@loopx-agent
loopx-agent deleted the codex/catalog-git-probe-isolation-20261101 branch November 1, 2026 10: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.

1 participant