[Bug] bibtex workspace_cleanliness is forced to 0.5 by default OpenClaw scaffold files
Summary
In the default OpenClaw backend, the workspace_cleanliness criterion in:
tasks/01_Productivity_Flow/01_Productivity_Flow_task_3_bibtex.md
counts runtime scaffold files as unexpected agent outputs. In reproduced runs with the repository's default OpenClaw path, this produces at least ten extra root entries, forcing the criterion to its 0.5 floor and multiplying the whole task score by 0.5.
The task-specific grader references .task_root_snapshot.json, but the default OpenClaw setup and grading flow never creates that file.
Root cause
If the snapshot is missing, or either stored list is empty, the grader enumerates the current workspace:
if not task_root_entries or not results_entries:
task_root_entries = [p.name for p in workspace.iterdir()]
results_entries = [p.name for p in results_dir.iterdir()]
The root allowlist contains only input PDFs plus:
{"results", "gt", ".task_root_snapshot.json"}
A reproduced default OpenClaw workspace contained these runtime-owned entries:
.git
.learnings
.openclaw
AGENTS.md
BOOTSTRAP.md
HEARTBEAT.md
IDENTITY.md
SOUL.md
TOOLS.md
USER.md
They are scaffold/runtime files rather than outputs of the task solution, but all are counted as workspace pollution.
The repository also has a separate /tmp/wildclaw_workspace_baseline.json mechanism used by the Codex and ClaudeCode backends when collecting changed outputs. The bibtex grader does not read that file, and the default OpenClaw runner does not call that snapshot mechanism.
The cleanliness calculation then reaches its minimum:
max(0.5, 1.0 - 0.1 * extra_count) == 0.5
Finally, cleanliness multiplies the complete base score:
scores["overall_score"] = round(
base_score * scores["workspace_cleanliness"], 4
)
Reproduction
A real task result produced:
workspace_cleanliness = 0.5
overall_score = 0.3387
Adding a filtered baseline snapshot that excludes only the harness-owned entries, without changing any agent output, produces:
workspace_cleanliness = 1.0
overall_score = 0.6775
Important detail: simply writing a truthful snapshot after workspace setup does not fix the issue, because that snapshot still contains the ten harness-owned entries. A pre-task snapshot with results_entries=[] also triggers the fallback because the code uses if not results_entries.
Expected behavior
Workspace cleanliness should penalize files created by the agent outside the allowed output locations, not files that the harness placed in the workspace before task execution.
Suggested fix
Recommended options:
- Capture an immutable pre-agent baseline in the harness and score only entries added after that baseline.
- Restrict cleanliness checking to
/tmp_workspace/results, which already has a well-defined output allowlist. - If
.task_root_snapshot.jsonis retained, define it as a list of baseline entries to ignore, create it before the agent starts, and distinguish a valid empty list from a missing/invalid snapshot.
Please also add a regression test that runs the grader in the standard container scaffold and expects workspace_cleanliness == 1.0 before the agent creates any extra files.
@stalong1 Thanks for the detailed report and reproduction!
We confirmed the issue and applied the suggested option 2 as a minimal fix: workspace_cleanliness now checks only
the top-level entries under /tmp_workspace/results.
The grader no longer reads .task_root_snapshot.json or enumerates the workspace root, so OpenClaw scaffold/runtime
files no longer affect the score. The allowed entries under results/ remain:
paper_manifest.jsonrenamed_papers/bibtex/
This intentionally means that files outside results/ are no longer included in the cleanliness criterion.
A local regression check confirmed:
- representative OpenClaw scaffold files with valid results:
workspace_cleanliness == 1.0 - one unexpected entry under
results/:workspace_cleanliness == 0.9
Fixed in commit d4b12b5 .Thanks again for catching this!