docs(graphify): 添加知识图谱使用指南

- CLAUDE.md: graphify 从英文规则扩展为中文开发流程指南
  - 定义 5 种使用场景(接手任务/排查bug/理解模块/代码更新/架构审查)
  - 融入闭环工作法,优先级:graphify query > path > Grep/Read
- wiki/index.md: 关键数字添加 Graphify 行 + 模块导航新增开发工具分区
- wiki/infrastructure.md: §3 常用命令添加 Graphify 子节
This commit is contained in:
iven
2026-05-25 14:03:50 +08:00
parent 8ad4329632
commit 8027cdd1d9
3 changed files with 43 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
## 关键数字
> 最后更新: 2026-05-24 | 数据截止: feat/media-library-banner 分支(小程序 DevTools 卡死排查 + 构建优化)
> 最后更新: 2026-05-25 | 数据截止: feat/media-library-banner 分支(小程序 DevTools 卡死排查 + 构建优化)
| 指标 | 值 |
|------|-----|
@@ -28,6 +28,7 @@
| 依赖版本 | 全部最新主版本线Rust edition 2024 |
| API 文档 | `http://localhost:3000/api/docs/openapi.json` |
| Git 提交 | **996 次** |
| Graphify 知识图谱 | **18,517 节点** / 22,666 边 / 1,841 社区(`graphify-out/`AST 解析,无 API 成本) |
| 系统分析评分 | **6.9/10 (B)**多专家组生产就绪度分析2026-05-21业务 8.5 / 医疗合规 6.5 / 前端 8.0 / 安全 7.5 / DevOps 4.0 |
| 审计状态 | V1: 83% → V2: 85%P0 安全修复已完成E2E 测试 157 端点(Health 63% / AI+Plugin 92.4%)CRITICAL×2 待修复 |
| 角色测试 | R01-R05 全角色验证完成86.5% 通过率5 个 BUG 已修复;小程序 MP 多角色 96.2% 通过率 |
@@ -180,6 +181,9 @@
- [[frontend]] — React 19 SPA · 健康管理页面29 活跃路由 + 6 冻结 + 工作台组件)
- [[testing]] — 验证清单 · 测试分布 · 性能基准
### 开发工具
- **graphify** — 代码知识图谱18,517 节点 / 22,666 边 / 1,841 社区)。接手新任务时先 `graphify query "概念"` 定位相关代码,再 `graphify path "A" "B"` 追踪调用链,比盲目 Grep 更精准。代码改动后运行 `graphify update .` 增量更新AST-only秒级完成。详见 `CLAUDE.md` §graphify。
## 核心架构问答
**为什么 erp-health 用原生模块而非 WASM 插件?** 医疗业务需要 18 强类型实体、自定义 API趋势分析/统计报表)、文件上传(化验单/体检报告)、未来 AI 集成,超出 WASM 插件能力范围。详见 [[erp-health]]。

View File

@@ -158,6 +158,17 @@ wasm-tools component new target/wasm32-unknown-unknown/release/erp_plugin_test_s
cargo test -p erp-plugin-prototype # 运行插件集成测试
```
### Graphify 知识图谱
```bash
python -m graphify query "BLEConnection" # 搜索节点(比 Grep 更精准,按调用/引用关系)
python -m graphify path "A" "B" # 两个模块间的最短路径
python -m graphify explain "ArticleDetail" # 自然语言解释节点及其邻居
python -m graphify update . # 增量更新图谱AST-only秒级完成
```
> **开发流程中的使用:** 接手新任务时先 `graphify query` 定位相关代码 → `graphify path` 追踪调用链 → 再 Grep/Read 确认具体内容。代码改动后运行 `graphify update .` 保持图谱最新。详见 `CLAUDE.md` §graphify。
## 4. 代码逻辑
### 一键启动(推荐)
@@ -196,6 +207,7 @@ cd apps/web && pnpm install && pnpm dev
| 日期 | 变更 |
|------|------|
| 2026-05-25 | 添加 Graphify 知识图谱工具命令query/path/explain/update |
| 2026-05-25 | 明确 dev:weapp vs build:weapp 构建模式区分,记录 .env.production 导致 DevTools 卡死的陷阱 |
| 2026-04-26 | 从 CLAUDE.md 迁移常用命令§9 |
| 2026-04-25 | 外部化微信凭据和健康加密密钥为环境变量;添加 4 个新的必设环境变量 |