case-run: 支持 agent mutation prompt
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.`,
|
||||
|
||||
Reference in New Issue
Block a user