From f60433040c289ac1f4612f737f8baab42786847a Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 18:39:23 +0800 Subject: [PATCH 1/4] fix: preserve worktree release across path-only moves --- .../2026-12-02-worktree-idle-reuse/plan.md | 140 ++++++++++++++++++ .../2026-12-02-worktree-idle-reuse/prd.md | 54 +++++++ .../reference/host-checks.md | 23 +++ .../2026-12-02-worktree-idle-reuse/spec.md | 54 +++++++ TaskFlowDocs/todo.md | 15 ++ hooks/README.md | 2 +- hooks/start-worktree | 13 +- hooks/test-reuse-worktree | 21 ++- hooks/test-worktree-ownership | 6 +- hooks/worktree-owner | 21 ++- skills/taskflow/SKILL.md | 6 +- 11 files changed, 337 insertions(+), 18 deletions(-) create mode 100644 TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md create mode 100644 TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md create mode 100644 TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md create mode 100644 TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md new file mode 100644 index 0000000..37dfeb9 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md @@ -0,0 +1,140 @@ +# Plan — 已归档工作树的空闲识别与复用 +> Task version: v1 +> Status: in_progress + +## Spec Pointers + +- `spec.md` + +## Related Tasks + +- TF-20261201-643914:保留已交付的多会话占用、确认和原子交接约束。 +- TF-20261201-d77eb7:复用已交付的写入口自动重新领取。两项已归档,本任务处理后续复现的空闲判断。 + +## Skills / Tools Used + +- [PRD] Declared `agent-skills:debugging-and-error-recovery` — 从会话和隔离 Git 复现划定可自动恢复、必须确认和主动释放的要求。 +- [Spec] Declared `agent-skills:spec-driven-development` — 核对共享账本、候选筛选、交接锁和 Agent 的职责边界。 +- [Plan] Declared `agent-skills:planning-and-task-breakdown` — 先复现并修身份识别,再补操作规则,最后覆盖各宿主入口。 +- [Test] Declared `agent-skills:debugging-and-error-recovery` — 用真实 Git 最小夹具区分持有期间的更新、释放后快进和只移动路径,写成回归验收。 + +## Capability Contributions + +- [PRD] `agent-skills:debugging-and-error-recovery` | prd.md#Requirements | 区分可信记录的两类失效成因,把路径移动、HEAD 变化和会话释放拆成独立要求。 +- [Spec] `agent-skills:spec-driven-development` | spec.md#Interfaces, Data Flow, and Contracts | 将只读识别与现有锁内交接分开,限定路径和身份需要的证据。 +- [Plan] `agent-skills:planning-and-task-breakdown` | plan.md#Steps | 先让最小回归进入正常交接入口,再验证暂停与重入,最后验证宿主材料。 +- [Test] `agent-skills:debugging-and-error-recovery` | plan.md#Checkpoints | 比较外部快进、持有期间快进和纯路径移动的不同预期,防止把未知历史误判为释放。 + +## Preconditions + +- 工作树使用 `.worktrees/2026-12-02-worktree-idle-reuse`,分支 `fix/2026-12-02-worktree-idle-reuse`,开始前核验了远端 `main`。 +- 已读取 `TaskFlowDocs/repository-docs/index.md`、`LICENSE`、`CONTRIBUTING.md`、`CODE_STYLE.md` 和 `ROADMAP.md`。使用共享 Bash 入口,在任务 PR 内归档并验证全部已支持宿主,保留本机已有路由改动。 +- 用户确认路径移动、历史未知与停工释放的三项决定。实现前请求当前 v1 批准。 + +## Plan Review + +- Verdict: sound +- Coverage: Step 1 对应 A1、A2,Step 2 对应 A3,Step 3 对应 A4。负例保留已登记的其他持有者、已变更的 HEAD 和真正未知的历史。 +- Verifiability: 以同一 Git 工作树管理目录和新任务真实领取验证复用。对照以实际退出后的状态和交接拒绝为准。 +- Layer ownership: 共享所有权代码解释可信状态,既有锁与交接代码重验并移动。Agent 负责本人停工释放和恢复写入。 + +## Approval + +- Status: approved +- Approved by: User +- Approved at: 2026-12-02 17:55 +0800 +- Approved version: v1 +- Approved scope: PRD / Spec / Plan +- Approved repository checks: 8cb07520f221ccfd8e9ea42c67ccb98a1ab99f57 + +## Repository Rule Checks + +- host-coverage: applies +- host-coverage/claude-code: Step 3 | 核对打包入口至共享占用管理,验证 Bash 或可用 CLI 入口和现有事件夹具。 +- host-coverage/codex: Step 3 | 验证 Windows 入口及真实 Git 工作树流程,核对事件的能力边界。 +- host-coverage/codebuddy: Step 3 | 核对已打包 Bash 入口,验证共享流程与手工释放。 +- host-coverage/dsh: Step 3 | 核对插件发布材料和共享 Bash 命令,验证常规入口。 +- host-coverage/trae: Step 3 | 核对项目 hook 和 Skill 路径,验证显式 Bash 路线。 + +## Steps + +按「识别与真实接管 → 正常释放与重新领取 → 五宿主验证」的顺序推进。 + +### Step 1 — 保留只移动路径的可信释放 + +- Goal: 修复 Git 路径移动后的安全候选判断和跳过原因。 +- Dependencies: 已复现当前失败。复用现有 GitDir、分支、HEAD、成员和锁。 +- Files: `hooks/worktree-owner`、`hooks/start-worktree`、现有定向夹具。 +- Implementation checklist: + - [x] 先用真实 Git 写出路径移动后不能接管的红灯回归。 + - [x] 判断可信移动并接入状态与候选发现,保持现有交接端二次验证和事务。 + - [x] 验证身份不符、原路径仍存在、未知、脏工作树、独立持有者仍被拒绝。 +- Acceptance: A1、A2。成功路径实际复用同一个 GitDir,状态查询前后账本哈希相同。 +- Verification: `bash hooks/test-worktree-ownership`、`bash hooks/test-reuse-worktree`,记录现有负例及新回归结果。 +- Rollback: 回退共享判断、诊断和对应回归。沿用现有账本文件格式。 +- Status: done + +### Step 2 — 验证最后写入释放和恢复领取 + +- Goal: 把领取、更新、释放、停工和恢复写入接回 Agent 正常流程。 +- Dependencies: Step 1 完成。明确区分本人释放与其他会话占用。 +- Files: `skills/taskflow/SKILL.md`、适用的 `hooks/README.md` 与现有写入口夹具。 +- Implementation checklist: + - [x] 写明快进或提交前先领取,最后一次写入和提交后释放本人,恢复写入先领取。 + - [x] 验证已确认的历史工作树经现有确认接管后建立新记录。 + - [x] 验证未归档任务或仍被其他人占用时,释放当前会话不会使它进入其他任务。 +- Acceptance: A3。正常流程不需要用户再确认,历史无凭据仅在必须接管时核实。 +- Verification: `bash hooks/test-write-entry`及 Step 1 的实际 Git 断言,核对会话列表和新旧记录。 +- Rollback: 回退操作指引及对应断言。保持显式命令和宿主事件边界。 +- Status: done + +### Step 3 — 验证五个宿主与发版前置条件 + +- Goal: 核对各宿主实际共享入口,形成回归证据。 +- Dependencies: Step 1、2 完成。 +- Files: `reference/host-checks.md`、本 Plan。发布按仓库 `RELEASE.md` 在修复合入后执行。 +- Implementation checklist: + - [ ] 执行定向、Windows 和仓库三平台验证,检查格式。 + - [x] 分别记录五个宿主的入口结果、测试方式和可观测限制。 + - [ ] PR 验收后按 TaskFlow 归档及合并,合入后再准备发布提交。 +- Acceptance: A4。修复已合入且达到发布校验前置条件。 +- Verification: `git diff --check`、`bash hooks/repository-check .`、Skill 校验、五宿主入口验证、GitHub Hooks。 +- Rollback: 修复进入主线前不准备发版。如果发布相关基线检查失败,停在准备步骤。 +- Status: in_progress + +## Checkpoints + +- 起点对照:已释放后外部快进应从 `stale` 到 `unknown`。持有时快进并最后释放应为 `released`。 +- 修复对照:仅改路径且其他身份完全一致应为 `released`。对照改变 HEAD、记录不可信、原目录仍存在和持有者未退出的情况。 +- 会话对照:TaskFlow 写入口在暂停后重新登记原会话,其他会话留下时继续显示占用。 + +## Verification / Review + +- 2026-12-02 Step 3: 五 Agent 配置入口夹具通过,提交候选进行三平台 Hooks 验证。 + +- 2026-12-02 Step 2: Windows 恢复写入通过。隔离旧工作树被自动跳过,经显式确认后接管,释放后获得可信状态。 + +- 2026-12-02 Step 1: Windows Git Bash 定向回归先红后绿。纯路径移动后复用同一 GitDir,读取状态无需改账本。原位置仍存在、外部 HEAD 变化和其他持有者继续阻止自动接管。 + +- 2026-12-02 Step 1: 用户批准 v1,先以真实 Git 复现路径迁移失败,再改共享判断。 + +- 2026-12-02:Digdig 只读核对显示已归档、Git 干净、0 个登记持有者与 `trusted=no`。隔离 Git 在受管理和外部快进、移动场景复现不同状态。现阶段只记录基线观察。 +- 2026-12-02:新增真实 Git 回归在修复前失败于 `same-worktree move lost trusted release`。Windows Git Bash 的所有权测试通过了多会话、遗留占用、HEAD 变更原因与未知记录检查。 +- 2026-12-02:五个 SessionStart 配置分支逐一运行了夹具,并通过共享入口释放。完整宿主会话覆盖范围见验证记录。 +- host-coverage/claude-code: verified | reference/host-checks.md +- host-coverage/codex: verified | reference/host-checks.md +- host-coverage/codebuddy: verified | reference/host-checks.md +- host-coverage/dsh: verified | reference/host-checks.md +- host-coverage/trae: verified | reference/host-checks.md + +## Change Log + +- 2026-12-02:建立 v1,写入三项用户决定和已复现的源行为。 + +## Follow-ups + +- 工作树部署及真实宿主覆盖范围将按实测记录。 + +## Version History + +- v1 — planning. diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md new file mode 100644 index 0000000..7ee3484 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md @@ -0,0 +1,54 @@ +# 已归档工作树的空闲识别与复用 +> Task version: v1 +> Status: in_progress + +## Goal + +让 TaskFlow 在有可信证据时直接复用已归档工作树。对仍有持有者或确实缺少可信证据的工作树,说明原因并保持安全交接。 + +## Task Kind + +- Kind: defect + +## Background / Confirmed Facts + +- Digdig 的图片修复工作树已归档并合入,Git 干净且登记会话数为 0。TaskFlow 在迁移目录前后均返回 `unknown`,登记为 `trusted=no`。旧任务的 reflog 记录了交接后快进,当前证据不能确定当时的领取或释放顺序。 +- 隔离 Git 仓库复现了两条会把可信释放变为未知的路径。释放后直接快进,再普通领取和释放,状态依次为 `released → stale → unknown`。仅移动工作树路径也出现同样状态。持有会话期间快进,最后释放后仍为 `released`。 +- 原会话由 Agent 自行设置 `TASKFLOW_WORKTREE_DIR=.worktree`。用户没有指定该路径。本任务解决复用判断与占用释放。 + +## Requirements + +- R1. 可信释放后仅移动路径时,Git 工作树身份、分支、HEAD 一致且无登记持有者的候选可恢复可信释放,再通过既有交接流程复用。 +- R2. 受管理的 Git 更新应先为本会话领取工作树。HEAD 在释放后变化、记录缺失、历史可信状态已丢失或存在外部写入疑点时,继续拒绝自动交接。确需复用时,核实该工作树一次再走已有确认路径。 +- R3. Agent 最后一次写入和提交结束,且其后台写入已经结束时,释放自己的占用。继续写入时重新领取。其余会话的占用和未归档任务的隔离继续有效。 +- R4. 候选被跳过时,Agent 能区分缺少记录、缺少可信释放、工作树身份或提交已改变以及仍被持有。 + +## Acceptance Criteria + +- A1. 真实 Git 隔离夹具对可信释放记录执行普通 `git worktree move` 后,读到 `released`。状态查询保持只读,下一项任务能通过 `task-workspace start` 复用同一 Git 工作树管理目录并领取自己。 +- A2. HEAD 或分支变化、未知历史、损坏记录、锁、待恢复交接或其他持有会话均不能走自动复用;旧位置仍存在时保守判断。两个写入者分别释放,最后一个才可满足释放条件。 +- A3. 已领取后快进、提交、释放可以保持可信。无可信记录的旧工作树经独立核实,可通过现有确认交接建立新的可信记录。临时停工释放后,原任务写入重新领取,未归档工作树仍不能交接给新任务。 +- A4. Claude Code、Codex、CodeBuddy、dsh 和 Trae 的共享入口和差异均有验证记录,真实运行、事件夹具与文档核对分别标明。 + +## External Facts + +- Depends on external facts: no +- Why not: `hooks/worktree-owner` 定义状态判定,`hooks/test-reuse-worktree` 用隔离 Git 仓库核对交接。Digdig 的会话和只读账本观察用于复现背景。 + +## In Scope + +- 工作树所有权状态、候选日志、既有显式交接、Agent 领取与释放指引及其回归验证。 + +## Out of Scope + +- Digdig 当前数据和宿主全局配置的变更。 +- 以超时、单轮停止、任务阶段、Git 干净或用户未发新消息推断会话已终止。 + +## Risks / Deferred Items + +- Git 状态读取和交接之间存在竞争。交接必须在现有锁内重验。 +- 已丢失可信状态的记录保留人工核实入口,已有未释放的其他会话按会话逐一核实。 + +## Open Questions + +- 工作树移动、历史未知与停工时机的规则均已在本会话确认。 diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md new file mode 100644 index 0000000..4d53dc8 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md @@ -0,0 +1,23 @@ +# 五个 Agent 的工作树入口验证 + +候选代码在同一个隔离的 Windows Git 仓库运行。每个配置使用独立的 SessionStart 身份,经声明的 Bash 或 Windows 启动器执行工作树登记。随后用共享的 `worktree-owner release` 释放该身份,逐次读回 `occupied` 和 `released`。完整宿主会话属于另一个验证层级。本次结果覆盖随插件交付的入口和共享动作。 + +## host-coverage/claude-code + +- Evidence: 读取 `hooks/hooks.json` 的 SessionStart Bash 配置,执行 `run-hook.cmd session-start` 的 Bash 路径。输入含会话和工作目录,读取 JSON 输出成功,工作树登记并释放成功。 + +## host-coverage/codex + +- Evidence: 读取 `hooks/hooks-codex.json` 的 `commandWindows` 配置,实际从 PowerShell 委托给 `run-hook.cmd session-start`。Windows 启动后的回执、会话登记及释放均成功。 + +## host-coverage/codebuddy + +- Evidence: 读取 `hooks/hooks-codebuddy.json` 配置,以对应环境执行配置指定的 Bash `session-start`。验证 JSON 输出、登记和释放。 + +## host-coverage/dsh + +- Evidence: 静态核对 `dsh/index.js` 加载 `hooks/hooks-dsh.json`,并通过 `node --check dsh/index.js`。使用配置指定的 Bash 包装器运行 SessionStart 夹具,验证会话登记和释放。 + +## host-coverage/trae + +- Evidence: 读取 `hooks/hooks-trae.json` 配置并使用对应 Bash 包装器。按从工作目录定位的回退路径运行无 `cwd` 事件,验证会话登记和释放。 diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md new file mode 100644 index 0000000..afb7df9 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md @@ -0,0 +1,54 @@ +# Spec — 已归档工作树的空闲识别与复用 +> Task version: v1 + +## Objective and Success Criteria + +可信释放的工作树仅移动路径后,继续成为可信候选。受管理的更新以及恢复写入沿用既有领取和释放。系统继续拒绝无可信依据或有持有者的交接,并给出明确原因。 + +## Architecture Boundaries and Responsibilities + +- `worktree-owner` 判断工作树身份和可信记录。它使用 Git 返回的工作树管理目录、分支和 HEAD,读取当前注册位置。已有状态查询保持只读。 +- `start-worktree` 负责候选发现及跳过原因。 `reuse-worktree` 负责加锁、重验、归档核对及事务交接。两处复用同一所有权判定。 +- 各 Agent 沿用共享的 shell 入口和写入登记。Agent 在最后一次写入和提交后释放本人,停工期没有正在运行的写入工作时也可以释放。 + +## Project Structure / Affected Files + +- `hooks/worktree-owner`、`hooks/start-worktree` 与既有交接调用方。 +- `hooks/test-worktree-ownership`、`hooks/test-reuse-worktree`、`hooks/test-write-entry` 中最贴合的夹具。仓库使用的 Windows 和三平台冒烟入口用于复验。 +- `skills/taskflow/SKILL.md` 及适用的现有 hook 使用指引。共用行为在共享文档记录一次。 + +## Interfaces, Data Flow, and Contracts + +1. 读账本并比较 GitDir、分支、HEAD、记录的原路径和当前路径。 +2. 路径不同且其他三项相同的候选,只有旧记录可信、无持有者、旧位置已经消失且 Git 注册了目前位置时才有恢复依据。路径移动识别不更改状态文件。 +3. 交接端在现有每工作树账本锁内再次检查。通过候选检查后,继续运行归档归属、已提交、Git 工作区与新路径安全检查。实际接收方成功领取时按现有规则记录新路径。 +4. 普通领取不会提升未知历史的可信度。必须选用时,沿用 `reuse-worktree start … --confirmed-idle`,由 Agent 核实独立的空闲证据后执行。 +5. 状态输出保留首个状态词、观察值和占用会话。需要诊断的检查输出简短原因;调用方不需要解析会话 ID 来决定复用。 + +## Invariants and Compatibility + +- 只改路径的判断不提升 `trusted=no`、损坏和缺失记录的信任。旧位置同时存在或跨工作树管理目录的情况继续保守判断。 +- HEAD 在最后一次释放后改变仍为失效。受管理的快进和提交须在本人领取之后完成。 +- 用同一账本锁保护登记和交接。任何其他会话仍持有时,普通释放只移除本会话。 +- 本任务沿用当前账本格式和命令。未归档任务仍绑定原工作树。宿主的单轮结束事件没有释放权限。 + +## Validation and Error Semantics + +- 复用入口分别报告已登记占用、缺少可信凭据、Git 状态不一致或暂时忙,保留当前拒绝行为。 +- 只读观察和后续接管各自执行身份校验。并发领取和未提交文件继续由现有检查拦截。 +- 真实的 Digdig 历史账本只读核对,不以修复测试写入它。 + +## Code and Test Constraints + +- 保持 Bash 入口的现有平台边界。优先复用每工作树锁和归档交接检查。 +- 定向测试通过真实 Git 的快进、移动、领取、释放与任务接管完成。Ubuntu、macOS 和 Windows 跑仓库现有验证。 + +## Design Decisions and Alternatives + +- 对受管路径移动保留可信释放。普通 Git 位置改名不应该把稳定且可核对的身份降为未知。 +- 保留 HEAD 变化与无可信历史的安全条件。Git 历史向前推进无法证明期间没有外部写入者。 +- 靠明确的最后写入释放和写入口重新领取处理暂停与恢复。无需引入宿主各自的空闲猜测或计时器。 + +## Open Questions + +- 无待决规则。实际验证如发现不能公开区分的宿主入口,记录证据和限制。 diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index c3ea2b1..11749af 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -35,6 +35,21 @@ has an issue number or URL. +## 修复已归档工作树的空闲识别和复用,保留多会话占用与安 + +- ID: TF-20261202-a2ffc4 +- Status: in_progress +- Priority: normal +- Owner: Unknown +- Source: user +- Kind: defect +- Added: 2026-12-02 +- Updated: 2026-12-02 +- Goal: 修复已归档工作树的空闲识别和复用,保留多会话占用与安全交接 +- Task: `TaskFlowDocs/2026-12-02-worktree-idle-reuse/` +- Initial files: plan.md=b30e242d07e83780542781c826296b496d39757d775962c4a90850524d11fa99 prd.md=fb245fb52b34e7648eabea2b3e6135dd73ce10d6752e008035b6b737e25b852a spec.md=8e8156b910c46d85da90c97e9217e12d9ad687779dc459b2ce679c4316f223dd +- Next action: Complete PRD / Spec / Plan and request approval. + ## 让研究证据支撑研究型任务的 PRD、Spec 和 Plan - ID: TF-20261201-d3ab22 diff --git a/hooks/README.md b/hooks/README.md index bfe8536..8d37cc2 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -369,7 +369,7 @@ above is the one this repository documents. Windows, runs the full lifecycle through PowerShell 5.1 + `run-hook.cmd` in a path containing spaces and Chinese characters). -At branch creation, `start-worktree / [base]` and `reuse-worktree start` check the live target of the selected base. A behind local base must fast-forward before planning. `worktree-owner status` lists the holders of a linked worktree. Each session claims before work and releases after its last write. The final release enables handoff if the recorded checkout still matches. See the skill for manual takeover and crash recovery. +At branch creation, `start-worktree / [base]` and `reuse-worktree start` check the live target of the selected base. A behind local base must fast-forward before planning. `worktree-owner status` lists holders and explains unknown or stale records. The final release enables handoff if the recorded checkout still matches. Moving a trusted, released worktree can preserve that release when Git registers the new path and the old path is gone, with the Git directory, branch, and commit unchanged. See the skill for the claim and release sequence, manual takeover, and crash recovery. Hosts without hooks run the base flow unchanged; hooks are optional. diff --git a/hooks/start-worktree b/hooks/start-worktree index 2f71d6a..520d348 100755 --- a/hooks/start-worktree +++ b/hooks/start-worktree @@ -37,11 +37,14 @@ while IFS= read -r line; do if [ ! -d "$candidate" ] || [ -L "$candidate_dir" ] || [ -L "$candidate" ]; then printf 'Skipping %s: missing or indirect worktree path.\n' "$candidate" >&2; continue fi - ownership="$(bash "$HERE/worktree-owner" status --root "$candidate" 2>/dev/null)" || ownership=unknown - case "$ownership" in - 'released '*) ;; - *) printf 'Skipping %s: ownership %s.\n' "$candidate" "${ownership%% *}" >&2; continue ;; - esac + ownership="$(bash "$HERE/worktree-owner" status --root "$candidate" 2>/dev/null)" || ownership=invalid + read -r ownership_state _ ownership_detail _ <<< "$ownership" + if [ "$ownership_state" != released ]; then + reason='' + if [[ "$ownership_detail" = reason=* ]]; then reason=" (${ownership_detail#reason=})"; fi + printf 'Skipping %s: ownership %s%s.\n' "$candidate" "$ownership_state" "$reason" >&2 + continue + fi old_task="$(git -C "$candidate" log -1 --format= --name-only -- TaskFlowDocs/achieved | awk -F/ '$1 == "TaskFlowDocs" && $2 == "achieved" && NF > 3 && !seen { print $3; seen=1 }')" [ -n "$old_task" ] || { printf 'Skipping %s: no committed task archive.\n' "$candidate" >&2; continue; } diff --git a/hooks/test-reuse-worktree b/hooks/test-reuse-worktree index d589281..a8a2b93 100644 --- a/hooks/test-reuse-worktree +++ b/hooks/test-reuse-worktree @@ -192,11 +192,24 @@ cmp "$snapshot/capability-revisions" "$gitdir/taskflow/capability-revisions" [ "$(cat "$gitdir/taskflow/version-baselines/$task/v1")" = "$base" ] || { echo 'FAIL original baseline lost'; exit 1; } next_snapshot="$(find "$gitdir/taskflow/handoff-history/$next_task" -mindepth 1 -maxdepth 1 -type d | head -1)" [ "$(cat "$next_snapshot/evidence")" = 'next evidence' ] || { echo 'FAIL next ledger not preserved'; exit 1; } -# The ordinary start entry must choose this eligible released archive itself. +# A Git-only move must retain the release and remain eligible for ordinary start. owner release +receipt_before="$(git -C "$wt" hash-object --no-filters "$gitdir/taskflow/ownership")" +previous="$wt" +mkdir -p "$repo/.worktree" +wt="$repo/.worktree/relocated tree" +git -C "$repo" worktree move "$previous" "$wt" +mkdir "$previous" +[[ "$(owner status)" = 'stale '* ]] || { echo 'FAIL old worktree location still exists'; exit 1; } +rmdir "$previous" +[[ "$(owner status)" = 'released '* ]] || { echo 'FAIL same-worktree move lost trusted release'; exit 1; } +[ "$(git -C "$wt" hash-object --no-filters "$gitdir/taskflow/ownership")" = "$receipt_before" ] (cd "$repo" && bash "$HERE/task-workspace" start feature/automatic main) > "$fixture/auto" grep -q 'Handoff start:' "$fixture/auto" -grep -Fq "Task workspace: $(git -C "$repo" rev-parse --show-toplevel)/.worktrees/automatic" "$fixture/auto" -[ ! -e "$wt" ] && [ -d "$repo/.worktrees/automatic" ] -[ "$(git -C "$repo/.worktrees/automatic" rev-parse --absolute-git-dir)" = "$gitdir" ] +automatic="$repo/.worktree/automatic" +grep -Fq "Task workspace: $(git -C "$repo" rev-parse --show-toplevel)/.worktree/automatic" "$fixture/auto" +[ ! -e "$wt" ] && [ -d "$automatic" ] +[ "$(git -C "$automatic" rev-parse --absolute-git-dir)" = "$gitdir" ] +wt="$automatic" +[[ "$(owner status)" = 'occupied '*session=fixture-owner ]] echo 'PASS archived worktree reuse preserves Git and evidence' diff --git a/hooks/test-worktree-ownership b/hooks/test-worktree-ownership index f33a403..3ac72d0 100755 --- a/hooks/test-worktree-ownership +++ b/hooks/test-worktree-ownership @@ -43,10 +43,10 @@ git -C "$wt" -c user.name=test -c user.email=test@example.invalid commit --allow TASKFLOW_SESSION_ID=carol owner release [[ "$(status)" = 'released '* ]] git -C "$wt" commit --allow-empty -qm changed-after-release -[[ "$(status)" = 'stale '* ]] +[[ "$(status)" = 'stale '*reason=head-changed ]] owner claim owner release -[[ "$(status)" = 'unknown '* ]] +[[ "$(status)" = 'unknown '*reason=untrusted-release ]] # Race actual membership updates. Busy writers retry; no acknowledged claim is lost. retry() { local i; for i in 1 2 3 4 5 6 7 8; do "$@" && return; sleep 0.1; done; return 1; } TASKFLOW_SESSION_ID=left retry owner claim & left=$! @@ -91,6 +91,8 @@ git -C "$local_wt" commit -qm plan bash "$HERE/worktree-owner" release --root "$local_wt" deny bash "$HERE/reuse-worktree" start 2026-01-01-unrelated feature/next integration auto --root "$local_wt" grep -q 'branch-specific work' "$tmp/denial" +git -C "$repo" worktree add -qb unknown "$repo/.worktrees/unknown" integration +[[ "$(bash "$HERE/worktree-owner" status --root "$repo/.worktrees/unknown")" = 'unknown observed=absent reason=missing-record' ]] # Local and remote intake must both stop before plan files or Issue operations. detached="$repo/.worktrees/detached" git -C "$repo" worktree add -q --detach "$detached" integration diff --git a/hooks/worktree-owner b/hooks/worktree-owner index f39c554..e5ca886 100755 --- a/hooks/worktree-owner +++ b/hooks/worktree-owner @@ -10,7 +10,7 @@ owner_load() { receipt="$gitdir/taskflow/ownership" branch="$(git -C "$root" symbolic-ref --quiet HEAD)" || branch=@detached head="$(git -C "$root" rev-parse --verify 'HEAD^{commit}')" || return 1 - members=(); trusted=no; state=unknown; observed=absent + members=(); trusted=no; state=unknown; observed=absent; owner_reason=missing-record [ ! -L "$gitdir/taskflow" ] && [ ! -L "$receipt" ] || return 1 [ -e "$receipt" ] || return 0 [ -f "$receipt" ] || return 1 @@ -31,11 +31,23 @@ owner_load() { [ "$ended" = yes ] || return 1 } < "$receipt" [ "$observed" = "$(git -C "$root" hash-object --no-filters "$receipt")" ] || return 1 - if [ "$saved_root" != "$root" ] || [ "$saved_dir" != "$gitdir" ] || [ "$saved_branch" != "$branch" ]; then - state=stale; trusted=no + owner_reason='' + if [ "$saved_dir" != "$gitdir" ] || [ "$saved_branch" != "$branch" ]; then + state=stale; trusted=no; owner_reason=worktree-identity-changed + elif [ "$saved_root" != "$root" ]; then + # A Git move can preserve an existing release, but cannot establish one. + if [ "$trusted" = yes ] && [ -z "${members[*]-}" ] && [ "$saved_head" = "$head" ] && + [[ "$saved_root" = /* || "$saved_root" = [A-Za-z]:/* ]] && + [ ! -e "$saved_root" ] && [ ! -L "$saved_root" ] && + git -C "$root" worktree list --porcelain | grep -Fx -- "worktree $root" >/dev/null; then + state=released + else + state=stale; trusted=no; owner_reason=worktree-location-changed + fi elif [ -n "${members[*]-}" ]; then state=occupied - elif [ "$saved_head" != "$head" ]; then state=stale; trusted=no + elif [ "$saved_head" != "$head" ]; then state=stale; trusted=no; owner_reason=head-changed elif [ "$trusted" = yes ]; then state=released + else owner_reason=untrusted-release fi } owner_save() { @@ -60,6 +72,7 @@ owner_join() { } owner_report() { printf '%s observed=%s' "$state" "$observed" + if [ -n "$owner_reason" ]; then printf ' reason=%s' "$owner_reason"; fi local member for member in "${members[@]+"${members[@]}"}"; do printf ' session=%s' "$member"; done printf '\n' diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index 26b2a72..f120af7 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -182,7 +182,9 @@ Select the task's actual target repository and base branch **before creating the A TaskFlow-created branch records its verified base commit in the linked worktree's Git directory. For a Git- or IDE-created branch, the first promotion checks the selected base against its remote and requires that commit to be an ancestor of HEAD. Set `TASKFLOW_BASE_BRANCH` for a non-default base and `TASKFLOW_BASE_REMOTE` for an ambiguous remote. Extra commits on top of the base are fine. Before manually drafting new planning documents, run `TASKFLOW_BASE_BRANCH= bash /worktree-entry verify `. Observable edit hooks stay offline. Established tasks can continue offline. -Provide a stable session ID before starting. TaskFlow uses `TASKFLOW_SESSION_ID`, `CODEX_THREAD_ID` or `CLAUDE_CODE_SESSION_ID`; without a host ID, choose a unique handle and keep it for the session. The creating session is registered. TaskFlow write commands and observable file edits register or reclaim the writing session before proceeding; read-only queries leave membership unchanged. Each collaborating session must claim before unobserved writes and release after its last write or commit, including a session returning after release. SessionStart claims automatically where available. Otherwise run `bash /worktree-owner claim --root `. On busy or pending handoff, inspect the worktree path and retry before writing. A host Stop event ends a turn and does not release a session. +Provide a stable session ID before starting. TaskFlow uses `TASKFLOW_SESSION_ID`, `CODEX_THREAD_ID` or `CLAUDE_CODE_SESSION_ID`; without a host ID, choose a unique handle and keep it for the session. The creating session is registered. TaskFlow write commands and observable file edits register or reclaim the writing session before proceeding. Read-only queries leave membership unchanged. SessionStart claims automatically where available. + +Before an unobserved write or Git update such as a fast-forward or commit, run `bash /worktree-owner claim --root ` if you have not already claimed this checkout. When you finish writing and committing, or pause to wait for approval or acceptance, first finish any background writes you started. Then run `bash /worktree-owner release --root ` for your session. Claim again before resuming writes. On a busy ledger or pending handoff, inspect the workspace and retry. Other sessions release their own claims. A host Stop event alone does not establish that the session has stopped writing. One active task, one working tree — not only when several tasks run at once. A working tree can later be reused only after its previous task is archived and the archive is committed, with the handoff below. The base checkout then stays on `` and clean, which is what makes the next task's branch startable at all: `git checkout` refuses to move while a shared file like `TaskFlowDocs/todo.md` carries uncommitted work from a task that belonged elsewhere. `` follows the repository's branch prefixes (`CONTRIBUTING.md`); `.worktrees/` is ignored, so the worktrees themselves never appear as changes. `hooks/task promote` refuses to run outside a task working tree for this reason, and `hooks/task intake` warns when it has written `todo.md` in a shared one. @@ -447,7 +449,7 @@ After completion, promote only verified, cross-task rules into the project's sha Run `bash /reuse-worktree start auto --root ` from outside the worktree. The handoff checks the selected remote base and claims the released tree under the ledger lock. Start and resume move the worktree to a sibling directory named for the branch's task slug (`feature/example` becomes `example`); an occupied target stops the handoff. Use the printed path after success. A pending handoff blocks TaskFlow writes; inspect `git worktree list` and use `bash /reuse-worktree recover --confirmed-idle --root ` to restore the old task and path. Save the printed snapshot ID; to return to an old task after archiving and committing the current one, run `bash /reuse-worktree resume --root `. Do not switch tasks with ordinary Git commands: the per-worktree evidence would otherwise remain attached to the wrong task. Submodules and nonstandard linked Git layouts are currently refused. If a process was killed leaving `.ledger-lock`, verify no writer is running before removing the stale lock. A killed task transaction may leave a writer token inside it; inspect that directory and remove only the verified abandoned token before removing the empty lock directory; preserve handoff journals and snapshots. -Use `worktree-owner status --root ` to inspect the current holders. Choose another tree if any session remains. If reuse is necessary and a holder forgot to release, verify that particular session has stopped, then use `worktree-owner forget --session --observed --confirmed-idle --root `. A resumed session or other membership change invalidates the token. Repeat the inspection for each abandoned holder. Missing or stale releases require independent idle confirmation before adding `--confirmed-idle` to start/resume. Old trees first observed with no trusted baseline stay unknown after the last known session leaves. Locks, dirty files, pending handoffs and active holders still block reuse. Ownership covers participating sessions; check any known external writer separately. +Use `worktree-owner status --root ` to inspect holders and the reason for an unknown or stale record. A Git-only move preserves a trusted release if the registered location is the only change, the previous location is gone, and no session is recorded. Choose another tree if any session remains. If reuse is necessary and a holder forgot to release, verify that particular session has stopped, then use `worktree-owner forget --session --observed --confirmed-idle --root `. A resumed session or other membership change invalidates the token. Repeat the inspection for each abandoned holder. Missing or stale releases require independent idle confirmation before adding `--confirmed-idle` to start/resume. Old trees first observed with no trusted baseline stay unknown after the last known session leaves. Locks, dirty files, pending handoffs and active holders still block reuse. Ownership covers participating sessions. Check any known external writer separately. If branch cleanup is needed before another task starts, after confirming the archive is committed and merged, the worktree is idle and clean including untracked files, the index hides no changes, and submodules are safe, check out the verified base commit in detached HEAD using `git checkout --no-overwrite-ignore --detach `. Keep the old task ledger in place and do not start another task by hand; the later `start` handoff snapshots it. If the checkout refuses, preserve the files and branch for inspection. From fb4eb2f298701327483aaeddabc52d392d3ab9d6 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 18:42:31 +0800 Subject: [PATCH 2/4] docs: preserve the existing Todo order in the worktree fix --- TaskFlowDocs/todo.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index 08d48d2..9ad78d4 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -48,7 +48,23 @@ has an issue number or URL. - Goal: 修复已归档工作树的空闲识别和复用,保留多会话占用与安全交接 - Task: `TaskFlowDocs/2026-12-02-worktree-idle-reuse/` - Initial files: plan.md=b30e242d07e83780542781c826296b496d39757d775962c4a90850524d11fa99 prd.md=fb245fb52b34e7648eabea2b3e6135dd73ce10d6752e008035b6b737e25b852a spec.md=8e8156b910c46d85da90c97e9217e12d9ad687779dc459b2ce679c4316f223dd -- Next action: Complete PRD / Spec / Plan and request approval. +- Next action: Record the PR CI result and request acceptance. + +## 用单一公开标签 vX.Y.Z 安装同版 TaskFlow + +- ID: TF-20261201-0314e6 +- Status: done +- Goal: 让公开版本标签 vX.Y.Z 同时固定市场目录及同版插件,目录只使用该版本引用 +- Task: `TaskFlowDocs/achieved/2026-12-01-versioned-plugin-catalog/` +- Next action: None — completed and archived. + +## 确保 TaskFlow 在开工与评审时提醒适用的仓库规则,并在批准 + +- ID: TF-20261202-34dd60 +- Status: done +- Goal: 确保 TaskFlow 在开工与评审时提醒适用的仓库规则,并在批准与完成时逐项核查仓库声明的要求 +- Task: `TaskFlowDocs/achieved/2026-12-02-repository-rule-checks/` +- Next action: None — completed and archived. ## 让研究证据支撑研究型任务的 PRD、Spec 和 Plan @@ -1458,19 +1474,3 @@ has an issue number or URL. - Task: None — direct docs change in `docs/trae-lang`; the English text now cites the English doc set and its labels, `README.zh-CN.md` keeps the Chinese pair. - Next action: None — completed. -## 确保 TaskFlow 在开工与评审时提醒适用的仓库规则,并在批准 - -- ID: TF-20261202-34dd60 -- Status: done -- Goal: 确保 TaskFlow 在开工与评审时提醒适用的仓库规则,并在批准与完成时逐项核查仓库声明的要求 -- Task: `TaskFlowDocs/achieved/2026-12-02-repository-rule-checks/` -- Next action: None — completed and archived. - -## 用单一公开标签 vX.Y.Z 安装同版 TaskFlow - -- ID: TF-20261201-0314e6 -- Status: done -- Goal: 让公开版本标签 vX.Y.Z 同时固定市场目录及同版插件,目录只使用该版本引用 -- Task: `TaskFlowDocs/achieved/2026-12-01-versioned-plugin-catalog/` -- Next action: None — completed and archived. - From 9dc1ddf4e8853e042b2037309ba4ae72b54956f4 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 20:13:27 +0800 Subject: [PATCH 3/4] docs: record worktree reuse verification --- TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md | 8 ++++++-- TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md index 37dfeb9..a24cb96 100644 --- a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md @@ -1,6 +1,6 @@ # Plan — 已归档工作树的空闲识别与复用 > Task version: v1 -> Status: in_progress +> Status: checking ## Spec Pointers @@ -94,7 +94,7 @@ - Dependencies: Step 1、2 完成。 - Files: `reference/host-checks.md`、本 Plan。发布按仓库 `RELEASE.md` 在修复合入后执行。 - Implementation checklist: - - [ ] 执行定向、Windows 和仓库三平台验证,检查格式。 + - [x] 执行定向、Windows 和仓库三平台验证,检查格式。 - [x] 分别记录五个宿主的入口结果、测试方式和可观测限制。 - [ ] PR 验收后按 TaskFlow 归档及合并,合入后再准备发布提交。 - Acceptance: A4。修复已合入且达到发布校验前置条件。 @@ -110,6 +110,8 @@ ## Verification / Review +- 2026-12-02 Step 3: 候选 fb4eb2f 的 Ubuntu、macOS、Windows 冒烟全部通过。仓库检查和五宿主入口验证已完成,等待用户验收。[Hooks CI](https://github.com/hkwuks/TaskFlow/actions/runs/46863921067) + - 2026-12-02 Step 3: 五 Agent 配置入口夹具通过,提交候选进行三平台 Hooks 验证。 - 2026-12-02 Step 2: Windows 恢复写入通过。隔离旧工作树被自动跳过,经显式确认后接管,释放后获得可信状态。 @@ -127,6 +129,8 @@ - host-coverage/dsh: verified | reference/host-checks.md - host-coverage/trae: verified | reference/host-checks.md +- 2026-12-02:再次只读核对 Digdig 原工作树,Git reflog 记录了从任务分支切换到同一提交的 detached HEAD。候选返回 `stale` 和 `reason=worktree-identity-changed`,与身份变更一致。 + ## Change Log - 2026-12-02:建立 v1,写入三项用户决定和已复现的源行为。 diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md index 7ee3484..59f8ac8 100644 --- a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md +++ b/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md @@ -1,6 +1,6 @@ # 已归档工作树的空闲识别与复用 > Task version: v1 -> Status: in_progress +> Status: checking ## Goal From 5a6152d93e8048dc266af2bcc699a835d392eb77 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 20:13:49 +0800 Subject: [PATCH 4/4] docs: archive accepted worktree reuse fix --- .../2026-12-02-worktree-idle-reuse/plan.md | 8 +++++--- .../2026-12-02-worktree-idle-reuse/prd.md | 2 +- .../reference/host-checks.md | 0 .../2026-12-02-worktree-idle-reuse/spec.md | 0 TaskFlowDocs/todo.md | 13 +++---------- 5 files changed, 9 insertions(+), 14 deletions(-) rename TaskFlowDocs/{ => achieved}/2026-12-02-worktree-idle-reuse/plan.md (97%) rename TaskFlowDocs/{ => achieved}/2026-12-02-worktree-idle-reuse/prd.md (99%) rename TaskFlowDocs/{ => achieved}/2026-12-02-worktree-idle-reuse/reference/host-checks.md (100%) rename TaskFlowDocs/{ => achieved}/2026-12-02-worktree-idle-reuse/spec.md (100%) diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/plan.md similarity index 97% rename from TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md rename to TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/plan.md index a24cb96..1587454 100644 --- a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/plan.md +++ b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/plan.md @@ -1,6 +1,6 @@ # Plan — 已归档工作树的空闲识别与复用 > Task version: v1 -> Status: checking +> Status: completed ## Spec Pointers @@ -96,11 +96,11 @@ - Implementation checklist: - [x] 执行定向、Windows 和仓库三平台验证,检查格式。 - [x] 分别记录五个宿主的入口结果、测试方式和可观测限制。 - - [ ] PR 验收后按 TaskFlow 归档及合并,合入后再准备发布提交。 + - [x] 用户已验收。在同一 PR 提交任务归档,合并后按 RELEASE.md 准备发布。 - Acceptance: A4。修复已合入且达到发布校验前置条件。 - Verification: `git diff --check`、`bash hooks/repository-check .`、Skill 校验、五宿主入口验证、GitHub Hooks。 - Rollback: 修复进入主线前不准备发版。如果发布相关基线检查失败,停在准备步骤。 -- Status: in_progress +- Status: done ## Checkpoints @@ -110,6 +110,8 @@ ## Verification / Review +- 2026-12-02 Step 3: 用户同意验收 PR #164。代码候选三平台 CI 与五宿主入口验证已通过,同一 PR 提交归档。 + - 2026-12-02 Step 3: 候选 fb4eb2f 的 Ubuntu、macOS、Windows 冒烟全部通过。仓库检查和五宿主入口验证已完成,等待用户验收。[Hooks CI](https://github.com/hkwuks/TaskFlow/actions/runs/46863921067) - 2026-12-02 Step 3: 五 Agent 配置入口夹具通过,提交候选进行三平台 Hooks 验证。 diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/prd.md similarity index 99% rename from TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md rename to TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/prd.md index 59f8ac8..4d720e7 100644 --- a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/prd.md +++ b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/prd.md @@ -1,6 +1,6 @@ # 已归档工作树的空闲识别与复用 > Task version: v1 -> Status: checking +> Status: completed ## Goal diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/reference/host-checks.md similarity index 100% rename from TaskFlowDocs/2026-12-02-worktree-idle-reuse/reference/host-checks.md rename to TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/reference/host-checks.md diff --git a/TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md b/TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/spec.md similarity index 100% rename from TaskFlowDocs/2026-12-02-worktree-idle-reuse/spec.md rename to TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/spec.md diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index 9ad78d4..15fbde2 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -38,17 +38,10 @@ has an issue number or URL. ## 修复已归档工作树的空闲识别和复用,保留多会话占用与安 - ID: TF-20261202-a2ffc4 -- Status: in_progress -- Priority: normal -- Owner: Unknown -- Source: user -- Kind: defect -- Added: 2026-12-02 -- Updated: 2026-12-02 +- Status: done - Goal: 修复已归档工作树的空闲识别和复用,保留多会话占用与安全交接 -- Task: `TaskFlowDocs/2026-12-02-worktree-idle-reuse/` -- Initial files: plan.md=b30e242d07e83780542781c826296b496d39757d775962c4a90850524d11fa99 prd.md=fb245fb52b34e7648eabea2b3e6135dd73ce10d6752e008035b6b737e25b852a spec.md=8e8156b910c46d85da90c97e9217e12d9ad687779dc459b2ce679c4316f223dd -- Next action: Record the PR CI result and request acceptance. +- Task: `TaskFlowDocs/achieved/2026-12-02-worktree-idle-reuse/` +- Next action: None — completed and archived. ## 用单一公开标签 vX.Y.Z 安装同版 TaskFlow