{
  "scope": "Public retained example and task-specific verification checklist; no inference or correction executed.",
  "repairId": "fix-llamacpp-schema-required-action",
  "repairURL": "https://kingy.ai/ai-fix-finder/fix-llamacpp-schema-required-action/",
  "example": {
    "request": {
      "prompt": "<|im_start|>user\nRepresent a single trip to the mall as JSON with an actions array and location field. Return only JSON.<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n",
      "json_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string",
                  "enum": [
                    "go_to",
                    "pick_up_item",
                    "drop_item"
                  ]
                }
              },
              "required": [
                "action"
              ],
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "go_to"
                    },
                    "location": {
                      "type": "string",
                      "enum": [
                        "mall",
                        "backyard"
                      ]
                    }
                  },
                  "required": [
                    "location"
                  ]
                },
                {
                  "properties": {
                    "action": {
                      "const": "lay_down"
                    },
                    "data": {
                      "type": "string",
                      "enum": [
                        "None"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                {
                  "properties": {
                    "action": {
                      "const": "pick_up_item"
                    },
                    "item": {
                      "type": "string",
                      "enum": [
                        "vase",
                        "coke",
                        "cake"
                      ]
                    }
                  },
                  "required": [
                    "item"
                  ]
                },
                {
                  "properties": {
                    "action": {
                      "const": "drop_item"
                    },
                    "item": {
                      "type": "string",
                      "enum": [
                        "vase",
                        "coke",
                        "cake"
                      ]
                    }
                  },
                  "required": [
                    "item"
                  ]
                }
              ]
            }
          }
        },
        "required": [
          "actions"
        ]
      },
      "n_predict": 256,
      "temperature": 0,
      "seed": 42,
      "cache_prompt": false,
      "stream": false
    },
    "response": {
      "index": 0,
      "content": "{\"actions\": [{\"location\": \"mall\"}]}",
      "tokens": [],
      "id_slot": 0,
      "stop": true,
      "model": "kingy-repair-fixture",
      "tokens_predicted": 11,
      "tokens_evaluated": 33,
      "generation_settings": {
        "seed": 42,
        "temperature": 0.0,
        "dynatemp_range": 0.0,
        "dynatemp_exponent": 1.0,
        "top_k": 40,
        "top_p": 0.949999988079071,
        "min_p": 0.05000000074505806,
        "top_n_sigma": -1.0,
        "xtc_probability": 0.0,
        "xtc_threshold": 0.10000000149011612,
        "typical_p": 1.0,
        "repeat_last_n": 64,
        "repeat_penalty": 1.0,
        "presence_penalty": 0.0,
        "frequency_penalty": 0.0,
        "dry_multiplier": 0.0,
        "dry_base": 1.75,
        "dry_allowed_length": 2,
        "dry_penalty_last_n": 64,
        "dry_sequence_breakers": [
          "\n",
          ":",
          "\"",
          "*"
        ],
        "mirostat": 0,
        "mirostat_tau": 5.0,
        "mirostat_eta": 0.10000000149011612,
        "adaptive_target": -1.0,
        "adaptive_decay": 0.8999999761581421,
        "stop": [],
        "max_tokens": 256,
        "n_predict": 256,
        "n_keep": 0,
        "n_discard": 0,
        "ignore_eos": false,
        "stream": false,
        "logit_bias": [],
        "n_probs": 0,
        "min_keep": 0,
        "grammar": "actions ::= \"[\" space (actions-item (\",\" space actions-item)*)? space \"]\"\nactions-item ::= actions-item-0 | actions-item-1 | actions-item-2 | actions-item-3\nactions-item-0 ::= \"{\" space actions-item-0-location-kv ( \",\" space ( actions-item-0-action-kv ) )? space \"}\"\nactions-item-0-action ::= \"\\\"go_to\\\"\"\nactions-item-0-action-kv ::= \"\\\"action\\\"\" space \":\" space actions-item-0-action\nactions-item-0-location ::= (\"\\\"mall\\\"\" | \"\\\"backyard\\\"\")\nactions-item-0-location-kv ::= \"\\\"location\\\"\" space \":\" space actions-item-0-location\nactions-item-1 ::= \"{\" space actions-item-1-data-kv ( \",\" space ( actions-item-1-action-kv ) )? space \"}\"\nactions-item-1-action ::= \"\\\"lay_down\\\"\"\nactions-item-1-action-kv ::= \"\\\"action\\\"\" space \":\" space actions-item-1-action\nactions-item-1-data ::= (\"\\\"None\\\"\")\nactions-item-1-data-kv ::= \"\\\"data\\\"\" space \":\" space actions-item-1-data\nactions-item-2 ::= \"{\" space actions-item-2-item-kv ( \",\" space ( actions-item-2-action-kv ) )? space \"}\"\nactions-item-2-action ::= \"\\\"pick_up_item\\\"\"\nactions-item-2-action-kv ::= \"\\\"action\\\"\" space \":\" space actions-item-2-action\nactions-item-2-item ::= (\"\\\"vase\\\"\" | \"\\\"coke\\\"\" | \"\\\"cake\\\"\")\nactions-item-2-item-kv ::= \"\\\"item\\\"\" space \":\" space actions-item-2-item\nactions-item-3 ::= \"{\" space actions-item-3-item-kv ( \",\" space ( actions-item-3-action-kv ) )? space \"}\"\nactions-item-3-action ::= \"\\\"drop_item\\\"\"\nactions-item-3-action-kv ::= \"\\\"action\\\"\" space \":\" space actions-item-3-action\nactions-item-3-item ::= (\"\\\"vase\\\"\" | \"\\\"coke\\\"\" | \"\\\"cake\\\"\")\nactions-item-3-item-kv ::= \"\\\"item\\\"\" space \":\" space actions-item-3-item\nactions-kv ::= \"\\\"actions\\\"\" space \":\" space actions\nroot ::= \"{\" space actions-kv space \"}\"\nspace ::= | \" \" | \"\\n\"{1,2} [ \\t]{0,20}\n",
        "grammar_lazy": false,
        "grammar_triggers": [],
        "preserved_tokens": [],
        "chat_format": "Content-only",
        "reasoning_format": "deepseek",
        "reasoning_in_content": false,
        "generation_prompt": "",
        "samplers": [
          "penalties",
          "dry",
          "top_n_sigma",
          "top_k",
          "typ_p",
          "top_p",
          "min_p",
          "xtc",
          "temperature"
        ],
        "speculative.types": "none",
        "timings_per_token": false,
        "post_sampling_probs": false,
        "backend_sampling": false,
        "lora": []
      },
      "prompt": "<|im_start|>user\nRepresent a single trip to the mall as JSON with an actions array and location field. Return only JSON.<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n",
      "has_new_line": false,
      "truncated": false,
      "stop_type": "eos",
      "stopping_word": "",
      "tokens_cached": 43,
      "timings": {
        "cache_n": 0,
        "prompt_n": 33,
        "prompt_ms": 3891.476,
        "prompt_per_token_ms": 117.92351515151516,
        "prompt_per_second": 8.480072856674433,
        "predicted_n": 11,
        "predicted_ms": 1415.24,
        "predicted_per_token_ms": 141.524,
        "predicted_per_second": 7.065939345976654
      }
    },
    "endpoint": "/completion",
    "context": 2048,
    "repairId": "fix-llamacpp-schema-required-action",
    "runtime": "llamacpp",
    "note": "Retained repair 004 example, originally qualified 2026-10-15. This preview sends no request and does not retest the model.",
    "checks": [
      "Keep the original Draft 7 schema and validation rules. Do not add action values or narrow the original permission for empty arrays and extra fields.",
      "Inspect SEMANTICS.md and the exact original-schema.json and normalized-schema.json in the package before using this contract-specific rewrite.",
      "Submit the same frozen prompt and settings with normalized-schema.json to the native /completion json_schema route.",
      "Validate the returned JSON against original-schema.json and the exact task answer. For the neutral trip, action must be go_to and location must be mall.",
      "Inspect the retained author and separate-agent runs, generated grammars and semantic checks. This is not a general-purpose schema normalizer."
    ],
    "correction": "Use the packaged normalized-schema.json as the decoder schema and keep original-schema.json as the application validator. The rewrite puts common requirements inside each complete disjoint oneOf alternative.",
    "evidenceDate": "2026-10-15"
  }
}
