1const e=`# Discover Ranking Pipeline (Company-Agnostic) 2 3> Shipped 2026-06-03 (LC-658, prod commit a2c4b8c6). Lives in \`apps/server/src/lib/discover-source-v2.ts\` (\`discoverSourceMapV2\`), the production path selected whenever \`canUseDiscoverSourceV2(env) = Boolean(LLMAPI_API_KEY)\` is true (always in prod). The legacy \`discoverRepos\` (discover-phase1.ts) path is the fallback only when the LLM key is absent. 4 5## Goal 6From any company URL, rank the source map so the **plan-capped top-N** (Free = 2) are the GitHub repos where the company's **buyers** are â not its own employees. Must generalize to any company, not a tuned set. 7 8## The problem it fixed 9Before: the ranking forced a company's OWN repos into the top-2. Those repos (often 5â26 stars) surface a handful of the company's own employees, not leads â so a free customer saw no value and didn't convert. Example (Coval): free top-2 were \`coval-ai/benchmarks\` (7â ) + \`coval-ai/cli\` (5â ). 10 11## The pipeline (5 grounded, company-agnostic stages) 121. **Grounded niche discovery** â the LLM emits \`nicheSearchTerms\` describing the *buyer's tool niche* (e.g. "voice agent", "LLM evaluation"), **not** competitor names from memory. GitHub repo search on those terms returns the real high-yield repos in the niche. *Retrieve facts from real data; use the LLM for judgment, never for recall of specific repo names.* 132. **Yield + freshness gate** (\`meetsActivationFloor\`) â a repo cannot occupy an activated/top-N slot if it is archived, stale (no push >12 months), or low-yield (\`<50â && <10 forks\`). Kills employees-only and dead repos. 143. **Relevance-first sort** â bucket by confidence (\`floor(confidence*10)\`); yield (\`log1p(stars)\`) breaks ties. A precise 10kâ repo beats a broad 100kâ one; stars never override relevance. 154. **Buyer-presence calibration** â repos whose developers are buyers (competitor/adjacent-org repos where the ICP congregates) score high; broad/off-ICP repos score low. 165. **First-party is not privileged** â company-owned repos rank on merit and carry a UI badge. An OSS-led company's popular own repo wins on yield; a displacement company's tiny own repo correctly drops. Motion-awareness falls out of yield, not a hardcoded rule. 17 18After: Coval's free top-2 become \`rasa\` (21kâ ) + \`deepeval\` (16kâ ) â real buyer communities. 19 20## How it is evaluated 21A **grounded research-agent judge** (script-driven, not a one-shot LLM rating): generates the real source map, then for each company researches the ICP (web) and checks each repo's **public GitHub yield** (stars, contributors, recent activity). It is stable run-to-run because it is grounded in real numbers â unlike a subjective LLM score, which swung ±0.25 on identical inputs. Verified on 9 real YC companies; a golden-label set is retained to verify future changes deterministically. 22 23Per-plan grading (Free=2 / Pro=5 / Business=10 / Scale=30, raised from 20 in LC-666 â \`types.ts:89\`): **Free is strong**; quality holds through mid-tiers; the deep tail thins for narrow niches. 24 25## Known residuals (not regressions) 26- **LC-663** â off-ICP *audience-mismatch* keyword false-positives at higher tiers (e.g. a 100kâ speech-model repo for an agent-eval product, or a SQL-database repo for an agent-infra product): right keyword, wrong audience. 27- **Niche scarcity at high caps** is correct behavior â when fewer than N high-yield buyer repos exist for a niche, surface fewer, never pad with junk (see LC-666 adaptive quality-gated cap). 28 29## Invariants 30- Never pad a plan's slots with low-yield/off-ICP repos to hit a number. 31- Discovery + scoring use per-request real data (GitHub search/stars/contributors); the LLM supplies judgment (niche description, relevance), never recalled repo names. 32- The change is confined to \`discover-source-v2.ts\`; the legacy phase1 path is untouched. 33`;export{e as default}; 34//# sourceMappingURL=discover-ranking-pipeline-ByoDO0cm.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.