disclosure
code_context_agent.tools.graph.disclosure ¶
Progressive disclosure for code graph exploration.
This module provides the ProgressiveExplorer class for staged exploration of code graphs, enabling AI agents to: - Start with a high-level overview - Progressively expand from interesting nodes - Navigate by module or path
ProgressiveExplorer ¶
Staged exploration of code graph for AI context generation.
Tracks what has been explored and suggests next steps for progressive disclosure of codebase structure.
Initialize the explorer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph | CodeGraph | The CodeGraph to explore | required |
analyzer | CodeAnalyzer | None | Optional CodeAnalyzer (created if not provided) | None |
Source code in src/code_context_agent/tools/graph/disclosure.py
get_overview ¶
Get high-level codebase structure (Level 0).
Provides entry points, hotspots, modules, and foundations for initial orientation.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with overview information |
Source code in src/code_context_agent/tools/graph/disclosure.py
expand_node ¶
Expand exploration from a specific node (Level 1+).
Uses BFS to discover nodes within the specified depth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id | str | The node to expand from | required |
depth | int | Number of hops to expand | 1 |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with discovered nodes, edges, and suggestions |
Source code in src/code_context_agent/tools/graph/disclosure.py
expand_module ¶
Explore an entire detected module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module_id | int | The module ID from detect_modules() | required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with module details and internal structure |
Source code in src/code_context_agent/tools/graph/disclosure.py
get_path_between ¶
Find shortest path between two nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source | str | Source node ID | required |
target | str | Target node ID | required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with path information |
Source code in src/code_context_agent/tools/graph/disclosure.py
explore_category ¶
Explore all nodes in a business logic category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category | str | Category to explore (e.g., "db", "auth", "http") | required |
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with categorized nodes |
Source code in src/code_context_agent/tools/graph/disclosure.py
get_exploration_status ¶
Get the current exploration status.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | Dictionary with exploration statistics |