Skip to content

test(build): audit pinned host Python and fail closed on a broken pin - #168

Merged
yesme merged 2 commits into
mainfrom
grok/r3-python-pin-audit
Sep 4, 2026
Merged

yesme merged 2 commits into
mainfrom
grok/r3-python-pin-audit

Conversation

@yesme

@yesme yesme commented Sep 3, 2026

Copy link
Copy Markdown
Owner

定位与重述

这是任务书三追加段对 GLM PR #165 的核验,位置在构建供应链(宿主 Python 钉定),不是产品合同。#165 的三平台 CI 已绿,本 PR 只核 CI 证明不了的三件事:钉定解释器是否真的在用、清单是否锁到官方制品、以及「C 编译 action key 仍稳定」是否成立。结论写在 #165 评论,不另开文档。

本地验收:

  • bash src/build/tests/check_python_pin.sh 通过
  • cd src && ./buck2 test root//build/tests:python_pin_test --target-platforms root//build/platforms:macos_arm64 通过
  • PATH 前置 exit 1 的假 python3 后 ./buck2 test root//build/tests:version_contract_test 仍过
  • 清 buck-out 后同 worktree 重建 foundation 测试 100% cache hit;第二个 worktree 的 sqlite buildscript-run 为 Local

当前生效约束集

  • 指令累积;本 PR 只执行任务书三追加 · build: 钉定宿主 Python 3.12,libsqlite3-sys 翻回上游 build script #165 核验。
  • Buck2 唯一构建入口;钉定解释器仍走 DotSlash + config 注入,不另建平行 Python 工具链。
  • 研究文件发布后正文不改,只在 python-build-standalone.md 文末追加复核记录。
  • 新脚本是测试驱动器,要在调研节论证。
  • 禁用「张力」;位置引用写文件 §节名。
  • 不改变合同语义,不引入第三方依赖。

业界方案调研

新增 src/build/tests/check_python_pin.sh。钉版本与摘要锁是 DotSlash 的原生机制(与仓库已有 buck2/jq/process-compose 清单同一形状),核验是对照 python-build-standalone 20260901 官方 release 资产 digest,不自建第二套版本表。PATH 毒化与弄坏 digest 是供应链测试的常规反例(uv/rustup 同类),在本仓库里直接跑钉定 trampoline 和启动器,不引入新框架。缓存代价用 Buck2 原生日志 log what-ran / log summary 观察,不自建 action-key 解析器。启动器从「钉失效则 || true 回落宿主」改为失败即停,因为任务书要求不能悄悄回落——这是把 #157 的核心主张收成 fail-closed,不是新协议。

任务书三追加:核 #165 的钉定解释器、供应链锁与缓存代价。启动器在钉
失效时不再回落宿主 Python。结论写在 #165 评论。
@yesme
yesme force-pushed the grok/r3-python-pin-audit branch from 58b2da0 to e631ec8 Compare September 3, 2026 23:45
CI poisons PATH to prove the pin; the audit helpers must call
/usr/bin/python3 so they are not the fake interpreter.
@yesme
yesme merged commit ca48981 into main Sep 4, 2026
14 checks passed
@yesme
yesme deleted the grok/r3-python-pin-audit branch September 10, 2026 05:06
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