import type { ClassifyResult, ExpandResult, ProjectConfig } from "../../types/index.js";
import type { KnowledgeIndexManager } from "../../knowledge/index_manager.js";
import type { IntentRouteDecision } from "./intent_router.js";
import type { InputMaterial, IngestionEvidence, PromptInjectionPlan } from "./input_material_contract_registry.js";
import type { OutputArtifact } from "../contracts/artifact_contract_registry.js";
import type { DataSensitivityLabel, RedactionRecord, PrivacyGovernanceFinding } from "../audit/privacy_secret_contract.js";
import type { resolveWorkflow } from "../workflow/workflow_contract_registry.js";
/**
 * sf_expand pipeline — 将上帝函数拆分为可独立测试的阶段。
 *
 * 每个阶段接收共享上下文，返回可能修改后的上下文 + 可选的 early-stop。
 * expand() 仍然是编排入口，但逐步迁出逻辑到独立 stage 函数中。
 */
export interface ExpandPipelineContext {
    intent: string;
    classification: ClassifyResult;
    projectPath: string;
    config: ProjectConfig;
    knowledgeIndex: KnowledgeIndexManager;
    routeDecision?: IntentRouteDecision;
    task_id?: string;
    safeIntent?: string;
    safeGoal?: string;
    phasePolicy?: ExpandRoutePhasePolicy;
    outputArtifactRecord?: OutputArtifact;
    inputMaterials?: InputMaterial[];
    ingestionEvidences?: IngestionEvidence[];
    promptInjectionPlan?: PromptInjectionPlan;
    privacyLabels?: DataSensitivityLabel[];
    privacyRedactions?: RedactionRecord[];
    privacyFindings?: PrivacyGovernanceFinding[];
    workflowContract?: ReturnType<typeof resolveWorkflow>;
    workflowGovernanceFindings?: Array<{
        severity: string;
        rule: string;
        message: string;
    }>;
}
export interface ExpandPipelineStageResult {
    context: ExpandPipelineContext;
    stop?: ExpandResult;
}
export interface ExpandPipelineStage {
    name: string;
    run(context: ExpandPipelineContext): Promise<ExpandPipelineStageResult> | ExpandPipelineStageResult;
}
export interface ExpandPipelineResult {
    context: ExpandPipelineContext;
    stopped_by?: string;
    stop?: ExpandResult;
}
export interface ExpandRoutePhasePolicy {
    route?: string;
    execution_shape?: string;
    mutation_allowed: boolean;
    lightweight: boolean;
    read_only_verification: boolean;
    skip_workflow_contract_strict: boolean;
    skip_input_material_hard_block: boolean;
    skip_project_knowledge_hard_block: boolean;
    skip_heavy_contract_gates: boolean;
    skip_pre_implementation_gates: boolean;
}
export declare function createExpandPipeline(stages: ExpandPipelineStage[]): ExpandPipelineStage;
export declare function runExpandPipeline(context: ExpandPipelineContext, stages: ExpandPipelineStage[]): Promise<ExpandPipelineResult>;
export declare function createExpandRoutePhasePolicy(routeDecision: IntentRouteDecision | undefined): ExpandRoutePhasePolicy;
export interface PrivacyGateOutput {
    safeIntent: string;
    safeGoal: string;
    privacyLabels: DataSensitivityLabel[];
    privacyRedactions: RedactionRecord[];
    privacyFindings: PrivacyGovernanceFinding[];
    hardFail: boolean;
    blockedSources: string[];
}
export declare function computePrivacyGate(deps: {
    intent: string;
    routeDecision?: IntentRouteDecision;
    inputMaterials?: Array<{
        path?: string;
    }>;
    phasePolicy: ExpandRoutePhasePolicy;
    evaluatePrivacyGate: (input: {
        intent: string;
        input_materials: Array<{
            path_or_ref: string;
        }>;
    }) => {
        labels: DataSensitivityLabel[];
        redaction_records: RedactionRecord[];
        findings: PrivacyGovernanceFinding[];
        blocked_sources: string[];
        hard_fail: boolean;
        redacted_text?: string;
    };
    redactSensitiveText: (text: string, label: string) => {
        redacted: string;
    };
}): PrivacyGateOutput;
export interface InputMaterialValidationResult {
    blocked: boolean;
    blockReason?: string;
    forbiddenPaths?: string[];
    confirmationNeeded?: string[];
    inputMaterials: InputMaterial[];
    ingestionEvidences: IngestionEvidence[];
    promptInjectionPlan?: PromptInjectionPlan;
    contractNotes: string[];
}
export declare function validateInputMaterials(deps: {
    routeDecision?: IntentRouteDecision;
    skipInputMaterialHardBlock: boolean;
    confirmations?: string[];
    createInputMaterial: (input: {
        path_or_ref: string;
    }) => InputMaterial;
    createIngestionEvidence: (m: InputMaterial) => IngestionEvidence;
    buildPromptInjectionPlan: (materials: InputMaterial[], evidences: IngestionEvidence[]) => PromptInjectionPlan;
    normalizePathCandidate: (p: string) => string;
    classifyIngestionStatus: (path: string) => string;
}): InputMaterialValidationResult;
//# sourceMappingURL=expand_pipeline.d.ts.map