03. Architecture (FACET v2.1.3)

FACET architecture is phase-driven and deterministic for fixed normalized source, profile, mode, runtime inputs, and host configuration.

Compiler/Runtime Pipeline

  1. Phase 1: Resolution
    • UTF-8/NFC/LF normalization
    • parse to AST
    • @import resolution
    • deterministic merge
  2. Phase 2: Type Checking
    • @vars / @var_types
    • pipeline type checks
    • facet schema checks
    • @input placement checks
    • policy schema/type checks
  3. Phase 3: Reactive Compute (R-DAG)
    • dependency graph on $var references
    • topological evaluation with stable insertion-order tie-break
    • input materialization for @input
    • lens execution subject to mode/profile/policy/guard/gas/cache
  4. Phase 4: Layout (Token Box Model)
    • budget in FACET Units (UTF-8 byte length)
    • deterministic packing, truncation, and drop rules
  5. Phase 5: Render
    • Canonical JSON output
    • provider payload preserving canonical semantics

Profiles

Determinism Boundaries

Deterministic by spec:

Not standardized by FACET:

Core Data Objects

Canonical JSON contract

The canonical object includes:

Failure Surfaces

Practical Guidance