SkinDeepRESEARCHSteve Seguin

Self-editing with a protected state

Keep an explicit working state and protect new data until it has been processed. This revision keeps the self-editing idea while changing how the surrounding application handles memory.

A room check protects the next batch; code updates the state; the next call receives the pinned state and keeps space for more data.

How it works

  1. Check that there is room before fetching another batch.
  2. Apply the batch to a small state table, such as “apples: 13.”
  3. Keep that table visible on the next call, then remove the processed batch.

Already-delivered batches cannot be discarded by a retry. Earlier thinking is removed, so facts needed later must go into the explicit state.

What changed from the original?

The original agent could lose an unread batch during rollback. This version protects delivery and shows the working state at the end of each prompt. Its state file counts as active context; it is not an unlimited hidden archive.

What happened in the tests?

TrialCorrectTime
121K, run 124/2415 min
121K, run 221/2421 min
478K stream24/248.2 min

Both 121K runs retained every batch. The second made a coding mistake: its rewritten update script stopped applying deletes, causing three wrong totals.

On the 478K stream, code processed most batches without showing their raw text to the model. That is useful processing beyond the window’s size, but does not show the model understanding 478K tokens at once.

Why might it help? What can still fail?

The model spends less effort reconstructing past work, and a long stream can fit if its useful state stays small. Correct bookkeeping still depends on correct code. A state-size check cannot tell whether a total is right; tasks needing all original details may outgrow the state budget.

Technical details: state placement and verified updates

The harness reloads a pinned STATE.txt into the final message and counts it against the context budget. Placing changing state last preserves more unchanged prompt text for prefix caching. It also checks available space before fetching and prevents rollback from deleting a delivered item.

A subsequent verified-fold revision keeps one update script, runs its self-test and checks how many lines of each kind it handled. That addresses the observed delete bug; it is distinct from the completed trials above. The results above do not establish that later revision’s accuracy.

Completed results and failure analysis · Implementation and run instructions