Development
Use this workflow to make a change and verify the layer it affects.
Install the pinned local formatting tools from the repository root:
npm ci --ignore-scriptspython -m pip install -r requirements-dev.txtgit config core.hooksPath .githooksmake formatmake checkmake format runs Prettier for JavaScript, Ruff for Python, and rustfmt for the
Rust workspace and standalone CLI reference tool. make check checks the
same files without rewriting them and runs in the pre-commit hook.
Configuration lives in .prettierrc.json and ruff.toml; Ruff targets Python 3.11.
Generated bundles, vendored code and installed dependencies are excluded. After
editing vendor adapters, regenerate their bundles with
npm run build --prefix crates/runtime/js/vendor.
1. Find the owning crate
Section titled “1. Find the owning crate”
| Change | Start here |
|---|---|
| DOM arena, parser or C boundary | crates/lexbor |
| Engine ownership, callbacks or protected values | crates/jsc |
| HTTP/WebSocket transport | crates/net |
| Browser APIs, sessions, scheduling or plugins | crates/runtime |
| Command-line behavior | crates/cli |
| Python/Node host interface | bindings/python, bindings/node |
2. Start with an independent layer
Section titled “2. Start with an independent layer”Lexbor needs no JSC or curl SDK:
cargo test -p brimp-lexborpython3 scripts/test_lexbor_boundary.pyThe second command exercises the native boundary under ASan/UBSan. JSC tests require only the engine SDK; networking tests require only curl-impersonate:
cargo test -p brimp-jsccargo test -p brimp-netNative prerequisites
Section titled “Native prerequisites”Follow Build from source to install the pinned toolchain, download the JavaScriptCore and curl SDKs, and export their build and runtime paths. Use the same environment for the checks below.
On macOS, local defaults are the adjacent WebKit/WebKitBuild/Release directory
and /usr/local/lib for curl. When using that WebKit build, run:
export DYLD_FRAMEWORK_PATH="$PWD/../WebKit/WebKitBuild/Release"Lexbor 3.0.0 is vendored with provenance and documented patches. WebCrypto
shares the BoringSSL instance in curl-impersonate. Build the curl SDK with its
WebCrypto interface (curl-impersonate/webcrypto.h); older curl SDKs without
these exports cannot link the runtime. Rendering, fonts, GPU/audio engines and browser Worker
execution are outside the runtime.
3. Build and test the host interfaces
Section titled “3. Build and test the host interfaces”cargo build -p brimp-cli -p brimp-python -p brimp-nodepython3 bindings/prepare_local.pycargo test --workspacePYTHONPATH=bindings/python/python python3 -m pytest bindings/python/testsnode --test bindings/node/test/*.test.mjspython3 -m pytest crates/cli/tests/test_cli.pyInstall pytest in your Python environment first. Tests use local HTTP fixtures.
Re-run prepare_local.py after rebuilding bindings so Python and Node load the
new extensions.
Run the runtime environment and browser workload regressions against those bindings:
npm ci --prefix tests --ignore-scripts --no-audit --no-fundnpm run prepare:fixtures --prefix testsnpm test --prefix testsThe tests/runtime/ suite checks browser APIs through the Node driver, separately
from the host binding contracts. Run it alone with
npm run test:runtime --prefix tests. The workload suite runs eleven functional
workloads against reviewed Chromium expectations; run it alone with
npm run test:workloads --prefix tests. CI runs both without the optional full comparison
directory or a browser installation. See the
regression guide
for fixtures, reports, and updating expectations.
Continuous integration
Section titled “Continuous integration”The Test workflow runs the same Testing job on macOS arm64, Linux x64, Linux arm64 and Windows x64. Each downloads the pinned JSC and curl SDKs, builds the CLI and both bindings, runs all workspace tests (including JSC ownership and asynchronous WebAssembly), checks the Python/Node APIs, CLI and tutorials, runs the runtime environment and browser workloads, and tests installed packages. Clippy and the runtime dependency boundary run on all four targets.
Linux installs the native font and packaging tools. Windows development setup
copies SDK DLLs beside the Python and Node extensions; use the environment
emitted by prepare_native.py before running prepare_local.py. POSIX signal
tests retain their platform guard. Lexbor and JSC tests run within the shared
workspace suite. The Documentation workflow builds and validates the site on
Linux for pull requests and relevant pushes to main; deployment runs only
from main.
The Lexbor ASan/UBSan script remains available for local checks.
4. Check the boundaries and style
Section titled “4. Check the boundaries and style”python3 scripts/check_runtime_dependencies.pycargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningsUse the coverage audit for browser behavior probes. For performance work, use the reproducible native and network benchmarks with the same build profile and host.
5. Regenerate docs and references
Section titled “5. Regenerate docs and references”From the repository root, install the documentation dependencies into a virtual environment, then build:
python3 -m venv /tmp/brimp-docs-env. /tmp/brimp-docs-env/bin/activatepython -m pip install -r docs/requirements.txtnpm ci --prefix docsnpm run build --prefix docspython -m pytest docs/tests/test_site.pyThe build runs mkdocstrings on Python source, TypeDoc on the Node declarations, and a small Rust helper on the CLI’s existing Clap model. It renders editable SVG diagram sources to PNG and builds the Starlight site. No native SDK is needed for documentation generation.
To test the runnable tutorial code against the built bindings and CLI:
PYTHONPATH=bindings/python/python python3 -m pytest docs/tests/test_examples.pyEdit signatures and docstrings in their source files. Edit diagrams in
docs/diagrams/. Do not edit generated reference output by hand.