feat: generate task board from task frontmatter

This commit is contained in:
chengma
2026-07-08 10:47:36 +08:00
parent d1d4f458cb
commit 8a7ce0acba
4 changed files with 309 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
# 任务看板
> 本文件由 `python scripts/gen_task_board.py` 自动生成,请勿手改。
> 数据源只包含 `docs/tasks/T-*.md`;`docs/06-tasks.md` 是 T-000~T-549 历史归档,不纳入本看板。
## 汇总
- 总任务:2
- 状态统计:BLOCKED 0 · DOING 0 · DONE 2 · TODO 0
- 下一个可领取:暂无
## Phase 7
| ID | 任务 | 依赖 | 状态 |
| --- | --- | --- | --- |
| T-550 | ①②③ 批次下拉默认选中最新批次 | T-523, T-206 | DONE |
## Phase 8
| ID | 任务 | 依赖 | 状态 |
| --- | --- | --- | --- |
| T-551 | 脚本从 docs/tasks/ frontmatter 生成任务看板 | - | DONE |
+6 -2
View File
@@ -3,7 +3,7 @@ id: T-551
title: 脚本从 docs/tasks/ frontmatter 生成任务看板
phase: 8
deps: []
status: TODO
status: DONE
created: 2026-07-08
---
@@ -39,4 +39,8 @@ created: 2026-07-08
## 执行记录
(做完在此记录:改了哪些文件、跑的验证命令与结果、决策)
- 2026-07-08:完成 T-551。
- 代码:新增 `scripts/gen_task_board.py`,用标准库扫描 `docs/tasks/T-*.md`,手写解析 frontmatter;字段缺失、格式错误、非法 status/phase/deps 的任务文件会跳过并通过 stderr 提示,不让脚本崩溃;按 phase 分组输出 `id / title / deps / status`,并计算状态统计和“下一个可领取”。
- 文档产物:运行 `python scripts/gen_task_board.py` 生成 `docs/tasks-board.md`,文件顶部标注由脚本生成、请勿手改;数据源仅包含 `docs/tasks/T-*.md`,不纳入冻结归档 `docs/06-tasks.md`。
- 测试:新增 `tests/test_task_board.py`,用临时任务目录覆盖正常任务、依赖已完成的下一个可领取任务、依赖未完成任务、进行中任务,以及缺字段 frontmatter 被跳过。
- 验证:`py -3.10 -m unittest discover -s tests -p "test_task_board.py"` 通过(1 test);`python scripts/gen_task_board.py` 通过并生成 2 个任务;`python -m ruff check app tests main.py` 通过;`python -m ruff check scripts\gen_task_board.py tests\test_task_board.py` 通过;`py -3.10 -m compileall app main.py` 通过;`py -3.10 -m py_compile scripts/gen_task_board.py` 通过;`git diff --check` 通过;`py -3.10 -m unittest discover -s tests` 通过(254 tests)。