facet-compiler  by rokoss21

Deterministic compiler and runtime for AI specifications

Created 5 months ago
296 stars

Top 89.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

The facet-compiler project provides a deterministic compiler and runtime for the FACET specification (v2.1.3), enabling developers to generate canonical, policy-aware AI request contexts. It addresses the need for predictable and auditable AI interactions by enforcing explicit failure semantics, deterministic ordering, and bounded execution. This tool is beneficial for engineers building robust AI-powered applications requiring high reliability and control over AI model interactions.

How It Works

The facet-fct compiler processes .facet contracts through a strict pipeline: normalization, resolution, type checking, computation, layout, and rendering. This deterministic process ensures that AI requests are compiled into a canonical JSON format with stable hashes. Key advantages include policy and guard fail-closed behavior (F454, F455) and explicit failure codes, enhancing the reliability and debuggability of AI request assembly.

Quick Start & Requirements

  • Primary Install: cargo install --git https://github.com/rokoss21/facet-compiler --bin facet-fct (recommended). Release binaries are available for Linux, macOS, and Windows.
  • Prerequisites: Rust/Cargo toolchain required for building from source.
  • Links: Documentation portal: rokoss21.github.io/facet-compiler. Quick Start guide: docs/01-quickstart.md.

Highlighted Details

  • Deterministic compilation pipeline: normalization -> resolution -> type check -> compute -> layout -> render.
  • Strict type and placement checks (FTS).
  • Policy and guard fail-closed behavior (F454, F455) with explicit failure semantics.
  • Canonical JSON output generation with stable document and policy hashes.
  • Spec-oriented examples and conformance suites integrated into CI.
  • Provides an "Integration Pattern (Brownfield)" for minimal-risk adoption into existing systems.

Maintenance & Community

The project is authored by Emil Rokossovskiy. It is part of a broader ecosystem including facet-standard and IOSM. Contribution guidelines and issue tracking are available via GitHub links. No specific community channels (e.g., Discord, Slack) or public roadmap were detailed in the README.

Licensing & Compatibility

The project is dual-licensed under MIT or Apache-2.0, permitting broad compatibility, including commercial use and linking within closed-source applications.

Limitations & Caveats

The FACET compiler guarantees deterministic contract compilation and execution boundaries but explicitly does not guarantee deterministic model generation output or the correctness of external APIs. The current version is 0.1.2, indicating potential for ongoing development and API changes.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
361 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.