Skip to content

v0.2.0

Choose a tag to compare

@rand rand released this 02 Mar 18:21
· 12 commits to main since this release

v0.1.0 extracted constraints and compiled them. v0.2.0 makes them compose.

CLaSH constraint algebra

Five constraint domains in two tiers. Hard domains (Syntax, Types, Imports) compose by intersection: if any domain rejects a token, it can't be generated. Soft domains (ControlFlow, Semantics) bias the distribution without blocking. The key invariant: adding soft constraints can never make a satisfiable set unsatisfiable.

Domain fusion combines all five into a single per-token decision. Hard domains fuse via exact mask intersection (~10us/token). Soft domains fuse via additive logit reweighting within the feasible set. CRANE-style adaptive switching relaxes constraints during reasoning tokens and tightens them for structured output.

Type inhabitation

Given a target type, which expressions in scope can produce it? The inhabitation graph does BFS reachability over 9 edge kinds across 10 languages, then generates token masks from the reachable set.

Fill-in-the-middle

IDE completions via grammar quotienting: left-quotient by the prefix, right-quotient by the suffix, generate only in the residual. Hole scale (expression through module) maps to constraint intensity.

Homer integration

Cross-file intelligence from Homer scope graphs: name resolution, call graph context (upstream callers + downstream callees), four-quadrant salience scoring, temporal analysis, convention mining. All optional. The system degrades gracefully without it.

14 languages

Kotlin, C#, Ruby, PHP, and Swift join the existing 9. 383 patterns across all extractors, all supporting full CLaSH domain compilation.

sglang backend

OpenAI-compatible endpoint with constraint_spec extension field. Backend auto-detection: sglang if configured, Modal as fallback. New export-spec command for one-shot constraint pipeline.

Eval framework

Multi-sample pass@k with statistical significance testing. 24 task categories, paired constrained vs. unconstrained comparison, batch evaluation.

Numbers

  • Tests: 301 to 617 (473 Zig + 144 Rust), zero failures
  • Patterns: 101 across 5 languages to 383 across 14
  • Tree-sitter integration fully working (was pending in v0.1.0)

Full changelog: v0.1.0...v0.2.0