{"record":{"id":"d06e1bbbc8df3817","repo":"github/spec-kit","slug":"missing-preset-field","errorCode":null,"errorMessage":"Missing preset.{field}","messagePattern":"Missing preset\\.(.+?)","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":340,"sourceCode":"                    f\"Invalid {section}: expected a mapping\"\n                )\n\n        # Validate preset metadata\n        pack = self.data[\"preset\"]\n        # Check presence AND type: the format/version checks below feed these\n        # values straight to ``re.match`` and ``packaging.Version``, both of\n        # which raise a bare TypeError on a non-string. YAML makes that an easy\n        # authoring slip -- unquoted ``version: 1.0`` parses as a float and\n        # ``id: 2`` as an int -- and TypeError is not a PresetValidationError,\n        # so it escapes every caller that already handles a malformed manifest\n        # (see list_installed()'s \"Corrupted preset\" fallback, which catches\n        # PresetValidationError only, making one bad preset exit ``specify\n        # preset list`` with a raw traceback and hide the healthy ones).\n        # Mirrors the sibling IntegrationDescriptor, which already type-checks\n        # the same four fields.\n        for field in [\"id\", \"name\", \"version\", \"description\"]:\n            if field not in pack:\n                raise PresetValidationError(f\"Missing preset.{field}\")\n            if not isinstance(pack[field], str):\n                raise PresetValidationError(\n                    f\"Invalid preset.{field}: expected a string, \"\n                    f\"got {type(pack[field]).__name__}\"\n                )\n\n        # Validate pack ID format\n        if not re.match(r'^[a-z0-9-]+$', pack[\"id\"]):\n            raise PresetValidationError(\n                f\"Invalid preset ID '{pack['id']}': \"\n                \"must be lowercase alphanumeric with hyphens only\"\n            )\n\n        # Validate semantic version\n        try:\n            pkg_version.Version(pack[\"version\"])\n        except pkg_version.InvalidVersion:\n            raise PresetValidationError(f\"Invalid version: {pack['version']}\")","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L322-L358","documentation":"Error \"Missing preset.{field}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing preset.<field> entry to the manifest."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}