Skip to content

Phase 6 item 6.16: navigations with a body (clazel-fetch half; ipc and kernel not done) - #177

Draft
atiernan wants to merge 142 commits into
mainfrom
phase6/6.16-post
Draft

atiernan wants to merge 142 commits into
mainfrom
phase6/6.16-post

Conversation

@atiernan

@atiernan atiernan commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Item 6.16, built in part: clazel-fetch and clazel-ipc are done; clazel-kernel does not handle Submit, so the item stays open and no tier changes.

clazel-fetch

  • Requests carry a method, body with content type, initiator and origin redirect-taint. Content-Type/Content-Length (Fetch 4.6 steps 6-9), Origin on non-GET/HEAD, body octets after the head, HTTP-redirect fetch step 12 (301/302 POST to GET without body; 303 all but GET/HEAD; 307/308 keep method and body, sent again), cookie context takes the method's safety and the initiator (no Lax/Strict cookies on a cross-site POST). Only GET and POST; body at most 16 MiB.
  • Spec/contracts df3f5afe unchanged except a05f847c (body_len_ok, same meaning; lemma_rewrite_plain_get). 255 verified, 0 errors; 81 mutations all certified, 0 survive; tests/conformance_post.rs 1378/1378 against a model of step 12 with rust-url. independent.rs still requires a plain GET (not widened). Four mutations whose certificates time out at 600 s were dropped.

clazel-ipc

  • Submit (tag 12, renderer to kernel: url, method, content type, body); tag 9 Navigate stays GET-only. Spec committed first (53f80793), then codec. 221 verified, 0 errors; example lemma; tests round-trip three messages and the largest that fits; 102 mutations, 102 killed with certificates, 0 survive (4 new, 2 old repaired).
  • Deviation from the plan's proposed 16 MiB: one Submit is one frame (MAX_FRAME is 1 MiB), so with a URL, method and content type of at most 8192 octets the body may be at most 1,040,320 octets (lemma_submit_fits_frame). Larger needs chunking or a larger MAX_FRAME; not done.

clazel-kernel (written 2026-11-19, NOT verified: no Verus run, sent to CI)

  • 5fa21a9a contracts first: Event::SubmitTab (declassified part of another domain's Submit, never produced by the host), declassified for Submit, statements of theorem_body_from_requester, theorem_body_sent_once, theorem_redirect_method, theorem_post_cookies.
  • 69ca8a4c executable Submit (submit_request_exec, begin_navigation_exec takes the request), SubmitTab arms and lemma_d_submit through the noninterference lemmas.
  • a4ccb60c src/body_theorems.rs (proofs: bodies_step invariant over traces, one-step facts for sends, fetch theorems at the kernel), 10 new tests/fetch.rs tests (34 pass natively; a test found that the exec frame gate let an uncommitted renderer's Submit through, fixed), 6.16 row updated.
  • Expect Verus errors in the kernel (proofs written blind). Not done: independent transcription for bodies, the four dropped fetch mutations, kernel mutations for Submit, Kani. Native: clippy clean, cargo xtask check passes. Proof jobs need approval.

Verify output

  • cargo xtask check: STATIC CHECKS PASSED; rustfmt and workspace clippy clean (clippy last run before the ipc work).
  • cargo xtask verify --part crate clazel-fetch: CRATE PART PASSED; --part crate clazel-ipc: CRATE PART PASSED.
  • Kernel: cargo verus verify 866 verified, 0 errors at be0caa3f (re-run on the committed tree; the kernel's mutations, tests and part run were not run).
  • cargo xtask verify --changed not completed (libvulkan missing in WSL for the workspace tests). CI's full verification has not run.

🤖 Generated with Claude Code

atiernan and others added 25 commits November 16, 2026 01:09
docs/phases/phase-6.md is the detailed plan: decoders for PNG, JPEG, GIF
and WebP at tier 1 (the maintainer's decision), DEFLATE and the form data
set at tier 2, image items in the display list, form submission with POST
through the kernel, ORB, and HN's login and comment forms as the exit.
The 6.0 decisions are taken as recommended, by a Claude session on the
maintainer's delegation.

ROADMAP.md: Phase 4 complete (CI green at 72e11de, run 43742499291),
Phase 5 built with its tier raises left, Phase 3's remaining items
restated, Phase 6 linked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (item 6.1)

At 4ad507b2, the commit clazel-css and clazel-encoding use, with licence,
SOURCE.md and a SHA-256 manifest. Nothing reads them yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Counts image formats, img attributes, srcset, CSS url() uses, SVG elements
and form shapes on pages; stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Measured counts replace the 'not yet measured' text, licences of the later
format suites are recorded, and the plan gains the static SVG item.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ion and Kani step harness (item 6.3)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…em 6.7)

Statements first, as the tier 1 rule asks. This commit holds:

- the GIF89a header comment of lib.rs (the pinned standard, section
  numbers, the ten listed choices);
- the decoder's state (`Gif`) and its invariant (`Gif::inv`, `Lzw::inv`,
  `Sink::inv`), with the work buffer layout (`work.rs`);
- the harnesses of proofs.rs: the item 6.3 template on the GIF step
  function (instantiated from another crate for the first time), LZW over
  any table state and contents, the sink, the interlace row over every
  height, and the interlace pass covering a frame exactly once.

The code behind the harnesses is STUBBED: `Gif::byte`, `Lzw::feed`,
`Sink::put` and `next_interlaced_row` do nothing useful, so harnesses
asserting their results fail and the crate warns about dead code. The
implementation follows in later commits. Not in the workspace's test-data
check yet either (the vendored files come with the tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The implementation behind the harness statements of the previous commit.

- lzw.rs: GIF89a Appendix F variable-code-size LZW as a one-byte-at-a-time
  state machine over three arrays in the work buffer. Full-table deferred
  clear as browsers do, the first code after a clear a root, a code above
  the next free one an error. Safe over any table contents: every access is
  checked and a prefix chain is followed at most TABLE_LEN steps.
- sink.rs: colour indexes through the palette onto the canvas, interlacing
  (Appendix E passes), transparent index, clipping to the canvas.
- decoder.rs: the blocks of GIF89a (header, screen, colour tables, image
  descriptor, Graphic Control Extension, other extensions skipped by
  sub-block size, trailer), frames composited with the previous frame's
  disposal (none, keep, background to transparent, previous from a saved
  canvas), implementing clazel_image_shape::Decoder, with Gif::frame for
  delay, disposal and rectangle.

Tests, the vendored data and the Kani run follow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…6.7)

Wuffs commit b36a81d (the pin 6.1 recorded): test/data/*.gif (16 files) and
test/data/artificial-gif/*.gif (15), byte for byte, as two suites under
crates/clazel-gif/tests/data/ with SOURCE.md (upstream, commit, licence,
each file's SHA-256, provenance from Wuffs' README) and LICENSE.md (Wuffs'
LICENSE-MIT, our choice of MIT or Apache-2.0).

`cargo xtask check` requires every suite under tests/data/ to have a
converter (xtask/src/testdata.rs), so GIF gets the one binary files get
(like the fonts): xtask/src/testdata/wuffs_gif.rs checks each file's
SHA-256 against SOURCE.md and that it starts with GIF89a, and writes a table
embedding it with include_bytes!. The .giflzw and .make-artificial.txt files
beside them upstream are not vendored.

The `gif` crate 0.14.2 (default features off, std only) as a dev-dependency
for the differential test, with its one dependency weezl 0.1.12; both rows
in docs/DEPENDENCIES.md, class test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… 6.7)

tests/conformance_gif.rs prints four clazel-conformance lines:
- Wuffs' GIF files and artificial files against the gif crate 0.14.2, every
  completed frame's composited RGBA exact (the test composites the crate's
  frames itself with the listed choices), plus frame facts and how the
  stream ends. 25 of 31 agree; 6 differ in listed choices, each named with
  its reason (empty palette, no frames, no/short pixel data, a zero-width
  frame, garbage LZW after the last pixel).
- Every file at chunk sizes 1 to 4096 with and without empty chunks equals
  the whole-file decode, with the invariant checked after every step and
  canary bytes past the buffers untouched.
- Deterministic byte mutations of every file (flips, truncations, deleted
  and repeated runs): no panic, invariant kept, chunking changes nothing.
- 62 GIFs made by hand: disposal 1, 2, 3, transparency, local tables,
  clipping, every kind of extension, interlacing at every height 1 to 40,
  and a real LZW encoder through every minimum code size with both a clear
  and the deferred clear at a full table.
Plus s.gif, the 1 by 1 GIF of Hacker News's pages. Miri strides are in the
file's header.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The statements of the first commit did not all survive contact with the
model checker, so this commit changes them, and says how:

- `lzw_any` (LZW over any table state) is split in two: `lzw_any` the whole
  of `feed`, `lzw_code_any` one code. The latter found a real mistake in the
  invariant as I had stated it: a clear code lowers `code_size` below the
  bits waiting in the buffer, so one code keeps only the table part of
  `Lzw::inv` (new `inv_table`), and `feed` drains the buffer afterwards.
- The step-function harness (item 6.3's template on all of `Gif::step`) is
  NOT here: CBMC passed 6 GB after 5.5 minutes and was stopped. It is
  replaced by `control_byte_any` and `data_byte_any`, the byte function in
  each of its two halves, for any state with the invariant. The README
  says what that leaves argued rather than proven. The template itself
  expands and runs from this crate.
- What made them finish: loops of a constant bound where the model checker
  was unwinding to the global bound (the up-to-three codes of a byte, the
  interlace pass search, the output of a string), `Lzw` generic over the
  code size (`Lzw<BITS>`, 12 in the browser, 3 and 4 under Kani), and
  `#[kani::solver(kissat)]` on the heavy ones (the default solver ran out of
  memory on `data_byte_any`).

7 harnesses, 7 pass (WSL, Kani 0.68.0, `cargo kani -p clazel-gif`); a mutated
`Lzw::add` fails `lzw_code_any`. The tier stays 0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The first Miri run of the suites (files of at most 16 KiB, 18,000-pixel LZW
cases) ran for over 40 minutes, so under Miri every suite is cut to a
stride: files of at most 2 KiB (21 of the 31), chunk sizes 1 and 64, 3
mutants per file, every fourth interlaced height, no LZW case. Measured:
8 tests, 291 s in all, the longest 89 s (the limit is 300 s).

docs/phases/phase-6.md: the 6.7 row of the status table, with what is
built, proven, tested and not done (the template harness on the whole step
did not fit; LZW is proven at 3 and 4 bits), and a note on the 6.3 row that
the template has now been run from another crate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New crate, tier 0 with target tier 2 (phase-6.md 6.0(b)). Only the part
people review: spec.rs transcribes HTML §4.10.18.3 "reset the form owner" and
"form owner", §4.10.22.4 "constructing the entry list" (steps 1 to 5.11),
disabled (with the fieldset rule), the list of options and option disabled,
the textarea wrapping transformation, value sanitization, the dirname entry
and the image button's coordinates, over a clazel-dom arena with the control
state in a side table. HTML pinned at 0793d3d8544e. contract.rs states what
the executable functions will be proven to meet. No executable code yet.

The spec typechecks and its termination proofs verify under Verus (22
verified, 0 errors). Modelling choices are listed at the top of spec.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…unctions, proven (item 6.13)

Each is proven equal to the spec function it names, under Verus (77
verified, 0 errors): newline stripping and normalization, whitespace
stripping, ASCII case-insensitive and exact keyword matches, the textarea
wrapping line breaks, decimal, the cols character width (non-negative integer
parsing, cut off at usize::MAX), attribute lookup, the input type, element
classes, the walks up the ancestors (root, nearest form, datalist, disabled
fieldset, option's ancestors, first legend child) and the tree order walk as
a stack machine whose state is the spec's tree order still to come.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, proven (item 6.13)

The form owner and the controls of a form (the form attribute resolved by
the root's tree order and a once-per-form lookup, the parser's association
otherwise), the values of text, textarea (newline normalization, hard
wrapping), button, checkbox, radio, hidden and image fields, a select's list
of options as an explicit-stack walk, option disabled and value, and the
whole of step 5's body for one field are proven equal to the spec (152
verified, 0 errors under Verus). Lemmas prove every node of a tree order has
the form's root as its root, so "connected" is "the root is the document".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…item 6.13)

Twenty hand-made cases of the algorithm's steps and the form owner, run
through the proven executable functions, and the Verus proofs kept after the
clippy fixes (158 verified, 0 errors).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…m 6.13)

All 32 pages of form-submission-0 need script, so the test reads the markup
and the data tables of three of them (constructing-form-data-set.html,
url-encoded.html, submit-entity-body.html) and runs the script-free part:
the form the page builds, the element it clicks, the entry list compared
with what the page asserts. 19 of 19 pass; the rest of those pages' checks
(FormData, events, files, frames) need script and are not counted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (item 6.13)

lemma_entry_names (field_entries, entries_of): every entry has a non-empty
name, proven for the spec. examples.rs evaluates the string algorithms on
small inputs. mutations.json: ten certified mutations of the string
algorithms and ten of the entry list's steps recorded as killed
incidentally (no spec lemma is false; the exec proofs break).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ection numbers

The mutation run passes: 20 mutations, 10 killed by a theorem, 10 killed
incidentally. docs/phases/phase-6.md: 6.13's row, and the item's section
numbers corrected against the HTML text (§4.10.18.3 and §4.10.22.4).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ssion algorithm (item 6.14)

URL's application/x-www-form-urlencoded serializer, HTML's conversion to
name-value pairs, text/plain, multipart/form-data, picking an encoding, and
the form submission algorithm's steps to a navigation request. Contracts
only; no executable code yet (rule 3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… recursive definitions (item 6.14)

Same meaning as the quantified form; recursion matches how every other
helper in the spec is written and what the implementation loops over.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the spec (item 6.14)

Every public function of src/submit/exec equals its spec function:
serializer (UTF-8 and single-byte), pairs, text/plain, multipart,
picking an encoding, attribute states, targets, and submit_exec. Lemmas:
the serializer's output is ASCII, scalar strings stay scalar. Spec: the
unencodable-code-point literals are explicit code points. clazel-encoding:
run_encoder_handler is public (no proof change).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (item 6.14)

Worked examples evaluated by Verus; 21 mutations of the new spec; the
xtask converter and vendored WPT files for the urlencoded, text/plain and
multipart tests; hand-made submission tests; a differential test of the
serializer against form_urlencoded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… 6.14)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@atiernan
atiernan added this pull request to stack #175 November 16, 2026 13:22
@atiernan atiernan changed the title phase6/6.16 post Phase 6 item 6.16: navigations with a body (clazel-fetch half; ipc and kernel not done) Nov 16, 2026
atiernan and others added 8 commits November 21, 2026 09:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/ERRATA.md
#	docs/phases/phase-6.md
#	xtask/src/status.rs
#	xtask/src/testdata.rs
…ion)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/DEPENDENCIES.md
#	docs/phases/phase-6.md
#	xtask/src/status.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	Cargo.lock
#	docs/phases/phase-6.md
#	xtask/src/status.rs
#	xtask/src/testdata.rs
…integration)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	Cargo.lock
#	docs/DEPENDENCIES.md
#	docs/phases/phase-6.md
#	xtask/src/status.rs
#	xtask/src/testdata.rs
…tegration)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/phases/phase-6.md
…ation)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/phases/phase-6.md
@atiernan
atiernan temporarily deployed to full-verification November 21, 2026 09:41 — with GitHub Actions Inactive
atiernan and others added 4 commits November 21, 2026 11:03
…oofs

A nested `matches` chain needs parentheses, and Seq::subrange takes int.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The induction needs only lemma_step_sent; with item 6.16's Submit the
unfolded step exceeded the solver's resource limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
display-before-commit's `find` and begin-keeps-old-connections' witness
named the spec as it was before Submit and begin_navigation's request
argument. Neither `expect` changes; both are still certified kills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y WebP)

decode_config sets Coding::Progressive (JPEG SOF2) or Coding::Lossy (WebP
that has or may have VP8 frames), so work_len can size the work buffer for
the stream's own coding instead of the largest one every stream of the
format could need. Config::new gives Coding::Base; with_coding refuses a
coding the format does not have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan temporarily deployed to full-verification November 21, 2026 17:52 — with GitHub Actions Inactive
atiernan and others added 11 commits November 22, 2026 16:55
…five that do not finish

unfilter_any now assumes bpp 1 to 8 (filter_bpp() is .max(1)); adam7_geometry
becomes three passing harnesses; adam7_sizes_add_up, control_any, finish_row_any,
feed_any and data_any become NOT-a-harness comment blocks with measured reasons.
cargo kani -p clazel-png: 8 successfully verified harnesses, 0 failures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d not fire)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/DEPENDENCIES.md
#	xtask/src/testdata.rs
…ase 6 integration)

# Conflicts:
#	Cargo.lock
#	docs/DEPENDENCIES.md
#	xtask/src/testdata.rs
@atiernan
atiernan removed this pull request from stack #175 November 22, 2026 17:37
@atiernan
atiernan changed the base branch from phase6/6.14-submission to main November 22, 2026 17:37
… now targets main)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan temporarily deployed to full-verification November 22, 2026 17:51 — with GitHub Actions Inactive
<p>Test passes if the word "PASS" appears below</p>
<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
<p>Test passes if the word "PASS" appears below</p>
<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");

This branch was previously deployed

1 inactive deployment
full-verification — b04c0e50 Deployed Nov 22, 2026 by atiernan via Approve the proofs #770
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants