This document provides comprehensive API documentation for ElixirScope, its components, and the Enhanced AST Repository.
- Core ElixirScope API (
ElixirScope) - Configuration Management (
ElixirScope.Config) - Event System (
ElixirScope.Events) - Utilities (
ElixirScope.Utils) - Storage Layer
- Core Logic Layer
- Capture Layer
- RingBuffer (
ElixirScope.Capture.RingBuffer) - Ingestor (
ElixirScope.Capture.Ingestor) - InstrumentationRuntime (
ElixirScope.Capture.InstrumentationRuntime) - AsyncWriter (
ElixirScope.Capture.AsyncWriter) - AsyncWriterPool (
ElixirScope.Capture.AsyncWriterPool) - PipelineManager (
ElixirScope.Capture.PipelineManager) - TemporalBridge (
ElixirScope.Capture.TemporalBridge) - TemporalBridgeEnhancement (
ElixirScope.Capture.TemporalBridgeEnhancement) - EnhancedInstrumentation (
ElixirScope.Capture.EnhancedInstrumentation)
- RingBuffer (
- AST Transformation Layer
- Enhanced AST Repository Layer
- AST Repository Config (
ElixirScope.ASTRepository.Config) - NodeIdentifier (
ElixirScope.ASTRepository.NodeIdentifier) - Parser (
ElixirScope.ASTRepository.Parser) - ASTAnalyzer (
ElixirScope.ASTRepository.ASTAnalyzer) - CFGGenerator (
ElixirScope.ASTRepository.Enhanced.CFGGenerator) - DFGGenerator (
ElixirScope.ASTRepository.Enhanced.DFGGenerator) - CPGBuilder (
ElixirScope.ASTRepository.Enhanced.CPGBuilder) - EnhancedRepository (
ElixirScope.ASTRepository.Enhanced.Repository) - ProjectPopulator (
ElixirScope.ASTRepository.Enhanced.ProjectPopulator) - FileWatcher (
ElixirScope.ASTRepository.Enhanced.FileWatcher) - Synchronizer (
ElixirScope.ASTRepository.Enhanced.Synchronizer) - QueryBuilder (
ElixirScope.ASTRepository.QueryBuilder) - QueryExecutor (
ElixirScope.ASTRepository.QueryExecutor) - RuntimeBridge (
ElixirScope.ASTRepository.RuntimeBridge) - PatternMatcher (
ElixirScope.ASTRepository.PatternMatcher) - MemoryManager (
ElixirScope.ASTRepository.MemoryManager) - TestDataGenerator (
ElixirScope.ASTRepository.TestDataGenerator)
- AST Repository Config (
- Query Engine Layer
- AI Layer
- AI Bridge (
ElixirScope.AI.Bridge) - IntelligentCodeAnalyzer (
ElixirScope.AI.Analysis.IntelligentCodeAnalyzer) - ComplexityAnalyzer (
ElixirScope.AI.ComplexityAnalyzer) - PatternRecognizer (
ElixirScope.AI.PatternRecognizer) - CompileTime Orchestrator (
ElixirScope.CompileTime.Orchestrator) - LLM Client (
ElixirScope.AI.LLM.Client) - LLM Config (
ElixirScope.AI.LLM.Config) - LLM Response (
ElixirScope.AI.LLM.Response) - LLM Providers
- Predictive ExecutionPredictor (
ElixirScope.AI.Predictive.ExecutionPredictor)
- AI Bridge (
- Distributed Layer
- Mix Tasks
- Integration Patterns and Best Practices
- Performance Characteristics and Limitations
- Migration Guide: Basic to Enhanced Repository
The ElixirScope module is the main entry point for interacting with the ElixirScope system.
Starts ElixirScope with the given options.
- Options:
:strategy: Instrumentation strategy (:minimal,:balanced,:full_trace).:sampling_rate: Event sampling rate (0.0 to 1.0).:modules: Specific modules to instrument.:exclude_modules: Modules to exclude.
- Returns:
:okor{:error, term()}. - Example:
ElixirScope.start(strategy: :full_trace)
Stops ElixirScope and all tracing.
- Returns:
:ok. - Example:
ElixirScope.stop()
Gets the current status of ElixirScope, including running state, configuration, stats, and storage usage.
- Returns:
map(). - Example:
status = ElixirScope.status()
Queries captured events based on criteria.
- Query Options:
:pid,:event_type,:since,:until,:limit. - Returns:
[ElixirScope.Events.t()]or{:error, term()}. - Example:
events = ElixirScope.get_events(pid: self(), limit: 100)
Gets the state history for a GenServer process.
- Returns:
[ElixirScope.Events.StateChange.t()]or{:error, term()}. - Example:
history = ElixirScope.get_state_history(pid)
Reconstructs the state of a GenServer at a specific timestamp.
- Returns:
term()or{:error, term()}. - Example:
state = ElixirScope.get_state_at(pid, timestamp)
Gets message flow between two processes.
- Returns:
[ElixirScope.Events.MessageSend.t()]or{:error, term()}. - Example:
messages = ElixirScope.get_message_flow(sender_pid, receiver_pid)
Manually triggers AI analysis of the current codebase.
- Returns:
:okor{:error, term()}. - Example:
ElixirScope.analyze_codebase()
Updates the instrumentation plan at runtime.
- Returns:
:okor{:error, term()}. - Example:
ElixirScope.update_instrumentation(sampling_rate: 0.5)
Checks if ElixirScope is currently running.
- Returns:
boolean(). - Example:
if ElixirScope.running?(), do: ...
Gets the current configuration.
- Returns:
ElixirScope.Config.t()or{:error, term()}. - Example:
config = ElixirScope.get_config()
Updates configuration at runtime for allowed paths.
- Returns:
:okor{:error, term()}. - Example:
ElixirScope.update_config([:ai, :planning, :sampling_rate], 0.8)
Manages loading, validation, and runtime access to ElixirScope configuration.
Starts the configuration server.
- Returns:
GenServer.on_start().
Gets the current complete configuration.
- Returns:
ElixirScope.Config.t().
Gets a specific configuration value by path (list of atoms).
- Returns:
term()ornil. - Example:
sampling_rate = ElixirScope.Config.get([:ai, :planning, :sampling_rate])
Updates allowed configuration paths at runtime.
- Returns:
:okor{:error, term()}. - Example:
ElixirScope.Config.update([:ai, :planning, :sampling_rate], 0.7)
Validates a configuration structure.
- Returns:
{:ok, config}or{:error, reasons}.
Defines core event structures and utilities for serialization.
Creates a new base event with automatic metadata.
- Returns:
ElixirScope.Events.t(). - Example:
event = ElixirScope.Events.new_event(:custom_event, %{detail: "info"})
Serializes an event to binary format.
- Returns:
binary().
Deserializes an event from binary format.
- Returns:
ElixirScope.Events.t().
The module defines various event structs like FunctionEntry, FunctionExit, ProcessSpawn, MessageSend, etc. Each has specific fields relevant to the event type. Consult the source file for detailed struct definitions.
Provides high-performance utilities for timestamps, ID generation, data inspection, and performance measurement.
Generates a high-resolution monotonic timestamp in nanoseconds.
- Returns:
integer().
Generates a wall clock timestamp in nanoseconds.
- Returns:
integer().
Converts a nanosecond timestamp to a human-readable string.
- Returns:
String.t().
Measures execution time of a 0-arity function in nanoseconds.
- Returns:
{result, duration_ns :: integer()}.
Generates a unique, roughly sortable integer ID.
- Returns:
integer().
Generates a unique UUID v4 string for correlation.
- Returns:
String.t().
Extracts the timestamp component from a generated ID.
- Returns:
integer().
Safely inspects a term with size limits.
- Returns:
String.t().
Truncates a term if its binary representation exceeds max_size.
- Returns:
term()or{:truncated, binary_size, type_hint}.
Estimates the memory footprint of a term in bytes.
- Returns:
non_neg_integer().
Measures memory usage before and after executing a 0-arity function.
- Returns:
{result, {memory_before, memory_after, memory_diff}}.
Gets current statistics for a given process.
- Returns:
map().
Gets system-wide performance statistics.
- Returns:
map().
Formats a byte size into a human-readable string (KB, MB, GB).
- Returns:
String.t().
Formats a duration in nanoseconds into a human-readable string (μs, ms, s).
- Returns:
String.t().
Validates if a value is a positive integer.
- Returns:
boolean().
Validates if a value is a percentage (0.0 to 1.0).
- Returns:
boolean().
Validates if a PID exists and is alive.
- Returns:
boolean().
High-performance ETS-based storage for ElixirScope events with multiple indexes.
Creates a new DataAccess instance with ETS tables.
- Options:
:name,:max_events. - Returns:
{:ok, ElixirScope.Storage.DataAccess.t()}or{:error, term()}.
Stores a single event.
- Returns:
:okor{:error, term()}.
Stores multiple events in batch.
- Returns:
{:ok, count_stored}or{:error, term()}.
Retrieves an event by its ID.
- Returns:
{:ok, ElixirScope.Events.event()}or{:error, :not_found}.
Queries events by time range.
- Options:
:limit,:order(:ascor:desc). - Returns:
{:ok, [ElixirScope.Events.event()]}or{:error, term()}.
Queries events by process ID.
- Returns:
{:ok, [ElixirScope.Events.event()]}or{:error, term()}.
Queries events by function (module and function name).
- Returns:
{:ok, [ElixirScope.Events.event()]}or{:error, term()}.
Queries events by correlation ID.
- Returns:
{:ok, [ElixirScope.Events.event()]}or{:error, term()}.
Gets storage statistics (event counts, memory usage, timestamps).
- Returns:
map().
Removes events older than the specified timestamp.
- Returns:
{:ok, count_removed}or{:error, term()}.
Destroys the storage and cleans up ETS tables.
- Returns:
:ok.
(Note: get_events_since/1, event_exists?/1, store_events/1 (simplified arity), get_instrumentation_plan/0, store_instrumentation_plan/1 are utility functions using a default storage instance, typically for simpler internal use or testing.)
A GenServer wrapper around ElixirScope.Storage.DataAccess providing a global, supervised event store. It also provides a compatible store_event/3 API for components expecting it.
Starts the EventStore GenServer.
- Returns:
GenServer.on_start().
Stores a single event using the underlying DataAccess instance.
- Returns:
GenServer.on_start(). (viaGenServer.call)
Queries events using the underlying DataAccess instance.
- Returns:
GenServer.on_start(). (viaGenServer.call)
Gets indexing statistics from the underlying DataAccess instance.
- Returns:
GenServer.on_start(). (viaGenServer.call)
For integration testing, retrieves events directly.
- Returns:
GenServer.on_start(). (viaGenServer.call)
(Note: The ElixirScope.EventStore module is a separate wrapper for ElixirScope.Storage.EventStore providing a simplified store_event/3 API and managing a global default instance. Its API is simpler and primarily for internal use by older components.)
Specialized storage for events with temporal indexing and AST correlation, designed for Cinema Debugger functionality.
Starts a new TemporalStorage process.
- Options:
:name,:max_events,:cleanup_interval. - Returns:
{:ok, pid()}or{:error, term()}.
Stores an event with temporal indexing. Events are expected to be maps with :timestamp, :ast_node_id (optional), :correlation_id (optional), and :data.
- Returns:
:okor{:error, term()}(via GenServer call).
Retrieves events within a time range, ordered chronologically.
- Returns:
{:ok, [event()]}or{:error, term()}.
Gets events associated with a specific AST node ID.
- Returns:
{:ok, [event()]}or{:error, term()}.
Gets events associated with a specific correlation ID.
- Returns:
{:ok, [event()]}or{:error, term()}.
Gets all events in chronological order.
- Returns:
{:ok, [event()]}or{:error, term()}.
Gets storage statistics.
- Returns:
{:ok, map()}or{:error, term()}.
Manages runtime event querying and filtering, bridging RuntimeCorrelator with the main API.
Gets events based on query criteria. Delegates to QueryEngine or RuntimeCorrelator.
- Query Options:
:pid,:event_type,:since,:until,:limit. - Returns:
{:ok, [map()]}or{:error, term()}.
Gets events with a map or function-based query.
- Returns:
{:ok, [map()]}or{:error, term()}.
Gets events for a specific AST node ID (delegates to RuntimeCorrelator).
- Returns:
{:ok, [map()]}or{:error, term()}.
Gets correlation statistics from RuntimeCorrelator.
- Returns:
{:ok, map()}or{:error, term()}.
Manages process state history and temporal queries.
Gets the state history for a GenServer process.
- Returns:
{:ok, [map()]}or{:error, term()}. (Currently returns{:error, :not_implemented_yet}or{:ok, []}if tracking disabled/no events).
Reconstructs the state of a GenServer at a specific timestamp.
- Returns:
{:ok, term()}or{:error, term()}. (Currently reconstructs from most recent:state_changeevent before timestamp).
Checks if state history data is available for a process.
- Returns:
boolean(). (Currently returnsfalse).
Gets state tracking statistics.
- Returns:
{:ok, map()}or{:error, term()}.
Tracks message flows between processes.
Gets message flow between two processes.
- Returns:
{:ok, [map()]}or{:error, term()}. (Correlates send/receive events).
Gets all incoming and outgoing messages for a specific process.
- Returns:
{:ok, map()}or{:error, term()}. (Currently returns{:error, :not_implemented_yet}if tracking disabled).
Gets message flow statistics.
- Returns:
{:ok, map()}or{:error, term()}.
Checks if message tracking is enabled for a process.
- Returns:
boolean(). (Currently returnsfalse).
Enables/disables message tracking for a process.
- Returns:
:okor{:error, term()}. (Currently returns{:error, :not_implemented}).
Manages AI integration and analysis capabilities.
Analyzes the codebase using AI capabilities.
- Returns:
{:ok, map()}or{:error, term()}. (Currently returns{:error, :not_implemented_yet}if AI disabled).
Updates instrumentation configuration based on AI recommendations.
- Returns:
{:ok, map()}or{:error, term()}. (Currently returns{:error, :not_implemented_yet}if AI disabled).
get_statistics() / available?() / get_model_info() / configure(opts) / recommend_instrumentation(modules)
Various functions for AI management. (Currently mostly placeholders or return {:error, :not_implemented}).
High-performance lock-free ring buffer for event ingestion.
Creates a new ring buffer.
- Options:
:size(power of 2),:overflow_strategy(:drop_oldest,:drop_newest,:block),:name. - Returns:
{:ok, ElixirScope.Capture.RingBuffer.t()}or{:error, term()}.
Writes an event to the ring buffer. Critical hot path.
- Returns:
:okor{:error, :buffer_full}.
Reads the next available event from the buffer.
- Returns:
{:ok, event, new_position}or:empty.
Reads multiple events in batch.
- Returns:
{[ElixirScope.Events.event()], new_position}.
Utility functions for buffer management.
Ultra-fast event ingestor, acts as the hot path for event capture.
Manages the shared ring buffer for runtime components.
Ingests a function call event. Optimized for speed.
- Returns:
ingest_result :: :ok | {:error, term()}.
Ingests a function return event.
- Returns:
ingest_result.
Ingests a process spawn event.
- Returns:
ingest_result.
Ingests a message send event.
- Returns:
ingest_result.
Ingests a state change event.
- Returns:
ingest_result.
Ingests a performance metric event.
- Returns:
ingest_result.
Ingests an error event.
- Returns:
ingest_result.
Ingests multiple events in batch.
- Returns:
{:ok, count_ingested}or{:error, term()}.
Creates a pre-configured ingestor function for a specific buffer.
- Returns:
(ElixirScope.Events.event() -> ingest_result).
Measures ingestion performance.
- Returns:
map()with timing statistics.
Validates if ingestion performance meets targets.
- Returns:
:okor{:error, term()}.
(Includes Phoenix, LiveView, Ecto, GenServer, and Distributed specific ingestors like ingest_phoenix_request_start, ingest_liveview_mount_start, etc.)
Runtime API for instrumented code to report events. This module is called by transformed AST.
Reports a function call entry.
- Returns:
correlation_id :: term()ornil.
Reports a function call exit.
- Returns:
:ok.
(Other report_* functions for process spawn, message send, state change, errors, etc. follow a similar pattern.)
These functions are called by AST transformed with EnhancedTransformer and include ast_node_id.
Reports function entry with AST node ID.
- Returns:
:ok.
Reports function exit with AST node ID.
- Returns:
:ok.
Reports a local variable snapshot with AST node correlation.
- Returns:
:ok.
Reports an expression value with AST node correlation.
- Returns:
:ok.
Reports line execution with AST node correlation.
- Returns:
:ok.
(Other AST-specific reporting functions like report_ast_pattern_match, report_ast_branch_execution, report_ast_loop_iteration exist.)
Manage the per-process instrumentation context.
Temporarily disables instrumentation for the current process during fun execution.
Returns metadata for correlating runtime events with AST nodes.
Validates the format of an AST node ID.
- Returns:
{:ok, ast_node_id}or{:error, reason}.
(Includes Phoenix, LiveView, Ecto, GenServer, and Distributed specific reporting functions like report_phoenix_request_start, report_liveview_mount_start, etc. These mirror the Ingestor API but are intended for direct calls from instrumented code.)
Worker process that consumes events from ring buffers, enriches, and processes them. Managed by AsyncWriterPool.
Starts an AsyncWriter worker.
- Config:
:ring_buffer,:batch_size,:poll_interval_ms,:max_backlog. - Returns:
GenServer.on_start().
Management functions for the worker.
Enriches an event with correlation and processing metadata.
- Returns: Enriched
event :: map().
Manages a pool of AsyncWriter processes.
Starts the AsyncWriterPool.
- Config:
:pool_size,:ring_buffer,:batch_size, etc. (passed to workers). - Returns:
GenServer.on_start().
get_state(pid) / scale_pool(pid, new_size) / get_metrics(pid) / get_worker_assignments(pid) / health_check(pid) / stop(pid)
Management functions for the pool.
Supervises Layer 2 asynchronous processing components like AsyncWriterPool.
Starts the PipelineManager supervisor.
- Returns:
Supervisor.on_start().
get_state(pid \\ __MODULE__) / update_config(pid \\ __MODULE__, new_config) / health_check(pid \\ __MODULE__) / get_metrics(pid \\ __MODULE__) / shutdown(pid \\ __MODULE__)
Management functions for the pipeline.
Bridge between InstrumentationRuntime and TemporalStorage for real-time temporal correlation.
Starts the TemporalBridge process.
- Options:
:name,:temporal_storage,:buffer_size,:flush_interval. - Returns:
GenServer.on_start().
Correlates and stores a runtime event with temporal indexing. Called by InstrumentationRuntime.
- Returns:
:okor{:error, term()}(via GenServer cast).
Retrieves events within a time range.
- Returns:
{:ok, [temporal_event()]}or{:error, term()}.
Gets events associated with a specific AST node ID.
- Returns:
{:ok, [temporal_event()]}or{:error, term()}.
Gets events associated with a specific correlation ID.
- Returns:
{:ok, [temporal_event()]}or{:error, term()}.
Management functions.
Reconstructs system state at a specific point in time.
- Returns:
{:ok, map()}or{:error, term()}.
Reconstructs the execution sequence that led to a particular event.
- Returns:
{:ok, [temporal_event()]}or{:error, term()}.
Shows AST nodes active during a specific time window.
- Returns:
{:ok, [ast_node_id()]}or{:error, term()}.
Manages the global registration of the bridge for InstrumentationRuntime.
Extends TemporalBridge with AST integration for AST-aware time-travel debugging.
Starts the TemporalBridgeEnhancement process.
- Options:
:temporal_bridge,:ast_repo,:correlator,:event_store,:enabled. - Returns:
GenServer.on_start().
Reconstructs state with AST context.
- Returns:
{:ok, ast_enhanced_state :: map()}or{:error, term()}.
Gets an AST-aware execution trace for a time range.
- Returns:
{:ok, ast_execution_trace :: map()}or{:error, term()}.
Gets all states associated with a specific AST node ID.
- Returns:
{:ok, [ast_enhanced_state :: map()]}or{:error, term()}.
Shows execution path and state transitions between two AST nodes.
- Returns:
{:ok, execution_flow :: map()}or{:error, term()}.
Management functions.
Integrates AST-correlation for advanced debugging features like structural breakpoints and semantic watchpoints.
Starts the EnhancedInstrumentation process.
- Options:
:ast_repo,:correlator,:enabled,:ast_correlation_enabled. - Returns:
GenServer.on_start().
Controls AST correlation for events.
Sets a breakpoint that triggers on AST patterns.
- Returns:
{:ok, breakpoint_id :: String.t()}or{:error, term()}.
Sets a breakpoint that triggers on variable flow through AST paths.
- Returns:
{:ok, breakpoint_id :: String.t()}or{:error, term()}.
Sets a watchpoint to track variables through AST structure.
- Returns:
{:ok, watchpoint_id :: String.t()}or{:error, term()}.
Breakpoint management and statistics.
These are called by the enhanced AST transformer.
report_enhanced_function_entry(module, function, args, correlation_id, ast_node_id)report_enhanced_function_exit(correlation_id, return_value, duration_ns, ast_node_id)report_enhanced_variable_snapshot(correlation_id, variables, line, ast_node_id)All return:ok.
Core AST transformation engine for injecting basic instrumentation.
Transforms a complete module AST based on the instrumentation plan.
- Returns: Transformed
ast :: Macro.t().
Transforms a single function definition.
- Returns: Transformed
function_ast :: Macro.t().
(Specific transformation functions for GenServer, Phoenix Controller, LiveView callbacks also exist.)
Enhanced AST transformer for granular compile-time instrumentation, providing "Cinema Data".
Transforms AST with enhanced capabilities like local variable capture and expression tracing.
- Returns: Transformed
ast :: Macro.t().
Transforms AST with fine-grained instrumentation based on the plan.
- Returns: Transformed
ast :: Macro.t().
Injects local variable capture at specified lines or after expressions.
- Returns: Transformed
ast :: Macro.t().
Injects expression tracing for specified expressions.
- Returns: Transformed
ast :: Macro.t().
Injects custom debugging logic AST snippets at specified points.
- Returns: Transformed
ast :: Macro.t().
Helper functions for generating AST snippets for instrumentation calls. These are primarily internal to the transformation process.
This layer provides storage and advanced analysis of code, including CFG, DFG, and CPG.
Centralized configuration for AST Repository components.
Gets a configuration value.
- Returns:
term().
Accessor functions for specific configuration values with defaults. Consult the source for a full list.
Returns all AST repository configurations as a map.
Manages generation, parsing, and validation of unique AST Node IDs.
Assigns unique AST node IDs to traversable nodes in an AST, injecting them into node metadata.
- Returns: Transformed
ast :: Macro.t().
Generates a unique AST Node ID based on the node and its context.
- Returns:
ast_node_id :: String.t().
Extracts an AST Node ID from a node's metadata.
- Returns:
ast_node_id :: String.t()ornil.
Parses an AST Node ID string into its constituent parts.
- Returns:
{:ok, map()}or{:error, :invalid_format}.
Alternative traversal for assigning IDs with more path control (often used internally or by TestDataGenerator).
- Returns: Transformed
ast :: Macro.t().
Enhanced AST parser that assigns unique node IDs and extracts instrumentation points. (Note: This refers to the "new" parser logic, potentially integrated into ASTAnalyzer or used by ProjectPopulator).
Assigns unique node IDs to instrumentable AST nodes.
- Returns:
{:ok, enhanced_ast}or{:error, reason}. - Example:
{:ok, enhanced_ast} = Parser.assign_node_ids(original_ast)
Extracts instrumentation points from an AST that has already had node IDs assigned.
- Returns:
{:ok, instrumentation_points :: [map()]}or{:error, reason}.
Builds a map of correlation_id -> ast_node_id.
- Returns:
{:ok, correlation_index :: map()}or{:error, reason}.
Performs comprehensive AST analysis, populating EnhancedModuleData and EnhancedFunctionData.
Analyzes a module's AST.
- Returns:
{:ok, ElixirScope.ASTRepository.EnhancedModuleData.t()}or{:error, term()}.
analyze_function_ast(fun_ast, module_name, fun_name, arity, file_path, ast_node_id_prefix, opts \\ [])
Analyzes a single function's AST.
- Returns:
{:ok, ElixirScope.ASTRepository.EnhancedFunctionData.t()}or{:error, term()}.
(Internal helper functions extract dependencies, attributes, complexities, etc.)
Enhanced Control Flow Graph generator.
Generates a CFG for an Elixir function.
- Options:
:function_key,:include_path_analysis,:max_paths. - Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.CFGData.t()}or{:error, term()}.
Enhanced Data Flow Graph generator using SSA form.
Generates a DFG for an Elixir function. (Note: the code shows generate_dfg/1 and generate_dfg/2, the docs/docs20250527_2/CODE_PROPERTY_GRAPH_DESIGN_ENHANCE/4-dfg_generator.ex shows generate_dfg/3. Assuming the 2-arity is the primary one for the enhanced version).
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.DFGData.t()}or{:error, term()}.
Traces a variable through its data flow. (Note: This function is defined in the older WRITEUP_CURSOR/4-dfg_generator.ex but conceptually belongs here).
- Returns:
{:ok, map()}or{:error, term()}.
Gets all dependencies for a variable.
- Returns:
[String.t()](list of variable names it depends on).
Builds a Code Property Graph by unifying AST, CFG, and DFG.
Builds a CPG for a given function's AST. (Note: the code shows build_cpg/2 taking AST, the older WRITEUP_CURSOR/5-cpg_builder.ex takes EnhancedFunctionData).
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.CPGData.t()}or{:error, term()}.
Queries the CPG for nodes matching specific criteria. (Defined in older WRITEUP_CURSOR/5-cpg_builder.ex).
- Returns:
{:ok, [CPGNode.t()]}or{:error, term()}.
Finds patterns in the CPG based on graph structure. (Defined in older WRITEUP_CURSOR/5-cpg_builder.ex).
- Returns:
{:ok, [map()]}or{:error, term()}.
Central GenServer for storing and managing all enhanced AST-related data (EnhancedModuleData, EnhancedFunctionData, CFG, DFG, CPG).
Starts the EnhancedRepository GenServer.
- Options:
:name,:memory_limit. - Returns:
GenServer.on_start().
Stores enhanced module data with advanced analysis. (Note: This is different from store_module/2 which takes EnhancedModuleData.t()).
- Returns:
GenServer.on_start(). (viaGenServer.call)
Retrieves enhanced module data.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.EnhancedModuleData.t()}or{:error, :not_found}.
Stores enhanced function data with CFG/DFG analysis.
- Returns:
GenServer.on_start(). (viaGenServer.call)
Retrieves enhanced function data.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.EnhancedFunctionData.t()}or{:error, :not_found}.
Generates or retrieves CFG for a function.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.CFGData.t()}or{:error, term()}.
Generates or retrieves DFG for a function.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.DFGData.t()}or{:error, term()}.
Generates or retrieves CPG for a function.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.CPGData.t()}or{:error, term()}.
Performs advanced analysis queries (complexity, security, performance, etc.).
- Returns:
GenServer.on_start(). (viaGenServer.call)
Gets performance metrics for repository analysis operations.
- Returns:
{:ok, map()}.
Populates repository with project AST data using ProjectPopulator.
- Returns:
GenServer.on_start(). (viaGenServer.call)
clear_repository() / get_statistics() / health_check(pid) / get_ast_node(pid, ast_node_id) / find_references(pid, m, f, a) / correlate_event_to_ast(pid, event)
Standard repository management and query functions, adapted for enhanced data.
Populates the Enhanced AST Repository by discovering, parsing, and analyzing project files.
Populates the repository with data from an Elixir project.
- Options:
:include_patterns,:exclude_patterns,:max_file_size,:parallel_processing,:generate_cfg,:generate_dfg,:generate_cpg. - Returns:
{:ok, results_map}or{:error, reason}.results_mapcontains stats about processed files, modules, functions, and duration.
Parses and analyzes a single file. Used by Synchronizer.
- Returns:
{:ok, ElixirScope.ASTRepository.Enhanced.EnhancedModuleData.t()}or{:error, reason}.
Discovers Elixir source files in a project.
- Returns:
{:ok, [String.t()]}or{:error, term()}.
Parses AST from discovered files.
- Returns:
{:ok, [parsed_file_map]}or{:error, term()}.
Analyzes parsed modules with enhanced analysis (CFG, DFG, CPG).
- Returns:
{:ok, %{module_name => EnhancedModuleData.t()}}or{:error, term()}.
Builds dependency graph from analyzed modules.
- Returns:
{:ok, dependency_graph_map}or{:error, term()}.
Real-time file system watcher for the Enhanced AST Repository.
Starts the FileWatcher GenServer.
- Options:
:watch_dirs,:synchronizer(pid of Synchronizer),:debounce_ms. - Returns:
GenServer.on_start().
watch_project(project_path, opts \\ []) / stop_watching() / get_status(pid \\ __MODULE__) / flush_changes() / rescan_project() / update_config(new_opts) / stop(pid \\ __MODULE__) / subscribe(pid \\ __MODULE__, subscriber_pid)
Management and control functions for the file watcher.
Handles incremental synchronization of the Enhanced AST Repository based on file change events.
Starts the Synchronizer GenServer.
- Options:
:repository(pid of Repository),:batch_size. - Returns:
GenServer.on_start().
get_status(pid) / sync_file(pid, file_path) / sync_file_deletion(pid, file_path) / sync_files(pid, file_paths) / stop(pid)
Synchronization and management functions. sync_file and sync_files return {:ok, results_list} or {:error, reason}.
Advanced query builder for the Enhanced AST Repository. (Note: The new version is in lib/elixir_scope/ast_repository/query_builder.ex).
Builds a query structure from a map or keyword list.
- Returns:
{:ok, query_t :: map()}or{:error, term()}. Query includes fields likeselect,from,where,order_by,limit,estimated_cost,optimization_hints.
Executes a query against the repository.
- Returns:
{:ok, query_result :: map()}or{:error, term()}.query_resultincludesdataandmetadata.
Cache management functions.
(Older find_functions(), by_complexity(), calls_mfa(), etc. are ways to construct the query_spec map).
Executes query specifications against the AST Repository. (This module is from CODE_PROPERTY_GRAPH_DESIGN_ENHANCE and might be an internal detail or superseded by direct Repository query functions).
Executes a prepared query specification.
- Returns:
{:ok, results :: list()}or{:error, term()}.
Bridge for InstrumentationRuntime to interact with ASTRepository (primarily for compile-time helpers and potential post-runtime lookup).
Verifies if an ast_node_id is known to the repository.
- Returns:
boolean(). (Conceptual, likely too slow for direct runtime use).
Fetches minimal static context for an AST Node ID. (More for post-runtime processing).
- Returns:
{:ok, map()}or{:error, term()}.
(Conceptual) Notifies repository about an executed AST node.
- Returns:
:ok.
Used by instrumentation tooling at compile-time to get/ensure an AST node ID.
- Returns:
{Macro.t(), String.t() | nil}.
CompileTimeHelpers.prepare_runtime_call_args(original_ast_node_with_id, runtime_function, additional_static_args)
Used by instrumentation tooling at compile-time to prepare arguments for InstrumentationRuntime calls.
- Returns:
Macro.t().
Advanced pattern matcher for AST, behavioral, and anti-patterns.
Starts the PatternMatcher GenServer.
- Returns:
GenServer.on_start().
Matches structural AST patterns.
- Spec:
%{pattern: Macro.t(), confidence_threshold: float(), ...}. - Returns:
{:ok, pattern_result :: map()}or{:error, term()}.pattern_resultcontainsmatches,total_analyzed,analysis_time_ms.
Matches behavioral patterns (OTP, design patterns).
- Spec:
%{pattern_type: atom(), confidence_threshold: float(), ...}. - Returns:
{:ok, pattern_result :: map()}or{:error, term()}.
Matches anti-patterns and code smells.
- Spec:
%{pattern_type: atom(), confidence_threshold: float(), ...}. - Returns:
{:ok, pattern_result :: map()}or{:error, term()}.
Pattern library management and statistics.
Manages memory for the Enhanced AST Repository.
Starts the MemoryManager GenServer.
- Options:
:monitoring_enabled. - Returns:
GenServer.on_start().
Monitors current memory usage.
- Returns:
{:ok, memory_stats :: map()}or{:error, term()}.
Cleans up unused AST data.
- Options:
:max_age,:force,:dry_run. - Returns:
:okor{:error, term()}.
Compresses infrequently accessed analysis data.
- Options:
:access_threshold,:age_threshold,:compression_level. - Returns:
{:ok, compression_stats :: map()}or{:error, term()}.
Configures LRU cache for queries, analysis, or CPGs.
- Options:
:max_entries,:ttl,:eviction_policy. - Returns:
:okor{:error, term()}.
Handles memory pressure situations (:level_1 to :level_4).
- Returns:
:okor{:error, term()}.
Statistics, monitoring control, and manual GC.
Direct cache manipulation functions.
Utilities for generating test fixtures for AST Repository components. This module is for testing purposes.
simple_assignment_ast(var_name, value_ast, meta \\ []) / if_else_ast(...) / case_ast(...) / function_call_ast(...) / block_ast(...)
Generate basic AST snippets.
function_def_ast(type, head_ast, body_ast, meta \\ []) / simple_function_head_ast(...) / module_def_ast(...) / simple_module_name_alias(...)
Generate function and module definition ASTs.
Generates an EnhancedFunctionData struct from AST, assigning Node IDs.
- Returns:
{:ok, ElixirScope.ASTRepository.EnhancedFunctionData.t()}or{:error, term()}.
Generates an EnhancedModuleData struct from module AST.
- Returns:
{:ok, ElixirScope.ASTRepository.EnhancedModuleData.t()}or{:error, term()}.
Generates a complex module AST with multiple functions.
Generates a mock project structure on disk for testing.
- Returns:
root_path :: String.t().
Optimized query engine for event retrieval.
Analyzes a query to determine optimal execution strategy.
- Returns:
ElixirScope.QueryEngine.Engine.t()(struct with strategy info).
Estimates the cost of executing a query.
- Returns:
non_neg_integer()(estimated cost).
Executes a query against the EventStore.
- Returns:
{:ok, [event()]}or{:error, term()}.
Executes a query and returns detailed performance metrics.
- Returns:
{:ok, [event()], metrics :: map()}or{:error, term()}.
Provides optimization suggestions for a query.
- Returns:
[String.t()].
Extends Query Engine to query the Enhanced AST Repository.
Executes a static analysis query against the AST Repository.
- Query:
%{type: ast_query_type(), params: map(), opts: keyword()}. - Returns:
{:ok, results}or{:error, term()}.resultscan be list, map, orCPGData.t().
Combines static AST information with runtime events.
- Returns:
{:ok, correlated_results :: list(map())}or{:error, term()}.
Interface for AI components to access AST Repository and Query Engine.
Fetches full CPG for a function.
- Returns:
{:ok, CPGData.t()}or{:error, term()}.
Finds CPG nodes based on a structural/semantic pattern.
- Returns:
{:ok, [CPGNode.t()]}or{:error, term()}.
get_correlated_features_for_ai(target_type, ids, runtime_event_filters, static_features, dynamic_features)
Retrieves correlated static and dynamic features for AI models.
- Target Type:
:function_keysor:cpg_node_ids. - Returns:
{:ok, list(map())}or{:error, term()}.
(Also defines patterns for AI.CodeAnalyzer, AI.ASTEmbeddings, AI.PredictiveAnalyzer, and LLM interaction.)
AI-powered code analyzer for semantic analysis, quality assessment, and refactoring suggestions.
Starts the IntelligentCodeAnalyzer GenServer.
Analyzes code semantics.
- Returns:
{:ok, analysis_map}(complexity, patterns, semantic_tags, maintainability).
Assesses code quality across multiple dimensions.
- Returns:
{:ok, assessment_map}(overall_score, dimensions, issues).
Generates intelligent refactoring suggestions.
- Returns:
{:ok, [suggestion_map]}.
Identifies design patterns and anti-patterns.
- Returns:
{:ok, %{patterns: list, anti_patterns: list}}.
Gets analyzer statistics.
Analyzes code complexity for modules and functions.
Calculates complexity for a single AST node.
- Returns:
map()(score, nesting_depth, cyclomatic, pattern_match, performance_indicators).
Analyzes complexity for an entire module.
- Returns:
ElixirScope.AI.ComplexityAnalyzer.t()(struct with aggregated complexities).
Determines if code is performance-critical.
- Returns:
boolean().
Analyzes state complexity for stateful modules.
- Returns:
:high | :medium | :low | :none.
Identifies common OTP, Phoenix, and architectural patterns.
Identifies the primary type of a module (e.g., :genserver, :phoenix_controller).
- Returns:
atom().
Extracts patterns and characteristics from module AST.
- Returns:
map()containing callbacks, actions, events, children, strategy, etc.
Orchestrates compile-time AST instrumentation plan generation.
Generates an AST instrumentation plan.
- Target:
module :: atom()or{module, function, arity}. - Opts:
:functions,:capture_locals,:trace_expressions,:granularity. - Returns:
{:ok, plan :: map()}or{:error, term()}.
Generates a plan for on-demand instrumentation of a specific function.
- Returns:
{:ok, plan :: map()}or{:error, term()}.
Gets the current instrumentation plan from DataAccess.
- Returns:
{:ok, plan :: map()}or{:error, :no_plan}.
Analyzes a project and generates/stores a comprehensive instrumentation plan.
- Returns:
{:ok, plan :: map()}or{:error, term()}.
Updates an existing instrumentation plan.
- Returns:
{:ok, plan :: map()}or{:error, term()}.
Analyzes runtime data and suggests plan adjustments.
- Returns:
{:ok, adjusted_plan, suggestions}or{:error, term()}.
Generates a simple instrumentation plan for a given module's code string.
- Returns:
{:ok, plan :: map()}or{:error, term()}.
Validates an instrumentation plan.
- Returns:
{:ok, overall_valid :: boolean(), validation_results :: map()}.
Main interface for interacting with LLM providers. Handles provider selection and fallback.
Analyzes code using the configured LLM.
- Returns:
ElixirScope.AI.LLM.Response.t().
Explains an error using the LLM.
- Returns:
ElixirScope.AI.LLM.Response.t().
Suggests a fix using the LLM.
- Returns:
ElixirScope.AI.LLM.Response.t().
Returns the status of configured LLM providers.
- Returns:
map().
Tests connectivity to the primary LLM provider.
- Returns:
ElixirScope.AI.LLM.Response.t().
Configuration management for LLM providers.
Accessors for provider-specific credentials.
Determines the primary LLM provider based on configuration.
- Returns:
:vertex | :gemini | :mock.
Returns the fallback provider (always :mock).
get_gemini_base_url() / get_vertex_base_url() / get_gemini_model() / get_vertex_model() / get_request_timeout()
Accessors for provider URLs, models, and request timeout.
Checks if configuration is valid for a given provider.
- Returns:
boolean().
Returns a map of current LLM configuration (API keys masked).
Standardized response struct for all LLM provider interactions.
Creates a successful response.
- Returns:
ElixirScope.AI.LLM.Response.t().
Creates an error response.
- Returns:
ElixirScope.AI.LLM.Response.t().
Utility functions for inspecting responses.
(ElixirScope.AI.LLM.Providers.Gemini, Vertex, Mock)
These modules implement the ElixirScope.AI.LLM.Provider behaviour. Their public API matches the callbacks defined in the behaviour: analyze_code/2, explain_error/2, suggest_fix/2, provider_name/0, configured?/0, test_connection/0.
Predicts execution paths, resource usage, and concurrency impacts.
Starts the ExecutionPredictor GenServer.
Predicts execution path for a function call.
- Returns:
{:ok, prediction_map}or{:error, term()}. Prediction map includes:predicted_path,:confidence,:alternatives,:edge_cases.
Predicts resource usage for an execution context.
- Context:
%{function: atom(), input_size: integer(), ...}. - Returns:
{:ok, resources_map}(memory, cpu, io, execution_time, confidence).
Analyzes concurrency bottlenecks and scaling factors.
- Signature:
{module, function, arity}orfunction_name_atom. - Returns:
{:ok, impact_map}(bottleneck_risk, recommended_pool_size, scaling_factor).
Model training, batch prediction, and statistics.
Distributed global clock for event synchronization using hybrid logical clocks.
Starts the GlobalClock GenServer.
Gets the current logical timestamp {logical_time, wall_time, node_id}.
- Returns:
timestamp :: tuple()orfallback_timestamp :: integer().
Updates the clock with a timestamp from another node (GenServer cast).
Synchronizes the clock with all known cluster nodes (GenServer cast).
Initializes the cluster with a list of nodes (GenServer cast).
Gets the current state of the global clock (GenServer call).
Synchronizes events across distributed ElixirScope nodes.
Synchronizes events with all nodes in the cluster.
- Returns:
{:ok, sync_results :: list()}.
Synchronizes events with a specific node.
- Returns:
{:ok, count_received}or{:error, {target_node, reason}}.
Handles incoming synchronization requests from other nodes (typically called via RPC).
- Returns:
{:ok, local_events_for_sync}or{:error, term()}.
Forces a full synchronization with all cluster nodes.
Coordinates ElixirScope tracing across multiple BEAM nodes.
Starts the NodeCoordinator GenServer.
Sets up the ElixirScope cluster with the given list of node names.
Cluster management, event synchronization, and distributed query execution functions (GenServer calls).
Mix compiler that transforms Elixir ASTs to inject ElixirScope instrumentation.
The main entry point for the Mix compiler task.
- Returns:
{:ok, []}on success, or{:error, [reason]}on failure.
Publicly accessible function (primarily for tests) to transform an AST directly with a given plan.
- Returns: Transformed
ast :: Macro.t().
- Initialization: Start
ElixirScopeearly in your application's lifecycle, typically inapplication.ex.def start(_type, _args) do children = [ ElixirScope, # Start ElixirScope and its supervision tree # ... your other application children ] Supervisor.start_link(children, strategy: :one_for_one) end
- Configuration: Configure ElixirScope via
config/config.exs(and environment-specific files). Pay attention to:default_strategyand:sampling_ratefor performance tuning. - AST Repository: For applications requiring deep static analysis, ensure the
ProjectPopulatoris run (e.g., via a Mix task or on application start in dev/test) to populate theEnhancedRepository. TheFileWatchercan keep it synchronized. - Event Ingestion: The
InstrumentationRuntimeis the primary interface for instrumented code. It's designed for high performance. Events flow throughIngestortoRingBuffer, then processed byAsyncWriterPooland stored byStorage.DataAccess(viaStorage.EventStore). - Temporal Debugging:
TemporalBridgeandTemporalStorageenable time-travel features.TemporalBridgeEnhancementlinks this with AST data fromEnhancedRepositoryviaRuntimeCorrelator. - Querying: Use
ElixirScope.get_events/1for basic runtime event queries. For advanced static/dynamic correlated queries, useElixirScope.QueryEngine.ASTExtensionswhich interacts withEnhancedRepositoryandQueryEngine.Engine. TheQueryBuildercan help construct complex query specifications. - AI Analysis: Interact with AI components like
IntelligentCodeAnalyzerfor insights.CompileTime.Orchestratoruses these to generate instrumentation plans. - Custom Instrumentation: While ElixirScope aims for automatic instrumentation, specific needs can be met by manually calling
InstrumentationRuntime.report_*functions, especially the AST-aware variants ifast_node_ids are available. - Performance: Monitor ElixirScope's overhead using
ElixirScope.status()andElixirScope.ASTRepository.MemoryManager.get_stats(). Adjust sampling rates and instrumentation strategies as needed.
- Event Ingestion: Designed for >100k events/sec.
InstrumentationRuntimecalls aim for sub-microsecond overhead when disabled, and low single-digit microsecond overhead when enabled. - AST Repository:
- Module storage: Target <10ms (Enhanced: <50ms for complex).
- CFG/DFG/CPG Generation: Can be resource-intensive. Targets are <100ms (CFG), <200ms (DFG), <500ms (CPG) per typical function/module. Very large or complex code units will take longer.
- Query Response: Target <100ms (Enhanced: <50ms) for 95th percentile of common queries. Complex CPG graph pattern queries can be slower.
- Memory Usage:
- Base ElixirScope: Aims for minimal constant overhead.
- RingBuffers: Configurable, bounded memory.
- EventStore/DataAccess: Memory usage proportional to the number of events stored in ETS.
- AST Repository: Target <500MB for 1000 modules.
MemoryManagerhelps control this.
- AI Components: Performance varies. LLM interactions involve network latency. Local analysis (Complexity, PatternRecognizer) is faster.
- Metaprogramming: Deep analysis of heavily metaprogrammed code (macros generating significant code structures at compile time) can be challenging. CPGs may represent the expanded code.
- Inter-Process Communication (IPC) across non-ElixirScope nodes: Full tracing of IPC may be limited if remote nodes are not also running ElixirScope or a compatible tracing agent. Distributed features (
ElixirScope.Distributed.*) address this within an ElixirScope cluster. - Large Codebases: While designed for scalability, extremely large codebases (e.g., 5000+ modules) might strain default memory limits or increase analysis times. Configuration tuning and potentially sampling of analysis might be needed.
- Runtime Overhead: While minimized, full tracing (
:full_tracestrategy with 1.0 sampling) will have noticeable overhead, especially in performance-sensitive applications. Use:balancedor:minimalstrategies with appropriate sampling in production. - AI Model Dependency: LLM-based features depend on external API availability and performance, and may incur costs.
- AST Node ID Stability: While efforts are made for stability, significant code refactorings (e.g., moving large blocks of code, major function signature changes) can alter AST Node IDs, potentially orphaning old runtime data from new static analysis.
- Current Implementation Status: Some advanced features (e.g., full inter-procedural DFG/CPG, some AI predictions) are still under development or in early stages. The documentation reflects the intended API surface and capabilities.
Migrating from a conceptual "basic" AST repository to the "Enhanced AST Repository" involves several considerations:
-
Data Structures:
ElixirScope.ASTRepository.ModuleData->ElixirScope.ASTRepository.Enhanced.EnhancedModuleData: The enhanced version stores the full AST, detailed function analyses (including CFG, DFG, CPG links), comprehensive dependencies, OTP pattern info, and richer metrics.ElixirScope.ASTRepository.FunctionData->ElixirScope.ASTRepository.Enhanced.EnhancedFunctionData: The enhanced version includes fields for CFG, DFG, CPG data, detailed variable tracking, call graphs, and more granular complexity/quality metrics.- New Structures: The enhanced system introduces many new data structures for CFG, DFG, CPG nodes/edges, complexity metrics, scope info, variable versions, etc., primarily within the
ElixirScope.ASTRepository.Enhanced.*andElixirScope.ASTRepository.Enhanced.SupportingStructures.*namespaces.
-
Core Repository API:
- The primary GenServer is now
ElixirScope.ASTRepository.Enhanced.Repository. store_module/2andstore_function/2now expect the enhanced data structures.- New functions exist for storing/retrieving CFG, DFG, CPG data specifically (e.g.,
EnhancedRepository.get_cfg/3). - The
EnhancedRepositoryhas more specialized query functions beyond basicget_module/2orget_function/3.
- The primary GenServer is now
-
Analysis Workflow:
- Old: Basic parsing, limited metadata extraction.
- New:
Parser.assign_node_ids(orNodeIdentifier) assigns stable IDs to AST nodes.ASTAnalyzerpopulatesEnhancedModuleDataandEnhancedFunctionDatawith detailed static analysis.CFGGenerator,DFGGenerator,CPGBuilder(all from theEnhancednamespace) generate their respective graphs, which are then linked or stored withinEnhancedFunctionDataor queried separately.ProjectPopulator(enhanced version) orchestrates this for an entire project.FileWatcherandSynchronizer(enhanced versions) keep the repository up-to-date incrementally.
-
Querying:
- Old: Basic lookups by module/function name.
- New:
QueryBuilderhelps construct complex queries for static data.QueryExecutorprocesses these queries against theEnhancedRepository.QueryEngine.ASTExtensionsallows correlated queries combining static data fromEnhancedRepositorywith runtime event data.
-
Runtime Correlation:
- Old: May have relied on simpler correlation mechanisms.
- New:
RuntimeCorrelatorusesast_node_ids (embedded in instrumented code byEnhancedTransformerusingNodeIdentifier) to link runtime events directly to specific AST/CPG nodes stored inEnhancedRepository.TemporalBridgeEnhancementleverages this for AST-aware time-travel.
-
Key Benefits of Migration:
- Deep Code Understanding: CFG, DFG, and CPG enable much deeper analysis than AST alone.
- Precise Runtime Correlation: Linking runtime events to exact AST nodes.
- Advanced Debugging: Features like structural/data-flow breakpoints and semantic watchpoints become possible.
- Enhanced AI Capabilities: Richer static context for AI-driven analysis, predictions, and recommendations.
- Improved Querying: More powerful and specific queries on code structure and properties.
Migration Steps (Conceptual):
- Update Dependencies: Ensure all ElixirScope components are using the "Enhanced" versions of AST repository modules.
- Adapt Data Storage: If custom storage solutions were used, they need to accommodate the new
EnhancedModuleDataandEnhancedFunctionDatastructures, or rely onEnhancedRepository's ETS tables. - Modify Analysis Pipeline: Update any custom code analysis or project processing logic to use
ProjectPopulator,ASTAnalyzer, and the new graph generators. - Update Instrumentation: If custom AST transformation was done, it needs to be updated to use
NodeIdentifierfor ID generation and ensureEnhancedTransformeris used for injecting calls withast_node_ids. - Revise Query Logic: Update any code that queries AST information to use
QueryBuilderandQueryEngine.ASTExtensionsor the direct API ofEnhancedRepository. - Test Thoroughly: Ensure all integrations function correctly with the new data structures and APIs.