Multifaceted improvement plan for the megaplan+hermes SWE-bench pipeline based on 2 iterations of auto-improve data. Current rate: 63% (12/19). Goal: 90%+.
Root problems:
SCOPE DETECTION: Pipeline treats all tasks identically. 1-line fixes and 100-line features get same workflow. Prep should classify complexity and plan should scale accordingly.
NO VERIFICATION FEEDBACK LOOP: When tests fail during execute, no structured diagnose→fix→reverify cycle. Need execute→verify→diagnose→fix→verify loop.
SCORING INFRASTRUCTURE: Watch scorer should use Modal by default (done), need auto-retry, error capture, fallback.
PREP NOT CONNECTING DOTS: Prep lists files but doesn't synthesize into scope assessment. Should output: simple fix / multi-site fix / new feature / refactor.
REGRESSION FROM NONDETERMINISM: pylint-4970 passed iter 001, failed iter 002 with no relevant changes.
Current state: 63% (12/19) after 2 auto-improve iterations. The pipeline has 6 identified root problems spanning megaplan prompts (prep/plan/execute), pipeline infrastructure (scoring/verification), and the auto-improve process itself.
Key constraint: Megaplan prompts live in /Users/user_c042661f/Documents/megaplan/megaplan/prompts.py (separate repo, not readable from hermes-agent sandbox). Pipeline orchestration lives in /Users/user_c042661f/Documents/hermes-agent/evals/run_evals.py. Scoring lives in evals/watch_scoring.py. Auto-improve loop lives in auto_improve/.
Current verification loop (run_evals.py:596-658): Execute runs → checks _all_tasks_done() → runs verify_fn() → if failed, injects feedback via _inject_verify_feedback() → re-runs execute (max 2 verify attempts). This is decent but the feedback injection is limited (just test output tail) and there's no structured diagnosis step between failure and retry.
Assistant
User
Assistant
{"flags":[{"id":"F3","concern":"Regression analysis: the revised Step 8 still does not work end-to-end, because it relies on error_category being present in the iteration scores.json, but the current normalization path drops that field entirely.","category":"correctness","severity_hint":"likely-significant","evidence":"Step 8 says compare_scores() should read error_category from scores, but auto_improve/score_experiment.py:140-190 only normalizes each task to {resolved, status} plus optional error; it never copies error_category through from _watch_scores.json. auto_improve/loop.py:52-76 then feeds those normalized scores into compare_scores() and the analysis scaffold. Without a companion change in score_experiment.py, the new infra-vs-real regression split cannot be populated."}],"verified_flag_ids":["F1","F2","DEBT-031"],"disputed_flag_ids":[]}
Current scoring retry (watch_scoring.py:60-66): Tasks scoring None (transient failures) retry up to 2 attempts. No error categorization, no fallback strategy.
Phase 1: Scope Classification in Prep (Root Problems #1, #4)
Step 1: Add scope classification output to prep prompt (megaplan/prompts.py)
Scope: Medium
Locate the prep prompt template in megaplan/prompts.py. The prep phase currently "lists files but doesn't synthesize into scope assessment" per findings.
Add to the prep prompt's output requirements a scope_assessment section that must include:
Classification: one of simple_fix (1-3 lines, single site), multi_site_fix (same change in multiple locations), new_feature (new function/class/method), refactor (structural change across files)
Estimated touch points: number of files and functions to modify
Add a prep instruction: "After grepping all usages, synthesize into a scope assessment. If you found NotImplementedError, the scope is likely new_feature or refactor, not simple_fix. If the same pattern appears in N locations, classify as multi_site_fix."
Step 2: Make plan prompt scale with scope classification (megaplan/prompts.py)
Scope: Medium
Modify the plan prompt to read the prep's scope_assessment and adjust planning depth:
simple_fix: "Produce a focused plan. Identify the exact line(s) to change. Do not over-engineer."
multi_site_fix: "Grep confirmed N sites need the same fix. Your plan MUST enumerate every site. Missing a site is the #1 failure mode."
new_feature / refactor: "This requires structural changes. Map the full dependency graph before proposing changes. Budget for test updates."
Add to plan prompt: "If prep classified as multi_site_fix, your plan MUST list every call site. After planning, grep again to verify you haven't missed any."
Phase 2: Verification Feedback Loop (Root Problem #2)
Step 3: Add structured diagnosis between verify failure and execute retry (evals/run_evals.py)
Scope: Medium — changes to run_megaplan_loop() around lines 606-643
Currently: When verify fails, _inject_verify_feedback() just passes the last 1500 chars of test output. The executor gets raw test output with no diagnosis.
Add a _diagnose_verify_failure() function that parses the verify result to extract:
Which specific tests failed (from verify_result.tests_run + output parsing)
Error type categorization: assertion_error, import_error, attribute_error, syntax_error, timeout
The failing assertion or traceback (extract from test_output)
Update_inject_verify_feedback() (run_evals.py:392-418) to include the structured diagnosis:
python
diagnosis = _diagnose_verify_failure(verify_result)
parts = [
"[verify failed]",
f"failing_tests: {diagnosis.failing_tests}",
f"error_type: {diagnosis.error_type}",
f"key_traceback: {diagnosis.traceback_summary}",
"Diagnose the root cause from the traceback before making changes.",
"Fix the implementation and do not modify test files.",
"verify_output_tail:",
output_tail,
]
Increasemax_verify_attempts default from 2 to 3 (run_evals.py:429). The current 2 attempts means only 1 retry after initial failure — not enough for complex fixes.
Step 4: Add execute prompt guidance for verify-retry cycles (megaplan/prompts.py)
Scope: Small
Add to the execute prompt: "If you receive a [verify failed] note, follow this procedure: (1) Read the failing test to understand what it expects. (2) Read the traceback to identify which line of YOUR code is wrong. (3) Fix the root cause, not the symptom. (4) Do NOT revert to the original code — your approach is likely right, just incomplete."
Phase 3: Scoring Infrastructure Hardening (Root Problem #3)
Step 5: Add retry categorization and auto-retry to watch scorer (evals/watch_scoring.py)
Scope: Medium — changes to watch_and_score() and _score_single_prediction()
Increase max retry attempts from 2 to 3 (watch_scoring.py:65). Currently attempts < 2 means only 1 retry.
Add error categorization to _score_single_prediction() return value:
Add retry-with-fallback logic: if Modal fails twice (error_category == "modal_sandbox"), retry with local Docker (use_modal=False) as a third attempt. This addresses the "Modal flaky" finding.
Add structured error capture: store the error category in _watch_scores.json per task so analysis can distinguish pipeline failures from real failures (addresses iteration 001 finding: "3/8 failures were actually correct patches with scoring infra issues").
Step 6: Add scoring summary with error breakdown (evals/watch_scoring.py)
Scope: Small
Add to _refresh_scores_summary() an error_breakdown field:
Add to _format_stop_line() the error breakdown so it's visible in terminal output without opening the JSON.
Phase 4: Sphinx/Complex Repo Handling (Root Problem #6)
Step 7: Add large-codebase awareness to prep and plan prompts (megaplan/prompts.py)
Scope: Medium
Add to prep prompt: "For large codebases (>500 files), focus your investigation on the specific module mentioned in the issue. Map the module's internal structure before examining cross-module dependencies. If the repo has a plugin/extension architecture (like Sphinx), identify which extension point is involved."
Add to plan prompt: "If prep identified a plugin/extension architecture, your plan must account for: (1) the extension registration mechanism, (2) the extension's interaction with the core, (3) any merge/aggregation logic that combines extension outputs."
Add to prep prompt: "For repos with >20 files in the relevant module, output a brief module map showing the key classes and their relationships before listing individual files."
Phase 5: Regression Detection in Auto-Improve (Root Problem #5)
Step 8: Add regression detection to score comparison (auto_improve/loop.py, auto_improve/utils.py)
Scope: Medium
Enhancecompare_scores() in auto_improve/utils.py to flag regressions with severity:
regression_with_no_change: task passed before, failed now, and no prompt changes targeted this task's failure pattern — likely nondeterminism
regression_from_change: task passed before, failed now, and prompt changes could have affected it
Updatescaffold_iteration_docs() (loop.py:49-111) to highlight regressions prominently in the auto-generated analysis.md, with a dedicated "## Regressions" section before "## Failed".
Add anchor task tracking: maintain a list of "must-pass" tasks (those that passed in 2+ consecutive iterations). If an anchor task regresses, flag it as high-priority in the analysis scaffold.
Step 9: Add task rotation with anchor/retry/new split (auto_improve/run_experiment.py)
Scope: Small
Currently task selection is either fixed 20 tasks or manual. Per findings: "~10 anchors (passed before), ~5 retries (failed before), ~5 new (unseen)."
Add a select_iteration_tasks() function that takes prior iteration scores and the full task pool, returns a split:
10 anchor tasks (passed in latest iteration — regression detection)
5 retry tasks (failed in latest iteration — measure improvement)
5 new tasks (never attempted — expand coverage)
Wire this into build_materialized_config() (run_experiment.py:31-41) so it auto-generates the task list from prior scores when tasks.json isn't manually specified.
Step 10: Strengthen execute prompt against under-scoping (megaplan/prompts.py)
Scope: Small
Add to execute prompt: "Before declaring done, grep for the pattern you just fixed. If the same bug pattern exists in other functions/methods in the same file or related files, fix ALL instances. Under-fixing is worse than over-fixing."
Add to execute prompt: "If the plan says multi_site_fix, count the sites you've fixed and compare to the plan's enumerated list. Do not finish until all sites are addressed."
Execution Order
Phase 1 (Steps 1-2): Scope classification — highest impact, addresses the root cause of under-scoping (3/5 failures in iter 001).
Phase 2 (Steps 3-4): Verify feedback loop — second highest impact, turns verify failures into actionable retries.
Phase 3 (Steps 5-6): Scoring infra — important for measurement accuracy but doesn't improve solve rate.
Phase 5 (Steps 8-9): Auto-improve process — improves iteration velocity, not direct solve rate.
Validation Order
Smoke test: Run 3-5 tasks from the failure set (scikit-learn-12973, sphinx-8035, sympy-18199) with Phase 1+2 changes to verify scope classification works.
Regression check: Run the 10 anchor tasks to verify no regressions from prompt changes.
Full iteration: Run full 20-task iteration with all changes, compare to iter 001 baseline (67%).
Scoring validation: Verify scoring infra changes by checking that tasks previously scored as error now resolve correctly.
Target: 14/19 (74%) on first iteration with changes, 17/19 (89%) after 2 iterations of tuning.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-30T13:10:56Z",
"hash": "sha256:a48ff62cfccaeac4cf02c62ad6fce46c5d5eb7f9661492c9ef16e10accbe5982",
"questions": [
"Can I get read access to /Users/user_c042661f/Documents/megaplan/megaplan/prompts.py? I need to see the current prompt templates to write precise diffs rather than generic instructions. The plan currently describes WHAT to add but not WHERE exactly in the existing prompts.",
"For the verify feedback loop (Step 3): the current verify_fn comes from the Benchmark protocol. Does VerifyResult.test_output include the full pytest output, or just a summary? The diagnosis quality depends on having actual tracebacks.",
"For scoring fallback (Step 5): is local Docker scoring actually viable on your machine for non-Django repos? FINDINGS.md says Docker fails on Apple Silicon for matplotlib/pytest/requests/sphinx. If local Docker is also broken, the fallback should be a different Modal config or skip-and-flag rather than local Docker.",
"The 90% target on 19 tasks means at most 1-2 failures allowed. The 3 sphinx tasks are currently 0/3. Is improving sphinx performance a hard requirement, or would 90% on the non-sphinx subset (16 tasks) be acceptable as an intermediate milestone?",
"For task rotation (Step 9): should the 20-task pool expand over iterations, or stay fixed at 20 with rotation within a larger pool? The current tasks.json seems to be a fixed set."
],
"success_criteria": [
"Scope classification: prep output includes scope_assessment with classification (simple_fix/multi_site_fix/new_feature/refactor) for every task",
"Plan scaling: plan prompt demonstrably produces different plan depths for simple_fix vs multi_site_fix tasks (verifiable by comparing plan artifacts)",
"Verify loop: verify failures produce structured diagnosis (error type + failing test + traceback summary) in the injected feedback, not just raw output tail",
"Scoring reliability: error_category field present in _watch_scores.json for all scored tasks; Modal\u2192local fallback triggers on repeated Modal failures",
"Regression detection: analysis.md auto-scaffold includes Regressions section with severity classification when regressions detected",
"Task rotation: iteration task list auto-generated from prior scores with ~50% anchors, ~25% retries, ~25% new when no manual tasks.json override",
"Under-scoping reduction: on the 5 tasks that failed due to under_scoping in iter 001, at least 3 now pass (scikit-learn-12973, sphinx-8035, sympy-18199 are key targets)",
"Overall pass rate: \u226580% (16/20) on next full iteration, \u226590% within 2 iterations"
],
"assumptions": [
"Megaplan prompts in prompts.py are string templates that can be extended with additional sections/instructions without changing the megaplan harness code \u2014 the prep/plan/execute prompts are injected as-is into the LLM context.",
"The prep phase output is a JSON object that can be extended with new fields (scope_assessment) without breaking downstream phases \u2014 plan/critique/gate read prep output but tolerate extra fields.",
"The verify_fn in run_megaplan_loop produces VerifyResult with full pytest output in test_output (not truncated), making traceback extraction feasible.",
"Modal is the preferred scoring backend and local Docker is a viable fallback for at least Django repos (the largest subset). For repos where neither works, we accept error status rather than false negatives.",
"The 19-task denominator in '63% (12/19)' excludes tasks that were infra errors, not real failures. The plan targets both reducing real failures AND reducing infra errors.",
"Prompt changes are additive (appending instructions) rather than requiring structural refactoring of existing prompt templates.",
"The auto-improve task pool is larger than 20 tasks (SWE-bench_Verified has ~500), so task rotation with new unseen tasks is feasible."
],
"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"
]
}
],
"execute-loop-control-flow": [
{
"id": "DEBT-022",
"concern": "the 'all tasks done but state stuck on finalized' break path at line 562 would skip verify if verify is inserted after the execute block.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
}
],
"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"
]
},
{
"id": "DEBT-026",
"concern": "manual megaplan research cli invocation can strand plans in state_researched with no workflow exit transition.",
"occurrence_count": 1,
"plan_ids": [
"three-changes-to-the-megaplan-20260329-1755"
]
}
],
"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"
]
}
],
"join-workflow": [
{
"id": "DEBT-019",
"concern": "the --join cli has no enforced source of truth for original run settings, so a mismatched config could attach wrong models/workspace layout to an existing manifest.",
"occurrence_count": 1,
"plan_ids": [
"two-goals-for-the-swe-bench-20260328-2006"
]
}
],
"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"
]
},
{
"id": "DEBT-024",
"concern": "the evals/ top-level package is outside the distributable module set and won't be included in wheel builds.",
"occurrence_count": 1,
"plan_ids": [
"fix-two-issues-with-swe-bench-20260329-1313"
]
}
],
"orchestrator-lifecycle": [
{
"id": "DEBT-018",
"concern": "the manifest.all_done() polling loop can hang indefinitely if a worker crashes and leaves tasks in 'claimed' state with no timeout or reclaim mechanism.",
"occurrence_count": 1,
"plan_ids": [
"two-goals-for-the-swe-bench-20260328-2006"
]
}
],
"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-backend": [
{
"id": "DEBT-027",
"concern": "watch scoring is docker-only; modal scoring is not supported.",
"occurrence_count": 1,
"plan_ids": [
"add-a-polling-watch-mode-to-20260329-2355"
]
}
],
"scoring-consolidation": [
{
"id": "DEBT-030",
"concern": "consolidate.py scans a global logs/run_evaluation/ path and could pick up stale reports from prior iterations running the same 20 instance ids.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"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"
]
}
],
"session-lifecycle": [
{
"id": "DEBT-016",
"concern": "_cleanup_hermes_sessions() hard-codes path.home() / '.hermes' / 'sessions', ignoring hermes_home. parallel workers may delete session files from the default location.",
"occurrence_count": 2,
"plan_ids": [
"add-parallel-worker-support-20260328-1222"
]
}
],
"swebench-harness-invocation": [
{
"id": "DEBT-020",
"concern": "verify runs full instance evaluation via run_evaluation rather than targeting individual test ids.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
},
{
"id": "DEBT-023",
"concern": "read_prompt() has no caller in this repository yet, so fail_to_pass test ids won't reach megaplan prompts until a follow-up wires it in.",
"occurrence_count": 1,
"plan_ids": [
"fix-two-issues-with-swe-bench-20260329-1313"
]
}
],
"task-set-validation": [
{
"id": "DEBT-031",
"concern": "representative_sample was authored alongside swe-bench_lite code paths but the plan uses swe-bench_verified \u2014 no explicit check that all 20 ids exist in verified.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"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"
]
}
],
"verify-artifact-isolation": [
{
"id": "DEBT-021",
"concern": "multiple verify attempts may leave stale result artifacts that _check_resolved() picks up, causing false positives.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
},
{
"id": "DEBT-028",
"concern": "startup cleanup and restart idempotency are in tension \u2014 cleaning the run_id's artifacts on startup would delete reports that the restart logic wants to re-verify.",
"occurrence_count": 1,
"plan_ids": [
"add-a-polling-watch-mode-to-20260329-2355"
]
}
],
"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"
]
}
],
"workflow-enforcement": [
{
"id": "DEBT-025",
"concern": "handle_plan accepts both state_initialized and state_prepped, so a manual cli invocation could skip prep on heavy robustness.",
"occurrence_count": 2,
"plan_ids": [
"add-a-prep-phase-to-the-20260329-1410"
]
}
],
"workspace-cache-isolation": [
{
"id": "DEBT-029",
"concern": "per-iteration workspace dirs share a parent-level _repo_cache, so bare-repo clones are shared across iterations.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"workspace-lifecycle": [
{
"id": "DEBT-017",
"concern": "stale per-worker prediction dirs from crashed prior runs could be globbed into a subsequent run's combined_predictions.jsonl.",
"occurrence_count": 2,
"plan_ids": [
"add-parallel-worker-support-20260328-1222"
]
}
]
}
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:
- First, assess whether the plan targets the correct root cause. If the proposed fix already exists in the codebase, or if the plan contradicts evidence you find, flag this as CRITICAL — the plan needs a fundamentally different approach, not just adjustments.
- 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.
- If the task hints suggest a specific approach and the plan deviates, flag it. The issue author often knows the correct fix.
- If the plan limits scope to avoid breaking tests, flag as a potential under-fix.
- 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":"F1","concern":"Scoring backend: CRITICAL: the proposed Modal->local Docker fallback contradicts the repository's own Apple Silicon findings, so the fallback would send the exact non-Django repos you care about back onto a known-broken path.","category":"correctness","severity_hint":"likely-significant","evidence":"auto_improve/FINDINGS.md:34-35 and :76 say Docker scoring fails on Apple Silicon for matplotlib/pytest/requests/sphinx and that Modal or a Linux scorer is needed. evals/watch_scoring.py:26-33 already defaults watch scoring to Modal, and evals/watch_scoring.py:176-178 shows the non-Modal path is plain local Docker (--namespace \"\")."},{"id":"F2","concern":"Verify retries: increasing max_verify_attempts only in run_megaplan_loop() will not change the auto-improve pipeline, because the configured value still materializes as 2 before the loop is called.","category":"correctness","severity_hint":"likely-significant","evidence":"evals/config.py:51 keeps EvalConfig.max_verify_attempts = 2; auto_improve/base_config.json:18 also sets \"max_verify_attempts\": 2; auto_improve/run_experiment.py:31-40 builds each iteration config from that base config; and evals/run_evals.py:807-814 passes config.max_verify_attempts into run_megaplan_loop()."},{"id":"F3","concern":"Regression analysis: Step 8 asks compare_scores() to classify regressions as "with no change" vs "from change", but the current data flow only gives that function boolean resolved states and cannot support those labels reliably.","category":"correctness","severity_hint":"likely-significant","evidence":"auto_improve/utils.py:38-68 compares only _task_resolution_map() booleans from current vs previous scores; it does not ingest prompt diffs, failure-pattern metadata, or scorer error categories. The motivating example is not even reproducible from the current canonical scores: auto_improve/iterations/001/scores.json:58-62 and auto_improve/iterations/002/scores.json:59-63 both mark pylint-dev__pylint-4970 as unresolved/error, while auto_improve/iterations/001/analysis.md:5-16 manually lists it as passed."},{"id":"DEBT-031","concern":"Task set validation: Recurring debt: the rotation step broadens task selection beyond the fixed sample, but the plan does not define a dataset-backed source of truth or new override semantics for replacing auto_improve/tasks.json.","category":"completeness","severity_hint":"likely-significant","evidence":"auto_improve/run_experiment.py:25-40 always materializes evals_to_run from the fixed auto_improve/tasks.json; there is no existing "manual tasks.json override" branch. Any rotated IDs must still satisfy the configured Verified dataset, and evals/benchmarks/swe_bench.py:95-109 will hard-fail if configured IDs are not present in the loaded dataset."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
Multifaceted improvement plan for the megaplan+hermes SWE-bench pipeline based on 2 iterations of auto-improve data. Current rate: 63% (12/19). Goal: 90%+.
Root problems:
SCOPE DETECTION: Pipeline treats all tasks identically. 1-line fixes and 100-line features get same workflow. Prep should classify complexity and plan should scale accordingly.
NO VERIFICATION FEEDBACK LOOP: When tests fail during execute, no structured diagnose→fix→reverify cycle. Need execute→verify→diagnose→fix→verify loop.
SCORING INFRASTRUCTURE: Watch scorer should use Modal by default (done), need auto-retry, error capture, fallback.
PREP NOT CONNECTING DOTS: Prep lists files but doesn't synthesize into scope assessment. Should output: simple fix / multi-site fix / new feature / refactor.
REGRESSION FROM NONDETERMINISM: pylint-4970 passed iter 001, failed iter 002 with no relevant changes.
Current state: 63% (12/19) after 2 auto-improve iterations. The pipeline has 6 identified root problems spanning megaplan prompts (prep/plan/execute), pipeline infrastructure (scoring/verification), and the auto-improve process itself.
Key constraint: Megaplan prompts live in /Users/user_c042661f/Documents/megaplan/megaplan/prompts.py (separate repo, not readable from hermes-agent sandbox). Pipeline orchestration lives in /Users/user_c042661f/Documents/hermes-agent/evals/run_evals.py. Scoring lives in evals/watch_scoring.py. Auto-improve loop lives in auto_improve/.
Current verification loop (run_evals.py:596-658): Execute runs → checks _all_tasks_done() → runs verify_fn() → if failed, injects feedback via _inject_verify_feedback() → re-runs execute (max 2 verify attempts). The feedback injection is limited (just test output tail) and there's no structured diagnosis step between failure and retry.
Current scoring retry (watch_scoring.py:60-66): Tasks scoring None (transient failures) retry up to 2 attempts. No error categorization, no fallback strategy. Modal is the only viable backend (local Docker broken on Apple Silicon for non-Django repos per FINDINGS.md:34-35,76).
Current task selection (run_experiment.py:40,124-128): Always loads from fixed auto_improve/tasks.json. No rotation logic exists — any rotation is manual editing of that file.
Phase 1: Scope Classification in Prep (Root Problems #1, #4)
Step 1: Add scope classification output to prep prompt (megaplan/prompts.py)
Scope: Medium
Locate the prep prompt template in megaplan/prompts.py. The prep phase currently "lists files but doesn't synthesize into scope assessment" per findings.
Add to the prep prompt's output requirements a scope_assessment section that must include:
Classification: one of simple_fix (1-3 lines, single site), multi_site_fix (same change in multiple locations), new_feature (new function/class/method), refactor (structural change across files)
Estimated touch points: number of files and functions to modify
Add a prep instruction: "After grepping all usages, synthesize into a scope assessment. If you found NotImplementedError, the scope is likely new_feature or refactor, not simple_fix. If the same pattern appears in N locations, classify as multi_site_fix."
Step 2: Make plan prompt scale with scope classification (megaplan/prompts.py)
Scope: Medium
Modify the plan prompt to read the prep's scope_assessment and adjust planning depth:
simple_fix: "Produce a focused plan. Identify the exact line(s) to change. Do not over-engineer."
multi_site_fix: "Grep confirmed N sites need the same fix. Your plan MUST enumerate every site. Missing a site is the #1 failure mode."
new_feature / refactor: "This requires structural changes. Map the full dependency graph before proposing changes. Budget for test updates."
Add to plan prompt: "If prep classified as multi_site_fix, your plan MUST list every call site. After planning, grep again to verify you haven't missed any."
Phase 2: Verification Feedback Loop (Root Problem #2)
Step 3: Add structured diagnosis between verify failure and execute retry (evals/run_evals.py)
Scope: Medium — changes to run_megaplan_loop() around lines 606-643
Currently: When verify fails, _inject_verify_feedback() just passes the last 1500 chars of test output. The executor gets raw test output with no diagnosis.
Add a _diagnose_verify_failure() function that parses the verify result to extract:
Which specific tests failed (from verify_result.tests_run + output parsing)
Error type categorization: assertion_error, import_error, attribute_error, syntax_error, timeout
The failing assertion or traceback (extract from test_output)
Update_inject_verify_feedback() (run_evals.py:392-418) to include the structured diagnosis:
python
diagnosis = _diagnose_verify_failure(verify_result)
parts = [
"[verify failed]",
f"failing_tests: {diagnosis.failing_tests}",
f"error_type: {diagnosis.error_type}",
f"key_traceback: {diagnosis.traceback_summary}",
"Diagnose the root cause from the traceback before making changes.",
"Fix the implementation and do not modify test files.",
"verify_output_tail:",
output_tail,
]
Increase max_verify_attempts in all three locations (addresses F2):
evals/config.py:51 — change default from 2 to 3
auto_improve/base_config.json:18 — change from 2 to 3
Verify evals/run_evals.py:429 default matches (currently also 2, change to 3)
All three must be updated because run_experiment.py:31-40 materializes config from base_config.json, and run_evals.py:807-814 passes config.max_verify_attempts into run_megaplan_loop(). Changing only the function default would have no effect on auto-improve runs.
Step 4: Add execute prompt guidance for verify-retry cycles (megaplan/prompts.py)
Scope: Small
Add to the execute prompt: "If you receive a [verify failed] note, follow this procedure: (1) Read the failing test to understand what it expects. (2) Read the traceback to identify which line of YOUR code is wrong. (3) Fix the root cause, not the symptom. (4) Do NOT revert to the original code — your approach is likely right, just incomplete."
Phase 3: Scoring Infrastructure Hardening (Root Problem #3)
Step 5: Add retry categorization and Modal-only retry to watch scorer (evals/watch_scoring.py)
Scope: Medium — changes to watch_and_score() and _score_single_prediction()
Increase max retry attempts from 2 to 3 (watch_scoring.py:65: change attempts < 2 to attempts < 3).
Add error categorization to _score_single_prediction() return value:
All retries remain Modal-only. Local Docker is not a viable fallback on Apple Silicon for non-Django repos (FINDINGS.md:34-35,76 documents build failures for matplotlib, pytest, requests, sphinx). Instead, on Modal failure: retry with Modal (up to 3 attempts). If all 3 fail, mark as error with error_category so it's clearly an infra failure, not a pipeline failure. (Addresses F1 — no broken fallback path.)
Add structured error capture: store error_category in _watch_scores.json per task so analysis can distinguish infra failures from real failures (addresses iteration 001 finding: "3/8 failures were actually correct patches with scoring infra issues").
Step 6: Add scoring summary with error breakdown (evals/watch_scoring.py)
Scope: Small
Add to _refresh_scores_summary() an error_breakdown field:
Add to _format_stop_line() the error breakdown so it's visible in terminal output without opening the JSON.
Phase 4: Sphinx/Complex Repo Handling (Root Problem #6)
Step 7: Add large-codebase awareness to prep and plan prompts (megaplan/prompts.py)
Scope: Medium
Add to prep prompt: "For large codebases (>500 files), focus your investigation on the specific module mentioned in the issue. Map the module's internal structure before examining cross-module dependencies. If the repo has a plugin/extension architecture (like Sphinx), identify which extension point is involved."
Add to plan prompt: "If prep identified a plugin/extension architecture, your plan must account for: (1) the extension registration mechanism, (2) the extension's interaction with the core, (3) any merge/aggregation logic that combines extension outputs."
Add to prep prompt: "For repos with >20 files in the relevant module, output a brief module map showing the key classes and their relationships before listing individual files."
Phase 5: Regression Detection in Auto-Improve (Root Problem #5)
Step 8: Add regression surfacing to score comparison (auto_improve/loop.py, auto_improve/utils.py)
Scope: Small-Medium
Simplified approach (addresses F3): Drop the "with_no_change" vs "from_change" classification — compare_scores() only has boolean resolved states (auto_improve/utils.py:38-68) and cannot determine causality. Instead:
Enhancecompare_scores() to include error_category from scores when available:
If a regression's current status has error_category set (from Step 5), include it in the regression entry so the analyst can see "this regressed because of infra, not code"
Return regressions as objects instead of bare task IDs:
A regression with error_category set is likely infra nondeterminism; one without is likely a real regression. This uses data already in the scores (after Step 5) rather than requiring prompt diff analysis.
Updatescaffold_iteration_docs() (loop.py:49-111) to add a dedicated "## Regressions" section before "## Failed" in the auto-generated analysis.md, with infra vs real split:
code
## Regressions (2)
### Likely infra (1)
- pylint-dev__pylint-4970 — error_category: modal_sandbox
### Likely real (1)
- scikit-learn-12973 — investigate
Note on data integrity: The critique found that iterations/001/scores.json marks pylint-dev__pylint-4970 as resolved: false, status: error while FINDINGS.md calls it "passed." This is because the patch was correct (verified manually) but scoring failed (Modal/Docker). With error_category tagging from Step 5, this case would automatically surface as an infra regression rather than a real one.
Step 9: Add task rotation helper to run_experiment (auto_improve/run_experiment.py)
Scope: Small
Simplified approach (addresses DEBT-031): Don't auto-replace tasks.json — keep it as the single source of truth that's manually edited. Add a helper that suggests the rotation, which the operator applies.
Add a suggest_task_rotation() function in auto_improve/utils.py that takes prior iteration scores and a full task pool path, and prints a suggested tasks.json following the rotation strategy:
10 anchor tasks (resolved in latest iteration)
5 retry tasks (failed in latest iteration, not infra errors)
5 new tasks (randomly sampled from SWE-bench_Verified minus all previously attempted)
Validation: The function loads the SWE-bench_Verified dataset IDs (via evals/benchmarks/swe_bench.py) and validates all suggested IDs exist in the dataset before printing. This prevents the hard-fail at swe_bench.py:95-109 that DEBT-031 flagged.
Wire as a CLI subcommand: python -m auto_improve.utils suggest-rotation --iteration 2 prints the suggested JSON to stdout. The operator reviews and copies to tasks.json.
build_materialized_config() (run_experiment.py:31-41) remains unchanged — it always reads from tasks.json. No new override semantics needed.
Step 10: Strengthen execute prompt against under-scoping (megaplan/prompts.py)
Scope: Small
Add to execute prompt: "Before declaring done, grep for the pattern you just fixed. If the same bug pattern exists in other functions/methods in the same file or related files, fix ALL instances. Under-fixing is worse than over-fixing."
Add to execute prompt: "If the plan says multi_site_fix, count the sites you've fixed and compare to the plan's enumerated list. Do not finish until all sites are addressed."
Execution Order
Phase 1 (Steps 1-2): Scope classification — highest impact, addresses the root cause of under-scoping (3/5 failures in iter 001).
Phase 2 (Steps 3-4): Verify feedback loop — second highest impact, turns verify failures into actionable retries. Step 3.4 updates all three config locations for max_verify_attempts.
Phase 3 (Steps 5-6): Scoring infra — Modal-only retries with error categorization. No local Docker fallback.
Phase 5 (Steps 8-9): Auto-improve process — regression surfacing using error_category, manual task rotation with validation helper.
Validation Order
Smoke test: Run 3-5 tasks from the failure set (scikit-learn-12973, sphinx-8035, sympy-18199) with Phase 1+2 changes to verify scope classification works.
Regression check: Run the 10 anchor tasks to verify no regressions from prompt changes.
Full iteration: Run full 20-task iteration with all changes, compare to iter 001 baseline (67%).
Scoring validation: Verify error_category appears in _watch_scores.json for all scored tasks; confirm that tasks previously marked error now show a meaningful error_category.
Target: 14/19 (74%) on first iteration with changes, 17/19 (89%) after 2 iterations of tuning.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-30T13:20:15Z",
"hash": "sha256:4f36a24214b5eaf8cbd1e7356a0ceb58b4ccbeb1cd8c13a3cd284c7f426a14f5",
"changes_summary": "Addressed all 4 gate flags:\n\nF1 (Modal\u2192Docker fallback broken): Removed the local Docker fallback entirely from Step 5. All retries are Modal-only (3 attempts). Local Docker is documented as broken on Apple Silicon for non-Django repos. Tasks failing all 3 Modal attempts are marked as infra errors with error_category, not silently marked as failures. Removed "docker_build" from error categories since we're not using local Docker.\n\nF2 (max_verify_attempts config propagation): Step 3.4 now explicitly lists all three locations that must be updated: evals/config.py:51, auto_improve/base_config.json:18, and evals/run_evals.py:429. Added explanation of the config materialization chain (base_config.json \u2192 run_experiment.py:31-40 \u2192 config.max_verify_attempts \u2192 run_megaplan_loop()).\n\nF3 (Regression classification lacks data): Completely redesigned Step 8. Dropped the "with_no_change" vs "from_change" classification that required prompt diff analysis. Instead, regressions now carry error_category (from Step 5) \u2014 if a regression has an error_category, it's likely infra nondeterminism; if not, it's likely real. This uses data already in the scores. Added note about the pylint-4970 data integrity issue (scores.json says error, FINDINGS.md says passed \u2014 both are "correct" from different perspectives).\n\nDEBT-031 (Task rotation source of truth): Redesigned Step 9. Instead of auto-replacing tasks.json, added a suggest_task_rotation() helper that prints a suggested rotation to stdout. The operator reviews and manually updates tasks.json. build_materialized_config() remains unchanged \u2014 tasks.json stays the single source of truth. The helper validates all suggested IDs against the SWE-bench_Verified dataset to prevent the hard-fail at swe_bench.py:95-109.",
"flags_addressed": [
"F1",
"F2",
"F3",
"DEBT-031"
],
"questions": [
"Can I get read access to /Users/user_c042661f/Documents/megaplan/megaplan/prompts.py? I need to see the current prompt templates to write precise diffs rather than generic instructions.",
"For the verify feedback loop (Step 3): does VerifyResult.test_output include the full pytest output (with tracebacks), or just a summary? The diagnosis quality depends on having actual tracebacks.",
"The 90% target on 19 tasks means at most 1-2 failures allowed. The 3 sphinx tasks are currently 0/3. Is improving sphinx performance a hard requirement, or would 90% on the non-sphinx subset (16 tasks) be acceptable as an intermediate milestone?"
],
"success_criteria": [
"Scope classification: prep output includes scope_assessment with classification (simple_fix/multi_site_fix/new_feature/refactor) for every task",
"Plan scaling: plan prompt demonstrably produces different plan depths for simple_fix vs multi_site_fix tasks (verifiable by comparing plan artifacts)",
"Verify loop: verify failures produce structured diagnosis (error_type + failing_tests + traceback_summary) in the injected feedback, not just raw output tail",
"Verify config: max_verify_attempts is 3 in all three locations (evals/config.py:51, auto_improve/base_config.json:18, evals/run_evals.py:429 default)",
"Scoring reliability: error_category field present in _watch_scores.json for all scored tasks; all retries use Modal (no local Docker fallback)",
"Scoring summary: _watch_scores.json includes error_breakdown dict; terminal stop line shows error category counts",
"Regression surfacing: analysis.md auto-scaffold includes Regressions section with infra/real split based on error_category when regressions detected",
"Task rotation: suggest_task_rotation() CLI prints valid rotation with anchor/retry/new split, all IDs validated against SWE-bench_Verified dataset",
"Under-scoping reduction: on the 5 tasks that failed due to under_scoping in iter 001, at least 3 now pass (scikit-learn-12973, sphinx-8035, sympy-18199 are key targets)",
"Overall pass rate: \u226580% (16/20) on next full iteration, \u226590% within 2 iterations"
],
"assumptions": [
"Megaplan prompts in prompts.py are string templates that can be extended with additional sections/instructions without changing the megaplan harness code \u2014 the prep/plan/execute prompts are injected as-is into the LLM context.",
"The prep phase output is a JSON object that can be extended with new fields (scope_assessment) without breaking downstream phases \u2014 plan/critique/gate read prep output but tolerate extra fields.",
"The verify_fn in run_megaplan_loop produces VerifyResult with full pytest output in test_output (not truncated), making traceback extraction feasible.",
"Modal is the only viable scoring backend on Apple Silicon. Local Docker fails for non-Django repos. All scoring retries use Modal.",
"The pylint-4970 discrepancy between scores.json (error) and FINDINGS.md (passed) is because the patch was manually verified as correct but scoring infrastructure failed. This is an infra error, not a real regression.",
"Prompt changes are additive (appending instructions) rather than requiring structural refactoring of existing prompt templates.",
"The auto-improve task pool is larger than 20 tasks (SWE-bench_Verified has ~500), so task rotation with new unseen tasks is feasible.",
"tasks.json remains the manually-edited single source of truth for task selection. The rotation helper is advisory only."
],
"structure_warnings": [],
"delta_from_previous_percent": 25.83
}
code
Plan structure warnings from validator:
[]
Existing flags:
[
{
"id": "F1",
"concern": "Scoring backend: CRITICAL: the proposed Modal->local Docker fallback contradicts the repository's own Apple Silicon findings, so the fallback would send the exact non-Django repos you care about back onto a known-broken path.",
"status": "addressed",
"severity": "significant"
},
{
"id": "F2",
"concern": "Verify retries: increasing max_verify_attempts only in run_megaplan_loop() will not change the auto-improve pipeline, because the configured value still materializes as 2 before the loop is called.",
"status": "addressed",
"severity": "significant"
},
{
"id": "F3",
"concern": "Regression analysis: Step 8 asks compare_scores() to classify regressions as "with no change" vs "from change", but the current data flow only gives that function boolean resolved states and cannot support those labels reliably.",
"status": "addressed",
"severity": "significant"
},
{
"id": "DEBT-031",
"concern": "Task set validation: Recurring debt: the rotation step broadens task selection beyond the fixed sample, but the plan does not define a dataset-backed source of truth or new override semantics for replacing auto_improve/tasks.json.",
"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"
]
}
],
"execute-loop-control-flow": [
{
"id": "DEBT-022",
"concern": "the 'all tasks done but state stuck on finalized' break path at line 562 would skip verify if verify is inserted after the execute block.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
}
],
"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"
]
},
{
"id": "DEBT-026",
"concern": "manual megaplan research cli invocation can strand plans in state_researched with no workflow exit transition.",
"occurrence_count": 1,
"plan_ids": [
"three-changes-to-the-megaplan-20260329-1755"
]
}
],
"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"
]
}
],
"join-workflow": [
{
"id": "DEBT-019",
"concern": "the --join cli has no enforced source of truth for original run settings, so a mismatched config could attach wrong models/workspace layout to an existing manifest.",
"occurrence_count": 1,
"plan_ids": [
"two-goals-for-the-swe-bench-20260328-2006"
]
}
],
"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"
]
},
{
"id": "DEBT-024",
"concern": "the evals/ top-level package is outside the distributable module set and won't be included in wheel builds.",
"occurrence_count": 1,
"plan_ids": [
"fix-two-issues-with-swe-bench-20260329-1313"
]
}
],
"orchestrator-lifecycle": [
{
"id": "DEBT-018",
"concern": "the manifest.all_done() polling loop can hang indefinitely if a worker crashes and leaves tasks in 'claimed' state with no timeout or reclaim mechanism.",
"occurrence_count": 1,
"plan_ids": [
"two-goals-for-the-swe-bench-20260328-2006"
]
}
],
"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-backend": [
{
"id": "DEBT-027",
"concern": "watch scoring is docker-only; modal scoring is not supported.",
"occurrence_count": 1,
"plan_ids": [
"add-a-polling-watch-mode-to-20260329-2355"
]
}
],
"scoring-consolidation": [
{
"id": "DEBT-030",
"concern": "consolidate.py scans a global logs/run_evaluation/ path and could pick up stale reports from prior iterations running the same 20 instance ids.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"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"
]
}
],
"session-lifecycle": [
{
"id": "DEBT-016",
"concern": "_cleanup_hermes_sessions() hard-codes path.home() / '.hermes' / 'sessions', ignoring hermes_home. parallel workers may delete session files from the default location.",
"occurrence_count": 2,
"plan_ids": [
"add-parallel-worker-support-20260328-1222"
]
}
],
"swebench-harness-invocation": [
{
"id": "DEBT-020",
"concern": "verify runs full instance evaluation via run_evaluation rather than targeting individual test ids.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
},
{
"id": "DEBT-023",
"concern": "read_prompt() has no caller in this repository yet, so fail_to_pass test ids won't reach megaplan prompts until a follow-up wires it in.",
"occurrence_count": 1,
"plan_ids": [
"fix-two-issues-with-swe-bench-20260329-1313"
]
}
],
"task-set-validation": [
{
"id": "DEBT-031",
"concern": "representative_sample was authored alongside swe-bench_lite code paths but the plan uses swe-bench_verified \u2014 no explicit check that all 20 ids exist in verified.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"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"
]
}
],
"verify-artifact-isolation": [
{
"id": "DEBT-021",
"concern": "multiple verify attempts may leave stale result artifacts that _check_resolved() picks up, causing false positives.",
"occurrence_count": 1,
"plan_ids": [
"add-a-verify-step-to-the-20260328-2253"
]
},
{
"id": "DEBT-028",
"concern": "startup cleanup and restart idempotency are in tension \u2014 cleaning the run_id's artifacts on startup would delete reports that the restart logic wants to re-verify.",
"occurrence_count": 1,
"plan_ids": [
"add-a-polling-watch-mode-to-20260329-2355"
]
}
],
"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"
]
}
],
"workflow-enforcement": [
{
"id": "DEBT-025",
"concern": "handle_plan accepts both state_initialized and state_prepped, so a manual cli invocation could skip prep on heavy robustness.",
"occurrence_count": 2,
"plan_ids": [
"add-a-prep-phase-to-the-20260329-1410"
]
}
],
"workspace-cache-isolation": [
{
"id": "DEBT-029",
"concern": "per-iteration workspace dirs share a parent-level _repo_cache, so bare-repo clones are shared across iterations.",
"occurrence_count": 1,
"plan_ids": [
"build-an-auto-improve-loop-20260330-0024"
]
}
],
"workspace-lifecycle": [
{
"id": "DEBT-017",
"concern": "stale per-worker prediction dirs from crashed prior runs could be globbed into a subsequent run's combined_predictions.jsonl.",
"occurrence_count": 2,
"plan_ids": [
"add-parallel-worker-support-20260328-1222"
]
}
]
}
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:
- First, assess whether the plan targets the correct root cause. If the proposed fix already exists in the codebase, or if the plan contradicts evidence you find, flag this as CRITICAL — the plan needs a fundamentally different approach, not just adjustments.
- 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.
- If the task hints suggest a specific approach and the plan deviates, flag it. The issue author often knows the correct fix.
- If the plan limits scope to avoid breaking tests, flag as a potential under-fix.
- 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`.