Register all seven public Speedrun cohorts with verifiable boundaries

This commit is contained in:
2026-11-01 01:54:41 +08:00
parent 17e9306c97
commit 51d6364ddd
6 changed files with 3624 additions and 12 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ async function main() {
const research = await researchResponse.json();
assert.equal(research.companies.length, 1253);
assert.equal(research.categories.length, 11);
assert.equal(research.evidence.length, 4894);
assert.equal(research.evidence.length, 4909);
assert.equal(research.observations.length, 491);
assert.equal((await request("/api/research/ai-companies", { method: "POST", headers })).status, 405);
const researchPage = await request("/docs/other-research/ai-company-research/overview", { headers });
+33 -4
View File
@@ -124,7 +124,7 @@ test("research revisions share the authentication database and preserve replay l
assert.equal(consumeCode(config, "invalid"), "limited");
const initial = readResearchSnapshot();
assert.equal(initial.companies.length, 1253);
assert.equal(initial.evidence.length, 4894);
assert.equal(initial.evidence.length, 4909);
assert.equal(initial.observations.length, 491);
const businessReviews = initial.reviews.filter((review) => review.type === businessModelReviewType);
assert.equal(businessReviews.length, 7);
@@ -170,8 +170,8 @@ test("research validation rejects broken evidence and unsafe source links", () =
test("reviews link explicit companies without turning global or excluded cases into companies", () => {
const snapshot = structuredClone(seed) as ResearchSnapshot;
assert.equal(snapshot.reviews.filter((r) => r.scope === "companies").length, 248);
assert.equal(snapshot.reviews.filter((r) => r.scope === "dataset").length, 147);
assert.equal(snapshot.reviews.filter((r) => r.scope === "excluded-candidate").length, 54);
assert.equal(snapshot.reviews.filter((r) => r.scope === "dataset").length, 149);
assert.equal(snapshot.reviews.filter((r) => r.scope === "excluded-candidate").length, 55);
const review = snapshot.reviews.find((r) => r.id === "R4")!;
assert.deepEqual(reviewCompanyIds(snapshot, review), ["AI007", "AI013", "AI021", "AI034"]);
assert.deepEqual(reviewCompanyIds(snapshot, snapshot.reviews.find((r) => r.id === "CN-R-PSI")!), []);
@@ -630,6 +630,35 @@ test("the public SR007 roster preserves unique entries and Alven's older operato
"a current category change must retain the unresolved historical product attribution");
});
test("public Speedrun cohort rosters preserve the finite boundary without inventing founding years", () => {
const snapshot = seed as ResearchSnapshot;
const rosters = snapshot.candidateBatches!.filter((batch) => /^SR00[1-7]-public-roster-2026-1$/.test(batch.id));
assert.equal(rosters.length, 7);
for (const [index, count] of [25, 25, 32, 42, 59, 59, 79].entries()) {
const batch = rosters.find((item) => item.id.startsWith(`SR${String(index + 1).padStart(3, "0")}-`))!;
assert.equal(batch.records.length, count);
assert.equal(batch.complete, false, "a complete directory page is not completed company-level research");
}
const rows = rosters.flatMap((batch) => batch.records);
assert.equal(rows.length, 321);
assert.equal(new Set(rows.map((row) => row.url)).size, 321);
const newlyRegistered = rosters.filter((batch) => !batch.id.startsWith("SR007-")).flatMap((batch) => batch.records);
assert.equal(newlyRegistered.length, 242);
assert.equal(newlyRegistered.filter((row) => row.status === "pending-year").length, 226);
assert.equal(newlyRegistered.filter((row) => row.status === "linked").length, 9);
assert.equal(newlyRegistered.filter((row) => row.status === "existing-outside-cohort").length, 1);
assert.equal(newlyRegistered.filter((row) => row.status === "outside-cohort").length, 6);
assert.ok(newlyRegistered.filter((row) => row.status === "outside-cohort").every((row) =>
row.profileStatus === "readable" && row.evidenceIds?.some((id) => id.startsWith("SRALL1-P-"))),
"old founding years require independent profile evidence, not cohort age");
const variants = newlyRegistered.filter((row) => row.name === "Variant");
assert.equal(variants.length, 2);
assert.equal(new Set(variants.map((row) => row.url)).size, 2, "same-name profiles must not be merged by name");
assert.equal(variants.filter((row) => row.companyId === "AI066").length, 1);
assert.ok(!snapshot.observations.some((row) => row.evidence.startsWith("SRALL1-")),
"roster discovery and outside-cohort claims do not create financial observations");
});
test("annual launch archives exclude older companies only with evidence and reuse existing records", () => {
const snapshot = structuredClone(seed) as ResearchSnapshot;
const batch = snapshot.candidateBatches!.find((b) => b.id === "PH-2025-visible-1")!;
@@ -657,7 +686,7 @@ test("unreconciled directory financials remain source reviews instead of income
assert.ok(review.evidenceIds.includes("PH-TANA-DR"));
assert.equal(reviewCompanyIds(snapshot, review).length, 0);
assert.ok(!snapshot.observations.some((o) => o.evidence === "PH-TANA-DR"));
assert.equal(snapshot.candidateBatches!.flatMap((b) => b.records).filter((r) => r.status === "pending-year").length, 131);
assert.equal(snapshot.candidateBatches!.flatMap((b) => b.records).filter((r) => r.status === "pending-year").length, 357);
});
test("product pivots and founder histories do not become new company years or current revenue", () => {