{"record":{"id":"564c446a186ac409","repo":"github/spec-kit","slug":"catalog-source-source-id-has-a-non-integer-pri","errorCode":null,"errorMessage":"Catalog source '{source_id}' has a non-integer priority: {priority!r}.","messagePattern":"Catalog source '(.+?)' has a non-integer priority: (.+?)\\.","errorType":"exception","errorClass":"BundlerError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/bundler/models/catalog.py","lineNumber":82,"sourceCode":"    @property\n    def install_allowed(self) -> bool:\n        return self.install_policy is InstallPolicy.INSTALL_ALLOWED\n\n    @classmethod\n    def from_dict(cls, data: Any, scope: Scope) -> \"CatalogSource\":\n        if not isinstance(data, dict):\n            raise BundlerError(\"Each catalog source must be a mapping.\")\n        source_id = str(data.get(\"id\", \"\")).strip()\n        url = str(data.get(\"url\", \"\")).strip()\n        if not source_id:\n            raise BundlerError(\"A catalog source is missing its 'id'.\")\n        if not url:\n            raise BundlerError(f\"Catalog source '{source_id}' is missing its 'url'.\")\n        priority = data.get(\"priority\")\n        if priority is None:\n            raise BundlerError(f\"Catalog source '{source_id}' is missing its 'priority'.\")\n        if isinstance(priority, bool) or not isinstance(priority, (int, str)):\n            raise BundlerError(\n                f\"Catalog source '{source_id}' has a non-integer priority: {priority!r}.\"\n            )\n        try:\n            priority_int = int(priority)\n        except (TypeError, ValueError):\n            raise BundlerError(\n                f\"Catalog source '{source_id}' has a non-integer priority: {priority!r}.\"\n            ) from None\n        return cls(\n            id=source_id,\n            url=url,\n            priority=priority_int,\n            install_policy=InstallPolicy.parse(data.get(\"install_policy\")),\n            scope=scope,\n        )\n\n    def to_dict(self) -> dict[str, Any]:\n        return {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/bundler/models/catalog.py#L64-L100","documentation":"Raised by CatalogSource.from_dict()'s first priority guard when the 'priority' value is of a disallowed type: booleans are rejected explicitly (bool is a subclass of int in Python), and anything that is not an int or str is rejected outright (float, list, dict, None-like objects). Numeric strings are deferred to a later int() conversion (see error 69) rather than raised here.","triggerScenarios":"priority: true in YAML (parses as bool); priority: 1.5 (float); priority: [10] or {\"value\": 10}; priority set to a nested object by templating code.","commonSituations":"YAML where 'true'/'on' is used as a truthy priority; JSON producers serializing floats where ints were intended; config generated by code that inserts a raw Python object.","solutions":["Set priority to a plain integer (e.g. 10) or an integer-valued string (e.g. \"10\").","Never use true/false for priority; YAML users should quote values that could parse as booleans.","Fix the upstream generator to emit int(priority) when writing config."],"exampleFix":"# before (YAML)\npriority: true\n\n# after (YAML)\npriority: 10","handlingStrategy":"type-guard","validationCode":"p = entry.get(\"priority\")\nif isinstance(p, bool) or not isinstance(p, (int, str)):\n    raise ValueError(f\"priority must be int or int-string, got {type(p).__name__}\")","typeGuard":"def is_valid_priority_type(p: object) -> bool:\n    return (isinstance(p, int) and not isinstance(p, bool)) or isinstance(p, str)","tryCatchPattern":"try:\n    CatalogSource.from_dict(entry, Scope.PROJECT)\nexcept BundlerError as e:\n    if \"non-integer priority\" in str(e):\n        entry[\"priority\"] = int(float(entry[\"priority\"]))  # deliberate coercion policy","preventionTips":["Write priorities as plain integers in config.","Beware YAML truthiness: never use true/false for priority.","Config generators should coerce with int() at write time, not read time."],"tags":["bundler","catalog","validation","priority","type-error"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}