/** * Pure helper that folds a `CheckResult[]` (the raw * `runSuites` output) into a compact, UI-friendly * `{ results, summaries }` view. * * Called from `verifier.ts` after `runSuites` returns and after * the recognition payload has been lifted onto the result. The * helper has no I/O, no async, and no service dependencies — it * is safe to call from any context (incl. consumers refolding * after appending late results, e.g. dcc-transaction-service's * async OpenBadges merge). * * In **non-verbose** mode (the default), `results[]` carries * only failures and explicit `.applies` skips; everything * else is folded into the per-suite rollup on `summaries[]`. In * **verbose** mode `results[]` is the raw input, unchanged. * * `summaries[]` is always populated with one entry per (phase, * suite) that emitted at least one `CheckResult`. Suites that * silently no-op'd (predicate false, not explicitly queued) emit * nothing in either array, mirroring `runSuites`'s behavior. * * @see SuiteSummary * @see CheckResult * @see computeId */ import type { CheckResult, SuitePhase, VerificationSuite } from './types/check.js'; import type { SuiteSummary } from './types/suite-summary.js'; export interface FoldOptions { /** * If true, `results[]` carries every `CheckResult` from the * input. If false (default), `results[]` carries only failures * and explicit `.applies` skips. */ verbose?: boolean; } export declare function foldCheckResults(checks: CheckResult[], suites: VerificationSuite[], opts?: FoldOptions): { results: CheckResult[]; summaries: SuiteSummary[]; }; /** * Compute the dot-separated namespaced id for a single * `CheckResult` or `SuiteSummary`. * * Rules: * - Strip the `.` prefix from `localCheckId` if present. * - When `phase === suite`, collapse to a single segment. * - When `phase` is missing, use `'unknown'`. * - When `localCheckId` is empty (suite-summary case), drop the * trailing segment. * * @example * computeId('cryptographic', 'core', 'core.proof-exists') * // → 'cryptographic.core.proof-exists' * computeId('recognition', 'recognition', 'recognition.profile') * // → 'recognition.profile' * computeId('cryptographic', 'core', '') * // → 'cryptographic.core' */ export declare function computeId(phase: SuitePhase | undefined, suite: string, localCheckId: string): string; //# sourceMappingURL=fold-results.d.ts.map