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.

MethodRustZig (future)
scoreYesYes
scoreEnterpriseYesNo
validateYesYes
compileYesNo
decompileYesNo
scoreBinaryYesNo
binaryInfoYesNo

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:

PackageWhatSize
faf-wasm-sdkRustโ†’WASM compiler (the engine)322KB
faf-wasm-coreKernel router (wraps sdk, FafKernel interface)155KB npm
bun-stickyBun CLI (embeds core)185KB npm
xai-faf-zigZig 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

GitHub

Source and interface contract.

faf-wasm-core

npm

Install the kernel.

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