Bead: asupersync-umelq.10.5
This document defines the canonical React integration patterns for the WASM
Browser Edition surface and maps each pattern to deterministic harness
scenarios in tests/react_wasm_strictmode_harness.rs.
Cross-framework canonical example index:
docs/wasm_canonical_examples.md.
The reference catalog covers:
- Task groups with explicit cancellation UX.
- Bounded retry after transient failures.
- Bulkhead isolation across independently scoped work.
- Tracing-hook diagnostic transitions for replay/debug flows.
All scenarios must preserve the runtime invariants:
- no leaked tasks or scopes,
- cancelled losers are drained before teardown,
- cancellation is explicit and observable,
- structured logs contain stable scenario IDs and replay metadata.
| Scenario ID | Pattern | Intent | Deterministic Assertions |
|---|---|---|---|
react_ref.task_group_cancel |
task group + cancel UX | User cancel on one grouped task drains cleanly while sibling completion remains valid. | cancel count and join count stay balanced; group scope closes leak-free. |
react_ref.retry_after_transient_failure |
retry | Two transient failures followed by success with bounded retry attempts. | retry_attempts=3, recoverable_failures=2, final outcome is success. |
react_ref.bulkhead_isolation |
bulkhead | Overload cancellation in one bulkhead does not block the sibling bulkhead path. | one cancellation, sibling success, independent scope closure. |
react_ref.tracing_hook_transition |
tracing hook | Emit stable hook transition diagnostics for troubleshooting and replay pointers. | hook transition is legal (active -> cleanup) and fields are deterministic. |
Each scenario emits deterministic fields with these required keys:
scenario_idpatternoutcomeretry_attemptsrecoverable_failurescancel_countjoin_countnotes
Tracing-hook entries additionally include:
hook_kindfrom_phaseto_phaselabelhandles_countdetail
Run the full reference-pattern harness:
rch exec -- env CARGO_TARGET_DIR=/tmp/rch-target-umelq105 cargo test --test react_wasm_strictmode_harness -- --nocaptureRun only the reference catalog deterministic test:
rch exec -- env CARGO_TARGET_DIR=/tmp/rch-target-umelq105 cargo test --test react_wasm_strictmode_harness reference_pattern_catalog_scenarios_are_deterministic_and_leak_free -- --nocaptureRun lint/format gates for touched surface:
rch exec -- env CARGO_TARGET_DIR=/tmp/rch-target-umelq105 cargo check --all-targets
rch exec -- env CARGO_TARGET_DIR=/tmp/rch-target-umelq105 cargo clippy --all-targets -- -D warnings
rch exec -- env CARGO_TARGET_DIR=/tmp/rch-target-umelq105 cargo fmt --check