Skip to main content

Executable stream-framing lab

10–16 implementation hours, inside the 22–32-hour extension. Download the starter, reference, wire contract and checks. Python 3.9+ with no dependencies suffices. No network endpoint is opened by these tests.

  1. Spend 2–3 hours predicting state transitions, error behavior and timer events from README.md.
  2. Run python3 -B check.py starter and retain its expected failure. Spend 4–6 hours implementing bounded header/body state and the terminal-state API.
  3. Spend 2–4 hours comparing fragmentation patterns, EOF cuts and simulated deadlines; add independent irregular-chunk and error cases.
  4. Spend 2–3 hours rejecting a seeded bug, reviewing the reference after your attempt and writing the socket-adapter plan.

Checks cover all 1024 partitions of an 11-byte stream, 1029 EOF cuts of a maximum frame, payload boundaries, coalesced messages, sticky errors and fixed simulated deadlines. Five faults are rejected by the author verifier. This verifies a decoder contract, not TCP, TLS or real event-loop timing.

Submit source, predictions, logs, a fault/repair example, an independent case, adapter design and assistance disclosure. All NW1–NW6 must pass. Existing real socket-server and packet-inspection work remains required.