{"record":{"id":"342747aaec88c571","repo":"Fission-AI/OpenSpec","slug":"unknown-schema-parseresult-data-schema-avail","errorCode":null,"errorMessage":"Unknown schema '${parseResult.data.schema}'. Available: ${availableSchemas.join(', ')}","messagePattern":"Unknown schema '(.+?)'\\. Available: (.+?)","errorType":"validation","errorClass":"ChangeMetadataError","httpStatus":null,"severity":"error","filePath":"src/utils/change-metadata.ts","lineNumber":140,"sourceCode":"      `Invalid YAML in metadata file: ${parseError.message}`,\n      metaPath,\n      parseError\n    );\n  }\n\n  // Validate with Zod\n  const parseResult = ChangeMetadataSchema.safeParse(parsed);\n  if (!parseResult.success) {\n    throw new ChangeMetadataError(\n      `Invalid metadata: ${parseResult.error.message}`,\n      metaPath\n    );\n  }\n\n  // Validate that the schema exists\n  const availableSchemas = listSchemas(projectRoot);\n  if (!availableSchemas.includes(parseResult.data.schema)) {\n    throw new ChangeMetadataError(\n      `Unknown schema '${parseResult.data.schema}'. Available: ${availableSchemas.join(', ')}`,\n      metaPath\n    );\n  }\n\n  return parseResult.data;\n}\n\nexport interface ResolveSchemaForChangeOptions {\n  metadata?: ChangeMetadata | null;\n  /** Pre-read project config; suppresses the fallback config read when provided. */\n  projectConfig?: ProjectConfig | null;\n}\n\n/**\n * Resolves the schema for a change, with explicit override taking precedence.\n *\n * Resolution order:","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/utils/change-metadata.ts#L122-L158","documentation":"ChangeMetadataError thrown by readChangeMetadata after a successful Zod parse: the metadata's schema field names a schema that listSchemas() does not know for this project. The file is structurally valid but references an unavailable schema — typically one defined elsewhere or removed.","triggerScenarios":"Thrown at src/utils/change-metadata.ts:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install or restore the referenced schema in the project","Edit the metadata's schema field to one of the available schemas listed in the message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}