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§
- Canonical
Chunk - One canonical chunk: name, classification, default priority.
- Compile
Options - Options for compilation
- Decompiled
Fafb - A decompiled .fafb file with header, section table, string table, and raw data
- Fafb
Header - The 32-byte FAFB file header
- Flags
- Helper struct for working with flags
- Priority
- Priority level with semantic meaning
- Section
Entry - A single section entry in the section table
- Section
Table - The section table containing all section entries
- String
Table - A string table mapping u8 indices to UTF-8 names
Enums§
- Chunk
Classification - Chunk classification, stored in bits 0–1 of
SectionEntry.flags. - Fafb
Error - Errors that can occur when working with .fafb files
- Truncation
Tier - 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
0xprefix. - is_
canonical - Is this top-level key part of the canonical chunk set?
- is_
known_ structural - True when
nameis on the closed structural list. - is_
structural_ name - True when
nameis 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_EPOCHwhen it is a validu64. Spec MUST. - truncated_
rendering - Canonical rendering after dropping whole priority tiers from the tail.
Type Aliases§
- Fafb
Result - Result type for FAFB operations