Skip to content

fix(core): cover all companion distributions and harden installation metadata checks - #9522

Merged
huangruiteng merged 2 commits into
mainfrom
codex/fix-main-std-dist-doctor-probe-20261127
Nov 28, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/fix-main-std-dist-doctor-probe-20261127

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Summary

Fixes the origin/main regression in tests/test_core_standard_distribution.py::test_standard_installation_distinguishes_doctor_fingerprint_and_commands, aligns companion diagnostics across all six Core companion wheels (loopx-workspace, loopx-capability-benchmark-toolkit, loopx-capability-agent-turn-recall, loopx-capability-pull-request-review, loopx-capability-issue-fix, and loopx-capability-research), and hardens companion/core metadata parsing against unreadable, null-dir_info, or corrupt direct_url.json.

Root Cause

  • Commit 933579795a2 made package_runtime_fingerprint a required doctor --installation-only check (loopx/release_candidate.py), causing loopx doctor --installation-only to exit 1 (ok: false) whenever package_fingerprint is cleared (e.g. unowned/tampered files under loopx/).
  • PR #9049 (0e8c2b2b25d) branched prior to 933579795a2 and used _installation_doctor(...) (defaulting to expected=0) in tests/test_core_standard_distribution.py after injecting unowned_standard_probe.py.
  • collect_companion_distribution_diagnostics in loopx/release_candidate.py previously inspected only loopx-capability-research, ignoring loopx-workspace, loopx-capability-benchmark-toolkit (added on main via #9038), and [standard] wheels, causing false "no optional companion distributions installed" diagnostics and loopx-capability-research-only repair text when other companions were installed.
  • inspect_builtin_capability_distribution in loopx/python_install_owner.py parsed direct_url.json without handling decode/read errors or non-dict JSON, and CPython's PathDistribution.read_text silently swallows PermissionError / IsADirectoryError as None.

Changes

  • loopx/capabilities/benchmark_toolkit/catalog_entry.py, loopx/capabilities/agent_turn_recall/catalog_entry.py, loopx/capabilities/pr_review_queue/catalog_entry.py, loopx/capabilities/issue_fix/catalog_entry.py, loopx/cli_runtime.py: expose inspect_*_distribution helpers reusing inspect_builtin_capability_distribution with zero unconditional optional imports, while keeping existing *_installed() / _workspace_installed() checks delegating to ["ready"].
  • loopx/release_candidate.py: update collect_companion_distribution_diagnostics to inspect all six _CORE_COMPANION_DISTRIBUTIONS (loopx-workspace, loopx-capability-benchmark-toolkit, [standard], and loopx-capability-research) and tailor fingerprint-failure repair text to the actually installed companion distributions.
  • loopx/python_install_owner.py & loopx/release_manifest.py: extract shared read_editable_direct_url helper that rejects explicit "dir_info": null (checking key presence + isinstance(..., dict)) and inspects on-disk direct_url.json via lstat() + direct read when PathDistribution.read_text returns None, so unreadable (PermissionError / IsADirectoryError), empty, corrupt JSON, or malformed-dir_info direct_url.json fails closed identically (invalid_companion_metadata in companion diagnostics and omitted package_fingerprint in runtime identity) while keeping structured doctor --installation-only JSON intact.
  • tests/test_core_standard_distribution.py: add expected: int = 0 to _installation_doctor; assert expected=1 and ok is False on the unowned_standard_probe.py tamper probe, verify companion reporting (issue-fix / [standard]), missing-module failure (workflow_plan.py), and truncated, "dir_info": null, and unreadable (chmod 000) companion direct_url.json (invalid_companion_metadata preserving sibling companion diagnostics and structured JSON), plus clean recovery.
  • tests/test_doctor_installation_scope.py: add test_collect_companion_distribution_diagnostics_covers_all_core_companions (verifying 1:1 coverage of all 6 _CORE_COMPANION_DISTRIBUTIONS), test_inspect_builtin_capability_distribution_handles_corrupt_direct_url_metadata (including {"dir_info": null}), and test_read_editable_direct_url_rejects_null_dir_info_and_unreadable_file_on_path_distribution (including real PathDistribution with {"dir_info": null}, chmod 000, and directory replacement).

Verification (32d9745e6a3, base origin/main@2302e42d9ca)

  • Rebuilt wheels (loopx-core, loopx-capability-agent-turn-recall, loopx-capability-pull-request-review, loopx-capability-issue-fix, loopx-capability-research):
    • tests/test_core_standard_distribution.py: 3 passed (including unowned_standard_probe.py, missing workflow_plan.py, truncated JSON, dir_info: null, and chmod 000 direct_url.json)
    • tests/test_core_research_distribution.py (LOOPX_RESEARCH_TEST_ENABLED=1): 7 passed
    • (Earlier identical-surface wheel run at 9d6a3029563e also verified test_core_benchmark_distribution.py 7 passed, test_core_workspace_distribution.py 7 passed, bare loopx-core 71 passed, 7 skipped, issue-fix 3 passed, 2 skipped, pr-review 3 passed, recall 3 passed, and all-6 companion doctor --installation-only ok=true)
  • pytest -vv tests/test_doctor_installation_scope.py tests/test_distribution_runtime_identity.py: 56 passed
  • ruff check: All checks passed!; mypy --follow-imports=silent (7 edited production modules): Success: no issues found
  • loopx check (10 changed files): ok=True, errors=0, warnings=0
  • scripts/check_rfc_bilingual.py: passed
  • Change-quality qualification (cqr_c1f108f70e358e48e3c8): status="valid", decision="pass", scope_fingerprint="c1f108f70e358e48e3c8be4b80ad3949eecb8e50402a96c71690709bdb0f1454"
  • canary premerge --from-git-diff --git-diff-base origin/main --tier standard: 6/6 direct checks, 10/10 catalog canaries passed, 0 failures (manual_hold_count=1 expected for benchmark_sensitive because loopx/capabilities/benchmark_toolkit/catalog_entry.py is in scope)

@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 · xhigh

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

动机 / Motivation

通过 Standalone Core 安装或修复配套包的用户,需要用安装诊断查清哪个包可用、哪个包需要修复。旧版安装了 Standard 配套包时,安装诊断只检查 Research。即使指纹校验正确拒绝了损坏安装,修复提示也可能指向没装过的 Research。候选让正常安装列出五类配套包,也能为 Workspace 缺件给出对应修复建议。Issue Fix 安装元数据损坏时,安装诊断却丢失了原有 JSON 结果。本次核对真实 wheel 安装和现有诊断入口,覆盖包识别、文件缺失、元数据损坏和恢复。独立实测覆盖 macOS 与 Python 3.12。其他平台和发布安装器仍待验证。

改动思路 / Approach

安装诊断从本机安装的包元数据和已记录文件派生结果。四个新检查入口复用已有的包版本与文件归属检查,现有命令发现仍取同一检查的 ready 值。原 Research 检查沿用,普通整包在初始入口仍直接返回。只改测试期望可以修主线的退出码测试,却无法告诉持有配套包的用户该修哪一个。包元数据读取的失败应在共享检查器处得到一致处理。

已安装 Core 及其可选配套 wheel 的版本、文件、诊断和恢复。在共享安装检查器把无法解析的配套包元数据转换成现有的不可用诊断结果。保留必需检查失败和指纹失败,并在 JSON 中指出要修复的实际包。

具体改动 / Changes

精确提交 492bee6acdc14836953f89e599612e88781a5ea0,对照 0bcdffb9926e46a1024bcdacb18e24de37a1b018。改动 7 文件,+290/-31。loopx/capabilities/agent_turn_recall/catalog_entry.py 复用现有 Recall 安装检查,loopx/capabilities/issue_fix/catalog_entry.py 复用现有 Issue Fix 安装检查,loopx/capabilities/pr_review_queue/catalog_entry.py 复用现有 PR Review 安装检查,loopx/cli_runtime.py Workspace 检查改为同时向命令发现与 Doctor 提供同一结果,loopx/release_candidate.py 汇总安装状态和修复提示,tests/test_core_standard_distribution.py 已安装 wheel 交付路径回归,tests/test_doctor_installation_scope.py 配套包集合与缺件行为覆盖。

关键代码讲解

  • collect_companion_distribution_diagnostics。每个已安装配套包进入原有诊断。共享检查器抛出的元数据异常目前会中断整份报告。 源码
  • inspect_issue_fix_workflow_distribution。Issue Fix 将现有实际模块清单交给共享检查器,正常命令发现和 Doctor 复用相同判定。 源码
  • inspect_builtin_capability_distribution。读取已安装分发版本、来源元数据与已记录文件。来源元数据解析错误目前直接传播。 源码
  • test_standard_installation_distinguishes_doctor_fingerprint_and_commands。真实 wheel 测试检查纯 Core、Standard、缺文件和恢复。元数据不可解析需要单独覆盖。 源码

按现有仓库契约 packages/loopx-core/README.md 对齐。基线契约

  • core-standard-composition(implemented)。纯 Core 与安装配套包的诊断应区分实际安装组合。从候选重建六个 wheel。纯 Core 和五件配套包齐全均退出 0,后者五个 ready 全部为真。Workspace 缺件时退出 1 且点名 Workspace,恢复后回到退出 0。
  • installation-doctor-readback(not_met)。安装故障应继续以可读的诊断结果供安装者和自动化处理。同一个 Issue Fix wheel 和同一份损坏输入,主线退出 1 并保留可解析 JSON、指纹失败状态与修复提示。候选同样退出 1,却只在 stderr 输出 JSONDecodeError,stdout 无诊断 JSON。恢复元数据后两边均退出 0。

对主干的风险 / Risks

[P2] 损坏的配套包元数据中断安装诊断。 同一个 Issue Fix wheel 和同一份损坏输入,主线退出 1 并保留可解析 JSON、指纹失败状态与修复提示。候选同样退出 1,却只在 stderr 输出 JSONDecodeError,stdout 无诊断 JSON。恢复元数据后两边均退出 0。在共享安装检查器把无法解析的配套包元数据转换成现有的不可用诊断结果。保留必需检查失败和指纹失败,并在 JSON 中指出要修复的实际包。 重跑 Core + Issue Fix 实际安装的 Doctor 健康、元数据不完整与恢复三组断言;核对另外一个健康配套包仍有诊断结果。 48 项安装 scope 和指纹相关测试、3 项真实 Standard wheel 用例以及 Ruff 和 git diff --check 通过。真实 wheel 独立对照另确认损坏元数据触发一项回归。 独立实测覆盖 macOS 与 Python 3.12。其他平台和发布安装器仍待验证。

语义与 CI 对齐

配套包健康、丢失文件和来源元数据不可读需要从安装后的同一入口校验。仅核对非零退出码会漏掉 stdout 丢失。使用现有诊断字段返回包不可用、原因与修复提示。

我的整体评价 / Verdict

REQUEST_CHANGES。 当前提交会让正需要安装修复的用户失去可解析结果,按退出码读取 Doctor JSON 的下游无法获得修复目标。用实际安装的 Core 与 Issue Fix wheel 核对不可读元数据时仍有失败 JSON,其他配套包的结果也保留,恢复后重新通过。

English verdict: REQUEST_CHANGES at 492bee6. Healthy wheel discovery and missing-file diagnostics pass, but damaged companion metadata regresses structured installation diagnostics.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Supplemental exact-head verification note at 492bee6acdc14836953f89e599612e88781a5ea0 (alongside review 6089905908, which already holds REQUEST_CHANGES):

[P1] Post-#9038 origin/main regression on merge (tests/test_doctor_installation_scope.py:455)

Current origin/main (1a8391ca7db) includes BENCHMARK_TOOLKIT_DISTRIBUTION ("loopx-capability-benchmark-toolkit") in release_manifest._CORE_COMPANION_DISTRIBUTIONS (6 entries). Although 492bee6acdc14836953f89e599612e88781a5ea0 merges onto origin/main with zero git textual conflicts, the merged tree immediately fails:

  • pytest -q tests/test_doctor_installation_scope.py -> 1 failed, 25 passed at tests/test_doctor_installation_scope.py:455 (AssertionError: 5 != 6, 'loopx-capability-agent-turn-recall' != 'loopx-capability-benchmark-toolkit').
  • loopx/release_candidate.py::collect_companion_distribution_diagnostics omits loopx-capability-benchmark-toolkit (loopx/capabilities/benchmark_toolkit/catalog_entry.py currently only defines benchmark_toolkit_installed without an inspect_* companion diagnostic helper).

Requested fixes before merge:

  1. Rebase onto current origin/main and wire inspect_benchmark_toolkit_distribution() into loopx/release_candidate.py::collect_companion_distribution_diagnostics and tests/test_doctor_installation_scope.py.
  2. Address the [P2] structured diagnostic JSON regression in loopx/python_install_owner.py#L136 (json.loads(implementation.read_text("direct_url.json") or "{}")) flagged in review 6089905908.

…metadata checks

Inspect all six Core companion wheels (including workspace and benchmark-toolkit) in installation diagnostics, handle unreadable or corrupt direct_url.json companion metadata without crashing structured JSON output, and verify standard tamper, missing-file, and corrupt-metadata doctor diagnostics.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/fix-main-std-dist-doctor-probe-20261127 branch from 492bee6 to 9d6a302 Compare November 27, 2026 15:32
@loopx-agent loopx-agent changed the title fix(core): cover all companion distributions and fail closed on standard tamper fix(core): cover all companion distributions and harden installation metadata checks Nov 27, 2026
@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Addressed review 6089905908 and supplemental note 7221525864 at 9d6a3029563e2430a68c15594d6ab1515ba9545d (rebased onto origin/main@2302e42d9ca):

  1. Wired inspect_benchmark_toolkit_distribution into collect_companion_distribution_diagnostics and tests/test_doctor_installation_scope.py (covering all 6 _CORE_COMPANION_DISTRIBUTIONS post-#9038).
  2. Extracted shared read_editable_direct_url guard in loopx/python_install_owner.py (reused by loopx/release_manifest.py) so corrupt/unreadable/non-dict direct_url.json reports invalid_companion_metadata and clears package_fingerprint without crashing structured JSON output.
  3. Added unit & real-wheel regression coverage in tests/test_doctor_installation_scope.py and tests/test_core_standard_distribution.py. Ready for exact-head re-review.

@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 · xhigh

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

动机 / Motivation

用安装诊断核对 Core 和可选配套的用户,以及消费 JSON 的安装和修复脚本。基线只单列 Research 配套诊断。Research 的截断元数据会中断 JSON 输出。候选修复了截断 JSON 的诊断,显式为空的目录字段却会被当成正常非 editable 安装。交付范围为既有 Core 安装诊断、包所有权和配套可用性。两个精确版本的真实安装显示,候选会在基线拒绝的目录元数据上保留健康指纹。

改动思路 / Approach

python_install_owner 识别已安装元数据和 RECORD 文件归属。release_manifest 生成实际安装指纹,release_candidate 汇集已有安装诊断。交付范围为既有 Core 安装诊断、包所有权和配套可用性。共享读取适合让配套诊断与实际指纹使用同一损坏判定。已有文件所有权检查继续负责识别实际导入的安装文件。 用两个精确提交构建配套 wheel,在隔离环境安装并检查实际退出码、JSON、配套包诊断和指纹。

具体改动 / Changes

精确提交 9d6a3029563e2430a68c15594d6ab1515ba9545d,对照 2302e42d9cad35a8a4150e24496ffecfbfdce8cb。十个文件增加 443 行、删除 38 行。

  • loopx/capabilities/agent_turn_recall/catalog_entry.py。沿已有安装判定提供 Recall 的诊断记录。
  • loopx/capabilities/benchmark_toolkit/catalog_entry.py。暴露 Benchmark Toolkit 配套包的诊断结果,保留原命令门禁。
  • loopx/capabilities/issue_fix/catalog_entry.py。复用 Issue Fix 必需模块清单并读出错误状态。
  • loopx/capabilities/pr_review_queue/catalog_entry.py。复用 PR 评审配套的检查规则。
  • loopx/cli_runtime.py。让 Workspace 命令发现和 doctor 共用安装检查。
  • loopx/python_install_owner.py。共用 direct_url 元数据读取,对损坏元数据添加失败原因。
  • loopx/release_candidate.py。汇集六类配套包,并给出对应修复提示。
  • loopx/release_manifest.py。实际安装指纹共用新的读取。
  • tests/test_core_standard_distribution.py。实测 Standard 安装、诊断、恢复与卸载。
  • tests/test_doctor_installation_scope.py。核对六个配套及所列元数据异常。

关键代码讲解

  • read_editable_direct_url。读取 Direct URL 元数据。显式 null 被 .get() 和 is not None 当作字段缺席。 源码
  • inspect_builtin_capability_distribution。从共享结果识别 invalid_companion_metadata。若获得 False,继续正常的配套可用性检查。 源码
  • _owned_runtime_files。用同一个读取结果约束指纹。None 或 editable 会拒绝,False 则继续计算。 源码
  • collect_companion_distribution_diagnostics。只在独立 Core 上汇集六类已安装配套。截断的 JSON 仍能返回其他配套的状态。 源码

installed-diagnostic-json 已覆盖实际安装中的截断 JSON、配套缺文件及恢复。fail-closed-metadata 仍未达标。PyPA 规范要求出现的 dir_info 是对象。 仓库验收要求 · PyPA Direct URL 规范

对主干的风险 / Risks

[P2] 显式 null 的安装元数据被诊断为健康。 实际的 Core、Research 或 Issue Fix 安装元数据含 dir_info: null 时,候选三组都退出 0、返回 ok: true,且指纹与实际健康安装相同。基线三组退出 1。Core 与 Issue Fix 保留失败 JSON,Research 抛出 AttributeError。 共享读取把目录字段缺席和显式 null 归到了同一个非 editable 分支。在原读取边界区分字段缺席和显式 null,并区分文件缺席与实际读取失败。让已存在的坏元数据走现有兼容失败和指纹拒绝。 读取分支 · 指纹入口

在同一系统用户确实无法读取文件时,两边仍报告健康并保留原指纹。CPython 的 PathDistribution.read_text 自己捕获 PermissionError 并返回 None。直接让替身抛 OSError 的测试覆盖不到这条读取路径。 这条既有缺口仍在本次改动承诺的范围内。独立重建候选七个 wheel 和基线 Core、Research、Issue Fix 三个 wheel。54 项诊断及身份测试、三项实际 Standard 安装回归、Ruff 和 git diff --check 通过。Standard 套件用已安装的 CLI 验证卸载配套后重放原轮且无新增效果。同一 mypy --follow-imports=silent 命令检查八个变更生产文件,基线和候选的 cli_runtime.py 各有完全相同的 19 条诊断。

语义与验证对齐

候选同源六个配套包均列出且健康。Workspace 缺已归属文件时结构化拒绝,恢复文件后指纹恢复。截断 Research 或 Issue Fix 元数据时均退出 1,输出 invalid_companion_metadata 和仍健康的兄弟配套状态。纯 Core 继续正常。测试在本机隔离环境,安装探针使用 Python 3.12。远端 CI 和全量架构套件未复跑。

我的整体评价 / Verdict

REQUEST_CHANGES。 上一轮的截断 JSON 诊断已修复。请恢复对无效目录元数据的拒绝,并在真实安装中分别验证缺席、损坏和不可读。

English verdict: REQUEST_CHANGES at 9d6a302. The previous traceback on truncated JSON is fixed. An explicit null dir_info now yields a healthy doctor result with the original installation fingerprint, although the baseline rejects it. Existing unreadable metadata is also still treated as absent.

Check explicit presence of dir_info (failing closed on dir_info: null) and inspect on-disk direct_url.json via lstat + direct read when PathDistribution.read_text returns None, ensuring PermissionError and IsADirectoryError map cleanly to invalid_companion_metadata and omit package_fingerprint.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Addressed review 6090559552 in commit 32d9745e6a36e688630c665f653211f34e359c39:

  1. Updated loopx/python_install_owner.py::read_editable_direct_url to check explicit "dir_info" in direct_url so {"dir_info": null} fails closed (None -> invalid_companion_metadata & omitted package_fingerprint) instead of matching field-absent.
  2. When installed.read_text("direct_url.json") returns None, checked getattr(installed, "_path", None) via lstat() + direct file read so PathDistribution.read_text's suppressed PermissionError (chmod 000) and IsADirectoryError fail closed as invalid_companion_metadata instead of missing-file.
  3. Added unit & real-wheel tests covering {"dir_info": null}, chmod 000, and directory-replaced direct_url.json in tests/test_doctor_installation_scope.py and tests/test_core_standard_distribution.py. Ready for exact-head re-review.

@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 · xhigh

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

动机 / Motivation

依赖独立 Core 安装诊断的用户和读取 doctor JSON 的本地安装脚本。上一候选会把显式空目录字段与不可读元数据判为健康,返回原安装指纹。使用同源 Core、Research 与 Issue Fix 的实际 wheel,分别制造缺席、截断、显式 null、不可读和目录替换。在 Python 3.11、3.12 和 3.14 上,实际损坏均返回可解析的失败诊断及空缺的指纹,合法的缺席和恢复仍保持原指纹。验收为 Core 安装诊断、六个可选分发包及已有运行指纹。

改动思路 / Approach

安装读取由原 python_install_owner 负责,指纹和配套诊断仍分别由 release_manifest 和 release_candidate 使用它的结果。验收为 Core 安装诊断、六个可选分发包及已有运行指纹。使用同一已有安装读取规则可以让可用性、诊断和指纹对损坏保持一致,不改动实际 CLI 或日志归属。 用三个实际 Python 版本读取匹配 wheel 的安装状态,沿同一入口对照失败、合法缺席、恢复和六类配套。

具体改动 / Changes

精确提交 32d9745e6a36e688630c665f653211f34e359c39,对照 2302e42d9cad35a8a4150e24496ffecfbfdce8cb,全量十个文件增加 519 行、删除 38 行。本次相对上一候选只涉及元数据读取和两组测试。

  • loopx/capabilities/agent_turn_recall/catalog_entry.py。复用已有配套归属及命令门禁。
  • loopx/capabilities/benchmark_toolkit/catalog_entry.py。提供 Benchmark Toolkit 配套读回。
  • loopx/capabilities/issue_fix/catalog_entry.py。提供 Issue Fix 实际分发的兼容诊断。
  • loopx/capabilities/pr_review_queue/catalog_entry.py。提供评审模块是否安装的诊断状态。
  • loopx/cli_runtime.py。让 Workspace 与 doctor 共用现有安装检查。
  • loopx/python_install_owner.py。区分元数据缺席、显式 null 和真实读取错误;保留既有 editable 拒绝。
  • loopx/release_candidate.py。报告六种配套与针对已装配套的修复。
  • loopx/release_manifest.py。使用同一元数据判断决定是否生成安装指纹。
  • tests/test_core_standard_distribution.py。对真实 Standard 安装验证损坏及恢复,保留原轮回放。
  • tests/test_doctor_installation_scope.py。覆盖真 PathDistribution 与现有分包诊断。

关键代码讲解

  • read_editable_direct_url。在实际路径补查被 PathDistribution 吞掉的读取错误,并拒绝出现的非对象 dir_info。 源码
  • _owned_runtime_files。以共享读取的 None 或 editable 判定拒绝生成安装指纹。 源码
  • collect_companion_distribution_diagnostics。核对六类已装配套,结构化诊断同时保留其它配套记录。 源码
  • test_standard_installation_distinguishes_doctor_fingerprint_and_commands。用实际已安装的 Standard 包对损坏和恢复进行回读。 源码

installed-diagnostic-json 和 fail-closed-metadata 由实际安装结果覆盖。Python 的 Direct URL 规范把出现的 dir_info 定义为对象。此次检查其形状和可读性。 仓库真实路径门 · PyPA Direct URL 规范

对主干的风险 / Risks

在三种 Python 版本、三个包上,截断、显式 null、权限拒绝、目录替换共 36 个实际负例都退出 1,JSON 有效并省略指纹。损坏配套记录带 invalid_companion_metadata,其它配套仍可读。同源候选六类配套在实际安装中全部健康。纯 Core 正常;Workspace 缺已归属文件时结构化拒绝,恢复后返回原指纹。Core、Research 和 Issue Fix 的可选元数据合法缺席或恢复时都返回原指纹。用候选重建七个同源 wheel。56 项诊断及身份测试、3 项实际 Standard 安装测试、Ruff 与 git diff --check 通过。Standard 套件覆盖撤除配套后原任务回放。

同一严格 mypy 调用路径检查八个生产文件,候选与精确基线的 cli_runtime.py 各保留相同 19 条既有诊断。对普通已安装 wheel 与本地负例验证,未复跑远端 CI、非文件系统的自定义元数据提供方及全量 premerge。

语义与验证对齐

与上一候选的实装输出逐项对照。原先 null 字段与权限拒绝会保留健康指纹,新头在同一真实入口拒绝。 普通配套选择、安装后的原回放和基线身份继续通过。修订保持之前的六配套诊断。

我的整体评价 / Verdict

APPROVE。 上轮的显式 null 和真实不可读两处误报都已通过三个 Python 版本的隔离安装复验。实际 doctor 仍能区分数据损坏、合法缺席及恢复。

English verdict: APPROVE at 32d9745. Real wheel installs on Python 3.11, 3.12, and 3.14 reject null, unreadable, truncated, or directory metadata with structured JSON and no fingerprint. Valid absence and restored installs retain the prior fingerprint.

@huangruiteng
huangruiteng merged commit acfa11c into main Nov 28, 2026
30 of 35 checks passed
@huangruiteng
huangruiteng deleted the codex/fix-main-std-dist-doctor-probe-20261127 branch November 28, 2026 01:23
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