Commit Graph

243 Commits

Author SHA1 Message Date
zhou 9573f1f2a2 refactor: 质量收尾 — diagnostics.py pragma 清理(4 处:1 激活 3 删除)、context.py 与 reseticoncache.py 覆盖率提升至 100%、README 同步 pyrefly、iter-06~15 归档到 skills/pyflowx-development/SKILL.md。
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 15:45:21 +08:00
zhou 18ffae8390 perf: 性能优化深入 — build_call_args fn-no-deps 快速路径(3.7x)、JSONBackend batch 延迟验证(16.5%)、from_specs 批量注册;新增 8 个高级基准场景;pyproject 加 search-path 解析 benchmarks 包。
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 15:28:52 +08:00
zhou 5831c92f97 fix(ops): 修复 dockercmd/msdownload/sglang 的 check=False 静默失败问题,改用 check=True + try/except 打印 rich 错误信息;taskkill 检查 returncode 打印结果;clr/which 加注释说明 check=False 原因;补 9 个错误路径测试覆盖 CalledProcessError/FileNotFoundError。
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 14:44:48 +08:00
zhou 02ef858718 feat: CLI 体验增强 — yamlrun --list 过滤, graph --color-by tag 着色, pf info 工具详情, pf completion shell 补全
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 14:35:16 +08:00
zhou 5e6daa554f feat: 观测性增强 — RunReport.run_id 贯穿日志/序列化, 结构化 extra 字段, profile() 便捷方法
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 14:08:18 +08:00
zhou 520694f2df feat: 失败诊断增强 — RunReport.diagnose() 根因分析与依赖链回溯
CI / Lint, Typecheck & Test (push) Has been cancelled
新增 diagnostics 模块:根因识别、依赖链 BFS 回溯、相似失败聚类、
常见异常可操作建议;TaskFailedError 携带 report 供 CLI 打印诊断摘要。
2026-07-07 13:52:43 +08:00
zhou 8d626f606e feat: 新增 pf graph 终端 DAG 可视化命令与 yamlrun --progress 选项
CI / Lint, Typecheck & Test (push) Has been cancelled
pf graph 支持 ASCII 分层树/Mermaid/list/deps 四种输出格式;
yaml_loader._safe_load 包装 YAMLError 为 ValueError 统一错误处理。
2026-07-07 12:58:44 +08:00
zhou 6499210dc9 feat: RunReport 结果序列化支持 to_json/to_dict/to_csv/from_json
CI / Lint, Typecheck & Test (push) Has been cancelled
新增 RunReport 序列化方法,支持 JSON/dict/CSV 多格式导出与反序列化重建;
非 JSON 可序列化值默认回退到 repr,可通过 value_serializer 自定义。
2026-07-07 12:51:06 +08:00
zhou 7b5e4864c2 feat: 新增子图执行 — Graph.subgraph_with_deps 计算传递闭包, run(only=/tags=) 按名称或标签运行图子集, yamlrun CLI 支持 --only/--tags; 修复 test_executors.py 中 TaskStatus 缺少 px. 前缀的预存问题
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 12:44:50 +08:00
zhou 6614dc5a8d feat(cancellation): 新增任务取消与优雅停止 — CancelToken 线程安全取消令牌, run(cancel_event=) 支持外部取消与 KeyboardInterrupt 优雅停止; 各策略在层/任务边界检查取消信号, 待运行任务标记 SKIPPED; 提取 _dispatch_strategy 辅助函数控制 run() PLR0912 分支数
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 11:53:27 +08:00
zhou 98c3d84334 perf: 添加性能基准套件并优化 layers 缓存与 cmd 快速路径
CI / Lint, Typecheck & Test (push) Has been cancelled
新增 benchmarks 模块覆盖图构建/执行/上下文注入/状态后端四个维度;
Graph.layers() 结果缓存避免重复拓扑排序,cmd 任务跳过签名内省。
2026-07-07 11:38:37 +08:00
zhou 9f50bb3e7c feat: 实现 GitHub Actions 风格 YAML 任务编排
CI / Lint, Typecheck & Test (push) Has been cancelled
新增 yaml_loader 模块支持 jobs/needs/strategy.matrix/if 条件/env/defaults 等 CI/CD 概念,
Graph.from_yaml classmethod 与 pf yamlrun CLI 命令;矩阵笛卡尔积展开与依赖自动展开,
${{ matrix.key }} 占位符替换,字段名 hyphen/underscore 兼容。
2026-07-07 11:27:16 +08:00
zhou 8cfdef7516 docs: 对齐 README 与实际代码状态, 清理过期文档 — 移除未实现的 YAML 编排特性声明与整章, 修正覆盖率徽章 100%→97%, 修正依赖描述(实际 rich+typer+typing-extensions, 无 PyYAML), 修正 CLI 模块路径(profiler/emlmanager 已迁至 cli/legacy/); 归档 iter-01~05 迭代记录(设计决策已存 project_memory.md), 删除过期重构计划文档; 保留 typing_extensions 守卫(3.12/3.13 前向兼容非 3.8 死代码)
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 11:11:04 +08:00
zhou 505e40012e feat(executors): 新增 run_iter() 流式执行 API — 生成器逐个 yield (name, TaskResult), 后台线程+队列实现, 支持 4 种策略; _finalize_failure 在抛出前写入 report.results 使失败任务可被 yield; run() 新增内部 _report 参数支持结果共享
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 10:45:41 +08:00
zhou a32c65c8a0 feat(notification): 新增任务通知系统 — Notifier 协议 + CallbackNotifier/WebhookNotifier 及飞书/钉钉/企业微信实现, run(notifiers=) 支持单值/列表, 事件级别过滤, 提取 _finish_monitoring 控制 run 分支数, 通知失败仅记录日志不影响任务执行
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 10:29:36 +08:00
zhou 936e0d2a26 feat(progress): 新增实时进度监控 — ProgressCallback 协议 + RichProgressMonitor, run(progress=) 支持 bool/自定义监控器, 与 on_event/verbose 共存, 提取 _resolve_progress 控制 run 分支数
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 10:17:42 +08:00
zhou 0ecda36759 feat(storage): 新增 SQLiteBackend 状态后端 — 基于 sqlite3 按键查询, 支持 TTL/batch/线程安全, 解决 JSONBackend 全量加载瓶颈, 作为 drop-in 替换
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 10:10:40 +08:00
zhou b71c90ba5c refactor(ops): 整合 tasks/ 到 ops/system — setenv/writefile 转为 @px.tool, 丢弃重叠的 clr/reset_icon_cache/which 工厂, 删除 tasks 目录
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 09:43:27 +08:00
zhou d733452c8a refactor(ops): 按功能划分重构 ops/ 结构 — 22 个工具归入 files/dev/system/infra 子包, pf 动态导入注册表, 测试导入路径同步
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 08:43:36 +08:00
zhou c502556db9 refactor(cli): legacy 工具归入 cli/legacy/ — emlmanager 与 profiler 移至子目录, 入口点与导入路径同步更新 2026-07-07 08:33:25 +08:00
zhou e1824b9f5a fix(cli): 修复 pf 工具缺失必填参数时无错误提示 — standalone_mode=False 下手动调用 rich_format_error 打印 ClickException
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 08:17:04 +08:00
zhou 5e93a75987 refactor(ops): 清理无用代码与过时文档 — 删除 gittool 兼容别名、folderzip 未用 IGNORE 变量、过时迁移计划文档
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-07 03:02:24 +08:00
zhou 529a024ea1 feat(cli): rich 深度集成 — 执行生命周期 ✓/✗/▸/○ 符号 + dry-run + 命令输出
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-06 22:27:25 +08:00
zhou 4721b59f40 feat(cli): 重构CLI并添加富文本输出与版本/帮助优化
CI / Lint, Typecheck & Test (push) Has been cancelled
- 使用rich库重构工具列表展示为美观的表格形式
- 添加--version/-V参数显示版本号
- 新增未知工具的模糊匹配提示功能
- 统一使用标准错误输出和富文本样式打印错误信息
- 优化命令行参数处理逻辑,支持先解析help/version参数
2026-07-06 22:16:12 +08:00
zhou fca6f17a5c chore: 升级项目适配 Python 3.10+ 并重构代码
1.  移除对 Python 3.8/3.9 的支持,更新 tox、pyproject.toml 配置
2.  替换 typing 导入为 collections.abc 标准库类型
3.  重构 CLI 系统从 argparse 迁移到 typer
4.  优化代码格式与类型注解,修复多处类型兼容问题
5.  更新依赖声明,移除 graphlib_backport 兼容包
2026-07-06 22:14:59 +08:00
zhou d493c6233e docs(rules): 补充多阶段项目约束与更新规则说明
新增开发流程约束文档dev-workflow.md,完善self-driven.md中的多阶段项目规则,
补充阶段迭代、收尾的判定逻辑,修正目标达成的暂停条件说明
2026-07-06 21:16:07 +08:00
zhou 7a87a4177e feat(ops): 新增 _common 共享辅助模块消除跨平台重复代码
CI / Lint, Typecheck & Test (push) Has been cancelled
新增 src/pyflowx/ops/_common.py 提供 platform_command/ensure_platform/IGNORE_PATTERNS 三个公共 API, 配套 12 个单元测试; 修复上个提交中 8 个 ops 模块引用缺失模块导致的 ImportError.
2026-07-06 20:40:38 +08:00
zhou 04d6871e8d chore: 发布v0.4.8版本,清理冗余代码并优化跨平台实现
1. 移除folderzip和folderback模块中的默认导出函数与测试用例
2. 重构跨平台命令获取逻辑,统一使用platform_common工具函数
3. 移动IGNORE_PATTERNS常量到公共模块,精简packtool和autofmt代码
4. 重构平台检查逻辑,复用ensure_platform减少重复代码
5. 优化pdftool模块的依赖检查逻辑,提取公共检查函数
6. 修复测试用例中的字符串断言冗余内容
2026-07-06 20:22:59 +08:00
zhou 08149d990d bump version to 0.4.8
Release / Build, Publish & Release (push) Has been cancelled
CI / Lint, Typecheck & Test (push) Has been cancelled
v0.4.8
2026-07-06 13:19:24 +08:00
zhou 54aef98f3a chore(gittool): 新增ruff缓存目录到排除列表
CI / Lint, Typecheck & Test (push) Has been cancelled
将.ruff_cache添加到EXCLUDE_DIRS列表中,避免git工具扫描该缓存目录
2026-07-06 13:11:59 +08:00
zhou e31646e281 feat: 新增envdev、gittool、msdownload、pymake工具模块及对应测试用例
新增四个业务工具模块:
1. envdev: 开发环境镜像源配置工具,支持Python/Conda/Rust镜像配置及Linux系统环境配置
2. gittool: Git操作工具,提供提交、初始化、清理、推送等快捷子命令
3. msdownload: ModelScope模型/数据集下载工具
4. pymake: 项目构建工具,覆盖构建、测试、发布等全流程开发操作

同时为每个工具模块编写了完整的注册验证与功能测试用例
2026-07-06 13:11:09 +08:00
zhou f7fb95af83 refactor: 重构项目架构,移除YAML编排与旧注册系统
1.  将所有YAML配置的工具迁移到`@px.tool`装饰器实现
2.  拆分`llm`模块为`msdownload`和`sglang`子模块
3.  移除废弃的`registry.py`、`yaml_loader.py`和`yamlrun.py`模块
4.  清理项目依赖,移除PyYAML相关包
5.  更新文档与测试用例适配新架构
2026-07-06 13:04:57 +08:00
zhou 6da42ec5ff refactor: 移除YAML配置,统一使用@px.tool装饰器实现CLI工具
1.  新增tools.py模块实现@px.tool装饰器与工具注册表
2.  将所有configs下的YAML工具迁移为ops/xxx.py模块形式
3.  重构cli路由逻辑,优先加载Python工具实现回退YAML
4.  删除所有YAML配置文件与旧的yaml_loader相关代码
5.  调整__init__.py导出API,移除YAML相关依赖
2026-07-06 07:53:22 +08:00
zhou c55a37173a test: 新增 YamlCliRunner 错误分支测试使覆盖率达标 95%
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-05 22:25:15 +08:00
zhou 960b8672f4 test: 新增截图、PDF工具相关的单元测试
1. 新增Linux平台下截图工具回退到scrot的测试用例
2. 新增pdf加密、解密、重排、PDF转图片的完整测试用例
3. 补充各PDF工具未安装依赖时的分支测试
2026-07-05 22:21:47 +08:00
zhou 4fd1d70b58 test: 修复跨平台路径断言不兼容问题
1. 调整测试用例中的路径比较逻辑,统一替换反斜杠为正斜杠适配Windows平台
2. 将原生echo/true/false命令替换为跨平台的python执行命令,避免环境依赖问题
2026-07-05 22:18:16 +08:00
zhou 6fb9223066 fix: pymake bump 调用 pf bumpversion 而非已移除的外部 bumpversion 命令
CI / Lint, Typecheck & Test (push) Has been cancelled
2026-07-05 22:09:28 +08:00
zhou 1f7127357e refactor: 将 cli/system、cli/llm、cli/dev 脚本迁移为 YAML 配置 + register_fn 模式
CI / Lint, Typecheck & Test (push) Has been cancelled
删除 cli/system (clearscreen/taskkill/which)、cli/llm (msdownload/sglang)、cli/dev (dockercmd/envdev) 三个目录; 新增 7 个 YAML 配置; 新增 ops/llm.py 模块; 扩展 ops/system.py 和 ops/dev.py; pf.py 添加工具别名; 删除 examples/ 目录
2026-07-05 21:12:41 +08:00
zhou 58ee84ded6 bump version to 0.4.7
CI / Lint, Typecheck & Test (push) Has been cancelled
Release / Build, Publish & Release (push) Has been cancelled
v0.4.7
2026-07-05 19:49:54 +08:00
zhou 9a96e5d052 fix: 修复 bump_project_version 版本号不同步跳号 bug 并抽离到独立模块
CI / Lint, Typecheck & Test (push) Has been cancelled
原实现对每个文件独立 +1, 文件版本号不同步时跳号; 改为先读取所有文件取 max 作为基准再统一写入. 同时修复 git add . 违规 (改按文件名) 与 check=False 吞错误. bumpversion 从 ops/dev.py 抽离到 ops/bumpversion.py, 测试简化为 16 个核心场景.
2026-07-05 19:34:44 +08:00
zhou c9c7529c58 bump version to 0.4.6
CI / Lint, Typecheck & Test (push) Has been cancelled
Release / Build, Publish & Release (push) Has been cancelled
v0.4.6
2026-07-05 19:09:10 +08:00
zhou c498d9b1c9 feat: 实现方向 B 聚合 job 并消除 pymake/reseticoncache CLI 入口
CI / Lint, Typecheck & Test (push) Has been cancelled
放宽 yaml_loader 校验允许有 needs 无 cmd/fn 的聚合 job, 完善 pymake.yaml 覆盖原 pymake.py 所有别名, 新增 reset_icon_cache_run fn 与 reseticoncache.yaml, 删除 pymake.py/reseticoncache.py 及对应 scripts 入口, 修复 --list 在 subcommands 模式下的可达性 bug.
2026-07-05 18:12:59 +08:00
zhou b36e279f92 feat(cli): add pymake project build tool support
add pymake command alias to CLI, create pymake config yaml and move its legacy tool config out of _LEGACY_TOOLS dict
2026-07-05 17:45:08 +08:00
zhou 58d6f1faad refactor: 迁移 cli/_ops/ 到 ops/, 按类别保持 dev/files/media/system 分类
CI / Lint, Typecheck & Test (push) Has been cancelled
将 src/pyflowx/cli/_ops/ 整体迁移至 src/pyflowx/ops/, 与 cli/ 平级
(工具函数非 CLI 专属, 可被 YAML 任务编排通用引用). 分类保持不变:
dev (git/pip/bump/autofmt), files (date/level/back/zip),
media (pdf/screenshot), system (ls/pack/ssh).

同步更新 15 个引用文件 (yaml_loader + 14 个测试) 的 import 路径,
README 模块结构表与 test_registry docstring.
2026-07-05 17:32:22 +08:00
zhou d93da0d8b4 refactor: 迁移 cli/_ops/ 到 ops/, 按类别保持 dev/files/media/system 分类
CI / Lint, Typecheck & Test (push) Has been cancelled
将 src/pyflowx/cli/_ops/ 整体迁移至 src/pyflowx/ops/, 与 cli/ 平级
(工具函数非 CLI 专属, 可被 YAML 任务编排通用引用). 分类保持不变:
dev (git/pip/bump/autofmt), files (date/level/back/zip),
media (pdf/screenshot), system (ls/pack/ssh).

同步更新 15 个引用文件 (yaml_loader + 14 个测试) 的 import 路径,
README 模块结构表与 test_registry docstring.
2026-07-05 17:30:35 +08:00
zhou 701c455c42 refactor: 用 YamlCliRunner/PfApp class 封装 CLI 入口逻辑
CI / Lint & Typecheck (push) Has been cancelled
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.13) (push) Has been cancelled
CI / Test (Python 3.8) (push) Has been cancelled
CI / Docs Build (push) Has been cancelled
yaml_loader.py 新增 YamlCliRunner class, 将 run_cli 的 90 行
流程拆为 run/_load_config/_add_global_options/_extract_variables/
_handle_list 等单一职责方法; run_cli 保留为薄包装 (公共 API).
pf.py 新增 PfApp class, 将 main 的路由逻辑拆为 run/_list_tools/
_resolve_tool/_run_legacy/_run_yaml 等方法; main 仅调用
PfApp().run().

附带修复 run_yaml 的 jobs=None 误报 bug: 原代码 jobs is None
时 raise ValueError, 但 None 本意是执行全部任务, 导致
pf folderzip 报 "jobs 不能为空".
2026-07-05 15:59:05 +08:00
zhou e174b64495 refactor(cli): 重构配置文件路径并新增多工具配置
1. 移除旧的cli/configs/__init__.py占位文件
2. 修正pf.py中配置目录的路径指向
3. 新增folderzip、bumpversion等十余种工具的配置文件
4. 更新uv.lock中的依赖版本匹配规则
2026-07-05 15:50:18 +08:00
zhou 3afb25bb5e fix: 修正 typing-extensions 依赖条件为 python_version < '3.13'
CI / Test (Python 3.11) (push) Has been cancelled
CI / Lint & Typecheck (push) Has been cancelled
CI / Test (Python 3.13) (push) Has been cancelled
CI / Test (Python 3.8) (push) Has been cancelled
CI / Docs Build (push) Has been cancelled
task.py 在 Python < 3.13 时需要 typing_extensions 的 TypeVar
(PEP 696 default= 参数), 此前条件 < '3.10' 导致 3.10-3.12
环境 import 失败, ReadTheDocs (Python 3.11) 构建报
ModuleNotFoundError: No module named 'typing_extensions'.
2026-07-05 13:16:24 +08:00
zhou fbd17536fd ci: 重写 CI/Release 为 GitHub 兼容版本并加文档构建
CI / Lint & Typecheck (push) Has been cancelled
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.13) (push) Has been cancelled
CI / Test (Python 3.8) (push) Has been cancelled
CI / Docs Build (push) Has been cancelled
ci.yml 改用标准 actions (checkout/setup-uv/setup-python), 新增
pyrefly 类型检查、coverage 阈值检查 (>=95%)、Sphinx 文档构建三个
job, 多版本矩阵测试 (py38/py311/py313)。release.yml 改用标准
actions, 发布到 PyPI + GitHub Release (替代原 Gitea Release)。
2026-07-05 12:32:00 +08:00
zhou 32ca8c1208 docs: 搭建 Sphinx 文档站并清理死代码
CI / Lint, Typecheck & Test (push) Has been cancelled
1. 新建 docs/ Sphinx 文档结构 (conf.py + 8 个 rst 章节),
   napoleon 支持 Google/NumPy docstring, rtd 主题,
   自动生成 API 参考与错误家族文档
2. 新建 .readthedocs.yaml 配置, pyproject.toml 加 docs 依赖
3. 删除 runner.py 的 _apply_verbose_to_graph 死代码及对应测试
   (功能已移入 executors.run 统一处理)
4. 更新 README: CLI 示例改为 pf 统一入口, 模块结构表补全
   cli/pf.py/cli/configs/cli/_ops 等模块
5. 修复版本不一致 (pyproject.toml 0.3.5 → 0.4.5)
6. 加文档徽章链接到 ReadTheDocs
2026-07-05 12:17:10 +08:00