refactor(reconstruction): isolate ledger coverage
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
} from "./ReconstructionObligationOriginalCases.js";
|
||||
import {
|
||||
digestObligationLedgerValue,
|
||||
obligationLedgerCoverage,
|
||||
obligationEdgeOrder,
|
||||
obligationLedgerEvidenceLinks,
|
||||
obligationLedgerStatus,
|
||||
@@ -99,7 +100,7 @@ export const evaluateReconstructionObligationLedger = ({
|
||||
omittedCount,
|
||||
orphanManifestIds,
|
||||
);
|
||||
const coverage = coverageFor(
|
||||
const coverage = obligationLedgerCoverage(
|
||||
omittedCount,
|
||||
maxObligations,
|
||||
limitations.length > 0,
|
||||
@@ -204,17 +205,6 @@ const ledgerLimitations = (
|
||||
]),
|
||||
].sort();
|
||||
|
||||
const coverageFor = (
|
||||
omittedCount: number,
|
||||
maxObligations: number,
|
||||
incomplete: boolean,
|
||||
): ReconstructionObligationLedger["coverage"] => ({
|
||||
status: incomplete ? "partial" : "complete",
|
||||
truncated: omittedCount > 0,
|
||||
omitted_count: omittedCount,
|
||||
max_obligations: maxObligations,
|
||||
});
|
||||
|
||||
const evaluateObligation = (
|
||||
candidate: ReconstructionObligationCandidate,
|
||||
context: EvaluationContext,
|
||||
|
||||
@@ -10,6 +10,17 @@ import type {
|
||||
|
||||
type DiagnosticCode = ReconstructionObligation["diagnostics"][number]["code"];
|
||||
|
||||
export const obligationLedgerCoverage = (
|
||||
omittedCount: number,
|
||||
maxObligations: number,
|
||||
incomplete: boolean,
|
||||
): ReconstructionObligationLedger["coverage"] => ({
|
||||
status: incomplete ? "partial" : "complete",
|
||||
truncated: omittedCount > 0,
|
||||
omitted_count: omittedCount,
|
||||
max_obligations: maxObligations,
|
||||
});
|
||||
|
||||
export const summarizeObligations = (
|
||||
obligations: readonly ReconstructionObligation[],
|
||||
): ReconstructionObligationLedger["summary"] => ({
|
||||
|
||||
Reference in New Issue
Block a user