code2llm 0.5.125__tar.gz → 0.5.127__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.
- code2llm-0.5.127/MANIFEST.in +4 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/PKG-INFO +2 -2
- {code2llm-0.5.125 → code2llm-0.5.127}/README.md +1 -1
- code2llm-0.5.127/VERSION +1 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/__init__.py +1 -1
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_exports/__init__.py +6 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_exports/orchestrator.py +20 -213
- code2llm-0.5.127/code2llm/cli_exports/orchestrator_chunked.py +87 -0
- code2llm-0.5.127/code2llm/cli_exports/orchestrator_constants.py +52 -0
- code2llm-0.5.127/code2llm/cli_exports/orchestrator_handlers.py +149 -0
- code2llm-0.5.127/code2llm/exporters/evolution/__init__.py +78 -0
- code2llm-0.5.127/code2llm/exporters/evolution/computation.py +167 -0
- code2llm-0.5.127/code2llm/exporters/evolution/constants.py +25 -0
- code2llm-0.5.127/code2llm/exporters/evolution/exclusion.py +17 -0
- code2llm-0.5.127/code2llm/exporters/evolution/render.py +195 -0
- code2llm-0.5.127/code2llm/exporters/evolution/yaml_export.py +103 -0
- code2llm-0.5.127/code2llm/exporters/evolution_exporter.py +74 -0
- code2llm-0.5.127/code2llm/exporters/map/__init__.py +60 -0
- code2llm-0.5.127/code2llm/exporters/map/alerts.py +84 -0
- code2llm-0.5.127/code2llm/exporters/map/details.py +115 -0
- code2llm-0.5.127/code2llm/exporters/map/header.py +71 -0
- code2llm-0.5.127/code2llm/exporters/map/module_list.py +26 -0
- code2llm-0.5.127/code2llm/exporters/map/utils.py +69 -0
- code2llm-0.5.127/code2llm/exporters/map/yaml_export.py +106 -0
- code2llm-0.5.127/code2llm/exporters/map_exporter.py +50 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/__init__.py +66 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/calls.py +59 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/classic.py +90 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/compact.py +64 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/flow_compact.py +155 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/flow_detailed.py +67 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/flow_full.py +67 -0
- code2llm-0.5.127/code2llm/exporters/mermaid/utils.py +78 -0
- code2llm-0.5.127/code2llm/exporters/mermaid_exporter.py +75 -0
- code2llm-0.5.127/code2llm/exporters/readme/__init__.py +40 -0
- code2llm-0.5.127/code2llm/exporters/readme/content.py +348 -0
- code2llm-0.5.127/code2llm/exporters/readme/files.py +26 -0
- code2llm-0.5.127/code2llm/exporters/readme/insights.py +52 -0
- code2llm-0.5.127/code2llm/exporters/readme/sections.py +67 -0
- code2llm-0.5.127/code2llm/exporters/readme_exporter.py +66 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/__init__.py +98 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/analysis.py +173 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/cli.py +76 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/generator.py +118 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/nodes.py +103 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/parsing.py +39 -0
- code2llm-0.5.127/code2llm/generators/llm_flow/utils.py +84 -0
- code2llm-0.5.127/code2llm/generators/llm_flow.py +87 -0
- code2llm-0.5.127/code2llm/generators/mermaid/__init__.py +70 -0
- code2llm-0.5.127/code2llm/generators/mermaid/fix.py +147 -0
- code2llm-0.5.127/code2llm/generators/mermaid/png.py +264 -0
- code2llm-0.5.127/code2llm/generators/mermaid/validation.py +119 -0
- code2llm-0.5.127/code2llm/generators/mermaid.py +84 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/__init__.py +1 -1
- code2llm-0.5.127/code2llm/parsers/toon_parser.py +147 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/PKG-INFO +2 -2
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/SOURCES.txt +43 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/pyproject.toml +1 -1
- code2llm-0.5.125/code2llm/exporters/evolution_exporter.py +0 -473
- code2llm-0.5.125/code2llm/exporters/map_exporter.py +0 -432
- code2llm-0.5.125/code2llm/exporters/mermaid_exporter.py +0 -492
- code2llm-0.5.125/code2llm/exporters/readme_exporter.py +0 -499
- code2llm-0.5.125/code2llm/generators/llm_flow.py +0 -507
- code2llm-0.5.125/code2llm/generators/mermaid.py +0 -512
- {code2llm-0.5.125 → code2llm-0.5.127}/LICENSE +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/__main__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/call_graph.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/cfg.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/coupling.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/data_analysis.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/dfg.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/pipeline_classifier.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/pipeline_detector.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/pipeline_resolver.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/side_effects.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/smells.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/type_inference.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/utils/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/analysis/utils/ast_helpers.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/api.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_analysis.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_commands.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_exports/code2logic.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_exports/formats.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_exports/prompt.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/cli_parser.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/analyzer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/ast_registry.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/config.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/export_pipeline.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/file_analyzer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/file_cache.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/file_filter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/gitignore.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/incremental.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/base.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/cpp.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/csharp.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/generic.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/go_lang.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/java.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/php.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/ruby.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/rust.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/ts_extractors.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/ts_parser.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/lang/typescript.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/large_repo.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/models.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/persistent_cache.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/refactoring.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/repo_files.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/cache.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/incremental.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/prioritizer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/scanner.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming/strategies.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/streaming_analyzer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/core/toon_size_manager.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/article_view.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/base.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/context_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/context_view.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/dashboard_data.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/dashboard_renderer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/flow_constants.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/flow_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/flow_renderer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/html_dashboard.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/index_generator/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/index_generator/renderer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/index_generator/scanner.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/index_generator.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/json_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/llm_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/mermaid_flow_helpers.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/constants.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/core.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/evolution.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/health.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/hotspots.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml/modules.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/project_yaml_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/report_generators.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/helpers.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/metrics.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/metrics_core.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/metrics_duplicates.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/metrics_health.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/module_detail.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon/renderer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/toon_view.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/validate_project.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/exporters/yaml_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/generators/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/generators/_utils.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/generators/llm_task.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/config.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/entity_resolution.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/intent_matching.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/normalization.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/nlp/pipeline.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/patterns/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/patterns/detector.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/refactor/__init__.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm/refactor/prompt_engine.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/dependency_links.txt +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/entry_points.txt +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/requires.txt +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/code2llm.egg-info/top_level.txt +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/setup.cfg +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/setup.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_advanced_analysis.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_analyzer.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_calls_toon_export.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_deep_analysis.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_edge_cases.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_flow_exporter.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_format_quality.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_multilanguage_e2e.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_nlp_pipeline.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_nonpython_cc_calls.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_persistent_cache.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_pipeline_detector.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_project_toon_export.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_prompt_engine.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_prompt_txt.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_refactoring_engine.py +0 -0
- {code2llm-0.5.125 → code2llm-0.5.127}/tests/test_toon_v2.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2llm
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.127
|
|
4
4
|
Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
|
|
5
5
|
Home-page: https://github.com/wronai/stts
|
|
6
6
|
Author: STTS Project
|
|
@@ -67,7 +67,7 @@ Dynamic: requires-python
|
|
|
67
67
|
|
|
68
68
|
## AI Cost Tracking
|
|
69
69
|
|
|
70
|
-
    
|
|
71
71
|
  
|
|
72
72
|
|
|
73
73
|
- 🤖 **LLM usage:** $7.5000 (166 commits)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## AI Cost Tracking
|
|
5
5
|
|
|
6
|
-
    
|
|
7
7
|
  
|
|
8
8
|
|
|
9
9
|
- 🤖 **LLM usage:** $7.5000 (166 commits)
|
code2llm-0.5.127/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.5.127
|
|
@@ -8,7 +8,7 @@ Includes NLP Processing Pipeline for query normalization, intent matching,
|
|
|
8
8
|
and entity resolution with multilingual support.
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
__version__ = "0.5.
|
|
11
|
+
__version__ = "0.5.127"
|
|
12
12
|
__author__ = "STTS Project"
|
|
13
13
|
|
|
14
14
|
# Core analysis components (lightweight, always needed)
|
|
@@ -27,6 +27,10 @@ from .orchestrator import (
|
|
|
27
27
|
_export_single_project,
|
|
28
28
|
_export_chunked_results,
|
|
29
29
|
)
|
|
30
|
+
from .orchestrator_chunked import (
|
|
31
|
+
_get_filtered_subprojects,
|
|
32
|
+
_process_subproject,
|
|
33
|
+
)
|
|
30
34
|
|
|
31
35
|
__all__ = [
|
|
32
36
|
"_export_simple_formats",
|
|
@@ -45,4 +49,6 @@ __all__ = [
|
|
|
45
49
|
"_run_exports",
|
|
46
50
|
"_export_single_project",
|
|
47
51
|
"_export_chunked_results",
|
|
52
|
+
"_get_filtered_subprojects",
|
|
53
|
+
"_process_subproject",
|
|
48
54
|
]
|
|
@@ -27,45 +27,24 @@ from code2llm.exporters import (
|
|
|
27
27
|
from code2llm.exporters.project_yaml.evolution import load_previous_evolution
|
|
28
28
|
from code2llm.core.persistent_cache import PersistentCache
|
|
29
29
|
from code2llm.core.config import DEFAULT_PROGRESS_BAR_THRESHOLD
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'map': ['map.toon.yaml'],
|
|
49
|
-
'evolution': ['evolution.toon.yaml'],
|
|
50
|
-
'context': ['context.md'],
|
|
51
|
-
'mermaid': ['calls.mmd', 'calls.png'],
|
|
52
|
-
'yaml': ['analysis.yaml'],
|
|
53
|
-
'json': ['analysis.json'],
|
|
54
|
-
'readme': ['README.md'],
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
# Human-readable labels
|
|
58
|
-
FORMAT_LABELS: Dict[str, str] = {
|
|
59
|
-
'toon': 'TOON (diagnostics)',
|
|
60
|
-
'map': 'MAP (structure)',
|
|
61
|
-
'flow': 'FLOW (data-flow)',
|
|
62
|
-
'context': 'CONTEXT (LLM narrative)',
|
|
63
|
-
'yaml': 'YAML',
|
|
64
|
-
'json': 'JSON',
|
|
65
|
-
'evolution': 'EVOLUTION (refactoring queue)',
|
|
66
|
-
'readme': 'README (documentation)',
|
|
67
|
-
'project-yaml': 'PROJECT-YAML (single source of truth)',
|
|
68
|
-
}
|
|
30
|
+
from .orchestrator_constants import (
|
|
31
|
+
FORMAT_FILENAMES,
|
|
32
|
+
FORMAT_DRY_RUN_FILES,
|
|
33
|
+
FORMAT_LABELS,
|
|
34
|
+
)
|
|
35
|
+
from .orchestrator_handlers import (
|
|
36
|
+
_export_mermaid,
|
|
37
|
+
_export_calls,
|
|
38
|
+
_export_context_fallback,
|
|
39
|
+
_export_data_structures,
|
|
40
|
+
_export_project_toon,
|
|
41
|
+
_export_readme,
|
|
42
|
+
_export_index_html,
|
|
43
|
+
)
|
|
44
|
+
from .orchestrator_chunked import (
|
|
45
|
+
_get_filtered_subprojects,
|
|
46
|
+
_process_subproject,
|
|
47
|
+
)
|
|
69
48
|
|
|
70
49
|
|
|
71
50
|
def _build_export_config(args, formats: List[str]) -> Dict[str, Any]:
|
|
@@ -302,185 +281,13 @@ def _get_format_kwargs(fmt: str, args) -> Dict[str, Any]:
|
|
|
302
281
|
return kwargs
|
|
303
282
|
|
|
304
283
|
|
|
305
|
-
def _export_mermaid(args, result, output_dir: Path):
|
|
306
|
-
"""Export mermaid diagrams."""
|
|
307
|
-
exporter = MermaidExporter()
|
|
308
|
-
include_examples = getattr(args, 'flow_include_examples', False)
|
|
309
|
-
|
|
310
|
-
# Core diagrams
|
|
311
|
-
exporter.export_flow_compact(result, str(output_dir / 'flow.mmd'), include_examples)
|
|
312
|
-
exporter.export_call_graph(result, str(output_dir / 'calls.mmd'))
|
|
313
|
-
exporter.export_compact(result, str(output_dir / 'compact_flow.mmd'))
|
|
314
|
-
|
|
315
|
-
# Optional detailed diagrams
|
|
316
|
-
if getattr(args, 'flow_detail', False):
|
|
317
|
-
exporter.export_flow_detailed(result, str(output_dir / 'flow_detailed.mmd'), include_examples)
|
|
318
|
-
if getattr(args, 'flow_full', False):
|
|
319
|
-
exporter.export_flow_full(result, str(output_dir / 'flow_full.mmd'), include_examples)
|
|
320
|
-
|
|
321
|
-
# Also export calls.yaml/toon
|
|
322
|
-
yaml_exporter = YAMLExporter()
|
|
323
|
-
yaml_exporter.export_calls(result, str(output_dir / 'calls.yaml'))
|
|
324
|
-
yaml_exporter.export_calls_toon(result, str(output_dir / 'calls.toon.yaml'))
|
|
325
|
-
|
|
326
|
-
if args.verbose:
|
|
327
|
-
files = ['flow.mmd', 'calls.mmd', 'compact_flow.mmd', 'calls.yaml']
|
|
328
|
-
if getattr(args, 'flow_detail', False):
|
|
329
|
-
files.append('flow_detailed.mmd')
|
|
330
|
-
if getattr(args, 'flow_full', False):
|
|
331
|
-
files.append('flow_full.mmd')
|
|
332
|
-
print(f" - Mermaid: {output_dir}/*.mmd ({', '.join(files)})")
|
|
333
|
-
|
|
334
|
-
# PNG generation
|
|
335
|
-
_export_mermaid_pngs(args, output_dir)
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
def _export_mermaid_pngs(args, output_dir: Path):
|
|
339
|
-
"""Generate PNGs from mermaid files."""
|
|
340
|
-
if getattr(args, 'no_png', False):
|
|
341
|
-
return
|
|
342
|
-
try:
|
|
343
|
-
from ..generators.mermaid import generate_pngs
|
|
344
|
-
png_count = generate_pngs(output_dir, output_dir)
|
|
345
|
-
if args.verbose and png_count > 0:
|
|
346
|
-
print(f" - PNG: {png_count} files generated")
|
|
347
|
-
except ImportError:
|
|
348
|
-
if args.verbose:
|
|
349
|
-
print(f" - PNG: Skipped (install with: make install-mermaid)")
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
def _export_calls(args, result, output_dir: Path, formats: List[str]):
|
|
353
|
-
"""Export calls.yaml and calls.toon.yaml."""
|
|
354
|
-
yaml_exporter = YAMLExporter()
|
|
355
|
-
if 'calls' in formats:
|
|
356
|
-
yaml_exporter.export_calls(result, str(output_dir / 'calls.yaml'))
|
|
357
|
-
if args.verbose:
|
|
358
|
-
print(f" - CALLS (call graph YAML): {output_dir / 'calls.yaml'}")
|
|
359
|
-
if 'calls_toon' in formats:
|
|
360
|
-
yaml_exporter.export_calls_toon(result, str(output_dir / 'calls.toon.yaml'))
|
|
361
|
-
if args.verbose:
|
|
362
|
-
print(f" - CALLS (toon format): {output_dir / 'calls.toon.yaml'}")
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
def _export_context_fallback(args, result, output_dir: Path):
|
|
366
|
-
"""Export context.md as fallback."""
|
|
367
|
-
exporter_cls = get_exporter('context')
|
|
368
|
-
if exporter_cls:
|
|
369
|
-
exporter = exporter_cls()
|
|
370
|
-
exporter.export(result, str(output_dir / 'context.md'))
|
|
371
|
-
if args.verbose:
|
|
372
|
-
print(f" - CONTEXT (LLM narrative): {output_dir / 'context.md'}")
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
def _export_data_structures(args, result, output_dir: Path):
|
|
376
|
-
"""Export data_structures.yaml."""
|
|
377
|
-
yaml_exporter = YAMLExporter()
|
|
378
|
-
yaml_exporter.export_data_structures(result, str(output_dir / 'data_structures.yaml'), compact=True)
|
|
379
|
-
if args.verbose:
|
|
380
|
-
print(f" - Data structures: {output_dir / 'data_structures.yaml'}")
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
def _export_project_toon(args, result, output_dir: Path):
|
|
384
|
-
"""Export project.toon.yaml from project.yaml data."""
|
|
385
|
-
from ..exporters.project_yaml_exporter import ProjectYAMLExporter
|
|
386
|
-
|
|
387
|
-
project_yaml_exporter = ProjectYAMLExporter()
|
|
388
|
-
prev_evolution = load_previous_evolution(output_dir / 'project.yaml')
|
|
389
|
-
data = project_yaml_exporter._build_project_yaml(result, prev_evolution)
|
|
390
|
-
|
|
391
|
-
generator = ToonViewGenerator()
|
|
392
|
-
generator.generate(data, str(output_dir / 'project.toon.yaml'))
|
|
393
|
-
|
|
394
|
-
if args.verbose:
|
|
395
|
-
print(f" - PROJECT-TOON (project overview): {output_dir / 'project.toon.yaml'}")
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
def _export_readme(args, result, output_dir: Path):
|
|
399
|
-
"""Export README.md."""
|
|
400
|
-
if getattr(args, 'no_readme', False):
|
|
401
|
-
return
|
|
402
|
-
exporter_cls = get_exporter('readme')
|
|
403
|
-
if exporter_cls:
|
|
404
|
-
exporter = exporter_cls()
|
|
405
|
-
exporter.export(result, str(output_dir / 'README.md'))
|
|
406
|
-
if args.verbose:
|
|
407
|
-
print(f" - README (documentation): {output_dir / 'README.md'}")
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
def _export_index_html(args, output_dir: Path):
|
|
411
|
-
"""Generate index.html for browsing files."""
|
|
412
|
-
if 'all' not in getattr(args, 'format', ''):
|
|
413
|
-
return
|
|
414
|
-
try:
|
|
415
|
-
generator = IndexHTMLGenerator(output_dir)
|
|
416
|
-
index_path = generator.generate()
|
|
417
|
-
if args.verbose:
|
|
418
|
-
print(f" - INDEX (file browser): {index_path}")
|
|
419
|
-
except Exception as e:
|
|
420
|
-
if args.verbose:
|
|
421
|
-
print(f" - INDEX generation failed: {e}", file=sys.stderr)
|
|
422
|
-
|
|
423
|
-
|
|
424
284
|
def _export_chunked(
|
|
425
285
|
args, result, output_dir: Path, source_path: Path,
|
|
426
286
|
formats: List[str], requested_formats: List[str]
|
|
427
287
|
):
|
|
428
288
|
"""Export chunked analysis results."""
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
for sp in subprojects:
|
|
432
|
-
_process_subproject(args, sp, output_dir)
|
|
433
|
-
|
|
434
|
-
# Merged summary
|
|
435
|
-
_export_registry_formats(args, result, output_dir, ['toon', 'context', 'evolution'])
|
|
436
|
-
|
|
437
|
-
if 'calls' in formats or 'calls_toon' in formats:
|
|
438
|
-
_export_calls(args, result, output_dir, formats)
|
|
439
|
-
if 'all' in requested_formats:
|
|
440
|
-
_export_project_toon(args, result, output_dir)
|
|
441
|
-
|
|
442
|
-
if source_path is not None:
|
|
443
|
-
from .code2logic import _export_code2logic
|
|
444
|
-
from .prompt import _export_chunked_prompt_txt
|
|
445
|
-
_export_code2logic(args, source_path, output_dir, formats)
|
|
446
|
-
_export_chunked_prompt_txt(args, output_dir, requested_formats, source_path, subprojects)
|
|
447
|
-
|
|
448
|
-
_export_readme(args, result, output_dir)
|
|
449
|
-
_export_index_html(args, output_dir)
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
def _get_filtered_subprojects(args, source_path: Path):
|
|
453
|
-
"""Get filtered subprojects list."""
|
|
454
|
-
from ..core.large_repo import HierarchicalRepoSplitter
|
|
455
|
-
|
|
456
|
-
splitter = HierarchicalRepoSplitter(size_limit_kb=args.chunk_size)
|
|
457
|
-
subprojects = splitter.get_analysis_plan(source_path)
|
|
458
|
-
|
|
459
|
-
if getattr(args, 'only_subproject', None):
|
|
460
|
-
subprojects = [
|
|
461
|
-
sp for sp in subprojects
|
|
462
|
-
if sp.name == args.only_subproject or sp.name.startswith(args.only_subproject + '.')
|
|
463
|
-
]
|
|
464
|
-
if getattr(args, 'skip_subprojects', None):
|
|
465
|
-
subprojects = [
|
|
466
|
-
sp for sp in subprojects
|
|
467
|
-
if not any(sp.name.startswith(skip) for skip in args.skip_subprojects)
|
|
468
|
-
]
|
|
469
|
-
return subprojects
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
def _process_subproject(args, sp, output_dir: Path):
|
|
473
|
-
"""Process a single subproject result."""
|
|
474
|
-
sp_output_dir = output_dir / sp.name.replace('.', '_')
|
|
475
|
-
if not sp_output_dir.exists():
|
|
476
|
-
return
|
|
477
|
-
for ext in ['.toon', '.yaml', '.json']:
|
|
478
|
-
result_file = sp_output_dir / f'analysis{ext}'
|
|
479
|
-
if result_file.exists():
|
|
480
|
-
if args.verbose:
|
|
481
|
-
level_name = {0: 'root', 1: 'L1', 2: 'L2'}.get(sp.level, f'L{sp.level}')
|
|
482
|
-
print(f" - Exported [{level_name}] {sp.name}")
|
|
483
|
-
break
|
|
289
|
+
from .orchestrator_chunked import _export_chunked as _chunked_impl
|
|
290
|
+
_chunked_impl(args, result, output_dir, source_path, formats, requested_formats)
|
|
484
291
|
|
|
485
292
|
|
|
486
293
|
# Backward-compatible aliases
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Chunked export functionality — handles multi-subproject analysis export.
|
|
2
|
+
|
|
3
|
+
Extracted from orchestrator.py to reduce its complexity and separate
|
|
4
|
+
the chunked/distributed analysis concerns.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import List
|
|
9
|
+
|
|
10
|
+
from ..core.large_repo import HierarchicalRepoSplitter
|
|
11
|
+
from .orchestrator_handlers import (
|
|
12
|
+
_export_calls,
|
|
13
|
+
_export_project_toon,
|
|
14
|
+
_export_readme,
|
|
15
|
+
_export_index_html,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _export_chunked(
|
|
20
|
+
args,
|
|
21
|
+
result,
|
|
22
|
+
output_dir: Path,
|
|
23
|
+
source_path: Path,
|
|
24
|
+
formats: List[str],
|
|
25
|
+
requested_formats: List[str],
|
|
26
|
+
):
|
|
27
|
+
"""Export chunked analysis results."""
|
|
28
|
+
from .orchestrator import _export_registry_formats
|
|
29
|
+
from .code2logic import _export_code2logic
|
|
30
|
+
from .prompt import _export_chunked_prompt_txt
|
|
31
|
+
|
|
32
|
+
subprojects = _get_filtered_subprojects(args, source_path)
|
|
33
|
+
for sp in subprojects:
|
|
34
|
+
_process_subproject(args, sp, output_dir)
|
|
35
|
+
|
|
36
|
+
_export_registry_formats(args, result, output_dir, ['toon', 'context', 'evolution'])
|
|
37
|
+
|
|
38
|
+
if 'calls' in formats or 'calls_toon' in formats:
|
|
39
|
+
_export_calls(args, result, output_dir, formats)
|
|
40
|
+
if 'all' in requested_formats:
|
|
41
|
+
_export_project_toon(args, result, output_dir)
|
|
42
|
+
|
|
43
|
+
if source_path is not None:
|
|
44
|
+
_export_code2logic(args, source_path, output_dir, formats)
|
|
45
|
+
_export_chunked_prompt_txt(args, output_dir, requested_formats, source_path, subprojects)
|
|
46
|
+
|
|
47
|
+
_export_readme(args, result, output_dir)
|
|
48
|
+
_export_index_html(args, output_dir)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _get_filtered_subprojects(args, source_path: Path):
|
|
52
|
+
"""Get filtered subprojects list based on CLI arguments."""
|
|
53
|
+
splitter = HierarchicalRepoSplitter(size_limit_kb=args.chunk_size)
|
|
54
|
+
subprojects = splitter.get_analysis_plan(source_path)
|
|
55
|
+
|
|
56
|
+
if getattr(args, 'only_subproject', None):
|
|
57
|
+
subprojects = [
|
|
58
|
+
sp for sp in subprojects
|
|
59
|
+
if sp.name == args.only_subproject or sp.name.startswith(args.only_subproject + '.')
|
|
60
|
+
]
|
|
61
|
+
if getattr(args, 'skip_subprojects', None):
|
|
62
|
+
subprojects = [
|
|
63
|
+
sp for sp in subprojects
|
|
64
|
+
if not any(sp.name.startswith(skip) for skip in args.skip_subprojects)
|
|
65
|
+
]
|
|
66
|
+
return subprojects
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _process_subproject(args, sp, output_dir: Path):
|
|
70
|
+
"""Process a single subproject result."""
|
|
71
|
+
sp_output_dir = output_dir / sp.name.replace('.', '_')
|
|
72
|
+
if not sp_output_dir.exists():
|
|
73
|
+
return
|
|
74
|
+
for ext in ['.toon', '.yaml', '.json']:
|
|
75
|
+
result_file = sp_output_dir / f'analysis{ext}'
|
|
76
|
+
if result_file.exists():
|
|
77
|
+
if args.verbose:
|
|
78
|
+
level_name = {0: 'root', 1: 'L1', 2: 'L2'}.get(sp.level, f'L{sp.level}')
|
|
79
|
+
print(f" - Exported [{level_name}] {sp.name}")
|
|
80
|
+
break
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
__all__ = [
|
|
84
|
+
'_export_chunked',
|
|
85
|
+
'_get_filtered_subprojects',
|
|
86
|
+
'_process_subproject',
|
|
87
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Export orchestrator constants — format filenames, labels, and dry-run mappings.
|
|
2
|
+
|
|
3
|
+
This module centralizes all format-related constants for the export system
|
|
4
|
+
to avoid duplication and enable easier maintenance.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Dict, List
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Format output filenames
|
|
11
|
+
FORMAT_FILENAMES: Dict[str, str] = {
|
|
12
|
+
'toon': 'analysis.toon.yaml',
|
|
13
|
+
'map': 'map.toon.yaml',
|
|
14
|
+
'flow': 'flow.toon.yaml',
|
|
15
|
+
'context': 'context.md',
|
|
16
|
+
'yaml': 'analysis.yaml',
|
|
17
|
+
'json': 'analysis.json',
|
|
18
|
+
'evolution': 'evolution.toon.yaml',
|
|
19
|
+
'readme': 'README.md',
|
|
20
|
+
'project-yaml': 'project.yaml',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Files produced per format in dry-run preview
|
|
24
|
+
FORMAT_DRY_RUN_FILES: Dict[str, List[str]] = {
|
|
25
|
+
'toon': ['analysis.toon'],
|
|
26
|
+
'map': ['map.toon.yaml'],
|
|
27
|
+
'evolution': ['evolution.toon.yaml'],
|
|
28
|
+
'context': ['context.md'],
|
|
29
|
+
'mermaid': ['calls.mmd', 'calls.png'],
|
|
30
|
+
'yaml': ['analysis.yaml'],
|
|
31
|
+
'json': ['analysis.json'],
|
|
32
|
+
'readme': ['README.md'],
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Human-readable labels
|
|
36
|
+
FORMAT_LABELS: Dict[str, str] = {
|
|
37
|
+
'toon': 'TOON (diagnostics)',
|
|
38
|
+
'map': 'MAP (structure)',
|
|
39
|
+
'flow': 'FLOW (data-flow)',
|
|
40
|
+
'context': 'CONTEXT (LLM narrative)',
|
|
41
|
+
'yaml': 'YAML',
|
|
42
|
+
'json': 'JSON',
|
|
43
|
+
'evolution': 'EVOLUTION (refactoring queue)',
|
|
44
|
+
'readme': 'README (documentation)',
|
|
45
|
+
'project-yaml': 'PROJECT-YAML (single source of truth)',
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
'FORMAT_FILENAMES',
|
|
50
|
+
'FORMAT_DRY_RUN_FILES',
|
|
51
|
+
'FORMAT_LABELS',
|
|
52
|
+
]
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""Export handlers — specific format export implementations.
|
|
2
|
+
|
|
3
|
+
This module contains all the individual export handler functions
|
|
4
|
+
that were extracted from orchestrator.py to reduce its size.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any, Dict, List
|
|
9
|
+
|
|
10
|
+
from code2llm.exporters import (
|
|
11
|
+
get_exporter,
|
|
12
|
+
YAMLExporter,
|
|
13
|
+
MermaidExporter,
|
|
14
|
+
ToonViewGenerator,
|
|
15
|
+
IndexHTMLGenerator,
|
|
16
|
+
)
|
|
17
|
+
from code2llm.exporters.project_yaml.evolution import load_previous_evolution
|
|
18
|
+
from .orchestrator_constants import FORMAT_LABELS
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _export_mermaid(args, result, output_dir: Path):
|
|
22
|
+
"""Export mermaid diagrams."""
|
|
23
|
+
exporter = MermaidExporter()
|
|
24
|
+
include_examples = getattr(args, 'flow_include_examples', False)
|
|
25
|
+
|
|
26
|
+
# Core diagrams
|
|
27
|
+
exporter.export_flow_compact(result, str(output_dir / 'flow.mmd'), include_examples)
|
|
28
|
+
exporter.export_call_graph(result, str(output_dir / 'calls.mmd'))
|
|
29
|
+
exporter.export_compact(result, str(output_dir / 'compact_flow.mmd'))
|
|
30
|
+
|
|
31
|
+
# Optional detailed diagrams
|
|
32
|
+
if getattr(args, 'flow_detail', False):
|
|
33
|
+
exporter.export_flow_detailed(result, str(output_dir / 'flow_detailed.mmd'), include_examples)
|
|
34
|
+
if getattr(args, 'flow_full', False):
|
|
35
|
+
exporter.export_flow_full(result, str(output_dir / 'flow_full.mmd'), include_examples)
|
|
36
|
+
|
|
37
|
+
# Also export calls.yaml/toon
|
|
38
|
+
yaml_exporter = YAMLExporter()
|
|
39
|
+
yaml_exporter.export_calls(result, str(output_dir / 'calls.yaml'))
|
|
40
|
+
yaml_exporter.export_calls_toon(result, str(output_dir / 'calls.toon.yaml'))
|
|
41
|
+
|
|
42
|
+
if args.verbose:
|
|
43
|
+
files = ['flow.mmd', 'calls.mmd', 'compact_flow.mmd', 'calls.yaml']
|
|
44
|
+
if getattr(args, 'flow_detail', False):
|
|
45
|
+
files.append('flow_detailed.mmd')
|
|
46
|
+
if getattr(args, 'flow_full', False):
|
|
47
|
+
files.append('flow_full.mmd')
|
|
48
|
+
print(f" - Mermaid: {output_dir}/*.mmd ({', '.join(files)})")
|
|
49
|
+
|
|
50
|
+
# PNG generation
|
|
51
|
+
_export_mermaid_pngs(args, output_dir)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _export_mermaid_pngs(args, output_dir: Path):
|
|
55
|
+
"""Generate PNGs from mermaid files."""
|
|
56
|
+
if getattr(args, 'no_png', False):
|
|
57
|
+
return
|
|
58
|
+
try:
|
|
59
|
+
from ..generators.mermaid import generate_pngs
|
|
60
|
+
png_count = generate_pngs(output_dir, output_dir)
|
|
61
|
+
if args.verbose and png_count > 0:
|
|
62
|
+
print(f" - PNG: {png_count} files generated")
|
|
63
|
+
except ImportError:
|
|
64
|
+
if args.verbose:
|
|
65
|
+
print(f" - PNG: Skipped (install with: make install-mermaid)")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _export_calls(args, result, output_dir: Path, formats: List[str]):
|
|
69
|
+
"""Export calls.yaml and calls.toon.yaml."""
|
|
70
|
+
yaml_exporter = YAMLExporter()
|
|
71
|
+
if 'calls' in formats:
|
|
72
|
+
yaml_exporter.export_calls(result, str(output_dir / 'calls.yaml'))
|
|
73
|
+
if args.verbose:
|
|
74
|
+
print(f" - CALLS (call graph YAML): {output_dir / 'calls.yaml'}")
|
|
75
|
+
if 'calls_toon' in formats:
|
|
76
|
+
yaml_exporter.export_calls_toon(result, str(output_dir / 'calls.toon.yaml'))
|
|
77
|
+
if args.verbose:
|
|
78
|
+
print(f" - CALLS (toon format): {output_dir / 'calls.toon.yaml'}")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _export_context_fallback(args, result, output_dir: Path):
|
|
82
|
+
"""Export context.md as fallback."""
|
|
83
|
+
exporter_cls = get_exporter('context')
|
|
84
|
+
if exporter_cls:
|
|
85
|
+
exporter = exporter_cls()
|
|
86
|
+
exporter.export(result, str(output_dir / 'context.md'))
|
|
87
|
+
if args.verbose:
|
|
88
|
+
print(f" - CONTEXT (LLM narrative): {output_dir / 'context.md'}")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _export_data_structures(args, result, output_dir: Path):
|
|
92
|
+
"""Export data_structures.yaml."""
|
|
93
|
+
yaml_exporter = YAMLExporter()
|
|
94
|
+
yaml_exporter.export_data_structures(result, str(output_dir / 'data_structures.yaml'), compact=True)
|
|
95
|
+
if args.verbose:
|
|
96
|
+
print(f" - Data structures: {output_dir / 'data_structures.yaml'}")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _export_project_toon(args, result, output_dir: Path):
|
|
100
|
+
"""Export project.toon.yaml from project.yaml data."""
|
|
101
|
+
from ..exporters.project_yaml_exporter import ProjectYAMLExporter
|
|
102
|
+
|
|
103
|
+
project_yaml_exporter = ProjectYAMLExporter()
|
|
104
|
+
prev_evolution = load_previous_evolution(output_dir / 'project.yaml')
|
|
105
|
+
data = project_yaml_exporter._build_project_yaml(result, prev_evolution)
|
|
106
|
+
|
|
107
|
+
generator = ToonViewGenerator()
|
|
108
|
+
generator.generate(data, str(output_dir / 'project.toon.yaml'))
|
|
109
|
+
|
|
110
|
+
if args.verbose:
|
|
111
|
+
print(f" - PROJECT-TOON (project overview): {output_dir / 'project.toon.yaml'}")
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _export_readme(args, result, output_dir: Path):
|
|
115
|
+
"""Export README.md."""
|
|
116
|
+
if getattr(args, 'no_readme', False):
|
|
117
|
+
return
|
|
118
|
+
exporter_cls = get_exporter('readme')
|
|
119
|
+
if exporter_cls:
|
|
120
|
+
exporter = exporter_cls()
|
|
121
|
+
exporter.export(result, str(output_dir / 'README.md'))
|
|
122
|
+
if args.verbose:
|
|
123
|
+
print(f" - README (documentation): {output_dir / 'README.md'}")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _export_index_html(args, output_dir: Path):
|
|
127
|
+
"""Generate index.html for browsing files."""
|
|
128
|
+
if 'all' not in getattr(args, 'format', ''):
|
|
129
|
+
return
|
|
130
|
+
try:
|
|
131
|
+
generator = IndexHTMLGenerator(output_dir)
|
|
132
|
+
index_path = generator.generate()
|
|
133
|
+
if args.verbose:
|
|
134
|
+
print(f" - INDEX (file browser): {index_path}")
|
|
135
|
+
except Exception as e:
|
|
136
|
+
if args.verbose:
|
|
137
|
+
print(f" - INDEX generation failed: {e}", file=__import__('sys').stderr)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
__all__ = [
|
|
141
|
+
'_export_mermaid',
|
|
142
|
+
'_export_mermaid_pngs',
|
|
143
|
+
'_export_calls',
|
|
144
|
+
'_export_context_fallback',
|
|
145
|
+
'_export_data_structures',
|
|
146
|
+
'_export_project_toon',
|
|
147
|
+
'_export_readme',
|
|
148
|
+
'_export_index_html',
|
|
149
|
+
]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Evolution exporter package — prioritized refactoring queue for iterative improvement.
|
|
2
|
+
|
|
3
|
+
This package provides:
|
|
4
|
+
- constants: Thresholds and exclusion patterns
|
|
5
|
+
- exclusion: Path filtering logic
|
|
6
|
+
- computation: Metrics calculation (god modules, hub types, etc.)
|
|
7
|
+
- render: Text output generation for evolution.toon
|
|
8
|
+
- yaml_export: Structured YAML output for evolution.toon.yaml
|
|
9
|
+
|
|
10
|
+
All public names are re-exported here for backward compatibility
|
|
11
|
+
with the original evolution_exporter.py module structure.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# Constants
|
|
15
|
+
from .constants import (
|
|
16
|
+
CC_SPLIT_THRESHOLD,
|
|
17
|
+
FAN_OUT_THRESHOLD,
|
|
18
|
+
GOD_MODULE_LINES,
|
|
19
|
+
HUB_TYPE_THRESHOLD,
|
|
20
|
+
EXCLUDE_PATTERNS,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Exclusion
|
|
24
|
+
from .exclusion import is_excluded
|
|
25
|
+
|
|
26
|
+
# Computation
|
|
27
|
+
from .computation import (
|
|
28
|
+
compute_func_data,
|
|
29
|
+
scan_file_sizes,
|
|
30
|
+
aggregate_file_stats,
|
|
31
|
+
make_relative_path,
|
|
32
|
+
filter_god_modules,
|
|
33
|
+
compute_god_modules,
|
|
34
|
+
compute_hub_types,
|
|
35
|
+
build_context,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# Render
|
|
39
|
+
from .render import (
|
|
40
|
+
render_header,
|
|
41
|
+
render_next,
|
|
42
|
+
render_risks,
|
|
43
|
+
render_metrics_target,
|
|
44
|
+
render_patterns,
|
|
45
|
+
render_history,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# YAML Export
|
|
49
|
+
from .yaml_export import export_to_yaml
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
# Constants
|
|
53
|
+
'CC_SPLIT_THRESHOLD',
|
|
54
|
+
'FAN_OUT_THRESHOLD',
|
|
55
|
+
'GOD_MODULE_LINES',
|
|
56
|
+
'HUB_TYPE_THRESHOLD',
|
|
57
|
+
'EXCLUDE_PATTERNS',
|
|
58
|
+
# Exclusion
|
|
59
|
+
'is_excluded',
|
|
60
|
+
# Computation
|
|
61
|
+
'compute_func_data',
|
|
62
|
+
'scan_file_sizes',
|
|
63
|
+
'aggregate_file_stats',
|
|
64
|
+
'make_relative_path',
|
|
65
|
+
'filter_god_modules',
|
|
66
|
+
'compute_god_modules',
|
|
67
|
+
'compute_hub_types',
|
|
68
|
+
'build_context',
|
|
69
|
+
# Render
|
|
70
|
+
'render_header',
|
|
71
|
+
'render_next',
|
|
72
|
+
'render_risks',
|
|
73
|
+
'render_metrics_target',
|
|
74
|
+
'render_patterns',
|
|
75
|
+
'render_history',
|
|
76
|
+
# YAML Export
|
|
77
|
+
'export_to_yaml',
|
|
78
|
+
]
|