#!/usr/bin/env python3 # SPDX-License-Identifier: MIT OR Apache-2.0 """The JSON-content oracle (0.3.5): how llama-server b11192 turns a constrained answer's raw text into the message `content`, from llama.cpp's own code — `testing/content_oracle.cpp` calls `common_chat_parse(raw, false, …)` with the PEG chat parser `common_chat_templates_apply` builds for the request's schema (`--jinja --reasoning off`), inside the b11192 release's `libllama-common.so`; no model is loaded. The server then answers with that content, or with the raw text when the parse gives an empty message (`server_task_result_cmpl_final::to_json_oaicompat_chat`). The corpus: every character-boundary prefix of every answer llama-server gave under JSON mode and JSON schemas (`.models/oracle-json/{json,schema}-*.jsonl`, each with the schema it was asked under) — the texts a length cut can leave — and edge cases (fences, whitespace, a reasoning block, scalars, escapes). One file per reproduced template. LLAMA_SRC= BANKML_GGML_LIB= python3 testing/content_oracle.py → .models/oracle-content/content-