业务价值与适用场景
一句话
Pysolate 是面向 Agent execution platform 的 research runtime:它用 Current 的 Host authority/fresh Wazero core 管理权限和执行,并用 Experimental 或 Research-only lanes 探索私有尝试、多 backend 与安全 overlap。当前价值首先是可控和可解释,性能收益仍是有条件的研究机会。
先看一个例子
一个代码研究 Agent 要完成任务:读取受控数据,分析后修改项目,再从多个候选结果中选一个。某些程序能在 WASM 跑,某些需要 native package。过程中还可能等待审批、发生 timeout,或在分支中根本不使用提前读取的数据。
若平台只给 Agent 一个长期运行的 Python 进程和共享目录,会遇到几类问题:旧 globals/handles 泄漏到下次任务,多个候选互相覆盖文件,fallback 可能重复 external effect,缓存结果还可能带着旧权限关系。
Pysolate 把这些关系拆成 Host-owned objects,而不是依赖“解释器应该记得正确状态”。
真实机制
对研究平台或原型集成来说,Pysolate 提供一组可组合的控制点。前两项的核心路径是 Current;placement/native、overlap/reuse 多为 Experimental 或 default-off,workflow 则是 Research-only:
- 可控权限:Host 将 capability Spec/Grant 一次性封存为 Plan,再为具体 Run/attempt 建立 Broker context。Guest 只拿到窄 Presentation;Broker 负责 call admission、approval coordination、dispatch 和 receipt,Host run owner 负责 terminal lifecycle。
- Fresh isolation:每次 Guest 不继承旧 heap、module mutation、WASI handle 或 Broker context。Workspace 使用私有 Attempt/Branch,只有显式 publish/seal 的结果继续可见。
- 安全 overlap/reuse:Host 可以提前执行被明确授权、identity-bound、可丢弃的 read/decode;原 Guest occurrence 仍是唯一 logical claim 点。其他 reuse primitive 也各有独立 owner。
- 多 backend:Host 根据 state、requirements、imports 和 artifact profile 选择 WASM 或 native;只有 typed
not_started才允许一次 promotion,普通失败不 replay。 - 可运营证据:Host 分开记录 physical attempt、logical claim、workspace disposition、receipt、ambiguity 和 cleanup。Operator 能知道“没有开始”“已完成”“未被消费”与“不确定”不是同一个状态。
- 受限 fan-out:Prepared Family 让多个 fresh member 复用一份 bounded NumPy input;Linux COW lane 还可共享 sealed image/page lineage。每个 member 仍有独立 Invocation、workspace 和 terminal record;需要 capability 时还必须使用自己的 Plan/Broker。
- 可审查 source pass:既有 overlay/prepared 机制和纯 AST rewrite 共享 registration/stage vocabulary;semantic 有可测试的 outcome adapter,但尚未接入 production caller。Pure patch execution 仍由自己的 registry/evidence owner 记录,effectful pass 则必须新增 Host contract。
可能适合的场景
- Agent 平台需要执行用户或模型生成的 Python,同时把网络、API、发布等 authority 留在 Host。
- Research/coding prototype 会产生多个候选,需要共享 immutable 起点、隔离可变 workspace,再显式选择结果。
- 一部分任务适合受限 WASM,另一部分需要 native CPython/package,而且 fallback 不能重复 side effect。
- Source 以流式方式生成,早期出现身份固定、延迟较高的不可变 read,平台愿意接受有界 orphan waste。
- 多个分析 Agent 针对同一 bounded ndarray 运行不同程序,并需要 mutation、authority 与 workspace 隔离。
- 研究者要把窄 AST/paper kernel 接入 exact Guest,并保留不适用、负性能与 Deferred effect semantics。
- 研究系统需要把论文 claim 与真实 source owner、negative control 和 evidence disposition 对齐。
当前不适合直接采用的场景
- 需要开箱即用支持任意 Python package、native extension、dynamic import 和长生命周期进程。
- 需要事务式回滚远端 write,或要求 timeout 后自动安全 retry。
- 主要 workload 是很短的纯本地计算,fresh/staging/join 开销可能大于任何 overlap。
- 需要跨平台完整 Python checkpoint/restore、distributed cache 或 production scheduler。
- 需要动态 optimizer plugin、自动 pass composition,或希望 generic AST rewrite 自动提供 batching/parallel tool semantics。
- 没有能力维护 Host capability contracts、artifact profiles 和 failure reconciliation 的团队。
为什么重要
技术上: Authority 与 Guest lifetime 分开,旧解释器状态、cache hit 或错误字符串不能扩大下一次 Run 的权限。
产品和业务上: Attempt、receipt、ambiguous outcome、orphan 和 cleanup 都有明确 owner。出错时平台可以决定 fail、reconcile 或人工处理,而不是盲目重试。
潜在性能: 流式 pre-dispatch、prepared runtime、Prepared Family、private-COW、single-flight 和 memoization 提供不同优化机会。是否省时、省内存或省钱必须按具体 workload 测量;当前两个 scalar pass 的 synthetic timing 还是负结果,也没有 Prepared Family 的生产经济数字。
不能推出什么
- Pysolate 当前是研究型 runtime 与 evidence-backed prototype,不是已完成的通用 Agent cloud 产品。
- 可安全 overlap 不表示每个 workload 更快,native/WASM placement 也不表示自动最优。
- Host-owned evidence 提高可追踪性,不等于远端世界的事务真相或完整 rollback。
- 使用 Pysolate 不能替代 capability policy、artifact supply chain、sandbox hardening 和运营 reconciliation。
术语卡
- Agent platform:接收 Agent Program,并管理执行、权限、状态和结果的 Host 系统。
- Private attempt:从共享起点创建、可 publish 或 discard 的私有执行状态。
- Reconciliation:结果 ambiguous 时,通过外部查询或人工流程确认真实状态。
- Safe overlap opportunity:满足 authority 和 discard 条件时可提前调度的物理工作。
- Operational evidence:供 operator 判断执行与 cleanup 状态的 Host-authored 记录。
继续阅读
- 前置:当前限制与不应声称的能力
- 回到:Pysolate 本科生版解释目录
- 说明文档:
README.md、claims/innovation-inventory.md、defense/limitations.md、evidence/current-runtime-94fab78.md - 源码 owner:
cmd/apyrun/main.go、runtime/capability/、runtime/workspace/、runtime/placement/、runtime/engine/wazero/prepared_family.go、runtime/passpipeline/