Skip to main content

Module binary

Module binary 

Source
Expand description

FAFB Binary Format — Unified Specification

Compiles human-readable .faf (YAML) to AI-optimized binary. String table for unlimited section names, classification bits for DNA/Context/Pointer.

§Features

  • O(1) section lookup - Section table at end for instant access
  • Priority truncation - Smart context window management
  • Pre-computed tokens - No runtime estimation
  • String table - Unlimited section names (up to 256)
  • Classification - DNA / Context / Pointer chunk types

§Usage

use faf_rust_sdk::binary::{compile, decompile, CompileOptions};

let yaml = "faf_version: 2.5.0\nproject:\n  name: my-project\n";
let opts = CompileOptions { use_timestamp: false };
let bytes = compile(yaml, &opts).unwrap();
let result = decompile(&bytes).unwrap();
let name = result.get_section_string_by_name("project").unwrap();

See FAFB-SPEC-UNIFIED.md for full specification.

Re-exports§

pub use chunk_registry::classify_key;
pub use chunk_registry::ChunkClassification;
pub use chunk_registry::CLASSIFICATION_MASK;
pub use chunk_registry::DNA_KEYS;
pub use chunk_registry::POINTER_KEY;
pub use compile::compile;
pub use compile::decompile;
pub use compile::CompileOptions;
pub use compile::DecompiledFafb;
pub use error::FafbError;
pub use error::FafbResult;
pub use flags::Flags;
pub use flags::FLAG_COMPRESSED;
pub use flags::FLAG_EMBEDDINGS;
pub use flags::FLAG_MODEL_HINTS;
pub use flags::FLAG_RESOLVED;
pub use flags::FLAG_SIGNED;
pub use flags::FLAG_STRING_TABLE;
pub use flags::FLAG_TOKENIZED;
pub use flags::FLAG_WEIGHTED;
pub use header::FafbHeader;
pub use header::HEADER_SIZE;
pub use header::MAGIC;
pub use header::MAGIC_U32;
pub use header::MAX_FILE_SIZE;
pub use header::MAX_SECTIONS;
pub use header::VERSION_MAJOR;
pub use header::VERSION_MINOR;
pub use priority::Priority;
pub use priority::PRIORITY_CRITICAL;
pub use priority::PRIORITY_HIGH;
pub use priority::PRIORITY_LOW;
pub use priority::PRIORITY_MEDIUM;
pub use priority::PRIORITY_OPTIONAL;
pub use section::SectionEntry;
pub use section::SectionTable;
pub use section::SECTION_ENTRY_SIZE;
pub use section_type::SectionType;
pub use section_type::SECTION_ARCHITECTURE;
pub use section_type::SECTION_BISYNC;
pub use section_type::SECTION_COMMANDS;
pub use section_type::SECTION_CONTEXT;
pub use section_type::SECTION_CUSTOM;
pub use section_type::SECTION_EMBEDDINGS;
pub use section_type::SECTION_KEY_FILES;
pub use section_type::SECTION_META;
pub use section_type::SECTION_MODEL_HINTS;
pub use section_type::SECTION_TECH_STACK;
pub use section_type::SECTION_TOKEN_MAP;
pub use string_table::StringTable;

Modules§

chunk_registry
FAFb v2 Chunk Registry
compile
Compile/decompile API for .faf ↔ .fafb conversion
error
FAFB Error Types
flags
FAFB Feature Flags
header
FAFB Header Implementation
priority
FAFB Priority System
section
FAFB Section Entry and Section Table
section_type
FAFB Section Types
string_table
FAFb v2 String Table