补核6项成立冲突并拆分旧年份与缺年候选

This commit is contained in:
2026-10-31 04:48:47 +08:00
parent 652b0fd539
commit feb4de220d
6 changed files with 537 additions and 8 deletions
+27 -2
View File
@@ -24,7 +24,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, 1154);
assert.equal(initial.evidence.length, 3274);
assert.equal(initial.evidence.length, 3303);
assert.equal(initial.observations.length, 453);
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");
@@ -406,7 +406,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, 18);
assert.equal(snapshot.candidateBatches!.flatMap((b) => b.records).filter((r) => r.status === "pending-year").length, 24);
});
test("product pivots and founder histories do not become new company years or current revenue", () => {
@@ -748,6 +748,31 @@ test("the final uncertain cohort separates delivery-start rentals, reservations
assert.ok(!platformIncomeSample(snapshot, { windowDays: null }).points.some((p) => p.observation.id.startsWith("UNCLEAR8-")));
});
test("founding conflicts preserve old product history without creating new companies or revenue", () => {
const snapshot = seed as ResearchSnapshot;
const batch = snapshot.candidateBatches!.find((b) => b.id === "YC-DATE-CONFLICT-1")!;
const original = coverageAudit.records.filter((r) => r.status === "date-conflict");
assert.equal(batch.complete, false);
assert.equal(batch.records.length, 6);
assert.deepEqual(batch.records.map((r) => r.url), original.map((r) => r.source));
assert.equal(new Set(batch.records.map((r) => r.url)).size, original.length);
for (const row of batch.records) {
assert.equal(row.status, "pending-year");
assert.equal(row.companyId, undefined);
const evidence = snapshot.evidence.filter((e) => row.evidenceIds!.includes(e.id));
assert.equal(evidence.length, row.evidenceIds!.length);
assert.ok(evidence.every((e) => e.companyId === null));
assert.ok(evidence.some((e) => e.publishedAt?.startsWith("2025-")), "old product launch remains explicit");
assert.ok(!snapshot.companies.some((c) => c.evidenceIds.some((eid) => row.evidenceIds!.includes(eid))));
}
assert.match(batch.records.find((r) => r.name === "Layers")!.note, /未确认当前AI核心/);
assert.ok(!snapshot.observations.some((o) => o.evidence.startsWith("YEARCONFLICT1-")));
const excluded = coverageAudit.records.filter((r) => r.status === "year-outside-or-missing");
assert.equal(excluded.filter((r) => r.foundedYear === null).length, 54);
assert.equal(excluded.filter((r) => r.foundedYear !== null).length, 214);
assert.ok(excluded.filter((r) => r.foundedYear !== null).every((r) => ![2025, 2026].includes(r.foundedYear!)));
});
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")!;