{"record":{"id":"7aad84f25d826c02","repo":"santifer/career-ops","slug":"runseedscan-unknown-seed-seedid","errorCode":null,"errorMessage":"runSeedScan: unknown seed \"${seedId}\"","messagePattern":"runSeedScan: unknown seed \"(.+?)\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scan-ats-full.mjs","lineNumber":556,"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":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/scan-ats-full.mjs#L538-L574","documentation":"runSeedScan looks up the requested seed source in the SEED_SOURCES registry; this library throws when the seedId key does not exist. It is a fail-fast guard so an unknown identifier aborts before any network fetching happens.","triggerScenarios":"Calling runSeedScan(seedId, ...) with a seedId that is not a key of SEED_SOURCES, e.g. a typo, a renamed/removed seed, or an ID read from config that the CLI never registered.","commonSituations":"Users pass a seed name on the CLI or in a config file after a version renamed seeds; scripts hardcode an old seed ID; programmatic callers build the ID dynamically and mistype it.","solutions":["Print the valid seed IDs by inspecting the SEED_SOURCES object in scan-ats-full.mjs and pick one exactly","Fix the seedId spelling in the command line or config","Update to the current version if the seed was renamed and use its new ID","Wrap the call in a check: if (!SEED_SOURCES[seedId]) list keys before running"],"exampleFix":"// before\nawait runSeedScan('ats-companies', opts, ctx, seenUrls, label);\n// after\nimport { SEED_SOURCES } from './scan-ats-full.mjs';\nif (!(seedId in SEED_SOURCES)) {\n  console.error(`Unknown seed \"${seedId}\". Valid: ${Object.keys(SEED_SOURCES).join(', ')}`);\n  process.exit(1);\n}\nawait runSeedScan(seedId, opts, ctx, seenUrls, label);","handlingStrategy":"validation","validationCode":"import { SEED_SOURCES } from './scan-ats-full.mjs';\nif (!(seedId in SEED_SOURCES)) {\n  throw new Error(`Unknown seed \"${seedId}\". Valid seeds: ${Object.keys(SEED_SOURCES).join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runSeedScan(seedId, opts, ctx, seenUrls, label);\n} catch (err) {\n  if (String(err.message).startsWith('runSeedScan: unknown seed')) {\n    console.error(`${err.message}. Valid seeds: ${Object.keys(SEED_SOURCES).join(', ')}`);\n  } else throw err;\n}","preventionTips":["List SEED_SOURCES keys before passing a seedId on the CLI","Keep seed IDs in a single config constant referenced by both caller and registry","Validate user-supplied seed names at argument-parse time"],"tags":["cli","invalid-argument","seed-scan"],"backgroundTag":"resource-not-found","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}