# Self-Improving Agent Loops — foundations packet

**Date:** 2026-10-08 · **Method:** deep-research-foundations, one research lane (Sonnet class) · **Status:** initial, minimal · **Address:** `miadi-foundation:self-improving-agent-loops`
**Grounds:** miadi-review:3cf740b9-302f-4c6d-932f-be05f46bb19f v5 (Academic Fields), jgwill/Miadi#262
**Feeds:** miadi-chronicle:551 *Learning Between Sessions: Autoresearch for the Miadi Factory*
**Verification:** mixed. 19 sources found online on 2026-10-08. The two Argyris entries rest on catalog and secondary listings, not the publisher's page (`source-ledger.yaml`)

## Context layer

**Terms.** A *loop* is change, run, score, keep or discard. The *metric* is the one number the loop compares (`val_bpb` in autoresearch). The *instructions* are what the person writes and the agent does not edit (`program.md`). *Single loop* corrects actions against a fixed metric. *Double loop* changes the metric or the instructions.

**Fields.** The same six titles as the review's Academic Fields, so the overlap is visible:

| # | field | discipline | what it gives this packet |
|---|---|---|---|
| 1 | Hyperparameter Optimization and AutoML | machine learning | the loop as search under a fixed budget |
| 2 | Search-Based Software Engineering and Genetic Improvement | software engineering | code changes scored by a fitness function |
| 3 | Autonomic Computing and the MAPE-K Loop | systems engineering | monitor, analyze, plan, execute over shared knowledge |
| 4 | Self-Improving Language-Model Agents | artificial intelligence | agents revising their own prompts, skills, code |
| 5 | Double-Loop and Organizational Learning | organization studies | who may change the rule the loop obeys |
| 6 | Metric Validity: Goodhart's Law and Overfitting | statistics, AI safety | what optimizing a proxy does to it |

**Crosswalk.** `rispecs/miadi-code/miadi-agent/ARCHITECTURE_MAPE-K.md` and jgwill/Miadi#402 already name field 3. `agentic-skill-lineage-knowledge-weaving/` holds the Iris evolution wave that field 4 continues. jgwill/Miadi#540 is the runtime side (communicating with self-evolving agents). EURY/QMD is offline (`AGENTS.md`), so no index is updated.

## Intent understanding

**Current reality.** Guillaume steers a series of sessions toward a result. Many transitions take him two or three messages. His corrections land as Earned lines, feedback memories and skill edits, by hand, one session at a time. Episode 351 drafted fixed tasks drawn from those Earned lines. No loop runs them.

**Desired outcome.** Between sessions, agents read the session traces and his follow-ups, propose changes to instructions, skills and plugins, test each against fixed tasks, and keep only what passes. A transition that took him three messages takes one.

**Who this is for.** The agents that would run the loop, and Guillaume, who decides what the loop may change.

## Synthesis

The six fields agree on one shape and four limits.

1. **The loop needs a score it cannot write.** Field 2 calls it the fitness function, field 1 the validation set. For Miadi it is Episode 351's tasks, scored by script. Without them, "kept because it improved" has no meaning.
2. **Keep a held-out set.** Fields 1 and 6: the best of many trials on one set is partly noise. Some of the 351 tasks stay out of the loop and are only used to confirm a kept change.
3. **Audit the evaluator.** Fields 4 and 6: an agent can satisfy a score without doing the task (specification gaming). A kept change is read by a person or a second agent before it lands.
4. **The instructions stay with the person.** Field 5: the overnight loop is single loop. Changing what counts as better (the Earned rules, the metric) is double loop and stays with Guillaume, as `program.md` stays with the person in autoresearch.
5. **Field 3 already has a home here.** The MAPE-K spec can carry this loop as its Plan and Execute steps over the session record (traces, Earned lines) as Knowledge.

## Addendum 2026-11-20: guards and corrections as loop evidence

A guard (a hook that refuses an agent's write) is a fixed check the agent's work must pass, so
point 3 applies to it twice. First, its refusals are evidence only when kept apart from a person's
corrections: on 2026-11-20 the capture held 58 guard refusals among 1196 recorded corrections, 32 of
116 in November. Second, a ban on a surface word invites the next synonym, so a loop over a word
list counts rewrites and recorded overrides, not refusals alone, and changing the list stays double
loop, with its owner. Grounded in jgwill/miadi-orchestration-kit
`foundations/agent-harness-and-controlled-language/` and specified as the `guard-fit` scorer in
`rispecs/agent-harness-hooks/` S8.

## Not done

- No field files: each field is its review paragraph plus its ledger entries.
- No loop is built. Episode 551 holds that work.
