{"record":{"id":"7aad84f25d826c02","repo":"santifer/career-ops","slug":"runseedscan-unknown-seed-seedid","errorCode":null,"errorMessage":"runSeedScan: unknown seed \"${seedId}\"","messagePattern":"runSeedScan: unknown seed \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scan-ats-full.mjs","lineNumber":446,"sourceCode":"const SEED_PROVIDERS = [greenhouse, lever, ashby];\n\n/**\n * Scan a VC portfolio seed source and return matching job offers.\n * Companies are converted to PortalEntry shape, then each ATS provider's\n * detect() is tried in order (greenhouse → lever → ashby). The first hit\n * wins and its fetch() is called — identical to how portals.yml tracked\n * companies flow through scan.mjs.\n *\n * @param {string}   seedId      Key from SEED_SOURCES (e.g. 'yc').\n * @param {object}   opts        Parsed CLI options.\n * @param {object}   ctx         HTTP context from makeHttpCtx().\n * @param {Set}      seenUrls    Shared dedup set (mutated in place).\n * @param {string}   label       Human-readable source label for logs.\n * @returns {Promise<object[]>}  New job offers (same shape as ATS scan offers).\n */\nexport async function runSeedScan(seedId, opts, ctx, seenUrls, label) {\n  const source = SEED_SOURCES[seedId];\n  if (!source) throw new Error(`runSeedScan: unknown seed \"${seedId}\"`);\n\n  let companies;\n  try {\n    companies = await source.fetch();\n  } catch (err) {\n    console.error(`⚠️  ${seedId}: could not fetch portfolio — ${err.message}`);\n    return [];\n  }\n\n  // Apply the --limit cap here too (by slug, consistent with sampleCompanies).\n  const capped = opts.limit < companies.length\n    ? (opts.shuffle\n      ? (() => { const c = companies.slice(); for (let i = c.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [c[i], c[j]] = [c[j], c[i]]; } return c.slice(0, opts.limit); })()\n      : companies.slice(0, opts.limit))\n    : companies;\n\n  const cutoff = Date.now() - opts.sinceDays * 86_400_000;\n  const offers = [];","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/scan-ats-full.mjs#L428-L464","documentation":"runSeedScan(seedId, ...) looks up the seed source in the SEED_SOURCES registry (e.g. 'yc', 'a16z') and throws a plain Error if the key is absent. This is a programmer/CLI-usage error: the caller asked for a seed portfolio the scanner does not know about.","triggerScenarios":"Passing a seedId that is not a key in SEED_SOURCES, such as 'sequoia' when only 'yc' and 'a16z' are registered; a typo like 'YC' (case-sensitive) or 'y-combinator'; an empty string.","commonSituations":"User runs `scan-ats-full.mjs --seeds sequoia` with a name not in the registry; case mismatch; trailing whitespace in the seed name from shell expansion; an outdated career-ops install that predates a newly added seed.","solutions":["Check available seeds: inspect SEED_SOURCES keys in scan-ats-full.mjs or run the scanner's --help/list-seeds to see registered names.","Fix the seedId to exactly match a registry key (case-sensitive): 'yc', 'a16z'.","Trim whitespace: seedId.trim() before calling.","If you need a new seed source, register it in SEED_SOURCES with a fetch function in seeds/vc-portfolios.mjs."],"exampleFix":"// before\nawait runSeedScan('Sequoia', opts, ctx, seen, 'sequoia'); // throws\n\n// after\nconst known = Object.keys(SEED_SOURCES);\nif (!known.includes(seedId.trim())) {\n  throw new Error(`Unknown seed '${seedId}'. Available: ${known.join(', ')}`);\n}\nawait runSeedScan(seedId.trim(), opts, ctx, seen, label);","handlingStrategy":"validation","validationCode":"const VALID_SEEDS = new Set(Object.keys(SEED_SOURCES));\nfunction validateSeedId(seedId) {\n  const id = String(seedId).trim();\n  if (!VALID_SEEDS.has(id)) {\n    throw new Error(`Unknown seed '${seedId}'. Available: ${[...VALID_SEEDS].join(', ')}`);\n  }\n  return id;\n}","typeGuard":"function isKnownSeed(seedId) {\n  return Object.prototype.hasOwnProperty.call(SEED_SOURCES, String(seedId).trim());\n}","tryCatchPattern":"try {\n  await runSeedScan(seedId, opts, ctx, seen, label);\n} catch (err) {\n  if (err.message.includes('unknown seed')) {\n    console.error(err.message);\n    console.error(`Available seeds: ${Object.keys(SEED_SOURCES).join(', ')}`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Expose available seeds via a --list-seeds CLI flag for discoverability.","Trim and lowercase-normalize seed IDs only if the registry is case-insensitive — otherwise match exactly.","Validate seed IDs at CLI parse time, not deep in the scan loop."],"tags":["seed-sources","registry","validation","scan"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}