fix(ptc): preserve policy and evaluation lifecycle across memory runs

This commit is contained in:
creatixchu committed 2026-09-28 16:08:45 +08:00
1 parent 3a0c2ae3bb
commit bf95e3a74b
33 files changed
+155 -118

No files matched your search

@@ -48,8 +48,8 @@
en: ab4a08f301de599d
zh: e698b35ccf3ce665
/deepseek-ai-dsh-experimental-ptc-runtime-python/model-experience:
en: 42064c81cda8f059
zh: fa68d1acac16e263
en: c509cebe744d72e1
zh: 3d2f3dd286c1c8be
/deepseek-ai-dsh-experimental-ptc-runtime-python/model-experience/kv-cache-effect:
en: 40294c1c31b74824
zh: d805c6bd7270505e
@@ -101,6 +101,8 @@ Read these when the runtime contract is not enough. They move from the seam defi
Indirectly, through PTC mode in `dsh-tools` when an explicit composition mounts this provider; it renders the program's completion value or failure into a retained `run_code` result, and no shipped profile mounts this experimental package.
The provider supplies async-function syntax, `print`/`return` output and fresh-process state rules through `executionInstructions`; the tool consumer appends them to `run_code`.
#### KV Cache effect
No direct invalidation; the named consumer owns any request-prefix changes.
@@ -101,6 +101,8 @@ kind: "package-reference"
间接地,通过 `dsh-tools` 中的 PTC mode;当显式组合挂载本提供方时,它会把程序的完成值或失败渲染成保留的 `run_code` 结果,且已发布 profile 均不挂载这个实验包。
提供方通过 `executionInstructions` 说明异步函数语法、`print`/`return` 输出和每次启动新进程的状态规则;工具消费者将这些指引附加到 `run_code`。
#### KV Cache 效应
无直接失效;指定的消费方拥有任何请求前缀变化。
@@ -815,6 +815,10 @@ export class PythonPtcRuntime extends PtcRuntime {
readonly language = 'python'
readonly isolation = 'process'
override get executionInstructions(): string {
return 'The program is the body of an async Python function. Top-level await and return are supported. Emit output with print(...) or return a lossless JSON value. Only printed values and the returned value become program output. Each call runs in a fresh Python process; variables and imported modules do not persist across calls.'
}
private readonly config: ResolvedConfig
private readonly pythonBin: string
// The frame cap this instance enforces: the protocol cap, or the host's