Skip to content

Phase 7.16: FetchScript and UpdateUrl in the kernel (proven) - #289

Open
atiernan wants to merge 5 commits into
mainfrom
claude/kernel-script-fetch
Open

atiernan wants to merge 5 commits into
mainfrom
claude/kernel-script-fetch

Conversation

@atiernan

Copy link
Copy Markdown
Member

Phase 7.16, first slice: the kernel serves a renderer's script fetches, and the IPC schema carries the new messages. UpdateUrl is decoded and allowed from a renderer, but the kernel does not act on it yet (see "Not done").

What is in it

  • clazel-ipc: spec, codec, lemmas, examples, tests and mutations for FetchScript, UpdateUrl, ScriptResponse, ScriptBody, ScriptEnd and ScriptFailed. 106 mutations, all killed with certificates.
  • clazel-kernel spec: fetch_sub (the one function FetchStyle and FetchScript share, with a script flag), the Script* frames, and the sub-fetch's script flag. The spec and the statement of theorem_script_fetch_shape were committed before the proof (rule 3).
  • clazel-kernel proof and exec: theorem_script_fetch_shape is proven, the existing sub-fetch theorems are restated over script, and the exec kernel handles FetchScript.
  • Fix: the last commit re-anchors the find/replace text of two stale clazel-ipc mutations (dir-navigate-not-renderer, msg-display-direction). Their expect values and certificates are unchanged.

Not done, left for later PRs

  • UpdateUrl in the kernel, with theorem_url_update_same_origin. Today the kernel ignores an UpdateUrl: the renderer's URL and the address bar do not change. Doing it means changing a renderer's url (or adding a new state table), and that touches the kernel invariant, the noninterference unwinding, the exec records and every lemma that says "this message leaves the renderers alone". It deserves its own PR, with the statement committed first. The plan is to accept it only when the resolved URL's lock equals the renderer's lock and the lock is not opaque, which keeps lock_of_url(r.url, r.id) == Some(r.lock), then restate theorem_address_bar_integrity and theorem_cookie_noninterference over it.
  • Fetch (fetch()/XHR, CORS, forbidden headers), and with it theorem_cors_read, theorem_forbidden_headers and ORB for no-cors responses (listed in the spec's modelling choices).
  • theorem_popup_needs_input and OpenTab.
  • Certified kernel mutations for theorem_script_fetch_shape. None was added in this PR; the mutation count is 74, all of them the existing ones.

Results (run locally)

  • cargo xtask verify --part crate clazel-ipc: CRATE PART PASSED. Verus: 218 verified, 0 errors. Mutations: 106 killed, 0 survived.
  • cargo xtask verify --part crate clazel-kernel: CRATE PART PASSED. Verus: 876 verified, 0 errors. Mutations: 74 killed, 0 survived.
  • cargo fmt, cargo clippy -p clazel-ipc -p clazel-kernel --all-targets -- -D warnings, cargo xtask check (static checks passed) and cargo test -p clazel-ipc -p clazel-kernel all pass.
  • No tier is raised, and no clazel-sys file is touched. Full CI verification has not run on this PR, and its proof jobs need a full-verification approval, so this is not yet done.

🤖 Generated with Claude Code

atiernan and others added 5 commits November 22, 2026 10:40
…tBody, ScriptEnd, ScriptFailed

Contracts first (CLAUDE.md rule 3): the schema rows, tokens and parser.
The codec, lemmas, examples and mutations follow.

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

lemma_script_body_fits_frame: a ScriptBody of at most max_script_chunk octets,
whatever its request id, fits one frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e's statement

Contracts first (CLAUDE.md rule 3): fetch_sub (fetch_style's function with a
script flag), the Script* frames, the sub-fetch's script flag, and the
statement of theorem_script_fetch_shape. The proofs and the exec kernel
follow.

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

FetchStyle and FetchScript run through one function, fetch_sub, with the
sub-fetch's script flag choosing the frames; the existing sub-fetch lemmas
and the noninterference proofs take the flag, and theorem_script_fetch_shape
is proven. Verus: 876 verified, 0 errors.

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

The 7.16 messages added lines to is_from_renderer, so dir-navigate-not-renderer
and msg-display-direction no longer matched their find text. Only find/replace
changed; expect and certificates are untouched.

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

Copy link
Copy Markdown
Member Author

Included in #286, which verifies all open phase 7 pull requests together; this merges with it.

This branch has not been deployed

No deployments
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.

1 participant