dsh-eval-guard 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,7 +32,7 @@
32
32
  - 原 5 个比赛任务:坦克大战、仓储调度、圈地、炸弹人、夺旗。
33
33
  - 3 个长时单任务:Commit0 单库实现、SWE-Bench Pro 单任务、FeatureBench 单 feature。
34
34
 
35
- 原 5 个任务直接放入打包好的 workspace.zip。后 3 个任务在安装时由 host 侧 setup 脚本按固定 commit clone 仓库、创建 .venv 并安装依赖;agent 运行时仍然禁网,使用工作区内的 .venv 跑测试。
35
+ 原 5 个任务直接放入打包好的 workspace.zip。后 3 个任务在安装时由 host 侧 setup 脚本按固定 commit clone 仓库、创建 .venv 并安装依赖;安装完成后会清理 `.git`、`setup.sh`、`remove.patch`、`spec.pdf.bz2` 等安装产物,工作区只保留任务本身素材。Commit0 的 `pytest.ini` 会去掉 coverage 参数,保证默认测试命令在沙箱内可运行。agent 运行时仍然禁网,使用工作区内的 .venv 跑测试;agent 可以自行 `git init` 或写自己的脚本。
36
36
 
37
37
  安装是后台任务:
38
38
 
Binary file
Binary file
Binary file
package/lib/index.js CHANGED
@@ -1998,6 +1998,21 @@ var TaskService = class {
1998
1998
  });
1999
1999
  }
2000
2000
  }
2001
+ /** Remove install-only artifacts so they are not part of the agent workspace. */
2002
+ cleanupWorkspace(workspacePath) {
2003
+ for (const name of [
2004
+ ".git",
2005
+ ".repo",
2006
+ "setup.sh",
2007
+ "remove.patch",
2008
+ "spec.pdf.bz2"
2009
+ ]) try {
2010
+ fs.rmSync(path.join(workspacePath, name), {
2011
+ recursive: true,
2012
+ force: true
2013
+ });
2014
+ } catch {}
2015
+ }
2001
2016
  /** Start a non-blocking install. The settings page polls the returned job. */
2002
2017
  startInstall(workspaceId, taskId, options = {}) {
2003
2018
  const definition = TASK_DEFINITIONS[taskId];
@@ -2049,6 +2064,7 @@ var TaskService = class {
2049
2064
  cwd: checked.path,
2050
2065
  env,
2051
2066
  onSuccess: () => {
2067
+ if (definition.needsSetup) this.cleanupWorkspace(checked.path);
2052
2068
  const runId = this.newRunId();
2053
2069
  const prompt = this.guard.promptFor(checked.path, this.materialZip(taskId), definition);
2054
2070
  const run = {
@@ -2159,6 +2175,7 @@ var TaskService = class {
2159
2175
  fs.copyFileSync(this.materialZip(taskId), path.join(checked.path, "workspace.zip"));
2160
2176
  if (definition.needsSetup) this.extractMaterial(checked.path);
2161
2177
  if (definition.prepare !== void 0) definition.prepare(checked.path);
2178
+ if (definition.needsSetup) this.cleanupWorkspace(checked.path);
2162
2179
  } catch (error) {
2163
2180
  return {
2164
2181
  ok: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-eval-guard",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "description": "Evaluation guard for DSH: workspace-only filesystem, no network/subagents, wall-clock limits, and task installation for the meow-ai-arena tank task.",
6
6
  "license": "MIT",