Lace examples

Quickstart Local

This is the smallest local porcelain/API companion. It opens one memory-backed Lace, creates records with the app-facing JavaScript Record.create({...}) shape or Rust record helpers, stores records through interlace-backed store(...), and reads them back with list(...) and get(...).

It does not run a two-participant interlace. For the central end-to-end operation, use the first-interlace tutorial and its first-interlace runnable companion.

It deliberately stores one unrelated record under a different App to show that records can exist locally without being selected by the current policy.

Run

From the repository root:

JavaScript:

rustup target add wasm32-unknown-unknown
npm --prefix js/crates/lace-js run build
node examples/quickstart-local/js/quickstart.mjs

Rust:

cargo run --manifest-path examples/quickstart-local/rust/Cargo.toml

Expected output:

stored selected: 2
listed selected: link/one, link/two
get returned: one record
unrelated selected: no

Policy

policy/links.interlang contains the normal authoring surface:

converge {
  Link in //quickstart//links//link/{*} => include Link
}

A bare Interlang pipeline converges records matching that coordinate shape and exposes the same local row set to peer-origin rules for this interlace. Use an explicit top-level converge { ... } block for the same combined contribution, or combine expose { ... } and converge { ... } blocks when the peer’s rules need extra exposed evidence around the records selected for convergence. Unqualified helper calls read checked local evidence. Bare include uses advertised fields to discover candidates; include by hash uses hashes named by checked support records.

What this example avoids

It does not use direct setup or store-inspection helpers. Those live on advanced/diagnostic surfaces for fixtures and conformance tests. Application code uses store, list, get, forEach, openInterlace, and boundedInterlace.