{"record":{"id":"ca77cb3983f0886b","repo":"JuliusBrussee/caveman","slug":"label-capabilities-must-be-an-object","errorCode":null,"errorMessage":"{label}: capabilities must be an object","messagePattern":"(.+?): capabilities must be an object","errorType":"validation","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"shared/provider-catalog/validate_catalog.py","lineNumber":155,"sourceCode":"    if pricing_unknown:\n        raise CatalogError(f\"{label}: unknown pricing field(s): {', '.join(sorted(pricing_unknown))}\")\n    for required in (\"input_per_million\", \"output_per_million\"):\n        if required not in pricing:\n            raise CatalogError(f\"{label}: pricing.{required} is required\")\n    for field, value in pricing.items():\n        if value is None or field == \"long_context_threshold_inclusive\":\n            if field == \"long_context_threshold_inclusive\" and value is not None and not isinstance(value, bool):\n                raise CatalogError(f\"{label}: pricing.{field} must be boolean or null\")\n            continue\n        if isinstance(value, bool) or not isinstance(value, (int, float)):\n            raise CatalogError(f\"{label}: pricing.{field} must be numeric or null\")\n        if not math.isfinite(value) or value < 0:\n            raise CatalogError(f\"{label}: pricing.{field} must be finite and nonnegative\")\n        if field == \"batch_discount_fraction\" and value > 1:\n            raise CatalogError(f\"{label}: pricing.batch_discount_fraction must be <= 1\")\n\n    if not isinstance(row[\"capabilities\"], dict):\n        raise CatalogError(f\"{label}: capabilities must be an object\")\n    sources = row[\"sources\"]\n    if not isinstance(sources, list) or not sources:\n        raise CatalogError(f\"{label}: sources must be a non-empty list\")\n    if any(not isinstance(source, str) or not source.startswith(\"https://\") for source in sources):\n        raise CatalogError(f\"{label}: every source must be HTTPS\")\n\n    verified_at = parsed_time(row[\"verified_at\"], label)\n    if verified_at > now:\n        raise CatalogError(f\"{label}: verified_at is in the future\")\n    if verified_at < now - timedelta(days=120):\n        raise CatalogError(f\"{label}: verified_at is older than 120 days\")\n    return identity[0], identity[1], identity[2]\n\n\ndef check_review_markers(text: str, label: str) -> None:\n    \"\"\"Refuse a catalog that still carries an unreviewed sync proposal.\n\n    YAML comments are invisible to the parsed rows, so this reads the raw file:","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/provider-catalog/validate_catalog.py#L137-L173","documentation":"Each catalog row must have a 'capabilities' key holding a dict/object of capability flags. If capabilities is missing its object shape (null, list, string, etc.), validate_row raises this CatalogError.","triggerScenarios":"A row defines capabilities as a list (e.g. [\"vision\",\"tools\"]), a string (\"vision,tools\"), or omits it so it resolves to null.","commonSituations":"Hand-writing a new row with a shorthand capability list; a schema migration turning the object into an array; YAML collapsing an empty capabilities block to null.","solutions":["Reshape capabilities into an object with boolean keys, e.g. {vision: true, tools: true}","Compare with an existing valid row's capabilities shape and mirror it","In YAML, ensure capabilities: is followed by key: value mappings, not a dash list"],"exampleFix":"// before\ncapabilities:\n  - vision\n  - tools\n// after\ncapabilities:\n  vision: true\n  tools: true","handlingStrategy":"validation","validationCode":"assert isinstance(row.get(\"capabilities\"), dict), \"capabilities must be an object\"","typeGuard":"def has_capabilities_dict(row):\n    caps = row.get(\"capabilities\")\n    return isinstance(caps, dict) and all(isinstance(v, bool) for v in caps.values())","tryCatchPattern":"try:\n    validate_catalog(rows)\nexcept CatalogError as e:\n    if \"capabilities must be an object\" in str(e):\n        convert_capabilities_to_object(row)\n    raise","preventionTips":["Model capabilities as {name: bool} mappings everywhere","Disallow lists/strings in the catalog schema","Mirror an existing valid row when adding providers"],"tags":["validation","schema","capabilities","type-error"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}