Skip to main content

Module page_host

Module page_host 

Source
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:

statementthe page sees
Mount C [at S]__mount_C(parent)
Click/Submit/Press/Type … into/Choose/Hovereach 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/Blurthe DOM command, then the focus/blur it raises, dispatched the same way
Raise "offline"__lgx_raise
Navigate to UpushState, then the route handler the page registered
Reload the pagethe module re-instantiated, its main run again
Advance time by Nevery 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.
AxisDivergence
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.
GivenAnswer
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.
LedgerRow
One parsed ledger line.
LoweredHost
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).
LoweredPage
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.
PageTrace
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.
TestTierComparison
One ## Test, run on the reference tier and on each candidate tier.
TraceStep
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.
DriveError
Why a statement did not drive the page.
LedgerTier
Which comparison a ledger row records — named on the row by its tag.
PageTier
Who executes the page while a scenario runs.
PageTierKind
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§

DrivenPage
A page the host drives one statement at a time and can observe between statements.
LoweredCalls
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.
RemotePage
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.
RemotePageLauncher
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 through crate::analysis::assemble_project, the same function largo build --static compiles 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 ## Page component defs auto-mounts, if any, resolved through interner — what a driven tier’s Replay these actions: runs against before any explicit Mount in the test body ever ran (a page mounts itself).
auto_mounted_page_path
The declared URL of the ## Page defs auto-mounts, if any, resolved through interner. 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 ## Page defs auto-mounts declares, so routePath() 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 stmt is to a tier that drives the page from outside.
compare_tests
Parse source, and run every ## Test in it that works a page on the reference tier and on each of candidates. A test whose program mounts nothing is not a page scenario and is left out. ## Main is the program’s entry point, never test fixture, and is stripped as the test runner strips it.
defs_auto_mount_a_page
Whether defs auto-mounts a ## Page — the parser’s own inserted Mount <page>. arrange relocates 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 explicit Mount in 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
## Main driving a page — the plain, non-sealed twin of Scenario::lowered_vm_trace. There is no test to seal a world for and no reference trace to hold against: compile.rs::vm_outcome hands over a program’s own definitions and its own driving script (its gate has already made sure drive_stmts is nothing but driving statements), and this drives them exactly as a ## Test drives 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 stmt acts 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 stmt arranges the world a page meets rather than acting on the page.
ledger_map
rows of one tier, collected into the (scenario, kind, statement) -> cause map 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 program are 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’s State: 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 a LedgerTier’s own, a parseable statement number, a non-empty cause, and a kind that is refused or a real super::Axis name. 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.