refactor(analysis): remove fixed result quotas

This commit is contained in:
morluto
2026-09-29 13:57:24 +08:00
parent 0e2738ffb6
commit 20152a9872
105 changed files with 605 additions and 1084 deletions
-13
View File
@@ -79,8 +79,6 @@ type RecordPair = z.infer<
typeof bundleComparisonInputSchema
>["record_pairs"][number];
const MAX_ENTITIES = 100_000;
/** Compare canonical bundle membership and only explicitly paired observations. */
export const compareBundles = (
leftInput: unknown,
@@ -89,7 +87,6 @@ export const compareBundles = (
): BundleComparisonResult => {
const left = parseEvidenceBundle(leftInput);
const right = parseEvidenceBundle(rightInput);
enforceBounds(left, right);
const leftDigest = bundleDigest(left);
const rightDigest = bundleDigest(right);
const recordResult = compareRecords(left, right, recordPairs);
@@ -303,16 +300,6 @@ const historyEvidenceIds = (history: readonly ResidualUnknown[]): string[] =>
),
].sort(ascii);
const enforceBounds = (left: EvidenceBundle, right: EvidenceBundle): void => {
const total =
left.records.length +
right.records.length +
left.unknowns.length +
right.unknowns.length;
if (total > MAX_ENTITIES)
throw new TypeError(`Bundle comparison exceeds ${MAX_ENTITIES} entities`);
};
const bundleDigest = (bundle: EvidenceBundle): string =>
createHash("sha256").update(serializeEvidenceBundle(bundle)).digest("hex");