v0.1.0

Implementation

Current status, technical stack, and performance metrics.

Current Status

Ananke v0.1.0 represents the production-ready core pipeline. The extraction and compilation layers are implemented in Zig for performance and memory safety. The orchestration layer is implemented in Rust with Python bindings for llguidance integration.

301 Tests Passing
<100ms Extraction Time
9 Languages
~50µs Token Overhead

Component Implementation

Clew (Constraint Extraction)

Tree-sitter AST parsing with C FFI integration. Hybrid confidence scoring: AST-based extraction (0.95 confidence) with pattern-matching fallback (0.75). 101 built-in constraint patterns across six categories.

Supported Languages: TypeScript, JavaScript, Python, Rust, Go, Zig, C, C++, Java

Braid (Constraint Compilation)

Just-in-time constraint compilation to multiple intermediate representations:

  • JSON Schema: For structured outputs API integration
  • Context-Free Grammars: EBNF for syntactic constraints
  • Regular Expressions: For pattern matching constraints
  • Token Masks: Direct token-level constraint enforcement

LRU cache provides ~1µs hit latency with 20x speedup on repeated compilations. Topological sorting (Kahn's algorithm) handles dependency ordering and cycle detection.

Maze (Orchestration)

Token-level constraint enforcement via llguidance integration. Deployed on Modal Labs with scale-to-zero GPU infrastructure.

  • Runtime: vLLM 0.11.0 for model serving
  • Constraints: llguidance 0.7.11 for token masking
  • Models: Qwen2.5-Coder-32B-Instruct, Llama 3.1, DeepSeek Coder, Mistral
  • Hardware: A100-80GB GPUs with automatic scaling

Performance Metrics

Operation Target Achieved
Constraint extraction (local) <100ms <100ms
Constraint extraction (with Claude) <2s <2s
Constraint compilation <50ms <50ms
Cache hit latency <1µs ~1µs
Token validation overhead <50µs ~50µs
Generation throughput >20 tok/s 22.3 tok/s

Command Line Interface

Ananke ships as a single binary:

ananke extract   # Extract constraints from source files
ananke compile   # Compile constraints to ConstraintIR
ananke generate  # Generate code under constraints
ananke validate  # Validate code against constraints
ananke init      # Initialize constraint configuration
ananke version   # Show version information
ananke help      # Show help

Output formats: pretty (default), json, compact, verbose

Security Hardening

  • Path traversal protection: Symlink validation prevents directory escape
  • Constraint injection prevention: SQL, XSS, and command injection patterns blocked
  • API key handling: Memory zeroing with volatile writes
  • HTTP resilience: Exponential backoff with rate limiting
  • OWASP Top 10: Full compliance verified

23 dedicated security edge case tests validate these protections.

Roadmap

v0.1.0 (Current)

  • Production-ready Clew, Braid, and Maze
  • 9 language parsers via Tree-sitter
  • CLI with core commands
  • Modal deployment with scale-to-zero
  • 301 tests, zero failures

v0.2.0 (Planned)

  • Bidirectional streaming generation
  • Multi-model orchestration
  • Ariadne DSL type checking
  • Extended language extractors
  • Web UI (beta)

Getting Started

Requirements

  • Zig 0.15.2+ (for building from source)
  • 2GB RAM minimum, 4GB recommended
  • 500MB disk space

Platforms

  • macOS (Apple Silicon and Intel)
  • Linux (Ubuntu 20.04+, Debian 11+, Arch)
  • Windows (WSL2)

Build from Source

git clone https://github.com/rand/ananke
cd ananke
zig build -Doptimize=ReleaseSafe