Skip to main content

Glither WASM component pilot

This page is the operator and reviewer handoff for the public Glither component surface. It turns the compiler design into a bounded pilot: one ruleset, one generated WIT contract, one component scaffold, and one evidence packet that says exactly what is ready.

The pilot is deliberately narrower than a production runtime rollout. The current Glither compiler can lower .glith source through typed IR and emit WIT, Rust, Gleam, manifests, snapshots, and WebAssembly component scaffolds. Host admission, long-running conformance, registry promotion, and operational retention remain hardening tracks.

1. Pilot scope

TrackIn scopeOut of scope
Rulesetone glither.mail, glither.governance, or glither.hft source filebroad dialect redesign
Contractgenerated world.wit plus reviewer noteshand-authored WIT
Build outputgenerated Rust logic and component crate scaffoldunreviewed runtime admission
Evidencecommand transcript, source, generated artifacts, status notecompliance certification
Runtimelocal component build when toolchain is presentproduction host fleet rollout

The best first candidate is a ruleset with a clear action boundary: hold an AI tool call, route a mail message, or evaluate a deterministic market strategy.

2. Inputs

InputOwnerAcceptance check
.glith rulesetbuilderpolicy intent can be explained without reading host code
sample eventoperatorevent has realistic fields and expected disposition
host boundaryreviewerimports and exports map to allowed capabilities
risk notereviewerstates what the component is allowed to decide
status boundaryoperatornames unfinished host, OCI, or conformance work

Use repository fixtures when possible:

/data/src/experiments/glither/packages/roux/tests/fixtures/mailguard.glith
/data/src/experiments/glither/packages/roux/tests/fixtures/governance.glith
/data/src/experiments/glither/packages/roux/tests/fixtures/hft.glith

3. Command path

Run from /data/src/experiments/glither with the local Rust workspace available:

cargo run -p tangle -- check packages/roux/tests/fixtures/governance.glith
cargo run -p tangle -- snapshot packages/roux/tests/fixtures/governance.glith --json
cargo run -p tangle -- wit packages/roux/tests/fixtures/governance.glith
cargo run -p tangle -- rust packages/roux/tests/fixtures/governance.glith
cargo run -p tangle -- gleam packages/roux/tests/fixtures/governance.glith
cargo run -p tangle -- manifest packages/roux/tests/fixtures/governance.glith
cargo run -p tangle -- component packages/roux/tests/fixtures/governance.glith -o /tmp/glither-governance-component

For glither.governance, add the KAGP policy export:

cargo run -p tangle -- export-kagp-policies packages/roux/tests/fixtures/governance.glith

The generated component crate includes wit/world.wit, src/logic.rs, src/lib.rs, Cargo.toml, build.sh, and a generated README. Building the actual .wasm component requires the wasm32-unknown-unknown Rust target and wasm-tools; OCI packaging additionally requires registry credentials and oras.

4. Review packet

ArtifactWhy it matters
source .glithhuman-readable policy or strategy source
tangle check outputstructural validation and diagnostics
snapshot JSONtyped IR, inferred states, and audit-friendly diff material
world.witmembrane contract for imports, exports, records, and outcomes
generated Rustpure disposition logic reviewers can inspect
generated Gleamreference oracle path for future differential checks
manifest JSONactivation metadata and ruleset description
component scaffoldbuildable crate boundary for WASM component work
status noteexplicit gap list for host, OCI, conformance, and retention

The packet should avoid runtime overclaiming. A valid pilot can finish at a reviewed WIT contract and generated component scaffold when the host or registry path is not yet ready.

5. Acceptance checks

CheckPass condition
Source claritya reviewer can identify the protected action and expected outcome
Structural checktangle check exits successfully or emits accepted diagnostics
WIT contractimports and exports match the declared host boundary
Rust outputgenerated logic includes the expected rule names and outcomes
Oracle outputgenerated Gleam preserves the same decision shape
Component scaffoldoutput directory contains WIT, glue, logic, and build recipe
Status boundarypacket marks incomplete host, conformance, and OCI promotion work

Optional build check when the component toolchain is present:

cd /tmp/glither-governance-component
bash build.sh

That optional step proves the scaffold can become a validated WebAssembly component locally. It does not by itself prove production host admission, registry promotion, or operational retention.

6. Buyer and operator handoff

The pilot output should read as a short review story:

  1. This is the source rule and the action it governs.
  2. This is the generated WIT contract; these are the only host capabilities.
  3. This is the generated logic and oracle output.
  4. This is the component scaffold and optional local build result.
  5. These are the unfinished production controls.

Pair this page with the compiler design spec, the glither.governance dialect, and the BAZ platform architecture when the pilot ruleset is a trading strategy.