Repository navigation
Description
Background
The GLM 5.2 MIPS Terminal-Bench comparison between the official Harbor OpenCode run and the Maka Harbor run suggests a harness and run-loop gap worth addressing upstream.
Both runs used the same model family and neither run should be treated as proof that one product or model is categorically better. The important signal is narrower: OpenCode made the model behave more like a persistent software engineer on a heavy implementation task. It performed an initial inventory, inspected source and binary artifacts, kept a structured todo list, made many targeted edits, ran repeated local checks, repaired failures from tool observations, and produced a final evidence summary.
Maka already has the core substrate for this kind of work: headless benchmark execution, container tools, runtime telemetry, autonomous retries, self-check hooks, and task-run export. In the captured path, however, the policy is split across the generic headless prompt, Harbor prompt, smoke bridge prompt, autonomous retry wrapper, self-check hook, and task-run classifier. The model-facing tool surface is also simpler than OpenCode's for long implementation work.
The proposed change is to add a reusable, configuration-gated "heavy-task mode" for benchmark runs. The goal is not to copy hidden benchmark details. The goal is to encode the public, auditable engineering loop that helped OpenCode: inventory first, structured todos, hypothesis/patch/check/repair cycles, public semantic self-checks, compact tool evidence, and finish classification that distinguishes semantic progress from transport/runtime incompleteness.
Evidence from the OpenCode vs Maka run
The OpenCode trace for terminal-bench/make-mips-interpreter was an official Harbor run using zhipuai-coding-plan/glm-5.2. It produced 124 trajectory steps and 122 tool uses before a final stop. The behavior was not a single magic prompt or hidden-test shortcut; it was a long tool-driven loop.
The strongest evidence against verifier leakage in the OpenCode run is that the agent-visible launcher prompt in trial.log and the first user message in trajectory.json mention only public task facts: /app/doomgeneric_mips, doomgeneric/, vm.js, rendered frames, boot correctness, and first-frame creation. They do not mention /tests, reference.jpg, image-similarity thresholds, pytest details, scorer constants, or hidden verifier assertions.
The remaining official failure also argues against full verifier awareness. OpenCode locally created a plausible frame artifact and the official verifier's frame existence and image-similarity tests passed, but test_vm_execution still failed because the captured stdout did not include the expected I_InitGraphics line before the verifier terminated the process. That stdout timing/order requirement was not reproduced by the agent's local checks.
OpenCode behaviors that Maka currently lacks or under-specifies:
- Initial inventory before implementation: OpenCode listed
/app, inspected Doom source files, checked available commands, and characterized the MIPS ELF before writingvm.js. - Persistent run loop after tool calls: OpenCode continued through many
tool-callsfinishes until no pending tool work remained. Maka's captured run ended with rawtool-callsmapped toincomplete_tool_calls. - Structured todo state: OpenCode used
todowritefor ELF loading, MIPS core, syscalls, frame capture, and verification. Maka's main benchmark tool surface has no comparable model-facing todo/plan primitive. - Targeted repair loops: OpenCode used command failures, timeout output, objdump, Python parsers, and BMP metadata checks to form hypotheses and patch specific defects such as unsigned
divu, WAD read position tracking, and BMP header details. - Compact evidence from tools: OpenCode's shell/read/edit/write results exposed exit status, truncation, diffs, and artifact facts that supported iteration.
- Finalization after useful work: Maka's captured run produced a self-check frame artifact of size
1024054bytes in about5795 ms, but exported terminal status remained incomplete because the attempt had already been classified asagent_incomplete.
Proposed benchmark policy and run-loop changes
Add a reusable heavy-task benchmark mode under the headless/runtime benchmark path. It should be configurable by task metadata, instruction heuristics, or runtime signals such as step-budget pressure, timeout, semantic self-check failure, or tool-calls/max-step incompleteness with meaningful workspace changes.
When enabled, heavy-task mode should prepend a central policy block to the benchmark system prompt and expose the same state to the run controller. The policy should require:
- Initial inventory before broad writes: public task goal, relevant source/artifact map, candidate execution commands, known constraints, unknowns, and initial todo list.
- Structured todo state with
pending,in_progress,completed,blocked, andcancelledstatuses, plus short evidence notes for completed or blocked items. - A loop state machine:
inventory -> hypothesize -> patch -> targeted_check -> repair -> semantic_self_check -> finish_or_continue. - Hypothesis and check records that link the suspected defect, patch scope, command or parser used to test it, exit code, timeout status, important output excerpts, produced artifacts, and interpretation.
- Public, task-derived semantic self-checks. Existence alone should not be enough for artifact tasks; checks should inspect publicly implied semantics such as format validity, dimensions, startup output, documented examples, or other workspace-observable behavior.
- Continuation prompts that include compact state: current phase, todos, last hypothesis, last patch summary, last targeted check result, last semantic self-check result, recent failure evidence, and remaining budgets.
- Tool descriptions for heavy mode that encourage bounded Bash with timeouts and compact output, line-bounded reads, narrow edits, and full writes only when creating a new file or intentionally replacing one.
- Tool telemetry that exposes compact evidence to the model and task-run export: exit code, timeout, truncation reference, diff summary, artifact metadata, and a stable check id.
Run-loop and classification changes:
- Do not flatten every
tool-calls, max-step, or timeout ending into an indistinguishable incomplete result when a public semantic self-check passed. - If semantic self-check passes after a runtime-incomplete ending, allow a short finalization turn with no broad edits, or export a dual status such as "semantically complete with runtime incomplete".
- Make stop conditions stronger than "artifact exists": required artifact/source change exists, main public command reaches a successful or expected condition, semantic self-check passes, required todos are resolved or explicitly nonblocking with evidence, and final output includes compact evidence and residual risks.
- Keep the policy reusable. It should not contain MIPS, Doom, frame filename, stdout timing, hidden-threshold, or official-verifier constants.
Suggested implementation slices:
- Add a configuration-gated heavy-task prompt policy in
packages/headlessand wire it throughConfig.systemPrompt/ Harbor prompt construction. - Add
todo_updateandinventory_submittools or equivalent structured benchmark events. - Add
hypothesis_submitandcheck_record, or one structuredprogress_updatetool that can represent both. - Standardize the semantic self-check schema across
runAutonomousTask, Harbor bridge, and task-run export. - Separate runtime transport completeness from semantic task completeness in classification and export.
- Compact
Bash,Edit,Write, and artifact telemetry for continuation prompts. - Add policy tests plus a synthetic heavy-task fixture that requires inventory, at least one failed targeted check, a repair patch, a passing public semantic self-check, and a final finish submission.
Acceptance criteria
- Heavy-task mode is configurable and can be triggered by task metadata, instruction heuristics, or runtime failure signals.
- A heavy-task run records an initial inventory before broad source/artifact writes.
- Main-loop todo state exists as structured data, is model-visible, and is exported in task-run telemetry.
- The run can represent
hypothesis -> patch -> targeted_check -> repairwith structured evidence rather than only prose. - Semantic self-checks use a schema that records public rationale, command evidence, artifact evidence, and forbidden-source guard status.
- Semantic self-checks explicitly forbid
/tests,reference.jpg, hidden thresholds, scorer-specific constants, pytest assertions, and official verifier artifacts. - Stop conditions require semantic evidence, execution/artifact validation, and resolved or explicitly nonblocking required todos rather than mere file existence.
- Runtime
tool-calls, max-step, or timeout endings with passing semantic self-checks are not exported only as indistinguishableagent_incomplete; the controller either grants a finalization turn or exports an explicit dual status. - Tool outputs shown to the model and stored in telemetry include compact evidence: exit codes, timeouts, truncation refs, diff summaries, artifact metadata, and linked check ids.
- The implementation is reusable and contains no MIPS-specific, Doom-specific, frame-name-specific, stdout-timing, hidden-threshold, or official-verifier constants.
- Tests cover trigger selection, required inventory gating, todo persistence, self-check forbidden-input validation, finalization-turn behavior, and task-run classification.
- A synthetic heavy-task benchmark trace demonstrates inventory first, todo updates, a failed targeted check, a repair patch, a passing public semantic self-check, and a final finish submission carrying compact evidence.
Non-goals
- Do not expose hidden tests, hidden reference images, official reference artifacts, image-similarity thresholds, pytest assertions, scorer constants, or verifier timing/order details to the model.
- Do not add task-specific MIPS, Doom,
frame.bmp, stdout timing, or Harbor-official-verifier shortcuts to the policy. - Do not claim the OpenCode run passed the official benchmark; it had reward
0.0and failed the stdout execution test. - Do not claim verifier leakage caused OpenCode's behavior. The available evidence supports harness/tool/run-loop effects plus model/task reasoning, not hidden verifier access.
- Do not replace official benchmark scoring with self-checks. Self-checks should provide public semantic evidence for steering, classification, and finalization, while official scoring remains separate.
- Do not require a model-provider change for the first implementation. The policy should land incrementally in the benchmark/headless/runtime stack.
Activity
likun666661 commentedon Jun 23, 2026
This is a plan-only proposal for issue #102. Later PRs should implement it in slices; this comment intentionally does not include patches.
Scope
Add a reusable, configuration-gated heavy-task benchmark mode for Maka's headless/runtime benchmark path. The goal is to make long-running benchmark agents behave more like persistent engineers: inventory public files first, keep structured todos, record hypothesis/check/repair progress, run public semantic self-checks, preserve compact evidence, and avoid treating semantically useful work as only an undifferentiated runtime incomplete result.
The guardrail is equally important: model-visible policy must not include benchmark-private inputs, evaluator-only materials, suite-private assertions, or task-specific shortcut constants in prompts, self-check policy, fixtures, or desired product behavior.
P0: smallest useful foundation
Goals:
agent_incomplete.Non-goals:
Module boundaries:
Tests and acceptance:
Main risks:
P1: richer engineering loop and compact evidence
Goals:
Non-goals:
Module boundaries:
Tests and acceptance:
Main risks:
P2: fixtures, telemetry polish, and broader rollout
Goals:
Non-goals:
Module boundaries:
Tests and acceptance:
Main risks:
Overall acceptance signals
somewan820 commentedon Jun 23, 2026
Is anyone working on this issue? I'd like to give it a try.