From b3e063f38a305c514b44a0e8fb11fece1ad7b5f9 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 6 Jun 2026 15:11:31 +0800 Subject: [PATCH] =?UTF-8?q?case-run:=20=E6=94=AF=E6=8C=81=20agent=20mutati?= =?UTF-8?q?on=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/hwlab-cli/caserun.test.ts | 2 ++ tools/src/hwlab-caserun-lib.ts | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/hwlab-cli/caserun.test.ts b/tools/hwlab-cli/caserun.test.ts index 4276cee5..3293acd4 100644 --- a/tools/hwlab-cli/caserun.test.ts +++ b/tools/hwlab-cli/caserun.test.ts @@ -255,6 +255,8 @@ test("case run orchestrates agent prompt, diff capture, and compile evidence wit const prompt = await readFile(path.join(cwd, ".state", "hwlab-cli", "caserun", "run-agent-flow", "agent-prompt.md"), "utf8"); assert.match(prompt, /without auto-grading/u); assert.match(prompt, /Run-local HWPOD spec/u); + assert.match(prompt, /verificationMode: compile-only build check/u); + assert.doesNotMatch(prompt, /compile-only 阶段不要修改 subject 源码/u); assert.match(prompt, /hwpod-ctl spec validate --spec \.hwlab\/hwpod-spec\.yaml/u); assert.match(prompt, /hwpod build --spec \.hwlab\/hwpod-spec\.yaml/u); assert.match(prompt, /path: "F:\\\\Work\\\\HWLAB-CASE-F103\\\\\.worktree\\\\caserun-run-agent-flow"/u); diff --git a/tools/src/hwlab-caserun-lib.ts b/tools/src/hwlab-caserun-lib.ts index 4430a41b..b65cfa84 100644 --- a/tools/src/hwlab-caserun-lib.ts +++ b/tools/src/hwlab-caserun-lib.ts @@ -840,9 +840,9 @@ async function renderAgentTaskPrompt(run: PreparedCaseRun, agentTask: PreparedAg ...agentTask.constraints, "只能修改 isolated subject worktree,不得修改 case registry repo。", "不得修改原 subject repo checkout;所有源码修改必须落在 subjectWorktreePath。", - "允许且必须在 AgentRun workspace 内写入/覆盖 .hwlab/hwpod-spec.yaml,用于本次 run-local HWPOD compile-only。", - "compile-only 阶段不要修改 subject 源码;如任务确需改源码,只能改 subjectWorktreePath。", - "不要运行 CaseRun 答案执行器;你本人必须通过 hwpod/hwpod-ctl 标准入口触发 compile-only。" + "允许且必须在 AgentRun workspace 内写入/覆盖 .hwlab/hwpod-spec.yaml,用于本次 run-local HWPOD 编译验证。", + "若 case prompt 要求源码修改,必须只改 subjectWorktreePath;若 prompt 未要求源码修改,则保持 subject 源码不变。", + "不要运行 CaseRun 答案执行器;你本人必须通过 hwpod/hwpod-ctl 标准入口触发编译验证。" ].filter(Boolean); return [ `# HWPOD CaseRun Code Agent Task`, @@ -853,7 +853,7 @@ async function renderAgentTaskPrompt(run: PreparedCaseRun, agentTask: PreparedAg `subjectCommitId: ${run.subject.commitId}`, `subjectWorktreePath: ${run.subject.worktreePath}`, `runLocalHwpodSpec: ${run.specPath}`, - `compileOnly: true`, + `verificationMode: compile-only build check; no download or runtime smoke unless the case explicitly asks for it`, ``, `## Run-local HWPOD spec`, `Write exactly this YAML to \`.hwlab/hwpod-spec.yaml\` in your AgentRun workspace before running HWPOD commands. The Windows subjectWorktreePath is consumed by hwpod-node through this spec; do not try to cd into that Windows path from the Linux runner.`,