深化20条目录资料并保留发现来源审计
This commit is contained in:
@@ -25,7 +25,7 @@ test("research revisions share the authentication database and preserve replay l
|
||||
const initial = readResearchSnapshot();
|
||||
assert.equal(initial.companies.length, 1015);
|
||||
assert.equal(initial.evidence.length, 1086);
|
||||
assert.equal(initial.observations.length, 151);
|
||||
assert.equal(initial.observations.length, 155);
|
||||
assert.deepEqual(readResearchSnapshot(), initial, "reopening does not duplicate records");
|
||||
const db = openSiteDatabase();
|
||||
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table'").all() as { name: string }[];
|
||||
@@ -62,7 +62,7 @@ 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, 28);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "companies").length, 29);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "dataset").length, 3);
|
||||
assert.equal(snapshot.reviews.filter((r) => r.scope === "excluded-candidate").length, 8);
|
||||
const review = snapshot.reviews.find((r) => r.id === "R4")!;
|
||||
@@ -84,10 +84,10 @@ test("disclosure counts exclude client income, biographies, targets and duplicat
|
||||
const snapshot = seed as ResearchSnapshot;
|
||||
const summary = categorySummary(snapshot);
|
||||
assert.equal(summary.reduce((n, c) => n + c.count, 0), 1015);
|
||||
assert.equal(summary.reduce((n, c) => n + c.self, 0), 17);
|
||||
assert.equal(summary.reduce((n, c) => n + c.self, 0), 18);
|
||||
assert.equal(summary.reduce((n, c) => n + c.estimate, 0), 1);
|
||||
assert.equal(summary.reduce((n, c) => n + c.platform, 0), 16);
|
||||
assert.equal(summary.reduce((n, c) => n + c.unknown, 0), 981);
|
||||
assert.equal(summary.reduce((n, c) => n + c.unknown, 0), 980);
|
||||
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 === "公司整体"));
|
||||
@@ -167,15 +167,22 @@ test("directory coverage reconciles every candidate and keeps profile-only incom
|
||||
assert.equal(count("ai-unclear"), coverage.unclearAI);
|
||||
for (const row of coverageAudit.records.filter((r) => r.status === "imported")) {
|
||||
const company = snapshot.companies.find((c) => c.id === `YC${row.ycId}`)!;
|
||||
assert.ok(company.profileOnly);
|
||||
assert.ok(company.profileOnly || company.directoryOrigin === "yc-2025-2026");
|
||||
assert.equal(company.url, row.source);
|
||||
assert.equal(company.revenueStatus, "unknown");
|
||||
if (company.profileOnly) assert.equal(company.revenueStatus, "unknown");
|
||||
assert.equal(company.year, row.foundedYear);
|
||||
assert.ok([2025, 2026].includes(company.year!));
|
||||
}
|
||||
const invalid = structuredClone(snapshot);
|
||||
invalid.coverage!.newProfiles += 1;
|
||||
assert.throws(() => validateResearch(invalid), /coverage accounting/);
|
||||
const promoted = snapshot.companies.find((c) => c.id === "YC30215")!;
|
||||
assert.equal(promoted.profileOnly, false);
|
||||
assert.equal(promoted.directoryOrigin, "yc-2025-2026");
|
||||
assert.equal(promoted.revenueStatus, "self");
|
||||
const lostOrigin = structuredClone(snapshot);
|
||||
delete lostOrigin.companies.find((c) => c.id === promoted.id)!.directoryOrigin;
|
||||
assert.throws(() => validateResearch(lostOrigin), /coverage accounting/);
|
||||
});
|
||||
|
||||
test("income descriptions report sample dispersion and maximum-value sensitivity", () => {
|
||||
|
||||
Reference in New Issue
Block a user