test(web): keep policy snapshots host-independent

This commit is contained in:
NI0317
2026-07-30 23:34:14 +08:00
parent 831d9c4ae3
commit 129ded523c
14 changed files with 19 additions and 58 deletions
+19 -6
View File
@@ -9,12 +9,13 @@
// from live session memory), refresh (keyless replay that rewrites goldens).
//
// Composition divergences from `dsh web`, all deliberate, all via include
// patches after the shipped surface overlay: temp persistenceRoot;
// workspace-context disabled (recorded fixtures must not embed this repo's
// AGENTS.md); session-title-llm disabled (its fire-and-forget title call
// would race the loop for the session's replay cursor); webserver pinned to
// port 0 with the built dist; keyless modes disable llm-deepseek and fill
// the open llm seam post-boot with installLlmReplay on the settled root ctx
// patches after the shipped surface overlay: temp persistenceRoot; local skill
// roots confined to the temp workspace; workspace-context disabled (recorded
// fixtures must not embed this repo's AGENTS.md); session-title-llm disabled
// (its fire-and-forget title call would race the loop for the session's replay
// cursor); webserver pinned to port 0 with the built dist; keyless modes
// disable llm-deepseek and fill the open llm seam post-boot with
// installLlmReplay on the settled root ctx
// (the plugin-row path discards the ReplayHandle; the direct install keeps
// assertConsumed for the teardown fixture-consumption check).
import { existsSync } from 'node:fs'
@@ -172,6 +173,18 @@ export async function launchWebScaffold(options: LaunchOptions = {}): Promise<We
// per write; the scaffold restores the original cwd after boot, so the
// row gets an absolute temp root (removed with the workspace at close).
{ id: 'storage-json', config: { root: join(workspaceCwd, '.dsh-storages') } },
// Skill discovery is model-visible input. Pin every host-level root inside
// the owned temp world so ambient catalogs cannot change replay requests
// or conversation goldens; project roots still use the empty workspace.
{
id: 'skill-local',
config: {
dshHome: join(workspaceCwd, '.dsh-home'),
agentsHome: join(workspaceCwd, '.agents-home'),
bundledSkillDir: join(workspaceCwd, '.bundled-skills'),
watch: false,
},
},
// fs/bash cwd default to process.cwd(); the gateway injects the same
// value into session.cwd — chdir below anchors all three to the temp
// workspace, keeping the composition untouched.
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- 'button "Think The user wants me to write a single `run_code` program that:"':
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to:":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to run a simple bash command and reply with \"DONE\".":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to reply with a single word. Let me comply.":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- paragraph: partial
- text: 已停止
- button "复制":
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- textbox "Message the agent"
- button "Add attachment":
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user is asking for a one-sentence description of event sourcing. This is a straightforward knowledge question that doesn't require any skill loading or tool calls.":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to use the ask_user_question tool with specific parameters. Let me do exactly that.":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- paragraph: partial
- button "2 条排队消息"
- textbox "Message the agent"
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- paragraph: partial
- button "2 条排队消息" [disabled] [expanded]
- list:
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- paragraph: partial
- list:
- listitem:
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to use the ask_user_question tool to ask them a specific question with the given parameters. Let me do exactly that.":
- img
- img
@@ -15,10 +15,6 @@
- img
- img
- text: 上下文注入
- button "上下文注入":
- img
- img
- text: 上下文注入
- button "Think The user wants me to use the ask_user_question tool to ask them a specific question with the given parameters. Let me do exactly that.":
- img
- img