/**
 * Per-segment verdict evaluation for Shell AST normalization.
 *
 * Evaluates policy per AST segment, aggregates a final compound verdict,
 * and produces structured denial output with per-segment reasons.
 *
 * Each segment verdict is a runtime contract: callers can inspect which
 * segments were safe vs. unsafe and surface that information to the user.
 *
 * @module normalization/verdict
 */
import type { CommandClassification } from './types.js';
import type { ShellNode, CommandNode } from './ast.js';
/**
 * Default set of classifications permitted for exec commands.
 *
 * Destructive and escalation are excluded; they require explicit user approval.
 * Network commands are allowed because connectivity restrictions are handled
 * by network-scope rules in the evaluator, not at the exec layer.
 */
export declare const DEFAULT_ALLOWED_CLASSES: ReadonlySet<CommandClassification>;
/**
 * The policy verdict for a single command segment.
 *
 * Each verdict is an immutable runtime contract that records why a segment
 * was allowed or denied, making the decision auditable and explainable.
 */
export interface SegmentVerdict {
    /** The raw command string for this segment. */
    raw: string;
    /** Canonical command name. */
    command: string;
    /** Semantic risk classification. */
    classification: CommandClassification;
    /** Whether this segment was allowed by policy. */
    allowed: boolean;
    /**
     * Human-readable reason for the verdict.
     * Always set; describes the policy that matched or the safe classification.
     */
    reason: string;
    /** Whether this segment contains obfuscated content (encoded chars, substitution). */
    hasObfuscation: boolean;
    /** Descriptions of any obfuscation patterns found. */
    obfuscationPatterns: string[];
}
/**
 * The aggregated verdict for a compound command.
 *
 * Contains the overall allow/deny decision plus per-segment records for
 * user-facing denial output and audit logging.
 */
export interface CompoundVerdict {
    /** The original command string. */
    original: string;
    /** Whether the entire compound command is allowed. */
    allowed: boolean;
    /** The highest-risk classification across all segments. */
    highestClassification: CommandClassification;
    /** Per-segment verdict records (in parse order). */
    segments: SegmentVerdict[];
    /**
     * Human-readable denial explanation including per-segment reasons.
     * Only set when `allowed` is false.
     */
    denialExplanation?: string | undefined;
    /** Whether any segment contains obfuscated content. */
    hasObfuscation: boolean;
}
/**
 * Evaluates a single CommandNode against the default policy.
 *
 * @param node           - The command node to evaluate.
 * @param allowedClasses - Classification tiers to allow (defaults to read+write+network).
 * @returns A SegmentVerdict for this node.
 */
export declare function evaluateSegmentNode(node: CommandNode, allowedClasses?: ReadonlySet<CommandClassification>): SegmentVerdict;
/**
 * Builds a structured denial explanation from a list of segment verdicts.
 *
 * Includes the full per-segment breakdown for user-facing output.
 *
 * @param original - The original command string.
 * @param verdicts - All segment verdicts.
 * @returns A multi-line denial explanation string.
 */
export declare function buildDenialExplanation(original: string, verdicts: SegmentVerdict[]): string;
/**
 * Evaluates a ShellNode AST against policy and returns a CompoundVerdict.
 *
 * Safe segments are identified alongside unsafe ones. The compound command
 * is denied if ANY segment is denied.
 *
 * @param original       - The original command string.
 * @param ast            - The parsed ShellNode AST.
 * @param allowedClasses - Classification tiers to allow per segment.
 * @returns A CompoundVerdict with per-segment breakdown.
 */
export declare function evaluateCommandAST(original: string, ast: ShellNode, allowedClasses?: ReadonlySet<CommandClassification>): CompoundVerdict;
//# sourceMappingURL=verdict.d.ts.map