{"record":{"id":"a23d22446fab1d37","repo":"JuliusBrussee/caveman","slug":"label-every-source-must-be-https","errorCode":null,"errorMessage":"{label}: every source must be HTTPS","messagePattern":"(.+?): every source must be HTTPS","errorType":"validation","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"shared/provider-catalog/validate_catalog.py","lineNumber":160,"sourceCode":"    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:\n    a rubber-stamped merge must not be able to advance price provenance while\n    the line saying \"nobody has confirmed this yet\" is still in the file.\n    \"\"\"\n    offending = [\n        index + 1","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/provider-catalog/validate_catalog.py#L142-L178","documentation":"Every entry in a row's sources list must be a string starting with 'https://'. Non-string entries or http:// (insecure) URLs fail validation, since the catalog only accepts secure documentation links.","triggerScenarios":"A source entry is \"http://example.com/pricing\", a bare domain like \"example.com/pricing\", or a non-string value such as a number or nested object.","commonSituations":"Copying an http:// link from an older site; forgetting the scheme entirely; YAML interpreting a URL-ish token as a non-string (e.g. a mapping); internal docs links using http.","solutions":["Change the scheme to https:// (update the URL if the site supports TLS)","Add the https:// prefix if the scheme was omitted","Quote the URL in YAML if special characters cause it to parse as a non-string"],"exampleFix":"// before\nsources:\n  - http://docs.example.com/pricing\n// after\nsources:\n  - https://docs.example.com/pricing","handlingStrategy":"validation","validationCode":"assert all(isinstance(s, str) and s.startswith(\"https://\") for s in row[\"sources\"]), \"all sources must be https\"","typeGuard":"def all_https(srcs):\n    return isinstance(srcs, list) and all(isinstance(s, str) and s.startswith(\"https://\") for s in srcs)","tryCatchPattern":"try:\n    validate_catalog(rows)\nexcept CatalogError as e:\n    if \"every source must be HTTPS\" in str(e):\n        upgrade_sources_to_https(row)\n    raise","preventionTips":["Default to https:// when copying links","Normalize http:// to https:// in import scripts","Lint URLs with a urllib.parse scheme check"],"tags":["validation","url","https","security"],"backgroundTag":"invalid-url-format","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"}