/** * Atlas Rebuild - Deterministic graph construction from Frames * * Rebuilds the Atlas graph structure deterministically when new Frames are ingested. * Atlas represents the knowledge graph connecting work sessions (Frames) based on * module scope overlap and temporal proximity. */ import type { Frame } from "../types/frame.js"; /** * Atlas node representing a Frame in the knowledge graph */ export interface AtlasNode { frameId: string; timestamp: string; moduleScope: string[]; branch: string; } /** * Atlas edge representing relationship between two Frames */ export interface AtlasEdge { from: string; to: string; weight: number; reason: "module_overlap" | "temporal_proximity" | "branch_relation"; } /** * Atlas graph structure - the complete knowledge graph of Frames */ export interface Atlas { nodes: AtlasNode[]; edges: AtlasEdge[]; metadata: { buildTimestamp: string; frameCount: number; edgeCount: number; }; } /** * Rebuild Atlas graph from a collection of Frames * * Algorithm: * 1. Sort Frames by ID for deterministic ordering * 2. Create nodes for each Frame * 3. Build edges based on: * - Module scope overlap (shared modules) * - Temporal proximity (frames close in time) * - Branch relationships (same branch) * 4. Return deterministic Atlas structure * * Deterministic guarantee: Same input Frames (regardless of order) → Identical Atlas * * @param frames - Array of Frames to build Atlas from * @returns Atlas graph structure */ export declare function rebuildAtlas(frames: Frame[]): Atlas;