vcode-analysis 0.9.0__tar.gz → 0.10.0__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.
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/MANIFEST.in +1 -1
- {vcode_analysis-0.9.0/vcode_analysis.egg-info → vcode_analysis-0.10.0}/PKG-INFO +1 -1
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/cli.py +68 -27
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/prompt_manager.py +6 -5
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/pyproject.toml +4 -4
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/vcode_analysis.egg-info}/PKG-INFO +1 -1
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_analysis.egg-info/SOURCES.txt +13 -13
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_analysis.egg-info/top_level.txt +0 -1
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/server.py +1 -1
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/tool_handler.py +2 -2
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/LICENSE +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/README.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/_tuning_context.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/architecture.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/code_review.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/context_builder.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/directory.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/documentation.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/knowledge_graph.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/security.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/analyzers/security_ast.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/analyzer.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/batch_analyzer.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/batch_planner.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/cache_manager.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/config.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/feedback_hub.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/git_handler.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/ignore.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/json_utils.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/llm_client.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/metrics_store.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/architecture.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/batch_review.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/code_review.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/code_review_v2.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/commit_review.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/documentation/api.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/documentation/module.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/documentation/readme.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/mcp/code_review_checklist.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/mcp/mr_review_template.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/mcp/vuln_tuning_advisor.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0/core}/prompts/security_analysis.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/report_generator.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/core/token_estimator.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/2026-stage-highlights.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/PPT/345/244/247/347/272/262-VCode_Analysis_/346/231/272/350/203/275/344/273/243/347/240/201/345/210/206/346/236/220/345/267/245/345/205/267/345/210/206/344/272/253.md" +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/PPT/347/224/237/346/210/220/346/217/220/347/244/272/350/257/215-VCode_Analysis/345/210/206/344/272/253.md" +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/USER_MANUAL.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/batch-cache-optimization.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/c-parser-design.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/code-knowledge-graph.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/critical-severity.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/expert-review-response-2026-07.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/kotlin-parser-design.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/prompt-externalization.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/three-year-roadmap.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/vcode-analysis-tool.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/review-scenarios.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/security-sharing-article.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/severity-standard.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/superpowers/plans/2026-07-22-expert-review-response.md +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs//350/207/252/350/215/220/344/272/256/347/202/271/350/257/264/346/230/216.md" +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c/ast_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c/models.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c/patterns.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c/regex_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/c_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/java_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/javascript_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin/ast_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin/models.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin/patterns.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin/regex_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/kotlin_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/python_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/sql_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/parsers/typescript_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/requirements.txt +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/setup.cfg +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_batch_operations.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_c_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_context_builder_sql.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_kotlin_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_mcp_tools.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_metrics_store.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_prompt_manager.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_report_generator.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_security_rules.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/tests/test_sql_parser.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_analysis.egg-info/dependency_links.txt +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_analysis.egg-info/entry_points.txt +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_analysis.egg-info/requires.txt +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/__init__.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/prompt_handler.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/resource_handler.py +0 -0
- {vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/vcode_mcp/transports/__init__.py +0 -0
|
@@ -70,6 +70,8 @@ Options:
|
|
|
70
70
|
--limit <n> 限制数量 (feedback pending 使用)
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
|
+
from __future__ import annotations
|
|
74
|
+
|
|
73
75
|
import sys
|
|
74
76
|
import json
|
|
75
77
|
import time
|
|
@@ -111,7 +113,7 @@ from analyzers import (
|
|
|
111
113
|
)
|
|
112
114
|
|
|
113
115
|
|
|
114
|
-
__version__ = "0.
|
|
116
|
+
__version__ = "0.10.0"
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
def _timestamp() -> str:
|
|
@@ -247,6 +249,17 @@ def get_default_output_path(target_path: str, prefix: str) -> Path:
|
|
|
247
249
|
return result_dir / filename
|
|
248
250
|
|
|
249
251
|
|
|
252
|
+
def _save_output_to_file(args: dict, content: str, prefix: str) -> str:
|
|
253
|
+
"""将输出内容保存到文件(未指定 --output 时生成默认路径并返回)。
|
|
254
|
+
|
|
255
|
+
用于 metrics/feedback/clone 等命令:既保存到 result/ 目录,也保留终端输出。
|
|
256
|
+
"""
|
|
257
|
+
output_path = args.get("--output") or str(get_default_output_path(".", prefix))
|
|
258
|
+
Path(output_path).write_text(content, encoding="utf-8")
|
|
259
|
+
_log(f"结果已保存到: {output_path}")
|
|
260
|
+
return output_path
|
|
261
|
+
|
|
262
|
+
|
|
250
263
|
def format_review_result(result, output_format: str = "markdown") -> str:
|
|
251
264
|
"""格式化审查结果"""
|
|
252
265
|
if output_format == "json":
|
|
@@ -517,7 +530,7 @@ def cmd_review(args: dict) -> int:
|
|
|
517
530
|
reviewer.metrics_store = _metrics_store
|
|
518
531
|
reviewer._current_run_id = _metrics_store.record_scan_run(ScanRun(
|
|
519
532
|
repo_path=str(Path(target_path).resolve()),
|
|
520
|
-
analyzer="code_review", tool_version="0.
|
|
533
|
+
analyzer="code_review", tool_version="0.10.0",
|
|
521
534
|
))
|
|
522
535
|
_log_section("分析中(逐文件模式)")
|
|
523
536
|
_log(f"开始分析 {total} 个文件...", "START")
|
|
@@ -627,7 +640,7 @@ def cmd_review(args: dict) -> int:
|
|
|
627
640
|
_metrics_store = MetricsStore(_metrics_db)
|
|
628
641
|
_run_id = _metrics_store.record_scan_run(ScanRun(
|
|
629
642
|
repo_path=str(Path(target_path).resolve()),
|
|
630
|
-
analyzer="code_review", tool_version="0.
|
|
643
|
+
analyzer="code_review", tool_version="0.10.0",
|
|
631
644
|
))
|
|
632
645
|
for r in results:
|
|
633
646
|
if r.success and r.issues:
|
|
@@ -790,7 +803,7 @@ def cmd_review_commit(args: dict) -> int:
|
|
|
790
803
|
_metrics_store = MetricsStore(_metrics_db)
|
|
791
804
|
_run_id = _metrics_store.record_scan_run(ScanRun(
|
|
792
805
|
repo_path=str(Path(target_path).resolve()),
|
|
793
|
-
analyzer="code_review", tool_version="0.
|
|
806
|
+
analyzer="code_review", tool_version="0.10.0",
|
|
794
807
|
))
|
|
795
808
|
|
|
796
809
|
with Analyzer(config) as analyzer:
|
|
@@ -1004,12 +1017,14 @@ def cmd_metrics(args: dict) -> int:
|
|
|
1004
1017
|
lines.append(f"| {item['key']} | {item['count']} |")
|
|
1005
1018
|
content = "\n".join(lines)
|
|
1006
1019
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1020
|
+
# 默认保存到文件(未指定 --output 时生成默认路径)
|
|
1021
|
+
if not output_path:
|
|
1022
|
+
output_path = str(get_default_output_path(".", "metrics"))
|
|
1023
|
+
|
|
1024
|
+
with open(output_path, "w", encoding="utf-8") as f:
|
|
1025
|
+
f.write(content)
|
|
1026
|
+
_log(f"[OK] 指标报告已保存到 {output_path}")
|
|
1027
|
+
print(content) # 同时保留终端输出
|
|
1013
1028
|
|
|
1014
1029
|
return 0
|
|
1015
1030
|
|
|
@@ -1027,6 +1042,9 @@ def cmd_feedback(args: dict) -> int:
|
|
|
1027
1042
|
)
|
|
1028
1043
|
store = MetricsStore(Path(db_path))
|
|
1029
1044
|
|
|
1045
|
+
# 收集输出文本,统一在末尾保存到默认文件
|
|
1046
|
+
output_lines: list[str] = []
|
|
1047
|
+
|
|
1030
1048
|
if args.get("pending"):
|
|
1031
1049
|
limit = int(args.get("--limit") or 50)
|
|
1032
1050
|
conn = store._get_conn()
|
|
@@ -1037,12 +1055,17 @@ def cmd_feedback(args: dict) -> int:
|
|
|
1037
1055
|
).fetchall()
|
|
1038
1056
|
conn.close()
|
|
1039
1057
|
if not rows:
|
|
1040
|
-
|
|
1058
|
+
output_lines.append("无待复核 issue")
|
|
1041
1059
|
else:
|
|
1042
|
-
|
|
1043
|
-
|
|
1060
|
+
output_lines.append(f"{'ID':<12} {'规则':<25} {'严重度':<10} {'文件':<30} {'行号':<6}")
|
|
1061
|
+
output_lines.append("-" * 90)
|
|
1044
1062
|
for r in rows:
|
|
1045
|
-
|
|
1063
|
+
output_lines.append(
|
|
1064
|
+
f"{r[0][:10]:<12} {r[1] or '':<25} {r[2] or '':<10} {r[3]:<30} {r[4]:<6}"
|
|
1065
|
+
)
|
|
1066
|
+
output = "\n".join(output_lines)
|
|
1067
|
+
print(output)
|
|
1068
|
+
_save_output_to_file(args, output, "feedback")
|
|
1046
1069
|
return 0
|
|
1047
1070
|
|
|
1048
1071
|
if args.get("import"):
|
|
@@ -1056,7 +1079,9 @@ def cmd_feedback(args: dict) -> int:
|
|
|
1056
1079
|
item.get("reviewer", "import"), item.get("note", ""),
|
|
1057
1080
|
)
|
|
1058
1081
|
count += 1
|
|
1059
|
-
|
|
1082
|
+
output = f"[OK] 已导入 {count} 条反馈"
|
|
1083
|
+
print(output)
|
|
1084
|
+
_save_output_to_file(args, output, "feedback")
|
|
1060
1085
|
return 0
|
|
1061
1086
|
|
|
1062
1087
|
# 单条标记
|
|
@@ -1067,7 +1092,9 @@ def cmd_feedback(args: dict) -> int:
|
|
|
1067
1092
|
print("用法: vcode-analysis feedback <issue-id> --status <status> [--note <text>]")
|
|
1068
1093
|
return 1
|
|
1069
1094
|
store.update_issue_status(issue_id, status, "cli", note)
|
|
1070
|
-
|
|
1095
|
+
output = f"[OK] issue {issue_id[:10]} 状态已更新为 {status}"
|
|
1096
|
+
print(output)
|
|
1097
|
+
_save_output_to_file(args, output, "feedback")
|
|
1071
1098
|
return 0
|
|
1072
1099
|
|
|
1073
1100
|
|
|
@@ -1277,7 +1304,7 @@ def cmd_security(args: dict) -> int:
|
|
|
1277
1304
|
security.metrics_store = _metrics_store
|
|
1278
1305
|
security._current_run_id = _metrics_store.record_scan_run(ScanRun(
|
|
1279
1306
|
repo_path=str(Path(target_path).resolve()),
|
|
1280
|
-
analyzer="security", tool_version="0.
|
|
1307
|
+
analyzer="security", tool_version="0.10.0",
|
|
1281
1308
|
))
|
|
1282
1309
|
results = security.scan_project(target_path, deep=deep_scan, log_callback=_log)
|
|
1283
1310
|
scan_time = time.time() - scan_start
|
|
@@ -1419,6 +1446,10 @@ def cmd_clone(args: dict) -> int:
|
|
|
1419
1446
|
analyze = args.get("--analyze", False)
|
|
1420
1447
|
output_file = args.get("--output")
|
|
1421
1448
|
|
|
1449
|
+
# 默认输出路径(未指定 --output 时生成)
|
|
1450
|
+
if not output_file:
|
|
1451
|
+
output_file = str(get_default_output_path(".", "clone"))
|
|
1452
|
+
|
|
1422
1453
|
_log(f"克隆仓库: {repo_url}", "START")
|
|
1423
1454
|
|
|
1424
1455
|
# 克隆仓库
|
|
@@ -1445,6 +1476,8 @@ def cmd_clone(args: dict) -> int:
|
|
|
1445
1476
|
("总耗时", _format_duration(total_time)),
|
|
1446
1477
|
],
|
|
1447
1478
|
)
|
|
1479
|
+
# 默认保存克隆报告
|
|
1480
|
+
_save_output_to_file(args, f"# 克隆报告\n\n- 仓库: {repo_url}\n- 路径: {repo_path}\n- 耗时: {_format_duration(clone_time)}\n", "clone")
|
|
1448
1481
|
return 0
|
|
1449
1482
|
|
|
1450
1483
|
# 执行分析
|
|
@@ -1500,6 +1533,10 @@ def cmd_batch_clone(args: dict) -> int:
|
|
|
1500
1533
|
analyze = args.get("--analyze", False)
|
|
1501
1534
|
output_file = args.get("--output")
|
|
1502
1535
|
|
|
1536
|
+
# 默认输出路径(未指定 --output 时生成)
|
|
1537
|
+
if not output_file:
|
|
1538
|
+
output_file = str(get_default_output_path(target_dir, "batch_clone"))
|
|
1539
|
+
|
|
1503
1540
|
# 读取 URL 列表
|
|
1504
1541
|
urls = []
|
|
1505
1542
|
try:
|
|
@@ -1531,7 +1568,7 @@ def cmd_batch_clone(args: dict) -> int:
|
|
|
1531
1568
|
target_dir=target_dir,
|
|
1532
1569
|
parallel=parallel,
|
|
1533
1570
|
max_workers=4,
|
|
1534
|
-
progress_callback=progress_callback if not
|
|
1571
|
+
progress_callback=progress_callback if not args.get("--output") else None,
|
|
1535
1572
|
)
|
|
1536
1573
|
clone_time = time.time() - clone_start
|
|
1537
1574
|
|
|
@@ -1562,9 +1599,10 @@ def cmd_batch_clone(args: dict) -> int:
|
|
|
1562
1599
|
|
|
1563
1600
|
report = "\n".join(lines)
|
|
1564
1601
|
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1602
|
+
# 保存报告(默认已生成 output_file)
|
|
1603
|
+
Path(output_file).write_text(report, encoding="utf-8")
|
|
1604
|
+
_log(f"报告已保存到: {output_file}")
|
|
1605
|
+
print(report)
|
|
1568
1606
|
|
|
1569
1607
|
# 如果需要分析
|
|
1570
1608
|
analyze_time = 0
|
|
@@ -1594,6 +1632,10 @@ def cmd_batch_pull(args: dict) -> int:
|
|
|
1594
1632
|
repos_str = args.get("--repos")
|
|
1595
1633
|
output_file = args.get("--output")
|
|
1596
1634
|
|
|
1635
|
+
# 默认输出路径(未指定 --output 时生成)
|
|
1636
|
+
if not output_file:
|
|
1637
|
+
output_file = str(get_default_output_path(dir_path, "batch_pull"))
|
|
1638
|
+
|
|
1597
1639
|
# 解析指定仓库
|
|
1598
1640
|
repos = None
|
|
1599
1641
|
if repos_str:
|
|
@@ -1626,12 +1668,11 @@ def cmd_batch_pull(args: dict) -> int:
|
|
|
1626
1668
|
# 生成报告
|
|
1627
1669
|
report = handler.generate_status_report(repo_infos)
|
|
1628
1670
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
print(report)
|
|
1671
|
+
# 保存报告(默认已生成 output_file)
|
|
1672
|
+
Path(output_file).write_text(report, encoding="utf-8")
|
|
1673
|
+
_log(f"报告已保存到: {output_file}")
|
|
1674
|
+
print("\n" + "=" * 50)
|
|
1675
|
+
print(report)
|
|
1635
1676
|
|
|
1636
1677
|
total_time = time.time() - start_time
|
|
1637
1678
|
_log_section("批量拉取完成")
|
|
@@ -60,15 +60,16 @@ class PromptManager:
|
|
|
60
60
|
def _resolve_builtin_dir(self) -> Optional[Path]:
|
|
61
61
|
"""定位内置 prompts 目录。
|
|
62
62
|
|
|
63
|
-
优先用 importlib.resources 读取已安装的 ``prompts``
|
|
64
|
-
|
|
63
|
+
优先用 importlib.resources 读取已安装的 ``core.prompts`` 子包
|
|
64
|
+
(随 whl 打包,作为 core 包数据),失败则回退到开发模式布局
|
|
65
|
+
core/prompts(__file__ 同级子目录)。
|
|
65
66
|
"""
|
|
66
|
-
#
|
|
67
|
+
# 已安装 / 开发模式:prompts 作为 core 的子包
|
|
67
68
|
try:
|
|
68
69
|
from importlib import resources
|
|
69
70
|
|
|
70
71
|
try:
|
|
71
|
-
files = resources.files("prompts")
|
|
72
|
+
files = resources.files("core.prompts")
|
|
72
73
|
with resources.as_file(files) as f:
|
|
73
74
|
if f.exists():
|
|
74
75
|
return f
|
|
@@ -78,7 +79,7 @@ class PromptManager:
|
|
|
78
79
|
pass
|
|
79
80
|
|
|
80
81
|
# 回退:开发模式或源码仓库布局
|
|
81
|
-
repo_path = Path(__file__).resolve().parent
|
|
82
|
+
repo_path = Path(__file__).resolve().parent / "prompts"
|
|
82
83
|
if repo_path.exists():
|
|
83
84
|
return repo_path
|
|
84
85
|
return None
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vcode-analysis"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.10.0"
|
|
8
8
|
description = "基于大模型的智能代码分析工具,支持代码审查、文档生成、架构分析和安全扫描"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -70,11 +70,11 @@ py-modules = ["cli"]
|
|
|
70
70
|
|
|
71
71
|
[tool.setuptools.packages.find]
|
|
72
72
|
where = ["."]
|
|
73
|
-
include = ["core*", "analyzers*", "parsers*", "vcode_mcp*"
|
|
73
|
+
include = ["core*", "analyzers*", "parsers*", "vcode_mcp*"]
|
|
74
74
|
|
|
75
|
-
# 将 prompts
|
|
75
|
+
# 将 core/prompts 子包内的 Markdown 提示词打包进 whl(默认内置,可被用户目录覆盖)
|
|
76
76
|
[tool.setuptools.package-data]
|
|
77
|
-
|
|
77
|
+
core = ["prompts/**/*.md"]
|
|
78
78
|
|
|
79
79
|
[tool.black]
|
|
80
80
|
line-length = 100
|
|
@@ -29,6 +29,19 @@ core/metrics_store.py
|
|
|
29
29
|
core/prompt_manager.py
|
|
30
30
|
core/report_generator.py
|
|
31
31
|
core/token_estimator.py
|
|
32
|
+
core/prompts/__init__.py
|
|
33
|
+
core/prompts/architecture.md
|
|
34
|
+
core/prompts/batch_review.md
|
|
35
|
+
core/prompts/code_review.md
|
|
36
|
+
core/prompts/code_review_v2.md
|
|
37
|
+
core/prompts/commit_review.md
|
|
38
|
+
core/prompts/security_analysis.md
|
|
39
|
+
core/prompts/documentation/api.md
|
|
40
|
+
core/prompts/documentation/module.md
|
|
41
|
+
core/prompts/documentation/readme.md
|
|
42
|
+
core/prompts/mcp/code_review_checklist.md
|
|
43
|
+
core/prompts/mcp/mr_review_template.md
|
|
44
|
+
core/prompts/mcp/vuln_tuning_advisor.md
|
|
32
45
|
docs/2026-stage-highlights.md
|
|
33
46
|
docs/PPT大纲-VCode_Analysis_智能代码分析工具分享.md
|
|
34
47
|
docs/PPT生成提示词-VCode_Analysis分享.md
|
|
@@ -65,19 +78,6 @@ parsers/kotlin/ast_parser.py
|
|
|
65
78
|
parsers/kotlin/models.py
|
|
66
79
|
parsers/kotlin/patterns.py
|
|
67
80
|
parsers/kotlin/regex_parser.py
|
|
68
|
-
prompts/__init__.py
|
|
69
|
-
prompts/architecture.md
|
|
70
|
-
prompts/batch_review.md
|
|
71
|
-
prompts/code_review.md
|
|
72
|
-
prompts/code_review_v2.md
|
|
73
|
-
prompts/commit_review.md
|
|
74
|
-
prompts/security_analysis.md
|
|
75
|
-
prompts/documentation/api.md
|
|
76
|
-
prompts/documentation/module.md
|
|
77
|
-
prompts/documentation/readme.md
|
|
78
|
-
prompts/mcp/code_review_checklist.md
|
|
79
|
-
prompts/mcp/mr_review_template.md
|
|
80
|
-
prompts/mcp/vuln_tuning_advisor.md
|
|
81
81
|
tests/test_batch_operations.py
|
|
82
82
|
tests/test_c_parser.py
|
|
83
83
|
tests/test_context_builder_sql.py
|
|
@@ -8,7 +8,7 @@ from vcode_mcp.prompt_handler import PROMPTS
|
|
|
8
8
|
from vcode_mcp.resource_handler import read_metrics_summary, read_report, read_rule
|
|
9
9
|
from vcode_mcp.tool_handler import handle_tool
|
|
10
10
|
|
|
11
|
-
mcp = MCPServer("vcode-analysis", version="0.
|
|
11
|
+
mcp = MCPServer("vcode-analysis", version="0.10.0")
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
# ── Tools ────────────────────────────────────────────────────────
|
|
@@ -61,7 +61,7 @@ def _run_review(target: str, config, args: dict) -> list[dict]:
|
|
|
61
61
|
reviewer.metrics_store = ms
|
|
62
62
|
reviewer._current_run_id = ms.record_scan_run(ScanRun(
|
|
63
63
|
repo_path=str(Path(target).resolve()), analyzer="code_review",
|
|
64
|
-
tool_version="0.
|
|
64
|
+
tool_version="0.10.0",
|
|
65
65
|
))
|
|
66
66
|
|
|
67
67
|
path = Path(target)
|
|
@@ -99,7 +99,7 @@ def _run_security(target: str, config, args: dict) -> list[dict]:
|
|
|
99
99
|
scanner.metrics_store = ms
|
|
100
100
|
scanner._current_run_id = ms.record_scan_run(ScanRun(
|
|
101
101
|
repo_path=str(Path(target).resolve()), analyzer="security",
|
|
102
|
-
tool_version="0.
|
|
102
|
+
tool_version="0.10.0",
|
|
103
103
|
))
|
|
104
104
|
|
|
105
105
|
path = Path(target)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vcode_analysis-0.9.0 → vcode_analysis-0.10.0}/docs/design/expert-review-response-2026-07.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|