{"record":{"id":"cbe40c62738d862c","repo":"JuliusBrussee/caveman","slug":"schema-failed-to-compile-schema-id","errorCode":null,"errorMessage":"schema failed to compile: ${schema.$id}","messagePattern":"schema failed to compile: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/shared/contracts/scripts/validate-schemas.mjs","lineNumber":32,"sourceCode":"}\n\nconst schemas = [];\nfor (const file of files) {\n  const schema = JSON.parse(await readFile(path.join(schemaRoot, file), \"utf8\"));\n  if (schema.$schema !== \"https://json-schema.org/draft/2020-12/schema\") {\n    throw new Error(`${file}: unsupported or missing $schema`);\n  }\n  if (typeof schema.$id !== \"string\" || schema.$id.length === 0) {\n    throw new Error(`${file}: missing $id`);\n  }\n  schemas.push(schema);\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: true });\najv.addSchema(schemas);\nfor (const schema of schemas) {\n  const validate = ajv.getSchema(schema.$id);\n  if (!validate) throw new Error(`schema failed to compile: ${schema.$id}`);\n}\n\nconst agentFixtureRoot = path.join(packageRoot, \"fixtures\", \"agent\");\nconst fixtureFiles = (await readdir(agentFixtureRoot))\n  .filter((name) => name.endsWith(\".json\"))\n  .sort();\n\nif (fixtureFiles.length !== 2) {\n  throw new Error(`expected exactly 2 agent conformance fixtures, found ${fixtureFiles.length}`);\n}\n\nconst fixtures = await Promise.all(\n  fixtureFiles.map(async (file) => JSON.parse(await readFile(path.join(agentFixtureRoot, file), \"utf8\"))),\n);\nconst validateAdapterConformance = ajv.getSchema(\n  \"https://caveman.so/schemas/adapter-conformance.schema.json\",\n);\nif (!validateAdapterConformance) {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/shared/contracts/scripts/validate-schemas.mjs#L14-L50","documentation":"Error \"schema failed to compile: ${schema.$id}\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at packages/shared/contracts/scripts/validate-schemas.mjs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the schema so it compiles (resolve invalid references or keywords)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}