# Eight-node one-chance cascade demo

Standalone `cascade-model.js` exports CascadeDemo in a browser and CommonJS in Node. `create({p=.5,bridge=true,seed=1,horizon=8})` returns nodes, edges, snapshot(), step(), reset(). Coordinates fit an SVG viewBox `0 0 600 260`. Two four-node cycles are optionally joined by edge2–4. Source0 is informed initially. This small illustrative graph is separate from the stored120-node study and its bootstrap results.

Each step advances one round. Only nodes newly informed in the previous round attempt to inform their neighbors. Eligibility is determined from the informed set at the start of the round; concurrent attempts to a still-uninformed node each receive an independent pseudo-random draw, even if an earlier same-round attempt succeeds. All draws and attempts are returned so an owner-rendered diagram can explain what happened. Previously active nodes never retry failures. Attempt order is ascending source then neighbor identifier; successful frontier is sorted. Edges and graph order are deterministic.

Random generator is a32-bit LCG: state=(1664525*state+1013904223) modulo2^32, draw=state/2^32. This is a reproducible teaching generator, not cryptographic randomness or a calibrated social model. Success is draw<p. Reset restores the original seed, round0 and source-only state. Finished means no newly active nodes or the round horizon reached. Further step calls do nothing and return an empty attempts list. Horizon0 permits no attempts. Reaching the horizon does not assert that spreading would have stopped with more rounds.

Snapshot returns round, informed IDs, frontier IDs, coverage and finished. Coverage includes source0. No real people, adoption, belief, trust, influence efficacy or probability estimation is represented. p is assigned. A shared-neighbor response follows1-(1-p)^k only under the assumed independent attempts.

Run `node test.cjs`. Forty deterministic trajectory cases check bounds, persistence and absence of repeated directed attempts. Explicit checks cover p0, p1 connected/disconnected graphs, finite horizons, deterministic reset and rerun; eleven invalid-input guards pass. No Site changes or rendering code is included.
