feat(pipeline): support incremental runs and analysis caching

Reuse existing output directory by default instead of failing
Cache successful Gemini analysis results using content hashing
Skip unchanged files and retry failed analyses on subsequent runs
Update --force flag to explicitly delete and rebuild the output
This commit is contained in:
2026-04-02 11:03:04 +08:00
parent c73767073e
commit 0cf62d1ac5
4 changed files with 165 additions and 22 deletions

View File

@@ -28,8 +28,7 @@ GEMINI_MODEL=gemini-2.5-flash
```bash
./.venv/bin/python -m uipath_explainator \
/path/to/uipath-project \
--output-dir workspace/project-bundle \
--force
--output-dir workspace/project-bundle
```
常用参数:
@@ -38,10 +37,12 @@ GEMINI_MODEL=gemini-2.5-flash
- `--env-file`: 自定义 `.env` 路径
- `--model`: 临时覆盖 `.env` 里的模型名
- `--skip-analysis`: 只做复制、清理和剪枝,不调用 Gemini
- `--force`: 允许覆盖已有输出目录
- `--force`: 删除并重建已有输出目录;不加时会默认续跑,并跳过“已成功分析且源码未变化”的文件
- `--log-level`: 日志级别,支持 `DEBUG` / `INFO` / `WARNING` / `ERROR` / `CRITICAL`
- `--log-file`: 把完整日志同时写入文件,便于回溯扫描、剪枝和 Gemini 分析过程
中途中断后,直接对同一个 `--output-dir` 再运行一次即可继续。程序会复用 `docs/` 里的本地分析缓存,只把新增文件、内容有变化的文件,以及上次失败的文件重新发给 Gemini。
## 输出内容
输出目录现在是一个 bundle 目录,里面固定包含:
@@ -78,8 +79,7 @@ GEMINI_MODEL=gemini-2.5-flash
/path/to/uipath-project \
--output-dir workspace/project-bundle \
--log-level DEBUG \
--log-file workspace/project-bundle/run.log \
--force
--log-file workspace/project-bundle/run.log
```
`DEBUG` 会额外记录每个文件的复制、依赖解析、路径解析、剪枝、分析文档写出等细节。