Skip to main content

Module binary

Module binary 

Source
Expand description

The compiled binary form of .faf — FAFb v2 (re-export of faf-fafb).

Modules§

canon
The canonical chunk table — FAFb v2 is CLOSED CANONICAL.
compile
Compile/decompile API for .faf ↔ .fafb conversion — FAFb v2, closed canonical.
error
FAFB Error Types
flags
FAFB Feature Flags
header
FAFB Header Implementation
priority
FAFB Priority System
section
FAFB Section Entry and Section Table
string_table
FAFb v2 String Table

Structs§

CanonicalChunk
One canonical chunk: name, classification, default priority.
CompileOptions
Options for compilation
DecompiledFafb
A decompiled .fafb file with header, section table, string table, and raw data
FafbHeader
The 32-byte FAFB file header
Flags
Helper struct for working with flags
Priority
Priority level with semantic meaning
SectionEntry
A single section entry in the section table
SectionTable
The section table containing all section entries
StringTable
A string table mapping u8 indices to UTF-8 names

Enums§

ChunkClassification
Chunk classification, stored in bits 0–1 of SectionEntry.flags.
FafbError
Errors that can occur when working with .fafb files

Constants§

CANONICAL_CHUNKS
The canonical chunk table — the complete, closed set of FAFb v2 section names, in serialization order. This IS the format: there is no chunk 14.
CLASSIFICATION_MASK
Classification mask for the low 2 bits of section flags.
FLAG_COMPRESSED
Content is zstd compressed
FLAG_EMBEDDINGS
Contains pre-computed embeddings
FLAG_MODEL_HINTS
Contains model-specific hints
FLAG_RESOLVED
File is output of chain resolution (enterprise)
FLAG_SIGNED
Contains cryptographic signature
FLAG_STRING_TABLE
Contains a string table (always set in unified format)
FLAG_TOKENIZED
Contains token boundaries
FLAG_WEIGHTED
Contains attention weights
HEADER_SIZE
Header size in bytes
MAGIC
Magic number identifying FAFB files: “FAFB” in ASCII
MAGIC_U32
Magic number as u32 (little-endian)
MAX_FILE_SIZE
Maximum allowed file size (DoS protection): 10MB
MAX_SECTIONS
Maximum allowed section count (DoS protection)
PRIORITY_CRITICAL
Critical priority - never truncate (name, version)
PRIORITY_HIGH
High priority - truncate last (key_files, tech_stack)
PRIORITY_LOW
Low priority - truncate first (verbose context)
PRIORITY_MEDIUM
Medium priority - normal truncation (architecture, commands)
PRIORITY_OPTIONAL
Optional priority - can be omitted entirely
SECTION_ENTRY_SIZE
Size of a single section entry in bytes
VERSION
Library version
VERSION_MAJOR
Format major version
VERSION_MINOR
Current format minor version (additive changes)

Functions§

canonical_chunk
Look up a canonical chunk by name.
compile
Compile a .faf YAML source string into .fafb v2 binary bytes.
decompile
Decompile .fafb v2 binary bytes into a structured representation.
is_canonical
Is this top-level key part of the canonical chunk set?

Type Aliases§

FafbResult
Result type for FAFB operations