/**
 * DecisionGraph — Unified Data Model (ADR-033)
 *
 * Canonical shared data model for every pipeline execution.
 * A directed acyclic graph (DAG) where nodes are data artifacts
 * and edges represent derivation relationships.
 *
 * Features:
 *   - Typed node/edge CRUD with schema validation
 *   - Append-only version history (originals preserved)
 *   - Automatic edge creation from derivedFrom references
 *   - Graph lifecycle management (created → accumulated → sealed)
 *   - Compound querying with pagination
 *   - Semantic search on summary fields
 *   - JSON file persistence + AgentDB memory sync
 *   - Concurrent-safe writes via monotonic timestamps
 *   - Statistics and metrics aggregation
 */
import type { DecisionGraphNode, DecisionGraphEdge, DecisionNodeType, EdgeRelation, PassNumber, AgentRef } from './types.js';
/** All valid DecisionNodeType values as a runtime-accessible object. */
export declare const DECISION_NODE_TYPES: {
    readonly PROBLEM_DEFINITION: "problem_definition";
    readonly BUSINESS_CONTEXT: "business_context";
    readonly TECHNICAL_SCOPE: "technical_scope";
    readonly ARCHITECTURE_HYPOTHESIS: "architecture_hypothesis";
    readonly EXECUTION_PLAN: "execution_plan";
    readonly DECISION_LINEAGE: "decision_lineage";
    readonly SCENARIO: "scenario";
    readonly RISK_SIGNAL: "risk_signal";
    readonly RELIABILITY_REPORT: "reliability_report";
    readonly SYSTEM_ARCHITECTURE: "system_architecture";
    readonly INTEGRATION_MAP: "integration_map";
    readonly DATA_FLOW: "data_flow";
    readonly SERVICE_BOUNDARY: "service_boundary";
    readonly PROTOTYPE: "prototype";
    readonly API_CONTRACT: "api_contract";
    readonly SDK_INTERFACE: "sdk_interface";
    readonly SECURITY_ANALYSIS: "security_analysis";
    readonly COMPLIANCE_REPORT: "compliance_report";
    readonly COST_MODEL: "cost_model";
    readonly GOVERNANCE_REPORT: "governance_report";
    readonly POLICY_ANALYSIS: "policy_analysis";
    readonly EXECUTIVE_MEMO: "executive_memo";
    readonly EXECUTIVE_SUMMARY: "executive_summary";
    readonly RISK_ASSESSMENT: "risk_assessment";
    readonly IMPLEMENTATION_ROADMAP: "implementation_roadmap";
    readonly ORG_IMPACT: "org_impact";
    readonly STAKEHOLDER_MAP: "stakeholder_map";
    readonly KPI_DEFINITION: "kpi_definition";
    readonly OKR_ALIGNMENT: "okr_alignment";
    readonly RAID_LOG: "raid_log";
    readonly CONFIDENCE_SCORE: "confidence_score";
    readonly DEPLOYMENT_ENDPOINT: "deployment_endpoint";
    readonly INTEGRATION_RESULT: "integration_result";
    readonly TELEMETRY_CONFIG: "telemetry_config";
    readonly HEALTH_CHECK: "health_check";
    readonly LEARNED_PATTERN: "learned_pattern";
    readonly PROVENANCE_MANIFEST: "provenance_manifest";
};
/** Set of all valid node type values for runtime validation. */
export declare const VALID_NODE_TYPES: ReadonlySet<string>;
/** All valid EdgeRelation values as a runtime-accessible object. */
export declare const EDGE_RELATIONS: {
    readonly DERIVED_FROM: "derived_from";
    readonly INFORMS: "informs";
    readonly VALIDATES: "validates";
    readonly SUPERSEDES: "supersedes";
    readonly AGGREGATES: "aggregates";
};
/** Set of all valid edge relation values for runtime validation. */
export declare const VALID_EDGE_RELATIONS: ReadonlySet<string>;
/** Lifecycle states for the DecisionGraph. */
export type GraphLifecycle = 'created' | 'accumulated' | 'sealed' | 'queryable';
/** A snapshot of a node at a specific version. */
export interface NodeVersionEntry {
    readonly version: number;
    readonly timestamp: string;
    readonly content: Record<string, unknown>;
    readonly summary: string;
    readonly status: DecisionGraphNode['status'];
    readonly confidence: number;
}
/** Compound query filter for nodes. */
export interface NodeQuery {
    readonly type?: DecisionNodeType;
    readonly pass?: PassNumber;
    readonly tag?: string;
    readonly status?: DecisionGraphNode['status'];
    readonly domain?: string;
    readonly agent?: string;
    readonly minConfidence?: number;
}
/** Pagination options for query results. */
export interface PaginationOptions {
    readonly offset?: number;
    readonly limit?: number;
}
/** Paginated query result. */
export interface PaginatedResult<T> {
    readonly items: readonly T[];
    readonly total: number;
    readonly offset: number;
    readonly limit: number;
    readonly hasMore: boolean;
}
/** Aggregate statistics for the graph. */
export interface GraphStatistics {
    readonly executionId: string;
    readonly lifecycle: GraphLifecycle;
    readonly nodeCount: number;
    readonly edgeCount: number;
    readonly nodesByPass: Readonly<Record<number, number>>;
    readonly nodesByType: Readonly<Record<string, number>>;
    readonly nodesByStatus: Readonly<Record<string, number>>;
    readonly averageConfidence: number;
    readonly completenessRatio: number;
}
/** Structured node validation error. */
export interface NodeValidationError {
    readonly field: string;
    readonly message: string;
}
export declare class DecisionGraph {
    private readonly nodes;
    private readonly edges;
    private readonly versionHistory;
    private readonly executionId;
    private readonly outputDir;
    private lifecycle;
    private writeSequence;
    constructor(executionId: string, outputDir: string);
    /** Get the execution ID. */
    getExecutionId(): string;
    /** Get the current lifecycle state. */
    getLifecycle(): GraphLifecycle;
    /** Transition to accumulated state (called after first node beyond root). */
    markAccumulated(): void;
    /** Seal the graph — no further writes allowed. */
    seal(): void;
    /** Mark as queryable — sealed + available for external queries. */
    markQueryable(): void;
    /** Check if the graph accepts writes. */
    isWritable(): boolean;
    /** Generate a new unique node ID. */
    generateNodeId(): string;
    /**
     * Generate the canonical AgentDB memory key for a node.
     * Format: decisiongraph:{execution_id}:{node_id}
     */
    memoryKey(nodeId: string): string;
    /** Validate a node against the schema. Returns errors (empty = valid). */
    validateNode(node: DecisionGraphNode): readonly NodeValidationError[];
    /** Add a validated node to the graph. Throws on validation failure. */
    addNode(node: DecisionGraphNode): void;
    /**
     * Update an existing node (ADR-033: append-only history).
     * Original content is preserved in version history.
     * Increments version and updates timestamp.
     */
    updateNode(nodeId: string, updates: Partial<Pick<DecisionGraphNode, 'content' | 'summary' | 'status' | 'confidence' | 'tags'>>): DecisionGraphNode;
    /** Get a node by ID. Returns undefined if not found. */
    getNode(nodeId: string): DecisionGraphNode | undefined;
    /** Get all nodes of a specific type. */
    getNodesByType(type: DecisionNodeType): readonly DecisionGraphNode[];
    /** Get all nodes from a specific pass. */
    getNodesByPass(pass: PassNumber): readonly DecisionGraphNode[];
    /** Get all nodes produced by a specific agent. */
    getNodesByAgent(domain: string, agent: string): readonly DecisionGraphNode[];
    /** Get all nodes matching a tag. */
    getNodesByTag(tag: string): readonly DecisionGraphNode[];
    /** Get total node count. */
    get nodeCount(): number;
    /** Get total edge count. */
    get edgeCount(): number;
    /** Get all nodes as an array. */
    getAllNodes(): readonly DecisionGraphNode[];
    /** Get all edges as an array. */
    getAllEdges(): readonly DecisionGraphEdge[];
    /**
     * Query nodes with compound filters and optional pagination.
     * All filter fields are ANDed together.
     */
    queryNodes(filter: NodeQuery, pagination?: PaginationOptions): PaginatedResult<DecisionGraphNode>;
    /**
     * Search nodes by text similarity on the summary field.
     * Uses simple token overlap scoring (production systems would use
     * vector embeddings via AgentDB HNSW — this provides the interface).
     */
    searchBySummary(query: string, topK?: number): readonly DecisionGraphNode[];
    /** Add an edge to the graph with validation. */
    addEdge(from: string, to: string, relation: EdgeRelation): void;
    /** Get all edges from a specific node. */
    getEdgesFrom(nodeId: string): readonly DecisionGraphEdge[];
    /** Get all edges to a specific node. */
    getEdgesTo(nodeId: string): readonly DecisionGraphEdge[];
    /** Get all edges with a specific relation. */
    getEdgesByRelation(relation: EdgeRelation): readonly DecisionGraphEdge[];
    /** Get the full derivation chain for a node (all ancestors, depth-first). */
    getDerivationChain(nodeId: string): readonly DecisionGraphNode[];
    /** Get the immediate children of a node (nodes that derive from it). */
    getChildren(nodeId: string): readonly DecisionGraphNode[];
    /** Get the full version history for a node. */
    getVersionHistory(nodeId: string): readonly NodeVersionEntry[];
    /** Get a specific version of a node's content. */
    getNodeAtVersion(nodeId: string, version: number): NodeVersionEntry | undefined;
    /** Create and add a node with minimal boilerplate. Auto-tags with pass/type/agent. */
    createNode(params: {
        type: DecisionNodeType;
        name: string;
        content: Record<string, unknown>;
        summary: string;
        producedBy: AgentRef;
        pass: PassNumber;
        derivedFrom?: readonly string[];
        confidence?: number;
        status?: DecisionGraphNode['status'];
        tags?: readonly string[];
    }): DecisionGraphNode;
    /** Compute aggregate statistics for the graph. */
    getStatistics(): GraphStatistics;
    /** Serialize the graph to JSON (includes version history). */
    toJSON(): {
        executionId: string;
        lifecycle: GraphLifecycle;
        nodes: DecisionGraphNode[];
        edges: DecisionGraphEdge[];
        versionHistory: Record<string, NodeVersionEntry[]>;
        writeSequence: number;
    };
    /** Persist the graph to the output directory. */
    persist(): string;
    /** Load a previously persisted graph (rehydrates lifecycle, history, sequence). */
    static load(executionId: string, outputDir: string): DecisionGraph;
    /** Generate a human-readable summary of the graph. */
    summarize(): string;
}
//# sourceMappingURL=decision-graph.d.ts.map