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
identity
Content ID and file digest — computed, never stored.
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
TruncationTier
Spec truncation tiers, dropped from the tail in this order.

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_MEMBERS
Carries __members__ (spec 2.0 structural; this crate does not write it)
FLAG_MODEL_HINTS
Contains model-specific hints
FLAG_PROVENANCE
Carries __provenance__ (spec 2.0 structural; this crate does not write it)
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
STRUCTURAL_CHUNKS
Structural (__-prefixed) chunk names closed for spec 2.0.
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.
canonical_rendering
Canonical text rendering: concatenation of content-chunk payloads in canonical table order. Each payload already begins with name:\n.
compile
Compile a .faf YAML source string into .fafb v2 binary bytes.
content_id
Content ID of a compiled .fafb.
content_id_of
Content ID from an already-decompiled file.
decompile
Decompile .fafb v2 binary bytes into a structured representation.
file_digest
File digest: SHA-256 over every byte of the file.
hex_sha256
SHA-256 as 64 lowercase hex characters, no 0x prefix.
is_canonical
Is this top-level key part of the canonical chunk set?
is_known_structural
True when name is on the closed structural list.
is_structural_name
True when name is structural (leading __), whether or not it is on the closed list. Structural chunks are excluded from the Content ID.
is_valid_member_path
__members__ paths are POSIX, relative to the root brick, and MUST NOT contain ...
source_date_epoch
Honour SOURCE_DATE_EPOCH when it is a valid u64. Spec MUST.
truncated_rendering
Canonical rendering after dropping whole priority tiers from the tail.

Type Aliases§

FafbResult
Result type for FAFB operations