Skip to content

How coach and improve prove a change

An agent that proposes a change to an agent or a pipeline can be wrong, and it can word its case persuasively. So neither coach nor improve asks a person to take the agent’s word. Code checks the evidence, and replays of real past work show whether the change helps. Only a change that passes both reaches the shepherd, who makes the final call. This page explains each check. Review a proposal covers what you do with one.

The agent that studies the record reports findings. Each finding quotes the exact words of one step of one session, between 12 and 300 characters, and names the session and the step. The runner keeps a finding only when the quote appears in that step’s stored text. A finding it cannot find is dropped. A change that rests on no kept finding is refused, so the shepherd is never asked about it.

A finding has a kind. gap is a correction a person made that no rule covers. ignored and harm are a rule the agent did not follow, and a rule that made it do the wrong thing. followed is a rule that worked. Findings count only from the last 90 days.

coach reads an agent’s sessions that no one has read, that have been quiet for 30 minutes, and that the whole team can see. It skips replays and the sessions of pipelines that learn, so its own work never counts as evidence. A cheap model reads at most 8 sessions per run, up to 150 steps from each, and reports findings.

The runner counts each correction across sessions and people, and routes it before any text is written. A correction goes to the first of these that fits.

  1. A person’s profile, when every finding behind it comes from that one person.
  2. A check, when most of the findings say that a lint rule, type or check could catch the mistake.
  3. A skill, when most of the findings name one kind of task the correction applies to.
  4. The agent’s instructions, in every other case.

A correction is ready only when it appears in at least 2 sessions.

The writer then proposes up to 5 hunks, and the runner refuses any hunk that breaks a rule for changes.

  • A hunk cites findings, and each finding must be live evidence about the agent.
  • Adding or changing a rule rests on at least 2 occasions. Deleting a rule needs 2 findings of harm about that rule.
  • A hunk rests on one correction, and goes where the runner routed that correction.
  • A hunk must apply to the instructions as they are now.
  • The text the agent always loads, its instructions plus every skill description, stays under 5,000 tokens. When it is already over, a change may not grow it. The runner counts 4 characters to a token.
  • A hunk the team turned down is refused again, until more occasions back it than backed the first.

The runner replays the turn before each correction twice, once with the agent as it is and once with the change. It adds up to 2 unrelated turns, where nobody corrected the agent, to catch a change that helps one case and hurts another. The replay set is at most 4 turns behind corrections and 2 unrelated turns, as many as the run’s remaining spend allows. Each replayed turn may spend $0.50 and take 15 minutes.

A judge reads every reply without knowing which version wrote it. For a turn behind a correction it says fixed or still. For an unrelated turn it says ok or worse. The change wins only when all of these hold.

  • Fewer turns behind corrections still need the correction with the change than without it.
  • No more unrelated turns get worse.
  • The judge ruled on every reply, since a change with an unjudged reply is not shown to win. A reply that never came counts against its version.

A change that does not win ends the run, and nobody is asked.

improve studies a pipeline’s recent runs and changes its file once. The change must touch exactly one pipeline file, and it needs kept findings behind it. The runner then replays the pipeline’s latest finished runs, 3 unless AGENTS_REPLAYS says otherwise, at the commits they started from. Each replay runs once with the changed file and once with the current version. Replays never open pull requests or wait on people.

The runner compares the two versions on four measures, in this order. The first difference decides.

  1. Which version finished more replays.
  2. Which had fewer reminders and hand-offs.
  3. Which ran fewer stages.
  4. Whether the change cost at least a tenth less.

Only a change that scores better opens a pull request. The pull request carries both scores and the checked quotes.

A coach change made only of check hunks writes no instruction, skill or profile text. It skips the replays and reaches the shepherd unscored, and its proposal shows no score table.

The shepherd sees the summary, both scores, the diff and the quotes behind each hunk. For a coach proposal, the shepherd keeps or turns down each hunk. For an improve proposal, the shepherd decides on the whole change. Every decision is recorded with who made it and why, and a turned-down hunk is remembered. A proposal that waits when its run ends is marked turned down, or could not be scored if its replays had not finished.