codeboarding 0.14.0__tar.gz → 0.14.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codeboarding-0.14.0/codeboarding.egg-info → codeboarding-0.14.2}/PKG-INFO +8 -5
- {codeboarding-0.14.0 → codeboarding-0.14.2}/PYPI.md +7 -4
- {codeboarding-0.14.0 → codeboarding-0.14.2}/README.md +21 -6
- {codeboarding-0.14.0 → codeboarding-0.14.2/codeboarding.egg-info}/PKG-INFO +8 -5
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding.egg-info/SOURCES.txt +1 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/commands/full_analysis.py +13 -10
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/analysis.py +12 -19
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/__init__.py +4 -4
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/analysis_json.py +1 -1
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/diagram_generator.py +9 -9
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/io_utils.py +3 -7
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/run_context.py +2 -2
- {codeboarding-0.14.0 → codeboarding-0.14.2}/github_action.py +8 -6
- codeboarding-0.14.2/health_main.py +152 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/main.py +1 -1
- {codeboarding-0.14.0 → codeboarding-0.14.2}/pyproject.toml +1 -1
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/__init__.py +3 -2
- codeboarding-0.14.2/telemetry/__init__.py +11 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/telemetry/events.py +3 -3
- {codeboarding-0.14.0 → codeboarding-0.14.2}/telemetry/schemas.py +2 -2
- {codeboarding-0.14.0 → codeboarding-0.14.2}/telemetry/service.py +32 -18
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_cli_parser.py +85 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_github_action.py +21 -17
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_main.py +21 -17
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_telemetry_events.py +9 -6
- codeboarding-0.14.2/tests/test_telemetry_service.py +205 -0
- codeboarding-0.14.0/telemetry/__init__.py +0 -10
- codeboarding-0.14.0/tests/test_telemetry_service.py +0 -99
- {codeboarding-0.14.0 → codeboarding-0.14.2}/LICENSE +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/agent_responses.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/change_status.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/component_ownership.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/constants.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/content_hash.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/file_index_models.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/incremental_results.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/llm_config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/llm_errors.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/llm_renderers/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/llm_renderers/call_graph.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/llm_renderers/scope.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/model_capabilities.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/planner_agent.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/prompts/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/prompts/profiles.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/prompts/shared.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/relation_edges.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/retry.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/scope_analysis_agent.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/scope_ids.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/tools/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/tools/base.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/tools/get_method_calls.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/tools/read_file.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/agents/tree_planner_agent.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/clustering_ids.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding.egg-info/dependency_links.txt +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding.egg-info/entry_points.txt +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding.egg-info/requires.txt +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding.egg-info/top_level.txt +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/bootstrap.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/commands/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/commands/incremental_analysis.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/commands/partial_analysis.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/render.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_cli/view_instructions.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/orchestration.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/sources/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/sources/local.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/codeboarding_workflows/sources/remote.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/constants.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/core/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/core/plugin_loader.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/core/protocols.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/core/registry.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/exceptions.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/file_coverage.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/file_index.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/incremental_changes.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/incremental_update.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/run_mode.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/scope_assembly.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/scope_plan.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/diagram_analysis/tree_shape.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/checks/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/checks/circular_deps.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/checks/function_size.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/checks/unused_code_diagnostics.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/models.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/health/runner.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/install.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/logging_config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/callbacks.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/context.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/mixin.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/paths.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/stats.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/monitoring/writers.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/html.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/html_template.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/markdown.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/mdx.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/rendering.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/output_generators/sphinx.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/change_detector.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/errors.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/fingerprint_diff.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/git_ops.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/ignore.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/repo_utils/path_utils.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/setup.cfg +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/analysis_cache.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/analysis_result.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/cfg/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/cfg/call_graph.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/cfg/edge.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/cfg/location_key.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/cluster_relations.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/exceptions.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/models.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/draft.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/frontier.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/inventory.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/replay.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/spec.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/names/tokens.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/clustering/service.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/csharp_config_scanner.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/dotnet_sdk.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/csharp_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/go_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/java_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/php_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/python_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/rust_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/adapters/typescript_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/call_graph_builder.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/edge_build_context.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/edge_builder.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/hierarchy_builder.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/language_adapter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/lsp_client.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/lsp_constants.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/lsp_recycler.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/models.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/process_memory.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/progress.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/protocols.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/result_converter.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/source_inspector.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/symbol_table.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/engine/utils.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/incremental_orchestrator.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/internal_references.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/java_config_scanner.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/java_utils.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/language_results.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/lsp_client/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/lsp_client/diagnostics.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/node.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/programming_language.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/reference_resolver.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/scanner.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/static_analyzer/typescript_config_scanner.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/telemetry/device_id.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_install.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_logging_config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_persisted_analysis_artifacts.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_pyproject_packages.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_registry_coverage.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_tool_registry.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_user_config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_view_instructions.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_vscode_constants.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_windows_compatibility.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tests/test_windows_encoding.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tool_registry/__init__.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tool_registry/installers.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tool_registry/manifest.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tool_registry/paths.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/tool_registry/registry.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/user_config.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/utils.py +0 -0
- {codeboarding-0.14.0 → codeboarding-0.14.2}/vscode_constants.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeboarding
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
4
4
|
Summary: Interactive Diagrams for Code
|
|
5
5
|
Author: CodeBoarding Team
|
|
6
6
|
License-Expression: MIT
|
|
@@ -140,7 +140,7 @@ generated `.codeboarding/analysis.json` — it is parsed in your browser, nothin
|
|
|
140
140
|
```python
|
|
141
141
|
import json
|
|
142
142
|
from pathlib import Path
|
|
143
|
-
from diagram_analysis import DiagramGenerator, configure_models
|
|
143
|
+
from diagram_analysis import DiagramGenerator, RunContext, configure_models
|
|
144
144
|
from diagram_analysis.analysis_json import parse_unified_analysis
|
|
145
145
|
|
|
146
146
|
# Pass the key programmatically — shell env vars always take precedence if already set.
|
|
@@ -153,14 +153,17 @@ output_dir = repo_path / ".codeboarding"
|
|
|
153
153
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
154
154
|
|
|
155
155
|
# Generate the architectural diagram
|
|
156
|
+
context = RunContext.resolve("my-project")
|
|
156
157
|
generator = DiagramGenerator(
|
|
157
158
|
repo_location=repo_path,
|
|
158
159
|
temp_folder=output_dir,
|
|
159
160
|
repo_name="my-project",
|
|
160
161
|
output_dir=output_dir,
|
|
161
|
-
|
|
162
|
+
depth_cap=3, # Maximum hierarchy depth for automatic expansion, not a target.
|
|
163
|
+
run_id=context.run_id,
|
|
164
|
+
log_path=context.log_path,
|
|
162
165
|
)
|
|
163
|
-
|
|
166
|
+
analysis_path = generator.generate_analysis()
|
|
164
167
|
|
|
165
168
|
# Read and inspect the results
|
|
166
169
|
with open(analysis_path) as f:
|
|
@@ -221,7 +224,7 @@ codeboarding-render PATH/analysis.json --format FORMAT # render an existing anal
|
|
|
221
224
|
|---|---|
|
|
222
225
|
| `--local PATH` | Analyze a local repository (output: `PATH/.codeboarding/`) |
|
|
223
226
|
| `--render {md,html,mdx,rst}` | Render overview and component files from the local `analysis.json` for full, incremental, or partial commands |
|
|
224
|
-
| `--depth-
|
|
227
|
+
| `--depth-cap INT` | Maximum allowed hierarchy depth for automatic expansion (default: 3), not a target. Components can still be expanded on demand. Configures `metadata.depth_cap`, not `metadata.depth_level` (the depth actually reached). No input alias is accepted. |
|
|
225
228
|
| `--force` | (full only) Force full reanalysis, skip cached static analysis |
|
|
226
229
|
| `--base-ref REF` / `--target-ref REF` | (incremental only) Git refs to diff |
|
|
227
230
|
| `--component-id ID` | (partial only) ID of the component to update |
|
|
@@ -67,7 +67,7 @@ generated `.codeboarding/analysis.json` — it is parsed in your browser, nothin
|
|
|
67
67
|
```python
|
|
68
68
|
import json
|
|
69
69
|
from pathlib import Path
|
|
70
|
-
from diagram_analysis import DiagramGenerator, configure_models
|
|
70
|
+
from diagram_analysis import DiagramGenerator, RunContext, configure_models
|
|
71
71
|
from diagram_analysis.analysis_json import parse_unified_analysis
|
|
72
72
|
|
|
73
73
|
# Pass the key programmatically — shell env vars always take precedence if already set.
|
|
@@ -80,14 +80,17 @@ output_dir = repo_path / ".codeboarding"
|
|
|
80
80
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
81
81
|
|
|
82
82
|
# Generate the architectural diagram
|
|
83
|
+
context = RunContext.resolve("my-project")
|
|
83
84
|
generator = DiagramGenerator(
|
|
84
85
|
repo_location=repo_path,
|
|
85
86
|
temp_folder=output_dir,
|
|
86
87
|
repo_name="my-project",
|
|
87
88
|
output_dir=output_dir,
|
|
88
|
-
|
|
89
|
+
depth_cap=3, # Maximum hierarchy depth for automatic expansion, not a target.
|
|
90
|
+
run_id=context.run_id,
|
|
91
|
+
log_path=context.log_path,
|
|
89
92
|
)
|
|
90
|
-
|
|
93
|
+
analysis_path = generator.generate_analysis()
|
|
91
94
|
|
|
92
95
|
# Read and inspect the results
|
|
93
96
|
with open(analysis_path) as f:
|
|
@@ -148,7 +151,7 @@ codeboarding-render PATH/analysis.json --format FORMAT # render an existing anal
|
|
|
148
151
|
|---|---|
|
|
149
152
|
| `--local PATH` | Analyze a local repository (output: `PATH/.codeboarding/`) |
|
|
150
153
|
| `--render {md,html,mdx,rst}` | Render overview and component files from the local `analysis.json` for full, incremental, or partial commands |
|
|
151
|
-
| `--depth-
|
|
154
|
+
| `--depth-cap INT` | Maximum allowed hierarchy depth for automatic expansion (default: 3), not a target. Components can still be expanded on demand. Configures `metadata.depth_cap`, not `metadata.depth_level` (the depth actually reached). No input alias is accepted. |
|
|
152
155
|
| `--force` | (full only) Force full reanalysis, skip cached static analysis |
|
|
153
156
|
| `--base-ref REF` / `--target-ref REF` | (incremental only) Git refs to diff |
|
|
154
157
|
| `--component-id ID` | (partial only) ID of the component to update |
|
|
@@ -155,8 +155,8 @@ python main.py full --local ./my-project
|
|
|
155
155
|
|
|
156
156
|
# Raise the depth ceiling to auto-expand deeper (rarely needed — a component that
|
|
157
157
|
# outgrows the leaf ceiling is flagged expandable at whatever depth the run stops
|
|
158
|
-
# and can be expanded on demand; --depth-
|
|
159
|
-
python main.py full --local ./my-project --depth-
|
|
158
|
+
# and can be expanded on demand; --depth-cap is a safety-valve cap, default 3)
|
|
159
|
+
python main.py full --local ./my-project --depth-cap 5
|
|
160
160
|
|
|
161
161
|
# Re-analyze only changed parts when possible
|
|
162
162
|
python main.py incremental --local ./my-project
|
|
@@ -168,6 +168,20 @@ python main.py partial --local ./my-project --component-id "1.2"
|
|
|
168
168
|
python main.py full https://github.com/pytorch/pytorch
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
`--depth-cap` configures `metadata.depth_cap`; `metadata.depth_level` records the
|
|
172
|
+
depth actually reached. The cap is a maximum, not a target depth. `--depth-level`
|
|
173
|
+
is rejected; there is no compatibility alias.
|
|
174
|
+
|
|
175
|
+
Python callers must use `run_full(..., depth_cap=...)`,
|
|
176
|
+
`build_generator(..., depth_cap=...)`, and `DiagramGenerator(..., depth_cap=...)`.
|
|
177
|
+
The generator attribute is `depth_cap` and the exported default is
|
|
178
|
+
`diagram_analysis.DEFAULT_DEPTH_CAP` (3). The GitHub helper uses `DIAGRAM_DEPTH_CAP`
|
|
179
|
+
and rejects `DIAGRAM_DEPTH_LEVEL`. Telemetry reports configured `depth_cap`, not
|
|
180
|
+
`depth_level`. Readers of analysis results must keep reading `metadata.depth_level`
|
|
181
|
+
for the actual depth. Existing baseline loading behavior is unchanged: prefer
|
|
182
|
+
`metadata.depth_cap`, fall back to legacy `metadata.depth_level`, then use
|
|
183
|
+
`DEFAULT_DEPTH_CAP` if neither exists. This metadata fallback is not a CLI alias.
|
|
184
|
+
|
|
171
185
|
> **Incremental needs a baseline.** `incremental` diffs the working tree against the previous
|
|
172
186
|
> analysis in `.codeboarding/` (`analysis.json` + `fingerprint.json`). That baseline can live
|
|
173
187
|
> purely locally — a prior `full`/`incremental` run in the same output dir is enough. Commit
|
|
@@ -198,10 +212,11 @@ python main.py full https://github.com/pytorch/pytorch
|
|
|
198
212
|
|
|
199
213
|
## Telemetry
|
|
200
214
|
|
|
201
|
-
CodeBoarding collects
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
215
|
+
CodeBoarding collects usage telemetry (which command ran, success/failure,
|
|
216
|
+
duration, token cost, repository size and languages, and the account the
|
|
217
|
+
repository belongs to) to help us improve the tool. It is on by default and
|
|
218
|
+
never collects source code, file names, repository names, paths, prompts, model
|
|
219
|
+
outputs, or API keys. Opt out anytime:
|
|
205
220
|
|
|
206
221
|
```bash
|
|
207
222
|
export CODEBOARDING_TELEMETRY=false # or: export DO_NOT_TRACK=1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeboarding
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
4
4
|
Summary: Interactive Diagrams for Code
|
|
5
5
|
Author: CodeBoarding Team
|
|
6
6
|
License-Expression: MIT
|
|
@@ -140,7 +140,7 @@ generated `.codeboarding/analysis.json` — it is parsed in your browser, nothin
|
|
|
140
140
|
```python
|
|
141
141
|
import json
|
|
142
142
|
from pathlib import Path
|
|
143
|
-
from diagram_analysis import DiagramGenerator, configure_models
|
|
143
|
+
from diagram_analysis import DiagramGenerator, RunContext, configure_models
|
|
144
144
|
from diagram_analysis.analysis_json import parse_unified_analysis
|
|
145
145
|
|
|
146
146
|
# Pass the key programmatically — shell env vars always take precedence if already set.
|
|
@@ -153,14 +153,17 @@ output_dir = repo_path / ".codeboarding"
|
|
|
153
153
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
154
154
|
|
|
155
155
|
# Generate the architectural diagram
|
|
156
|
+
context = RunContext.resolve("my-project")
|
|
156
157
|
generator = DiagramGenerator(
|
|
157
158
|
repo_location=repo_path,
|
|
158
159
|
temp_folder=output_dir,
|
|
159
160
|
repo_name="my-project",
|
|
160
161
|
output_dir=output_dir,
|
|
161
|
-
|
|
162
|
+
depth_cap=3, # Maximum hierarchy depth for automatic expansion, not a target.
|
|
163
|
+
run_id=context.run_id,
|
|
164
|
+
log_path=context.log_path,
|
|
162
165
|
)
|
|
163
|
-
|
|
166
|
+
analysis_path = generator.generate_analysis()
|
|
164
167
|
|
|
165
168
|
# Read and inspect the results
|
|
166
169
|
with open(analysis_path) as f:
|
|
@@ -221,7 +224,7 @@ codeboarding-render PATH/analysis.json --format FORMAT # render an existing anal
|
|
|
221
224
|
|---|---|
|
|
222
225
|
| `--local PATH` | Analyze a local repository (output: `PATH/.codeboarding/`) |
|
|
223
226
|
| `--render {md,html,mdx,rst}` | Render overview and component files from the local `analysis.json` for full, incremental, or partial commands |
|
|
224
|
-
| `--depth-
|
|
227
|
+
| `--depth-cap INT` | Maximum allowed hierarchy depth for automatic expansion (default: 3), not a target. Components can still be expanded on demand. Configures `metadata.depth_cap`, not `metadata.depth_level` (the depth actually reached). No input alias is accepted. |
|
|
225
228
|
| `--force` | (full only) Force full reanalysis, skip cached static analysis |
|
|
226
229
|
| `--base-ref REF` / `--target-ref REF` | (incremental only) Git refs to diff |
|
|
227
230
|
| `--component-id ID` | (partial only) ID of the component to update |
|
|
@@ -11,7 +11,7 @@ from codeboarding_workflows.analysis import run_full
|
|
|
11
11
|
from codeboarding_workflows.orchestration import run_analysis_pipeline
|
|
12
12
|
from codeboarding_workflows.sources import SourceContext, local_source, remote_source
|
|
13
13
|
from constants import CLI_ROOT_DOCUMENT_NAME
|
|
14
|
-
from diagram_analysis import
|
|
14
|
+
from diagram_analysis import DEFAULT_DEPTH_CAP, RunContext, RunPaths
|
|
15
15
|
from monitoring import monitor_execution
|
|
16
16
|
from monitoring.paths import get_monitoring_run_dir
|
|
17
17
|
from output_generators.rendering import render_docs
|
|
@@ -45,13 +45,16 @@ def add_arguments(subparsers: argparse._SubParsersAction, parents: list[argparse
|
|
|
45
45
|
help="Force full reanalysis, skipping cached static analysis",
|
|
46
46
|
)
|
|
47
47
|
parser.add_argument(
|
|
48
|
-
"--depth-
|
|
48
|
+
"--depth-cap",
|
|
49
|
+
dest="depth_cap",
|
|
49
50
|
type=int,
|
|
50
|
-
default=
|
|
51
|
+
default=DEFAULT_DEPTH_CAP,
|
|
51
52
|
help=(
|
|
52
|
-
"
|
|
53
|
-
f"{
|
|
54
|
-
"regardless and can be expanded on demand; raise this only to auto-expand deeper up front."
|
|
53
|
+
"Maximum allowed hierarchy depth for automatic expansion (default: "
|
|
54
|
+
f"{DEFAULT_DEPTH_CAP}). A component that outgrows the leaf ceiling is flagged expandable "
|
|
55
|
+
"regardless and can be expanded on demand; raise this only to auto-expand deeper up front. "
|
|
56
|
+
"This configures metadata.depth_cap, "
|
|
57
|
+
"not metadata.depth_level (the depth actually reached)."
|
|
55
58
|
),
|
|
56
59
|
)
|
|
57
60
|
|
|
@@ -103,7 +106,7 @@ def _run_local(args: argparse.Namespace) -> None:
|
|
|
103
106
|
run_full(
|
|
104
107
|
RunPaths(repo_path=src.repo_path, output_dir=src.artifact_dir, project_name=src.project_name),
|
|
105
108
|
run_context,
|
|
106
|
-
|
|
109
|
+
depth_cap=args.depth_cap,
|
|
107
110
|
monitoring_enabled=should_monitor,
|
|
108
111
|
force_full=args.force,
|
|
109
112
|
source_sha=get_current_commit(src.repo_path),
|
|
@@ -152,7 +155,7 @@ def _run_remote(args: argparse.Namespace) -> None:
|
|
|
152
155
|
_process_one_remote(
|
|
153
156
|
repo_url=repo_url,
|
|
154
157
|
workspace_root=workspace_root,
|
|
155
|
-
|
|
158
|
+
depth_cap=args.depth_cap,
|
|
156
159
|
upload=args.upload,
|
|
157
160
|
should_monitor=should_monitor,
|
|
158
161
|
)
|
|
@@ -166,7 +169,7 @@ def _run_remote(args: argparse.Namespace) -> None:
|
|
|
166
169
|
def _process_one_remote(
|
|
167
170
|
repo_url: str,
|
|
168
171
|
workspace_root: Path,
|
|
169
|
-
|
|
172
|
+
depth_cap: int,
|
|
170
173
|
upload: bool,
|
|
171
174
|
should_monitor: bool,
|
|
172
175
|
) -> None:
|
|
@@ -185,7 +188,7 @@ def _process_one_remote(
|
|
|
185
188
|
analysis_path = run_full(
|
|
186
189
|
RunPaths(repo_path=src.repo_path, output_dir=src.artifact_dir, project_name=src.project_name),
|
|
187
190
|
run_context,
|
|
188
|
-
|
|
191
|
+
depth_cap=depth_cap,
|
|
189
192
|
monitoring_enabled=should_monitor,
|
|
190
193
|
source_sha=get_current_commit(src.repo_path),
|
|
191
194
|
)
|
|
@@ -17,7 +17,7 @@ from agents.content_hash import compute_source_tree_hash
|
|
|
17
17
|
from agents.scope_ids import ROOT_SCOPE_ID
|
|
18
18
|
from diagram_analysis import DiagramGenerator
|
|
19
19
|
from diagram_analysis.io_utils import load_analysis_metadata, load_expandable_component_ids, load_full_analysis
|
|
20
|
-
from diagram_analysis.run_context import
|
|
20
|
+
from diagram_analysis.run_context import DEFAULT_DEPTH_CAP, RunContext, RunPaths
|
|
21
21
|
from repo_utils.change_detector import ChangeSet
|
|
22
22
|
from repo_utils.fingerprint_diff import BaselineUnavailableError, detect_changes_from_fingerprint
|
|
23
23
|
from telemetry.events import track_analysis
|
|
@@ -30,7 +30,7 @@ __all__ = ["BaselineUnavailableError", "run_full", "run_partial", "run_increment
|
|
|
30
30
|
def build_generator(
|
|
31
31
|
run_paths: RunPaths,
|
|
32
32
|
run_context: RunContext,
|
|
33
|
-
|
|
33
|
+
depth_cap: int,
|
|
34
34
|
monitoring_enabled: bool = False,
|
|
35
35
|
static_analyzer=None,
|
|
36
36
|
changes=None,
|
|
@@ -40,7 +40,7 @@ def build_generator(
|
|
|
40
40
|
temp_folder=run_paths.output_dir,
|
|
41
41
|
repo_name=run_paths.project_name,
|
|
42
42
|
output_dir=run_paths.output_dir,
|
|
43
|
-
|
|
43
|
+
depth_cap=depth_cap,
|
|
44
44
|
run_id=run_context.run_id,
|
|
45
45
|
log_path=run_context.log_path,
|
|
46
46
|
monitoring_enabled=monitoring_enabled,
|
|
@@ -52,7 +52,7 @@ def build_generator(
|
|
|
52
52
|
def run_full(
|
|
53
53
|
run_paths: RunPaths,
|
|
54
54
|
run_context: RunContext,
|
|
55
|
-
|
|
55
|
+
depth_cap: int = DEFAULT_DEPTH_CAP,
|
|
56
56
|
monitoring_enabled: bool = False,
|
|
57
57
|
force_full: bool = False,
|
|
58
58
|
static_analyzer=None,
|
|
@@ -63,7 +63,7 @@ def run_full(
|
|
|
63
63
|
generator = build_generator(
|
|
64
64
|
run_paths,
|
|
65
65
|
run_context,
|
|
66
|
-
|
|
66
|
+
depth_cap=depth_cap,
|
|
67
67
|
monitoring_enabled=monitoring_enabled,
|
|
68
68
|
static_analyzer=static_analyzer,
|
|
69
69
|
)
|
|
@@ -87,8 +87,7 @@ def run_partial(
|
|
|
87
87
|
f"Running PARTIAL analysis workflow for project '{run_paths.project_name}', component '{component_id}'."
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
#
|
|
91
|
-
# legacy depth_level fallback — not the realized depth.
|
|
90
|
+
# Prefer the configured cap; retain depth_level for legacy baselines.
|
|
92
91
|
metadata = load_analysis_metadata(run_paths.output_dir)
|
|
93
92
|
if metadata is None:
|
|
94
93
|
raise BaselineUnavailableError(
|
|
@@ -107,7 +106,7 @@ def run_partial(
|
|
|
107
106
|
"Partial analysis requires an up-to-date source baseline. Run incremental analysis before expanding a component."
|
|
108
107
|
)
|
|
109
108
|
|
|
110
|
-
|
|
109
|
+
depth_cap = int(metadata.get("depth_cap", metadata.get("depth_level", DEFAULT_DEPTH_CAP)))
|
|
111
110
|
full_analysis = load_full_analysis(run_paths.output_dir)
|
|
112
111
|
if full_analysis is None:
|
|
113
112
|
# Metadata was present but the unified read failed — treat as a
|
|
@@ -139,11 +138,11 @@ def run_partial(
|
|
|
139
138
|
logger.error(f"Component with ID '{component_id}' not found in analysis")
|
|
140
139
|
return
|
|
141
140
|
|
|
142
|
-
generator = build_generator(run_paths, run_context,
|
|
141
|
+
generator = build_generator(run_paths, run_context, depth_cap=depth_cap, changes=ChangeSet(files=[]))
|
|
143
142
|
generator.source_sha = current_source_hash
|
|
144
143
|
# A component at the persisted cap needs one additional level prepared for expansion.
|
|
145
144
|
generator.prepare_analysis(
|
|
146
|
-
hierarchy_depth=
|
|
145
|
+
hierarchy_depth=depth_cap + 1,
|
|
147
146
|
target_component=component_to_analyze,
|
|
148
147
|
persisted_scopes={ROOT_SCOPE_ID: root_analysis, **sub_analyses},
|
|
149
148
|
)
|
|
@@ -189,19 +188,13 @@ def run_incremental(
|
|
|
189
188
|
should surface a "run full analysis" prompt rather than silently degrading to
|
|
190
189
|
an unscoped run.
|
|
191
190
|
"""
|
|
192
|
-
#
|
|
193
|
-
# (metadata.depth_cap, falling back to depth_level for legacy baselines
|
|
194
|
-
# that predate it) — not the realized depth_level, so a run that stopped
|
|
195
|
-
# short of its cap doesn't leave incremental permanently capped shallower
|
|
196
|
-
# than what was actually configured. Fail fast on cold-start:
|
|
197
|
-
# ``_generate_subcomponents`` requires the prior depth to re-detail
|
|
198
|
-
# changed components.
|
|
191
|
+
# Prefer the configured cap; retain depth_level for legacy baselines.
|
|
199
192
|
metadata = load_analysis_metadata(run_paths.output_dir)
|
|
200
193
|
if metadata is None:
|
|
201
194
|
raise BaselineUnavailableError(
|
|
202
195
|
f"No baseline analysis.json found in '{run_paths.output_dir}'. Run a full analysis first."
|
|
203
196
|
)
|
|
204
|
-
|
|
197
|
+
depth_cap = int(metadata.get("depth_cap", metadata.get("depth_level", DEFAULT_DEPTH_CAP)))
|
|
205
198
|
|
|
206
199
|
changes = detect_changes_from_fingerprint(run_paths.repo_path, run_paths.output_dir)
|
|
207
200
|
logger.info(
|
|
@@ -212,7 +205,7 @@ def run_incremental(
|
|
|
212
205
|
generator = build_generator(
|
|
213
206
|
run_paths,
|
|
214
207
|
run_context,
|
|
215
|
-
|
|
208
|
+
depth_cap=depth_cap,
|
|
216
209
|
monitoring_enabled=monitoring_enabled,
|
|
217
210
|
static_analyzer=static_analyzer,
|
|
218
211
|
changes=changes,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
__all__ = ["DiagramGenerator", "RunContext", "RunPaths", "
|
|
3
|
+
__all__ = ["DiagramGenerator", "RunContext", "RunPaths", "DEFAULT_DEPTH_CAP", "configure_models"]
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def __getattr__(name: str):
|
|
@@ -19,10 +19,10 @@ def __getattr__(name: str):
|
|
|
19
19
|
from .run_context import RunPaths
|
|
20
20
|
|
|
21
21
|
return RunPaths
|
|
22
|
-
if name == "
|
|
23
|
-
from .run_context import
|
|
22
|
+
if name == "DEFAULT_DEPTH_CAP":
|
|
23
|
+
from .run_context import DEFAULT_DEPTH_CAP
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return DEFAULT_DEPTH_CAP
|
|
26
26
|
if name == "configure_models":
|
|
27
27
|
from agents.llm_config import configure_models
|
|
28
28
|
|
|
@@ -99,7 +99,7 @@ class AnalysisMetadata(BaseModel):
|
|
|
99
99
|
repo_name: str = Field(description="Name of the analyzed repository.")
|
|
100
100
|
depth_level: int = Field(description="Maximum depth level actually reached by this analysis.")
|
|
101
101
|
depth_cap: int = Field(
|
|
102
|
-
description="Safety-valve depth ceiling the run was configured with (see --depth-
|
|
102
|
+
description="Safety-valve depth ceiling the run was configured with (see --depth-cap); "
|
|
103
103
|
"may exceed depth_level when separability stopped expansion before the cap. "
|
|
104
104
|
"The value future incremental/partial runs reuse as their own cap."
|
|
105
105
|
)
|
|
@@ -555,7 +555,7 @@ class DiagramGenerator:
|
|
|
555
555
|
temp_folder: Path,
|
|
556
556
|
repo_name: str,
|
|
557
557
|
output_dir: Path,
|
|
558
|
-
|
|
558
|
+
depth_cap: int,
|
|
559
559
|
run_id: str,
|
|
560
560
|
log_path: str,
|
|
561
561
|
project_name: str | None = None,
|
|
@@ -567,7 +567,7 @@ class DiagramGenerator:
|
|
|
567
567
|
self.temp_folder = temp_folder
|
|
568
568
|
self.repo_name = repo_name
|
|
569
569
|
self.output_dir = output_dir
|
|
570
|
-
self.
|
|
570
|
+
self.depth_cap = depth_cap
|
|
571
571
|
self.project_name = project_name
|
|
572
572
|
self.run_id = run_id
|
|
573
573
|
self.log_path = log_path
|
|
@@ -664,7 +664,7 @@ class DiagramGenerator:
|
|
|
664
664
|
static_analysis = self._get_static_with_new_analyzer()
|
|
665
665
|
|
|
666
666
|
self.static_analysis = static_analysis
|
|
667
|
-
depth = hierarchy_depth if hierarchy_depth is not None else self.
|
|
667
|
+
depth = hierarchy_depth if hierarchy_depth is not None else self.depth_cap
|
|
668
668
|
if incremental:
|
|
669
669
|
root_analysis = persisted_scopes.get(ROOT_SCOPE_ID)
|
|
670
670
|
if root_analysis is None:
|
|
@@ -1295,7 +1295,7 @@ class DiagramGenerator:
|
|
|
1295
1295
|
logger.debug("Submitted component='%s' at level=%d", comp.name, lvl)
|
|
1296
1296
|
|
|
1297
1297
|
# 1. Initial Seeding
|
|
1298
|
-
for component, level in _component_expansion_seeds(root_components, self.
|
|
1298
|
+
for component, level in _component_expansion_seeds(root_components, self.depth_cap):
|
|
1299
1299
|
submit_component(component, level)
|
|
1300
1300
|
|
|
1301
1301
|
logger.info(
|
|
@@ -1340,11 +1340,11 @@ class DiagramGenerator:
|
|
|
1340
1340
|
source_tree_hash=self._source_tree_hash(),
|
|
1341
1341
|
expandable_component_ids=expandable_ids,
|
|
1342
1342
|
sub_expandable_ids=sub_expandable_ids,
|
|
1343
|
-
depth_cap=self.
|
|
1343
|
+
depth_cap=self.depth_cap,
|
|
1344
1344
|
tree_spec=self._tree_spec_dict(),
|
|
1345
1345
|
)
|
|
1346
1346
|
|
|
1347
|
-
if new_components and level + 1 < self.
|
|
1347
|
+
if new_components and level + 1 < self.depth_cap:
|
|
1348
1348
|
for child in new_components:
|
|
1349
1349
|
submit_component(child, level + 1)
|
|
1350
1350
|
|
|
@@ -1524,7 +1524,7 @@ class DiagramGenerator:
|
|
|
1524
1524
|
source_tree_hash=source_tree_hash,
|
|
1525
1525
|
expandable_component_ids=expandable_component_ids,
|
|
1526
1526
|
sub_expandable_ids=sub_expandable_ids,
|
|
1527
|
-
depth_cap=self.
|
|
1527
|
+
depth_cap=self.depth_cap,
|
|
1528
1528
|
tree_spec=self._tree_spec_dict(),
|
|
1529
1529
|
).resolve()
|
|
1530
1530
|
if persist_side_artifacts:
|
|
@@ -1633,7 +1633,7 @@ class DiagramGenerator:
|
|
|
1633
1633
|
self._incremental_preparation = self._prepare_incremental_clustering(
|
|
1634
1634
|
root_analysis,
|
|
1635
1635
|
sub_analyses,
|
|
1636
|
-
self.
|
|
1636
|
+
self.depth_cap,
|
|
1637
1637
|
)
|
|
1638
1638
|
if self.incremental_updater is None:
|
|
1639
1639
|
self.agent_init()
|
|
@@ -1698,7 +1698,7 @@ class DiagramGenerator:
|
|
|
1698
1698
|
component
|
|
1699
1699
|
for component in created_components
|
|
1700
1700
|
if component.component_id in hierarchy.preclustered_scopes
|
|
1701
|
-
and _component_depth(component.component_id) < self.
|
|
1701
|
+
and _component_depth(component.component_id) < self.depth_cap
|
|
1702
1702
|
]
|
|
1703
1703
|
generated_scope_ids: frozenset[str] = frozenset()
|
|
1704
1704
|
if new_components:
|
|
@@ -30,7 +30,7 @@ from diagram_analysis.analysis_json import (
|
|
|
30
30
|
build_unified_analysis_json,
|
|
31
31
|
parse_unified_analysis,
|
|
32
32
|
)
|
|
33
|
-
from diagram_analysis.run_context import
|
|
33
|
+
from diagram_analysis.run_context import DEFAULT_DEPTH_CAP
|
|
34
34
|
from utils import ANALYSIS_FILENAME, FINGERPRINT_FILENAME
|
|
35
35
|
|
|
36
36
|
logger = logging.getLogger(__name__)
|
|
@@ -183,19 +183,15 @@ class _AnalysisFileStore:
|
|
|
183
183
|
if depth_cap is None:
|
|
184
184
|
depth_cap = metadata.get("depth_cap")
|
|
185
185
|
if depth_cap is None:
|
|
186
|
-
# Legacy baselines predate depth_cap and only recorded depth_level,
|
|
187
|
-
# which is the depth the run *realized* — often short of the cap it
|
|
188
|
-
# was configured with. Reusing it as a cap can pin the tree shallower
|
|
189
|
-
# than its owner asked for, so say so rather than silently narrowing.
|
|
190
186
|
depth_cap = metadata.get("depth_level")
|
|
191
187
|
if depth_cap is not None:
|
|
192
188
|
logger.warning(
|
|
193
189
|
"Baseline has no depth_cap; using its realized depth_level=%s as the cap. "
|
|
194
|
-
"Run a full analysis with --depth-
|
|
190
|
+
"Run a full analysis with --depth-cap to widen it.",
|
|
195
191
|
depth_cap,
|
|
196
192
|
)
|
|
197
193
|
if depth_cap is None:
|
|
198
|
-
depth_cap =
|
|
194
|
+
depth_cap = DEFAULT_DEPTH_CAP
|
|
199
195
|
|
|
200
196
|
# Convert sub_analyses dict to the format expected by build_unified_analysis_json
|
|
201
197
|
sub_analyses_tuples: dict[str, tuple[AnalysisInsights, list[Component]]] | None = None
|
|
@@ -4,12 +4,12 @@ from pathlib import Path
|
|
|
4
4
|
from monitoring.paths import generate_log_path
|
|
5
5
|
from utils import generate_run_id
|
|
6
6
|
|
|
7
|
-
# Safety-valve depth cap, not a target — see --depth-
|
|
7
|
+
# Safety-valve depth cap, not a target — see --depth-cap help / README for why.
|
|
8
8
|
# A component that outgrows the leaf ceiling is flagged expandable at whatever depth
|
|
9
9
|
# the run stops, so this cap bounds how much gets expanded up front, not whether a
|
|
10
10
|
# large component *can* be expanded (on demand, via the partial-analysis API). Raise
|
|
11
11
|
# it to auto-expand deeper.
|
|
12
|
-
|
|
12
|
+
DEFAULT_DEPTH_CAP = 3
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
@dataclass(frozen=True, slots=True)
|
|
@@ -4,7 +4,7 @@ import shutil
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
from codeboarding_workflows.analysis import run_incremental_workflow
|
|
7
|
-
from diagram_analysis import
|
|
7
|
+
from diagram_analysis import DEFAULT_DEPTH_CAP, DiagramGenerator, RunContext
|
|
8
8
|
from diagram_analysis.io_utils import load_analysis_metadata
|
|
9
9
|
from output_generators.rendering import render_docs
|
|
10
10
|
from repo_utils import checkout_repo, clone_repository
|
|
@@ -85,15 +85,17 @@ def _seed_existing_analysis(existing_analysis_dir: Path, temp_repo_folder: Path)
|
|
|
85
85
|
logger.info(f"Seeded existing {filename} for incremental analysis")
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def
|
|
88
|
+
def _resolve_depth_cap(temp_repo_folder: Path) -> int:
|
|
89
89
|
"""Depth cap: explicit env var, else the seeded baseline's own depth_cap, else the default."""
|
|
90
|
-
|
|
90
|
+
if "DIAGRAM_DEPTH_LEVEL" in os.environ:
|
|
91
|
+
raise ValueError("DIAGRAM_DEPTH_LEVEL is no longer supported; use DIAGRAM_DEPTH_CAP")
|
|
92
|
+
env_depth = os.getenv("DIAGRAM_DEPTH_CAP")
|
|
91
93
|
if env_depth is not None:
|
|
92
94
|
return int(env_depth)
|
|
93
95
|
metadata = load_analysis_metadata(temp_repo_folder)
|
|
94
96
|
if metadata is not None:
|
|
95
|
-
return int(metadata.get("depth_cap",
|
|
96
|
-
return
|
|
97
|
+
return int(metadata.get("depth_cap", DEFAULT_DEPTH_CAP))
|
|
98
|
+
return DEFAULT_DEPTH_CAP
|
|
97
99
|
|
|
98
100
|
|
|
99
101
|
def generate_analysis(
|
|
@@ -121,7 +123,7 @@ def generate_analysis(
|
|
|
121
123
|
temp_folder=temp_repo_folder,
|
|
122
124
|
repo_name=repo_name,
|
|
123
125
|
output_dir=temp_repo_folder,
|
|
124
|
-
|
|
126
|
+
depth_cap=_resolve_depth_cap(temp_repo_folder),
|
|
125
127
|
run_id=run_context.run_id,
|
|
126
128
|
log_path=run_context.log_path,
|
|
127
129
|
)
|