{"record":{"id":"988815a4f94c9236","repo":"github/spec-kit","slug":"provides-kind-priority-must-be-an-integer-got","errorCode":null,"errorMessage":"provides.{kind} priority must be an integer, got {raw!r}.","messagePattern":"provides\\.(.+?) priority must be an integer, got (.+?)\\.","errorType":"exception","errorClass":"BundlerError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/bundler/models/manifest.py","lineNumber":280,"sourceCode":"        priority = _parse_priority(kind, item.get(\"priority\"))\n        refs.append(\n            ComponentRef(\n                kind=kind,\n                id=_text(item.get(\"id\")),\n                version=(str(item[\"version\"]).strip() if item.get(\"version\") else None),\n                source=(str(item[\"source\"]).strip() if item.get(\"source\") else None),\n                priority=priority,\n                strategy=(str(item[\"strategy\"]).strip() if item.get(\"strategy\") else None),\n            )\n        )\n    return refs\n\n\ndef _parse_priority(kind: str, raw: Any) -> int | None:\n    if raw is None:\n        return None\n    if isinstance(raw, bool) or not isinstance(raw, (int, str)):\n        raise BundlerError(\n            f\"provides.{kind} priority must be an integer, got {raw!r}.\"\n        )\n    try:\n        return int(raw)\n    except (TypeError, ValueError):\n        raise BundlerError(\n            f\"provides.{kind} priority must be an integer, got {raw!r}.\"\n        ) from None\n","sourceCodeStart":262,"sourceCodeEnd":289,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/bundler/models/manifest.py#L262-L289","documentation":"Raised by the manifest helper _parse_priority when a 'provides.<kind>' entry's 'priority' field is present but is not coercible to an integer — specifically when it is a bool (explicitly rejected because bool is an int subclass in Python) or any type other than int or str. The message includes the offending value for quick diagnosis.","triggerScenarios":"A component entry contains 'priority: true'/'priority: false', 'priority: 1.5' (float), or 'priority: null'-like mapping values; _parse_priority's first isinstance guard fires before int() conversion is attempted.","commonSituations":"Using a boolean as a 'high priority' flag; YAML auto-parsing a quoted number incorrectly; floats from priority weights copied from another tool.","solutions":["Set priority to an integer (e.g. 10) or an integer-valued string ('10').","Remove the 'priority' key to accept the default (None).","Never use true/false for priority — pick a numeric scale."],"exampleFix":"# before (bundle.yml)\nprovides:\n  skills:\n    - id: my-skill\n      priority: true\n\n# after\nprovides:\n  skills:\n    - id: my-skill\n      priority: 10","handlingStrategy":"validation","validationCode":"def priority_type_ok(raw: object) -> bool:\n    return raw is None or (not isinstance(raw, bool) and isinstance(raw, (int, str)))","typeGuard":"def is_valid_priority(raw: object) -> bool:\n    if raw is None:\n        return True\n    if isinstance(raw, bool) or not isinstance(raw, (int, str)):\n        return False\n    try:\n        int(raw)\n        return True\n    except (TypeError, ValueError):\n        return False","tryCatchPattern":"try:\n    manifest = BundleManifest.from_file(p)\nexcept BundlerError as e:\n    if \"priority must be an integer\" in str(e):\n        # replace bool/float priority with int, or drop the key\n        ...","preventionTips":["Priority is int-only; booleans and floats are rejected by design.","Omit 'priority' to use the default ordering."],"tags":["bundler","manifest","yaml","validation","priority"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}