Skip to content

hylo.codeagents.harness_evolution

Package: hylo-code-agents · Core contracts

harness_evolution

Optional phase-guided program evolution, independently implemented from a design study.

Plan observable phases -> develop and repair solve(robot) -> seal evidence-linked repair notes -> return a code candidate to Hylo's existing gate. No upstream HarnessPAI code is included, no weight training is performed, and development success never activates code.

PLAN module-attribute

PLAN = 'Plan observable phases for a robot control program. Return JSON only:\n{"phases": [{"name": "...", "goal": "...", "completion": "...", "fallback": "...", "step_budget": 100}]}.\nUse 1-12 phases. Completion checks must use deployment observations or public tool results,\nnever hidden simulator state, task IDs or evaluator success. Propose bounded handovers and\nfallbacks. Use a frozen action-model tool only if the supplied toolkit actually provides\none; otherwise use its available control tools. Retrieved repairs are hypotheses with\nlimited provenance, not universal instructions. Do not infer phase competence from a\nwhole-task score. This is a plan for code generation, not an executable state machine.'

DISTILL module-attribute

DISTILL = 'Summarize reusable repairs from the supplied development submissions and the\nselected program. Return JSON only: {"repairs": [{"phase": "a supplied phase name",\n"trigger": "observable failure pattern", "repair": "what changed and why it may help",\n"limitation": "where it may not apply", "failure_refs": ["submission-1/case-0"],\n"success_refs": ["submission-2/case-0"]}]}.\nUse at most 8 notes, or an empty list when no repair is supported. Each note must cite a\nfailed case and a successful replay of that same case in the selected program. Cite only\nprovided evidence IDs. Do not claim cross-task transfer or independent phase validation.\nDo not include executable code or hard-coded simulator coordinates in the repair text.'

HarnessEvolutionProposer

HarnessEvolutionProposer(model='ollama:qwen3.5:35b-a3b', *, dev: int = 6, budget=None, out_root='runs/harness-evolution', repair_campaigns=(), tools=None, family=None, program_params=None, reply_tokens: int = 2048, block_timeout_s: float = 60, program_timeout_s: float = 300)

A selectable strategy, distinct from the existing research.llm proposer.

budget.turns includes planning and optional distillation calls. Session submissions, resets and total model token/cost budgets remain bounded. Token/cost limits are checked between calls, as in ResearchSession; one model call can exceed the remaining estimate.

model instance-attribute

model = build_chat(model)

budget instance-attribute

budget = Budget.parse(budget) if budget is not None else Budget(turns=40, submits=6, resets=12)

config instance-attribute

config = ResearchConfig(dev=dev, tools=tools, family=family, program_params=dict(program_params or {}), reply_tokens=reply_tokens, block_timeout_s=block_timeout_s, program_timeout_s=program_timeout_s)

memory instance-attribute

memory = PhaseRepairMemory(repair_campaigns)

name instance-attribute

name = f'harness.program[{self.model.name}]@0.1'

last instance-attribute

last = {}

propose

propose(diagnosis, cfg, parent_id, archive)