JuliusBrussee/caveman · error · Error
adapter conformance schema failed to compile
Error message
adapter conformance schema failed to compile
What it means
The script explicitly resolves the adapter-conformance schema by its canonical $id to validate the harness fixtures. If Ajv has no compiled validator under https://caveman.so/schemas/adapter-conformance.schema.json, that schema either was not among the loaded files, failed strict compilation, or its $id drifted — so the script throws. This separates 'schema missing/broken' from 'fixture invalid'.
Solutions
- Confirm schemas/adapter-conformance.schema.json exists and its $id is exactly https://caveman.so/schemas/adapter-conformance.schema.json
- Fix any strict-mode compile error in that schema (see the compile failure details Ajv emits)
- Restore the schema file from git history if deleted
- Grep for the canonical URI to catch accidental edits to the $id or the lookup string in the script
Example fix
// before "$id": "https://caveman.so/schemas/adapter-conformance-v2.schema.json" // after "$id": "https://caveman.so/schemas/adapter-conformance.schema.json"
Defensive patterns
Strategy: try-catch
Validate before calling
const CANONICAL = 'https://caveman.so/schemas/adapter-conformance.schema.json';
const schemaFiles = schemas.map(s => s.$id);
if (!schemaFiles.includes(CANONICAL)) throw new Error(`missing schema with $id ${CANONICAL}`); Try / catch
try { getConformanceValidator(); } catch (e) { if (e.message.includes('adapter conformance schema failed to compile')) { console.error('Check $id and strict compile of adapter-conformance schema:', e.message); process.exitCode = 1; } else throw e; } Prevention
- Never edit the canonical $id without updating the lookup string
- Compile the schema standalone with Ajv before committing
- Keep adapter-conformance.schema.json and its fixtures versioned together
When it happens
Trigger: Running scripts/validate-schemas.mjs when the file adapter-conformance.schema.json is absent from schemas/, its $id no longer matches the canonical URI, or it failed Ajv strict compilation during addSchema.
Common situations: Renaming the schema file or changing its $id during a refactor; strict-mode compile failure in that schema; committing new fixtures without the schema that describes them.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- : missing $id
- : unsupported or missing $schema
- schema failed to compile
- canonical span
- caveman agent: Standard Schema cannot emit draft-07 input…
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/525d80f0a8dfe3c7.
Report an issue: GitHub.
Appendix: source
Thrown at packages/shared/contracts/scripts/validate-schemas.mjs:51
}
const agentFixtureRoot = path.join(packageRoot, "fixtures", "agent");
const fixtureFiles = (await readdir(agentFixtureRoot))
.filter((name) => name.endsWith(".json"))
.sort();
if (fixtureFiles.length !== 2) {
throw new Error(`expected exactly 2 agent conformance fixtures, found ${fixtureFiles.length}`);
}
const fixtures = await Promise.all(
fixtureFiles.map(async (file) => JSON.parse(await readFile(path.join(agentFixtureRoot, file), "utf8"))),
);
const validateAdapterConformance = ajv.getSchema(
"https://caveman.so/schemas/adapter-conformance.schema.json",
);
if (!validateAdapterConformance) {
throw new Error("adapter conformance schema failed to compile");
}
for (const [index, fixture] of fixtures.entries()) {
if (!validateAdapterConformance(fixture)) {
throw new Error(
`${fixtureFiles[index]}: ${ajv.errorsText(validateAdapterConformance.errors)}`,
);
}
}
const [claude, pi] = fixtures;
if (claude.harness !== "claude" || pi.harness !== "pi") {
throw new Error("agent conformance fixtures must cover claude and pi");
}
for (const key of [
"normalized_context_digest",
"plan_sha256",
"ordered_transform_ids",
"provider_visible_digest",View on GitHub (pinned to 3ee70a1026)