# RSI: autonomous harness improvement

This guide follows the [**RSI loop for autonomous harness improvement**](https://palagents.dev/technical-boss1.html?lang=en#harness-loop). It rewrites the agent’s prompts, action menu, fight code and boss cards, then tests those changes in play. The model weights stay fixed. The [RSI loop for online decision model fine-tuning](https://palagents.dev/technical-boss1.html?lang=en#finetuning-loop) uses fight records to train and evaluate candidate model weights.

This walks through the harness-improvement loop from the detailed design in [the technical report](https://palagents.dev/technical-boss1.html?lang=en#harness), one step per figure. The strip under each figure's title shows where that step sits in the loop. ★ marks our contributions.

## The whole loop

![How RSI learns, step by step](img/design-overview.svg)

## ② Observe: watch closely when it matters

![Observer windows over the agent's trajectory](img/design-observer.svg)

- The **trajectory** is everything the agent does, second by second. The observer reads it in **10-second windows**.
- A window with nothing new is skipped. After a hit, windows shrink to 5 seconds for the next 30 seconds.

## ③ Event scheduler ★: fix patterns, not accidents

![Event scheduler: reports to case files](img/design-incidents.svg)

- Repeats of the same problem become **one case file**, so memory stays small however long the task runs.
- A case reaches the fixer only after it has happened in **2+ fights**; the worst cases go first.

## ④ Improve: hard cases climb to the round reviewer

![Escalation to the round reviewer](img/design-escalation.svg)

- The fixer handles one case at a time. After **2 failed fixes**, the case goes to the round reviewer, who sees the **whole round**.
- **Landing slots** cap new live changes at **4 per round**: 1 quick fix, up to 2 strategy changes and 1 from the reviewer. With few changes at once, the judge can tell which one helped. If no slot is free, the fixer isn't called at all.

## ⑤ Noise removal + locked judge ★: luck can't decide

![Judge compares several fights with and without the change](img/design-judge.svg)

- **Top half:** with one fight each, a lucky win without the change and an unlucky loss with it make a good change look bad, so it gets undone.
- **Bottom half:** our judge plays several fights each way and compares the averages, so luck evens out.
- The judge and its thresholds are locked: the system can't make its own exam easier.

## Skills that carry over: one action pool, one card per boss

![One shared action pool, one tuning card per boss](img/design-actions.svg)

- Every boss fight uses the **same pool of actions**. When RSI learns a new action, it joins the pool and is ready for every later boss; it is never rewritten per boss.
- What differs per boss is only a small **boss card**: distances, which Pals to send first, when to offer an action. Each setting keeps the evidence behind it and how to undo it.
- **Reuse in practice:** boss 2 used 6 existing actions and added 1 (*best Pal*); boss 3 used 7 existing actions, including *best Pal* from boss 2, and added 2 (*brace*, *roll free*).

## What's new in our RSI harness improvement

![What's new in our RSI harness improvement](img/design-contributions.svg)

## What changed in the numbers

![Old vs new design](img/design-results.svg)

We compared the boss sessions run before the design changes (Oct 24–29) with those after (Nov 4–9). The "fixer" is the most expensive model in the loop, so the fewer wasted fixer calls, the lower the cost.

- **Tokens per 30 minutes:** the fixer and reviewer used about 3.9M tokens per 30 minutes of play in the old design, and 0.9M in the new one. The busiest 30 minutes fell from 56M to 14M tokens, and the cost guard that had to pause RSI twice never fired again.
- **Fixer time per kept change:** the fixer worked about 0.45 hours (27 min) for every change the judge kept; now it is 0.25 hours (15 min), about 45% less.
- **"Nothing to fix" answers:** over half of the old fixer calls looked at a problem and found nothing to change. Now it is a third, because one-off accidents no longer reach the fixer.

| Boss 3, whole run | |
|---|---|
| Problems reported → case files → sent to the fixer → kept | **7,313 → 131 → 37 → 26** |
| Escalated cases that later got a kept fix | **6 of 11** |
| Verdicts that would flip if judged on only 2 attempts | **9 of 24** |
| Observer reads per minute (cap 6) | **2.5** |

*All numbers are from the run logs. The old-vs-new comparison uses different bosses and several design changes at once, so it shows a direction, not a controlled result. Cost in dollars per kept change did not fall, because the new runs used a stronger fixer setting.*

## Ongoing work: budget-aware RSI via event forest optimization

![Budget-aware RSI via event forest optimization](img/design-future.svg)

We are optimizing steps ③ and ⑤ further. Instead of one fix per case, cases are grouped under a **root cause**, so one fix can close many cases at once, and several root fixes are tested in parallel with fair credit for each.

*An early pilot on a capture quest is promising, but it is one run per design; repeat runs are pending.*
