Repository navigation
Conversation
dispatch_seq folds the spec's one-token step over a sequence of tokens; incremental_new_ensures and incremental_pump_ensures state what the incremental driver (exec::incremental, next commit) is to meet: the initial parser, and a pump that leaves the parser where the spec's step takes it over some tokens, returning for actions, at the insertion point, or once stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scope::function and define_method take Fn + Send + Sync, and the table holds each closure in an Arc that a call clones, so JavaScript that calls a native function while it is running runs it again, nested, instead of getting Error::Busy. HTML's document.write needs this: it runs the parser, which runs a script, which calls document.write (item 7.15). The test that pinned Busy now checks a three-deep re-entrant call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… step's contract exec::incremental::Incremental is Phase 4's "a driver, not a restructured spec": the proven tokenizer and step over an input stream that grows at the insertion point (document.write), pausing after every step that asks for an action (ScriptReady), at the insertion point, and at the end of an input that is not closed (a document.open parser). Verus proves that every call meets its callee's contract, that the invariant holds after every method, that every pump ends, and incremental_pump_ensures: the parser after a pump is the parser before given some tokens by the spec's step. It is not proven equal to parse; the html5lib document cases run through it and give parse_real's tree, and cases naming no scripting flag are now checked with scripting on as well (all 1,931 give the same tree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HTML's "clean up after running script" performs a microtask checkpoint when the last script on the stack returns; a host that runs a page's scripts from one scope (item 7.15) reaches the job queue there. Runtime::run_jobs now calls it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripting::Page parses a document with the scripting flag on through clazel-treebuilder's incremental driver and runs its scripts through clazel-js's public API, its state in the engine's Host: - "prepare the script element" (HTML 4.12.1.1) on ScriptReady: the type string, classic and module scripts, inline and external ones (fetched by the embedder: take_requests and fetched), async, defer, the pending parsing-blocking script, nomodule, event/for; mark as ready; execute the script element with document.currentScript; create and run a classic script, reporting exceptions, with a microtask checkpoint when the last script returns; - the text mode's end tag script steps (script nesting level, parser pause flag, insertion point), the tokenizer blocked on a parsing-blocking script, abort a parser, and the end (deferred scripts, DOMContentLoaded, the load event's wait for async scripts); - document.write, writeln, open and close, as edits of the input stream at the insertion point; - module scripts' HTML half (module map, fetch a single module script, HostLoadImportedModule, fetch the descendants of and link, run a module script), which ends in the engine's NotImplemented today; - evaluate a javascript: URL, and performance.now() coarsened to 100 us; - the minimum globals before 7.12's bindings: document (write, writeln, open, close, currentScript), performance.now, a wrapper per node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion-timing pages tests/scripting.rs checks each algorithm step: inline, external, async and defer ordering, the parsing-blocking script, document.write (nested, split tags, from external scripts), open and close, currentScript, javascript: URLs, module scripts reaching the engine, performance.now's coarsening, and a meta charset's reparse. It runs the six html5lib scripted_*.dat tree-construction cases (2 pass, 4 listed: they need 7.12's DOM methods) and 21 vendored WPT execution-timing pages with a stand-in for testharness.js and testlib.js, which the engine cannot run yet (17 pass, 4 listed: eval, Location, DOM methods, timers). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A click on a link whose URL is a javascript: URL sends no Navigate: the URL is the page's to evaluate in its own renderer (item 7.15), and the kernel never sees it. This renderer does not host scripting::Page yet, so the click does nothing for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
had a problem deploying
to
full-verification
November 23, 2026 11:27 — with
GitHub Actions
Error
…Miri The run took 201 s under Miri with every 7th page; two pages keep it near 130 s, well under the 300 s limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
requested a deployment
to
full-verification
November 23, 2026 15:42 — with
GitHub Actions
Waiting
atiernan
added a commit
that referenced
this pull request
Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
added a commit
that referenced
this pull request
Nov 23, 2026
Both sides made native closures re-entrant. One API: every closure is an Arc<NativeFn> that is Send + Sync (#294's design); Scope::shared_function (#295's name) stays as an alias of Scope::function, and SharedNativeFn is an alias of NativeFn. Cargo.toml dependencies are the union. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Contained in #298 (renderer pipeline, 7.17), which merges this branch together with the other half so they verify as one. Branch kept. |
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 item 7.15, HTML integration: the script half. Base:
claude/phase7-integration(#286).What landed
clazel-treebuilder: an incremental driver, proven (tier 2 stays tier 2).contract::dispatch_seq,incremental_new_ensuresandincremental_pump_ensures.exec::incremental::Incremental: the proven tokenizer and step over an input stream that grows at the insertion point.pumppauses after any step that asks for an action (ScriptReady), at the insertion point, and at the end of an input that is not closed (adocument.openparser). This is Phase 4's "a driver, not a restructured spec".--verify-only-module exec::incremental: 15 verified, 0 errors) proves:parser_inv,reachable_inv, the tokenizer'sabstracts/wf, the insertion point in range) holds after every method;pumpends;dispatch.parse(withdocument.writethere is no specparseto equal). As evidence, all 1,761 html5lib document cases also run through the driver, and each givesparse_real's tree.tests/incremental.rsexercises the driver as a script host would.clazel-js(two small API changes, both from the README's open questions).Scope::function/define_methodnow takeFn + Send + Sync, and the table holds anArc.document.writeneeds this: it runs the parser, which runs a script, which callsdocument.write. The test that pinnedError::Busynow checks a three-deep re-entrant call.Scope::run_jobs: a microtask checkpoint from inside a scope, used by "clean up after running script".Runtime::run_jobscalls it.clazel-web::scripting(tier 0): HTML's script processing overclazel-js's public API only. Each module cites its HTML sections and steps (marked †: from memory, as phase-7.md's convention says) and lists its modelling choices.element, "prepare the script element" (§4.12.1.1) acting onScriptReady:Page::take_requests/Page::fetched);async,defer, and the pending parsing-blocking script, which blocks the tokenizer;nomodule, andevent/for;document.currentScript;parser:DOMContentLoaded, and the load event's wait for async scripts.write:document.writeandwritelnedit the input at the insertion point, and the written text is parsed before the rest (nested writes re-enter the parser).document.openanddocument.closeinclude the script-created parser after load.module: the HTML half of module scripts (§8.1.4, §8.1.5):javascript_url: "evaluate a javascript: URL" in the page.time:performance.now(), coarsened to 100 µs, on the embedder's monotonic clock.globals: the minimum the scripts need before 7.12, added through the embedding API and to be replaced by 7.12:document:write,writeln,open,close, andcurrentScriptas a data property the page sets around each classic script;performance.now;currentScriptkeeps its identity.tests/scripting.rs):scripted_*.dat: pass=2 xfail=4 fail=0 total=6. Bothdocument.writecases pass, including the nested one. The 4 listed cases needgetElementById,setAttribute,querySelectorandappendChild(7.12).execution-timing/pages, run with a stand-in fortestharness.js/testlib.js(tests/support/standin-testharness.js): pass=17 xfail=4 fail=0. The 4 listed pages needeval(006),Location(028), DOM methods (067), and DOM plussetTimeout(068).clazel-renderer: a click on ajavascript:link sends noNavigate; the URL is the page's own to evaluate. A test checks this, and was checked to fail without the change.What did not land
Module scripts do not run.
clazel-js'sparse_module,load_requested_modules,link,evaluate_moduleand every promise operation returnNotImplemented(7.8). Every module script ends in an engine report and anerrorevent at its element. Dynamicimport()and top-levelawaitwait on the same engine pieces; the HTML side (HostLoadImportedModule, the module map, rejection reporting) is written and compiles, but is untested end to end.The renderer does not run page scripts.
clazel-rendererstill parses with scripting off throughparse_real. Not done here:scripting::Pagein the renderer, withFetchScriptandScriptResponse/ScriptBody/ScriptEndmapped totake_requests/fetched;Until then a clicked
javascript:link does nothing. This is 7.15's renderer half.A typed
javascript:URL is not refused by the kernel yet. Another agent is editingclazel-kernel, so the change is described instead of made:javascript:URL has an opaque origin, solock_of_urlgives itOpaque(id)andopen_tab/navigate_tabcommit it today.lock_of_url(oropen_tab,navigate_tabandnavigate) refuses a URL whose scheme isjavascript, as an invalid tuple origin is refused today.OpenTab/NavigateTabare then ignored, and a renderer'sNavigategetserror_bad_url.javascript.javascript:URLs never replace the document. The engine'srun_scriptreturns no completion value (its README says why), so the result is never a string.WPT through the real
testharness.js: the engine cannot run it yet. It throws atself, and it needstry/catchwith thrown errors, RegExp and Promise.Deviations, each listed in its module
load,error,DOMContentLoadedandreadystatechangego intoPage::take_events, since no listeners exist before 7.12. The WPT runner stands in for the load event by calling the page'sonloaditself.errorevent for a script with an empty or badsrc, and an inline module script's "mark as ready". EachPagecall is one task. "Spin the event loop" is a return ofProgress::Waiting.ScriptReady". The tree builder does not report the script start tag's "set the parser document".document.openstarts a new tree and bumps a document generation, so old wrappers and prepared scripts are stale rather than aliased. It aborts a parser still active at nesting level 0 and empties its lists. The URL and history update, event-listener erasure and the iframe flags have nothing to act on.integrity,referrerpolicyandfetchpriority;srcwith the document's encoding (UTF-8 is used);change the encodingwith a tentative confidence aborts the parser and returnsProgress::Reparse(encoding). That is the standard's "navigate to the document again", left to the embedder.speculationrulesscripts do nothing. An import map gives an engine report.Verification
cargo xtask verify --changed origin/claude/phase7-integration, run locally on commit 60e6258. Its final line wasRESULT: FAILED: it did not reachCHANGED CRATES PASSED.The selected crates were the 9 changed ones and their dependents: clazel, clazel-forms, clazel-js, clazel-layout, clazel-renderer, clazel-style, clazel-text, clazel-treebuilder and clazel-web.
What passed:
The log also has a block for the engine crates, every step PASS: Kani on clazel-js-vm and clazel-js-regexp, Verus and mutations on clazel-jit and clazel-js-vm, and conformance for clazel-js-vm, clazel-js-builtins and clazel-js-regexp.
The one failure is "status table and images". Its message is: no committed row to carry over for clazel-deflate, clazel-gif, clazel-image-shape, clazel-jit, clazel-jpeg, clazel-js-builtins, clazel-png, clazel-svg and clazel-webp. These crates have no row in the committed
docs/STATUS.mdon the base branch, and none of them is touched here. The rule saysSTATUS.mdis never edited by hand, so I left it; CI'stablejob writes those rows.After that run, one commit (1d1492a) only changed the WPT runner's Miri stride. That test took 201 s under Miri with a stride of 7; with 11 it is expected near 130 s.
Under Miri, measured separately:
html5lib_scriptedtook 111 s; each other scripting test took 15 to 60 s; the treebuilder suite with the incremental run added took 53 s.CI's full verification has not run on this PR yet. Its proof jobs need a reviewer's approval of the
full-verificationenvironment. Nothing here raises a tier, adds an axiom, touchesclazel-sys,STATUS.md,SPEC-REVIEWS.mdorSYS-AUDITS.md, or removes a test, mutation or theorem.🤖 Generated with Claude Code