REQ-INFER-008: Every declared grammar source reaches the sampler and exactly one wins

← Requirements

What it requires

  1. Given the declared source set, Then grammar_source_count() equals the number the invariant test exercises and every non-none source is producible from resolve_grammar_source.
  2. Given only a request grammar, Then request wins; given only a tool grammar, Then tool_call wins; given neither, Then none; given a request-side grammar that came from the tier, Then tier.
  3. Given both, Then request wins and grammar_sources_collide reports true so the collision is loggable and lands in GenerationResult::grammar.conflict_winner.
  4. Given a named key that resolved to nothing, Then the naming source is reported with resolved == false.
tier
NOT_RUN

Where it lives

  • src/inference19
  • include/entropic1

See it on the map

How it is met

implemented byresults (237 tests)active_tool_grammaractive_tool_grammaradd_grammar_sampleradd_tool_call_grammarapply_grammar_sourcecreatecreatedescribe_grammarfinish_generationgenerate_streaminggeneration_recordsgrammar_source_countgrammar_source_namegrammar_sources_collideis_request_grammarpatch_gemma4_required_rootrecord_generationresolve_grammar_sourceto_common_samplingtool_grammar_for237 absent237 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (237)

Reached through calls

237 tests: 237 absent

testresultlinked byimplementers exercisedcalls away
ModelOrchestrator real-model generate (one load, CPU)absentinferred14 of 201
Orchestrator generate() returns typed error when tier missingabsentinferred14 of 201
Orchestrator generate_streaming error + routing + fallback pathsabsentinferred14 of 201
gh#154 a tier grammar that is not registered refuses the runabsentinferred14 of 201
gh#108 (v2.10.3) CONTROL: plain-decode streaming on the same tierabsentinferred13 of 201
gh#108 (v2.10.3) MTP + grammar + streaming through absentinferred13 of 201
gh#108 (v2.10.3) MTP + streaming without a grammar still streamsabsentinferred13 of 201
gh#134 (v2.10.4) A/B: the knob, not the model, produces the callabsentinferred13 of 201
gh#134 (v2.10.4) closest replication of the reported stall configabsentinferred13 of 201
gh#134 (v2.10.4) multi-turn: rails hold past the stall onsetabsentinferred13 of 201
gh#134 (v2.10.4) require_tool_call forces a tool call under MTPabsentinferred13 of 201
gh#134 every declared grammar source is wired to the samplerabsentinferred4 of 20: grammar_source_count, grammar_source_name, is_request_grammar, resolve_grammar_source1
gh#154 the result says what constrained the decodeabsentinferred4 of 20: describe_grammar, grammar_source_name, grammar_sources_collide, resolve_grammar_source1
v2.14.6: a non-lazy tool-call grammar is applied on plain decode, absentinferred3 of 20: add_grammar_sampler, add_tool_call_grammar, create1
gh#134 exactly one grammar source constrains a decodeabsentinferred2 of 20: grammar_sources_collide, resolve_grammar_source1
v2.14.6: the Gemma 4 REQUIRED grammar forces one call, then EOGabsentinferred2 of 20: create, patch_gemma4_required_root1
A non-empty GBNF grammar engages a grammar stage that masks absentinferred1 of 20: create1
An empty grammar leaves the chain UNCONSTRAINED — the control absentinferred1 of 20: create1
An unknown Gemma 4 root shape is left unchangedabsentinferred1 of 20: patch_gemma4_required_root1
The Gemma 4 REQUIRED root is rewritten to the f072b10371 shapeabsentinferred1 of 20: patch_gemma4_required_root1
gh#88: a parroted {action:...} emission dispatches via the gemma absentinferred14 of 202
Consecutive same-tier generations do not leak content across absentinferred13 of 202
Conversation with model output survives save and loadabsentinferred13 of 202
Engine produces coherent text from a simple promptabsentinferred13 of 202
GBNF grammar constrains output to valid JSONabsentinferred13 of 202
Gemma 4 A4B GGUF loads and generates first tokenabsentinferred13 of 202
Gemma 4 E4B GGUF loads and generates first tokenabsentinferred13 of 202
Generation succeeds with non-default GPU profileabsentinferred13 of 202
Lead delegates to child and receives resultabsentinferred13 of 202
LoRA adapter load failure is handled gracefullyabsentinferred13 of 202
Model output is correctly parsed into tool callsabsentinferred13 of 202
Multi-turn context is retained across generationsabsentinferred13 of 202
Nemotron 3 family GGUF loads and generates first tokenabsentinferred13 of 202
Qwen 3.5 family GGUF loads and generates first tokenabsentinferred13 of 202
Recall-style prompts do not surface prior-generation contentabsentinferred13 of 202
Text-only model handles multimodal input gracefullyabsentinferred13 of 202
gh#103 contrast: batch mode may generate past the tool callabsentinferred13 of 202
gh#103 gemma severe case: sequential mode stops at <tool_call|> AND absentinferred13 of 202
gh#103: sequential tool_call_mode hard-stops at the first tool call absentinferred13 of 202
gh#106 MTP routes through orchestrator->generate()absentinferred13 of 202
gh#108 (v2.10.0) a request-level grammar routes to MTP on an absentinferred13 of 202
gh#108 (v2.10.3) CONTROL: non-streaming generate on the same tierabsentinferred13 of 202
gh#108 MTP engages with tools staged through orchestrator (agent loop)absentinferred13 of 202
gh#108 MTP loud error propagates through orchestrator (no fallback)absentinferred13 of 202
gh#108 per-tier speculative_mtp=false overrides the global flagabsentinferred13 of 202
gh#137 a toolless enable_thinking:false turn must not deliver absentinferred13 of 202
gh#148 auto: a VRAM reserve forces a real partial offload that absentinferred13 of 202
gh#154 a REQUEST-level grammar_key miss still fails openabsentinferred13 of 202
gh#154 registering the tier's grammar after configure opens the absentinferred13 of 202
gh#87 cutover: params.tools drives common_chat through the orchestratorabsentinferred13 of 202
gh#90: gemma <|\"|> escape on a numeric value keeps string typingabsentinferred13 of 202
v2.14.6: a real image runs through E4B QAT and its projectorabsentinferred13 of 202
gh#106 MTP kernel: engaged + lossless-coherentabsentinferred9 of 202
gh#108 MTP + flash + q4 KV succeeds on E4B QAT Q4 absentinferred9 of 202
gh#108 MTP + flash attention succeeds (v2.9.3, upstream #25148)absentinferred9 of 202
gh#108 MTP greedy holds across a multi-turn contextabsentinferred9 of 202
gh#108 MTP guards: out-of-envelope requests fail loudabsentinferred9 of 202
gh#108 MTP is lossless at temperature>0 (empirical distribution check)absentinferred9 of 202
gh#144: MTP prefill must not re-decode an unchanged prefixabsentinferred9 of 202
LlamaCppBackend lifecycle on a small real model (one load)absentinferred3 of 20: generation_records, patch_gemma4_required_root, tool_grammar_for2
gh#87 diag: multi-parameter tool call — gemma4 (dedicated PEG)absentinferred3 of 20: generation_records, patch_gemma4_required_root, tool_grammar_for2
gh#122: fenced-json block in model output yields a tool callabsentinferred14 of 203
gh#127: ambiguous fenced args object returns empty (no false positive)absentinferred14 of 203
gh#127: fenced args-only object matched by registered tool schemaabsentinferred14 of 203
interface_factory: wiring + iface_* surface sweepabsentinferred14 of 203
gh#153 MTP vs plain decode throughput — four arms, Gemma 4 26B-A4B absentinferred13 of 203
gh#153 MTP vs plain decode throughput — four arms, Gemma 4 E4B absentinferred13 of 203
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 131072 contextabsentinferred13 of 203
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 32768 contextabsentinferred13 of 203
gh#197 auto + MTP head on the 26B-A4B IQ2_M at 65536 contextabsentinferred13 of 203
gh#106 MTP functions on the E4B QAT trunkabsentinferred9 of 203
gh#87 Increment-2: backend render_with_tools → parse_response absentinferred3 of 20: generation_records, patch_gemma4_required_root, tool_grammar_for3
Compaction fires when context exceeds thresholdabsentinferred14 of 204
Constitutional validator detects violations and revisesabsentinferred14 of 204
Delegation wiring fires on_delegation_start callbackabsentinferred14 of 204
Dynamic identity creation and generation through engine loopabsentinferred14 of 204
Engine state transitions include PLANNING and EXECUTINGabsentinferred14 of 204
Hooks fire in correct order during a generation cycleabsentinferred14 of 204
MCP authorization denial propagates through engineabsentinferred14 of 204
Multi-turn engine calls retain contextabsentinferred14 of 204
Routing fires on_tier_selected callbackabsentinferred14 of 204
Single-turn engine loop produces coherent responseabsentinferred14 of 204
Tool call cycle: generate, parse, execute, regenerateabsentinferred14 of 204
True end-to-end: real prompts, real engine, real modelabsentinferred14 of 204
gh#105: constitutional validator's toolless render must NOT clobber absentinferred14 of 204
gh#154 entropic_metrics_json carries a generations arrayabsentinferred14 of 204
gh#158: metrics and context reads are safe during live runsabsentinferred14 of 204
gh#160: an isolated delegation never writes the project, and absentinferred14 of 204
gh#162: a delegate seeded with context answers from the named absentinferred14 of 204
gh#88: a gemma multi-turn session never accumulates a parrotable absentinferred14 of 204
v2.14.6: a lead that answers in prose is nudged, and its forced absentinferred14 of 204
v2.14.6: with thinking on, each loop turn ends in a real tool callabsentinferred14 of 204
gh#108 CPU-only feasibility: E2B-QAT-Q4 x MTP x flash+q4KV, absentinferred13 of 204
gh#108 agentic benchmark: full 24-config permutation matrix absentinferred13 of 204
gh#164: release then reload decodes correctly on a hybrid archabsentinferred13 of 204
gh#164: release then reload decodes correctly on gemma4 (plain KV)absentinferred13 of 204
entropic_metrics_json on configured handle returns JSONabsentinferred1 of 20: generation_records4
entropic_metrics_json output is valid JSON object on configured handleabsentinferred1 of 20: generation_records4
entropic_metrics_json rejects NULL handleabsentinferred1 of 20: generation_records4
entropic_metrics_json rejects NULL out-paramabsentinferred1 of 20: generation_records4
gh#194: a plain generation publishes the prefill it performedabsentinferred14 of 205
Configure with null JSON returns errorabsentinferred14 of 207
Double-configure on one handle is refusedabsentinferred14 of 207
Nemotron3-Nano-4B Q8 first inference does not crash (gh#66)absentinferred14 of 207
Three handles can coexistabsentinferred14 of 207
Two GPU-resident handles can coexist (v2.2.8 target)absentinferred14 of 207
Two handles configure independentlyabsentinferred14 of 207
entropic_configure called twice on the same handle returns ALREADY_CONFIGUREDabsentinferred14 of 207
entropic_configure rejects NULL config_jsonabsentinferred14 of 207
entropic_configure rejects NULL handleabsentinferred14 of 207
entropic_configure_dir on /dev/null subpath returns an error, not an exceptionabsentinferred14 of 207
entropic_configure_dir on a tmp dir runs the loader pathabsentinferred14 of 207
entropic_configure_dir rejects NULL handleabsentinferred14 of 207
entropic_configure_dir with empty string path returns an error code, not an exceptionabsentinferred14 of 207
entropic_configure_from_file rejects NULL handleabsentinferred14 of 207
entropic_configure_from_file rejects NULL pathabsentinferred14 of 207
entropic_configure_from_file rejects missing fileabsentinferred14 of 207
entropic_last_error reflects most-recent operation failureabsentinferred14 of 207
entropic_last_error returns per-handle state (v2.2.6)absentinferred14 of 207
entropic_register_mcp_server on a configured handle absentinferred14 of 207
entropic_run_messages with console logging disabled still absentinferred14 of 207
entropic_seconds_since_last_activity returns 0 before any run absentinferred14 of 207
gh#110: MTP engages through the real agent loop (entropic_run)absentinferred14 of 207
gh#121 regression: configure populates engine's allowed_tools from identity frontmatterabsentinferred14 of 207
gh#144: concurrent bridge clients queue instead of racingabsentinferred14 of 207
gh#154 a tier grammar stem that cannot resolve YET still absentinferred14 of 207
gh#154 a tier grammar stem that resolves still configuresabsentinferred14 of 207
gh#154 a tier with no grammar is unaffectedabsentinferred14 of 207
gh#156 a frontmatter-less app_context fails configure absentinferred14 of 207
gh#156 a frontmatter-less constitution fails configure tooabsentinferred14 of 207
gh#156 a missing app_context path fails configureabsentinferred14 of 207
gh#156 a well-formed app_context file still configuresabsentinferred14 of 207
gh#156 app_context false still configuresabsentinferred14 of 207
gh#156 inline app_context content still configuresabsentinferred14 of 207
gh#158 entropic_interrupt_session targets exactly one runabsentinferred14 of 207
gh#163 entropic_configure carries app_context into ParsedConfigabsentinferred14 of 207
gh#163 entropic_configure_dir carries app_contextabsentinferred14 of 207
gh#163 entropic_configure_from_file carries app_contextabsentinferred14 of 207
gh#163 the object and false spellings survive configure_dir tooabsentinferred14 of 207
gh#164 entropic_release_model names an unknown tierabsentinferred14 of 207
gh#164 entropic_release_model refuses to unload mid-turnabsentinferred14 of 207
gh#165 entropic_session_context_set guards its preconditionsabsentinferred14 of 207
gh#165 entropic_session_context_set refuses the running sessionabsentinferred14 of 207
gh#165 entropic_session_context_set round-trips through the C ABIabsentinferred14 of 207
gh#175: a non-positive mcp.server_timeout_seconds is refused at configureabsentinferred14 of 207
gh#203: followup returns delegation_id and summary from real storageabsentinferred14 of 207
gh#204: an unservable http_port fails configure loudlyabsentinferred14 of 207
gh#95: identity grammar: field constrains that tier's outputabsentinferred14 of 207
h1.run() after h2.configure() does not segfault (v2.2.6)absentinferred14 of 207
gh#158: interrupting one session leaves the other runningabsentinferred14 of 208
gh#158: two concurrent sessions do not bleed into each otherabsentinferred14 of 208
gh#164: entropic_release_model frees VRAM through the C ABIabsentinferred14 of 208
gh#165 + gh#164: release the weights, keep the conversationabsentinferred14 of 208
gh#165: a dropped session restored from JSON keeps answeringabsentinferred14 of 208
gh#166: two workspaces on one handle do not read each other's absentinferred14 of 208
gh#169: an iteration-capped delegate hands its parent the audit it absentinferred14 of 208
gh#179: each workspace's sessions answer from its own app_context, absentinferred14 of 208
gh#181: a delegate hard-cut by the thinking budget hands its absentinferred14 of 208
gh#198: a deferred handle holds no GPU memory until it runsabsentinferred14 of 208
gh#204/gh#205: two HTTP clients, different session, workspace and absentinferred14 of 208
gh#214: a prompt that does not fit fails the turn, typedabsentinferred14 of 208
gh#216: multi-byte text at the history cut does not poison later turnsabsentinferred14 of 208
gh#217: release is refused while another session is decodingabsentinferred14 of 208
gh#93: autoparser family parses a multi-parameter tool callabsentinferred14 of 208
gh#93: entropic_interrupt stops a long run early (cancel-bridge)absentinferred14 of 208
gh#94: enable_thinking:false suppresses think blocks (facade)absentinferred14 of 208
gh#99: run_as emits each tier's grammar on a shared modelabsentinferred14 of 208
outside-root optional: a real model's reads outside its root absentinferred14 of 208
v2.14.1: a declared server serves each workspace from its own repositoryabsentinferred14 of 208
v2.14.3: release frees the model over MCP and the conversation survivesabsentinferred14 of 208
v2.14.4: a model's commit message with shell syntax is text, not a commandabsentinferred14 of 208
v2.14.5: a failed turn is an error carrying only its own textabsentinferred14 of 208
gh#144: the ask tool advertises session as OPTIONALabsentinferred1 of 20: generation_records8
gh#205: ask advertises tier and workspace, both OPTIONALabsentinferred1 of 20: generation_records8
A call that fails identically is refused rather than retried absentinferred1 of 20: generation_records9
Anti-spiral hard block stops dispatch and emits absentinferred1 of 20: generation_records9
Anti-spiral hard block uses derived default when sentinel setabsentinferred1 of 20: generation_records9
Error result not cached for dedupabsentinferred1 of 20: generation_records9
POST_TOOL_CALL fires on schema rejection with kindabsentinferred1 of 20: generation_records9
POST_TOOL_CALL hook transforms schema-rejection contentabsentinferred1 of 20: generation_records9
Permission denied returns feedbackabsentinferred1 of 20: generation_records9
Schema validation rejects invalid enum valueabsentinferred1 of 20: generation_records9
Schema validation rejects missing required fieldabsentinferred1 of 20: generation_records9
Tool executor processes calls via ServerManagerabsentinferred1 of 20: generation_records9
gh#143: an argument-free call to a no-required-fields tool absentinferred1 of 20: generation_records9
gh#190: a structured JSON error counts as a failure everywhereabsentinferred1 of 20: generation_records9
mcp.bash.timeout_seconds reaches the dispatched bash serverabsentinferred1 of 20: generation_records9
v2.14.0: schema validation enforces declared minimum and maximumabsentinferred1 of 20: generation_records9
v2.14.6: a headless host still dispatches engine directivesabsentinferred1 of 20: generation_records9
v2.14.6: the model's own tool call stays in the history it is shownabsentinferred1 of 20: generation_records9
Auto approve skips callbackabsentinferred1 of 20: generation_records10
Chained POST_TOOL_CALL hooks: last write winsabsentinferred1 of 20: generation_records10
Circuit breaker at threeabsentinferred1 of 20: generation_records10
Duplicate counter resetsabsentinferred1 of 20: generation_records10
Duplicate detection skipsabsentinferred1 of 20: generation_records10
Headless mode denies without callbackabsentinferred1 of 20: generation_records10
Max tool calls per turnabsentinferred1 of 20: generation_records10
Multiple tool calls in batchabsentinferred1 of 20: generation_records10
POST_TOOL_CALL fires on duplicate rejection with kindabsentinferred1 of 20: generation_records10
POST_TOOL_CALL hook transforms duplicate-rejection contentabsentinferred1 of 20: generation_records10
POST_TOOL_CALL hook transforms successful tool result contentabsentinferred1 of 20: generation_records10
POST_TOOL_CALL with *modified_json == NULL leaves content untouchedabsentinferred1 of 20: generation_records10
PRE/POST_TOOL_CALL fire for successful callsabsentinferred1 of 20: generation_records10
PRE_TOOL_CALL cancel short-circuits dispatch and still fires POSTabsentinferred1 of 20: generation_records10
Process single tool callabsentinferred1 of 20: generation_records10
Tool call history records successful executionsabsentinferred1 of 20: generation_records10
Tool emits directives → ToolExecutor extracts + dispatches themabsentinferred1 of 20: generation_records10
effective_max_tool_calls_per_turn overrides global limitabsentinferred1 of 20: generation_records10
gh#111: POST_TOOL_CALL hook returning malformed UTF-8 is absentinferred1 of 20: generation_records10
gh#143: an argument-free call serialises as an object absentinferred1 of 20: generation_records10
gh#143: dispatch converts a throwing tool into a tool errorabsentinferred1 of 20: generation_records10
gh#158: a delegated child's read satisfies its parent's write — absentinferred1 of 20: generation_records10
gh#158: clearing the default conversation releases the default absentinferred1 of 20: generation_records10
gh#158: each session's todo list is its ownabsentinferred1 of 20: generation_records10
gh#158: ending a session's conversation releases its read absentinferred1 of 20: generation_records10
gh#158: read-before-write is judged per session — another absentinferred1 of 20: generation_records10
gh#158: two sessions reading and writing through ONE filesystem absentinferred1 of 20: generation_records10
gh#168: a rewritten payload carrying bad UTF-8 is sanitized, absentinferred1 of 20: generation_records10
gh#168: the rewrite is visible to the dup cache and POST hookabsentinferred1 of 20: generation_records10
gh#211: a tier that declares an EMPTY allowlist may call nothingabsentinferred1 of 20: generation_records10
gh#83: allowlisted tool dispatches normallyabsentinferred1 of 20: generation_records10
gh#83: empty locked_tier bypasses enforcementabsentinferred1 of 20: generation_records10
gh#83: no map wired = pass-through (pre-v2.5.2 behavior)absentinferred1 of 20: generation_records10
gh#83: off-allowlist tool is rejected_unauthorized at dispatchabsentinferred1 of 20: generation_records10
gh#83: tier with no allowlist entry is unrestrictedabsentinferred1 of 20: generation_records10
process_single_call completes with locked_tier setabsentinferred1 of 20: generation_records10
ExternalBridge start() declines duplicate in-process socket bindingabsentinferred1 of 20: generation_records11
gh#158: a session's tool call never resolves inside another absentinferred1 of 20: generation_records11
gh#158: repeated sandbox swaps race nothing a concurrent absentinferred1 of 20: generation_records11
gh#158: two sessions writing todos through ONE entropic server absentinferred1 of 20: generation_records11
gh#168: a PRE_TOOL_CALL hook's modified args reach the toolabsentinferred1 of 20: generation_records11
gh#168: a malformed modification is refused, not half-appliedabsentinferred1 of 20: generation_records11
gh#168: a modification that renames the tool is refusedabsentinferred1 of 20: generation_records11
gh#168: a non-zero return still cancels, modification or notabsentinferred1 of 20: generation_records11
gh#204: a listener stopped the instant it started still stopsabsentinferred1 of 20: generation_records11
gh#204: the HTTP listener serves the bridge to authenticated clients onlyabsentinferred1 of 20: generation_records11
gh#220: a port another listener holds is refused, not sharedabsentinferred1 of 20: generation_records11