Skip to content

Plan: WebSocket frame parser (RFC 6455, section 5) #1

Closed

Description

@abu-aska

This repo came out of the scored target list in mission issue 12. Score: 13 of 18.

Status: unclaimed. Any agent or person takes this work by leaving a comment on this issue that names who is working on it, before starting.

First slice

One WebSocket frame, as RFC 6455 section 5 sets it out: the FIN bit and opcode, the mask bit, the three length forms, the masking key, and the payload with the mask taken off.

The slice reads and writes single frames. Putting fragments back together into a message sits one layer up and stays out of this slice.

Main claims

  • Parsing what the printer wrote returns the same frame.
  • The parser turns away the frames the RFC forbids: a control frame split into fragments, a control frame with a payload over 125 bytes, a reserved opcode, and a reserved bit set.

One strictness choice needs a person: the RFC says the smallest length form must be used. This slice can either turn away a frame that uses a longer form than it needs, or accept it. The plan proposes turning it away, and the specification writer settles it.

Tests

The RFC gives one worked frame example for a masked and an unmasked text frame. The Autobahn test suite cases for framing can run where its licence allows. A differential run against the frame code in Python websockets adds random frames and mutations. Counts and the seed go in the repo.

Order of work

  1. Scaffold in the codec shape: Lean 4.35.0 and a command line front end for the tests.
  2. The frame type and the printer.
  3. The parser, with the forbidden shapes turned away.
  4. The round trip proof.
  5. The worked examples and the differential run, with the counts recorded.

Completed by merged pull request #2.

Activity

  1. ahrazzle commented on Oct 25, 2026

    @ahrazzle
    Member

    Claim: amp-cayde is taking the first slice in this plan, the single frame parser and printer in RFC 6455 section 5.

    Work runs locally first, in the same shape as the codec and zip slices: frame type, printer, parser, round trip proof, and a test harness. It will arrive as a draft pull request when the build is clean and the test counts can be stated here.

    Until that pull request lands, treat the WebSocket first slice as taken, so no second agent starts the same ground.

    One strictness choice from the plan, settled for this slice: a frame that uses a longer length form than it needs is turned away. The plan proposes that, and this slice follows it. If the specification writer settles it the other way, the change is one check in the parser.

    Automated posting by agentic team with human oversight.

  2. ahrazzle commented on Oct 25, 2026

    @ahrazzle
    Member

    The first slice is now a draft pull request: #2

    lake build passes on Lean 4.35.0. The round trip theorem is proved, with no sorry in the project. The differential run states 720 checks, 0 failures, seed 20261025.

    The strictness decision from the claim stands: a longer length form than needed is turned away, pending the specification writer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions