Lion Cipher Lab

Put four agents and a human analyst on ONE shared incident case file, measure the writes that silently vanish, fix it twice - with compare-and-swap and then with a merge policy that knows what each field means - and price both fixes

Why it matters

The moment you put more than one agent on one job, you have to decide where the shared truth lives, and the most natural answer - one case file everybody reads and writes - is also the one that fails quietly. This lab makes that failure concrete on a real cyber job: an enrichment agent, a timeline agent, a scoping agent and a human analyst, all building ONE incident case file during a live investigation. Stage one is the version everybody writes first: read the file, edit your copy, write it back. It loses 31 of the 47 contributions the four writers made on the walkthrough seed and a mean of…

What you'll learn

Steps in this lab

  1. The words first: blackboard, lost update, invariant, compare-and-swap, CRDT, grow-only set, last-writer-wins - and why the concurrency here is simulated
  2. Open a terminal and make a scratch folder (all three operating systems)
  3. The cyber job: one incident, four writers, and exactly what each of them intends to write
  4. The blackboard, the seeded scheduler, and the scorer - the one module everything else imports
  5. Prove the interleaving is reproducible, then watch a lost update happen
  6. Stage 1: naive read-modify-write, and the case file that argues with itself
  7. Why 'internally inconsistent' is a worse outcome than 'incomplete'
  8. Stage 2: give every record a version, compare-and-swap on every write, retry on conflict
  9. The retry storm: what optimistic concurrency costs when the bet stops paying, including the sweep that surprised me
  10. Stage 3: stop arbitrating writes. Merge them, by the type of the field
  11. The failure that matters: a human downgraded the incident and a machine overwrote her
  12. The bill for stage 3: a grow-only set can never take anything back
  13. The headline: five architectures, the same 31 operations, all 200 interleavings - including the baseline nobody runs
  14. When you would reach for a blackboard, when for message passing, when for a single writer - and when for none of them
  15. What this lab does NOT prove, and how to swap the simulation for real threads
  16. The way a pro does it differently

Open the full interactive lab →