hylo.codeagents.roles¶
Package: hylo-code-agents · Core contracts
roles ¶
Role campaigns (RFC-0008 part 9): a coordinator works through a set of tasks with worker and verifier roles over a tool surface, keeps a ledger of every tool call, and admits skills only after an independent replay.
hylo roles run CAMPAIGN.yaml [--model ollama:qwen3.5:35b-a3b] [--out runs/roles/NAME]
hylo roles status OUT
A campaign file lists tasks, each a stage (a hylo.stage/v0.1 file the task starts from), a request for the worker, a goal (a check predicate) and a partition:
dev pending -> working -> verifying -> done a worker session works until its check holds
\-> retrying -> blocked one retry, with the failure reasons and matching skills
after a dev task is done, its worker's successful tool calls become a proposed skill (a recipe) with the
failure signature the task started with; a verifier (no model) replays the recipe on a fresh copy of the
task and checks the goal, at most twice; only a passing replay promotes the skill into the library
heldout pending -> heldout -> done | failed evaluated last, with the library frozen; never used to
propose or verify skills, and never shown to a dev worker
Rules: every task runs on its own copy of its stage (the campaign's stage root), so tasks never see each other's
changes; every tool call goes into ledger/<task>/<run>.jsonl (tool, argument digest, ok, error code, receipt
status) and counts against the task's budget (max_tool_calls; the call that crosses it fails with
campaign_budget_exceeded); the coordinator takes the pending dev task with the fewest goal atoms first.
Progress is written to status.json after every transition.
TRANSITIONS
module-attribute
¶
TRANSITIONS = {'pending': {'working', 'heldout'}, 'working': {'verifying', 'retrying', 'blocked'}, 'retrying': {'verifying', 'blocked'}, 'verifying': {'done', 'blocked'}, 'heldout': {'done', 'failed'}, 'done': set(), 'blocked': set(), 'failed': set()}
Ledger ¶
RoleCampaign ¶
RoleCampaign(spec: Mapping[str, Any], out: str | Path, model: ChatModel | None, surface_factory: Callable[[str, str], Surface] | None = None)
factory
instance-attribute
¶
factory = surface_factory or (lambda root, stage: registry.build('surfaces', {'type': self.surface_name, 'params': {'root': root, 'stage': stage}}))
tasks
instance-attribute
¶
tasks = {t['id']: {**t, 'state': 'pending', 'runs': [], 'partition': t.get('partition', 'dev')} for t in spec['tasks']}
fresh ¶
A new copy of the task's stage (its own stage name) and a surface on it.
verifier ¶
Replay the recipe on fresh copies of a dev task (no model) and check the goal.
recipe_from ¶
The successful acting calls of a run, in order, without generation-bound fields (they are re-read on replay).
replay ¶
Run a recipe: stage edits against the current revision, actions against the current generation.
main ¶
role campaigns: worker and verifier sessions over dev and held-out tasks, skills by replay