freecoding.school100% FREE · NO SIGNUP
The Seven LayersISSUE #70 of 73

agent failure & ROLLBACK · when a worker goes bad

OMNIVSThe Silent Failure
OMNI saysWhen a worker commits a bad block, VERIFY catches it and the orchestra ROLLBACKs the chain to the last known-good — apoptosis ends a worker, rollback undoes its damage.

Apoptosis (mol-65) handles a worker that finishes; rollback handles a worker that finishes wrong. The two are different tools. When a critic's VERIFY fails after a result has already been COMMITted — or when downstream evidence proves an earlier block was bad — the orchestra performs a ROLLBACK: it reverts the per-user chain to the last block that VERIFYed clean, discarding everything after it. The bad worker is already gone (it apoptosed); rollback removes its footprint from the durable record.

Rollback is precise because the chain is append-only and hash-linked: each block names its parent, so reverting to block N is unambiguous and replay from N forward is deterministic. After a rollback the conductor can respawn the failed stage with a tighter contract — smaller scope, stricter critic, lower budget — so the second attempt is less likely to repeat the fault. Detect (VERIFY) → revert (ROLLBACK) → respawn is the swarm's self-healing loop.

Power-ups you unlock

The Silent Failure attacks — common mistakes

Boss battleCommit three blocks, fail VERIFY on the third, ROLLBACK to the last good block, then respawn that stage with a smaller budget and show it pass.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#b388ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
const be = (layer, verb, payload) => ({ layer, verb, payload });
const CHAIN = [];
function commit(meta, good){
  const prev = CHAIN.length ? CHAIN[CHAIN.length-1].hash : 'genesis';
  CHAIN.push({ n:CHAIN.length+1, prev, meta, good, hash:'h' + (CHAIN.length+1) });
}
const verify = (block) => block.good;          // metaSurf VERIFY
function rollback(){                            // revert to last VERIFYed-clean block
  while(CHAIN.length && !verify(CHAIN[CHAIN.length-1])) CHAIN.pop();
  return CHAIN.length ? CHAIN[CHAIN.length-1] : null;
}
const out = [];
commit({ stage:'scout' }, true);
commit({ stage:'build' }, true);
commit({ stage:'risk'  }, false);              // a bad worker commits a bad block
out.push('committed: ' + CHAIN.map(b => b.meta.stage + (b.good ? '✓' : '✗')).join(' '));
const good = rollback();
out.push('VERIFY failed on risk → ROLLBACK to ' + good.meta.stage + ' (#' + good.n + ')');
commit({ stage:'risk', budget:'tighter' }, true);   // respawn with a tighter contract
out.push('respawned risk tighter → ' + CHAIN.map(b => b.meta.stage + (b.good ? '✓' : '✗')).join(' '));
document.getElementById('o').textContent = out.join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Swarm Hormones · Backpressure · Cortisol Throttles SpawnsTool Use As EXPRESS · Agents Reaching The Outside World ›