{"record":{"id":"34127317f76b19b9","repo":"rohitg00/ai-engineering-from-scratch","slug":"registry-root-must-be-an-object","errorCode":null,"errorMessage":"registry root must be an object","messagePattern":"registry root must be an object","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"certifications/claude/lessons/04-context-knowledge-memory-and-caching/code/main.py","lineNumber":95,"sourceCode":"        \"cachedPrefix\": [source[\"id\"] for source in registry[\"sources\"] if source[\"id\"] in cached],\n        \"dynamicContext\": [source[\"id\"] for source in registry[\"sources\"] if source[\"status\"] == \"active\" and source[\"id\"] not in cached],\n        \"retired\": [source[\"id\"] for source in registry[\"sources\"] if source[\"status\"] != \"active\"],\n        \"budgetRemaining\": registry[\"promptBudget\"][\"maximumTokens\"] - sum(value for key, value in registry[\"promptBudget\"].items() if key != \"maximumTokens\"),\n    }\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_registry(path: Path) -> dict[str, Any]:\n    value = json.loads(path.read_text(encoding=\"utf-8\"))\n    if not isinstance(value, dict):\n        raise ValueError(\"registry root must be an object\")\n    return value\n\n\nif __name__ == \"__main__\":\n    path = Path(__file__).parents[1] / \"outputs\" / \"context-registry.json\"\n    registry = load_registry(path)\n    print(json.dumps({\"valid\": not validate_registry(registry), \"plan\": build_context_plan(registry)}, indent=2))\n","sourceCodeStart":77,"sourceCodeEnd":103,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/certifications/claude/lessons/04-context-knowledge-memory-and-caching/code/main.py#L77-L103","documentation":"Error \"registry root must be an object\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at certifications/claude/lessons/04-context-knowledge-memory-and-caching/code/main.py:95 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"}