TL;DR: faf-wasm-core is the shared WASM engine that every FAF tool embeds. One FafKernel interface. Rust Mk4 today, Zig Cascade tomorrow. No consumer code changes. 322KB, 284ฮผs per score, zero dependencies.
Why This Exists
FAF has a Rust WASM compiler (faf-wasm-sdk). It works. But every consumer โ bun-sticky, builder.faf.one, and eventually faf-cli โ was wiring up the WASM differently. Loading the binary, calling the bindings, parsing the JSON results. Same boilerplate, every time.
Worse: when Zig Cascade arrives (2.7KB, sub-microsecond scoring), every consumer would need to add a second loading path. Two kernels, two APIs, divergence.
The Fix
One interface. Route to any kernel behind it.
The Interface
Every kernel implements FafKernel:
import { init } from "faf-wasm-core";
const kernel = await init("rust"); // or "zig" when Cascade ships
const result = kernel.score(yaml);
// result.score = 100
// result.populated = 11
// result.ignored = 10
// result.active = 11 That's it. The consumer doesn't know or care which WASM binary is running underneath. The interface is the contract.
Full Kernel Contract
interface FafKernel {
score(yaml: string): ScoreResult;
scoreEnterprise(yaml: string): ScoreResult;
validate(yaml: string): boolean;
compile(yaml: string): Uint8Array;
decompile(bytes: Uint8Array): FafbInfo;
scoreBinary(bytes: Uint8Array): ScoreBinaryResult;
binaryInfo(bytes: Uint8Array): FafbInfo;
version(): string;
readonly engine: "rust" | "zig";
readonly engineVersion: string;
}Capabilities
Not every kernel supports every method. Rust Mk4 has the full suite. Zig Cascade (when it ships) will start with scoring only. The rest throws KernelCapabilityError.
| Method | Rust | Zig (future) |
|---|---|---|
| score | Yes | Yes |
| scoreEnterprise | Yes | No |
| validate | Yes | Yes |
| compile | Yes | No |
| decompile | Yes | No |
| scoreBinary | Yes | No |
| binaryInfo | Yes | No |
Query capabilities at runtime with capabilities(). No surprises.
Who Embeds This
faf-wasm-core is infrastructure. It's not a CLI. It's not a service. It's the engine that other tools embed:
- bun-sticky โ Bun CLI, embeds core directly (v2.0.0, shipped same day)
- builder.faf.one โ Browser scorer, runs WASM client-side
- faf-cli โ Universal CLI (next consumer, replacing inline scoring)
- mcpaas.live โ Badge service (future, server-side WASM)
One kernel. Every tool gets the same score. No divergence.
WASM Roundup
The FAF WASM stack, top to bottom:
| Package | What | Size |
|---|---|---|
| faf-wasm-sdk | RustโWASM compiler (the engine) | 322KB |
| faf-wasm-core | Kernel router (wraps sdk, FafKernel interface) | 155KB npm |
| bun-sticky | Bun CLI (embeds core) | 185KB npm |
| xai-faf-zig | Zig ghost (scorer only, Cascade future) | 2.7KB |
sdk is the compiler. core wraps it behind an interface. bun-sticky embeds core. builder.faf.one runs both Rust and Zig in the browser.
Try It
npm install faf-wasm-core The Numbers
- v1.0.0 โ Released March 20, 2026
- 36/36 โ Tests passing
- 284ฮผs โ Per score (Mk4, Rust)
- 322KB โ Embedded WASM binary
- 0 dependencies โ Zero
- 100% โ Trophy score