faf-rust-sdk
.faf is to context what package.json is to dependencies.
One small, portable file that says what your project is, how it's built, and why —
readable at a glance by a teammate, your own code, or an AI assistant. .faf is the
Foundational AI-context Format: plain, human-readable YAML, an open IANA-registered
standard. faf-rust-sdk is the Rust way to read, validate, score, and compile it.
IANA media type: application/vnd.faf+yaml
Why it exists
AI assistants start cold every session — they re-learn your stack, your layout, your
intent, every time. A .faf file is the portable context that fixes that: write it
once, and any AI tool (or your own code) can load a complete, structured picture of the
project in a single read. The score tells you how complete that picture is.
Install
[]
= "3.0"
Quick start
use ;
Scoring
.faf files score 0–100 by how complete the context is, measured against a fixed
33-slot model. A higher score means an AI has more of what it needs to work without
guessing. The score is deterministic — the same file always scores the same.
Compression
Trim context to fit a model's window:
use ;
let minimal = compress; // ~150 tokens
let standard = compress; // ~400 tokens
let full = compress; // ~800 tokens
FAFb — the binary form
.faf is the source; FAFb is the compiled output — a small, sealed binary with a
checksum, for shipping or caching context fast.
use ;
let bytes = compile?;
let result = decompile?;
let name = result.get_section_string_by_name;
How it works (for the curious)
FAFb is modeled on IFF — the chunked format Commodore created for the Amiga in the '80s (Microsoft's RIFF and the ELF executable format use the same idea). Every YAML key becomes a named section via a string table, so there's no fixed enum and no "Unknown" ceiling. Sections are classified DNA (core identity) or Context (supplementary), ordered by priority, and sealed with a CRC32 checksum. The section table uses 16 bytes per entry for O(1) lookup. Same format for a one-file script or a 600-engineer monorepo.
Axum integration
Add FAF project context to any Axum server — parsed once at startup, then a single
Arc::clone per request:
[]
= { = "3.0", = ["axum"] }
use ;
use ;
let app: Router = new
.route
.layer;
async
Testing
faf-rust-sdk's own suite is 58 WJTTC tests — 16 Brake (safety), 22 Engine (core), 20 Aero (edge). And because it's a thin facade, every API it exposes is already covered by the crates beneath it — faf-kernel (62) and faf-fafb (103). 224 tests pass across the three crates.
Part of the FAF Rust workspace
One kernel, many shells:
faf-kernel— parse, validate, score (the engine)faf-fafb— the FAFb v2 binary formatfaf-wasm-sdk— the same engine for the browser and edge (WASM)
Links
- faf.one — project home
- IANA registration —
application/vnd.faf+yaml - FAF on Zenodo — academic paper
- FAF on Grokipedia
License
MIT
Get the CLI
faf-cli — the original AI-context CLI. A must-have for every builder.
Anthropic MCP #2759 · IANA: application/vnd.faf+yaml · faf.one · npm