Expand description
One driver, several page tiers.
A ## Test that works a page has two halves. The TEST — its Expects, its budgets, its
sealed world — is the tree-walker’s, always. The PAGE is whoever executes it: the page’s lowered
LOGOS on the tree-walker itself (the reference), the same LOGOS on the bytecode VM (what a
browser runs, compiled to WebAssembly), or a real browser. What varies between tiers is only
who executes the page, so the statements that act on a page are carried out by ONE driver
(LoweredHost::drive) that does for each exactly what runtime.js does in a browser, over
whichever engine runs the page’s lowered LOGOS:
| statement | the page sees |
|---|---|
Mount C [at S] | __mount_C(parent) |
Click/Submit/Press/Type … into/Choose/Hover | each of the verb’s events dispatched as a browser dispatches it, along crate::semantics::dom::dispatch_path — every stop through __lgx_dispatch_node — and what came of it worded by crate::semantics::drive |
Focus/Blur | the DOM command, then the focus/blur it raises, dispatched the same way |
Raise "offline" | __lgx_raise |
Navigate to U | pushState, then the route handler the page registered |
Reload the page | the module re-instantiated, its main run again |
Advance time by N | every interval the page armed, fired as it comes due |
Given that M "u" answers … | dom::stub_fetch |
After every statement the page SETTLES: each request that has an answer is completed through
the closure the page handed over with it, until no completion sends one that has an answer.
Every call into the page goes through one guarded door; a failure is handed to
__lgx_on_failure, and one no handler absorbs is the page’s to report.
Page queries (the text of "#x") read the recorder every in-process tier paints into, so a
test’s assertions mean the same thing whichever tier ran the page. Two tiers are compared by
PageTrace — the page after every top-level statement — per Axis.
Structs§
- Arranged
- A test’s statements in the order they run.
- Arrival
- How a scenario’s page arrives: everything that happens before statement 0 is observed.
- Axis
Divergence - Two tiers disagreeing about one axis, first at
statement. - Divergence
- Everything two runs of one scenario disagree about, one entry per axis, each at the first statement where that axis differs.
- DocSnapshot
- The page, observed from outside, at one moment.
- Given
Answer Given that METHOD "url" answers STATUS with BODY.- HereRun
- The lowered page’s run on the tree-walker — the reference — once: the trace to where the program stopped, and the statement it could not carry and why, when that is where it stopped.
- Ledger
Row - One parsed ledger line.
- Lowered
Host - The host state a browser keeps for a lowered page. It owns no engine: every statement it
carries out borrows the engine the page runs on for exactly that statement
(
LoweredHost::drive). - Lowered
Page - A lowered page and its host, held together by a process that owns both — the bytecode VM’s page, driven from outside the interpreter running the test.
- Page
Trace - One scenario’s run on one tier: a snapshot per top-level statement, until it stopped.
- Scenario
- A program and a test body to run against it, arranged (
arrange). - Stop
- Where a scenario stopped: the statement whose failure ended the run, and the failure.
- Test
Tier Comparison - One
## Test, run on the reference tier and on each candidate tier. - Trace
Step - The page after one statement of a scenario.
- World
- The sealed world a scenario runs in.
Enums§
- Axis
- One observable property of a page. A divergence is reported per axis, so a ledger can name exactly which part of the page two tiers disagree about — and a second, unrelated divergence on the same page cannot hide behind the first.
- Classified
- What one top-level test statement is, to a tier that drives the page from outside.
- Drive
- One statement that acts on a page, with its operands evaluated — the unit every page tier is driven in.
- Drive
Error - Why a statement did not drive the page.
- Ledger
Tier - Which comparison a ledger row records — named on the row by its tag.
- Page
Tier - Who executes the page while a scenario runs.
- Page
Tier Kind - Which tier executes a scenario’s page — the configuration-side name of a
super::PageTier. - TierRun
- A tier’s run of a scenario.
Constants§
- PAGE_
STEM - The name every page tier’s shell is built with: the browser bundle’s module and host
(
/app.wasm,/app.js) and the shell’s default<title>. A page the host drives in process arrives in the shell this names (World), so it arrives in the very document a browser loads.
Traits§
- Driven
Page - A page the host drives one statement at a time and can observe between statements.
- Lowered
Calls - An engine a lowered page runs on, seen from the host: call a function the page defines, call a closure it handed out, ask whether it defines a name, and reload it.
- Remote
Page - A page executed somewhere other than this process — a real browser, driven over its own transport. Whoever implements it starts the page (serving its bundle, loading it) and then answers the same two questions every tier answers: carry out a statement, show the page.
- Remote
Page Launcher - Starts a page in another process for one scenario.
Functions§
- arrange
- Arrange one test against its program. See
Arranged. - assemble_
stable - An example page’s assembled source —
entry’s project closure throughcrate::analysis::assemble_project, the same functionlargo build --staticcompiles from, not a raw single-file read. A page that shares a layout or a type across files (Import Layout.+{extends Site},Import Shared.) is a normal project; a discovery path that reads only the one file it happened to be pointed at is what misdiagnoses that page, not the page. - auto_
mounted_ page_ component - The name of the
## Pagecomponentdefsauto-mounts, if any, resolved throughinterner— what a driven tier’sReplay these actions:runs against before any explicitMountin the test body ever ran (a page mounts itself). - auto_
mounted_ page_ path - The declared URL of the
## Pagedefsauto-mounts, if any, resolved throughinterner.routePath()must read this from the moment a page’s own auto-mount runs, not the boot default"/": a page’s own test, and every tier that mounts it, is that page AT its own URL, exactly as a visitor who navigated there directly would find it. - boot_
at_ declared_ route - Boot the document at the URL the
## Pagedefsauto-mounts declares, soroutePath()answers that URL from the page’s first statement — the page as a visitor who navigated to it finds it. A program that auto-mounts no page leaves the route where it is. - classify
- What
stmtis to a tier that drives the page from outside. - compare_
tests - Parse
source, and run every## Testin it that works a page on the reference tier and on each ofcandidates. A test whose program mounts nothing is not a page scenario and is left out.## Mainis the program’s entry point, never test fixture, and is stripped as the test runner strips it. - defs_
auto_ mount_ a_ page - Whether
defsauto-mounts a## Page— the parser’s own insertedMount <page>.arrangerelocates into the test body, not a statement the test’s own body ever writes. A test against such a program drives a mounted page exactly as much as an explicitMountin its body does;largo test’s cross-tier check (testrun.rs) uses this SAME signal for that reason, so the two cannot drift on what “this test drives a mounted page” means. - describe_
difference - Two renderings of one axis, with the first difference pointed at — a document is long, and a person looking for what differs should not have to find it.
- drive_
main ## Maindriving a page — the plain, non-sealed twin ofScenario::lowered_vm_trace. There is no test to seal a world for and no reference trace to hold against:compile.rs::vm_outcomehands over a program’s own definitions and its own driving script (its gate has already made suredrive_stmtsis nothing but driving statements), and this drives them exactly as a## Testdrives its candidate tier — one statement at a time, through the session’s guarded door, settling after each — so a trapping turn recovers here and a typed fetch completes here, the same as they do under## Test.- drives_
the_ page - Whether
stmtacts on a page — a statement the page host carries out (Drive), whatever its operands — rather than one that reads the page or never touches it. - fetch_
record - One request of a page’s own request table as the fetches axis spells it — every tier’s snapshot renders its table through this, so two tiers that asked for the same request read the same.
- is_
scene - Whether
stmtarranges the world a page meets rather than acting on the page. - ledger_
map rowsof one tier, collected into the(scenario, kind, statement) -> causemap that tier’s lock compares what it found against. Panics on a duplicate key WITHIN the tier — two tiers’ rows sharing a scenario/kind/statement are not a collision, since each lock reads only its own.- page_
main_ len - How many leading statements of
programare its page’s MAIN: everything before the first statement that acts on the page (drives_the_page) — the lowered prelude, the program’s definitions, and the top-level bindings a page’sState:may read. What follows is whoever drives the page, the page’s own mount among them. A reload runs exactly the main again. - parse_
ledger - Parse the ledger’s text into every row: three
|-separated fields (scenario | [tag:]kind @ statement | cause), at most one tag and only aLedgerTier’s own, a parseable statement number, a non-empty cause, and akindthat isrefusedor a realsuper::Axisname. Panics naming the exact line on a malformed row — this runs at test time, checking an invariant, never a runtime path. - stale_
rows - The ledger rows a run’s OWN results say have genuinely closed — narrower than “not in
found”: a row whose scenario never ran far enough to be checked at all (its page did not parse, or the scenario itself refused at statement 0, before any axis was ever compared) is not evidence the divergence closed, only that THIS run could not see it. Left alone until a run that actually reaches it says otherwise, rather than deleting a real, still-true cause out from under whoever needs it back the moment the page parses or the scenario runs again. - works_
a_ page - Whether a scenario works a page: something in the program or the body mounts one.