# Mission: Structured clone

## Why
As a frontend engineer, you want durable judgment about the **structured clone algorithm** and **`structuredClone()`** — not another `JSON.parse(JSON.stringify)` habit, and not “hope `postMessage` copies everything.” When a value must be snapshotted, messaged, stored, or transferred, you should pick the copy tool on purpose and defend it in a design review.

## Success looks like
- Given a product need, choose among shallow copy, JSON round-trip, `structuredClone()` / implicit platform clone, transfer, and a custom serializer
- Know what structured clone is (the platform deep-copy / serialize-deserialize algorithm) and where it already runs for you (`postMessage`, BroadcastChannel, IndexedDB, History state, `structuredClone()`)
- Spot deal-breakers early (`DataCloneError`, clone cost, transfer detachment, lost prototypes/methods, JSON silent loss)
- Defend the choice in a design review with clear “detach / document / move / revive” constraints
- Complete light hands-on that locks the type matrix (cycles, Dates, throws, transfer) — not an engine implementation

## Constraints
- Frontend-first: system design decisions and browser/JS platform APIs
- Sibling to Web Workers, BroadcastChannel, and IndexedDB: those tracks already *use* structured clone as the message/storage model; this track owns the **algorithm, supported types, transfer, and when to call `structuredClone()` yourself**
- Short interactive lessons; dense facts live in `reference/`
- Zero new-from-scratch: start from the Workers messaging-cost model, do not re-teach `postMessage` or workers
- Decision fluency + light hands-on (same shape as BroadcastChannel / Workers)

## Status
**Complete** — lessons 1–5 done (lesson 5 passed). Decision fluency is the bar. Keep `reference/decision-playbook.html` + `integration-checklist.html` + the type/transfer sheets for design reviews.

## Out of scope
- Engine internals of StructuredSerialize / V8 snapshot format
- Shipping a general-purpose clone library (Lodash `cloneDeep`, etc.) beyond a decision note
- SharedArrayBuffer + Atomics as a first-class path (label only; advanced)
- Cross-origin `window.postMessage` / MessageChannel security model (issue #15 owns that surface)
- Custom wire-format design at protobuf/FlatBuffers depth
