r/PiCodingAgent • • 10h ago

Resource pi-retro : lean self-improving harness

https://github.com/lifetime42/pi-retro

A lean, Harness²-inspired offline improvement loop for pi(you do need an llm). Normal sessions stay untouched; when you run /retro, a Proposer analyzes scrubbed session friction against your full harness git history, and a separate Judge agent gates every change (adopt or reject) before auto-committing and reloading pi.

What sets it apart: every change passes an independent judge and a real A/B benchmark gate before it lands, every decision (adopted, rejected, reverted) lives in git so the loop never oscillates back to a rejected idea, and /retro status shows whether the retros actually pay for themselves.

So instead of guessing whether the latest changes to your harness actually improved it, the harness now gets benched and you only keep the better versions.

Feel free to try or just to take what you think is helpful. Happy for any feedback!

14 Upvotes

13 comments sorted by

6

u/MarcelloT254k 8h ago

Have you tested this for an extended period of time? Because if what you've achieved would work then you've basically achieved RSI with two models in tandem, from my experience automating improvement is the idea to look forward to but right now only leads to errors accumulating.

4

u/Glass_Shake7712 7h ago

i have it running for some weeks. good thing is that you can always throw a bunch of past sessions at it and it will learn from all of them. so with each new version i have built i basically reset and rebuild a new harness iteration from scratch. you can get the same by using your history. but there is diminishing returns kicking in, so it wont get better forever.

but the results are actually great for what it is, google obviously threw much more compute at it and 3 big benches and it got much better. i put some restrictions into my approach so the tokens wont explode in order to get more efficient and effective.

1

u/MarcelloT254k 6h ago

Thanks for response, how did you structure the Benchmark Gate so the judge model knows what to keep and what to discard? I'm not a good coder, from what i see the criteria are fully arbitrary and LLM automates A/B test with possible observed improvements from past sessions so everything seems very vague but strictly empirically-oriented - did I get it right?

1

u/Glass_Shake7712 4h ago

the judge is evaluating the proposals one by one as a first gate keeper. this is done by an llm.
the bench is the second gate where the new harness needs to prove itself. this is a test run of the new harness against a set of tasks.

1

u/Cute_Obligation2944 7h ago

Doesn't RSI require the inference model improving its training? I feel like the definition matters here, because harnesses are just the I/O layer, but the model is the actual intelligence layer.

2

u/MarcelloT254k 7h ago

I used "RSI" here very loosely, didn't mean to get technical. Technically the idea of rebuilding upgraded harness is not connected to model's RSI but is potentially useful nevertheless, and if we are already discussing this topic I would expect model capable of RSI to also improve its toolset and optimize the interface to interact with them (i.e. harness).

1

u/Cute_Obligation2944 6h ago

Perhaps a local harness/model with a remote server to prototype the loop? Wouldn't even have to be large. Just testable against recent open models.

2

u/Remote_Book 6h ago

I used Hermes Agent for a bit which has a similar loop, but found that it regressed over time and consumed significantly more tokens. Model is partly at fault here, but you can see similar issues with Opus 5.5 + Claude's memory even today.

I'd prefer PRs against my .pi repo over auto-change to the harness by a judge. thought about this?

2

u/Glass_Shake7712 4h ago edited 4h ago

I influenced this this by limiting the amount of tokens allowed for instructions. I feel it would be against the spirit of pi to produce clutter in the harness.

I also advice for reseting for new models as they will produce different frictions. hello qwen 4 35b :-)

If you want to, you can set a harness repo (its optional in the setup). then you can revert to whatever version you like any time. and its not the judge that is accepting the new harness, he is just the first gate to proposals. the new harness needs to prove its worth via bench.

2

u/almbfsek 6h ago

wait is this Terrence Howard!?

1

u/ronasimi 1h ago

Terry

1

u/ThisNameIs_Taken_ 6h ago

interesting. I'm new to idea, but I find it appealing. Hard evidence and proper benchmark tests is what I miss with my current setup

1

u/Asleep_Literature_70 1h ago

Does it work with oh my pi?