docs: constrain package README summaries

This commit is contained in:
Turtle
2026-09-08 13:52:40 +08:00
parent 06c01ce2e8
commit f1c1ff5a08
517 changed files with 827 additions and 692 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/experimental/code-runtime-python/README.md
README.md: 62e79efa47b9c05cb24a21e07f4e3bf394606f31
README.zh.md: ce39ad3feb7a803ebe41286c73319b3bc45565bc
README.md: 23595845e41d77b3a204e786c0d878b044ef6d4b
README.zh.md: 1aa93546428d1bd0a66ce0600f124565a798cb70
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
## Summary
`dsh-experimental-code-runtime-python` provides the private source-checkout `PythonCodeRuntime`, a CPython-subprocess implementation of the [`dsh-code-runtime`](../../code-runtime/code-runtime/README.md) seam. It registers as `codeRuntime` with `language: 'python'` and `isolation: 'process'`, spawning a fresh CPython 3.10+ child per `run()` and executing the program as an async function body over a versionless JSON-lines protocol on the child's fd 3 (stdout/stderr stay free for the program's own output). The host side (`src/protocol.ts`) treats every inbound frame as hostile and rebuilds it before reading; the Python side (`py/protocol.py`) mirrors the message vocabulary. Containment — not a security boundary, model code has bash-equivalent trust — comes from a tempdir-only environment, `RLIMIT_CPU`/`RLIMIT_AS`, a wall-clock ceiling, and `SIGTERM`→grace→`SIGKILL` process-group teardown, with all caps validated at plugin load.
This private experimental package lets source-checkout compositions run model-generated Python in a fresh CPython 3.10+ subprocess for each request. Programs can use top-level `await` and `return`, call configured bindings, and write normal stdout/stderr while receiving explicit completion or failure results. Resource budgets and process-group teardown contain runaway work, but the subprocess is not a security boundary: model code has bash-equivalent trust, no state persists across runs, and no shipped profile enables this runtime.
## Table of Contents
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
`dsh-experimental-code-runtime-python` 提供私有的源码 checkout `PythonCodeRuntime`,即 [`dsh-code-runtime`](../../code-runtime/code-runtime/README.zh.md) seam CPython 子进程实现。它以 `language: 'python'``isolation: 'process'` 注册为 `codeRuntime`,每次 `run()` 启动一个全新的 CPython 3.10+ 子进程,把程序作为 async 函数体执行,通过子进程 fd 3 上的无版本 JSON-lines 协议通信(stdout/stderr 留给程序自己的输出)。宿主侧(`src/protocol.ts`)把每条入站帧都视为敌意并逐字段重建后才读取;Python 侧(`py/protocol.py`)镜像消息词汇。隔离(不是安全边界——模型代码与 bash 同等的信任)来自仅含临时目录的环境、`RLIMIT_CPU`/`RLIMIT_AS`、墙钟上限与 `SIGTERM`→宽限→`SIGKILL` 进程组拆卸,所有上限都在插件加载期校验
这个私有实验包可让源码检出组合在每次请求时都用全新的 CPython 3.10+ 子进程运行模型生成的 Python。程序可以使用顶层 `await``return`、调用已配置的 binding、正常写入 stdout/stderr,并获得明确的完成或失败结果。资源预算和进程组拆卸会约束失控的工作,但子进程不是安全边界模型代码具有与 bash 同等的信任,运行之间不保留状态,且没有已发布 profile 启用此 runtime
## 目录