mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 16:57:19 +00:00
fix(functions): preserve coverage diagnostics separately from blockers
This commit is contained in:
1 parent
b47055edbe
commit
cb4ff50202
7 files changed
+230
-53
No files matched your search
@@ -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 ?? []),
|
||||
});
|
||||
Reference in new issue
Block a user