Skip to content

fix(install): report unknown dirtiness when Git status fails - #7226

Merged
huangruiteng merged 2 commits into
mainfrom
codex/source-status-unknown-20261024
Oct 24, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/source-status-unknown-20261024

Conversation

@BigDataDZ

@BigDataDZ BigDataDZ commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

A source checkout with a valid HEAD but unreadable Git index cannot prove it is clean. The diagnostic adapter collapsed successful empty git status output and command failure into None, then reported git_dirty=False whenever commit/ref remained readable.

Preserve successful empty output and classify dirtiness from the status result: empty success is False, nonempty success is True, and failure is the existing None (unknown). Commit/ref normalization stays unchanged. Doctor metadata, release manifests and installed-skill source readback retain the known identity and unknown dirtiness.

Author Declaration

  • Written by: model_agent (OpenAI Codex), under the author's direction.
  • Specification/revision: existing nullable source metadata in loopx/doctor_git.py and source-installation provenance tests at 7a03792090abb44850109cb6f6d93219c63e555e. Basis: reproduced false-clean result; intended base main.
  • Criteria implemented: failed status is unknown; readable branch/detached-tag identity survives; successful clean/dirty, unborn, archive and environment-isolation behavior is preserved. This reuses the existing field and owner, with no new vocabulary or settings.

Validation

Revision: dee3e15cc2fddb6bd82ce93711a17161fbfa0ce5; finished, synthetic inputs, native Windows/CPython 3.12.10 and real disposable Git repositories.

  • Real corrupt-index regressions fail before the fix in branch and detached-tag cases. The repaired owner and both installation consumers preserve HEAD/ref and report unknown dirtiness. Only disposable fixture indexes are modified.
  • Final source-provenance and Git-encoding modules: 31 passed, 3 skipped. The skips are existing POSIX installer cases. Unborn repository coverage confirms successful status remains useful before the first commit; fixture Git selectors are isolated from ambient hook variables.
  • Broader six-module run: 89 passed, 3 skipped, 1 failed. The failure was the installation-only doctor's command-availability check with loopx absent from the test session PATH; that route does not invoke the changed Git owner. With the existing virtualenv Scripts directory added only to the test session PATH, the exact case passes (1 passed). No product workaround or global installation was added.
  • Ruff, whitespace, public-boundary scan, semantic coinage advisory and bilingual RFC diff checks pass. Independent author-side inspection checked both consumers; its fixture-isolation note was corrected and included in the final owner-suite rerun.

Scope And Continuation

Complete within this source-diagnostic repair. Keeping subprocess success distinct at the existing owner avoids a new abstraction or parallel decision source. This stable Python Git adapter serves existing doctor/installation metadata readbacks; no frontend/Lark/new CLI operation changes, so visual evidence is N/A.

Hosted CI has a failed artifact-build job: goal-hierarchy.mjs times out after browser history restoration while waiting for the source-A goal row. A source-pinned local packaged build passes, but the browser replay is blocked earlier by a Windows path-redaction stall in synthetic per-Goal status; it does not reproduce or resolve the CI navigation failure. Its cause remains unconfirmed; no assertion or timeout was weakened. Other hosted checks and maintainer review/merge remain pending. No live repository index, user Goal, provider/model Turn, benchmark, global installation, publication or self-merge was touched.

Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>
Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>

@loopx-agent loopx-agent 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-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

Exact head: dee3e15cc2fddb6bd82ce93711a17161fbfa0ce5

动机

通过 doctor 或安装清单核对源码身份和本地修改状态的维护者。 Git 状态读取失败时,只要提交或分支还能读取,诊断会把未知脏状态误报为干净。 同一份提交和分支仍可读取、索引却损坏的源码,修复前显示干净,修复后保留已知身份并明确保留未知状态。 损坏索引在诊断、写入后重新加载的发布清单、安装技能来源和 doctor 新鲜度投影中都保持未知,其余八类对照结果完全一致。 本次不修复索引、不安装或晋升发布包、不改升级决策,也不声称原生 Windows、已安装主机采用或长期收益已验证。

改动思路

修复位于现有 Python Git IO adapter:成功的空输出与失败分开,脏状态只由 status 的成败和内容判断;提交与引用继续采用原有空值规范化。诊断和安装消费者复用同一 owner,无第二套判断或迁移。 当前 PR 的完整边界是纠正源代码脏状态的 false-clean 结果,并保留原有来源身份、路径归属及消费者格式;没有新增配置、协议或执行权。

No change preserves a reproduced false-clean result. Catching more exceptions or dropping all identity would lose valid facts; distinguishing successful empty output at the existing IO seam is smaller than a new result type, wrapper or duplicate diagnostic rule. 当前既有意图和授权已经足够,不新增确认轮次或手动同步。读取失败只保留未知,既不让用户重复说明源码身份,也不替用户发起索引修复、安装或升级。 这个分支用文字已能说明,无新增图形服务或未核实的图示。

具体改动

没有独立规定此局部修复的已接受 RFC/契约文档或 issue,规格判定为 no_spec。验收来自不可变基线 7a03792090abb44850109cb6f6d93219c63e555e 的现有 nullable 来源字段、原源码归属说明和实际安装消费者;不会把作者列出的测试标准升格成新的共享规范。

关键代码讲解

  • git_metadata_for_root:原有源码根目录验证和四个环境变量隔离保留。局部 _run 只在命令失败或 OSError 时返回 None,成功的空字符串得以保留;commit、branch、tag 则各自继续 or None。status 失败给未知、空成功给 false、非空成功给 true,不能再从身份成功推断干净。
  • write_release_manifest:既有消费者沿 _source_metadata 写出原 nullable 字段,独立 load 读取该文件后仍是 null,而不是丢失提交/引用或变成 false。这里未增加持久化格式或迁移。
  • build_skill_install_readback:仍复用相同 Git owner 取得已有身份和 dirty;技能来源 digest、archive、未出生仓库等原退路保持。该消费者没有为了修复而重复判断 Git 命令成败。

完整差异两路径 +48/-10:生产 net 删除来自去掉多身份联合猜测,测试新增两个真实损坏索引和一个未出生仓库控制,并补全 GIT_COMMON_DIR fixture 隔离。较小的改进已经落实在同一函数,不需要另外抽象或公共状态类型。

对主干的风险

独立本机测试 63 passed,没有失败或跳过;覆盖 source-provenance、Git 编码、安装新鲜度、安装范围和晋升读回。敏感性检查把不可变 base 的 Git owner 接回原生产消费者:两个损坏索引原回归均在 False is None 处失败,未出生控制通过;head 原套件通过,不能把旧缺陷的失败算成新通过。

额外使用真实 Git 的十类相同源做 base/head 对照,走诊断、发布清单写入/加载、技能读取文件写入/加载以及 doctor 新鲜度投影。分支和 detached-tag 索引损坏时 status 实际返回非零,HEAD/ref 保持可读,只有 dirty 从错误 false 改为 null;干净、修改、未出生干净/修改、嵌套 archive、缺失、软链接和 linked worktree 八组完整结果保持,没有归一化语义差异。所有源文件字节保持,四个环境 Git 路由变量故意污染,未触碰活动仓库索引。

本地 quick premerge 6 直接 + 3 选中检查通过,包含已有安装、打包安装和 update smoke。相关 #7229 的远端主机识别与 #7235 的技能 lookup 只读修复已阅读,分别由原 trust parser 与技能 loader 拥有,未发现需要另建 dirty owner 的理由。本轮未查询/等待 CI;作者报告的 Release 导航超时和本机未重现原因不被当作已解决。该修复的真实 Git/持久化边界已验证,原生 Windows、全仓套件与已安装活跃主机采用仍是明确未测范围。

语义与 CI 对齐

复用现有词汇和 owner:既有 nullable bool 表达真实 unknown,没有新增枚举、状态协议或通用义务。commit/ref 规范化与安装摘要消费者保持;平台/路径读取不是新的执行或升级许可。 本地检查与远程 CI 分别记录,当前 wait_for_ci=false 不等于远程成功,也不授予合并权。

我的整体评价

未发现阻塞问题,APPROVE。交付判断为 goal_achieved,仅覆盖上述具体读取边界。长程影响 preserved:没有新增工作账本、自动重试、准入义务或模型调用,未测量长期净收益;用户体验 improved:损坏索引在诊断、写入后重新加载的发布清单、安装技能来源和 doctor 新鲜度投影中都保持未知,其余八类对照结果完全一致。 修复位于现有 Python Git IO adapter:成功的空输出与失败分开,脏状态只由 status 的成败和内容判断;提交与引用继续采用原有空值规范化。诊断和安装消费者复用同一 owner,无第二套判断或迁移。 当前 PR 的完整边界是纠正源代码脏状态的 false-clean 结果,并保留原有来源身份、路径归属及消费者格式;没有新增配置、协议或执行权。

检查了 doctor_git、发布清单、技能来源与 doctor 新鲜度消费者;没有布局、控件、渲染字段或展示协议改动,视觉评审不适用。 未独立验证原生 Windows 或已安装实际主机;本机真实 Git 与持久化读取边界已验证。 兼容性保留有真实消费者和源数据依据;同域简化已采用已有 IO/查询与恢复 owner,无需新框架。局部修复已完整达到所需诊断结果,无需为完成请求另造后继任务。 合并仍由维护者处理,本评审未执行合并、安装或外部投递。

English verdict: APPROVE. The exact head fixes reproduced false-clean Git status without losing known source identity, with real-Git baseline/head and persisted-consumer controls. No blocking finding. Native installed adoption and unrelated reported CI failures are not certified; the stated source/build limits remain.

@huangruiteng
huangruiteng merged commit 0971d13 into main Oct 24, 2026
29 of 38 checks passed
@huangruiteng
huangruiteng deleted the codex/source-status-unknown-20261024 branch October 24, 2026 12:16
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.

3 participants