From 0140ff1c79dddba9a4dc7735b25e716fe18f0a85 Mon Sep 17 00:00:00 2001 From: Subrahmanya Pavankumar Dubagunta Date: Thu, 4 Jun 2026 16:17:00 +0000 Subject: [PATCH 1/4] fix(preprocess_v3): synthesize single-metric harness for flag-less/composite Path-A tasks (#258) A flag-less Path-A test command (no GEAK mode flag) was copied byte-identically into all four COMMANDMENT modes, silently. The correctness preflight then ran the harness's full default sweep until it timed out, producing 0% kernel gain. Two cooperating defects: the orchestrator prompt trained the LLM to mark all four modes covered, and _substitute_mode_flag silently no-ops on a flag-less command, so the renderer loop emitted no warning. Fix: - tools.py: add a deterministic flag-less backstop in commandment_from_user_command. When the command exposes no mode flag, is not a compound && shell contract, and yields no harness, refuse to render the all-modes-identical COMMANDMENT and return ok:False / PATH_A_FLAG_MISSING. This guard is independent of the modes_covered the LLM passes. - orchestrator.py: split Case A into A1 (flag-aware -> today's happy path) and A2 (flag-less/composite -> route into harness synthesis). A2 routes on whether the prompt carries shapes: with shapes, skip discovery and dispatch harness-generator with prompt shapes only; without shapes, fall through to discovery as Case C. Wire the PATH_A_FLAG_MISSING -> switch-to-A2 recovery and remove the all-four modes_covered example from the generic Case A default. - tests: cover the deterministic backstop (no silent duplicates even with all four modes covered) and the A1 happy path (detector does not mis-fire). Validated against the real k006 prompt on an AMD gfx942 GPU: the preprocessor now emits four distinct modes backed by a synthesized single-shape (983040x128 bf16), single-metric harness; correctness passes in ~66s instead of timing out at 600s. Co-Authored-By: Claude Opus 4 --- .../run/preprocess_v3/orchestrator.py | 22 ++++++-- src/minisweagent/run/preprocess_v3/tools.py | 31 +++++++++++ tests/run/test_preprocess_v3_bugfixes.py | 55 +++++++++++++++++++ 3 files changed, 104 insertions(+), 4 deletions(-) diff --git a/src/minisweagent/run/preprocess_v3/orchestrator.py b/src/minisweagent/run/preprocess_v3/orchestrator.py index 7abe40825..3eb3ad4e4 100644 --- a/src/minisweagent/run/preprocess_v3/orchestrator.py +++ b/src/minisweagent/run/preprocess_v3/orchestrator.py @@ -117,13 +117,20 @@ class LimitsExceeded(TerminatingException): **Case A — user provided explicit run instructions / commands.** Indicators: a literal command-line invocation (``python