REQ-INFER-007: Named grammars are registered, validated, and resolved by a fixed precedence

← Requirements

What it requires

  1. Given a registry, When grammars are registered from string/file/directory and deregistered, Then get/has/list/size reflect the mutations and duplicate keys are rejected.
  2. Given a malformed GBNF, Then validate returns a non-empty error and the entry records it.
  3. Given params carrying a raw grammar, a grammar_key, and a tier frontmatter grammar, Then resolution picks them in that order; an unknown runtime key leaves the params unconstrained and is recorded with resolved == false.
  4. Given a tier naming a grammar stem with no matching .gbnf in any search path, Then configure SUCCEEDS with a warning naming the tier, the stem and every directory searched, And a run selecting that tier returns ENTROPIC_ERROR_GRAMMAR_NOT_FOUND with no content and no tokens, And registering that key afterwards lets the same tier run normally.
tier
NOT_RUN

Where it lives

  • src/inference11
  • src/facade7
  • src/config3

See it on the map

How it is met

implemented byresults (217 tests)build_grammar_entryentropic_grammar_deregisterentropic_grammar_getentropic_grammar_listentropic_grammar_registerentropic_grammar_register_fileentropic_grammar_validategenerate_streaminggrammar_search_pathsholds_grammarsload_bundlednormalize_grammar_keyrefuse_unresolved_batch_grammarsrefuse_unresolved_tier_grammarregister_from_fileregister_grammarresolve_grammar_keytier_grammar_unresolvedvalidatewarn_tier_grammars_stepwarn_unresolved_tier_grammars217 absent217 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (217)

Reached through calls

217 tests: 217 absent

testresultlinked byimplementers exercisedcalls away
gh#95: identity grammar: field constrains that tier's outputabsentinferred13 of 211
gh#154 a tier grammar that is not registered refuses the runabsentinferred9 of 211
ModelOrchestrator real-model generate (one load, CPU)absentinferred8 of 211
Orchestrator generate() returns typed error when tier missingabsentinferred8 of 211
Orchestrator generate_streaming error + routing + fallback pathsabsentinferred8 of 211
gh#108 (v2.10.3) CONTROL: plain-decode streaming on the same tierabsentinferred8 of 211
gh#108 (v2.10.3) MTP + grammar + streaming through absentinferred8 of 211
gh#108 (v2.10.3) MTP + streaming without a grammar still streamsabsentinferred8 of 211
gh#134 (v2.10.4) require_tool_call forces a tool call under MTPabsentinferred8 of 211
gh#154 registering the tier's grammar after configure opens the absentinferred8 of 211
gh#134 (v2.10.4) A/B: the knob, not the model, produces the callabsentinferred5 of 211
gh#134 (v2.10.4) closest replication of the reported stall configabsentinferred5 of 211
gh#134 (v2.10.4) multi-turn: rails hold past the stall onsetabsentinferred5 of 211
Grammar register and get round-tripabsentinferred3 of 21: entropic_grammar_deregister, entropic_grammar_get, entropic_grammar_register1
Load bundled from nonexistent directoryabsentinferred3 of 21: build_grammar_entry, load_bundled, validate1
Load bundled grammars from directoryabsentinferred3 of 21: build_grammar_entry, load_bundled, validate1
Register from nonexistent file failsabsentinferred3 of 21: register_from_file, register_grammar, validate1
Register grammar from fileabsentinferred3 of 21: register_from_file, register_grammar, validate1
entropic_grammar_deregister of registered key succeedsabsentinferred3 of 21: entropic_grammar_deregister, entropic_grammar_get, entropic_grammar_register1
Clear removes all grammarsabsentinferred2 of 21: register_grammar, validate1
Concurrent register and get are thread-safeabsentinferred2 of 21: register_grammar, validate1
Deregister removes grammarabsentinferred2 of 21: register_grammar, validate1
Deregistered grammar no longer resolvesabsentinferred2 of 21: register_grammar, validate1
Duplicate key registration failsabsentinferred2 of 21: register_grammar, validate1
Frontmatter grammar with .gbnf extension normalizedabsentinferred2 of 21: register_grammar, validate1
Frontmatter grammar without extension used as-isabsentinferred2 of 21: register_grammar, validate1
Grammar list returns JSON arrayabsentinferred2 of 21: entropic_grammar_list, entropic_grammar_register1
Grammar validate detects invalid GBNFabsentinferred2 of 21: entropic_grammar_validate, validate1
Invalid grammar registered with error metadataabsentinferred2 of 21: register_grammar, validate1
List returns all registered grammarsabsentinferred2 of 21: register_grammar, validate1
No grammar set leaves generation unconstrainedabsentinferred2 of 21: register_grammar, validate1
Raw grammar string takes precedence over grammar_keyabsentinferred2 of 21: register_grammar, validate1
Register grammar from in-memory stringabsentinferred2 of 21: register_grammar, validate1
Runtime-registered grammar usable in resolutionabsentinferred2 of 21: register_grammar, validate1
entropic_grammar_list on configured handle returns JSON arrayabsentinferred2 of 21: entropic_grammar_list, entropic_grammar_register1
entropic_grammar_register + get round-trip on configured handleabsentinferred2 of 21: entropic_grammar_get, entropic_grammar_register1
entropic_grammar_register multiple keys then list contains allabsentinferred2 of 21: entropic_grammar_list, entropic_grammar_register1
entropic_grammar_validate accepts trivial GBNFabsentinferred2 of 21: entropic_grammar_validate, validate1
entropic_grammar_validate rejects NULL inputabsentinferred2 of 21: entropic_grammar_validate, validate1
entropic_grammar_validate rejects clearly invalid GBNFabsentinferred2 of 21: entropic_grammar_validate, validate1
entropic_grammar_validate returns NULL on valid GBNFabsentinferred2 of 21: entropic_grammar_validate, validate1
gh#154 grammar search paths mirror the runtime lookupabsentinferred2 of 21: grammar_search_paths, holds_grammars1
grammar_key resolved to contentabsentinferred2 of 21: register_grammar, validate1
grammar_key takes precedence over frontmatterabsentinferred2 of 21: register_grammar, validate1
valid grammar_id acceptedabsentinferred2 of 21: register_grammar, validate1
Validate accepts well-formed GBNFabsentinferred1 of 21: validate1
Validate rejects empty stringabsentinferred1 of 21: validate1
Validate rejects malformed GBNFabsentinferred1 of 21: validate1
entropic_grammar_deregister of unknown key returns NOT_FOUNDabsentinferred1 of 21: entropic_grammar_deregister1
entropic_grammar_deregister on unconfigured handle returns INVALID_STATEabsentinferred1 of 21: entropic_grammar_deregister1
entropic_grammar_get returns NULL on NULL handleabsentinferred1 of 21: entropic_grammar_get1
entropic_grammar_get returns NULL on unconfigured handleabsentinferred1 of 21: entropic_grammar_get1
entropic_grammar_get unknown key returns NULL on configured handleabsentinferred1 of 21: entropic_grammar_get1
entropic_grammar_list returns NULL on NULL handleabsentinferred1 of 21: entropic_grammar_list1
entropic_grammar_list returns NULL on unconfigured handleabsentinferred1 of 21: entropic_grammar_list1
entropic_grammar_register duplicate returns ALREADY_EXISTSabsentinferred1 of 21: entropic_grammar_register1
entropic_grammar_register on NULL handle returns INVALID_HANDLEabsentinferred1 of 21: entropic_grammar_register1
entropic_grammar_register on unconfigured handle returns INVALID_STATEabsentinferred1 of 21: entropic_grammar_register1
entropic_grammar_register_file on unconfigured handle returns INVALID_STATEabsentinferred1 of 21: entropic_grammar_register_file1
entropic_grammar_register_file with missing file returns IOabsentinferred1 of 21: entropic_grammar_register_file1
gh#154 an unresolved tier grammar stem is warned about, not absentinferred1 of 21: warn_unresolved_tier_grammars1
gh#158: interrupting one session leaves the other runningabsentinferred13 of 212
gh#158: metrics and context reads are safe during live runsabsentinferred13 of 212
gh#158: two concurrent sessions do not bleed into each otherabsentinferred13 of 212
gh#164: entropic_release_model frees VRAM through the C ABIabsentinferred13 of 212
gh#165 + gh#164: release the weights, keep the conversationabsentinferred13 of 212
gh#165: a dropped session restored from JSON keeps answeringabsentinferred13 of 212
gh#166: two workspaces on one handle do not read each other's absentinferred13 of 212
gh#169: an iteration-capped delegate hands its parent the audit it absentinferred13 of 212
gh#179: each workspace's sessions answer from its own app_context, absentinferred13 of 212
gh#181: a delegate hard-cut by the thinking budget hands its absentinferred13 of 212
gh#194: a plain generation publishes the prefill it performedabsentinferred13 of 212
gh#198: a deferred handle holds no GPU memory until it runsabsentinferred13 of 212
gh#204/gh#205: two HTTP clients, different session, workspace and absentinferred13 of 212
gh#214: a prompt that does not fit fails the turn, typedabsentinferred13 of 212
gh#216: multi-byte text at the history cut does not poison later turnsabsentinferred13 of 212
gh#217: release is refused while another session is decodingabsentinferred13 of 212
gh#93: autoparser family parses a multi-parameter tool callabsentinferred13 of 212
gh#93: entropic_interrupt stops a long run early (cancel-bridge)absentinferred13 of 212
gh#94: enable_thinking:false suppresses think blocks (facade)absentinferred13 of 212
gh#99: run_as emits each tier's grammar on a shared modelabsentinferred13 of 212
outside-root optional: a real model's reads outside its root absentinferred13 of 212
v2.14.1: a declared server serves each workspace from its own repositoryabsentinferred13 of 212
v2.14.3: release frees the model over MCP and the conversation survivesabsentinferred13 of 212
v2.14.4: a model's commit message with shell syntax is text, not a commandabsentinferred13 of 212
v2.14.5: a failed turn is an error carrying only its own textabsentinferred13 of 212
gh#106 MTP routes through orchestrator->generate()absentinferred7 of 212
gh#108 (v2.10.0) a request-level grammar routes to MTP on an absentinferred7 of 212
gh#108 (v2.10.3) CONTROL: non-streaming generate on the same tierabsentinferred7 of 212
gh#108 MTP engages with tools staged through orchestrator (agent loop)absentinferred7 of 212
gh#108 MTP loud error propagates through orchestrator (no fallback)absentinferred7 of 212
gh#108 per-tier speculative_mtp=false overrides the global flagabsentinferred7 of 212
gh#137 a toolless enable_thinking:false turn must not deliver absentinferred7 of 212
gh#148 auto: a VRAM reserve forces a real partial offload that absentinferred7 of 212
gh#154 a REQUEST-level grammar_key miss still fails openabsentinferred7 of 212
v2.14.6: a real image runs through E4B QAT and its projectorabsentinferred7 of 212
gh#88: a parroted {action:...} emission dispatches via the gemma absentinferred5 of 212
Consecutive same-tier generations do not leak content across absentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Conversation with model output survives save and loadabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Engine produces coherent text from a simple promptabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
GBNF grammar constrains output to valid JSONabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Gemma 4 A4B GGUF loads and generates first tokenabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Gemma 4 E4B GGUF loads and generates first tokenabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Generation succeeds with non-default GPU profileabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Lead delegates to child and receives resultabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
LoRA adapter load failure is handled gracefullyabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Model output is correctly parsed into tool callsabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Multi-turn context is retained across generationsabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Nemotron 3 family GGUF loads and generates first tokenabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Qwen 3.5 family GGUF loads and generates first tokenabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Recall-style prompts do not surface prior-generation contentabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Text-only model handles multimodal input gracefullyabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
gh#103 contrast: batch mode may generate past the tool callabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
gh#103 gemma severe case: sequential mode stops at <tool_call|> AND absentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
gh#103: sequential tool_call_mode hard-stops at the first tool call absentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
gh#87 cutover: params.tools drives common_chat through the orchestratorabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
gh#90: gemma <|\"|> escape on a numeric value keeps string typingabsentinferred4 of 21: normalize_grammar_key, refuse_unresolved_tier_grammar, resolve_grammar_key, tier_grammar_unresolved2
Orchestrator load_grammars_from with missing dir returns 0absentinferred3 of 21: build_grammar_entry, load_bundled, validate2
Orchestrator load_grammars_from with valid directory loads filesabsentinferred3 of 21: build_grammar_entry, load_bundled, validate2
gh#122: fenced-json block in model output yields a tool callabsentinferred8 of 213
gh#127: ambiguous fenced args object returns empty (no false positive)absentinferred8 of 213
gh#127: fenced args-only object matched by registered tool schemaabsentinferred8 of 213
interface_factory: wiring + iface_* surface sweepabsentinferred8 of 213
gh#108 CPU-only feasibility: E2B-QAT-Q4 x MTP x flash+q4KV, absentinferred7 of 213
gh#108 agentic benchmark: full 24-config permutation matrix absentinferred7 of 213
Classification runs the router and yields a configured tierabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Cleared classification_prompt makes routing a no-op (RED control)absentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator VRAM budget env override is read at initializeabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator drives create_tier_backends + activation failureabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator empty-tiers + handoff + observer + accessor coverageabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator initialize against missing tier paths fails cleanlyabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator member apply_tier_sampler_defaults maps all 8 absentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator multi-instance side-by-side constructionabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator residency_snapshot_json reports configured budgetabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator route() exercises both enabled and disabled pathsabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Orchestrator route() with router configured but unloadableabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#148 auto: a reserve no placement can fit is refused with a absentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#157: a deferred tier answers vision from config while unloadedabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#157: defer_load decides whether init touches the model at allabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#157: the first use loads exactly once, through the gateabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#164: release evicts the model and the next use brings it backabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
gh#198: a deferred handle does not touch the device until it loadsabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
testRunStartingabsentinferred3 of 21: build_grammar_entry, load_bundled, validate3
Configure with null JSON returns errorabsentinferred12 of 214
Double-configure on one handle is refusedabsentinferred12 of 214
Nemotron3-Nano-4B Q8 first inference does not crash (gh#66)absentinferred12 of 214
Three handles can coexistabsentinferred12 of 214
Two GPU-resident handles can coexist (v2.2.8 target)absentinferred12 of 214
Two handles configure independentlyabsentinferred12 of 214
entropic_configure called twice on the same handle returns ALREADY_CONFIGUREDabsentinferred12 of 214
entropic_configure rejects NULL config_jsonabsentinferred12 of 214
entropic_configure rejects NULL handleabsentinferred12 of 214
entropic_configure_dir on /dev/null subpath returns an error, not an exceptionabsentinferred12 of 214
entropic_configure_dir on a tmp dir runs the loader pathabsentinferred12 of 214
entropic_configure_dir rejects NULL handleabsentinferred12 of 214
entropic_configure_dir with empty string path returns an error code, not an exceptionabsentinferred12 of 214
entropic_configure_from_file rejects NULL handleabsentinferred12 of 214
entropic_configure_from_file rejects NULL pathabsentinferred12 of 214
entropic_configure_from_file rejects missing fileabsentinferred12 of 214
entropic_last_error reflects most-recent operation failureabsentinferred12 of 214
entropic_last_error returns per-handle state (v2.2.6)absentinferred12 of 214
entropic_register_mcp_server on a configured handle absentinferred12 of 214
entropic_run_messages with console logging disabled still absentinferred12 of 214
entropic_seconds_since_last_activity returns 0 before any run absentinferred12 of 214
gh#110: MTP engages through the real agent loop (entropic_run)absentinferred12 of 214
gh#121 regression: configure populates engine's allowed_tools from identity frontmatterabsentinferred12 of 214
gh#144: concurrent bridge clients queue instead of racingabsentinferred12 of 214
gh#154 a tier grammar stem that cannot resolve YET still absentinferred12 of 214
gh#154 a tier grammar stem that resolves still configuresabsentinferred12 of 214
gh#154 a tier with no grammar is unaffectedabsentinferred12 of 214
gh#154 entropic_metrics_json carries a generations arrayabsentinferred12 of 214
gh#156 a frontmatter-less app_context fails configure absentinferred12 of 214
gh#156 a frontmatter-less constitution fails configure tooabsentinferred12 of 214
gh#156 a missing app_context path fails configureabsentinferred12 of 214
gh#156 a well-formed app_context file still configuresabsentinferred12 of 214
gh#156 app_context false still configuresabsentinferred12 of 214
gh#156 inline app_context content still configuresabsentinferred12 of 214
gh#158 entropic_interrupt_session targets exactly one runabsentinferred12 of 214
gh#163 entropic_configure carries app_context into ParsedConfigabsentinferred12 of 214
gh#163 entropic_configure_dir carries app_contextabsentinferred12 of 214
gh#163 entropic_configure_from_file carries app_contextabsentinferred12 of 214
gh#163 the object and false spellings survive configure_dir tooabsentinferred12 of 214
gh#164 entropic_release_model names an unknown tierabsentinferred12 of 214
gh#164 entropic_release_model refuses to unload mid-turnabsentinferred12 of 214
gh#165 entropic_session_context_set guards its preconditionsabsentinferred12 of 214
gh#165 entropic_session_context_set refuses the running sessionabsentinferred12 of 214
gh#165 entropic_session_context_set round-trips through the C ABIabsentinferred12 of 214
gh#175: a non-positive mcp.server_timeout_seconds is refused at configureabsentinferred12 of 214
gh#203: followup returns delegation_id and summary from real storageabsentinferred12 of 214
gh#204: an unservable http_port fails configure loudlyabsentinferred12 of 214
h1.run() after h2.configure() does not segfault (v2.2.6)absentinferred12 of 214
gh#153 MTP vs plain decode throughput — four arms, Gemma 4 26B-A4B absentinferred7 of 214
gh#153 MTP vs plain decode throughput — four arms, Gemma 4 E4B absentinferred7 of 214
gh#164: release then reload decodes correctly on a hybrid archabsentinferred7 of 214
gh#164: release then reload decodes correctly on gemma4 (plain KV)absentinferred7 of 214
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 131072 contextabsentinferred7 of 214
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 32768 contextabsentinferred7 of 214
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 65536 contextabsentinferred7 of 214
Compaction fires when context exceeds thresholdabsentinferred5 of 214
Constitutional validator detects violations and revisesabsentinferred5 of 214
Delegation wiring fires on_delegation_start callbackabsentinferred5 of 214
Dynamic identity creation and generation through engine loopabsentinferred5 of 214
Engine state transitions include PLANNING and EXECUTINGabsentinferred5 of 214
Hooks fire in correct order during a generation cycleabsentinferred5 of 214
MCP authorization denial propagates through engineabsentinferred5 of 214
Multi-turn engine calls retain contextabsentinferred5 of 214
Routing fires on_tier_selected callbackabsentinferred5 of 214
Single-turn engine loop produces coherent responseabsentinferred5 of 214
Tool call cycle: generate, parse, execute, regenerateabsentinferred5 of 214
True end-to-end: real prompts, real engine, real modelabsentinferred5 of 214
gh#105: constitutional validator's toolless render must NOT clobber absentinferred5 of 214
gh#160: an isolated delegation never writes the project, and absentinferred5 of 214
gh#162: a delegate seeded with context answers from the named absentinferred5 of 214
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred5 of 214
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred5 of 214
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred5 of 214
gh#193: what cold prefill costs at each residency levelabsentinferred3 of 21: build_grammar_entry, load_bundled, validate6