fix(functions): preserve coverage diagnostics separately from blockers

This commit is contained in:
morluto committed 2026-10-15 03:43:28 +08:00
1 parent b47055edbe
commit cb4ff50202
7 files changed
+230 -53

No files matched your search

+14 -7
View File
@@ -78,16 +78,23 @@ export const isCallerOnlyIncompleteCoverage = (
);
};
/** Explain why two resolved call sets cannot establish call-set equality. */
export const functionCallCoverageLimitations = (
export interface FunctionCallCoverageAssessment {
/** Reasons the observed call sets cannot establish equality. */
readonly blockers: readonly string[];
/** Provider caveats that remain relevant even with complete coverage. */
readonly diagnostics: readonly string[];
}
/** Keep observed-set blockers separate from descriptive provider caveats. */
export const assessFunctionCallCoverage = (
coverage: RelationshipCoverage | null,
dossier: Pick<FunctionDossier, "unresolved_calls">,
): string[] => {
return uniqueSorted([
): FunctionCallCoverageAssessment => ({
blockers: uniqueSorted([
...relationshipCoverageLimitations(coverage),
...(coverage?.status === "complete" ? [] : (coverage?.diagnostics ?? [])),
...(dossier.unresolved_calls ?? []).map(
({ address, reason }) => `Unresolved call at ${address}: ${reason}`,
),
]);
};
]),
diagnostics: uniqueSorted(coverage?.diagnostics ?? []),
});