{"record":{"id":"66d57cedd49682cb","repo":"github/spec-kit","slug":"invalid-requires-speckit-version-expected-a-non-e-66d57c","errorCode":null,"errorMessage":"Invalid requires.speckit_version: expected a non-empty string, got {type(requires['speckit_version']).__name__}","messagePattern":"Invalid requires\\.speckit_version: expected a non-empty string, got (.+?)","errorType":"validation","errorClass":"PresetValidationError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/presets/__init__.py","lineNumber":379,"sourceCode":"        requires = self.data[\"requires\"]\n        if \"speckit_version\" not in requires:\n            raise PresetValidationError(\"Missing requires.speckit_version\")\n        # Presence alone is not enough: check_compatibility() feeds this value to\n        # ``SpecifierSet(required)``, guarded only by ``except InvalidSpecifier``,\n        # which a non-string escapes two different ways. A float/int/bool/None\n        # raises TypeError from the constructor, while a list or dict is an\n        # *iterable*, so SpecifierSet accepts it and the failure surfaces much\n        # later as ``AttributeError: 'str' object has no attribute 'filter'`` from\n        # inside .contains(). Neither is a PresetCompatibilityError, so both\n        # bypass the CLI's \"Compatibility Error\" handler and exit 1 with a raw\n        # traceback naming no field. An unquoted ``speckit_version: 1.0`` is an\n        # easy YAML slip. Mirrors the sibling IntegrationDescriptor, which already\n        # requires a non-empty string here.\n        if (\n            not isinstance(requires[\"speckit_version\"], str)\n            or not requires[\"speckit_version\"].strip()\n        ):\n            raise PresetValidationError(\n                \"Invalid requires.speckit_version: expected a non-empty string, \"\n                f\"got {type(requires['speckit_version']).__name__}\"\n            )\n\n        # Validate provides section\n        provides = self.data[\"provides\"]\n        if \"templates\" not in provides:\n            raise PresetValidationError(\n                \"Preset must provide at least one template\"\n            )\n\n        # Validate templates. Guard the container and each entry's shape so a\n        # malformed third-party preset.yml (e.g. ``templates: 5`` or\n        # ``templates: [null]``) raises a clean PresetValidationError the\n        # install handler already catches, instead of a raw TypeError\n        # ('int'/'NoneType' object is not iterable) that escapes to an\n        # unhandled traceback. Mirrors the sibling ExtensionManifest guards.\n        #","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/presets/__init__.py#L361-L397","documentation":"Error \"Invalid requires.speckit_version: expected a non-empty string, got {type(requires['speckit_version']).__name__}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/presets/__init__.py:379 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set requires.speckit_version to a non-empty string specifier."],"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"}