{"record":{"id":"017a1ccd7a22c8db","repo":"JuliusBrussee/caveman","slug":"label-no-priced-region-agnostic-rows-found","errorCode":null,"errorMessage":"${label}: no priced region-agnostic rows found","messagePattern":"(.+?): no priced region-agnostic rows found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/generate-agent-catalog.mjs","lineNumber":225,"sourceCode":"  if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0) {\n    throw new Error(`${label}: ${field} must be a finite non-negative number`);\n  }\n  return value;\n}\n\nfunction number(value) {\n  const text = String(value);\n  if (!/^(0|[1-9][0-9]*)(\\.[0-9]+)?(e[+-]?[0-9]+)?$/.test(text)) {\n    throw new Error(`cannot render ${text} as a stable numeric literal`);\n  }\n  return text;\n}\n\n/** Renders the full public/agent/src/catalog.ts module text. */\nexport function renderCatalogModule(catalogBytes, label = CATALOG_LABEL) {\n  const digest = createHash(\"sha256\").update(catalogBytes).digest(\"hex\");\n  const { selected, skipped } = selectRows(parseCatalogYaml(catalogBytes.toString(\"utf8\"), label), label);\n  if (selected.length === 0) throw new Error(`${label}: no priced region-agnostic rows found`);\n  const entries = selected.map(({ key, price }) => [\n    `  ${JSON.stringify(key)}: Object.freeze({`,\n    `    inputPerMillion: ${number(price.inputPerMillion)},`,\n    `    outputPerMillion: ${number(price.outputPerMillion)},`,\n    `    cacheReadPerMillion: ${number(price.cacheReadPerMillion)},`,\n    `    cacheWritePerMillion: ${number(price.cacheWritePerMillion)},`,\n    `    reasoningPerMillion: ${number(price.reasoningPerMillion)},`,\n    `  }),`,\n  ].join(\"\\n\")).join(\"\\n\");\n  const skippedLines = skipped.length === 0\n    ? \"// Every catalog row is represented above.\\n\"\n    : [\n      \"// Rows deliberately absent above. A regional rate is not a region-free\",\n      \"// rate, so these are omitted rather than borrowed; a run on one of these\",\n      \"// models prices as unpriced (honest zero) instead of plausibly wrong.\",\n      ...skipped.map(({ key, reason }) => `//   ${key} — ${reason}`),\n      \"\",\n    ].join(\"\\n\");","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/scripts/generate-agent-catalog.mjs#L207-L243","documentation":"Thrown by renderCatalogModule() in scripts/generate-agent-catalog.mjs when the selection pass over the parsed catalog yields zero rows. Rows are selected only when they are region-agnostic (`region: global`), priced in USD, and carry list prices for both input and output tokens; every other row is skipped with a recorded reason. An empty selection would generate an empty, useless catalog.ts, so the generator refuses.","triggerScenarios":"Every row in current.yaml is regional, non-USD, or missing input/output list prices — e.g. the catalog was temporarily rewritten with regional-only pricing, or a global edit changed `currency` or `region` values across the board.","commonSituations":"Bulk edits that flip region or currency; provider price sources switching to per-region rows; a truncated or partially merged catalog file.","solutions":["Ensure at least one row has `region: global`, `currency: USD`, and both `input_per_million` and `output_per_million` set in its pricing block.","Inspect the skipped list the generator prints to see why each row was dropped and fix the intended-to-carry rows.","Re-run `node scripts/generate-agent-catalog.mjs`."],"exampleFix":"# before: all rows regional\n- provider: acme\n  model: acme-1\n  region: us-east\n  currency: USD\n# after\n- provider: acme\n  model: acme-1\n  region: global\n  currency: USD","handlingStrategy":"validation","validationCode":"// Assert the catalog will select at least one row before generating.\nconst selectable = rows.some((r) =>\n  r.region === \"global\" && r.currency === \"USD\"\n  && r.pricing && typeof r.pricing.input_per_million === \"number\"\n  && typeof r.pricing.output_per_million === \"number\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bulk region/currency edits should be reviewed for at least one surviving global USD row.","Read the generator's printed skip reasons after any large catalog change."],"tags":["catalog","validation","pricing","build-tooling"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}