Contributing
The repository is dziry-dev/dziry. It
contains the compiler and runtime (TypeScript, under src/), the native
engine (Rust, under native-src/dziry-engine/), the docs site (docs/), and
the verification tooling (guards/ and scripts/).
Setup
git clone https://github.com/dziry-dev/dziry
cd dziry
bun install
bun run engine # build the Rust engine (requires a Rust toolchain)
bun run window # compile the demo window
bun run dev # open it
In a checkout, CLI commands are bun run cli <command> — the dziry bin
belongs to installed apps.
To test a change against a real app, scaffold one that depends on your checkout instead of the published package:
bun create dziry test-app --local ../dziry # add --no-install to skip installing
The test suite
bun run test # bun test + cargo test
bun run check # tsc over src, scripts, windows, and architecture
bun run lint # cargo fmt --check && clippy
Run these before any commit that touches more than one area.
The design rule
Nothing stays dynamic unless it is proven it must.
Before adding anything to the runtime — a per-frame cost, runtime state, a new
entry in the shared-memory schema — ask whether the work can happen at build
time instead. bun run runtime-surface enforces this as a ratchet: the
runtime's exported symbols and bundled bytes may fall freely, but may not rise
without editing the baseline in the same commit.
The guard scripts
Each guard proves one thing. Several use a browser or mdn-data as an
oracle, comparing Dziry against an external authority rather than against
itself:
| Run | Proves | Oracle |
|---|---|---|
bun run protocol-guardProtocol identity | Proves the shared-memory protocol's two halves still agree — offsets, field identity, enums, FFI symbols. | — |
bun run boundary-diffBoundary sanity | Validates the tables Bun is about to hand the engine: link consistency, index ranges, sibling cycles, arena bounds. | — |
bun run characterizeCompiler output frozen | Golden files of compiled output, so a refactor is provably behaviour-preserving. | — |
bun run goldenVisual regression | Renders scenarios headlessly and compares against blessed PNGs. | — |
bun run conformanceCSS conformance | Compiles a declaration and compares the emitted value with what the browser computes. | headless Chrome |
bun run layout-diffLayout conformance | Lays out the same html+css in dziry and in the browser at the same viewport, then compares every box. | headless Chrome |
bun run spec-auditInitial values | Checks computed-style defaults and inheritance flags for every style field. | mdn-data |
bun run css-coverageCoverage, measured | What CSS exists versus what dziry supports, bucketed as supported / unsupported / committed non-goal. | mdn-data |
bun run tailwind-coverageTailwind coverage | What fraction of Tailwind works, and what is blocking the rest ranked by classes unblocked. | — |
bun run html-coverageElement defaults | How each HTML element renders in dziry versus the browser — the table that specifies the UA stylesheet. | headless Chrome |
bun run doc-lintCitations resolve | Verifies that every `file.ext:LINE` citation in the Markdown docs still points at something. | — |
bun run probeBrowser facts | Measures what a browser actually does over CDP, so behaviour claims are recorded rather than remembered. | headless Chrome |
Two more that are not in that table:
| Run | Proves |
|---|---|
bun run docs-check | Doc examples compile against the real types; the public API is covered; frontmatter is present. |
bun run arch:check | The architecture map still matches the repository. --emit regenerates the diagram data. |
Which guard to run
| You changed | Run |
|---|---|
A CSS property, or STYLE_FIELDS | conformance, spec-audit, css-coverage |
src/protocol/schema.ts | protocol-guard |
Anything in src/compiler/ | characterize first, to freeze the current output |
paint.rs, layout.rs, text.rs | golden |
| Taffy style construction, sizing, wrapping | layout-diff |
The emitter, list splicing, relinking, hidden | boundary-diff |
The authoring API in src/index.ts | docs-check |
| Any doc, or any file a doc cites | doc-lint |
Claims and measurements
Prefer running the relevant script to quoting a number found in prose. For
coverage in particular, bun run tailwind-coverage is the measurement; a
percentage written in a document is only a record of one.
Working on docs
The docs site is docs/, and it is built rather than merely written: a
citation that no longer resolves fails bun run docs:build, and so does an
example that no longer compiles.
bun run docs # dev server; citations warn instead of failing
bun run docs-check # examples, API coverage, frontmatter
bun run docs:build # the gate: doc-lint + docs-check + build
See Writing docs for the conventions.