llw-livive-net

V8 Appliance SOW

Document: Statement of Work for the V8-shaped browser appliance
Baseline: v0.0.1+a (1fbfc53)
Status: work packages 1–5 implemented in the no_std core and Wasm ABI; engine oracle selection deferred
Scope owner: LodaLiteWeb


Implementation status

Work package Status Evidence
WP1 metadata/event/console/network Implemented telemetry.rs, ABI exports, event/network logging in the browser
WP2 storage Implemented storage.rs, storage ABI, set/get/delete/clear-session
WP3 heap Implemented heap.rs, region accounting, page allocation, OOM counters
WP4 GC Implemented gc.rs, GC phases, lod_gc_begin / lod_gc_step
WP5 engine lifecycle Implemented engine.rs, lifecycle events, lod_engine_event

Current ABI: 16.

Current browser artifacts:

screen.txt, help.txt, manual.txt, report.md
metadata, event log, console log, network log,
storage, heap, GC, engine lifecycle
host DevTools: Metadata, Events, Console, Network, Storage, Heap, GC, Engine

The ECMAScript engine/oracle is still deferred.


1. Context

LodaLiteWeb currently implements a deterministic text browser appliance:

browser modes        startup, viewer, help, page, quit
display buffer       configurable 40..240 x 12..80 cells
toolbar              manifest-generated icon navigation
favorites            Rust-declared URLs, loaded through a text proxy
display profiles     phone/tablet/desktop portrait and landscape
logical clock        1000, 60, 10, 1 Hz
execution policy     pacing, rate limits, timeouts, propagation
contract             actions, args, rates, outputs, states, policy
provenance           source commit, rustc/cargo, target, build id
outputs              screen, help, manual, report

The next phase is not to embed V8 in the no_std core. It is to build the surrounding observable state model that a V8-like engine needs:

metadata
event log
console log
network log
storage
heap / allocator
garbage collection
engine lifecycle

The result should be inspectable and replayable, with a real engine attachable later as an oracle.


2. Current evidence and baseline

Codebase

lodalite-web-rs/src/contract.rs    self-describing contract
lodalite-web-rs/src/screen.rs      configurable character screen
lodalite-web-rs/src/time.rs        logical clock
lodalite-web-rs/src/policy.rs      pacing / limits / deadlines
lodalite-web-wasm/src/lib.rs       browser modes, buffers, ABI
browser-demo/                      JS host and text proxy
CONCEPTS.md                        architecture
dont_take_no.md                    design principles and seams

Measured state

ABI                       16
Rust core tests           18
snapshot tests            2
Wasm size                 ~279 KiB
guest memory              ~1.56 MiB
display profiles          phone, tablet, desktop, desktop-wide
browser output            screen.txt, help.txt, manual.txt, report.md
cp-livive-net              application fixture / original browser target
wasm-fb-livive-net        no_std guest + JS hypervisor + TTY/framebuffer ideas
lodolite-livive-net       deterministic no_std state-machine precedent

lodolite-livive-net demonstrates the relevant architectural pattern:

pure no_std state transitions
inspectable per-cycle state
telemetry counters
Wasm/web projection
zero dependencies

V8 will not be modeled at that level of internal detail. The transferable idea is the inspectable state boundary, not the NPU microarchitecture.

V8 context

As of 2026-12-05:

Chrome Stable 159.0.8154.59     V8 15.9.128.52
Chrome 158.0.8127.109           V8 15.8.62.84

V8 is a large runtime with JIT tiers, GC, threads, code pages, and platform services. It is not a no_std library. The appliance will model observable engine state and attach a real engine as an oracle when execution semantics are needed.

Engine selection is deliberately deferred until work packages 1–5 are stable.


3. Scope

In scope

  1. Metadata buffer
  2. Event log buffer
  3. Console buffer
  4. Network log buffer
  5. Storage state machines
  6. Heap / allocator model
  7. GC state machine
  8. Engine lifecycle state machine
  9. Contract/manifest exposure for all of the above
  10. Fixed-buffer, allocation-free implementation in the no_std core
  11. Deterministic replay and tests
  12. Browser/report visibility for summaries

Out of scope

A real engine and DOM can be added after the state surface is stable.


4. Work packages

WP1 — Metadata, event, console, and network buffers

WP1.1 Browser metadata buffer

Structured browser state, queryable without scraping the display.

Fields:

mode
url
title
loading
progress
history index
history length
cols
rows
scroll
focus
document ready state
pending requests
completed requests
failed requests
timebase
tick
engine state
heap used
gc phase
provenance short form

Format: newline-delimited key|value records or a fixed binary record set. Values must be stable and machine-readable.

ABI:

lod_meta_render
lod_meta_ptr
lod_meta_len

Acceptance:

WP1.2 Event log buffer

Append-only ring buffer.

Record:

seq | tick | kind | actor | correlation | payload

Required event kinds:

navigation_start
navigation_commit
navigation_complete
request_start
request_end
timeout
key
click
scroll
console
script_start
script_end
script_error
task
timer
storage_write
storage_visible
gc_start
gc_end
engine_transition

Requirements:

ABI:

lod_event_render
lod_event_ptr
lod_event_len
lod_event_dropped

WP1.3 Console buffer

Record:

seq | tick | level | source | message | stack

Levels:

debug, info, log, warn, error, assert, uncaught

Requirements:

ABI:

lod_console_render
lod_console_ptr
lod_console_len
lod_console_dropped

WP1.4 Network log buffer

Record:

seq | tick | request_id | method | url | status | resource_type
    | start_tick | end_tick | bytes | cache | redirects | error

Requirements:

ABI:

lod_network_render
lod_network_ptr
lod_network_len
lod_network_dropped

WP1 deliverables

new core buffer module(s)
contract declarations for buffers and capacities
Wasm ABI exports
metadata/log summary in screen/report
tests for formatting, sequence, wrapping, and overflow

WP2 — Storage state machines

Scope

Implement deterministic, origin-scoped storage models:

cookies
localStorage
sessionStorage
cache entries

IndexedDB metadata may be modeled later; full object storage is out of scope.

Records

origin
kind
key
value
created_tick
expires_tick
version
visibility
size

Behaviors

set / get / delete / clear
expiry
quota enforcement
origin isolation
session vs persistent lifetime
propagation visibility window
event logging

Requirements

ABI

lod_storage_render
lod_storage_ptr
lod_storage_len
lod_storage_count
lod_storage_dropped

Tests

set/get/delete
expiry at exact tick
quota rejection
origin isolation
session reset
propagation delay
overflow policy

WP3 — Heap / allocator model

Scope

A deterministic abstract heap with hard upper limits.

Regions

young
old
large object
code (metadata only in this phase)
external

State

region capacity
used bytes
allocation count
free bytes
largest free block
oom count

Allocation model

bump allocation
fixed-size classes
bounded free list

Pick one simple strategy first. The model does not need to reproduce V8’s page allocator or pointer-compression cage.

Requirements

ABI

lod_heap_render
lod_heap_ptr
lod_heap_len
lod_heap_capacity
lod_heap_used
lod_heap_oom_count

Tests

allocate below/at/above cap
free and reuse
region pressure
OOM transition
event logging

WP4 — GC state machine

Scope

A deterministic single-threaded GC model over the abstract heap.

Phases

idle
scavenge
mark
sweep
compact
finalize

Triggers

allocation pressure
explicit request
threshold crossing

State

phase
cycle
objects before/after
bytes before/after
survivors
promotions
pause ticks

Requirements

ABI

lod_gc_render
lod_gc_ptr
lod_gc_len
lod_gc_phase
lod_gc_cycles

Tests

GC trigger thresholds
scavenge/promotion
mark/sweep/compact transitions
pause ticks
OOM interaction
replay equality

WP5 — Engine lifecycle state machine

Scope

An observable V8-shaped lifecycle model.

States

idle
parsing
compiling
executing
suspended
optimizing
deoptimizing
collecting
error
terminated

Events

CompileScript
RunScript
CallFunction
EnqueueTask
DrainMicrotasks
Optimize
Deopt
RequestGc
Exception
Terminate

Metadata

isolate id
context id
script id
source hash
compile tier
bytecode size
frame depth
pending tasks
pending microtasks
exception state

Requirements

ABI

lod_engine_render
lod_engine_ptr
lod_engine_len
lod_engine_state
lod_engine_tick

Tests

script compile/run lifecycle
task/microtask drain
exception transition
GC transition
terminate/reset
replay equality

5. Common buffer rules

All new buffers use:

fixed capacity
explicit max record count/bytes
sequence and tick fields
dropped/overflow counters
deterministic truncation
no allocation in the no_std core

Text projection

Each buffer exposes a text projection for the current text browser and tests. Binary records may be added later behind the same logical schema.

Capacities

Initial capacities are intentionally conservative and part of the contract:

metadata       4096-byte projection
event log      256 entries / 32 KiB
console        128 entries / 32 KiB
network        128 entries / 64 KiB
storage        128 entries / 32 KiB
heap regions   5 regions / 1,966,080 bytes modeled
gc state       512-byte projection
engine state   512-byte projection

Capacities are compiled constants and announced by the machine contract.


6. Contract and ABI changes

The machine contract will add:

buffer|meta|4096
buffer|event|256|32768
buffer|console|128|32768
buffer|network|128|65536
buffer|storage|128|32768
buffer|heap|5|1966080
buffer|gc|512
buffer|engine|512

New ABI exports are listed in each work package.

The manifest remains the host’s source of truth for:


7. Determinism and replay

Every buffer record includes:

seq
tick
kind

Replay inputs:

initial state
action sequence
logical ticks
storage operations
heap/GC events
engine lifecycle events
recorded host responses

Rules:


8. Testing strategy

Unit tests

Integration tests

Browser tests

Replay tests


9. Risks and open questions

Risks

Open questions

  1. Text records vs binary records for each buffer?
  2. Event log persistence across page loads or reset per session?
  3. Storage: cookies/localStorage/sessionStorage first, or cache first?
  4. Heap model: bump allocator first or size-class free list?
  5. GC model: single abstract cycle or separate young/old cycles?
  6. Engine lifecycle: does it mirror a real engine or stand alone?
  7. Which engine becomes the first oracle after WP1–WP5?
    • Boa
    • QuickJS-NG via rquickjs
    • V8 via deno_core
  8. Network log: record headers, bodies, or metadata only?
  9. Console: capture only messages or also source locations/stack frames?

10. Exit criteria for this SOW

Work packages 1–5 are complete when:


11. Deferred: engine selection

After work packages 1–5:

Boa            pure Rust, ~95% Test262, slower, easiest embedding
rquickjs       QuickJS-NG, small, ES2020, wasm-capable, C runtime
deno_core      V8, highest fidelity, JIT, large runtime
rusty_v8       lower-level V8 bindings
JavaScriptCore / SpiderMonkey bindings

The engine decision is not part of this SOW.


12. Supporting references

CONCEPTS.md
dont_take_no.md
no_std_migration.md
browser-demo/README.md
lodalite-web-rs/README.md
lodolite-livive-net/README.md
lodolite-livive-net/concept.md
wasm-fb-livive-net/docs/v3-entangled-hypervisors.md

V8 version references:

Chrome 159.0.8154.59 / V8 15.9.128.52
Chrome 158.0.8127.109 / V8 15.8.62.84