import type { JsonObject } from "@decionis/agent-safe-pipeline"; export type Comparison = "MATCH" | "MISMATCH" | "PENDING"; /** * How the provider's receipt (the Verifying Provider Profile, VP-3) relates to * this executor's own account of the attempt. `ABSENT` is no receipt, or one * whose statement could not be read; `SILENT` is a receipt whose status * agrees with the outcome but that names no effect digest to compare; * `MISMATCH` is a receipt that contradicts the outcome, the authorised * effect, or what this executor observed; `MATCH` is agreement on all three. */ export type ReceiptComparison = "MATCH" | "MISMATCH" | "SILENT" | "ABSENT"; export type ReceiptStatus = "EFFECTED" | "REFUSED" | "INDETERMINATE"; /** What a receipt says it did, read without verifying it. */ export interface ReceiptStatement { readonly status: ReceiptStatus; readonly digest: string | null; } export interface EffectComparisonResult { readonly comparison: Comparison; /** The projected fields that differ, in the projection's own order. */ readonly mismatched: readonly string[]; } /** * The expected effect against the observed one, field by field over the * projection and nothing else. A provider that returns more than the * projection asks about cannot cause a mismatch, and a provider that * returns less cannot hide one: a field the observation does not carry is a * difference, because the projection is exactly the set of things that had * to be true for this to be the effect that was authorised. * * An observation that does not exist yet is `PENDING`, which is not a * match: an acknowledgement is not a confirmation. */ export declare function compareEffect(expected: JsonObject, observed: JsonObject | null): EffectComparisonResult; /** * The provider's statement in its receipt: the `effect` block's status and * digest, and nothing else. The signature is not verified here and the * claims are not trusted; the authority does that at finalization. What this * reads is what the provider *says*, so the executor can record whether the * provider's account of the effect agrees with its own, which neither party * can tell alone. Null when there is no receipt, or when the value is not a * compact JWS whose payload carries an effect with a status the profile * defines and, when present, a digest in the profile's form. */ export declare function receiptStatement(receipt: string | null | undefined): ReceiptStatement | null; /** * The receipt's statement against this executor's account: the outcome the * provider answered with, the effect the grant authorised, and the effect * the adapter observed. A status that contradicts the outcome is a mismatch * whatever the digest says; a digest is compared with the authorised effect * and, when there is one, with the observation; a receipt that names no * digest can agree with nothing and disagree with nothing, and is `SILENT`. */ export declare function compareReceipt(outcome: "COMMITTED" | "FAILED" | "INDETERMINATE", expectedDigest: string, observedDigest: string | null, statement: ReceiptStatement | null): ReceiptComparison; //# sourceMappingURL=EffectComparison.d.ts.map