{"record":{"id":"3b52ae3745b0bf7f","repo":"rohitg00/ai-engineering-from-scratch","slug":"record-root-must-be-an-object","errorCode":null,"errorMessage":"record root must be an object","messagePattern":"record root must be an object","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"certifications/claude/lessons/01-claude-product-and-model-landscape/code/main.py","lineNumber":209,"sourceCode":"    return isinstance(value, str) and value.startswith(OFFICIAL_DOC_PREFIXES)\n\n\ndef _nonempty_strings(value: Any) -> bool:\n    return isinstance(value, list) and bool(value) and all(isinstance(item, str) and item.strip() for item in value)\n\n\ndef _iso_date(value: Any) -> bool:\n    try:\n        date.fromisoformat(value)\n        return isinstance(value, str)\n    except (TypeError, ValueError):\n        return False\n\n\ndef load_record(path: Path) -> dict[str, Any]:\n    value = json.loads(path.read_text(encoding=\"utf-8\"))\n    if not isinstance(value, dict):\n        raise ValueError(\"record root must be an object\")\n    return value\n\n\nif __name__ == \"__main__\":\n    path = Path(__file__).parents[1] / \"outputs\" / \"product-selection-record.json\"\n    record = load_record(path)\n    print(json.dumps({\"valid\": not validate_record(record), \"recommendation\": recommend(record)}, indent=2))\n","sourceCodeStart":191,"sourceCodeEnd":217,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/certifications/claude/lessons/01-claude-product-and-model-landscape/code/main.py#L191-L217","documentation":"Error \"record root must be an object\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at certifications/claude/lessons/01-claude-product-and-model-landscape/code/main.py:209 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"}