FlowGuard API - v1.2.0-rc.2
    Preparing search index...

    Function createPolicySnapshot

    • Create an immutable policy snapshot for embedding in SessionState.

      The snapshot freezes all FlowGuard-critical fields. The hash provides non-repudiation: given the hash and the policy registry, an auditor can verify which exact policy governed a session.

      Parameters

      • policy: FlowGuardPolicy

        The resolved FlowGuard policy.

      • resolvedAt: string

        ISO-8601 timestamp when the policy was frozen.

      • digestFn: (text: string) => string

        SHA-256 digest function (injected for testability).

      • Optionalresolution: {
            requestedMode: PolicyMode;
            effectiveGateBehavior: EffectiveGateBehavior;
            degradedReason?: "ci_context_missing";
            source?: PolicySource;
            resolutionReason?: PolicyResolutionReason;
            centralMinimumMode?: CentralMinimumMode;
            policyDigest?: string;
            policyVersion?: string;
            policyPathHint?: string;
        }

      Returns PolicySnapshot