{"record":{"id":"59b8df80e39e0349","repo":"rohitg00/ai-engineering-from-scratch","slug":"path-value-r-does-not-match-schema-pattern","errorCode":null,"errorMessage":"{path}: {value!r} does not match /{schema['pattern']}/","messagePattern":"(.+?): (.+?) does not match /(.+?)/","errorType":"validation","errorClass":"SchemaError","httpStatus":null,"severity":"error","filePath":"phases/14-agent-engineering/34-repo-memory-and-state/code/main.py","lineNumber":82,"sourceCode":"            return True\n        if t == \"array\" and isinstance(value, list):\n            return True\n        if t == \"string\" and isinstance(value, str):\n            return True\n        if t == \"integer\" and isinstance(value, int) and not isinstance(value, bool):\n            return True\n        if t == \"null\" and value is None:\n            return True\n    return False\n\n\ndef validate(value: Any, schema: dict[str, Any], path: str = \"$\") -> None:\n    if \"type\" in schema and not _check_type(value, schema[\"type\"]):\n        raise SchemaError(f\"{path}: expected {schema['type']}, got {type(value).__name__}\")\n    if \"enum\" in schema and value not in schema[\"enum\"]:\n        raise SchemaError(f\"{path}: {value!r} not in {schema['enum']}\")\n    if \"pattern\" in schema and isinstance(value, str) and not re.match(schema[\"pattern\"], value):\n        raise SchemaError(f\"{path}: {value!r} does not match /{schema['pattern']}/\")\n    if isinstance(value, dict):\n        for key in schema.get(\"required\", []):\n            if key not in value:\n                raise SchemaError(f\"{path}: missing required field {key!r}\")\n        properties = schema.get(\"properties\", {})\n        unexpected = sorted(set(value.keys()) - set(properties.keys()))\n        if unexpected:\n            raise SchemaError(f\"{path}: unexpected fields {unexpected}\")\n        for key, sub in properties.items():\n            if key in value:\n                validate(value[key], sub, f\"{path}.{key}\")\n    if isinstance(value, list) and \"items\" in schema:\n        for idx, item in enumerate(value):\n            validate(item, schema[\"items\"], f\"{path}[{idx}]\")\n\n\ndef atomic_write(path: Path, content: str) -> None:\n    path.parent.mkdir(parents=True, exist_ok=True)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/14-agent-engineering/34-repo-memory-and-state/code/main.py#L64-L100","documentation":"Error \"{path}: {value!r} does not match /{schema['pattern']}/\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/14-agent-engineering/34-repo-memory-and-state/code/main.py:82 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"}