test(ptc): reuse shared Script snapshot configuration

This commit is contained in:
_Kerman committed 2026-10-21 15:59:31 +08:00
1 parent 6085b6fb62
commit 99c73e310a
10 files changed
+18 -560

No files matched your search

@@ -1,58 +0,0 @@
# Keyless PTC mode combines the runtime/registry changes with the
# DeepSeek-to-replay swap in one profile patch.
- insert:
- id: literal-sdk
name: '../../../packages/core/tools/tests/fixtures/literal-sdk.ts'
- id: llm-deepseek
name: '@deepseek-ai/dsh-llm-deepseek-api-key'
disabled: true
- id: plugin-package-inventory-deepseek
disabled: true
- id: agent-default-model
name: '@deepseek-ai/dsh-agent-default-model'
config:
provider: deepseek-official
model: deepseek-v4-flash
- id: session-persistence-jsonl
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: !!js dshHomePath('sessions')
compression: none
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tools
name: '@deepseek-ai/dsh-tools'
config:
mode: ptc
- id: system-prompt
name: '@deepseek-ai/dsh-system-prompt'
config:
personaPrefix: |
You are a coding assistant powered by the {{model}} model.
Verify your work by running the code or tests. Keep answers brief and factual.
- insert:
- id: llm-replay
name: '@deepseek-ai/dsh-llm-replay'
config:
providers:
- id: deepseek-official
name: DeepSeek
models:
- id: deepseek-v4-flash
- id: deepseek-v4-pro
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: false
@@ -1,41 +0,0 @@
# PTC mode adds `ctx.ptcRuntime` and changes the registry to one wire tool,
# `run_code`, plus its generated TypeScript SDK prompt. The demo and snapshot
# recorder apply this profile patch; replay applies its sibling patch.
- insert:
- id: literal-sdk
name: '../../../packages/core/tools/tests/fixtures/literal-sdk.ts'
- id: agent-default-model
name: '@deepseek-ai/dsh-agent-default-model'
config:
provider: deepseek-official
model: deepseek-v4-pro
- id: session-persistence-jsonl
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: !!js dshHomePath('sessions')
compression: !!js 'process.env.DSH_SNAPSHOT === undefined ? ''zstd'' : ''none'''
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tools
name: '@deepseek-ai/dsh-tools'
config:
mode: ptc
- id: system-prompt
name: '@deepseek-ai/dsh-system-prompt'
config:
personaPrefix: |
You are a coding assistant powered by the {{model}} model.
Verify your work by running the code or tests. Keep answers brief and factual.
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: false
@@ -1,137 +0,0 @@
[
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_declare",
"name": "run_code",
"arguments": "{\"code\":\"let counter: number = 1; const alias = { value: counter }; function increment() { return ++counter }; class Box { [await Promise.resolve(\\\"read\\\")]() { return counter } };\",\"description\":\"Declare Script state with computed await\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_fresh",
"name": "run_code",
"arguments": "{\"code\":\"({ previous: typeof counter, answer: await(Promise.resolve(42)) })\",\"description\":\"Verify the next Script call starts fresh\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_binding",
"name": "run_code",
"arguments": "{\"code\":\"const result = await tools.bash({command:\\\"pwd\\\",description:\\\"Read working directory\\\"}); result.stdout.text.trim() === process.cwd()\",\"description\":\"Call a host binding from a fresh Script\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "text"
},
{
"type": "text-delta",
"index": 0,
"text": "Verified Script completion, host bindings, and fresh state between calls."
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "text",
"text": "Verified Script completion, host bindings, and fresh state between calls."
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 2
}
},
{
"type": "finish",
"reason": {
"kind": "stop"
}
}
]
}
]
@@ -0,0 +1,4 @@
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: false
@@ -1,11 +1,9 @@
version: 1
scenario: ptc-script-fresh
profile: headless
composition: ptc-script-fresh
composition: ptc
recording: authored
header:
class: ptc-script-fresh
pin: true
replay:
override: true
permission: workspace-write
@@ -1,66 +0,0 @@
# Keyless PTC mode combines the runtime/registry changes with the
# DeepSeek-to-replay swap in one profile patch.
- insert:
- id: literal-sdk
name: '../../../packages/core/tools/tests/fixtures/literal-sdk.ts'
- id: llm-deepseek
name: '@deepseek-ai/dsh-llm-deepseek-api-key'
disabled: true
- id: plugin-package-inventory-deepseek
disabled: true
- id: agent-default-model
name: '@deepseek-ai/dsh-agent-default-model'
config:
provider: deepseek-official
model: deepseek-v4-flash
- id: session-persistence-jsonl
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: !!js dshHomePath('sessions')
compression: none
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tools
name: '@deepseek-ai/dsh-tools'
config:
mode: ptc
- id: system-prompt
name: '@deepseek-ai/dsh-system-prompt'
config:
personaPrefix: |
You are a coding assistant powered by the {{model}} model.
Verify your work by running the code or tests. Keep answers brief and factual.
- insert:
- id: llm-replay
name: '@deepseek-ai/dsh-llm-replay'
config:
providers:
- id: deepseek-official
name: DeepSeek
models:
- id: deepseek-v4-flash
- id: deepseek-v4-pro
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: true
- insert:
- id: computer-use
name: '@deepseek-ai/dsh-computer-use'
- id: cua-script-guidance
name: './cua-guidance.mjs'
config:
agentPreset: false
@@ -1,49 +0,0 @@
# PTC mode adds `ctx.ptcRuntime` and changes the registry to one wire tool,
# `run_code`, plus its generated TypeScript SDK prompt. The demo and snapshot
# recorder apply this profile patch; replay applies its sibling patch.
- insert:
- id: literal-sdk
name: '../../../packages/core/tools/tests/fixtures/literal-sdk.ts'
- id: agent-default-model
name: '@deepseek-ai/dsh-agent-default-model'
config:
provider: deepseek-official
model: deepseek-v4-pro
- id: session-persistence-jsonl
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: !!js dshHomePath('sessions')
compression: !!js 'process.env.DSH_SNAPSHOT === undefined ? ''zstd'' : ''none'''
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tools
name: '@deepseek-ai/dsh-tools'
config:
mode: ptc
- id: system-prompt
name: '@deepseek-ai/dsh-system-prompt'
config:
personaPrefix: |
You are a coding assistant powered by the {{model}} model.
Verify your work by running the code or tests. Keep answers brief and factual.
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: true
- insert:
- id: computer-use
name: '@deepseek-ai/dsh-computer-use'
- id: cua-script-guidance
name: './cua-guidance.mjs'
config:
agentPreset: false
@@ -1,203 +0,0 @@
[
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_declare",
"name": "run_code",
"arguments": "{\"code\":\"let counter: number = 1; const alias = { value: counter }; function increment() { return ++counter }; class Box { [await Promise.resolve(\\\"read\\\")]() { return counter } };\",\"description\":\"Declare Script state with computed await\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_reuse",
"name": "run_code",
"arguments": "{\"code\":\"counter++; console.log(\\\"retained\\\", new Box().read()); ({ count: increment(), alias: alias.value, answer: await(Promise.resolve(42)) })\",\"description\":\"Reuse retained Script declarations\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_binding",
"name": "run_code",
"arguments": "{\"code\":\"const cwdResult = await tools.bash({command:\\\"pwd\\\",description:\\\"Read working directory\\\"}); ({ sameDirectory: cwdResult.stdout.text.trim() === process.cwd(), count: counter })\",\"description\":\"Call a host binding from Script\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_exit",
"name": "run_code",
"arguments": "{\"code\":\"process.exit(7)\",\"description\":\"End the Script process\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "tool-call"
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "tool-call",
"id": "script_recover",
"name": "run_code",
"arguments": "{\"code\":\"({ previous: typeof counter, recreated: await Promise.resolve(4) })\",\"description\":\"Verify Script state was cleared\"}"
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 5
}
},
{
"type": "finish",
"reason": {
"kind": "tool-calls"
}
}
]
},
{
"kind": "chunks",
"chunks": [
{
"type": "block-start",
"index": 0,
"blockType": "text"
},
{
"type": "text-delta",
"index": 0,
"text": "Verified Script completion, host bindings, and state retention and recovery."
},
{
"type": "block-end",
"index": 0,
"block": {
"type": "text",
"text": "Verified Script completion, host bindings, and state retention and recovery."
}
},
{
"type": "usage",
"usage": {
"inputTokens": 10,
"outputTokens": 2
}
},
{
"type": "finish",
"reason": {
"kind": "stop"
}
}
]
}
]
@@ -0,0 +1,12 @@
- id: ptc-runtime
config:
executionMode: vm-script
scriptPersistence: true
- insert:
- id: computer-use
name: '@deepseek-ai/dsh-computer-use'
- id: cua-script-guidance
name: './cua-guidance.mjs'
config:
agentPreset: false
@@ -1,13 +1,11 @@
version: 1
scenario: ptc-script-retained
profile: headless
composition: ptc-script-retained
composition: ptc
recording: authored
header:
class: ptc-script-retained
pin: true
replay:
override: true
permission: workspace-write
workspace:
setup: cua-script-guidance