{"record":{"id":"ebd9debca56d1d54","repo":"Hmbown/CodeWhale","slug":"receipt-metric-representative-context-fixture-id-must-be","errorCode":null,"errorMessage":"receipt metric `representative_context.fixture_id` must be `{REPRESENTATIVE_FIXTURE_ID}`, got {fixture_id!r}","messagePattern":"receipt metric `representative_context\\.fixture_id` must be `(.+?)`, got (.+?)","errorType":"exception","errorClass":"RuntimeContractError","httpStatus":null,"severity":"error","filePath":"scripts/check-runtime-contract-budget.py","lineNumber":274,"sourceCode":"    validate_document(receipt, RECEIPT_KIND, \"receipt\")\n    skill_discovery = receipt.get(\"skill_discovery\")\n    identical = (\n        skill_discovery.get(\"prompts_byte_identical\")\n        if isinstance(skill_discovery, dict)\n        else None\n    )\n    if identical is not True:\n        raise RuntimeContractError(\n            \"receipt metric `skill_discovery.prompts_byte_identical` must be true\"\n        )\n    representative = receipt.get(\"representative_context\")\n    fixture_id = (\n        representative.get(\"fixture_id\")\n        if isinstance(representative, dict)\n        else None\n    )\n    if fixture_id != REPRESENTATIVE_FIXTURE_ID:\n        raise RuntimeContractError(\n            \"receipt metric `representative_context.fixture_id` must be \"\n            f\"`{REPRESENTATIVE_FIXTURE_ID}`, got {fixture_id!r}\"\n        )\n    representative_identical = representative.get(\"prompts_byte_identical\")\n    if representative_identical is not True:\n        raise RuntimeContractError(\n            \"receipt metric `representative_context.prompts_byte_identical` must be true\"\n        )\n    validate_identity_structure(receipt, \"receipt\")\n\n\ndef validate_budget(budget: dict[str, Any]) -> None:\n    validate_document(budget, BUDGET_KIND, \"budget\")\n    representative = budget.get(\"representative_context\")\n    fixture_id = (\n        representative.get(\"fixture_id\")\n        if isinstance(representative, dict)\n        else None","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-runtime-contract-budget.py#L256-L292","documentation":"Receipts must be measured against the canonical representative-context fixture; representative_context.fixture_id must equal REPRESENTATIVE_FIXTURE_ID. A different fixture id means the receipt describes a different measurement setup and cannot be compared or converted to a budget.","triggerScenarios":"validate_receipt encounters fixture_id that is missing, null, or any string other than REPRESENTATIVE_FIXTURE_ID.","commonSituations":"The fixture was renamed/rotated in the repo but old receipts still reference the previous id; measuring against a locally modified fixture; version skew between the receipt producer and the checking script.","solutions":["Regenerate the receipt using the current fixture so fixture_id matches REPRESENTATIVE_FIXTURE_ID","Update fixture_id to the exact constant from check-runtime-contract-budget.py","If the fixture legitimately changed, bump REPRESENTATIVE_FIXTURE_ID and regenerate all receipts"],"exampleFix":"// before (stale fixture)\n\"representative_context\": {\"fixture_id\": \"fixture-2025-06\"}\n// after\n\"representative_context\": {\"fixture_id\": \"fixture-2026-09\"}","handlingStrategy":"validation","validationCode":"from scripts.check_runtime_contract_budget import REPRESENTATIVE_FIXTURE_ID\nrep = doc.get(\"representative_context\", {})\nassert isinstance(rep, dict) and rep.get(\"fixture_id\") == REPRESENTATIVE_FIXTURE_ID","typeGuard":null,"tryCatchPattern":"try:\n    budget = budget_from_receipt(receipt)\nexcept RuntimeContractError as e:\n    if \"fixture_id must be\" in str(e):\n        raise SystemExit(\"receipt measured against a different fixture; regenerate\")\n    raise","preventionTips":["Import REPRESENTATIVE_FIXTURE_ID rather than hardcoding the id","Regenerate all receipts when the fixture changes and commit them together","Record the fixture id in CI artifacts to catch skew before compare"],"tags":["python","version-skew","fixture"],"backgroundTag":"invalid-config-value","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}