import type { ConstraintFacet, ConstraintStatus } from '../types/gateway.js'; /** A facet evaluation snapshot — facet name + its status */ export interface FacetSnapshot { facet: ConstraintFacet; status: ConstraintStatus; } /** Result of a narrowing check */ export interface NarrowingCheckResult { valid: boolean; /** Facets where data attempted to widen authority */ violations: Array<{ facet: ConstraintFacet; before: ConstraintStatus; after: ConstraintStatus; message: string; }>; } /** Assert that data influence only narrows authority. * Compares constraint evaluations BEFORE and AFTER data is considered. * Any facet that moves from a more restrictive status to a more * permissive one is a violation — data attempted to widen authority. * * @param before - Facet evaluations before data influence * @param after - Facet evaluations after data influence * @returns NarrowingCheckResult with any violations */ export declare function assertDataNarrowsOnly(before: FacetSnapshot[], after: FacetSnapshot[]): NarrowingCheckResult; /** Apply data-sourced constraint modifications safely. * Only allows narrowing (making more restrictive). * Returns the narrowed snapshots with any widening attempts rejected. * * Use case: a data source declares "this data requires scope:read_only" * → the constraint is narrowed. But if data declares "grant scope:admin" * → the widening is rejected and the original constraint stands. */ export declare function applyDataConstraints(current: FacetSnapshot[], dataInfluence: FacetSnapshot[]): { result: FacetSnapshot[]; rejected: NarrowingCheckResult['violations']; }; /** Check if a status transition is valid narrowing (same or more restrictive) */ export declare function isValidNarrowing(before: ConstraintStatus, after: ConstraintStatus): boolean; /** The status ordering: fail < unknown < not_applicable < pass. * Exported for test vectors and cross-language verification. */ export declare const NARROWING_ORDER: Record; //# sourceMappingURL=data-narrowing.d.ts.map