fix: 修复实际使用中发现的 4 个 bug

- todo_parser: 支持无方括号的短 ID 提取(G-001/H-000 格式)
  原来只认 [T-xxx] 方括号格式,非方括号行退化为全文当 ID
- arc_mode: parallel_review_mode 保留 arcPhase 字段
  原来写 state 时覆盖为 {enabled, updatedAt, projectRoot},丢失 phase
- airplan.py: 新增 --task-text CLI 参数
  原来 argparse 缺此参数,do 模式无法接收任务描述
- do_mode.main: 透传 task_text 给 enter_worker
  原来调 enter_worker(project_root, tid) 缺第三个参数
  P1-20 is_ui_task() 永远收到空字符串

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
AirLongDian
2026-06-11 14:42:18 +08:00
parent 90a0db005f
commit e7f46097fb
4 changed files with 15 additions and 5 deletions

View File

@@ -69,9 +69,13 @@ def parse_tasks(todo_path: Path) -> list[TodoTask]:
continue
task_cell = cells[col_map.get("task", 0)] if col_map.get("task", 0) < len(cells) else ""
# 提取 [T-xxx] 格式的任务 ID
# 优先提取 [T-xxx] 方括号格式的 ID若没有则尝试从开头提取 G-001/H-000 类短 ID
tid_match = re.match(r"\[([A-Za-z0-9_\-\.]+)\]", task_cell)
task_id = tid_match.group(1) if tid_match else task_cell
if tid_match:
task_id = tid_match.group(1)
else:
short_match = re.match(r"^([A-Z]+-\d+[a-z]*)", task_cell)
task_id = short_match.group(1) if short_match else task_cell
task = task_cell
status = cells[col_map.get("status", 1)] if col_map.get("status", 1) < len(cells) else "TODO"
files_dirs = cells[col_map.get("files_dirs", 2)] if col_map.get("files_dirs", 2) < len(cells) else ""