santifer/career-ops · error · Error
runSeedScan: unknown seed "${seedId}"
Error message
runSeedScan: unknown seed "${seedId}" What it means
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.
Source
Thrown at scan-ats-full.mjs:446
const SEED_PROVIDERS = [greenhouse, lever, ashby];
/**
* Scan a VC portfolio seed source and return matching job offers.
* Companies are converted to PortalEntry shape, then each ATS provider's
* detect() is tried in order (greenhouse → lever → ashby). The first hit
* wins and its fetch() is called — identical to how portals.yml tracked
* companies flow through scan.mjs.
*
* @param {string} seedId Key from SEED_SOURCES (e.g. 'yc').
* @param {object} opts Parsed CLI options.
* @param {object} ctx HTTP context from makeHttpCtx().
* @param {Set} seenUrls Shared dedup set (mutated in place).
* @param {string} label Human-readable source label for logs.
* @returns {Promise<object[]>} New job offers (same shape as ATS scan offers).
*/
export async function runSeedScan(seedId, opts, ctx, seenUrls, label) {
const source = SEED_SOURCES[seedId];
if (!source) throw new Error(`runSeedScan: unknown seed "${seedId}"`);
let companies;
try {
companies = await source.fetch();
} catch (err) {
console.error(`⚠️ ${seedId}: could not fetch portfolio — ${err.message}`);
return [];
}
// Apply the --limit cap here too (by slug, consistent with sampleCompanies).
const capped = opts.limit < companies.length
? (opts.shuffle
? (() => { 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); })()
: companies.slice(0, opts.limit))
: companies;
const cutoff = Date.now() - opts.sinceDays * 86_400_000;
const offers = [];View on GitHub (pinned to 9b17a8ac97)
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.
Example fix
// before
await runSeedScan('Sequoia', opts, ctx, seen, 'sequoia'); // throws
// after
const known = Object.keys(SEED_SOURCES);
if (!known.includes(seedId.trim())) {
throw new Error(`Unknown seed '${seedId}'. Available: ${known.join(', ')}`);
}
await runSeedScan(seedId.trim(), opts, ctx, seen, label); Defensive patterns
Strategy: validation
Validate before calling
const VALID_SEEDS = new Set(Object.keys(SEED_SOURCES));
function validateSeedId(seedId) {
const id = String(seedId).trim();
if (!VALID_SEEDS.has(id)) {
throw new Error(`Unknown seed '${seedId}'. Available: ${[...VALID_SEEDS].join(', ')}`);
}
return id;
} Type guard
function isKnownSeed(seedId) {
return Object.prototype.hasOwnProperty.call(SEED_SOURCES, String(seedId).trim());
} Try / catch
try {
await runSeedScan(seedId, opts, ctx, seen, label);
} catch (err) {
if (err.message.includes('unknown seed')) {
console.error(err.message);
console.error(`Available seeds: ${Object.keys(SEED_SOURCES).join(', ')}`);
process.exit(2);
}
throw err;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- payload must include at least one of: cv, articleDigest
- payload.cv requires { section, entry }
- payload.cv requires a non-empty dedupKey (used for dedup/ide
- payload.articleDigest requires { entry }
- Application answer state must be one of: ${[...VALID_STATES]
AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13).
Data as JSON: /api/errors/7aad84f25d826c02.
Report an issue: GitHub.