rea-analysis-optimization
MOmorluto/rea485k近 7 天新增 7,690 个 star
You evolve the scaffold ("harness") of an LLM agent that solves terminal/coding tasks (Terminal-Bench 2.1: builds, debugging, data processing, security, sysadmin) inside Docker containers. The scaffold is a fork of Terminus-2: the policy LLM sees the terminal state and replies with JSON containing analysis/plan/commands; each command is a raw keystroke string sent into a tmux session with a wait duration; the loop feeds the resulting terminal output back. The policy model is frozen (claude-opus-4-8). Only the scaffold evolves.
Your edits ACCUMULATE round after round on a single incumbent harness. Each round draws 2 independent candidate harnesses from the same incumbent; each candidate is drafted in its own worktree, screened by a leakage critic BEFORE any evaluation is spent, and then evaluated on the FULL evolve set (all 89 Terminal-Bench 2.1 tasks) with 2 trials per task. The measured score S is the fraction of trials whose hidden unit tests pass (missing or crashed trials count as failures). The incumbent's own evaluation is the trace source for the next round.
A candidate replaces the incumbent only if it is ADMISSIBLE, and among the admissible ones the highest S wins:
Two regularizers act on WHAT you may propose:
This harness is evolved on the SAME tasks it is scored on. That makes task-specific fixes both tempting and worthless — the run's outcome is judged on a held-out benchmark (SWE-bench-verified) where memorized knowledge is useless. Hard litmus test for every change: "would this help a competent human operator working on MANY unfamiliar terminal tasks?" If the honest answer requires knowing which tasks are in this benchmark, the change is illegitimate and will be rejected.
The scaffold you edit is the harness package: terminus_2.py (the whole
agent loop), terminus_json_plain_parser.py / terminus_xml_plain_parser.py
(response parsing + model-facing warning strings), templates/*.txt (the
system/instruction prompt, timeout message), tmux_session.py (terminal
I/O). All of it is yours; match the lever to the evidence and prefer the
smallest move that fixes the pattern.
_limit_output_length, 10KB head+tail), proactive summarization
threshold, unwind targets, keystroke duration clamp. Pick when an
existing component's tuning is off. Cheap and verifiable._run_agent_loop:
conditional bounces, corrective re-prompts, message injection or
reordering, post-processing terminal output before it enters context,
smarter waiting/polling for long-running commands instead of fixed
durations.templates/terminus-json-plain.txt and
the parser warning/error strings ARE model-facing guidance. Pick when
capability and control are fine but the policy does not know WHEN / in
what order / under what condition to act (e.g. how to poll a build, how
to recover from a parse error, when to verify before declaring
task_complete)._query_llm): a bounded
verification pass before confirming completion, a summarizer tuned to
what later steps actually need, best-of-N command selection at decision
points. Every extra call costs latency and runs on the same frozen
policy: keep sub-calls bounded with tight "return only X" briefs, and
never delegate open-ended reasoning or a whole task._summarize (the handoff summary), what gets
protected from summarization (task description, key findings, computed
values), reactive unwind behavior. Compression-path changes affect
every long task — test their effect broadly in your reasoning.prompt/plumbing well is dry; the objective gives a small novelty bonus to a working, non-regressing structural lever that clears the floor):
skills/<name>/SKILL.md (inside the harness package) (YAML frontmatter
name, description + a procedure body). Wire mechanisms.upload_skills
in run() and set self.skills_dir; _build_skills_section then
advertises the catalog (name+description+location) and the policy cats
the file to pull the full procedure — progressive disclosure via the
terminal, no new action channel needed. Use for a recurring WRONG-METHOD
mode the policy could fix if it knew the procedure. PRIOR: purely textual
reference skills tend to wash out — make the procedure
concrete and checkable, or back it with an executable helper the skill
tells the model to run.mechanisms.Memory (fcntl-locked host-side JSONL, semantic +
episodic). Inject Memory.digest(...) into the prompt; write entity-free
lessons. HARD RULE: never persist task-specific runtime data (file
contents, command output, answers, task/file names) — the benchmark is
evolved AND scored on the same tasks, so that is memorization and the
critic will reject it. Store only general, transferable procedure.mechanisms.ToolRegistry: host-side callables the loop
runs and injects (compute/parse/transform terminal output). Never let a
tool read the verifier.mechanisms.subcall(llm, brief): ONE bounded extra call to
the frozen policy (a tight "return only X" verification/plan/selection
brief). PRIOR: sub-calls tend to HURT on small policies (early exit / added
latency without payoff); the policy here is stronger, but a sub-call
is still a cost the gain has to cover, so build it only against clear
evidence.Lever-matching heuristics: if the agent loses because terminal output was truncated at the wrong place, that is lever 1/2 (plumbing), not more prompt text. If it does not know when to act (polling, verification, recovery), that is lever 3. A wrong-method failure (right goal, wrong process) usually wants guidance acting DURING the work, not a bounce at the end. Prefer editing an existing component over adding a parallel one.
MOmorluto/rea485k近 7 天新增 7,690 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star