- wait_for_page_transition: XML 持续返回 other 超过 quick_timeout 后自动启用视觉兜底 - _xml_or_vision_click: 优先视觉 API 找按钮(H5 WebView XML 不可见) - 自动处理媒体访问权限弹窗 - scrcpy 改为非阻塞 Popen 启动,绑定当前设备 serial 避免多设备冲突 - 新增 auto_calibrate_from_recording.py / reconnect-phone.sh - postJson 前端异常捕获
29 lines
3.0 KiB
Markdown
29 lines
3.0 KiB
Markdown
<!-- 本文件由 /wrap-up 自动生成并覆盖,勿手工编辑;生成器见 wrap-up skill references/codemap.md -->
|
||
# 铁路系统发票 · 代码图谱索引 (CODEMAP)
|
||
|
||
> 由 codebase-memory-mcp 于 2026-07-17 生成 · 图谱 1088 节点 / 3812 边 · 活文件,每次 /wrap-up 覆盖
|
||
|
||
## 一、给能连 MCP 的 agent(首选)
|
||
|
||
本项目已索引,project 名 `Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain`。直接查图谱代替 grep(省 ~120x token):
|
||
|
||
- 架构总览:`get_architecture(project="Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain", aspects=["all"])`
|
||
- 查函数/类:`search_graph(project="Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain", name_pattern=".*X.*")`
|
||
- 调用链:`trace_path(project="Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain", function_name="X", direction="both")`
|
||
- 死代码:`search_graph(project="Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain", max_degree=0, exclude_entry_points=true)`
|
||
- Cypher:`query_graph(project="Users-qoragufimo390gmail.com-Documents-_e99d9ee9a1b9e79bae-works-autotrain", query="MATCH ...")`
|
||
|
||
未连 MCP?CLI 等价:`~/.local/bin/codebase-memory-mcp cli <tool> '<json>'`
|
||
|
||
## 二、结构画像快照(连不上 MCP 时读这段就够)
|
||
|
||
- **规模**:1088 节点 / 3812 边 / 36 Python+Bash 文件
|
||
- **语言**:Python 32 · Bash 4
|
||
- **节点构成**:Function 350 · Section 296 · Variable 225 · File/Module 64 · Method 53 · Class 20 · Folder 13
|
||
- **包/目录**:`scripts/`(250 节点,主逻辑)· `nextgen/`(149 节点,重构中的新一代)· `tests/`(12 节点)— 旧 scripts 彼此通过 CSV/配置文件耦合(IMPORTS 边 55 条,含 nextgen 内聚)
|
||
- **入口**(9 个 main):`invoice_tool.py`(主 CLI ~3200 行)/ `web_ui.py`(HTTP 服务 :8765)/ `vision_fallback.py`(视觉层)/ `record_step.py`(录制)/ `record_android_flow.py`(流录制)/ `add_invoice_passenger_name.py`(PDF 加姓名)/ `annotate_roster_invoices.py`(名单标状态)/ `device_calibrate.py`(设备校准)/ `nextgen/scripts/autotrain_next.py`(新一代入口)
|
||
- **热点函数**(by fan-in):`dict.get`(155) · `len`(62) · `print`(53) · `list.append`(49) · `run_adb`(24, invoice_tool) · `project_path`(21) · `adb_dump_nodes`(17) · `device.run`(15, nextgen) · `adb_visible_texts`(15)
|
||
- **边类型**:DEFINES 1380 · CALLS 1297 · USAGE 445 · WRITES 223 · SEMANTICALLY_RELATED 177 · CONTAINS_FILE 64 · IMPORTS 55 · DEFINES_METHOD 48 · RAISES 34 · SIMILAR_TO 33 · TESTS 29 · FILE_CHANGES_WITH 10
|
||
- **架构层**:`scripts` / `nextgen` = entry layer(有入口、只外调);builtins(dict/str/list/len/int/print)= core layer
|
||
- **Leiden 社区**:10 个 cluster,最大 58 成员(do_POST/main/do_GET Web UI 层)、55 成员(android_invoice_step/android_vision_page_run 状态机)、44 成员(open_next/download_and_continue 开票子流程)、39 成员(device_runtime 设备层)
|