Review uncertain AI candidates and preserve unresolved business scope
This commit is contained in:
@@ -182,10 +182,10 @@ async function main() {
|
||||
assert.equal(researchResponse.status, 200, "authenticated research API");
|
||||
assert.ok(researchResponse.headers.get("cache-control")?.includes("no-store"));
|
||||
const research = await researchResponse.json();
|
||||
assert.equal(research.companies.length, 1051);
|
||||
assert.equal(research.companies.length, 1065);
|
||||
assert.equal(research.categories.length, 11);
|
||||
assert.equal(research.evidence.length, 2697);
|
||||
assert.equal(research.observations.length, 366);
|
||||
assert.equal(research.evidence.length, 2764);
|
||||
assert.equal(research.observations.length, 372);
|
||||
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 });
|
||||
assert.equal(researchPage.status, 200);
|
||||
|
||||
@@ -48,7 +48,7 @@ export type ResearchCandidateBatch = {
|
||||
records: {
|
||||
id: string; name: string; url: string | null; categoryId: string;
|
||||
kind: "product" | "company" | "promotion"; profileStatus: "readable" | "unavailable" | "archive-only";
|
||||
status: "pending-year" | "linked" | "existing-outside-cohort" | "outside-cohort" | "promotion";
|
||||
status: "pending-year" | "pending-ai" | "linked" | "existing-outside-cohort" | "outside-cohort" | "promotion";
|
||||
companyId?: string; evidenceIds?: string[]; note: string;
|
||||
}[];
|
||||
};
|
||||
@@ -125,13 +125,13 @@ export function validateResearch(snapshot: ResearchSnapshot) {
|
||||
if (!row.name.trim() || !row.note.trim() || !categories.has(row.categoryId) ||
|
||||
!["product", "company", "promotion"].includes(row.kind) ||
|
||||
!["readable", "unavailable", "archive-only"].includes(row.profileStatus) ||
|
||||
!["pending-year", "linked", "existing-outside-cohort", "outside-cohort", "promotion"].includes(row.status) ||
|
||||
!["pending-year", "pending-ai", "linked", "existing-outside-cohort", "outside-cohort", "promotion"].includes(row.status) ||
|
||||
(row.kind !== "promotion" && (!row.url || !evidenceUrl(row.url))) ||
|
||||
(row.url !== null && !evidenceUrl(row.url)) ||
|
||||
linked !== !!row.companyId || (row.companyId && !companies.has(row.companyId)) ||
|
||||
(row.kind === "promotion") !== (row.status === "promotion") ||
|
||||
(row.evidenceIds ?? []).some((id) => !evidence.has(id)) ||
|
||||
(row.status === "outside-cohort" && !row.evidenceIds?.length))
|
||||
(["outside-cohort", "pending-ai"].includes(row.status) && !row.evidenceIds?.length))
|
||||
throw new Error(`Invalid research candidate: ${row.id}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ test("research revisions share the authentication database and preserve replay l
|
||||
for (let i = 0; i < 20; i++) consumeCode(config, "invalid");
|
||||
assert.equal(consumeCode(config, "invalid"), "limited");
|
||||
const initial = readResearchSnapshot();
|
||||
assert.equal(initial.companies.length, 1051);
|
||||
assert.equal(initial.evidence.length, 2697);
|
||||
assert.equal(initial.observations.length, 366);
|
||||
assert.equal(initial.companies.length, 1065);
|
||||
assert.equal(initial.evidence.length, 2764);
|
||||
assert.equal(initial.observations.length, 372);
|
||||
assert.deepEqual(initial.candidateBatches, seed.candidateBatches, "candidate gaps persist in the same database metadata");
|
||||
assert.deepEqual(initial.directoryRechecks, seed.directoryRechecks, "follow-up classifications persist without rewriting the discovery audit");
|
||||
assert.deepEqual(readResearchSnapshot(), initial, "reopening does not duplicate records");
|
||||
@@ -64,8 +64,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, 170);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "dataset").length, 12);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "companies").length, 173);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "dataset").length, 13);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "excluded-candidate").length, 44);
|
||||
const review = snapshot.reviews.find((r) => r.id === "R4")!;
|
||||
assert.deepEqual(reviewCompanyIds(snapshot, review), ["AI007", "AI013", "AI021", "AI034"]);
|
||||
@@ -85,11 +85,11 @@ test("reviews link explicit companies without turning global or excluded cases i
|
||||
test("disclosure counts exclude client income, biographies, targets and duplicate milestones", () => {
|
||||
const snapshot = seed as ResearchSnapshot;
|
||||
const summary = categorySummary(snapshot);
|
||||
assert.equal(summary.reduce((n, c) => n + c.count, 0), 1051);
|
||||
assert.equal(summary.reduce((n, c) => n + c.self, 0), 52);
|
||||
assert.equal(summary.reduce((n, c) => n + c.count, 0), 1065);
|
||||
assert.equal(summary.reduce((n, c) => n + c.self, 0), 53);
|
||||
assert.equal(summary.reduce((n, c) => n + c.estimate, 0), 2);
|
||||
assert.equal(summary.reduce((n, c) => n + c.platform, 0), 19);
|
||||
assert.equal(summary.reduce((n, c) => n + c.unknown, 0), 978);
|
||||
assert.equal(summary.reduce((n, c) => n + c.unknown, 0), 991);
|
||||
assert.equal(snapshot.companies.find((c) => c.name === "Rork")?.revenueStatus, "unknown");
|
||||
assert.equal(snapshot.companies.find((c) => c.name === "Result")?.revenueStatus, "unknown");
|
||||
assert.ok(snapshot.observations.filter((o) => o.selection === "signal").every((o) => o.scope === "公司整体"));
|
||||
@@ -124,8 +124,8 @@ test("service run rates, legacy freight revenue and paid adoption do not become
|
||||
|
||||
test("technical reviews keep accessible materials separate from tested capabilities", () => {
|
||||
const snapshot = structuredClone(seed) as ResearchSnapshot;
|
||||
assert.equal(snapshot.companies.filter((c) => c.technicalReview).length, 83);
|
||||
assert.equal(snapshot.companies.filter((c) => c.technicalReview?.level === "public-artifact").length, 18);
|
||||
assert.equal(snapshot.companies.filter((c) => c.technicalReview).length, 85);
|
||||
assert.equal(snapshot.companies.filter((c) => c.technicalReview?.level === "public-artifact").length, 19);
|
||||
assert.equal(snapshot.companies.filter((c) => c.technicalReview?.level === "independent-test").length, 1);
|
||||
assert.equal(snapshot.companies.find((c) => c.id === "AI051")?.revenueStatus, "unknown");
|
||||
assert.match(snapshot.companies.find((c) => c.id === "AI051")!.technicalReview!.testScope!, /Sep 2026/);
|
||||
@@ -443,6 +443,55 @@ test("follow-up evidence can admit an uncertain directory candidate without rewr
|
||||
assert.throws(() => validateResearch(snapshot), /directory recheck/);
|
||||
});
|
||||
|
||||
test("AI relevance follow-ups retain unresolved businesses and reuse existing company identities", () => {
|
||||
const snapshot = structuredClone(seed) as ResearchSnapshot;
|
||||
const batch = snapshot.candidateBatches!.find((b) => b.id === "YC-AI-UNCLEAR-1")!;
|
||||
assert.equal(batch.complete, false);
|
||||
assert.equal(batch.records.length, 24);
|
||||
const original = coverageAudit.records.filter((r) => r.status === "ai-unclear").slice(0, 24);
|
||||
assert.deepEqual(batch.records.map((r) => r.url), original.map((r) => r.source));
|
||||
const linked = batch.records.filter((r) => r.status === "linked");
|
||||
assert.equal(linked.length, 17);
|
||||
assert.equal(linked.filter((r) => r.companyId!.startsWith("YC")).length, 14);
|
||||
for (const [name, id] of [["Bud", "AI070"], ["Prism", "AI030"], ["Parametric", "AI014"]]) {
|
||||
assert.equal(linked.find((r) => r.name === name)?.companyId, id);
|
||||
}
|
||||
assert.equal(snapshot.companies.filter((c) => c.profileOnly || c.directoryOrigin === "yc-2025-2026").length, 928);
|
||||
for (const row of linked) {
|
||||
const ycId = Number(row.id.replace("YC-AI1-", ""));
|
||||
assert.equal(snapshot.directoryRechecks!.find((r) => r.ycId === ycId)?.companyId, row.companyId);
|
||||
}
|
||||
const pending = batch.records.filter((r) => r.status === "pending-ai");
|
||||
assert.equal(pending.length, 7);
|
||||
assert.ok(pending.every((r) => !r.companyId && r.evidenceIds!.length && /2025/.test(r.note)));
|
||||
assert.match(pending.find((r) => r.name === "Better Auth")!.note, /AI.*模块/);
|
||||
validateResearch(snapshot);
|
||||
pending[0].companyId = "AI014";
|
||||
assert.throws(() => validateResearch(snapshot), /research candidate/);
|
||||
delete pending[0].companyId;
|
||||
pending[0].evidenceIds = [];
|
||||
assert.throws(() => validateResearch(snapshot), /research candidate/);
|
||||
});
|
||||
|
||||
test("historical monthly revenue and customer examples do not enter recurring platform comparisons", () => {
|
||||
const snapshot = seed as ResearchSnapshot;
|
||||
const monthly = snapshot.observations.find((o) => o.id === "UNCLEAR1-O-SCALAR-MONTHLY")!;
|
||||
assert.equal(monthly.value, 74000);
|
||||
assert.equal(monthly.selection, "historical");
|
||||
assert.equal(monthly.metric, undefined, "monthly revenue alone does not establish MRR or ARR");
|
||||
assert.equal(monthly.comparisonGroup, null);
|
||||
assert.equal(snapshot.companies.find((c) => c.id === "YC30514")!.revenueStatus, "self");
|
||||
for (const id of ["AMBY-CLIENT", "NIXO-EXAMPLE", "AUTOSTEP-WASTE"]) {
|
||||
assert.equal(snapshot.observations.find((o) => o.id === `UNCLEAR1-O-${id}`)!.selection, "excluded");
|
||||
}
|
||||
assert.ok(!platformIncomeSample(snapshot, { windowDays: null }).points.some((p) => p.observation.id.startsWith("UNCLEAR1-")));
|
||||
const cua = snapshot.companies.find((c) => c.id === "YC30420")!;
|
||||
assert.equal(cua.cat, "C03");
|
||||
assert.equal(cua.revenueStatus, "unknown");
|
||||
assert.match(cua.businessModel!, /自备计算机/);
|
||||
assert.equal(cua.technicalReview!.level, "public-artifact");
|
||||
});
|
||||
|
||||
test("Chinese discovery entries preserve unread articles and use separate primary evidence", () => {
|
||||
const snapshot = structuredClone(seed) as ResearchSnapshot;
|
||||
const batch = snapshot.candidateBatches!.find((b) => b.id === "JQ-2026-targeted-1")!;
|
||||
|
||||
Reference in New Issue
Block a user