Release 1.23.0
What's New
Features
-
GBNF grammar for llama.cpp — The RIDDL grammar is now available in GBNF format for constrained text generation with llama.cpp and compatible inference engines. An automated Python converter (
ebnf_to_gbnf.py) transforms the canonical EBNF grammar (258 rules) into GBNF, handling whitespace insertion automatically by classifying rules as terminal (character-level) vs structural (syntax-level). Three rules with negative lookahead patterns are maintained as hand-written state-machine equivalents in a separate overrides file. The generated grammar is committed atlanguage/shared/src/main/resources/riddl/grammar/riddl-grammar.gbnf. -
Grammar API:
loadGbnfGrammar— TheGrammarobject in the language module now providesloadGbnfGrammarandloadGbnfGrammarOrThrowmethods to load the GBNF grammar from the classpath, alongside the existing EBNF loading methods. TheGbnfResourcePathconstant is also exposed for direct resource access. -
GBNF validation test suite — A comprehensive validator (
gbnf_validator.py) checks the generated GBNF for correctness: syntax validation, rule completeness (no dangling references), override coverage, EBNF-to-GBNF rule coverage (all 258 EBNF rules present), and freshness verification (committed file matches regeneration). Integrated into CI alongside the existing EBNF TatSu validation.
Internal
- Fixed CI workflow paths for Scala 3.8.3 upgrade (
release.yml,scala.yml,coverage.ymlall referenced stalescala-3.7.4paths) - Added
context-types.riddlto EBNF include fragment exclusion lists in both TatSu and Lark validators