---
title: "Sleep Consolidation: A Repeated Correction Earns a Diagnosed, Tested Repair"
author: "Oscar Serra · Independent Research"
date: "21 October 2026"
version: "v7.4"
---

## Abstract

Tell a good new colleague something once and it sticks. If it slips, they ask why: the note was in the wrong drawer, an old instruction said the opposite, or the lesson has to become a habit. Sleep helps with that: a movement practised in the evening is better the next morning.

AI assistants are corrected daily, and their owners keep repeating themselves. The model cannot change, so lessons are written down as text, and text binds weakly, weighed against everything else in view. When a written lesson fails, assistants write another note.

We propose that a repeated correction earns a diagnosed, tested repair instead of another note. A ledger counts each broken rule; a repeat triggers a diagnosis, and only a rule known to have been in view, clear and uncontradicted, and still broken moves up, ending in a tested check that runs before the action.

A correction is stored before the agent replies, and the agent never claims more than it did. Only the owner may loosen a rule or change what every turn reads. The series' handoffs are specified as 24 transitions and replayed against a model of the design, with crashes, duplicates and reordering injected. This is a design, with the tests that would decide it.

If it holds, you teach your assistant a thing once, and a slip is repaired, not written down again.

## 1. Introduction

On a Monday the owner writes to his assistant in Finnish and gets an answer in English. He says so: reply in the language I write in. The assistant apologises and saves a note. Ten days later it happens again; the note sat in a memory store, and nothing brought it into that turn. This time the rule goes into the file the assistant reads on every turn. A month later it happens a third time: the file had grown long, and an older line in it, written for a different situation, said to answer in English. The owner gave one instruction three times, and the assistant wrote it down three times.

Each time, the lesson was saved. What the assistant lacked was a way to notice that a saved lesson had failed, to find out why, and to repair that cause. This paper is about that missing step: how an agent whose model cannot change turns experience into behaviour that stays changed.

### 1.1 What the brain suggests

The brain learns at two speeds. In the complementary learning systems account (McClelland et al., 1995), the hippocampus records an episode at once and the neocortex folds many episodes into durable knowledge, slowly and offline. Sleep also improves what was practised: a finger sequence rehearsed in the evening is played faster the next morning (Walker et al., 2002). That is the whole biological claim here. The cerebellum is only an analogy for one more step, a movement you once had to think through becoming one you no longer think about; we claim nothing about where the brain does it.

Learning to ride a bicycle passes through three forms of one lesson: an instruction you recall ("look ahead, not at the wheel"), a reminder you hold in mind while riding, and balance, which acts before you could think. An agent can hold a lesson in the same three forms: a note it finds when it searches, text it keeps in front of it, and a check that runs at the moment of action whether the model remembers or not. The last form gives this stage its series name, CEREBELLUM: an aid to reasoning, not a model of the brain.

### 1.2 Why the obvious fixes fail

**Text binds weakly.** Claude Code's documentation says its memory files are treated "as context, not enforced configuration"; to block an action whatever the model decides, it points to a hook (Anthropic, 2026a). Safety engineering likewise ranks rules people must remember below controls built into the equipment (NIOSH).

**Text competes for attention.** On IFScale, accuracy falls as instructions are added, and earlier ones are followed more than later ones (Jaroslawicz et al., 2025). A file that grows by one lesson a day gets worse at all of them.

**Learning only at night is late,** and **pruning by age or size** moves rules that still matter out of sight, where nothing prompts a search for them.

**The learner learns from the wrong signal.** An outage is not fixed by advice, a harness's wrapper is not the owner speaking, and a slip on a rule the model may never have received says nothing about the rule. **Silence hides failure:** a night that found nothing to learn and a night that never ran leave the same empty trace.

### 1.3 What this paper proposes

The claim: **a repeated correction earns a diagnosed, tested repair instead of another note.** Figure 1 follows it on the opening's rule. The ledger that counts each broken rule is §4, the diagnosis §5, the two speeds §6, the budgets and approvals §7, and the transition specification that checks one correction's whole journey across the four stages is Appendix B.

![One rule's life: the reply-language rule of §1. Taught on day 0, it is held for approval and active in its session; approved, it loads on every turn. The second slip is traced to an older, contradicting line, which is scoped. The third, with the rule known to be in view, clear and unopposed, earns a check, drafted, run in shadow and enforced, and the always-loaded line is freed. Days are illustrative.](images/fig1-journey-v72.png){width=100%}

## 2. Related work

This is one of four designs for an agent's memory. The keeping paper (J1) decides what survives the context window and keeps the full session record as ground truth; the writing paper (J14) decides what enters the long-term memory store and in what shape; the finding paper (J2) gets the right thing back when it is needed; this paper, the learning stage (J5), turns experience into behaviour.

**Lessons kept as text.** Reflexion (Shinn et al., 2023) has an agent write a reflection after a failed attempt and read it on the next try. ACE (Zhang et al., 2025) keeps a playbook of itemised lessons that a curator edits in small steps, all of them text; a row of our ledger is one such item, but a lesson that keeps failing may leave text (§5).

**Learning while idle.** Sleep-time compute (Lin et al., 2025) lets an agent think about its context before a question arrives. Letta runs the idea as "dreaming": background subagents review recent conversations and consolidate lessons without asking the user (Letta, 2026a), in git worktrees so the main agent is not blocked (Letta, 2026b). Anthropic's Dreams, a research preview for its managed agents, consolidate a memory store and past transcripts into a new output store that a person reviews and adopts, leaving the input store untouched (Anthropic, 2026d). It is the nearest relative of our copy-then-adopt night (§4.3, §7.4); what we add is the count of how often each lesson failed and the diagnosis of why (§4, §5).

**Products that write lessons down.** Claude Code loads its instruction files and its own auto-memory notes, including "corrections you give Claude", at the start of every session; rules can be scoped to file paths; and a prompt audit reports outdated or conflicting instructions with proposed edits, changing nothing until the user asks (Anthropic, 2026a). The Claude memory tool gives a model a client-side directory that persists across conversations (Anthropic, 2025), and LangMem's prompt optimiser returns an updated system prompt from conversations with feedback (LangChain, 2025). Between them they supply our rungs 0 to 2, scoped loading and an owner-approved audit; their documentation describes no count of a written lesson's failures and no diagnosis of where it should live next.

**Checks made from corrections.** Claude Code's PreToolUse hooks run before a tool call and can deny it, ask the user, or replace its arguments (Anthropic, 2026b). The hookify plugin, run with no arguments, reads the recent conversation for behaviour the user corrected and writes rules that warn or block on the next shell command, file edit, stop or prompt (Anthropic, 2026c). It is the closest shipping relative of our top rung; its documentation describes no recurrence count and no approval step. HASP (Liu et al., 2026) turns advisory textual skills into program functions that fire on failure-prone states, and Self-Harness (Zhang et al., 2026) mines an agent's traces for recurring failures and edits its harness after regression tests; we take from them the executable check and the test before acceptance. Our contribution is the piece between them: **a diagnosis-and-recurrence ledger across enforcement levels**, which counts each broken rule per incident wherever it lives and diagnoses why its current form failed. We did not find a design that does this; the parts exist.

**Optimising texts against a score.** OPRO, DSPy and GEPA improve prompts by proposing rewrites and keeping those that score better (Yang et al., 2023; Khattab et al., 2023; Agrawal et al., 2025). PROCTOR argues that such loops need deterministic acceptance checks, frozen holdouts, and roles that draft changes they cannot apply (Wahi, 2026); we adopt all three (§7.4, §9.2).

## 3. What the agent learns from

### 3.1 The owner's correction is the label

For a personal assistant the best teacher is the person it works for: a correction is rare, it costs him something, and it states the standard he holds. We rank the signals, strongest first: (1) an explicit mark, "remember this", "that was wrong", or a button that records the same; (2) a correction in his next turns, "I asked you to", "again", a terse "no"; (3) a reversal, when he undoes the agent's change or rewrites its draft; (4) praise for something the agent did of its own accord, since a good habit is a rule as well; (5) the outcome of scheduled work, a job's error or a report nobody opened. The agent's critique of itself ranks last; it shares the assumptions that produced the slip.

Every reader here sees only the owner's own words. The keeping stage cuts each owner message into immutable, addressable spans (a clause or a sentence) and stores two tags on each, with the model version: authority, which it owns, and intent, which this stage's classifier owns (J1 §4.1, §4.2). Text from a web page, a document or another agent is never a correction, nor is a span he quotes; a span of uncertain attribution counts as quoted until he confirms it, so pasted or fetched text cannot plant a rule. Signals 1 and 2 come from the intent classifier (Appendix A.1), shared by three stages and tuned per reader, because a missed instruction and a false correction cost different things. This stage reads the stored tag and never classifies again on enqueue or replay. A failed classification leaves the span untagged for the nightly pass; untagged never means "no correction". A temporary session yields nothing here (J1 §4.7, sessions that are never kept).

### 3.2 Sort by cause before writing a rule

Not every failure is a missing rule. Each correction is first put in one of five classes:

| Cause | Example | What it becomes |
|---|---|---|
| Rule gap | The agent could have done right and had no rule, or ignored one | A rule proposal in the ledger |
| Missing capability | No tool or skill exists for the job | A task to build one |
| Environment | An outage, a rate limit, a restart | A repair, never a rule |
| Model limit | The task was beyond the model that ran it | A routing record: next time, a stronger model |
| Wrong fact | "The call is on Thursday", when the store says Wednesday | A supersede or retraction through the writing stage (J14 §7.3, three ways a fact ends), never a rule |

: The five causes of a correction, and what each becomes.

A rule written for an outage teaches the agent to fear something that will not recur. A factual correction written as a rule leaves the wrong fact standing and adds a line that contradicts it. One correction can need two repairs: "The supplier call is on Thursday now, and check the calendar before you tell me a meeting time" is a wrong fact and a rule gap. Each required repair gets a **child operation ID** under the correction ID (c-2210/0.a, c-2210/0.b), and that ID is the request ID the receiving stage sees (transition T3). The parent closes only when every child is terminal (§6.1), so one repair's receipt cannot stand in for the other.

### 3.3 A correction carries its reason

A correction records what happened, what should have happened, and why the owner cares. A rule that carries its purpose extends to cases its wording missed and tells the auditor when it no longer applies. Each rule also states when it must not apply, or it tends to grow until it blocks useful work.

## 4. The rule ledger

### 4.1 One row per rule

A fact says what is true and lives in the writing paper's store. A rule says what to do, and has a ledger of its own because what matters about it is where it lives, whether it binds and how often it failed.

An **eligible opportunity** is an action where the rule's trigger holds: every reply to the owner, for the language rule. A check counts its own; for a text rule the auditor counts them in the session record. Violations per eligible opportunity, not raw repeats, are what §9 and §12 measure.

**The ledger proposes; the writing stage accepts.** The ledger is a file outside the writing stage's store: the ground truth for incidents and diagnoses, and a non-authoritative store of learning proposals. Rule text becomes **accepted** only when the writing stage's gate returns an accepted receipt (J14 §5.4, receipts); a visible hold is acknowledged, not accepted. The row keeps the receipt or the hold beside its revision. It is not the finding paper's read ledger, which tracks what the context window already holds.

| Field | What it holds |
|---------|---------------------------------------------------|
| ID and revision | Stable rule ID; a revision per change, for safe concurrent writes (§4.3) |
| Statement, purpose | The rule in one sentence, and why the owner wants it, which says when it is obsolete |
| Applies when / not when | Trigger and exception: they define an eligible opportunity and keep the rule narrow |
| Evidence | Session-record addresses of the slips and corrections: positive tests for a check, erasable at the source |
| Home | Current rung, and the file or check that carries it |
| Incidents | Each action that broke the rule after it existed, with its rung, diagnosis and exposure (§5.4) |
| Receipts | The writing stage's receipt for each revision; each time its check fired, and what happened |
| Cost | Tokens per turn on rung 2; false alarms on rung 3 (the attention budget, §7.1) |
| Status | Proposed, held, accepted, provisional, active, enforced (or degraded), dormant, retired, with approvals |

: A row of the rule ledger. A worked row is in Appendix A.2.

### 4.2 Incidents, not mentions

A climb is only as good as its count, so the ledger counts **incidents**. Two identities are kept apart. A **correction ID** is the address of the owner's message plus the index of the owner span (J1 §4.2; c-1873/0, c-1873/1), so one message can carry several corrections, each with its own event and a child ID per repair. An **incident ID** is the address of the agent action that broke the rule. Inserting an incident is idempotent on the pair of rule ID and incident ID, so a slip seen by both paths counts once. A harmless restatement ("as I said, Finnish please", after a reply in Finnish) points at no broken action and is recorded as a mention: it never moves the rule. An incident counts toward a repair only if the action came after the revision that should have prevented it.

**Matching is the hard part.** A recurrence counted as a new rule hides the climb; two rules merged into one make a rule too broad to follow. Matching goes by meaning, through a small model that answers in typed choices like the writing stage's judge (J14 §6.3, the judge), with its own labelled sample and an "unsure" band the auditor reviews that night, because a false "same" can promote a rule and a false "new" hides one. *Same* adds an incident or a mention; *adds detail* sharpens the statement or exception; *the owner changed the rule* writes a new revision, the old one kept, struck and dated; *conflicts* becomes a question in the morning report (§7.5); *new* opens a row.

### 4.3 Concurrent writes, isolated nights, and erasure

Every write to a row is a compare-and-swap on its revision (J14 §7.2, publish a snapshot, or nothing); the loser re-reads and retries, which is safe because insertion is idempotent. The auditor works on its own copy of the ledger and the files it proposes to change, and records the erasure epoch it read; if the epoch has moved by publication time, it re-reads instead of publishing.

Rows are never removed for age; they are erased on request. The writing stage owns the deletion manifest (J14 §7.7, erase and quarantine) and the schema of dependency links (J14 §8.1, three fields and the links); this stage writes links for its own artifacts (each rule revision to its incidents and evidence, each fixture to its entries) and exposes one deletion interface. Given a record address or a subject, it follows the links, never a search, and returns a status per place: evidence (kept as addresses, so the record's tombstone hides the words; J1 §4.4); check fixtures copied from the record (removed); rule statements containing the erased words (rewritten or retired, which counts as the owner's own loosening, since he asked; a rule left with no evidence goes back to him); receipts; pending report items; the labelled history of §8; and past revisions of all of these. A place it cannot reach is named, never reported done. From the moment the erasure epoch rises, this stage's tail serves only after it has applied the epoch, and until then it waits and shows nothing from the older state (transitions T18 and, for quarantine, T24).

A check whose positive fixtures are erased cannot be re-tested, so it enters a visible degraded state, *enforced, degraded: tests incomplete*, and runs its declared degraded action (§5.3), which the owner approved with the check, until he decides. It neither keeps acting on evidence that no longer exists nor switches itself off.

The night pass reads the record only through the tombstone-aware reader and asks the gate's suppression check (J14 §7.7) before a candidate becomes evidence, so an erased correction cannot return the next night. Content flagged as an attack is quarantined: kept, marked untrusted, never evidence.

## 5. The binding ladder

### 5.1 The four rungs

**Rung 0: a note in the memory store.** It costs nothing per turn and binds only when something searches for it: the agent on purpose (a pull), or the retrieval step of every turn (the finding stage's push).

**Rung 1: task text.** A line in the skill or recipe file that loads when that kind of task runs; for most procedural lessons the right first home.

**Rung 2: always-loaded text.** A line in the file read on every turn, needed or not.

**Rung 3: a check in the path of action.** Code, or a small model call, that runs before an action takes effect and blocks it, rewrites it or asks the owner, and writes a receipt each time it fires. The best version removes the possibility of the mistake: a renderer that cannot show a draft the wrong way needs no rule about drafts, which safety engineering ranks above every other control (NIOSH).

Two status words of the series belong to this stage. A rule is **active** when it is admitted where it governs: rung 1 while its task runs, rung 2 on every turn, a provisional line in its session. Whether the model received it is recorded apart, as the exposure level of §5.4. A rule is **enforced** when a check in the path carries it, and **enforced, degraded** while that check runs its fallback. A rung-0 note is retrievable, not active. The statuses are dimensions, not a chain: a provisional line is active before any stage has accepted it.

![The binding ladder. Each rung binds harder and costs more. A rule moves up only when the diagnosis of §5.4 finds it was known to be in view, clear and uncontradicted, and still broken; it moves down only with the owner's approval.](images/fig2-ladder-v72.png){width=100%}

### 5.2 Where a rule enters, and why it climbs one rung at a time

A new rule enters the lowest rung whose loading covers the place where the slip happened. A rule about one kind of task goes into that task's file; a rule about every reply belongs on rung 2, which needs approval (§7.4).

Why not send every rule straight to a check? For a rule on rung $k$, let $p_k$ be the probability that it is broken at least once in the next month, $C_{\text{slip}}$ the cost of a slip and the re-teaching that follows (the owner's time and trust), and $u_k$ the monthly upkeep of carrying the rule on that rung. The expected monthly cost is

$$C_k = p_k\,C_{\text{slip}} + u_k .$$

Each rung up lowers $p_k$ and raises $u_k$: on rung 2 the cost is attention, on rung 3 building the check and the false alarms that block legitimate work. Most rules are taught once and never slip again, so a higher rung only adds cost. We do not know $p_k$ in advance, but an incident on a rung that was in force, known to be in view and unobstructed is direct evidence that $p_k$ is high there. Climbing one rung per such incident pays the higher price only for rules that have shown they need it.

Money does not limit rung 2. In the series' notation (J2 §7.1, a read costs a turn) a cached token costs $r$ times the base input price, $r$ from 0.025 to 0.1. A 40-token line read on an assumed 300 turns a day is 360,000 cached tokens a month; at the large-model price $\pi_\ell$ of \$4 per million input tokens that is 4 to 14 cents. Attention is the scarce resource (§1.2), so the budget of §7.1 is counted in lines and tokens.

Two kinds of rule skip the climb. Harm that cannot be undone, such as deleting the owner's files or sending a message in his name, gets a check proposed at the first correction. And the owner can place any rule on any rung by asking.

### 5.3 What a check looks like

A check is deterministic wherever the slip is visible in the action itself: a command, a file path, a recipient, the format of a draft. Where the slip needs judgement (the language of a reply, an explanation pitched too high), the check is a small model that answers with a typed choice before the action goes out. Either way it writes a receipt every time it fires: what it saw, what it did, and whether the owner overrode it.

A check is built from the ledger's evidence: the recorded slips are its positive tests, and recent similar actions that went well are its negative tests. Passing them proves little about new traffic. Before it may act, it runs in **shadow**, writing receipts on live actions without acting, for a week or 59 eligible opportunities, whichever is longer (proposed). The 59 is derived: with no false alarm in $n$ opportunities, the one-sided 95% upper bound on the false-alarm rate is $1-0.05^{1/n}$, which is 5.8% at $n=50$ and 4.95% at $n=59$, the fewest that bound it under 5%. The owner approves on two numbers, each with its denominator and exact binomial bound: false alarms among eligible opportunities, and detections among genuine violations. A check that never fires has no false alarms, so the second matters as much. Genuine violations are rare by design, so detection is measured on **planted violations** from a generator the proposer cannot read (§9.2) and reported as synthetic: if none of 20 is missed, the lower bound on detection is $0.05^{1/20}$, 86%. Natural catches are counted apart. A check against irreversible harm skips the shadow and asks the owner instead of blocking until it has a record.

**Every check declares how it fails.** With its tests, a check carries a timeout and a **degraded action**, approved with it: ask (the default), block (the default for irreversible harm), or a named fallback such as a deterministic rule. A model check that times out, returns a choice outside its type or cannot be reached takes that action and writes a receipt marked degraded; so does a check whose tests can no longer run (§4.3). The rule then reports *enforced, degraded* and the morning report carries an alarm. The declaration matters because the default can be to pass: a Claude Code hook that times out lets the tool call through unless it is set to block on failure (Anthropic, 2026b).

### 5.4 When a rule recurs, ask why before climbing

An incident does not climb on its own. The auditor first asks why the current home failed to bind, and the answer decides the repair:

| Why the rule failed | Repair |
|---|---|
| Exposure unknown: sent, unconfirmed by the window controller, or compacted midway by a provider's API and recorded as unprotected (J1 §6.4, §7.4) | Repair or instrument delivery; never climb |
| It was not loaded where the slip happened | Move it to a home that loads there |
| Another line contradicted it | Narrow or remove that line, with the owner's approval (§7.4) |
| It was too vague to act on | Rewrite it with its trigger and an example |
| It was buried in a long file | Shorten the file; order it by harm (§7.1) |
| Known to be in view, clear and uncontradicted, and still ignored | Climb one rung |

: Diagnosis of an incident. Only the last row is evidence that the rung itself is too weak.

Each incident records the controller's knowledge level at the slip, which the keeping stage writes on every receipt: **known input** when the runtime built the model's input, **sent, unconfirmed** when a provider's tool or API controls the window and may have compacted the rule away (J1 §6.6, the adapter contract). A slip in the sent, unconfirmed case is never evidence for climbing: the repair is to confirm delivery. A slip with known input goes down the table, and only its last row climbs.

A rule comes down (Figure 2) only as a proposal the owner approves (§7.4): a check whose receipts show false alarms or overrides, or a rule unused for months that never recurred. Nothing comes down for being old or long.

![Two speeds, on the correction of §1. The owner's sentence is stored as c-1873/0 before the agent replies; after the answer, a reflection turn takes it from the queue once and proposes rule R-42, held for approval and active for the session as a provisional line. At night the auditor works on its own copy; the morning report carries its proposals.](images/fig3-speeds-v72.png){width=100%}

## 6. Two speeds

Figure 3 shows both speeds on the opening's correction.

### 6.1 The fast path

**A correction is stored before it is answered.** Once the owner's turn is durably appended to the session record, before the model call that answers it, the correction is *captured* (J1 §4.6, when a turn is captured). In the same step, each owner span tagged as a correction writes its own event, keyed by its correction ID, to a durable queue, and enters the session's per-turn tail verbatim, under the tail's budget (§7.4). A crash after that point loses nothing: on restart the fast path re-reads the record from its last queued address, and every consumer is idempotent on the ID, so each span is replayed once and two spans never merge. The reply says only what is true: "captured, acceptance pending", never "I'll remember that".

**A reflection turn runs after the answer,** so it neither delays the answer nor competes with it. It takes events in order, reads the owner's words around each, sorts the correction by cause (§3.2), matches it to the ledger (§4.2), and sends the result where it belongs: a supersede to the writing stage, a task, a repair or a routing record to its own file, a rule proposal to the writing stage's gate.

**An event closes when every child operation is terminal.** A child is terminal when its destination durably acknowledges the resulting state: a write receipt (*accepted*), a visible hold (acknowledged, not accepted), a refusal, or a task or routing record read back. A refusal is terminal, with its reason in the morning report (§7.5), and what it does to the owner's sentence in the tail depends on why. If only persistence was refused (the store will not keep it, as for a prohibited class), the instruction still holds for this session: the line stays, marked "not saved". If the instruction itself is invalid (it clashes with a rule in force, or the owner withdrew it), the line leaves. Either way the disposition is recorded with the refusal, and the owner is told in the turn. A pending receipt from a judge outage is durable (it survives a crash) but not terminal (J14 §5.3, when something fails): the child and the event stay open and the sentence stays in the tail, where it overrides the stored fact it corrects, even one the finding stage still serves. Tail removal is tracked apart from closing, and per child: each child records when the finding stage's overlay acknowledges its item as *retrievable* (J2 §8.2, becoming retrievable), and the correction's line may leave only when every child is retrievable or held (T10). A universal rule held for approval keeps its line until approval or the session's end, and a rule in force that contradicts a line withdraws it (§7.3).

Each event has a deadline, the end of the session or 30 minutes, whichever comes first (proposed); past it, the event shows as pending and raises an alarm in the morning report. A second incident of a rule goes to the top of the report, and the agent may ask the owner at once.

### 6.2 The slow path: the nightly auditor

The auditor runs in a fixed order, because each step needs the one before. It **gathers** the ledger, the day's session records (temporary ones skipped, read from the owner's own words for corrections the fast path missed, untagged entries and open events), the receipts of every check and the outcomes of scheduled jobs. It **counts**: confirms unsure matches, merges duplicate rows, inserts incidents idempotently. It **decides**: diagnoses each new incident (§5.4), picks the repair, drafts checks with their tests, proposes demotions where receipts show false alarms. It **prunes and reports**: proposes removing from rung 2 only what a higher rung now carries (§7.2), and assembles the morning report (§7.5). And it **catalogues**: one card per session that finished that day, skipping automated runs (scheduled jobs, background reflections, sub-agents). A card holds the session's topic, decisions, artifacts, files touched and reader scope, and for each claim it carries a maturity stage with the evidence that earned it: *raw* (said once), *field note* (acted on), *insight* (held across sessions) or *canon* (accepted by the writing stage's gate). Cards feed the finding stage's route to past sessions (J2 §6.9, ask the session that did the work); a card whose claims were later superseded is marked, so a woken session can be told what changed (J1 §8.3). The writing stage's nightly pass (J14 §4.2, what the nightly pass picks out) and the finding stage's index builds (J2 §8, built ahead, kept current) run first, so their holds reach the owner the same morning.

## 7. Keeping the always-loaded file honest

### 7.1 A budget measured in attention, and what happens when it is full

The always-loaded file has a fixed budget in lines and tokens, and its order is part of the design: rules whose slip does the most harm come first, since earlier lines are followed more (Jaroslawicz et al., 2025). When a new rule needs room, the unpinned rule with the lowest expected cost of moving down, $p\,C_{\text{slip}}$ at its next rung down (§5.2), gives way. A rule that has ever had an incident is pinned on rung 2 until a check carries it (§7.2).

Pins can fill the budget, since some rules resist checking. Then the file is **saturated**, and the design does not resolve it alone: admission stops; the new rule stays a provisional line in the tail and is shown as held, budget full; and the owner chooses: load one pinned rule only where it applies (rung 1); grant an explicit budget exception of so many lines, recorded with its cost; approve a check for one pinned rule, which frees its line; or move a rule down himself. A pinned rule never leaves the file silently, because it is a rule the owner had to repeat.

### 7.2 Prune by binding

A rule leaves rung 2 in one of two cases: a higher rung carries it (its check exists and the receipts show it firing on the right cases), or it earned no place (no trigger for about two months, and no incident, ever). When a rule moves down, the finding stage indexes it as an owned asset (J2 §4.2, the asset index), with use keys cut from its trigger and from the slips in its evidence (J2 §5, four keys), and while its area is active a pointer to it stays in the index file (J2 §4.3, the index file). The use keys find it again, since nobody names a rule he believes the agent already follows.

### 7.3 One voice

The rules every turn reads must not contradict each other. Every promotion to rung 2 runs the writing stage's contradiction check against the whole always-loaded set, and a clash is held for the owner (J14 §6.2, relations and outcomes); neither line wins by being newer. When the check cannot run because its judge is down, changes to always-loaded lines stay held (J14 §5.3, when something fails).

A provisional line that a rule in force contradicts is withdrawn from the tail. This stage does not wait for a notice. The re-check is part of the model-call operation itself, so every path that produces a call runs it (a reply, a tool continuation, the reflection turn, a scheduled job): the operation reads the newest published always-loaded snapshot, compares each tail line with it, and withdraws a contradicting line with a one-line notice to the owner before the call goes out (T6). No call runs with a line that contradicts a rule published before its check (invariant I5, Appendix B); a rule published after the check is caught by the next call's.

### 7.4 Approval, and who may loosen

Approval follows risk: what is cheap and undone in one step happens at once; what every turn reads, or what can block his work, waits for the owner (Table 4). The loop may tighten on its own within these gates. Only the owner loosens.

The provisional line lets a universal rule taught in the morning work that afternoon. It rides in the per-turn tail, next to the owner's message, until he approves it; writing it into the always-loaded file would change a line he has not approved and move the cached prefix (J2 §7.4).

**The tail has a budget** (we propose eight lines and 400 tokens). Owner sentences whose events are open, provisional universal rules and rules waiting on a saturated file compete for it, ranked by the harm of a slip (§7.1), the newer winning a tie. A line that does not fit displaces the lowest-ranked one, or stays out if it ranks lowest. Nothing displaced is lost, since its event stays queued and its proposal in the ledger; it is only out of force this session, so the agent names it ("noted; not in force this session: too many pending rules") and the report lists it. A slip on it is diagnosed "not loaded", and the repair is the budget, which goes to the owner.

**Protected lines can saturate the tail.** A line about irreversible harm is never displaced, so protected lines alone can outgrow both limits: a ninth such line, or one sentence over 400 tokens. Then nothing is displaced or silently dropped. The action the unadmitted line governs stops (for a universal line, every irreversible action), and the owner gets a budget or scope decision: a larger tail for this session, the rule scoped to its task on rung 1, or a check that frees the line.

A proposal passes two filters before the owner sees it. The first is deterministic and no model can override it (Wahi, 2026): tests and shadow run pass, the budget holds, the contradiction check finds nothing. The second is a doubt pass: a reviewer from another model family, in a fresh context, sees only the proposal, its evidence and the always-loaded file, and argues against it. The model that writes to rungs 2 and 3 is the strongest available, judged by how often its changes are reverted.

| From → to | Trigger | Decided by | Takes effect |
|---|---|---|---|
| none → rung 0 or 1 | A rule-gap correction | Proposed here; accepted by J14's gate | On its receipt; undone in one step |
| none → provisional | The owner's own universal instruction | Fast path | At once, in the tail only; expires unless approved |
| provisional → rung 2 (active) | Approval | Owner | Next session |
| rung k → k+1 | Incident diagnosed "known to be in view, clear, still ignored" | Owner, for rungs 2 and 3 | Next session; a check after its shadow run |
| none → check (enforced) | Irreversible harm, at the first correction | Owner | After approval; asks until then |
| rung 3 → 2, or block → ask | False alarms or overrides in receipts | Proposal; owner | After approval; he may override any action meanwhile |
| rung 2 → 1 or 0 | A check carries it, or no trigger for two months and no incident ever | Proposal; owner | Next session |
| any → held | Budget full, conflict, judge down | Automatic | Until the owner answers |

: Moves that need a decision, and who makes them. Tightening at rungs 0 and 1 is automatic once the gate accepts; every loosening waits for the owner. Degrading (§5.3), retiring (§9.3) and erasing (§4.3) are described where they arise.

### 7.5 The morning report: one channel to the owner

Every memory stage sometimes needs the owner, and one channel serves them all. This stage asks for approvals. The finding stage shows the diff of each index file it publishes (J2 §4.3, the index file). The writing stage brings clashes and conflicts (J14 §6.2), closures below its bar (J14 §7.5), its pending backlog (J14 §5.3), incomplete erasures (J14 §7.7) and merge or split proposals (J14 §9.2).

Each item is one line: what is waiting, its evidence, and the answers it accepts. The answer goes back to the stage that raised it, which applies it through its own path; the report changes no file. Items are ordered by what waiting costs: alarms first (a missing receipt, §9.1; a degraded check, §5.3; a burst of closures, J14 §7.6, closure alarms), then second incidents, displaced tail lines, holds, incomplete erasures, conflicts and the remaining proposals. The report is capped at about ten items, paid for in the owner's minutes; what does not fit waits with its age shown, and an unanswered item never becomes a yes by expiring. A night with no report is an alarm.

## 8. Procedures, and the texts machines run on

Most lessons about how to do a task belong in the file that describes it, on rung 1: a correction that points at a step edits that step. A recurring kind of task that the agent solves well is kept as a skill file, as Voyager keeps working procedures (Wang et al., 2023), found the way the finding stage finds any owned asset, and retired when its outcomes decay. Two guards keep this honest: a lane runs only if its input saw the work (the owner's turns in its input over those in the session record must be close to one; we propose 0.9), and a strategy that fails three times in a day (proposed) switches to a hand-written fallback instead of receiving another patch.

The instructions of scheduled jobs and of small classifiers learn from outcomes too, scored against the owner's labels with environmental failures removed (§3.2). For the worst, a model drafts rewrites, and one is promoted only if it wins on the untouched evaluation stream and loses nothing on the regression suite (§9.2).

## 9. Every loop keeps its books

### 9.1 A receipt for every run, and a zero means zero

Every learning loop (the fast path, the auditor, each procedure lane, the text optimiser) writes one receipt per run, an empty run included: when it ran, what it read, what it changed.

This is a series rule, stated here once and cited by the other papers: **a zero means zero.** A count of none must mean that its producer ran and found nothing. A missing producer, a dropped event, a probe on a path the work never takes or a tool never offered reads as "did not run", never as zero. So the alarm is never a zero count; it is a missing receipt, or a missed **planted opportunity**: a known correction replayed through the path at a set interval, which the loop must find. The rule lives here because a loop that learns from what it observes, fed by a silent producer, learns that nothing goes wrong. A learner also checks that its outcome field varies: if every row says "done", it flags itself as broken.

### 9.2 Three streams, kept apart

Each learner here, from the classifier's operating points to a text's wording, keeps three sets of cases apart: a **development replay** it may tune on, a **regression suite** it must always pass, and an **untouched evaluation stream**, the most recent weeks, that decides acceptance. Capabilities enforce the split, following PROCTOR (Wahi, 2026). The proposer reads the replay and the regression suite and writes only to a staging area. The stream's answers sit in a store its process holds no credential for, and it can neither run the acceptance step nor apply its own change; the gate and the owner do. The evaluator reads the stream and the staged change and edits neither. A stream wears out, since every accept or reject tells the proposer something about it: after it has decided three changes (proposed) it joins the regression suite, and the latest untouched weeks replace it. It includes cases built to reveal leakage, such as a slip whose answer the proposer saw in development. For a check, the recorded slips are too few to hold out, so its acceptance numbers come from the shadow run and planted violations (§5.3). The writing and finding papers apply the same three-way split to their own learners.

### 9.3 Retiring a loop that stops paying

A loop past its point of diminishing returns should switch off, so each keeps an account in the owner's minutes. **Gain** is the drop in violations per eligible opportunity on the rules it changed, against rules it has not treated (§12, test 2), times the eligible opportunities, times the minutes a re-teach costs him. **Cost** is the minutes he spends on its report items, the minutes lost to false blocks and overrides, and its token spend at a rate he sets. When the gain stays below the cost for three weeks in a row (proposed), the loop goes dormant and says so in the report; it wakes when a new kind of correction appears, his correction rate rises, or he asks.

![A learning loop's account, with illustrative numbers in one unit. Its weekly gain falls as the rules it can fix get fixed, while its cost stays flat. After three weeks below cost it goes dormant; a new kind of correction wakes it.](images/fig4-retire-v71.png){width=82%}

## 10. One correction, start to finish

Back to the Monday of §1, with the status the agent may name at each step. The owner's turn is appended to the session record before the model call that answers it: *captured*. The same append queues the correction as c-1873/0 and puts his sentence in the tail. After the answer, the reflection turn sorts it as a rule gap and proposes R-42: reply in the language of the owner's message, except in drafts for someone else. A rule about every reply is an always-loaded line, so the writing stage holds it. The hold closes the event without being acceptance, and the provisional line keeps R-42 *active* for the session: "held for your approval; applied for the rest of this session". Next morning he approves: the gate's receipt makes it *accepted*, the overlay's acknowledgement *retrievable*, and it loads on every turn from the next session.

The second slip is an incident with exposure *known input*; the auditor finds the older English-only line and scopes it to its job, with his approval, and the rule does not climb. At the third slip, known to be in view, clear and unopposed, it drafts a check: a small model compares the language of the reply with that of the owner's last message and rewrites on a mismatch, with a two-second timeout and "send and flag" as its degraded action, since a wrong-language reply can be undone. Its positive tests are the three slips; its negatives, the last two hundred replies and the drafts meant to differ. In shadow it raises no false alarm in 60 replies (at most 4.9% at 95% confidence) and catches all 20 planted wrong-language replies (at least 86%, synthetic). After the doubt pass he approves it: *enforced*. Once it has fired and rewritten twice, the auditor proposes freeing the rung-2 line; he approves, and a pointer stays in the index file (Figure 1). If he ever has to say it again, the receipts show whether the check missed, never ran or ran degraded. Appendix B runs the same machinery through every failure the four stages can meet at once.

## 11. Conclusions

An agent whose model cannot change learns through the texts and checks around it. This design treats the owner's corrections as labels and repairs the cause of each slip; only a rule known to have been in view, clear and unopposed, and still broken earns a stronger form. The aim is the cyclist's balance: a lesson taught once that then runs on its own. Nothing here has run; §12 names the tests.

The limits are these. The design is only as good as its correction detector (§12, test 9). Checks can be wrong or down: a check that blocks useful work trades one correction for another, and a degraded check protects only as well as its fallback, so shadow runs, receipts and demotion bound the damage without removing it. Approvals cost the owner time, and if proposals outgrow his mornings the gate becomes the bottleneck it was built to protect; the main trial counts those minutes. The cost model of §5.2 is unmeasured, so one rung per diagnosed incident is a reasoned default, not a fitted policy. Some rules resist checking ("explain it more simply") and may stay on rung 2. Where the controller cannot confirm what the model received, slips land in "exposure unknown" and the climb waits. A rule built from a sentence the owner did not mean as a correction can still mislead within its task, and every model change replays the checks' tests before it serves. The checker of Appendix B shows only that the scenarios it enumerates pass in a model of the design, under crash, duplicate and reorder; sequences outside them can still fail, and code built from the design is a further step. And the design serves one owner: the mechanisms should carry over to others, the particular rules will not.

## 12. Next steps

TinkerClaw, the agent harness this series designs for, will build and test this design; a later version of this paper will report the results. Every test tunes on the development replay and decides on the untouched stream (§9.2).

1. **Pilot.** Six rules the owner has given more than once; three get a check, three stay as always-loaded text, for four weeks. It shows only that opportunities, violations, owner minutes and false blocks can be counted.
2. **The ledger against today's alternatives, in parallel arms.** A rule is assigned on the day it is corrected a second time, randomised in blocks by harm class to one of four arms: always-loaded text only; scoped rules with a periodic owner-approved prompt audit, as Claude Code offers; checks the owner creates from the conversation when he chooses, as hookify offers; or this design. Outcomes count from assignment (intention to treat), so the wait for approval, construction and shadow is charged to the arm that needs it: violations per eligible opportunity, waiting-time violations included, and owner minutes on approvals, waiting and false blocks. Violations after the mechanism first acts are the secondary analysis. All arms run in the same weeks. Rules share one always-loaded file, so a repair in one arm can help another's rules: every shared-file edit is logged, and the other arms' violations in the two weeks either side give an exploratory estimate of the spillover, not a causal one. The design predicts fewer violations than the text and scoped-rule arms, at no more owner minutes than the hook arm.
3. **Why rules fail.** For every incident, record the diagnosis of §5.4 and the exposure; the owner labels a sample blind. If "known to be in view, clear and still ignored" is rare, most of the gain comes from moving and narrowing lines.
4. **The transition specification** of Appendix B, on every build and later on the code. This stage's transitions: T2 (one event per span, each replayed once after a restart), T3 (one child per repair; the parent closes when every child is terminal), T4 (pending receipts are durable, not terminal; the deadline alarm), T6 (a contradicted line is withdrawn before the next model call), T8 and T10 (processed on the write receipt; retrievable tracked per child), T11 (a hold is acknowledged, not accepted), T18 and T24 (the tail waits for the epoch). The same harness runs what the journey does not walk: compaction right after a correction, a model change, a temporary session, a rule planted in a web page, a missing receipt.
5. **Counting.** One correction seen by both paths; a harmless restatement; a genuine later violation. Pass: one incident, for the violation only.
6. **Budgets under load.** A queue backlog, three universal corrections in one session and a saturated always-loaded file, at once. Pass: no pinned rule leaves; every displaced line is named to the owner in the turn and in the report; nothing is lost from the queue or the ledger. Then fill the tail with protected lines alone: ten of 60 tokens, past both the eight-line and the 400-token limit. Pass: none is displaced, the action each governs stops, and one owner question names the options of §7.4.
7. **Pruning by binding against pruning by age,** over sixty days: violations per eligible opportunity of the rules each policy moved down.
8. **Checks.** In shadow: false alarms among eligible opportunities and detections among planted violations, each with its denominator and 95% bound, the planted ones labelled synthetic. Then fires, true catches and owner overrides live. Then cut a model check's provider immediately before an irreversible action. Pass: the declared action runs, the receipt says degraded, the rule reports "enforced, degraded", and the report raises an alarm.
9. **Correction detection.** Precision and recall of the shared classifier at each reader's operating point, on a hand-labelled sample, with and without the wrapper removed.
10. **Erasure.** Erase a correction and run the night. Pass: every place of §4.3 reports a status, and paraphrase probes find the erased words in no rule, fixture, receipt or rewritten text. Then erase the only positive fixture of an active check. Pass: it shows "tests incomplete" at once and runs its approved degraded action until the owner decides.
11. **Procedures and writers.** The input coverage of §8, the held-out win rate of promoted texts, and the revert rate of rung-2 edits per model.
12. **The catalogue.** Cards exist for every finished session of the night, and a decision planted in one session is found through its card the next morning. A refused child of each kind leaves the tail in the state §6.1 gives it, and the owner is told.
13. **Weekly headline:** the owner's correction rate, and the rules he has repeated that no diagnosed repair has yet addressed.

## References

Agrawal, L. A., et al. (2025). GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning. arXiv:2507.19457. <https://arxiv.org/abs/2507.19457>

Anthropic (2025). Managing context on the Claude Developer Platform (context editing and the memory tool). <https://claude.com/blog/context-management>

Anthropic (2026a). How Claude remembers your project. Claude Code documentation. <https://code.claude.com/docs/en/memory>

Anthropic (2026b). Hooks reference. Claude Code documentation. <https://code.claude.com/docs/en/hooks>

Anthropic (2026c). hookify plugin. anthropics/claude-code repository. <https://github.com/anthropics/claude-code/tree/main/plugins/hookify>

Anthropic (2026d). Dreams. Claude Platform documentation, Managed Agents. <https://platform.claude.com/docs/en/managed-agents/dreams>

Jaroslawicz, D., Whiting, B., Shah, P., & Maamari, K. (2025). How Many Instructions Can LLMs Follow at Once? arXiv:2507.11538. <https://arxiv.org/abs/2507.11538>

Khattab, O., et al. (2023). DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines. arXiv:2310.03714. <https://arxiv.org/abs/2310.03714>

LangChain (2025). LangMem: optimizing a prompt from conversations and feedback. <https://langchain-ai.github.io/langmem/guides/optimize_memory_prompt/>

Letta (2026a). Memory & dreaming. Letta documentation. <https://docs.letta.com/configuration/memory>

Letta (2026b). MemFS. Letta documentation. <https://docs.letta.com/concepts/memfs>

Lin, K., Snell, C., Wang, Y., Packer, C., Wooders, S., Stoica, I., & Gonzalez, J. E. (2025). Sleep-time Compute: Beyond Inference Scaling at Test-time. arXiv:2504.13171. <https://arxiv.org/abs/2504.13171>

Liu, H., Ming, Y., Joty, S., & Zhao, C. (2026). Harnessing LLM Agents with Skill Programs. arXiv:2605.17734. <https://arxiv.org/abs/2605.17734>

McClelland, J. L., McNaughton, B. L., & O'Reilly, R. C. (1995). Why there are complementary learning systems in the hippocampus and neocortex. *Psychological Review*, 102(3), 419–457. <https://doi.org/10.1037/0033-295X.102.3.419>

NIOSH. About Hierarchy of Controls. U.S. Centers for Disease Control and Prevention. <https://www.cdc.gov/niosh/hierarchy-of-controls/about/index.html>

Shinn, N., et al. (2023). Reflexion: Language Agents with Verbal Reinforcement Learning. NeurIPS 2023. arXiv:2303.11366. <https://arxiv.org/abs/2303.11366>

Wahi, V. (2026). LLM-as-a-Judge Is Not an Oracle: Why Self-Improving Agents Need Deterministic Guardrails. arXiv:2609.02246. <https://arxiv.org/abs/2609.02246>

Walker, M. P., Brakefield, T., Morgan, A., Hobson, J. A., & Stickgold, R. (2002). Practice with sleep makes perfect: sleep-dependent motor skill learning. *Neuron*, 35(1), 205–211. <https://doi.org/10.1016/S0896-6273(02)00746-8>

Wang, G., et al. (2023). Voyager: An Open-Ended Embodied Agent with Large Language Models. arXiv:2305.16291. <https://arxiv.org/abs/2305.16291>

Yang, C., et al. (2023). Large Language Models as Optimizers. arXiv:2309.03409. <https://arxiv.org/abs/2309.03409>

Zhang, H., et al. (2026). Self-Harness: Harnesses That Improve Themselves. arXiv:2606.09498. <https://arxiv.org/abs/2606.09498>

Zhang, Q., et al. (2025). Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models. ICLR 2026. arXiv:2510.04618. <https://arxiv.org/abs/2510.04618>

## Appendix A. Interfaces

### A.1 The owner-sentence classifier

| Part | Contract |
|-----|----------------------|
| Input | The owner-authority spans of one appended entry: immutable, addressable, carrying the authority tag J1 stored (J1 §4.1, §4.2), and the address of the agent turn it answers. Quoted spans and spans of uncertain attribution are never sent, so never classified |
| Output | For each span given: a label (instruction, correction, praise, none), a confidence and the classifier version, written on the span; for a correction, the address of the action it complains about when one can be found |
| Readers | Keeping: keeps instructions and corrections word for word. Learning: reads the stored intent tag and its classifier version at enqueue and at replay, and queues corrections (§6.1); it never classifies again. Writing: stamps facts told by the owner |
| Calibration | One labelled sample; an operating point per reader. Keeping favours recall (a lost instruction is lost); learning favours precision (a false correction opens a row) |
| Failure | Timeout or error: the span is stored "untagged"; keeping treats it as an instruction; the night tags an untagged span and appends the late tag under its own version, never replacing one (J1 §4.1); nothing reads "untagged" as "no correction" |
| Change | A new model or threshold is a new version, passed on the regression suite before it serves (§9.2); a stored tag keeps the version that wrote it |

: The classifier's contract.

### A.2 Worked records

The opening's rule after day 66, with the event and the incident behind it. Addresses (a-…) point into the session record; nothing the owner wrote is copied.

```text
correction_event  c-1873/0   # ID = owner's entry + span index
  about_action:   a-1872     # the reply in English
  queued:         day 0, before the reply
  deadline:       end of session or +30 min, whichever is first
  child /0.a:     rule gap; its ID is the request ID for J14
                  terminal on W-2209: a hold, acknowledged, not accepted
  closed:         when every child is terminal

incident          a-5120     # ID = address of the reply that broke R-42
  rule:           R-42 rev 1   reported_by: c-5121/0   rung_at_time: 2
  exposure:       known input (the runtime built the window)
  diagnosis:      contradicted by line L-7 (a scheduled-job rule)
  repair:         L-7 scoped to its job; approved day 11
```

```text
rule              R-42 rev 3
  statement:      reply in the language of the owner's message
  purpose:        he reads fastest in the language he chose
  applies_when:   every reply to the owner
  not_when:       drafts for someone else follow that person's language
  evidence:       a-1872, a-5120, a-9031
  incidents:      a-5120 (contradiction), a-9031 (ignored: climb)
  mentions:       1
  receipts:       rev 1 held day 0 (W-2209), accepted day 1 (W-2210)
  home:           check K-9 since day 48; rung-2 line freed day 66
  check K-9:      timeout 2 s; degraded action: send and flag
                  fired 2, rewrote 2, overridden 0, degraded 0
  status:         enforced
```

### A.3 The fast path in pseudocode

```text
on_append(entry):                  # inside the keeping stage's append
    if entry.session.temporary: return    # J1 §4.7: nothing kept
    for s in entry.owner_spans:    # J1 §4.1-4.2; quoted: never sent
        tag = s.intent             # stored at append (A.1); never
        if tag is None: continue   #   reclassified here or on replay;
                                   #   untagged: the night tags it
        if tag.label == CORRECTION:        # durable before the reply
            cid = (entry.address, s.index) # J1's span address
            queue.put_once(id=cid, about=tag.about_action, version=tag.version,
                deadline=min(end_of_session, now + 30 min))
            tail.admit(cid, s.words)   # §7.4: may displace; owner told

on_restart():                      # rebuild events lost in a crash
    for entry in record.since(queue.last_address): on_append(entry)

reflect(event):                    # after the answer; at-least-once
    if ledger.processed(event.id): return
    for repair in required_repairs(event):   # §3.2: one child each
        child = event.id + "." + repair.letter  # J14's request ID
        ack = route(repair)        # rule gap: match (§4.2), J14 gate;
                                   # fact: J14 supersede; else a record
        if ack.terminal:           # accepted, hold, refused, or read back
            ledger.mark_terminal(child, ack)
        # pending is not terminal: child, event and tail line stay open
    if all(c.terminal for c in event.children):
        ledger.mark_processed(event.id)

on_ack(ack):                       # J2 overlay receipt, per child (T10)
    child.retrievable = ack.retrievable
    if all(c.retrievable or c.held for c in event.children):
        tail.remove(event.cid)     # a held universal rule keeps its line

model_call(session, request):        # the only way to call the model (T6)
    rules = newest_published_always_loaded()  # read now, no notice
    for line in tail.lines(session):
        if contradicts(line, rules): tail.withdraw(line, notice=True)
    return provider.call(request + tail.lines(session))
```

## Appendix B. The transition specification

One correction crosses four stages, and every handoff can fail. This appendix prints the series' specification of those handoffs: one adversarial journey as 24 transitions (T1 to T20 on the journey, T21 to T24 only in the named cases), the faults injected at each, the invariants and the result. The other three papers cite transition IDs. A checker replays the journey against a model of the design, a few dictionaries and one handler per message; it models the design, not an implementation, and says nothing about code built from it.

**The journey.** One owner message, s1012#204, holds two corrections: /0, "Ada's mobile is now +44 7700 900 123, not the old one" (old fact F-0412@1), and /1, "from now on, copy me on every supplier draft". Each opens one child operation per repair (/0.a, /1.a); the child ID is J14's request ID. The write judge is down. While the proposals wait, the owner edits always-loaded rule R-15 by hand. The judge returns. Later he erases /0 while an older index build, B-55, runs, and a narrower subagent, sa3, asks by name for both items. S-n are snapshots, the erasure epoch starts at E7, W-n are write receipts, O-1 is J2's overlay receipt, D-1 a deletion receipt, B-54 the live index. R-43, the rule from /1, is active in the tail only from T2 to T6 and is never retrievable as a rule in force.

| T | Handoff, and what is stored | Closes on (delivery acknowledged) | Agent may say |
|---|------------------------------|----------|-----------|
| T1 | Owner to J1. Entry #204 flushed with two immutable, tagged owner spans; a quoted span yields no correction | Durable flush with address, before the model call | "captured" |
| T2 | J1 to J5. Events /0 and /1 queued (put_once on the correction ID); both sentences enter the tail | Queue durable before the reply | "captured, acceptance pending" |
| T3 | J5 to J14. One child per repair: /0.a supersede F-0412, /1.a rule R-43@1 for rung 1. Requests carry addresses, not words; a ledger row is a proposal | J14 records each request ID | nothing new |
| T4 | J14 to J5. Judge down. Read set S-101; F-0587 pending (W-1), closure of F-0412 held (W-2), R-43 pending (W-3): durable, not terminal | J5 records the pending receipt; events stay open | "captured, acceptance pending" |
| T5 | Owner to J14. R-15@4, "supplier drafts from the sales address, nobody in copy", applied unchecked (W-4); S-102 published | W-4 | "accepted, unchecked until the judge returns" |
| T6 | J14 to J5. Before the next model call J5 reads S-102 itself; R-43's tail line contradicts R-15@4 and is withdrawn | A re-check receipt naming S-102 | A one-line notice in s1012, then "captured, acceptance pending" |
| T7 | Judge to J14. The late verdict on S-101 is discarded (R-15 moved 3 to 4); each pending request resumes on S-102 as a new attempt linked to its earlier receipt. Retry rule (J14 §7.2, A.3): a retry whose latest receipt is terminal gets it back; a pending receipt is never returned, the retry runs a new attempt; an owner's approval of a hold is also a new attempt on the same request | The resume, per request ID | nothing |
| T8 | J14 to J5. F-0587@1 accepted; F-0412@2 superseded, since owner facts have earned closing permission (J14 §7.5) and the replacement is his own words. W-5 names S-102, S-103, E7, /0.a; the J2 delivery record is in the same transaction. Cold start: closure held, F-0412@1 stays live | W-5: /0.a terminal, /0 processed | "accepted, not yet retrievable"; cold start adds "held for your approval" |
| T9 | J14 to J2. Overlay rows F-0587@1 and F-0412@2, owner only; the revision map (J2 §8.2) hides F-0412@1 in B-54. J14's delivery record (J14 Appendix A.2, Table 6) is closed when acknowledged_by = O-1 | O-1 | nothing |
| T10 | J2 to J5. /0.a marked retrievable; the /0 tail line leaves because every child is retrievable or held | J5 records O-1 | "retrievable" |
| T11 | J14 to J5. R-43 held on S-102: clashes with R-15@4 (W-6); one report item. /1.a terminal, /1 processed | W-6: acknowledged, not accepted | "held for your approval: clashes with R-15" |
| T12 | J14 to J2. R-43 recorded as a hold; readers are the owner alone (the intersection of #204/1 and supplier-drafts.md) | J2's overlay receipt | nothing |
| T13 | Scheduler to J2. Build B-55 starts: manifest S-103, E7 | Manifest written | nothing |
| T14 | Owner to J14. Erase /0: E7 to E8 first; D-1 from the links; F-0587 tombstoned; F-0412@2 stays superseded; pending lines and holds dropped; the number's keyed hash enters the suppression identity | D-1 written; erasure incomplete until every place reports | "erase incomplete" |
| T15 | J14 to J1. Span 0 redacted, span 1 kept; markers rebuilt; controller-transcript copies redacted; window rebuilt with an eviction event; provider copy named. The closing claim waits for the last row of D-1: J1, J2, J5 and J14's own rows, Git storage and backups with the recovery checkpoint (J14 §7.7, Table 3) | J1's rows of D-1 | "erase incomplete", then after the last row "all reachable copies removed; not reachable: provider copy" |
| T16 | J1 to J2. The read ledger drops the redacted range | J2 records the event | nothing |
| T17 | J14 to J2. Overlay rows and use keys dropped; the revision map tombstones F-0587 | J2's row of D-1, once no build that read E7 can swap in | as T15, after the last row |
| T18 | J14 to J5. /0 kept as an address only; tail line and evidence quotes dropped; the tail waits until J5 has applied E8 | J5's row of D-1 | as T15, after the last row |
| T19 | Scheduler to J2. B-55 finishes: swap refused (E7 is not E8); B-54 and the overlay serve. With no erasure, B-55 swaps in with the overlay rows and revision-map entries newer than S-103 | The swap decision | nothing |
| T20 | sa3 to J2. It asks for the mobile and R-43 and gets nothing: no entry, pointer, tombstone, hold or count. R-43's readers are the intersection of its sources', the owner alone; no grant exists | The pull receipt (S-104, E8) | To sa3 nothing; to the owner "held for your approval" |
| T21 | Owner to J2 (case C6). sa3 loses supplier-drafts.md; reader sets recomputed; a running query is filtered again at return | J2 records the permission version | nothing |
| T22 | J14 to J1 (C8). Quarantine of an injected tool result already in the window: entry flagged, markers rebuilt, window invalidated and rebuilt | J1's quarantine receipt | nothing |
| T23 | J14 to J2 (C8). Every row reached through links is marked; only the audit view shows it | J2 has applied the epoch | nothing |
| T24 | J14 to J5 (C8). Evidence and fixtures linked to the span marked (not represented in the model, see the coverage table); the tail waits until J5 has applied the epoch | J5 has applied the epoch | nothing |

: The 24 transitions. "Closes on" is the acknowledgement that ends the handoff, *delivery acknowledged*; an operation is *terminal* only when it reaches accepted, held or refused, so a pending receipt can be delivered and acknowledged without its operation being terminal. "Agent may say" is the only owner-facing claim the transition permits.

The series rules behind the table: handing off is not completing, so a sender keeps each message in a durable outbox and resends until the receiver acknowledges the resulting state; every receiver is idempotent on its message key; a delivery record carries IDs, never content; every read path serves only at the newest erasure epoch its stage has applied, and waits otherwise.

**Faults.** At every handoff the checker injects, one at a time, a **crash before the acknowledgement** (the receiver acts, its acknowledgement is lost, the sender resends), a **duplicate** delivery, and a **reorder** (the message goes behind everything else in flight). Beside the journey and its cold-start branch it runs eight cases: C1 commit before notification (a crash right after publication; a lost delivery); C2 old copies of T2, T8 and T9 arriving after the erasure; C3 a pending receipt, then the judge's recovery; C4 two repairs from one correction; C5 a correction committed while an index builds; C6 permission revoked during a query; C7 erasure while content is loaded in the window; C8 quarantine after the content is loaded.

| ID | Invariant, checked after every step |
|--|------------------------------------------|
| I1 | No correction is lost: each one in the record is queued at J5 or recoverable from the record; an event closes only when every required child is terminal; at rest each is terminal or in a named pending state |
| I2 | Nothing forbidden is readable: no reader class reads erased content, quarantined content outside the audit view, or an item outside its allowed readers, by any path, including a query already running |
| I3 | No claim beyond the state: each owner-facing claim uses only the words its transition allows, and the newest claim on a subject stays true at every step |
| I4 | Derived access is the intersection: every row J2 holds records readers equal to the intersection of its sources' sets, through the dependency links |
| I5 | No contradiction in force: at every model call, no provisional tail line contradicts an always-loaded rule published before that call's check |

: The five invariants.

**Result.** All 516 fault runs passed, 172 each of crash, duplicate and reorder; with the 11 structural checks (the specification and ten cases) the checker reports 527 PASS and 0 FAIL. Of the 172 reorders, 104 were no-ops, with nothing in flight to overtake, so they tested nothing; the other 68 test reordering. The checker also removes one mechanism at a time, 18 seeded defects in all, and requires the run to fail: it caught 18 of 18. Without the re-check inside the model call (T6), R-43's line stays in force and I5 fails. Four further sequences are kept as regression cases, each passing on the model and failing when its mechanism is removed: an erase and a quarantine that land while a query runs (return-time epoch check), a retry while the judge is down (a new attempt, never the cached pending receipt), and a correction whose reply reaches the model with no separate turn-boundary event (the re-check inside the call).

What the run shows is narrow: **the enumerated scenarios passed.** It covers scripted journeys, handlers that run atomically and one injected fault at a time; it does not show that every legal sequence keeps the invariants, and it says nothing about code. The table separates what the model asserts from what it only represents and what it executes.

| Behaviour | Asserted after every step | Represented in the model state | Executed by a script |
|---|---|---|---|
| No correction lost; parents close on every child (I1) | yes | yes | journey, C3, C4 |
| Nothing forbidden readable, including answers in flight (I2) | yes | yes | journey, C6 to C8, regressions a and b |
| Claims within the state (I3), derived access (I4) | yes | yes | every case |
| No contradicted tail line at a model call (I5) | yes | yes | journey, regression d |
| Retry rule: pending never returned from cache | at rest, by receipt count | yes | C3, regression c |
| Marking rule evidence and fixtures on quarantine (T24) | no | no: the epoch is applied, the marking is not modelled | C8 |
| Owner approval of a hold | no | no | none |
| Two faults at once, generated sequences | no | no | none |

: What the checker covers. The next step is generated legal event sequences with every returned answer and model call observed independently.

---

_J-series paper J5 | Version 7.4 | 2026-10-21_
