Add parallel worker support to the SWE-bench eval harness. Currently runs tasks sequentially (~25 min each = 125 hours for 300 tasks). Need to support N parallel workers that each process a slice of tasks independently, with a final batch scoring step. Requirements: (1) Add a --workers N CLI flag. (2) Split task list into N chunks. (3) Each worker gets its own workspace dir (workspaces-0/, workspaces-1/, etc.) to avoid conflicts. (4) Use patch-only mode (already implemented: config.swebench_patch_only=True) during parallel generation — skip Docker scoring per task. (5) All workers write predictions to a shared _swebench_predictions/ dir. (6) After all workers finish, run swebench.harness.run_evaluation on the combined predictions JSONL with --max_workers for parallel Docker scoring. (7) Merge per-worker results into unified summary. (8) Must not break existing sequential mode (--workers 1 or omitted = current behavior). (9) CRITICAL: the current 20-task run must continue undisturbed — don't modify any running code paths, only add new ones.
code
Plan:
# Implementation Plan: Parallel Worker Support for SWE-bench Eval Harness
Overview
The SWE-bench eval harness (evals/run_evals.py) currently runs tasks sequentially via run_all_evals(), which iterates selected_eval_names one-by-one. Each task takes ~25 min (clone → megaplan → score), making 300 tasks ~125 hours wall-clock.
Goal: Add a --workers N flag that splits the task list across N independent subprocesses, each writing predictions to a shared directory, followed by a combined batch-scoring step.
Key constraints:
--workers 1 (or omitted) = exact current behavior, no code path changes.
Must not touch the existing sequential run_all_evals() loop — only add new parallel orchestration on top.
Each worker needs its own workspace_dir to avoid git clone conflicts.
Workers use swebench_patch_only=True during generation (skip per-task Docker scoring).
After all workers finish, run swebench.harness.run_evaluation once on the combined predictions JSONL.
{"flags":[{"id":"worker-runtime-isolation","concern":"Hermes home isolation: HERMES_HOME alone does not contain SWE-bench session cleanup, so parallel workers can still delete the default ~/.hermes/sessions and disturb other live runs.","category":"correctness","severity_hint":"likely-significant","evidence":"The revised plan sets only HERMES_HOME for each worker. But evals/benchmarks/swe_bench.py:353-361 hard-codes cleanup to Path.home() / \".hermes\" / \"sessions\", not os.environ[\"HERMES_HOME\"]. That means worker cleanup still targets the default home directory unless the plan also isolates HOME or changes this code path. This directly conflicts with the requirement that the current 20-task run continue undisturbed."},{"id":"prediction-dir-hygiene","concern":"Predictions hygiene: the plan still does not make workers write to one shared directory, and post-merge cleanup alone does not prevent stale per-worker prediction files from being swept into a later run.","category":"correctness","severity_hint":"likely-significant","evidence":"Step 3 creates , but Step 4 still merges from , which matches the current repository behavior in rather than the stated requirement. Also, only clears and ; it does not clear directories before a new parallel run. If a previous run crashed before Step 4 cleanup, old worker prediction files can still be globbed into the next ."}],"verified_flag_ids":["worker-recursion","summary-merge-contract","batch-result-parsing"],"disputed_flag_ids":[]}
Main loop: evals/run_evals.py:run_all_evals() (lines 615-803)
Step 1: Add workers field to EvalConfig (evals/config.py:32)
Scope: Small
Addworkers: int = 1 field to the EvalConfig dataclass (after line 58, near run_name).
Add validation in __post_init__: if self.workers < 1: raise ValueError(...).
No other changes to config — swebench_patch_only already exists.
Step 2: Add --workers CLI flag (evals/run_evals.py:main())
Scope: Small
Addparser.add_argument("--workers", type=int, default=1, ...) in main() around line 1380.
Setconfig.workers = args.workers after load_config() (line 1387).
Branch before the run_all_evals() call (line 1414): if config.workers > 1 and config.benchmark == "swe-bench", call the new run_parallel_workers() instead.
Phase 2: Parallel Orchestrator
Step 3: Create evals/parallel.py — the parallel orchestrator
Scope: Large (core of this feature)
Createevals/parallel.py with a run_parallel_workers(config_path, eval_names, workers) function.
Flow:
code
a. Load config, resolve benchmark, get full task list
b. Split task list into N roughly-equal chunks (round-robin or contiguous)
c. Create a shared predictions dir: {workspace_dir}/../_swebench_predictions/
d. For each worker i=0..N-1:
- Clone the config JSON to a temp file with overrides:
* workspace_dir = {original_workspace_dir}-{i}/
* swebench_patch_only = true
* evals_to_run = chunk[i]
* run_name = {original_run_name}/worker-{i}
- Spawn: subprocess.Popen(["python", "-m", "evals.run_evals", "--config", temp_config_i])
e. Wait for all subprocesses (poll with timeout, stream stderr)
f. Collect exit codes; if any worker crashed, log error but continue
Key detail: Each worker is a full run_evals subprocess that re-enters run_all_evals() with its own config. This reuses 100% of existing code with zero modifications to the sequential path.
Predictions directory: Workers inherit the same parent for predictions because swe_bench.py:247 uses workspace_path.parent / "_swebench_predictions". Since each worker's workspace_dir differs (workspaces-0/, workspaces-1/), they'd write to different prediction dirs. Fix: Add a swebench_predictions_dir config override (or symlink). Simplest: after workers finish, glob all workspaces-*/\_swebench_predictions/*.jsonl into a single combined JSONL.
Step 4: Merge predictions and run batch scoring (evals/parallel.py)
Scope: Medium
After all workers finish, glob {workspace_dir}-*/_swebench_predictions/*.jsonl into a single combined_predictions.jsonl in the results dir.
After Step 7: run existing sequential mode, diff output against known-good run.
After Step 8: pytest tests/test_parallel.py.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-28T11:25:19Z",
"hash": "sha256:e665d22e1924576bbad10199acd46b4089c934a58060cb1c0953146d0f67ea9f",
"questions": [
"The predictions dir is derived from workspace_path.parent in swe_bench.py:247. With per-worker workspace dirs (workspaces-0/, workspaces-1/), each worker writes to a different _swebench_predictions/ dir. Should we: (a) add a config field to override the predictions dir to a single shared location, or (b) post-merge the per-worker prediction dirs after all workers finish? Option (b) is simpler and doesn't touch existing code.",
"For batch Docker scoring (Step 4), what --max_workers value should we use? This controls Docker container parallelism for swebench.harness.run_evaluation. More workers = faster but needs more RAM/disk. Should this be a separate CLI flag (--scoring-workers) or derived from --workers?",
"Should workers be subprocesses (via subprocess.Popen) or threads/multiprocessing.Pool? Subprocesses are safest (full isolation, match existing patterns in batch_runner.py) but slightly more overhead from re-loading the dataset per worker. The dataset load is ~5s, negligible vs 25 min/task.",
"Do you want a progress reporting mechanism across workers (e.g., a shared progress file or periodic status prints), or is per-worker stderr streaming sufficient?"
],
"success_criteria": [
"--workers 1 (or omitted) produces identical behavior and output to current sequential mode \u2014 no regressions",
"--workers N spawns N independent subprocesses, each processing its chunk of tasks",
"Each worker uses its own workspace directory (workspaces-0/, workspaces-1/, etc.) with no file conflicts",
"Workers run in swebench_patch_only=true mode, skipping per-task Docker scoring",
"After all workers finish, predictions from all workers are merged into a single JSONL file",
"Batch swebench.harness.run_evaluation runs on the combined predictions and produces resolution results",
"A unified summary JSON is produced that merges all worker results with batch scoring outcomes",
"No modifications to run_all_evals() or any code path exercised by sequential mode",
"Total wall-clock time for N workers is approximately (sequential_time / N) + batch_scoring_time"
],
"assumptions": [
"Using subprocesses (subprocess.Popen) for workers, not multiprocessing.Pool \u2014 safest isolation, matches existing patterns, and each worker is a full run_evals invocation",
"Post-merging prediction dirs (option b) rather than adding a shared predictions_dir config field \u2014 avoids touching existing code in swe_bench.py",
"The --workers flag only applies to swe-bench benchmark \u2014 next-evals and terminal-bench continue sequential-only (they have different scoring mechanisms)",
"Contiguous chunking (tasks 0-49 to worker 0, 50-99 to worker 1, etc.) rather than round-robin \u2014 simpler, and task difficulty is roughly random across the list",
"Docker batch scoring max_workers defaults to min(workers, 4) \u2014 can be overridden later if needed",
"The 20-task run currently in progress uses the existing code path and config; since we only add new files (evals/parallel.py) and minimal additions to main()/EvalConfig, there is zero risk of disturbing it"
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"config-reproducibility": [
{
"id": "DEBT-008",
"concern": "openrouter_params (temperature, top_p) are recorded in config but cannot be applied because neither hermes aiagent nor the megaplan cli expose inference parameter controls.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"docker-sandbox-init": [
{
"id": "DEBT-015",
"concern": "file_tools.py does not forward docker_mount_cwd_to_workspace when creating the docker sandbox, so if read_file/write_file is the first tool call, the host workspace bind mount may not be set up.",
"occurrence_count": 1,
"plan_ids": [
"generalize-the-eval-harness-20260327-2049"
]
}
],
"handler-routing": [
{
"id": "DEBT-009",
"concern": "handler layer hardcodes planned\u2192critique transitions that the plan doesn't explicitly enumerate for update.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
],
"hermes-config": [
{
"id": "DEBT-004",
"concern": "availability check references ~/.hermes/config.yaml for api keys, but hermes stores them in /.hermes/.env.",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"module-layout": [
{
"id": "DEBT-003",
"concern": "hermes_worker.py importing workerresult from workers.py while workers.py imports run_hermes_step from hermes_worker.py creates a circular import.",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"research-prompt": [
{
"id": "DEBT-013",
"concern": "plan omits the brief's explicit 'compare against at least 2 search results' requirement.",
"occurrence_count": 1,
"plan_ids": [
"improve-research-reliability"
]
}
],
"schema-validation": [
{
"id": "DEBT-011",
"concern": "proposed framework_versions object schema will be rejected by the strict additionalproperties:false rewriter.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
},
{
"id": "DEBT-014",
"concern": "prompt wording alone cannot prevent empty or content-free consideration entries since the schema only requires severity.",
"occurrence_count": 1,
"plan_ids": [
"improve-research-reliability"
]
}
],
"scoring-diffing": [
{
"id": "DEBT-007",
"concern": "git diff head1 fails when the workspace has only one initial commit before execution begins.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"test-coverage": [
{
"id": "DEBT-012",
"concern": "plan references wrong test files for workflow assertions.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
],
"trace-collection": [
{
"id": "DEBT-006",
"concern": "session log path is ~/.hermes/sessions/ not ~/.hermes/logs/, and sessions are reused across megaplan phases, so naive reads return cumulative history rather than phase-isolated snapshots.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"trace-instrumentation": [
{
"id": "DEBT-005",
"concern": "the plan captures normalized session logs and aggregate cost/token counters from run_conversation(), not raw http request/response payloads or openrouter response headers.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"worker-contract": [
{
"id": "DEBT-001",
"concern": "plan's sample workerresult constructor uses non-existent fields (output, input_tokens, output_tokens) instead of actual fields (payload, raw_output).",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"worker-dispatch": [
{
"id": "DEBT-002",
"concern": "plan's sample function signature (phase, prompt, schema_dir, model) doesn't match the actual worker signature (step, state, plan_dir, *, root, ...).",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
},
{
"id": "DEBT-010",
"concern": "research on non-hermes agents silently falls back to stale training data instead of fresh web searches.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
]
}
code
Escalated debt subsystems:
[]
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Ask whether the plan is the simplest approach that solves the stated problem, whether it could use fewer steps or less machinery, and whether it introduces unnecessary complexity.
- Over-engineering concerns should use category `maintainability`, should usually prefix the concern with "Over-engineering:", and should scale severity_hint to the practical impact.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
{"flags":[{"id":"worker-runtime-isolation","concern":"Worker runtime: parallel subprocesses cannot share the default HERMES_HOME; each SWE-bench task cleanup deletes every session_*.json, so workers will race on live Hermes session logs and corrupt traces or stuck detection.","category":"correctness","severity_hint":"likely-significant","evidence":"evals/run_evals.py:515 reads phase traces from Hermes session logs and evals/run_evals.py:996-997 watches HERMES_HOME/sessions/session_<id>.json for stuck detection. evals/benchmarks/swe_bench.py:347-359 calls _cleanup_hermes_sessions() after every task and unlinks all ~/.hermes/sessions/session_*.json. The plan adds parallel subprocesses but does not isolate HERMES_HOME per worker."},{"id":"worker-recursion","concern":"Worker orchestration: the plan's temp worker configs must explicitly force workers=1 or equivalent, otherwise each worker re-enters the new parallel branch and recursively spawns more workers instead of running its slice sequentially.","category":"correctness","severity_hint":"likely-significant","evidence":"The plan adds workers to EvalConfig and branches in evals/run_evals.py:1348-1414 when config.workers > 1, but Step 3 only overrides workspace_dir, swebench_patch_only, evals_to_run, and run_name in worker configs. If those configs inherit the parent workers=N, python -m evals.run_evals --config temp_config_i will hit the same branch again."},{"id":"summary-merge-contract","concern":"Summary contract: Step 5 assumes worker summary_*.json files contain deferred-scoring details that do not exist in the actual repository, so the proposed merge cannot reliably rewrite per-task outcomes from those files alone.","category":"correctness","severity_hint":"likely-significant","evidence":"run_all_evals() writes top-level summary entries with only eval_name, status, conditional_pass, build_pass, eval_score, test_passed, cost_usd, duration_seconds, audit_dir, and error (evals/run_evals.py:760-800). There is no test_result object or scoring=deferred marker there. The richer SWE-bench data lives in each audit's summary.json / scoring/test.json (evals/audit.py:123-147)."},{"id":"batch-result-parsing","concern":"Batch scoring: reusing the existing _check_resolved() pattern is not sufficient for a combined run because it is a single-instance heuristic that scans global output folders, not a reliable per-instance parser for one batch evaluation.","category":"correctness","severity_hint":"likely-significant","evidence":"evals/benchmarks/swe_bench.py:397-414 implements _check_resolved(instance_id, eval_result) by searching combined stdout/stderr and then walking global evaluation_results and logs/run_evaluation. That is already coarse for one instance; after a combined batch run it can match stale or unrelated JSON and does not return an authoritative resolved/unresolved map for all tasks."},{"id":"prediction-dir-hygiene","concern":"Workspace hygiene: the post-merge prediction-dir approach leaves stale worker artifacts in scope and conflicts with the stated shared _swebench_predictions requirement, which can contaminate later batch scoring runs.","category":"correctness","severity_hint":"likely-significant","evidence":"evals/run_evals.py:1379-1394 only clears config.workspace_dir and config.results_dir. Under the plan, worker directories like evals/workspaces-0/ and their _swebench_predictions/ trees sit outside the configured workspace_dir, so --clear will not remove them. The repo already has persisted prediction files under evals/workspaces/_swebench_predictions/*.jsonl, showing stale artifacts are real, not hypothetical."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
Add parallel worker support to the SWE-bench eval harness. Currently runs tasks sequentially (~25 min each = 125 hours for 300 tasks). Need to support N parallel workers that each process a slice of tasks independently, with a final batch scoring step. Requirements: (1) Add a --workers N CLI flag. (2) Split task list into N chunks. (3) Each worker gets its own workspace dir (workspaces-0/, workspaces-1/, etc.) to avoid conflicts. (4) Use patch-only mode (already implemented: config.swebench_patch_only=True) during parallel generation — skip Docker scoring per task. (5) All workers write predictions to a shared _swebench_predictions/ dir. (6) After all workers finish, run swebench.harness.run_evaluation on the combined predictions JSONL with --max_workers for parallel Docker scoring. (7) Merge per-worker results into unified summary. (8) Must not break existing sequential mode (--workers 1 or omitted = current behavior). (9) CRITICAL: the current 20-task run must continue undisturbed — don't modify any running code paths, only add new ones.
code
Plan:
# Implementation Plan: Parallel Worker Support for SWE-bench Eval Harness
Overview
The SWE-bench eval harness (evals/run_evals.py) currently runs tasks sequentially via run_all_evals(), which iterates selected_eval_names one-by-one. Each task takes ~25 min (clone → megaplan → score), making 300 tasks ~125 hours wall-clock.
Goal: Add a --workers N flag that splits the task list across N independent subprocesses, each writing predictions to a shared directory, followed by a combined batch-scoring step.
Key constraints:
--workers 1 (or omitted) = exact current behavior, no code path changes.
Must not touch the existing sequential run_all_evals() loop — only add new parallel orchestration on top.
Each worker needs its own workspace_dir to avoid git clone conflicts.
Workers use swebench_patch_only=True during generation (skip per-task Docker scoring).
After all workers finish, run swebench.harness.run_evaluation once on the combined predictions JSONL.
The current 20-task run must continue undisturbed.
DECISION-003: Contiguous chunking for task distribution.
DECISION-004: --workers flag applies only to swe-bench benchmark.
Phase 1: Config & CLI Plumbing
Step 1: Add workers field to EvalConfig (evals/config.py:32)
Scope: Small
Addworkers: int = 1 field to the EvalConfig dataclass (after line 58, near run_name).
Add validation in __post_init__: if self.workers < 1: raise ValueError(...).
No other changes to config — swebench_patch_only already exists.
Step 2: Add --workers CLI flag (evals/run_evals.py:main())
Scope: Small
Addparser.add_argument("--workers", type=int, default=1, ...) in main() around line 1380.
Setconfig.workers = args.workers after load_config() (line 1387).
Branch before the run_all_evals() call (line 1414): if config.workers > 1 and config.benchmark == "swe-bench", call the new run_parallel_workers() instead. Otherwise fall through to existing run_all_evals() unchanged.
Phase 2: Parallel Orchestrator
Step 3: Create evals/parallel.py — the parallel orchestrator
Scope: Large (core of this feature)
Createevals/parallel.py with a run_parallel_workers(config_path, eval_names, workers) function.
Flow:
code
a. Load config, resolve benchmark, get full task list via benchmark.list_tasks()
b. Split task list into N roughly-equal contiguous chunks
c. Create a shared predictions dir at a deterministic location:
{results_root}/_swebench_predictions/
d. For each worker i=0..N-1:
- Write a temp config JSON with these overrides:
* workers = 1 ← PREVENTS RECURSIVE SPAWNING
* workspace_dir = {original_workspace_dir}-{i}/
* swebench_patch_only = true
* evals_to_run = chunk[i]
* run_name = {original_run_name}/worker-{i}
- Set per-worker env:
* HERMES_HOME = {original_workspace_dir}-{i}/_hermes_home/
- Spawn: subprocess.Popen(
["python", "-m", "evals.run_evals", "--config", temp_config_i],
env={**os.environ, "HERMES_HOME": worker_hermes_home},
stderr=subprocess.PIPE,
)
e. Poll all subprocesses, streaming stderr with worker-id prefix
f. Collect exit codes; if any worker crashed, log error but continue to scoring
g. Clean up temp config files
Key detail: Each worker is a full run_evals subprocess that re-enters run_all_evals() with its own config. Because workers=1 is explicitly set in the temp config, the branch in main() falls through to the existing sequential path — no recursion possible.
HERMES_HOME isolation: Each worker subprocess inherits a unique HERMES_HOME via its environment. This flows through to:
_megaplan_env() (run_evals.py:1037) which calls os.environ.copy() — picks up the per-worker
Step 4: Merge predictions into combined JSONL (evals/parallel.py)
Scope: Small
After all workers finish, glob {workspace_dir}-*/_swebench_predictions/*.jsonl into a single {results_root}/combined_predictions.jsonl.
python
combined = results_root / "combined_predictions.jsonl"
with open(combined, "w") as out:
for worker_dir in sorted(workspace_base.parent.glob(f"{workspace_base.name}-*")):
preds_dir = worker_dir / "_swebench_predictions"
if not preds_dir.exists():
continue
for jsonl_file in sorted(preds_dir.glob("*.jsonl")):
out.write(jsonl_file.read_text())
Delete per-worker _swebench_predictions/ dirs and worker workspace dirs after merging to prevent stale artifact contamination.
Clean up worker workspace dirs (workspaces-0/, workspaces-1/, etc.) after merge. These contain the cloned repos which are no longer needed.
Step 5: Run batch Docker scoring (evals/parallel.py)
Parse batch results using a new _parse_batch_results() function (NOT _check_resolved()). This function:
Reads the SWE-bench evaluation output directory (evaluation_results/ or the --run_id-named output dir)
Looks for the authoritative JSON report that swebench.harness.run_evaluation writes, which contains a resolved_ids list or per-instance resolved booleans
Falls back to parsing stdout line-by-line for "RESOLVED" / "FAILED" per instance_id if no JSON report found
python
def _parse_batch_results(run_id: str) -> dict[str, bool]:
"""Parse swebench batch evaluation into {instance_id: resolved}."""
results: dict[str, bool] = {}
# Primary: read the JSON report written by swebench
for results_dir in [Path("evaluation_results"), Path(f"logs/{run_id}")]:
for json_file in results_dir.rglob("*.json"):
data = json.loads(json_file.read_text())
if isinstance(data, dict):
# swebench writes {"resolved_ids": [...]} or per-instance results
for rid in data.get("resolved_ids", []):
results[rid] = True
# Also check per-instance format
if "instance_id" in data and "resolved" in data:
results[data["instance_id"]] = bool(data["resolved"])
return results
Step 6: Merge per-worker summaries into unified summary (evals/parallel.py)
Scope: Medium
Load each worker's summary_*.json from results/{run_name}/worker-{i}/. Each summary's evals array contains entries with eval_name, status, cost_usd, duration_seconds, audit_dir, error.
Load per-eval audit data to get scoring details. For each eval entry, read {audit_dir}/scoring/test.json which contains the SWE-bench test_result dict (written by audit.py:146-147). This has instance_id, scoring: "deferred", and patch fields under patch-only mode.
Update each eval entry using batch scoring results:
python
batch_results = _parse_batch_results(run_id)
for entry in merged_entries:
instance_id = entry["eval_name"] # eval_name IS the instance_id for swe-bench
if instance_id in batch_results:
resolved = batch_results[instance_id]
entry["status"] = "passed" if resolved else "failed"
entry["test_passed"] = resolved
# Update the audit's test.json too
audit_test_path = Path(entry["audit_dir"]) / "scoring" / "test.json"
if audit_test_path.exists():
test_data = json.loads(audit_test_path.read_text())
test_data["success"] = resolved
test_data["scoring"] = "batch"
atomic_json_write(audit_test_path, test_data)
Write the unified summary_{run_timestamp}.json to the top-level results dir.
Print the combined summary to stdout (same JSON format as sequential mode).
Phase 3: Validation
Step 7: Verify sequential mode is untouched
Scope: Small
Diffevals/run_evals.py — the only changes should be the --workers arg and the branch in main(). Zero changes to run_all_evals() or any function it calls.
Run existing sequential mode (--workers 1 or omitted) on 2 tasks with patch_only to confirm identical behavior.
Step 8: Manual smoke test — 2 workers, 4 tasks
Scope: Small
Create a test config with 4 easy tasks from REPRESENTATIVE_SAMPLE and swebench_patch_only: false (so batch scoring runs).
Run with --workers 2 and verify:
Two worker subprocesses spawn (check PIDs in stderr).
workspaces-0/ and workspaces-1/ are created with isolated _hermes_home/ dirs.
Each worker sets HERMES_HOME correctly (check subprocess env).
Workers do NOT recursively spawn (check workers=1 in temp configs).
Prediction JSONL files are merged into combined_predictions.jsonl.
After Step 7: sequential mode produces identical output to pre-change behavior.
After Step 9: pytest tests/test_parallel.py passes.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-28T11:32:01Z",
"hash": "sha256:f37782bbb1536c0c941208e1b87c54f26263ac7345a4c8df3a8e347f4d193e23",
"changes_summary": "Revised plan addressing all 5 gate flags: (1) worker-recursion \u2014 worker configs now explicitly set workers=1 to prevent fork bomb; (2) worker-runtime-isolation \u2014 each worker subprocess gets HERMES_HOME={workspace_dir}-{i}/_hermes_home/ in its env, isolating session logs, stuck detection, and cleanup; (3) summary-merge-contract \u2014 Step 6 now reads per-eval {audit_dir}/scoring/test.json (which contains the actual test_result with instance_id and scoring=deferred) instead of assuming top-level summary fields that don't exist; (4) batch-result-parsing \u2014 replaced reuse of _check_resolved() with a new _parse_batch_results() function that reads swebench's authoritative JSON report with resolved_ids, returning a full instance_id\u2192resolved map; (5) prediction-dir-hygiene \u2014 Step 4 now explicitly deletes per-worker prediction dirs and workspace dirs after merging to combined JSONL, preventing stale artifact contamination.",
"flags_addressed": [
"worker-runtime-isolation",
"worker-recursion",
"summary-merge-contract",
"batch-result-parsing",
"prediction-dir-hygiene"
],
"questions": [],
"success_criteria": [],
"assumptions": [],
"structure_warnings": [],
"delta_from_previous_percent": 53.8
}
code
Plan structure warnings from validator:
[]
Existing flags:
[
{
"id": "worker-runtime-isolation",
"concern": "Worker runtime: parallel subprocesses cannot share the default HERMES_HOME; each SWE-bench task cleanup deletes every session_*.json, so workers will race on live Hermes session logs and corrupt traces or stuck detection.",
"status": "addressed",
"severity": "significant"
},
{
"id": "worker-recursion",
"concern": "Worker orchestration: the plan's temp worker configs must explicitly force workers=1 or equivalent, otherwise each worker re-enters the new parallel branch and recursively spawns more workers instead of running its slice sequentially.",
"status": "addressed",
"severity": "significant"
},
{
"id": "summary-merge-contract",
"concern": "Summary contract: Step 5 assumes worker summary_*.json files contain deferred-scoring details that do not exist in the actual repository, so the proposed merge cannot reliably rewrite per-task outcomes from those files alone.",
"status": "addressed",
"severity": "significant"
},
{
"id": "batch-result-parsing",
"concern": "Batch scoring: reusing the existing _check_resolved() pattern is not sufficient for a combined run because it is a single-instance heuristic that scans global output folders, not a reliable per-instance parser for one batch evaluation.",
"status": "addressed",
"severity": "significant"
},
{
"id": "prediction-dir-hygiene",
"concern": "Workspace hygiene: the post-merge prediction-dir approach leaves stale worker artifacts in scope and conflicts with the stated shared _swebench_predictions requirement, which can contaminate later batch scoring runs.",
"status": "addressed",
"severity": "significant"
}
]
code
Known accepted debt grouped by subsystem:
{
"config-reproducibility": [
{
"id": "DEBT-008",
"concern": "openrouter_params (temperature, top_p) are recorded in config but cannot be applied because neither hermes aiagent nor the megaplan cli expose inference parameter controls.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"docker-sandbox-init": [
{
"id": "DEBT-015",
"concern": "file_tools.py does not forward docker_mount_cwd_to_workspace when creating the docker sandbox, so if read_file/write_file is the first tool call, the host workspace bind mount may not be set up.",
"occurrence_count": 1,
"plan_ids": [
"generalize-the-eval-harness-20260327-2049"
]
}
],
"handler-routing": [
{
"id": "DEBT-009",
"concern": "handler layer hardcodes planned\u2192critique transitions that the plan doesn't explicitly enumerate for update.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
],
"hermes-config": [
{
"id": "DEBT-004",
"concern": "availability check references ~/.hermes/config.yaml for api keys, but hermes stores them in /.hermes/.env.",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"module-layout": [
{
"id": "DEBT-003",
"concern": "hermes_worker.py importing workerresult from workers.py while workers.py imports run_hermes_step from hermes_worker.py creates a circular import.",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"research-prompt": [
{
"id": "DEBT-013",
"concern": "plan omits the brief's explicit 'compare against at least 2 search results' requirement.",
"occurrence_count": 1,
"plan_ids": [
"improve-research-reliability"
]
}
],
"schema-validation": [
{
"id": "DEBT-011",
"concern": "proposed framework_versions object schema will be rejected by the strict additionalproperties:false rewriter.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
},
{
"id": "DEBT-014",
"concern": "prompt wording alone cannot prevent empty or content-free consideration entries since the schema only requires severity.",
"occurrence_count": 1,
"plan_ids": [
"improve-research-reliability"
]
}
],
"scoring-diffing": [
{
"id": "DEBT-007",
"concern": "git diff head1 fails when the workspace has only one initial commit before execution begins.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"test-coverage": [
{
"id": "DEBT-012",
"concern": "plan references wrong test files for workflow assertions.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
],
"trace-collection": [
{
"id": "DEBT-006",
"concern": "session log path is ~/.hermes/sessions/ not ~/.hermes/logs/, and sessions are reused across megaplan phases, so naive reads return cumulative history rather than phase-isolated snapshots.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"trace-instrumentation": [
{
"id": "DEBT-005",
"concern": "the plan captures normalized session logs and aggregate cost/token counters from run_conversation(), not raw http request/response payloads or openrouter response headers.",
"occurrence_count": 1,
"plan_ids": [
"hermes-evals-orchestrator"
]
}
],
"worker-contract": [
{
"id": "DEBT-001",
"concern": "plan's sample workerresult constructor uses non-existent fields (output, input_tokens, output_tokens) instead of actual fields (payload, raw_output).",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
}
],
"worker-dispatch": [
{
"id": "DEBT-002",
"concern": "plan's sample function signature (phase, prompt, schema_dir, model) doesn't match the actual worker signature (step, state, plan_dir, *, root, ...).",
"occurrence_count": 1,
"plan_ids": [
"hermes-megaplan-integration"
]
},
{
"id": "DEBT-010",
"concern": "research on non-hermes agents silently falls back to stale training data instead of fresh web searches.",
"occurrence_count": 1,
"plan_ids": [
"research-phase"
]
}
]
}
code
Escalated debt subsystems:
[]
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Ask whether the plan is the simplest approach that solves the stated problem, whether it could use fewer steps or less machinery, and whether it introduces unnecessary complexity.
- Over-engineering concerns should use category `maintainability`, should usually prefix the concern with "Over-engineering:", and should scale severity_hint to the practical impact.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
_swebench_predictions
{results_root}/_swebench_predictions/
{workspace_dir}-*/_swebench_predictions/*.jsonl
evals/benchmarks/swe_bench.py:247-250
evals/run_evals.py:1383-1394
config.workspace_dir
config.results_dir
workspaces-*
combined_predictions.jsonl
“You are an independent reviewer. Critique the plan against the actual repository.….” Conversation with gpt-5.4, from the Peter O’Mallet DataClaw Conversations dataset. The Chat Archive, 2026. https://thechatarchive.com/c/01m80epzwwssq387ch5dfbjrab
Dataset releases
Not yet included in a published release.
HERMES_HOME
_check_stuck() (run_evals.py:996) which reads os.environ.get("HERMES_HOME")
collect_phase_trace() (audit.py:192) which reads sessions via _read_session_log() using HERMES_HOME
_cleanup_hermes_sessions() (swe_bench.py:355) which deletes from ~/.hermes/sessions/ — but with HERMES_HOME overridden, Hermes writes sessions to the worker-specific dir instead, so cleanup only deletes that worker's sessions.