{"record":{"id":"0122c0878ac28f3c","repo":"rohitg00/ai-engineering-from-scratch","slug":"release-gate-root-must-be-an-object","errorCode":null,"errorMessage":"release gate root must be an object","messagePattern":"release gate root must be an object","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"certifications/claude/lessons/14-evals-testing-debugging-and-observability/code/main.py","lineNumber":133,"sourceCode":"        errors.append(\"severeCasePassRate must be 1.0\")\n    if not isinstance(gate.get(\"severeCases\"), list) or len(gate[\"severeCases\"]) < 3:\n        errors.append(\"at least three severeCases are required\")\n    required_surfaces = {\"output\", \"trajectory\", \"final-state\", \"safety\", \"operational-budget\"}\n    if not required_surfaces <= set(gate.get(\"evaluationSurfaces\", [])):\n        errors.append(\"all five evaluation surfaces are required\")\n    required_trace = {\"trace_id\", \"type\", \"model_version\", \"prompt_version\", \"policy\", \"latency_ms\", \"result_class\"}\n    if not required_trace <= set(gate.get(\"requiredTraceFields\", [])):\n        errors.append(\"required trace fields are incomplete\")\n    required_failures = {\"transport_timeout\", \"protocol_error\", \"contract_parse_error\", \"policy_denial\", \"final_state_failure\"}\n    if not required_failures <= set(gate.get(\"failureClasses\", [])):\n        errors.append(\"failure classes are incomplete\")\n    return errors\n\n\ndef load_release_gate(path: str) -> dict[str, Any]:\n    value = json.loads(Path(path).read_text(encoding=\"utf-8\"))\n    if not isinstance(value, dict):\n        raise ValueError(\"release gate root must be an object\")\n    return value\n\n\ndef _elapsed_ms(started: float) -> float:\n    return (time.perf_counter() - started) * 1000\n\n\ndef demo_agent(prompt: str) -> AgentRun:\n    if \"missing\" in prompt:\n        return AgentRun(\"I cannot verify that order.\", (), {\"escalated\": True}, ({\"type\": \"decision\", \"reason\": \"missing_id\"},))\n    return AgentRun(\"Order A-17 is ready.\", (\"lookup_order\",), {\"escalated\": False}, ({\"type\": \"tool_call\", \"name\": \"lookup_order\"},))\n\n\ndef demo() -> dict[str, Any]:\n    cases = [\n        EvalCase(\"known\", \"Find A-17\", (\"ready\",), (), (\"lookup_order\",), {\"escalated\": False}),\n        EvalCase(\"missing\", \"The order id is missing\", (\"cannot verify\",), (\"ready\",), (), {\"escalated\": True}),\n    ]","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/certifications/claude/lessons/14-evals-testing-debugging-and-observability/code/main.py#L115-L151","documentation":"Error \"release gate root must be an object\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at certifications/claude/lessons/14-evals-testing-debugging-and-observability/code/main.py:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}