DSH / Atlas
2026-08-12implementedtesting

Required Python runtime pull-request validation

必需的 Python 运行时拉取请求验证

Ordinary pull-request CI runs the complete Python SDK pytest suite against fake runtime peers, while Node snapshots exercise different clients and expected outputs. The real Python client, packaged JSON-RPC executable, executable-specific snapshot, release-shaped wheels, and clean installation meet only in the optional single-executable or Python release workflows. A runtime event change or closure change can therefo

English

Problem

Ordinary pull-request CI runs the complete Python SDK pytest suite against fake runtime peers, while Node snapshots exercise different clients and expected outputs. The real Python client, packaged JSON-RPC executable, executable-specific snapshot, release-shaped wheels, and clean installation meet only in the optional single-executable or Python release workflows. A runtime event change or closure change can therefore merge with a stale Python projection or broken wheel path and fail only when someone later builds a Python release candidate.

Decision

Every pull request has a required python-runtime job in CI. It calls the shared single-executable builder for node24-linux-x64 without a path filter and participates in all checks passed. The called workflow builds the real executable, runs all keyless Python full-turn and direct-binary scenarios including both committed snapshots, builds the SDK and runtime wheels, installs them into a clean virtual environment, checks the executable and native addon's GLIBC requirements, and runs the installed wheels in a manylinux 2.28 container.

The required job and the Python publication workflow use the same builder. Its concurrency key includes the caller workflow, so required CI and an explicit full release validation for the same ref do not cancel each other. The complete linux-x64, linux-arm64, and macos-arm64 matrix remains a release validation because platform-independent runtime, SDK, and snapshot behavior needs one merge-blocking native carrier, while architecture-specific executable, addon, wheel-tag, and deployment-target behavior still needs all release targets before publication.

The advanced executable snapshot normalizes opaque session, message, subagent, and workflow-run identifiers before comparison. A newly persisted workflow event therefore changes the reviewed expected output without making a random run identifier part of that output. The minimal scenario's model-visible snapshot covers the assembled system prompt, tool schemas, and message list that this one tokenizes.

Alternatives considered

Run the complete native matrix on every pull request. This duplicates platform-independent full-turn and snapshot behavior across three jobs and consumes ARM64 Linux and macOS capacity on every change. The publication workflow retains that evidence at the point where all three artifacts are required.

Run the snapshot against the development Node carrier. This catches protocol and event projection drift but does not prove pkg assembly, the deployed runtime closure, native addon staging, wheel construction, exact dependency pins, or clean installation. The required Linux executable path covers the published path directly.

Select the job with path filters or labels. Python behavior depends on shared agent, session, workflow, subagent, plugin-loading, and packaging code outside python/. An incomplete dependency filter recreates the delayed failure, and a label leaves the evidence optional.

Consequences

Every pull request pays for one standard-hosted Linux executable and wheel build, and all checks passed waits for it. This makes the first-party Python distribution a merge-time contract and reuses the release implementation instead of maintaining a smaller substitute pipeline.

One required architecture cannot detect macOS or Linux ARM64 packaging regressions. Explicit full release validation remains mandatory before publication and owns those platform-specific results.

中文

问题

普通拉取请求 CI 会针对 fake 运行时对端执行完整的 Python SDK pytest 套件,而 Node 快照使用不同的客户端与预期输出。真实 Python 客户端、打包后的 JSON-RPC 可执行文件、exe 专用快照、发布形态 wheel 包与干净安装只在可选的单文件可执行程序工作流或 Python 发布工作流中汇合。因此,运行时事件或闭包发生变化后,陈旧的 Python 投影或损坏的 wheel 包路径仍可能合并,直到后续有人构建 Python 发布候选版本时才失败。

决策

每个拉取请求都在 CI 中运行必需的 python-runtime 作业。该作业不使用路径过滤,调用共享的单文件可执行程序构建器构建 node24-linux-x64,并参与 all checks passed。被调用的工作流会构建真实可执行文件,运行全部无密钥 Python 完整轮次和直接二进制场景(包括两份检入的快照),构建 SDK 与运行时 wheel 包,将二者安装进干净的虚拟环境,检查可执行文件与原生 addon 的 GLIBC 依赖,并在 manylinux 2.28 容器中运行已安装的 wheel 包。

必需作业与 Python 发布工作流共用同一构建器。其并发键包含调用方工作流,因此同一 ref 上的必需 CI 与显式完整发布验证不会互相取消。完整的 linux-x64、linux-arm64 和 macos-arm64 矩阵仍属于发布验证:平台无关的运行时、SDK 与快照行为只需要一个阻断合并的原生载体,而架构相关的可执行文件、addon、wheel 包标签与部署目标行为在发布前仍需要全部发布目标验证。

进阶 exe 快照会在比较前规范化不透明的会话、消息、subagent 和工作流运行标识符。因此,新增的持久化工作流事件会改变经过审阅的预期输出,但不会把随机运行标识符写入其中。极简场景的模型可见快照覆盖了这份快照所占位化的已组装系统提示词、工具 schema 与消息列表。

曾考虑的替代方案

每个拉取请求都运行完整原生矩阵。 这会在三个作业中重复平台无关的完整轮次与快照行为,并让每项改动都消耗 ARM64 Linux 和 macOS 容量。Python 发布工作流在需要全部三个产物的环节保留这部分证据。

针对开发用 Node 载体运行快照。 这可以捕获协议与事件投影漂移,但不能证明 pkg 组装、部署后的运行时闭包、原生 addon 暂存、wheel 包构建、精确依赖版本与干净安装。必需的 Linux exe 路径直接覆盖发布路径。

通过路径过滤或标签选择该作业。 Python 行为依赖 python/ 之外共享的 agent、会话、工作流、subagent、插件加载与打包代码。不完整的依赖过滤会再次造成延迟发现,标签则会让证据保持可选。

后果

每个拉取请求都会承担一次标准托管 Linux exe 与 wheel 包构建,all checks passed 也会等待该作业。这使第一方 Python 分发成为合并时约定,并复用发布实现,而不维护一条更小的替代流水线。

单一必需架构无法检测 macOS 或 Linux ARM64 打包回归。发布前仍必须执行显式完整发布验证,并由该验证负责这些平台特定结果。