@mycodemap/mycodemap 0.4.0 → 0.4.2
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.
- package/CHANGELOG.md +45 -0
- package/README.md +214 -221
- package/dist/cli/commands/analyze-options.d.ts +36 -0
- package/dist/cli/commands/analyze-options.d.ts.map +1 -0
- package/dist/cli/commands/analyze-options.js +147 -0
- package/dist/cli/commands/analyze-options.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +93 -4
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +592 -176
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/ci.d.ts +47 -1
- package/dist/cli/commands/ci.d.ts.map +1 -1
- package/dist/cli/commands/ci.js +208 -1
- package/dist/cli/commands/ci.js.map +1 -1
- package/dist/cli/commands/export.d.ts.map +1 -1
- package/dist/cli/commands/export.js +2 -2
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +8 -2
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +151 -22
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +2 -13
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ship/analyzer.d.ts +1 -1
- package/dist/cli/commands/ship/analyzer.d.ts.map +1 -1
- package/dist/cli/commands/ship/analyzer.js +8 -1
- package/dist/cli/commands/ship/analyzer.js.map +1 -1
- package/dist/cli/commands/ship/checker.d.ts +1 -1
- package/dist/cli/commands/ship/checker.d.ts.map +1 -1
- package/dist/cli/commands/ship/checker.js +17 -6
- package/dist/cli/commands/ship/checker.js.map +1 -1
- package/dist/cli/commands/ship/index.js +2 -2
- package/dist/cli/commands/ship/index.js.map +1 -1
- package/dist/cli/commands/ship/monitor.d.ts +17 -2
- package/dist/cli/commands/ship/monitor.d.ts.map +1 -1
- package/dist/cli/commands/ship/monitor.js +116 -29
- package/dist/cli/commands/ship/monitor.js.map +1 -1
- package/dist/cli/commands/ship/pipeline.d.ts.map +1 -1
- package/dist/cli/commands/ship/pipeline.js +97 -18
- package/dist/cli/commands/ship/pipeline.js.map +1 -1
- package/dist/cli/commands/ship/publisher.d.ts +12 -2
- package/dist/cli/commands/ship/publisher.d.ts.map +1 -1
- package/dist/cli/commands/ship/publisher.js +217 -37
- package/dist/cli/commands/ship/publisher.js.map +1 -1
- package/dist/cli/commands/ship/rules/quality-rules.d.ts +2 -2
- package/dist/cli/commands/ship/rules/quality-rules.d.ts.map +1 -1
- package/dist/cli/commands/ship/rules/quality-rules.js +53 -54
- package/dist/cli/commands/ship/rules/quality-rules.js.map +1 -1
- package/dist/cli/commands/ship/versioner.d.ts +1 -1
- package/dist/cli/commands/ship/versioner.d.ts.map +1 -1
- package/dist/cli/commands/ship/versioner.js +4 -2
- package/dist/cli/commands/ship/versioner.js.map +1 -1
- package/dist/cli/commands/workflow.js +4 -4
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/config-loader.d.ts +31 -0
- package/dist/cli/config-loader.d.ts.map +1 -0
- package/dist/cli/config-loader.js +235 -0
- package/dist/cli/config-loader.js.map +1 -0
- package/dist/cli/index.js +19 -64
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/removed-commands.d.ts +9 -0
- package/dist/cli/removed-commands.d.ts.map +1 -0
- package/dist/cli/removed-commands.js +48 -0
- package/dist/cli/removed-commands.js.map +1 -0
- package/dist/cli/storage-runtime.d.ts +8 -0
- package/dist/cli/storage-runtime.d.ts.map +1 -0
- package/dist/cli/storage-runtime.js +14 -0
- package/dist/cli/storage-runtime.js.map +1 -0
- package/dist/cli/tree-sitter-check.d.ts.map +1 -1
- package/dist/cli/tree-sitter-check.js +0 -1
- package/dist/cli/tree-sitter-check.js.map +1 -1
- package/dist/cli-new/commands/export.d.ts.map +1 -1
- package/dist/cli-new/commands/export.js +2 -2
- package/dist/cli-new/commands/export.js.map +1 -1
- package/dist/cli-new/commands/query.d.ts.map +1 -1
- package/dist/cli-new/commands/query.js +5 -4
- package/dist/cli-new/commands/query.js.map +1 -1
- package/dist/cli-new/index.d.ts.map +1 -1
- package/dist/cli-new/index.js +0 -2
- package/dist/cli-new/index.js.map +1 -1
- package/dist/core/analyzer.d.ts.map +1 -1
- package/dist/core/analyzer.js +7 -39
- package/dist/core/analyzer.js.map +1 -1
- package/dist/core/file-discovery.d.ts +17 -0
- package/dist/core/file-discovery.d.ts.map +1 -0
- package/dist/core/file-discovery.js +75 -0
- package/dist/core/file-discovery.js.map +1 -0
- package/dist/core/global-index.d.ts +5 -0
- package/dist/core/global-index.d.ts.map +1 -1
- package/dist/core/global-index.js +71 -21
- package/dist/core/global-index.js.map +1 -1
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +8 -0
- package/dist/generator/index.js.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -5
- package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.js +2 -5
- package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts +1 -5
- package/dist/infrastructure/parser/implementations/PythonParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonParser.js +1 -5
- package/dist/infrastructure/parser/implementations/PythonParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +1 -5
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js +1 -5
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.d.ts +0 -1
- package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.js +4 -29
- package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
- package/dist/infrastructure/storage/adapters/FileSystemStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js +24 -137
- package/dist/infrastructure/storage/adapters/FileSystemStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts +10 -18
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js +103 -146
- package/dist/infrastructure/storage/adapters/KuzuDBStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts +0 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/MemoryStorage.js +16 -136
- package/dist/infrastructure/storage/adapters/MemoryStorage.js.map +1 -1
- package/dist/infrastructure/storage/graph-helpers.d.ts +16 -0
- package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/graph-helpers.js +161 -0
- package/dist/infrastructure/storage/graph-helpers.js.map +1 -0
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/interface/config/index.d.ts +10 -1
- package/dist/interface/config/index.d.ts.map +1 -1
- package/dist/interface/types/index.d.ts +13 -0
- package/dist/interface/types/index.d.ts.map +1 -1
- package/dist/interface/types/storage.d.ts +1 -4
- package/dist/interface/types/storage.d.ts.map +1 -1
- package/dist/orchestrator/confidence.d.ts +9 -9
- package/dist/orchestrator/confidence.d.ts.map +1 -1
- package/dist/orchestrator/confidence.js +44 -67
- package/dist/orchestrator/confidence.js.map +1 -1
- package/dist/orchestrator/file-header-scanner.d.ts.map +1 -1
- package/dist/orchestrator/file-header-scanner.js +22 -31
- package/dist/orchestrator/file-header-scanner.js.map +1 -1
- package/dist/orchestrator/intent-router.d.ts +2 -11
- package/dist/orchestrator/intent-router.d.ts.map +1 -1
- package/dist/orchestrator/intent-router.js +58 -49
- package/dist/orchestrator/intent-router.js.map +1 -1
- package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/tool-orchestrator.js +6 -4
- package/dist/orchestrator/tool-orchestrator.js.map +1 -1
- package/dist/orchestrator/types.d.ts +113 -2
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js +29 -0
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/orchestrator/workflow/config.d.ts +4 -12
- package/dist/orchestrator/workflow/config.d.ts.map +1 -1
- package/dist/orchestrator/workflow/config.js +4 -6
- package/dist/orchestrator/workflow/config.js.map +1 -1
- package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -1
- package/dist/orchestrator/workflow/git-analyzer.js +9 -19
- package/dist/orchestrator/workflow/git-analyzer.js.map +1 -1
- package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -1
- package/dist/orchestrator/workflow/phase-inheritance.js +14 -23
- package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -1
- package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -1
- package/dist/orchestrator/workflow/result-fusion.js +9 -11
- package/dist/orchestrator/workflow/result-fusion.js.map +1 -1
- package/dist/orchestrator/workflow/templates.d.ts +4 -1
- package/dist/orchestrator/workflow/templates.d.ts.map +1 -1
- package/dist/orchestrator/workflow/templates.js +49 -207
- package/dist/orchestrator/workflow/templates.js.map +1 -1
- package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -1
- package/dist/orchestrator/workflow/test-linker.js +12 -24
- package/dist/orchestrator/workflow/test-linker.js.map +1 -1
- package/dist/orchestrator/workflow/types.d.ts +11 -8
- package/dist/orchestrator/workflow/types.d.ts.map +1 -1
- package/dist/orchestrator/workflow/types.js +8 -1
- package/dist/orchestrator/workflow/types.js.map +1 -1
- package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -1
- package/dist/orchestrator/workflow/visualizer.js +7 -9
- package/dist/orchestrator/workflow/visualizer.js.map +1 -1
- package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -1
- package/dist/orchestrator/workflow/workflow-context.js +3 -5
- package/dist/orchestrator/workflow/workflow-context.js.map +1 -1
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +0 -4
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/workflow/workflow-orchestrator.js +7 -99
- package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -1
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +2 -2
- package/dist/parser/index.js.map +1 -1
- package/dist/plugins/index.d.ts +5 -3
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +19 -8
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/plugin-loader.d.ts +21 -6
- package/dist/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/plugins/plugin-loader.js +170 -54
- package/dist/plugins/plugin-loader.js.map +1 -1
- package/dist/plugins/plugin-registry.d.ts +7 -4
- package/dist/plugins/plugin-registry.d.ts.map +1 -1
- package/dist/plugins/plugin-registry.js +62 -14
- package/dist/plugins/plugin-registry.js.map +1 -1
- package/dist/plugins/types.d.ts +16 -6
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -1
- package/dist/server/handlers/AnalysisHandler.d.ts +16 -2
- package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
- package/dist/server/handlers/AnalysisHandler.js +31 -47
- package/dist/server/handlers/AnalysisHandler.js.map +1 -1
- package/dist/server/routes/api.d.ts.map +1 -1
- package/dist/server/routes/api.js +31 -12
- package/dist/server/routes/api.js.map +1 -1
- package/docs/AI_ASSISTANT_SETUP.md +3 -1
- package/docs/PUBLISHING.md +18 -4
- package/docs/SETUP_GUIDE.md +41 -17
- package/docs/ai-guide/COMMANDS.md +107 -103
- package/docs/ai-guide/INTEGRATION.md +23 -21
- package/docs/ai-guide/OUTPUT.md +206 -10
- package/docs/ai-guide/PATTERNS.md +64 -15
- package/docs/ai-guide/PROMPTS.md +50 -12
- package/docs/ai-guide/QUICKSTART.md +35 -19
- package/docs/ai-guide/README.md +22 -4
- package/docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md +159 -434
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-PRD.md +169 -261
- package/docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md +201 -1259
- package/docs/product-specs/README.md +8 -1
- package/docs/rules/architecture-guardrails.md +1 -2
- package/docs/rules/engineering-with-codex-openai.md +15 -9
- package/docs/rules/validation.md +26 -4
- package/mycodemap.config.schema.json +76 -5
- package/package.json +1 -1
- package/scripts/pre-release-check.js +21 -3
- package/scripts/sync-analyze-docs.js +500 -0
- package/scripts/validate-ai-docs.js +54 -1
- package/scripts/validate-docs.js +746 -26
- package/dist/cli/commands/server.d.ts +0 -9
- package/dist/cli/commands/server.d.ts.map +0 -1
- package/dist/cli/commands/server.js +0 -68
- package/dist/cli/commands/server.js.map +0 -1
- package/dist/cli-new/commands/server.d.ts +0 -13
- package/dist/cli-new/commands/server.d.ts.map +0 -1
- package/dist/cli-new/commands/server.js +0 -94
- package/dist/cli-new/commands/server.js.map +0 -1
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts +0 -49
- package/dist/infrastructure/storage/adapters/Neo4jStorage.d.ts.map +0 -1
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js +0 -222
- package/dist/infrastructure/storage/adapters/Neo4jStorage.js.map +0 -1
|
@@ -1,322 +1,230 @@
|
|
|
1
|
-
# CodeMap MVP3
|
|
1
|
+
# CodeMap MVP3 架构重构产品需求文档(PRD,v1.3 同步版)
|
|
2
2
|
|
|
3
|
-
> **版本**: v1.
|
|
4
|
-
> **状态**:
|
|
5
|
-
> **日期**: 2026-03-
|
|
3
|
+
> **版本**: v1.3-sync
|
|
4
|
+
> **状态**: Shipped baseline / archived design synced
|
|
5
|
+
> **日期**: 2026-03-25
|
|
6
6
|
> **负责人**: Architecture Team
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
## 1.
|
|
10
|
+
## 1. 文档目的
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
本文档不再把早期 MVP3 设计稿中的所有目标都视为“当前已实现”,而是明确区分:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| 层间耦合度高 | `cli/` 直接依赖 `core/analyzer`,难以测试 | CLI 命令难以 mock 分析器 |
|
|
17
|
-
| 存储层硬编码 | 输出只能是 JSON/Markdown,无法扩展 | 无法支持图数据库查询 |
|
|
18
|
-
| 语言支持受限 | 仅支持 TS/JS/Go,错失 Python/Java 用户 | 用户流失到 CodeGraphContext |
|
|
19
|
-
| 缺少服务层 | 业务逻辑分散在 CLI 命令中 | 难以复用核心能力 |
|
|
14
|
+
- **已交付基线**:当前仓库在 `v1.3` 已落地的架构与产品边界
|
|
15
|
+
- **Deferred**:仍保留为未来候选、但尚未成为当前产品事实的内容
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
│ ✅ CLI 增强: 基础可视化 + 交互式查询 │
|
|
32
|
-
│ ✅ 向后兼容: 现有用户零成本迁移 │
|
|
33
|
-
│ │
|
|
34
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
35
|
-
```
|
|
19
|
+
## 2. 背景
|
|
20
|
+
|
|
21
|
+
MVP3 重构的原始目的,是把 CodeMap 从“CLI 直接拼接分析逻辑的 brownfield 工具”收敛为:
|
|
22
|
+
|
|
23
|
+
1. 有清晰层次边界的 AI-first 代码地图工具
|
|
24
|
+
2. 有稳定存储契约的分析系统
|
|
25
|
+
3. 有可扩展 parser 注册机制的多语言基础设施
|
|
26
|
+
4. 有统一文档和验证护栏的可维护产品面
|
|
36
27
|
|
|
37
28
|
---
|
|
38
29
|
|
|
39
|
-
##
|
|
30
|
+
## 3. 当前已交付基线(`v1.3`)
|
|
40
31
|
|
|
41
|
-
###
|
|
32
|
+
### 3.1 架构边界
|
|
42
33
|
|
|
43
|
-
|
|
34
|
+
当前仓库已经形成如下稳定层次:
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
| 层级 | 路径 | 当前职责 |
|
|
37
|
+
|------|------|----------|
|
|
38
|
+
| Interface | `src/interface/` | 类型定义、配置契约 |
|
|
39
|
+
| Infrastructure | `src/infrastructure/` | storage、parser、repositories 等技术实现 |
|
|
40
|
+
| Domain | `src/domain/` | 实体、领域服务、仓储接口 |
|
|
41
|
+
| Server | `src/server/` | **内部** transport / handler 层 |
|
|
42
|
+
| CLI | `src/cli/` | 公共命令面、参数解析、输出编排 |
|
|
49
43
|
|
|
50
|
-
|
|
44
|
+
**边界要求**:
|
|
51
45
|
|
|
52
|
-
|
|
46
|
+
- `Server Layer` 是内部架构层,不等于公共 `mycodemap server` 命令
|
|
47
|
+
- 公共 CLI 不再暴露 `server`、`watch`、`report`、`logs`
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
- 可选图数据库存储后端
|
|
56
|
-
- 复杂查询性能 < 100ms
|
|
57
|
-
- 支持跨语言调用链分析
|
|
49
|
+
### 3.2 存储产品面
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
当前正式存储 surface 为:
|
|
60
52
|
|
|
61
|
-
|
|
53
|
+
| 类型 | 状态 | 说明 |
|
|
54
|
+
|------|------|------|
|
|
55
|
+
| `filesystem` | shipped | 默认、最稳定 |
|
|
56
|
+
| `memory` | shipped | 测试/内存场景 |
|
|
57
|
+
| `kuzudb` | shipped | 当前图存储主线 |
|
|
58
|
+
| `auto` | shipped surface | 配置面存在,但当前仍保守落到 `filesystem` |
|
|
59
|
+
| `neo4j` | removed | 不再是正式支持 backend;旧配置返回显式迁移错误 |
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
- CLI 字符画可视化
|
|
65
|
-
- 交互式命令补全
|
|
66
|
-
- 进度条和颜色输出
|
|
61
|
+
### 3.3 解析器能力
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
当前已落地的 parser 实现为:
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
| 语言族 | 当前实现 |
|
|
66
|
+
|--------|----------|
|
|
67
|
+
| TypeScript / JavaScript | `TypeScriptParser` |
|
|
68
|
+
| Go | `GoParser` |
|
|
69
|
+
| Python | `PythonParser` |
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
说明:
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
│ MVP3 分层架构 │
|
|
77
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
78
|
-
│ │
|
|
79
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
80
|
-
│ │ Layer 5: CLI Layer │ │
|
|
81
|
-
│ │ - 命令解析、参数校验、输出格式化 │ │
|
|
82
|
-
│ │ - 仅处理 stdin/stdout/stderr │ │
|
|
83
|
-
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
84
|
-
│ │ │
|
|
85
|
-
│ ▼ │
|
|
86
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
87
|
-
│ │ Layer 4: Server Layer ⭐ 新增 │ │
|
|
88
|
-
│ │ - 业务逻辑编排、用例实现 │ │
|
|
89
|
-
│ │ - 协调 Domain 和 Infrastructure 层 │ │
|
|
90
|
-
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
91
|
-
│ │ │
|
|
92
|
-
│ ▼ │
|
|
93
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
94
|
-
│ │ Layer 3: Domain Layer │ │
|
|
95
|
-
│ │ - 核心业务逻辑、实体、值对象 │ │
|
|
96
|
-
│ │ - 分析器、依赖图构建、符号索引 │ │
|
|
97
|
-
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
98
|
-
│ │ │
|
|
99
|
-
│ ▼ │
|
|
100
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
101
|
-
│ │ Layer 2: Infrastructure Layer │ │
|
|
102
|
-
│ │ - 存储抽象、解析器、缓存、文件系统 │ │
|
|
103
|
-
│ │ - 技术实现细节 │ │
|
|
104
|
-
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
105
|
-
│ │ │
|
|
106
|
-
│ ▼ │
|
|
107
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
108
|
-
│ │ Layer 1: Interface Layer │ │
|
|
109
|
-
│ │ - 类型定义、配置接口、外部 API 抽象 │ │
|
|
110
|
-
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
111
|
-
│ │
|
|
112
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
113
|
-
```
|
|
73
|
+
- `LanguageId` 仍保留未来扩展空间
|
|
74
|
+
- 但当前文档不再把 Java / Rust / C/C++ / 14 种语言描述成已交付事实
|
|
114
75
|
|
|
115
|
-
### 3.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
| { type: 'neo4j'; uri: string; username: string; password: string };
|
|
123
|
-
|
|
124
|
-
// 自动选择策略
|
|
125
|
-
interface AutoStorageConfig {
|
|
126
|
-
type: 'auto';
|
|
127
|
-
thresholds: {
|
|
128
|
-
useGraphDBWhenFileCount: number; // 默认 500
|
|
129
|
-
useGraphDBWhenNodeCount: number; // 默认 10000
|
|
130
|
-
};
|
|
131
|
-
}
|
|
76
|
+
### 3.4 公共 CLI 面
|
|
77
|
+
|
|
78
|
+
当前公共命令面聚焦于代码地图与代码分析:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
init / generate / query / deps / cycles / complexity / impact
|
|
82
|
+
analyze / ci / workflow / export / ship
|
|
132
83
|
```
|
|
133
84
|
|
|
134
|
-
|
|
85
|
+
其中:
|
|
135
86
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
| SA-02 | KùzuDB 嵌入式存储 | P1 | 查询性能比文件系统快 10x |
|
|
140
|
-
| SA-03 | Neo4j 远程存储 | P2 | 支持企业级部署 |
|
|
141
|
-
| SA-04 | 自动选择策略 | P1 | 根据项目规模自动选择后端 |
|
|
142
|
-
| SA-05 | 存储迁移工具 | P2 | FS ↔ GraphDB 双向迁移 |
|
|
87
|
+
- `analyze` 的公共契约固定为 `find` / `read` / `link` / `show`
|
|
88
|
+
- `workflow` 是 **analysis-only** 能力,只编排 `find → read → link → show`
|
|
89
|
+
- `ship` 仍是公开的过渡能力,但 must-pass 检查已复用 `ci`
|
|
143
90
|
|
|
144
|
-
### 3.
|
|
91
|
+
### 3.5 文档与验证护栏
|
|
145
92
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
│ └── Go │
|
|
155
|
-
│ │
|
|
156
|
-
│ Phase 2 (P1): 扩展语言 (MVP3 目标) │
|
|
157
|
-
│ ├── Python 🐍 (最高优先级) │
|
|
158
|
-
│ ├── Java ☕ │
|
|
159
|
-
│ ├── Rust 🦀 │
|
|
160
|
-
│ └── C/C++ │
|
|
161
|
-
│ │
|
|
162
|
-
│ Phase 3 (P2): 后续扩展 │
|
|
163
|
-
│ ├── C# │
|
|
164
|
-
│ ├── Ruby │
|
|
165
|
-
│ ├── PHP │
|
|
166
|
-
│ ├── Swift │
|
|
167
|
-
│ ├── Kotlin │
|
|
168
|
-
│ ├── Dart │
|
|
169
|
-
│ └── Perl │
|
|
170
|
-
│ │
|
|
171
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
172
|
-
```
|
|
93
|
+
当前已交付的验证基线:
|
|
94
|
+
|
|
95
|
+
- `npm run docs:check`
|
|
96
|
+
- `npm run typecheck`
|
|
97
|
+
- `npm run lint`(当前允许 warning baseline,只阻断 error)
|
|
98
|
+
- `npm test`
|
|
99
|
+
- `npm run build`
|
|
100
|
+
- `node dist/cli/index.js ci check-docs-sync`
|
|
173
101
|
|
|
174
|
-
|
|
102
|
+
---
|
|
175
103
|
|
|
176
|
-
|
|
177
|
-
|------|--------|--------|--------|
|
|
178
|
-
| Python | Tree-sitter | 中 | P0 |
|
|
179
|
-
| Java | Tree-sitter | 中 | P1 |
|
|
180
|
-
| Rust | Tree-sitter | 中 | P1 |
|
|
181
|
-
| C/C++ | Tree-sitter | 高 | P1 |
|
|
182
|
-
| C# | Tree-sitter | 中 | P2 |
|
|
183
|
-
| Ruby | Tree-sitter | 低 | P2 |
|
|
184
|
-
| PHP | Tree-sitter | 低 | P2 |
|
|
185
|
-
| Swift | Tree-sitter | 中 | P2 |
|
|
186
|
-
| Kotlin | Tree-sitter | 中 | P2 |
|
|
187
|
-
| Dart | Tree-sitter | 低 | P2 |
|
|
188
|
-
| Perl | Tree-sitter | 低 | P2 |
|
|
104
|
+
## 4. 产品需求状态
|
|
189
105
|
|
|
190
|
-
###
|
|
106
|
+
### 4.1 已满足
|
|
191
107
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
│ ├── src/core/analyzer.ts │
|
|
211
|
-
│ └── src/parser/index.ts │
|
|
212
|
-
│ │
|
|
213
|
-
│ 3. 热力图 (heatmap) │
|
|
214
|
-
│ $ mycodemap viz heatmap --metric complexity │
|
|
215
|
-
│ 🔴 src/orchestrator/workflow.ts (复杂度: 45) │
|
|
216
|
-
│ 🟡 src/cli/commands/query.ts (复杂度: 28) │
|
|
217
|
-
│ 🟢 src/cache/lru-cache.ts (复杂度: 12) │
|
|
218
|
-
│ │
|
|
219
|
-
│ 4. 进度条和 Spinner │
|
|
220
|
-
│ $ mycodemap generate │
|
|
221
|
-
│ [████████████████████] 85% | 正在分析 src/core/analyzer.ts │
|
|
222
|
-
│ │
|
|
223
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
224
|
-
```
|
|
108
|
+
| 需求 | 当前状态 |
|
|
109
|
+
|------|----------|
|
|
110
|
+
| 五层架构与命名边界稳定 | 已满足 |
|
|
111
|
+
| Kùzu-only 图存储主线 | 已满足 |
|
|
112
|
+
| 历史 `neo4j` 配置迁移诊断 | 已满足 |
|
|
113
|
+
| 解析器注册机制与 3 类实现 | 已满足 |
|
|
114
|
+
| `analyze` / `workflow` / `server` 边界收口 | 已满足 |
|
|
115
|
+
| docs/CI guardrail 自动化 | 已满足 |
|
|
116
|
+
|
|
117
|
+
### 4.2 Deferred
|
|
118
|
+
|
|
119
|
+
| 候选项 | 当前状态 |
|
|
120
|
+
|--------|----------|
|
|
121
|
+
| 更丰富的 auto heuristic 存储切换 | Deferred |
|
|
122
|
+
| Java / Rust / C/C++ 等更多 parser 实现 | Deferred |
|
|
123
|
+
| `viz` / `tui` / 更丰富 CLI 可视化 | Deferred |
|
|
124
|
+
| 公共 HTTP API / `mycodemap server` 产品面 | Deferred |
|
|
125
|
+
| 更深的 Kùzu-native 查询优化 | Deferred |
|
|
225
126
|
|
|
226
|
-
|
|
127
|
+
### 4.3 明确不在当前基线内
|
|
227
128
|
|
|
228
|
-
|
|
|
229
|
-
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
| VIZ-04 | 进度条/Spinner | P0 | 所有耗时命令 |
|
|
234
|
-
| VIZ-05 | 颜色主题 | P2 | `--theme dark/light` |
|
|
235
|
-
| VIZ-06 | 交互式 TUI | P2 | `mycodemap tui` |
|
|
129
|
+
| 项目 | 处理原则 |
|
|
130
|
+
|------|----------|
|
|
131
|
+
| 恢复 `neo4j` 正式支持 | 不在当前范围 |
|
|
132
|
+
| 把 `Server Layer` 重新包装成公共产品面 | 不在当前范围 |
|
|
133
|
+
| 把 workflow 扩回实现/提交/CI 编排 | 不在当前范围 |
|
|
236
134
|
|
|
237
135
|
---
|
|
238
136
|
|
|
239
|
-
##
|
|
137
|
+
## 5. 用户价值
|
|
240
138
|
|
|
241
|
-
###
|
|
139
|
+
### 5.1 AI / Agent 用户
|
|
242
140
|
|
|
243
|
-
|
|
244
|
-
|------|------|-----------|----------|
|
|
245
|
-
| 首次索引 (1000 文件) | ~30s | < 20s | Fast 模式 |
|
|
246
|
-
| 查询响应时间 | ~500ms | < 100ms (GraphDB) | 符号查询 |
|
|
247
|
-
| 内存占用 | ~500MB | < 1GB | 5000 文件项目 |
|
|
248
|
-
| 增量更新 | ~5s | < 3s | 修改 1 个文件 |
|
|
141
|
+
需求:
|
|
249
142
|
|
|
250
|
-
|
|
143
|
+
- 拿到稳定、机器可读、边界清晰的代码上下文
|
|
144
|
+
- 不被不稳定的命令面和文档漂移误导
|
|
251
145
|
|
|
252
|
-
|
|
253
|
-
- **输出兼容**: `AI_MAP.md` / `CONTEXT.md` 格式保持不变
|
|
254
|
-
- **CLI 兼容**: 所有现有命令和参数保持不变
|
|
146
|
+
当前交付:
|
|
255
147
|
|
|
256
|
-
|
|
148
|
+
- 公共命令面已收口
|
|
149
|
+
- 输出契约已固定
|
|
150
|
+
- docs guardrail 与 CI 能阻止高信号漂移
|
|
257
151
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
152
|
+
### 5.2 Python / Go / TypeScript 团队
|
|
153
|
+
|
|
154
|
+
需求:
|
|
155
|
+
|
|
156
|
+
- 能在当前主流仓库里复用统一代码地图能力
|
|
157
|
+
- 不需要等到“14 种语言全部完成”才使用 MVP3
|
|
158
|
+
|
|
159
|
+
当前交付:
|
|
160
|
+
|
|
161
|
+
- TypeScript/JavaScript、Go、Python 已有 parser 实现
|
|
162
|
+
- 解析器接口保留未来扩展余地
|
|
163
|
+
|
|
164
|
+
### 5.3 大仓库维护者
|
|
165
|
+
|
|
166
|
+
需求:
|
|
167
|
+
|
|
168
|
+
- 能切换到图存储后端
|
|
169
|
+
- 遇到旧配置时有清晰迁移语义
|
|
170
|
+
|
|
171
|
+
当前交付:
|
|
172
|
+
|
|
173
|
+
- `filesystem` / `memory` / `kuzudb` / `auto` 为正式配置面
|
|
174
|
+
- 旧 `neo4j` 配置会显式报错,不再静默 fallback
|
|
261
175
|
|
|
262
176
|
---
|
|
263
177
|
|
|
264
|
-
##
|
|
178
|
+
## 6. 非功能基线
|
|
265
179
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
│ v3.0.0-stable │
|
|
286
|
-
│ └── 正式发布 │
|
|
287
|
-
│ │
|
|
288
|
-
│ v3.1.0+ │
|
|
289
|
-
│ └── 剩余 6 种语言 + Neo4j 后端 │
|
|
290
|
-
│ │
|
|
291
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
292
|
-
```
|
|
180
|
+
### 6.1 兼容性
|
|
181
|
+
|
|
182
|
+
- 当前正式配置文件名为 `mycodemap.config.json`
|
|
183
|
+
- 对旧 `codemap.config.json` 保留兼容读取与迁移提示
|
|
184
|
+
- 输出仍围绕 `AI_MAP.md`、`codemap.json` 及相关导出格式组织
|
|
185
|
+
|
|
186
|
+
### 6.2 可维护性
|
|
187
|
+
|
|
188
|
+
- 文档、实现、测试、CI 必须使用同一套边界措辞
|
|
189
|
+
- 架构文档必须持续区分“内部 Server Layer”与“公共 CLI surface”
|
|
190
|
+
|
|
191
|
+
### 6.3 性能表述
|
|
192
|
+
|
|
193
|
+
当前文档不再把早期草案中的 `<100ms` GraphDB 指标写成现成 SLA。
|
|
194
|
+
|
|
195
|
+
更准确的当前表达是:
|
|
196
|
+
|
|
197
|
+
- Kùzu 路径已接入正式产品面
|
|
198
|
+
- 更激进的 DB-native 查询优化属于后续候选项,而非 `v1.3` 既成事实
|
|
293
199
|
|
|
294
200
|
---
|
|
295
201
|
|
|
296
|
-
##
|
|
202
|
+
## 7. 发布历史(按已交付里程碑)
|
|
297
203
|
|
|
298
|
-
|
|
|
299
|
-
|
|
300
|
-
|
|
|
301
|
-
|
|
|
302
|
-
|
|
|
303
|
-
|
|
|
204
|
+
| 里程碑 | 交付重点 |
|
|
205
|
+
|--------|----------|
|
|
206
|
+
| `v1.0` | AI-first 定位、公共 CLI 收口、analyze/workflow/ship/docs guardrail 基线 |
|
|
207
|
+
| `v1.1` | 插件扩展点产品化 |
|
|
208
|
+
| `v1.2` | 图数据库后端生产化 |
|
|
209
|
+
| `v1.3` | Kùzu-only 收敛、高信号 debt 清偿、docs/CI 自动验证闭环 |
|
|
304
210
|
|
|
305
211
|
---
|
|
306
212
|
|
|
307
|
-
##
|
|
213
|
+
## 8. 风险与缓解
|
|
308
214
|
|
|
309
|
-
|
|
215
|
+
| 风险 | 当前状态 | 缓解策略 |
|
|
216
|
+
|------|----------|----------|
|
|
217
|
+
| 文档继续把历史设计写成当前现实 | 高信号风险 | 持续运行 `docs:check` 与 `ci check-docs-sync` |
|
|
218
|
+
| `Server Layer` 与公共 `server` 命令再次混淆 | 高信号风险 | 在 README / AI docs / 架构文档统一措辞 |
|
|
219
|
+
| `auto` 被误读为“已完成智能切换” | 中 | 文档明确写明当前仍保守落到 `filesystem` |
|
|
220
|
+
| repo-wide lint warnings 演变成阻断项 | 中 | 单独开新 milestone 清理 warning baseline |
|
|
310
221
|
|
|
311
|
-
|
|
312
|
-
|------|------|
|
|
313
|
-
| Server Layer | 业务逻辑层,协调 Domain 和 Infrastructure |
|
|
314
|
-
| Storage Abstraction | 存储抽象接口,支持多种后端实现 |
|
|
315
|
-
| Tree-sitter | 增量解析库,支持多语言 |
|
|
316
|
-
| KùzuDB | 高性能嵌入式图数据库 |
|
|
222
|
+
---
|
|
317
223
|
|
|
318
|
-
|
|
224
|
+
## 9. 参考文档
|
|
319
225
|
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
226
|
+
- `docs/product-specs/MVP3-ARCHITECTURE-COMPARISON.md`
|
|
227
|
+
- `docs/product-specs/MVP3-ARCHITECTURE-REDESIGN-TECH-PRD.md`
|
|
228
|
+
- `.planning/PROJECT.md`
|
|
229
|
+
- `.planning/REQUIREMENTS.md`
|
|
230
|
+
- `.planning/v1.3-MILESTONE-AUDIT.md`
|