From dab1c0fb685cd7568367bf1d52dc65616b6f98f3 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:11:32 +0800 Subject: [PATCH 1/8] docs: prepare research planning fallback plan --- .../plan.md | 111 ++++++++++++++++++ .../prd.md | 50 ++++++++ .../spec.md | 38 ++++++ TaskFlowDocs/todo.md | 9 +- 4 files changed, 204 insertions(+), 4 deletions(-) create mode 100644 TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md create mode 100644 TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md create mode 100644 TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md new file mode 100644 index 0000000..f41373c --- /dev/null +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -0,0 +1,111 @@ +# Plan — 让研究和决策计划在无专用工具时也可执行 +> Task version: v1 +> Status: ready + +## Spec Pointers + +- `spec.md` 和 `prd.md` 的验收。 + +## Reference Pointers + +- `TaskFlowDocs/repository-docs/index.md`、`CONTRIBUTING.md`、`CODE_STYLE.md`、`skills/taskflow/SKILL.md`。 +- `hooks/version`、`hooks/task`、现有版本或工件参考和冒烟用例。 + +## Related Tasks + +- 当前 Todo TF-20261024-b48e56。 +- 发散路由 TF-20261008-5b5635。研究证据 TF-20261201-d3ab22 可沿用,保留其现有交付和验收。 + +## Skills / Tools Used + +- [PRD] Declared `agent-skills:idea-refine` — 对照真实案例,确认当前工作流遗漏和替代方案。 +- [Spec] Declared `agent-skills:spec-driven-development` — 明确该层输入、输出及错误语义。 +- [Plan] Declared `agent-skills:planning-and-task-breakdown` — 按依赖拆成三步及验收。 +- [Test] Unaided — none applied; considered: testing strategy. + +## Preconditions + +- 用户已同意整体方向。当前计划待批准后才实施。 +- 当前分支源于已核对的远端 main。如开始编码前 main 包含相关规则改动,先同步并按仓库规定核对五宿主要求。 + +## Plan Review + +- Verdict: sound +- Coverage: 所有要求和验收分配给下方三个步骤和合成案例。 +- Verifiability: 通过真实命令检查拒绝与成功路径,基于独立夹具和已知证据,验证前后读回产物。 +- Layer ownership: TaskFlow 提供选择条件、无工具方法和结构审查。工具或模型提出方案和方法。原资料、决策和工作区由当前任务维护。 + +## Approval + +- Status: requested +- Approved by: pending +- Approved at: pending +- Approved version: pending +- Approved scope: pending + +## Repository Rule Checks + +- host-coverage: applies +- host-coverage/claude-code: Step 3 | 核对安装入口的项目内能力路由,并按同一方法完成合成研究样例。 +- host-coverage/codex: Step 3 | 以项目内候选规则保存与批准合成研究样例,记录宿主观察及局限。 +- host-coverage/codebuddy: Step 3 | 核对其安装入口暴露相同的 TaskFlow 指导和审批命令。 +- host-coverage/dsh: Step 3 | 核对 dsh 桥及 TaskFlow skill 获取路径,运行共享计划批准夹具。 +- host-coverage/trae: Step 3 | 核对手动安装和直接调用流程,再跑独立 Plan 质量夹具。 + +## Steps + +### Step 1 — 在目标或判定方式未定时引入发散能力 + +- Goal: 在正式写研究计划前,识别需要比较的选择、假设和会改变结论的反例。 +- Dependencies: 用户批准 v1。 +- Files: 项目内 TaskFlow Skill 的能力路由、工件参考。 +- Implementation checklist: + - [ ] 显示发散能力适用条件和实际用法。方向、方法及验收已定时直接进入计划。 + - [ ] 在计划说明哪项取舍、问题或验收因工具输出改变。没有可用结果时进入兜底。 +- Acceptance: 对 GoGo 未定范围的案例,能说明为什么必须分开组队、路由和自主首派。对已明确范围的例子可直接规划。 +- Verification: 复查路由说明和合成案例记录,区分考虑、调用、采用。 +- Rollback: 回退新增的发散路由与引用规则。 +- Status: pending + +### Step 2 — 实现同一质量标准下的内置兜底 + +- Goal: 有用工具、工具失败或没有工具时,计划都能支持下一位执行者采取行动。 +- Dependencies: Step 1 判明发散和收敛边界。 +- Files: 工件参考、可复用示例、共享批准检查。 +- Implementation checklist: + - [ ] 已进入 TaskFlow 且以调研、方案决策或实验为交付的任务可显式采用研究计划要求。既有 Unaided 登记形状继续可用。 + - [ ] 核对问题、证据准入、比较或判定标准、阶段产物及放行条件。实验另列基线、数据冻结、计分、停止或复跑条件。 + - [ ] 复用已有研究证据索引。未知需要指出影响和最先验证的步骤,允许证据不足时延期作结论。 +- Acceptance: 同一个案例用工具或自带方法都能批准。仅填工具名、空泛步骤或没有可判定的验收都要返回缺项。 +- Verification: 在两条路径的夹具中对照 Plan 产物和真实批准输出。 +- Rollback: 回退特定计划类型的结构校验,保留既有能力登记。 +- Status: pending + +### Step 3 — 以研究案例和宿主验证可执行性 + +- Goal: 确认计划能交给不同宿主的 Agent 接着执行,并能解释何时可以下结论。 +- Dependencies: Step 2 的兜底和批准出口。 +- Files: 合成研究、非开发决策样例和五宿主验收记录。 +- Implementation checklist: + - [ ] GoGo 夹具覆盖候选筛选、入队前状态、实际输入核对、冻结、基线与计分。通用决策夹具覆盖证据、备选、选择阈值和待补问题。 + - [ ] 核对五个 Agent 的共用流程、使用证据和实际验证边界。 +- Acceptance: 两种案例均有阶段产物与最终判定。凭合成仓库可复现批准和拒绝,区分宿主接线和真实运行。 +- Verification: 定向回归、三系统冒烟与适用的宿主观察。 +- Rollback: 回退示例与适用的能力指引,保留原 Todo。 +- Status: pending + +## Checkpoints + +## Verification / Review + +- 已对照原仓库规则与实际 GoGo 案例的完成和待验证步骤。当前仅为待审设计。 + +## Change Log + +- 2026-12-02:根据用户确认的两个修复方向维护原 Todo 并形成当前计划。 + +## Follow-ups + +## Version History + +- v1 — planning. diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md new file mode 100644 index 0000000..dbc8035 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md @@ -0,0 +1,50 @@ +# 让研究和决策计划在无专用工具时也可执行 +> Task version: v1 +> Status: ready + +## Goal + +对已纳入 TaskFlow 的研究、方案决策和实验任务提供同一质量要求。工具合适时记录其实际贡献,无合适工具时可按内置流程产出完整计划。 + +## Task Kind + +- Kind: capability + +## Background / Confirmed Facts + +- 现有规则有 divergent exploration 和 Unaided 声明,但没有规定无合适工具时如何写研究和决策方法。GoGo 反复补充数据准入、模型实际输入和计分规则。 +- 原待办要求承认模型自身能力是兜底。保持现有 Unaided 登记,并用研究计划实际产物检验兜底是否有效。 + +## Requirements + +- 按目标、备选或验收是否开放选择发散工具,在选定方向后检查所需真实证据和合适的研究方法。工具记录说明哪个备选、假设或验证设计确实被改变。 +- Unaided 仍正常承接计划。按任务类型产出要回答或要决定的问题、来源及准入、判定标准、逐步产物和下一步条件,并明确证据不足如何处理。 +- 实验另写对照基线、评分、输入和数据冻结、继续或停止条件。纯调研或方案比较使用适合其工作的问题、方案和判断标准。 +- 使用现有研究证据索引入口(可用时),核对引用到可复核来源。质量门对使用工具与使用兜底一视同仁。 + +## Acceptance Criteria + +- GoGo 合成案例在缺专用技能时能生成数据准入、实际输入复核、冻结、基线和计分。只记录考虑的工具或泛泛罗列行动的 Plan 不满足质量核对。 +- 一项非开发的方案研究能用实际资料比较备选,未知保留并写出影响与验证步骤。已有明确方向时可直接写方法。 +- 以同一流程覆盖五个 Agent;适用的仓库规则及宿主验证结果按新贡献规范记录。 + +## External Facts + +- Depends on external facts: no +- Why not: 本次实现的规则、既有阶段、版本快照和检查入口位于 `skills/taskflow/SKILL.md`、`hooks/task` 和 `hooks/version`。案例以合成夹具验证。 + +## In Scope + +- 头脑风暴路由,从无专用工具到可执行计划的 TaskFlow 内置方法,调研/决策和实验两套核对。关联旧发散 Todo 和研究证据 Todo。 + +## Out of Scope + +- 隐式把普通只读问答纳入 TaskFlow、强制安装第三方技能、复制私密研究数据、改写其他活跃任务。 + +## Risks / Deferred Items + +- 自然语言质量和取舍由评审核实。确定性校验检查可定位的结构和条件。 + +## Open Questions + +- 通过待审计划确认具体实施边界。 diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md new file mode 100644 index 0000000..3afe605 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md @@ -0,0 +1,38 @@ +# Spec — 让研究和决策计划在无专用工具时也可执行 +> Task version: v1 + +## Objective and Success Criteria + +- 对已纳入 TaskFlow 的研究、方案决策和实验任务提供同一质量要求。工具合适时记录其实际贡献,无合适工具时可按内置流程产出完整计划。 + +## Architecture Boundaries and Responsibilities + +- TaskFlow 提供选择条件、无工具方法和结构审查。工具或模型提出方案和方法。原资料、决策和工作区由当前任务维护。 + +## Project Structure / Affected Files + +- 项目内 TaskFlow 技能和工件参考、现有阶段与批准入口、研究型计划样例和回归。 + +## Interfaces, Data Flow, and Contracts + +- 为已经进入 TaskFlow 的研究、方案决策和实验提议使用相应计划类型。开放问题阶段可以调用任一合适的发散能力。有或没有工具均用相同 Plan 产物。沿用 Unaided 记录形状。按计划类型核对证据/未知、可执行方法、逐步交付与验收,实验要求额外的可比较与复跑条件。 + +## Invariants and Compatibility + +- 使用当前工作树和任务版本;保留已批准历史。五宿主使用共用实现和相同证据语义。 + +## Validation and Error Semantics + +- 核心产物空缺或验收不可执行时指出缺项。未知可写在计划中,须指出影响、优先获取什么证据以及哪些决定暂缓。 + +## Code and Test Constraints + +- 用现有扩展名为空的 Bash 工具和适用的 smoke 入口,保持失败时源材料与审批状态可查。真实宿主观察与夹具结果分开记录。 + +## Design Decisions and Alternatives + +- 原待办要求承认模型自身能力是兜底。保持现有 Unaided 登记,并用研究计划实际产物检验兜底是否有效。 + +## Open Questions + +- 无未列的外部依赖。 diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index f06aa92..430b3de 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -478,15 +478,16 @@ has an issue number or URL. ## When a phase has no capability worth invoking, the fallback is the model's own a - ID: TF-20261024-b48e56 -- Status: inbox +- Status: promoted - Priority: normal - Owner: Claude - Source: user request 2026-10-24 - Added: 2026-10-24 -- Updated: 2026-10-24 +- Updated: 2026-12-02 - Goal: When a phase has no capability worth invoking, the fallback is the model's own ability, and the docs should say so in those words instead of only describing it as nothing having been invoked -- Task: Not promoted. -- Next action: Read the three places that define the fallback -- skills/taskflow/SKILL.md:179, references/artifacts.md:99 and :130, references/runtime.md:63 -- and decide what the wording should say. Today all of them describe Unaided as the absence of a capability ('no capability applied to this phase', 'nothing was invoked'), which reads as a gap rather than as a choice. The requested framing is that the fallback when no tool is worth introducing is the model's own ability, so the phase still runs, and the record says which ability was brought to bear. Decide whether that is an edit to those three paragraphs, a fourth field in the recorded line, or a rename -- and whether the 'considered:' field already carries it (it names the concept class the model was asked to supply). Keep the mechanical contract unchanged: the class still validates against the phase vocabulary and approve still reconciles it exactly. +- Task: `TaskFlowDocs/2026-12-02-research-planning-fallback/` +- Initial files: plan.md=365853a405d7b862da6b76d6bbf1606ae6edcc765c19fcb04c6431960be81909 prd.md=4d4272c218632c0df8cf1b3a1cc942c207339f2695e4e8ce2182132a9b7a02f3 spec.md=6d02e970120e9e7da48c20b7e56fcfa3592cd80453bc240192a350d4da748fcc +- Next action: Complete PRD / Spec / Plan and request approval. - Notes: Reported by the user 2026-10-24 while defining TF-20261024-310937. The user's wording: 这类引入工具的策略,当没有工具可以引入的时候,就用模型自己的能力。Related to TF-20261024-310937 (the Test stage's carrier): that task adds a fourth stage to the same set, so its line shape has to say what the model supplied for a stage no tool covers. Not the same gap as TF-20261009-8abbd6 (give a phase a way to record a selection that is not a tool-call artifact) -- this one is about what the fallback IS, not about how to record it. ## Test generation and test writing should draw in tools through the same mechanism From 8c1ae565ac4613bbff7dee5eca1b74631916f1a9 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:38:13 +0800 Subject: [PATCH 2/8] feat: give research plans a shared executable approval standard --- .../plan.md | 42 ++-- .../prd.md | 2 +- .../reference/host-checks.md | 25 +++ TaskFlowDocs/todo.md | 18 +- hooks/README.md | 2 + hooks/research-planning | 122 +++++++++++ hooks/smoke-test | 1 + hooks/smoke-test-windows.ps1 | 2 + hooks/task | 1 + hooks/test-research-planning | 196 ++++++++++++++++++ skills/taskflow/SKILL.md | 2 + skills/taskflow/references/artifacts.md | 30 +++ skills/taskflow/references/runtime.md | 2 + 13 files changed, 420 insertions(+), 25 deletions(-) create mode 100644 TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md create mode 100644 hooks/research-planning create mode 100755 hooks/test-research-planning diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index f41373c..8f07b76 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -1,6 +1,6 @@ # Plan — 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: ready +> Status: in_progress ## Spec Pointers @@ -25,7 +25,7 @@ ## Preconditions -- 用户已同意整体方向。当前计划待批准后才实施。 +- 用户已经批准本版计划,批准项见下方记录。 - 当前分支源于已核对的远端 main。如开始编码前 main 包含相关规则改动,先同步并按仓库规定核对五宿主要求。 ## Plan Review @@ -37,11 +37,12 @@ ## Approval -- Status: requested -- Approved by: pending -- Approved at: pending -- Approved version: pending -- Approved scope: pending +- Status: approved +- Approved by: user +- Approved at: 2026-12-02 11:14 +0800 +- Approved version: v1 +- Approved scope: PRD / Spec / Plan +- Approved repository checks: d0ebadf0983514265833068caba341750f33b347 ## Repository Rule Checks @@ -60,12 +61,12 @@ - Dependencies: 用户批准 v1。 - Files: 项目内 TaskFlow Skill 的能力路由、工件参考。 - Implementation checklist: - - [ ] 显示发散能力适用条件和实际用法。方向、方法及验收已定时直接进入计划。 - - [ ] 在计划说明哪项取舍、问题或验收因工具输出改变。没有可用结果时进入兜底。 + - [x] 显示发散能力适用条件和实际用法。方向、方法及验收已定时直接进入计划。 + - [x] 在计划说明哪项取舍、问题或验收因工具输出改变。没有可用结果时进入兜底。 - Acceptance: 对 GoGo 未定范围的案例,能说明为什么必须分开组队、路由和自主首派。对已明确范围的例子可直接规划。 - Verification: 复查路由说明和合成案例记录,区分考虑、调用、采用。 - Rollback: 回退新增的发散路由与引用规则。 -- Status: pending +- Status: done ### Step 2 — 实现同一质量标准下的内置兜底 @@ -73,13 +74,13 @@ - Dependencies: Step 1 判明发散和收敛边界。 - Files: 工件参考、可复用示例、共享批准检查。 - Implementation checklist: - - [ ] 已进入 TaskFlow 且以调研、方案决策或实验为交付的任务可显式采用研究计划要求。既有 Unaided 登记形状继续可用。 - - [ ] 核对问题、证据准入、比较或判定标准、阶段产物及放行条件。实验另列基线、数据冻结、计分、停止或复跑条件。 - - [ ] 复用已有研究证据索引。未知需要指出影响和最先验证的步骤,允许证据不足时延期作结论。 + - [x] 已进入 TaskFlow 且以调研、方案决策或实验为交付的任务可显式采用研究计划要求。既有 Unaided 登记形状继续可用。 + - [x] 核对问题、证据准入、比较或判定标准、阶段产物及放行条件。实验另列基线、数据冻结、计分、停止或复跑条件。 + - [x] 复用已有研究证据索引。未知需要指出影响和最先验证的步骤,允许证据不足时延期作结论。 - Acceptance: 同一个案例用工具或自带方法都能批准。仅填工具名、空泛步骤或没有可判定的验收都要返回缺项。 - Verification: 在两条路径的夹具中对照 Plan 产物和真实批准输出。 - Rollback: 回退特定计划类型的结构校验,保留既有能力登记。 -- Status: pending +- Status: done ### Step 3 — 以研究案例和宿主验证可执行性 @@ -98,7 +99,18 @@ ## Verification / Review -- 已对照原仓库规则与实际 GoGo 案例的完成和待验证步骤。当前仅为待审设计。 +- 2026-12-02 Step 2: 真实批准验证工具声明、Unaided 和带证据索引的决策三条通过路径,同时拦截缺失方法、证据、数据冻结或放行条件的计划。 + +- 2026-12-02 Step 1: GoGo 合成案例对照发散输出和兜底方法。两条路线都区分组队、路由和第一次独立派发。 + +- `test-research-planning` 定向回归通过。同一 GoGo 合成实验通过已声明工具及 Unaided 两条批准路径。输入清单固定候选、原始权限和附件,计分区分首派和修订。缺数据冻结、证据文件、合法待补步骤、具体方法或放行条件时拒绝批准。非开发决策用现有证据索引并通过。 +- 五个 Agent 的配置和启动器已通过合成事件复核,详见 `reference/host-checks.md`。 + +- 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 diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md index dbc8035..498e3d7 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md @@ -1,6 +1,6 @@ # 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: ready +> Status: in_progress ## Goal diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md new file mode 100644 index 0000000..fef3fb9 --- /dev/null +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md @@ -0,0 +1,25 @@ +# 五个 Agent 的研究计划验证 + +2026-12-02 在 Windows 对候选工作树的五份宿主配置读取 `UserPromptSubmit`。按各自的配置调用启动器,向它们发送合成事件,并解码返回的事件和仓库规则路径。功能的通过与拒绝另外通过同一候选版本的 `hooks/task approve` 隔离测试验证。 + +## host-coverage/claude-code + +- Evidence: `hooks/hooks.json` 的 `run-hook.cmd prompt-reminder` 接受合成事件,返回 `UserPromptSubmit` 和 `CONTRIBUTING.md` 路径。 + +## host-coverage/codex + +- Evidence: `hooks/hooks-codex.json` 的 `commandWindows` 使用同一启动器。合成事件返回 `UserPromptSubmit` 和 `CONTRIBUTING.md` 路径。 + +## host-coverage/codebuddy + +- Evidence: `hooks/hooks-codebuddy.json` 直接通过 Bash 调用 `prompt-reminder`。合成事件返回 `UserPromptSubmit` 和 `CONTRIBUTING.md` 路径。 + +## host-coverage/dsh + +- Evidence: `hooks/hooks-dsh.json` 的 Bash 启动器接收桥接后的合成 `UserPromptSubmit` 并返回 `CONTRIBUTING.md` 路径。 + +## host-coverage/trae + +- Evidence: `hooks/hooks-trae.json` 的 Bash 启动器以工作目录处理未提供 cwd 的合成事件,返回 `UserPromptSubmit` 和 `CONTRIBUTING.md` 路径。 + +这些证据覆盖配置与启动器的调用。当前终端有 Claude Code 和 Codex 命令,先前两者的实际会话探针遇到认证限制,当前终端未找到 CodeBuddy、dsh 或 TRAE 命令。未得到五个 Agent 各自运行新计划的端到端会话证据。 diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index 2cd744f..ff4e0fb 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -35,6 +35,14 @@ has an issue number or URL. +## 确保 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 - ID: TF-20261201-d3ab22 @@ -478,7 +486,7 @@ has an issue number or URL. ## When a phase has no capability worth invoking, the fallback is the model's own a - ID: TF-20261024-b48e56 -- Status: promoted +- Status: in_progress - Priority: normal - Owner: Claude - Source: user request 2026-10-24 @@ -1463,11 +1471,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. - diff --git a/hooks/README.md b/hooks/README.md index 0955b91..82cff45 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -48,6 +48,7 @@ taskflow/hooks/ ├── capability-context # capture task, stage, session and invocation context ├── capability-valid # validate attributed stage releases ├── capability-evidence # records observable capability invocations +├── test-research-planning # research and decision planning regression fixture ├── external-evidence # records outside URLs from tool events ├── capability-gate # refuses a stage document's first body write ├── test-base-document-permit # scoped permit regression @@ -62,6 +63,7 @@ taskflow/hooks/ ├── markdown-field # read task metadata outside fenced examples ├── version-baseline # verify each task version has a Git rollback point ├── task # explicit intake/promote/unpromote/state/progress/unaided/recover/complete edits +├── research-planning # checks research and decision planning before approval ├── archive # full archive transaction (incl. Todo update) ├── version # atomic version transition (changed docs only) ├── reopen # retrieve an achieved task diff --git a/hooks/research-planning b/hooks/research-planning new file mode 100644 index 0000000..abf8d54 --- /dev/null +++ b/hooks/research-planning @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# Check the minimum execution contract for a declared research or decision plan. +set -euo pipefail +export LC_ALL=C + +fail() { printf 'Research planning: %s\n' "$*" >&2; exit 1; } +[ "$#" -eq 1 ] || fail 'Usage: research-planning TASK-DIR' +dir="$1"; prd="$dir/prd.md"; plan="$dir/plan.md" +[ -f "$prd" ] && grep -Eq '^## Planning Profile[[:space:]]*$' "$prd" || exit 0 +[ -f "$plan" ] || fail 'Plan is missing.' + +result="$(awk ' + function fail(message) { print message; failed = 1; exit 1 } + function trim(value) { + sub(/^[[:space:]]+/, "", value) + sub(/[[:space:]]+$/, "", value) + return value + } + function useful(value) { + return value != "" && value !~ /^[[:punct:][:space:]]+$|^<[^>]+>$/ && + tolower(value) !~ /^(tbd|todo|pending|unknown|none|n\/a|待定|待补|未知|暂无)[.]?$/ + } + function planned(value, parts) { + if (split(value, parts, " [|] ") != 3 || parts[1] != "pending" || + parts[2] !~ /^Step [1-9][0-9]*$/ || !useful(parts[3])) return 0 + return (substr(parts[2], 6) in steps) + } + FNR == 1 { + if (fence != "") fail("Unclosed Markdown fence in the PRD.") + section = ""; step = "" + } + { + sub(/\r$/, "") + sub(/[ \t]+$/, "") + line = $0 + sub(/^ ? ? ?/, "", line) + marker = substr(line, 1, 1); n = 0 + if (marker == sprintf("%c", 96) || marker == "~") + while (substr(line, n + 1, 1) == marker) n++ + if (fence != "") { + if (marker == fence && n >= width && substr(line, n + 1) ~ /^[[:space:]]*$/) fence = "" + next + } + if (n >= 3 && (marker == "~" || index(substr(line, n + 1), marker) == 0)) { + fence = marker; width = n; next + } + } + FILENAME == ARGV[2] && !profiles { next } + /^## / { + section = $0; step = "" + if (FILENAME == ARGV[1] && section == "## Planning Profile") profiles++ + if (FILENAME == ARGV[2] && section == "## Planning Method") methods++ + next + } + FILENAME == ARGV[1] { + if (section == "## Planning Profile" && /^- Type:/) { + type_count++ + type = trim(substr($0, index($0, ":") + 1)) + } + next + } + section == "## Planning Method" && /^- [^:]+:/ { + key = substr($0, 3, index($0, ":") - 3) + if (key in fields) fail("Repeated Planning Method field " key ".") + fields[key] = trim(substr($0, index($0, ":") + 1)) + next + } + section == "## Steps" && /^### / { + step = "" + if ($0 !~ /^### Step [1-9][0-9]*([[:space:]:]|$)/) next + step = $3 + sub(/:$/, "", step) + if (step in steps) fail("Repeated Step " step ".") + steps[step] = 1 + step_count++ + next + } + step != "" && /^- (Deliverable|Next condition):/ { + key = substr($0, 3, index($0, ":") - 3) + if ((step SUBSEP key) in outcomes) fail("Repeated " key " in Step " step ".") + outcomes[step, key] = trim(substr($0, index($0, ":") + 1)) + } + END { + if (failed) exit 1 + if (!profiles) exit 0 + if (fence != "") fail("Unclosed Markdown fence in the Plan.") + if (profiles != 1 || type_count != 1 || type !~ /^(research|decision|experiment)$/) + fail("Declare exactly one Planning Profile Type: research, decision, or experiment.") + if (methods != 1) fail("Add one ## Planning Method section to plan.md.") + required = "Question|Evidence|Eligibility|Decision rule|Method|Unknowns" + if (type == "experiment") required = required "|Baseline|Data freeze|Scoring|Stop or rerun" + count = split(required, keys, "[|]") + for (i = 1; i <= count; i++) { + key = keys[i] + if (key == "Unknowns" && fields[key] == "none") continue + if (!useful(fields[key])) fail("Fill in " key " in Planning Method.") + } + if (!step_count) fail("Add a numbered Step with an observable deliverable and next condition.") + for (step in steps) { + if (!useful(outcomes[step, "Deliverable"]) || !useful(outcomes[step, "Next condition"])) + fail("Step " step " needs a Deliverable and Next condition.") + } + if (fields["Unknowns"] != "none" && !planned(fields["Unknowns"])) + fail("Unknowns must be none or pending | Step N | impact and the check to run.") + evidence = fields["Evidence"] + if (evidence ~ /^https?:\/\/[^[:space:]]+$/) exit 0 + if (evidence ~ /^reference\/[^|[:cntrl:]]+\.md$/) { print evidence; exit 0 } + if (!planned(evidence)) + fail("Evidence needs a task reference, a public URL, or pending | Step N | evidence to collect.") + } +' "$prd" "$plan")" || fail "$result" + +if [ -n "$result" ]; then + path="$dir" + IFS=/ read -r -a components <<< "$result" + for part in "${components[@]}"; do + case "$part" in ''|.|..|*\\*|*:*) fail 'Use a direct path beneath reference/.' ;; esac + path="$path/$part" + [ ! -L "$path" ] || fail 'Use a direct path beneath reference/.' + done + [ -f "$path" ] && [ -s "$path" ] || fail "Evidence reference is missing or empty: $result" +fi diff --git a/hooks/smoke-test b/hooks/smoke-test index 35cc9c5..1cf5381 100755 --- a/hooks/smoke-test +++ b/hooks/smoke-test @@ -37,6 +37,7 @@ bash "$HERE/test-recurring-schedule" "$tmp/recurring-schedule" bash "$HERE/test-ledger-lock" "$tmp/ledger-lock-fixture" bash "$HERE/test-reuse-worktree" "$tmp/reuse-worktree-fixture" bash "$HERE/test-capability-context" "$tmp/capability-context-fixture" +bash "$HERE/test-research-planning" "$tmp/research-planning" bash "$HERE/test-capability-attribution" "$tmp/capability-attribution-fixture" bash "$HERE/test-base-document-permit" bash "$HERE/test-worktree-candidates" diff --git a/hooks/smoke-test-windows.ps1 b/hooks/smoke-test-windows.ps1 index f6d698a..6d04e80 100755 --- a/hooks/smoke-test-windows.ps1 +++ b/hooks/smoke-test-windows.ps1 @@ -349,6 +349,8 @@ try { } & "$here\run-hook.cmd" test-multi-todo (Join-Path $Root 'multi-todo') if ($LASTEXITCODE -ne 0) { throw 'multi Todo test failed' } + & "$here\run-hook.cmd" test-research-planning (Join-Path $Root 'research-planning') + if ($LASTEXITCODE -ne 0) { throw 'Research planning test failed' } $parityRoot = Join-Path $Root 'host-parity' $diagnosticRoot = Join-Path $Root 'diagnostic-fixture' & "$here\run-hook.cmd" test-diagnostic-log $diagnosticRoot diff --git a/hooks/task b/hooks/task index 712f053..a5e0147 100755 --- a/hooks/task +++ b/hooks/task @@ -2161,6 +2161,7 @@ STAGE_LINES [ "$cap_declared" -eq 0 ] || printf ', %s declared (not host-observed)' "$cap_declared" printf '\n' repository_checks="$(bash "$SCRIPT_DIR/repository-rule-checks" approve "$root" "$base")" || exit 1 + bash "$SCRIPT_DIR/research-planning" "$base" || exit 1 approved_at="$(date '+%Y-%m-%d %H:%M %z')" approved_scope="" [ -f "$prd" ] && approved_scope="PRD" diff --git a/hooks/test-research-planning b/hooks/test-research-planning new file mode 100755 index 0000000..993d628 --- /dev/null +++ b/hooks/test-research-planning @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# Exercise the research planning profile through the shared task approval command. +set -euo pipefail +HERE="$(cd "$(dirname "$0")" && pwd)" +mkdir -p "$1" +fixture="$(cd "$1" && pwd)" +unset TASKFLOW_TASK_ID TASKFLOW_PHASE +export TASKFLOW_SESSION_ID=research-fixture +task=2026-12-02-research-fixture + +expect_refusal() { + local expected="$1"; shift + cp "$plan" "$fixture/before" + if "$@" > "$fixture/output" 2>&1; then + printf 'Unexpected success: %s\n' "$*" >&2 + exit 1 + fi + grep -Fq -- "$expected" "$fixture/output" || { cat "$fixture/output" >&2; exit 1; } + cmp -s "$plan" "$fixture/before" +} + +setup_task() { + local name="$1" size="$2" + unset TASKFLOW_TASK_ID + repo="$fixture/$name-base" + checkout="$fixture/$name checkout" + git -c init.defaultBranch=main init -q "$repo" + printf '# Fixture\n' > "$repo/README.md" + git -C "$repo" add README.md + commit_fixture "$repo" base + git -C "$repo" worktree add -qb "fix/$task" "$checkout" + cd "$checkout" + bash "$HERE/task" intake 'Evaluate independent team selection on synthetic inputs' fixture --local --kind capability >/dev/null + local entry + entry="$(awk '/^- ID: TF-/{print $3; exit}' TaskFlowDocs/todo.md)" + bash "$HERE/task" promote "$entry" "$task" "$size" --kind capability >/dev/null + export TASKFLOW_TASK_ID="$task" + dir="TaskFlowDocs/$task" + plan="$dir/plan.md" + bash "$HERE/task" unaided PRD --considered 'requirements elicitation' >/dev/null + bash "$HERE/task" unaided Test --considered 'testing strategy' >/dev/null +} + +commit_fixture() { + git -C "$1" -c user.name=Fixture -c user.email=fixture@example.invalid -c commit.gpgsign=false commit -qm "$2" +} + +approve() { + bash "$HERE/task" approve "$task" fixture +} + +write_prd() { + cat <<'PRD' +# PRD +> Task version: v1 +> Status: planning + +## Goal + +Evaluate independent dispatch using comparable inputs. + +## Task Kind + +- Kind: capability + +## External Facts + +- Depends on external facts: no +- Why not: The synthetic input is defined in `README.md`. + +PRD +} + +write_plan_header() { + cat <<'PLAN' +# Plan +> Task version: v1 +> Status: planning + +## Skills / Tools Used + +- [PRD] Unaided — considered: requirements elicitation. +- [Test] Unaided — considered: testing strategy. +PLAN +} + +write_approval() { + cat <<'PLAN' + +## Plan Review + +- Verdict: sound +- Coverage: The manifest comparison and dispatch trial cover the synthetic work. +- Verifiability: Compare the measured initial dispatch with the recorded manifest. +- Layer ownership: The execution record supplies evidence for the result. + +## Approval + +- Status: requested +- Approved by: pending +- Approved at: pending +- Approved version: pending +- Approved scope: pending + +PLAN +} + +write_profile() { + write_prd + printf '## Planning Profile\n\n- Type: %s\n' "$1" +} + +write_case() { + local path="$1" + write_plan_header + if [ "$path" = declared ]; then + printf '%s\n' '- [Plan] Declared `fixture:idea-refine` — simulated option review split team choice from dispatch.' + else + printf '%s\n' '- [Plan] Unaided — considered: experiment breakdown and divergent exploration.' + fi + write_approval + cat <<'PLAN' +## Planning Method + +- Question: Which team can carry out the first dispatch independently on the same permissions and inputs? +- Evidence: pending | Step 1 | Capture the pre-dispatch goal, actual input manifest and permission receipts. +- Eligibility: Compare teams that receive the same goal, permissions and attachment set. Exclude runs with manual repair before the first dispatch. +- Decision rule: Promote a candidate only if it passes all three trials and matches every required input. Keep the baseline on a tie or an evidence gap. +- Unknowns: pending | Step 1 | An absent attachment receipt prevents an independence finding. Check the captured manifest before queuing the matching trial. +PLAN + if [ "$path" = declared ]; then + printf '%s\n' '- Method: The option review split team selection, routing and independent dispatch into separate comparisons.' + else + printf '%s\n' '- Method: List alternative teams, vary one routing assumption at a time, and test permission and failure repair independently.' + fi + cat <<'PLAN' +- Baseline: Replay direct dispatch with the approved reference team. +- Data freeze: Hash the pre-dispatch manifest and preserve the raw input receipt before comparing candidates. +- Scoring: Score each candidate on three first attempts. Count a pass only when every required input and permission is present. +- Stop or rerun: Stop a run on missing input proof. Rerun only after the manifest is corrected, and record the difference. + +## Steps + +### Step 1 — Audit GoGo input and shortlist candidate teams + +- Deliverable: A frozen manifest, baseline receipt and table of comparable candidate inputs and exclusions. +- Next condition: Start dispatch trials only when there are comparable receipts for the baseline and shortlisted candidates. +- Status: pending + +### Step 2 — Score independently dispatched trials + +- Deliverable: A table of first-attempt results, failure repairs and the selection verdict against the baseline. +- Next condition: Select a team only when all three attempts meet the decision rule. Record unresolved evidence gaps. +- Status: pending +PLAN +} + +setup_task unaided small +write_profile experiment > "$dir/prd.md" +bash "$HERE/task" unaided Plan --considered 'experiment breakdown and divergent exploration' >/dev/null +write_case unaided > "$fixture/experiment" +sed '/^- Data freeze:/d' "$fixture/experiment" > "$plan" +expect_refusal 'Fill in Data freeze' approve +sed 's/Unknowns: pending | Step 1/Unknowns: pending | Step 99/' "$fixture/experiment" > "$plan" +expect_refusal 'Unknowns must be none or pending' approve +sed 's/^- Evidence: .*/- Evidence: reference\/evidence.md/' "$fixture/experiment" > "$plan" +expect_refusal 'Evidence reference is missing or empty' approve +sed 's/^- Next condition: Start dispatch .*/- Next condition: TBD/' "$fixture/experiment" > "$plan" +expect_refusal 'Step 1 needs a Deliverable and Next condition' approve +cp "$fixture/experiment" "$plan" +approve | grep -F 'approve OK' +grep -Fq -- '- Approved version: v1' "$plan" + +setup_task declared small +write_profile experiment > "$dir/prd.md" +bash "$HERE/task" declared Plan --capability fixture:idea-refine >/dev/null +write_case declared > "$fixture/with-tool" +sed 's/^- Method: .*/- Method: TBD/' "$fixture/with-tool" > "$plan" +expect_refusal 'Fill in Method' approve +cp "$fixture/with-tool" "$plan" +approve | grep -F 'approve OK' +grep -Fq -- '- Approved version: v1' "$plan" + +write_profile decision > "$dir/prd.md" +mkdir -p "$dir/reference" +printf '# Evidence\n\nTwo audited manifests are comparable.\n' > "$dir/reference/evidence.md" +sed -e '/^- Baseline:/d' -e '/^- Data freeze:/d' -e '/^- Scoring:/d' -e '/^- Stop or rerun:/d' \ + -e 's/^- Evidence: .*/- Evidence: reference\/evidence.md/' "$fixture/with-tool" > "$plan" +approve | grep -F 'approve OK' + +{ + write_prd + printf '%s\n' '~~~markdown' '## Planning Profile' '- Type: experiment' '~~~' +} > "$dir/prd.md" +printf '%s\n' '## Planning Method' '- Method: duplicate' '- Method: duplicate' > "$plan" +bash "$HERE/research-planning" "$dir" diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index ae8cb27..759998a 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -236,6 +236,8 @@ A phase ran unaided when its artifact exists but nothing was invoked for its con When a capability was actually used but the host could not observe its invocation, record `hooks/task declared --capability ` and a stage-tagged Plan line starting with `Declared` and the capability name in backticks. This is a declaration, not host-observed evidence; never use it for a capability that was merely listed or selected. See `references/runtime.md` for conflicts and limits. +For an admitted TaskFlow task whose deliverable is research, a decision, or an experiment, suggest the [planning profile](references/artifacts.md#research-decision-and-experiment-plans). When the question, options, or decision criteria are still open, consider a divergent exploration capability such as `idea-refine` or a host equivalent before drafting the PRD. Use its interactive method and place reviewed decisions in the task PRD, with supporting work in the task's `reference/` when needed. If the capability's file generator only writes to a default repository path, use the interactive method or the embedded method. Inspect the proposed options, assumptions and counterexamples and record which changed a requirement, comparison, or test. If the design is already clear, proceed to planning. If a tool is unavailable or its result does not help, use the same profile and work through the embedded method. Keep actual tool use in the usual capability record. + **The first body write of each stage document is gated.** Before invoking a capability, run `bash /hooks/capability-context stage `, using the session ID delivered by SessionStart. The recorder binds a successful invocation to the task, version, stage and session captured when the call started. Only a matching unconsumed record can release the document; unbound legacy evidence remains preserved but cannot release a new stage. For Test, run `bash /hooks/capability-context release-test ` after its invocation. If the host does not expose both session and tool-call identity, use `task declared` for an actually invoked capability or `task unaided` when none applies. `## Skills / Tools Used` is a report of what happened. Record stage-tagged lines there; approval checks the capability released for that stage. Never treat shell writes as gated. See `references/runtime.md` for limits. For a non-trivial task: diff --git a/skills/taskflow/references/artifacts.md b/skills/taskflow/references/artifacts.md index a809c93..e5029ef 100644 --- a/skills/taskflow/references/artifacts.md +++ b/skills/taskflow/references/artifacts.md @@ -233,6 +233,36 @@ The second is the one that does the work. Mark what breaks quietly and forgets i **When the material goes wrong.** A path that no longer resolves prints as `MISSING: ` in the same line rather than disappearing — material vanishing is exactly what this list exists to surface. A pointer whose content contradicts the implementation is a work revision: fix the affected documents and add one change-log line, keeping the Task version. Only if the material overturns an approved requirement does it become a Task-version material change, per the User-change trigger in `SKILL.md`. Whether a *repository* document is wrong is a separate deliverable, not something this list judges. +## Research, decision and experiment plans + +Discuss the profile when an admitted TaskFlow task delivers research, a decision or an experiment. Mark the PRD with `## Planning Profile` and one `- Type: research`, `- Type: decision`, or `- Type: experiment`. Work through the plans below with suitable tools or unaided. Use the same criteria for judging the plan in either case. + +1. Frame the decision as a question with a supported audience and outcome. If meaningful choices are open, draft distinct options, surface assumptions, and try a counterexample for each. Narrow the options using the evidence that can actually be collected. +2. List admissible evidence, units, scope, comparability, and exclusions before choosing a winner. Write a decision rule that permits keeping the baseline or leaving the question unresolved. Record the evidence in the existing task index where available. +3. Divide the work into steps with an observable artifact and criteria for moving forward. Put the earliest check for a material unknown in one of those steps. For experiments, define the baseline, versioned input freeze, scoring, and stop or rerun conditions before looking at results. + +For example, a decision about selecting a team for an isolated trial can use: + +```markdown +## Planning Method + +- Question: Which candidate team can begin independently with the recorded input and permissions? +- Evidence: pending | Step 1 | Collect two pre-dispatch manifests and their permission and attachment records. +- Eligibility: Compare teams that received the same goal and can retrieve the same inputs. Exclude demos with manual corrections before the first dispatch. +- Decision rule: Prefer a team only if it passes all three independent trials and its first dispatch preserves every required input and permission. Keep the baseline on a tie or missing evidence. +- Method: Compare independent routing, team composition and permission failures separately. Record which tested assumption changes the shortlist. +- Unknowns: pending | Step 1 | Missing attachment records prevent an independence conclusion. Verify their availability in the manifest audit. + +## Steps + +### Step 1 — Compare pre-dispatch manifests + +- Deliverable: A table of accessed inputs, permissions and attachments for each candidate, with missing records marked. +- Next condition: Start candidate trials only if the pairs are comparable. Pause the affected trial if a required record is missing. +``` + +Add `Baseline`, `Data freeze`, `Scoring` and `Stop or rerun` to the experiment's `## Planning Method`. Keep the same structured fields if a tool supplies a result. In `Method`, say what changed because of that result, or document the concrete method followed unaided. For `Evidence`, use a nonempty Markdown file under `reference/`, a public URL, or `pending | Step N | evidence to collect`. Use `none` for evaluated unknowns when there are none, or `pending | Step N | impact and verification`. Every numbered Step under `## Steps` states its `Deliverable` and `Next condition` along with the ordinary execution fields. `task approve` checks these fields for marked tasks. Review the evidence and decision rule before requesting approval. + ## Release task documents A release does not use task documents at all. It runs `RELEASE.md` directly, on the base checkout, with no Todo item, no task directory, no branch, and no PRD, Spec, or Plan — so there is nothing here to restate a procedure or to drift from one. The record of a release is its `CHANGELOG.md` section and its GitHub Release body; `RELEASE.md` names what they carry, and this reference does not repeat it. diff --git a/skills/taskflow/references/runtime.md b/skills/taskflow/references/runtime.md index 3b64327..e5d4ad9 100644 --- a/skills/taskflow/references/runtime.md +++ b/skills/taskflow/references/runtime.md @@ -415,6 +415,7 @@ repo-root/ ├── capability-context # capture task, stage, session and invocation context ├── capability-valid # validate attributed stage releases ├── capability-evidence # records real invocations in the worktree store + ├── test-research-planning # research and decision planning regression fixture ├── external-evidence # records outside URLs from any tool event, in a separate store ├── capability-gate # refuses a stage document's first body write ├── test-base-document-permit # scoped permit regression @@ -429,6 +430,7 @@ repo-root/ ├── markdown-field # read task metadata outside fenced examples ├── version-baseline # verify each task version has a Git rollback point ├── task # explicit intake/promote/state/progress/unaided/complete + ├── research-planning # checks research and decision planning before approval ├── summarize-state # shared state-summary generator ├── archive # full archive transaction (incl. Todo update) ├── version # archive changed docs + version bump From a2d5423bb14d2d3d13d331c2f34a128c799117ed Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:59:22 +0800 Subject: [PATCH 3/8] docs: record candidate regression and host coverage --- .../2026-12-02-research-planning-fallback/plan.md | 14 +++++++++----- .../2026-12-02-research-planning-fallback/prd.md | 2 +- TaskFlowDocs/todo.md | 2 +- skills/taskflow/references/artifacts.md | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index 8f07b76..cc2ce23 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -1,6 +1,6 @@ # Plan — 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: in_progress +> Status: checking ## Spec Pointers @@ -88,17 +88,19 @@ - Dependencies: Step 2 的兜底和批准出口。 - Files: 合成研究、非开发决策样例和五宿主验收记录。 - Implementation checklist: - - [ ] GoGo 夹具覆盖候选筛选、入队前状态、实际输入核对、冻结、基线与计分。通用决策夹具覆盖证据、备选、选择阈值和待补问题。 - - [ ] 核对五个 Agent 的共用流程、使用证据和实际验证边界。 + - [x] GoGo 夹具覆盖候选筛选、入队前状态、实际输入核对、冻结、基线与计分。通用决策夹具覆盖证据、备选、选择阈值和待补问题。 + - [x] 核对五个 Agent 的共用流程、使用证据和实际验证边界。 - Acceptance: 两种案例均有阶段产物与最终判定。凭合成仓库可复现批准和拒绝,区分宿主接线和真实运行。 - Verification: 定向回归、三系统冒烟与适用的宿主观察。 - Rollback: 回退示例与适用的能力指引,保留原 Todo。 -- Status: pending +- Status: in_progress ## Checkpoints ## Verification / Review +- 2026-12-02 Step 3: GoGo 合成案例及五宿主启动器复核通过。运行 hooks/smoke-test-windows.ps1,完整套件退出 0,末项记录 WINDOWS OPEN STDIN PASSED in 120s。Ubuntu 和 macOS 待 CI。 + - 2026-12-02 Step 2: 真实批准验证工具声明、Unaided 和带证据索引的决策三条通过路径,同时拦截缺失方法、证据、数据冻结或放行条件的计划。 - 2026-12-02 Step 1: GoGo 合成案例对照发散输出和兜底方法。两条路线都区分组队、路由和第一次独立派发。 @@ -118,6 +120,8 @@ ## Follow-ups +- 候选改动待 Ubuntu 和 macOS CI。五宿主的实际会话覆盖限制见 reference/host-checks.md。 + ## Version History -- v1 — planning. +- v1 — implemented, verification in progress. diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md index 498e3d7..0da3ae7 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md @@ -1,6 +1,6 @@ # 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: in_progress +> Status: checking ## Goal diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index ff4e0fb..2316fec 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -495,7 +495,7 @@ has an issue number or URL. - Goal: When a phase has no capability worth invoking, the fallback is the model's own ability, and the docs should say so in those words instead of only describing it as nothing having been invoked - Task: `TaskFlowDocs/2026-12-02-research-planning-fallback/` - Initial files: plan.md=365853a405d7b862da6b76d6bbf1606ae6edcc765c19fcb04c6431960be81909 prd.md=4d4272c218632c0df8cf1b3a1cc942c207339f2695e4e8ce2182132a9b7a02f3 spec.md=6d02e970120e9e7da48c20b7e56fcfa3592cd80453bc240192a350d4da748fcc -- Next action: Complete PRD / Spec / Plan and request approval. +- Next action: Complete candidate CI, then collect acceptance. - Notes: Reported by the user 2026-10-24 while defining TF-20261024-310937. The user's wording: 这类引入工具的策略,当没有工具可以引入的时候,就用模型自己的能力。Related to TF-20261024-310937 (the Test stage's carrier): that task adds a fourth stage to the same set, so its line shape has to say what the model supplied for a stage no tool covers. Not the same gap as TF-20261009-8abbd6 (give a phase a way to record a selection that is not a tool-call artifact) -- this one is about what the fallback IS, not about how to record it. ## Test generation and test writing should draw in tools through the same mechanism diff --git a/skills/taskflow/references/artifacts.md b/skills/taskflow/references/artifacts.md index e5029ef..87a2b1f 100644 --- a/skills/taskflow/references/artifacts.md +++ b/skills/taskflow/references/artifacts.md @@ -235,7 +235,7 @@ The second is the one that does the work. Mark what breaks quietly and forgets i ## Research, decision and experiment plans -Discuss the profile when an admitted TaskFlow task delivers research, a decision or an experiment. Mark the PRD with `## Planning Profile` and one `- Type: research`, `- Type: decision`, or `- Type: experiment`. Work through the plans below with suitable tools or unaided. Use the same criteria for judging the plan in either case. +Discuss the profile when an admitted TaskFlow task delivers research, a decision or an experiment. Mark the PRD with `## Planning Profile` and one `- Type: research`, `- Type: decision`, or `- Type: experiment`. Work through the plans below with suitable tools or unaided. Use the same criteria for judging the plan in either case. The headings, types, and field names in this section are parsed in English. Write their values in the user's working language, keeping the literal `pending`, `Step N`, and `none` where used. 1. Frame the decision as a question with a supported audience and outcome. If meaningful choices are open, draft distinct options, surface assumptions, and try a counterexample for each. Narrow the options using the evidence that can actually be collected. 2. List admissible evidence, units, scope, comparability, and exclusions before choosing a winner. Write a decision rule that permits keeping the baseline or leaving the question unresolved. Record the evidence in the existing task index where available. @@ -261,7 +261,7 @@ For example, a decision about selecting a team for an isolated trial can use: - Next condition: Start candidate trials only if the pairs are comparable. Pause the affected trial if a required record is missing. ``` -Add `Baseline`, `Data freeze`, `Scoring` and `Stop or rerun` to the experiment's `## Planning Method`. Keep the same structured fields if a tool supplies a result. In `Method`, say what changed because of that result, or document the concrete method followed unaided. For `Evidence`, use a nonempty Markdown file under `reference/`, a public URL, or `pending | Step N | evidence to collect`. Use `none` for evaluated unknowns when there are none, or `pending | Step N | impact and verification`. Every numbered Step under `## Steps` states its `Deliverable` and `Next condition` along with the ordinary execution fields. `task approve` checks these fields for marked tasks. Review the evidence and decision rule before requesting approval. +Add `Baseline`, `Data freeze`, `Scoring` and `Stop or rerun` to the experiment's `## Planning Method`. Keep the same structured fields if a tool supplies a result. In `Method`, say what changed because of that result, or document the concrete method followed unaided. For `Evidence`, use a nonempty Markdown file under `reference/`, a public URL, or `pending | Step N | evidence to collect`. Use `none` for evaluated unknowns when there are none, or `pending | Step N | impact and verification`. Record facts the PRD already relies on under `## External Facts`. Keep unanswered questions open until the planned evidence step can settle them. Every numbered Step under `## Steps` states its `Deliverable` and `Next condition` along with the ordinary execution fields. `task approve` checks these fields for marked tasks. Review the evidence and decision rule before requesting approval. ## Release task documents From 0005b78888b58eee98816e63784d9e5182173c20 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:49:40 +0800 Subject: [PATCH 4/8] fix: select phase capabilities without prescribing providers --- TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md | 3 +++ hooks/capability-gate | 2 +- hooks/test-research-planning | 4 ++-- skills/taskflow/SKILL.md | 6 +++++- skills/taskflow/references/artifacts.md | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index cc2ce23..a2d2533 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -107,6 +107,7 @@ - `test-research-planning` 定向回归通过。同一 GoGo 合成实验通过已声明工具及 Unaided 两条批准路径。输入清单固定候选、原始权限和附件,计分区分首派和修订。缺数据冻结、证据文件、合法待补步骤、具体方法或放行条件时拒绝批准。非开发决策用现有证据索引并通过。 - 五个 Agent 的配置和启动器已通过合成事件复核,详见 `reference/host-checks.md`。 +- 工具选择修订后,Windows 定向回归通过 `test-research-planning`、`test-capability-attribution` 和 `smoke-test-windows.ps1` 的生命周期及写入保护路径。静态核对确认研究流程和夹具使用能力类别或通用模拟标识。 - host-coverage/claude-code: verified | reference/host-checks.md - host-coverage/codex: verified | reference/host-checks.md @@ -117,10 +118,12 @@ ## Change Log - 2026-12-02:根据用户确认的两个修复方向维护原 Todo 并形成当前计划。 +- 2026-12-02:各任务类型共用阶段能力引入机制,发散只提出所需能力类别。计划评审按具体贡献核对能力标记,并将资料核对、工作区准备和验证执行记到各自位置。 ## Follow-ups - 候选改动待 Ubuntu 和 macOS CI。五宿主的实际会话覆盖限制见 reference/host-checks.md。 +- 阶段能力归属 Todo TF-20261121-1cee4b 的相邻边界:现有声明只能证明 Agent 登记了阶段和工具名。已在因子挖掘案例确认,纯代码检索的声明仍可占据 PRD 阶段;计划评审需核对实际作用,机制补强应携带该误标用例。 ## Version History diff --git a/hooks/capability-gate b/hooks/capability-gate index 251cad6..079617b 100644 --- a/hooks/capability-gate +++ b/hooks/capability-gate @@ -455,7 +455,7 @@ if [ -f "$released" ]; then old_note=" Note: $old_rows row(s) in $(printf '%s' "$released" | tr '\134' '/') predate the task name on a release and belong to no task, so they no longer count as anybody's release; they still hold their sequences, so nothing was double-spent. The historical rows are preserved." fi fi -deny "TaskFlow pre-write gate blocked stage [$stage]: $detail. TaskFlow is entered before the work. Before the invocation, select this task and stage with bash /hooks/capability-context stage , then invoke a capability. If the host cannot supply a session and call identity, record an actual invocation using bash hooks/task declared. If no capability fits this phase, declare it: bash hooks/task unaided $stage --considered '$class'.$classes_note$old_note" +deny "TaskFlow pre-write gate blocked stage [$stage]: $detail. TaskFlow is entered before the work. Select a capability that contributes to this phase. Before the invocation, select this task and stage with bash /hooks/capability-context stage . If the host cannot supply a session and call identity, declare the invocation with bash hooks/task declared and describe its contribution in the Plan. Keep supporting lookups and execution results with the evidence. If no capability fits this phase, declare it: bash hooks/task unaided $stage --considered '$class'.$classes_note$old_note" } # Judge every target the event named. `deny` exits inside `judge_path`, so a diff --git a/hooks/test-research-planning b/hooks/test-research-planning index 993d628..d22a02b 100755 --- a/hooks/test-research-planning +++ b/hooks/test-research-planning @@ -114,7 +114,7 @@ write_case() { local path="$1" write_plan_header if [ "$path" = declared ]; then - printf '%s\n' '- [Plan] Declared `fixture:idea-refine` — simulated option review split team choice from dispatch.' + printf '%s\n' '- [Plan] Declared `fixture:option-review` — simulated option review split team choice from dispatch.' else printf '%s\n' '- [Plan] Unaided — considered: experiment breakdown and divergent exploration.' fi @@ -173,7 +173,7 @@ grep -Fq -- '- Approved version: v1' "$plan" setup_task declared small write_profile experiment > "$dir/prd.md" -bash "$HERE/task" declared Plan --capability fixture:idea-refine >/dev/null +bash "$HERE/task" declared Plan --capability fixture:option-review >/dev/null write_case declared > "$fixture/with-tool" sed 's/^- Method: .*/- Method: TBD/' "$fixture/with-tool" > "$plan" expect_refusal 'Fill in Method' approve diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index 759998a..227bb58 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -218,6 +218,8 @@ non-trivial task → planning workflow below TaskFlow is the task-lifecycle and artifact layer, not the expert-capability layer. Before substantive work in any TaskFlow phase, inspect the capabilities currently available in the host environment, including Skills, tools, MCP servers, and Agents, and freely determine whether any can materially improve the current task, artifact, or decision. TaskFlow does not require the selection or use of any particular capability, provider, chain, category, or number of capabilities. When the Agent selects one for use, invoke or load it immediately through the host's supported mechanism before following its workflow or incorporating its output; discovery, listing, or selection alone is not invocation. +Apply this selection process in every phase and every task profile. Use the phase's capability class to decide what help is needed, then choose based on the current host and task. Task profiles define the work and its acceptance criteria. They leave tool selection to this process. + If none apply, continue with the base TaskFlow flow. If an optional invocation is unavailable or fails, continue with the base flow and record the failed or unavailable attempt only when it materially affects the task; block only when the capability is required for correctness and no safe alternative exists. Review successful outputs before incorporating them; raw outputs are not authoritative. When `plan.md` exists, record only actual invocation attempts: for success, record purpose and incorporated conclusions; for a relevant failure, record the failed or unavailable outcome without claiming incorporation. Do not record discovery, selection, or an uninvoked capability as used. A phase's artifact has an equivalent outside TaskFlow. TaskFlow names these itself, so an available capability rarely advertises "PRD"; match on the concept instead, and consider the class below before writing the artifact unaided. The class says what to look for, never what to use: availability, fit, and the decision to proceed unaided stay yours. @@ -234,9 +236,11 @@ A phase's artifact has an equivalent outside TaskFlow. TaskFlow names these itse A phase ran unaided when its artifact exists but nothing was invoked for its concept class; that is a legitimate outcome, and it is recorded as one — `hooks/task unaided --considered ""` — rather than asserted in prose. `## Skills / Tools Used` in `plan.md` is required, and a phase that ran unaided says so in one `Unaided — …` line rather than staying empty. The class list names what to look for in every phase, and `[Test]` is required of every task even when the Plan writes no test Step: decide the phase, then record what was decided. +For a stage record, identify the class served and the specific part of the artifact or decision the capability helped produce. A source lookup may establish the current behavior. A workspace operation may isolate edits. A test runner may confirm a result. Record those contributions in the task's facts, references, workspace, or verification as appropriate. If the Agent frames the requirements, designs the solution, sequences the work, or designs the tests itself after using those inputs, record that phase as `Unaided`. Review this distinction before asking for approval. + When a capability was actually used but the host could not observe its invocation, record `hooks/task declared --capability ` and a stage-tagged Plan line starting with `Declared` and the capability name in backticks. This is a declaration, not host-observed evidence; never use it for a capability that was merely listed or selected. See `references/runtime.md` for conflicts and limits. -For an admitted TaskFlow task whose deliverable is research, a decision, or an experiment, suggest the [planning profile](references/artifacts.md#research-decision-and-experiment-plans). When the question, options, or decision criteria are still open, consider a divergent exploration capability such as `idea-refine` or a host equivalent before drafting the PRD. Use its interactive method and place reviewed decisions in the task PRD, with supporting work in the task's `reference/` when needed. If the capability's file generator only writes to a default repository path, use the interactive method or the embedded method. Inspect the proposed options, assumptions and counterexamples and record which changed a requirement, comparison, or test. If the design is already clear, proceed to planning. If a tool is unavailable or its result does not help, use the same profile and work through the embedded method. Keep actual tool use in the usual capability record. +For an admitted TaskFlow task whose deliverable is research, a decision, or an experiment, suggest the [planning profile](references/artifacts.md#research-decision-and-experiment-plans). Open questions, options, or decision criteria call for the divergent exploration class before drafting the PRD. Use the same phase capability process above. If a suitable capability helps, record which option, assumption, or counterexample changed a requirement, comparison, or test. Place reviewed decisions in the task PRD and supporting work under the task's `reference/` when needed. If the design is clear, proceed to planning. If no available capability fits or helps, use the profile's built-in method and record the phase outcome through the same process. **The first body write of each stage document is gated.** Before invoking a capability, run `bash /hooks/capability-context stage `, using the session ID delivered by SessionStart. The recorder binds a successful invocation to the task, version, stage and session captured when the call started. Only a matching unconsumed record can release the document; unbound legacy evidence remains preserved but cannot release a new stage. For Test, run `bash /hooks/capability-context release-test ` after its invocation. If the host does not expose both session and tool-call identity, use `task declared` for an actually invoked capability or `task unaided` when none applies. `## Skills / Tools Used` is a report of what happened. Record stage-tagged lines there; approval checks the capability released for that stage. Never treat shell writes as gated. See `references/runtime.md` for limits. diff --git a/skills/taskflow/references/artifacts.md b/skills/taskflow/references/artifacts.md index 87a2b1f..d475ddd 100644 --- a/skills/taskflow/references/artifacts.md +++ b/skills/taskflow/references/artifacts.md @@ -213,6 +213,8 @@ List a capability only after an actual invocation attempt. Discovery or selectio `task approve` requires `[PRD]`, `[Plan]`, and `[Test]`, plus `[Spec]` when present. It reconciles each line against that stage’s release or explicit declaration. An unaided line must carry the declared concept class. A mismatched or missing record blocks approval; a store whose releases outrun its evidence is also refused. Fold reviewed capability output into the appropriate task artifact. +As part of `## Plan Review`, check what a reported capability contributed to its phase. `[PRD]` describes help framing a requirement or acceptance criterion. `[Spec]` describes help making a design decision. `[Plan]` describes help decomposing or sequencing work. `[Test]` describes help with a testing strategy or test design. A repository lookup, workspace setup, or routine test execution belongs with evidence, setup, or verification when that is its contribution. The release ledger verifies the recorded identity and stage. The Agent reviews the actual use and resulting decision before requesting approval. + `## Reference Pointers` lists what this task's work is read against. A plain bullet there is material already consulted; the line below is a declaration that it must come back while the task runs: ```markdown From 30a5e448d4650d25f77113e691e289baf5966947 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:03:10 +0800 Subject: [PATCH 5/8] docs: make unaided research plans executable at handoff --- .../plan.md | 2 ++ skills/taskflow/SKILL.md | 2 ++ skills/taskflow/references/artifacts.md | 20 ++++++++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index a2d2533..a6c2e3e 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -108,6 +108,7 @@ - `test-research-planning` 定向回归通过。同一 GoGo 合成实验通过已声明工具及 Unaided 两条批准路径。输入清单固定候选、原始权限和附件,计分区分首派和修订。缺数据冻结、证据文件、合法待补步骤、具体方法或放行条件时拒绝批准。非开发决策用现有证据索引并通过。 - 五个 Agent 的配置和启动器已通过合成事件复核,详见 `reference/host-checks.md`。 - 工具选择修订后,Windows 定向回归通过 `test-research-planning`、`test-capability-attribution` 和 `smoke-test-windows.ps1` 的生命周期及写入保护路径。静态核对确认研究流程和夹具使用能力类别或通用模拟标识。 +- 兜底质量复验:用隔离的历史决策检索案例从零编写 PRD、Spec、Plan,四个阶段均登记 Unaided,真实 `task approve` 通过。按 Plan 读回输入路径、冻结和配对结果,完整四组时输出试用建议,两种方式的中位数为 74 秒和 46.5 秒。删除一条回执后,Plan 的停止条件输出待补的 Q4 并延期决策。数据及结果仅用于合成验证。 - host-coverage/claude-code: verified | reference/host-checks.md - host-coverage/codex: verified | reference/host-checks.md @@ -119,6 +120,7 @@ - 2026-12-02:根据用户确认的两个修复方向维护原 Todo 并形成当前计划。 - 2026-12-02:各任务类型共用阶段能力引入机制,发散只提出所需能力类别。计划评审按具体贡献核对能力标记,并将资料核对、工作区准备和验证执行记到各自位置。 +- 2026-12-02:补细无专用工具时从 PRD、Spec 到 Plan 的写法和交接走查。验收增加独立样例的可执行结果与缺证据分支。 ## Follow-ups diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index 227bb58..b72d092 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -242,6 +242,8 @@ When a capability was actually used but the host could not observe its invocatio For an admitted TaskFlow task whose deliverable is research, a decision, or an experiment, suggest the [planning profile](references/artifacts.md#research-decision-and-experiment-plans). Open questions, options, or decision criteria call for the divergent exploration class before drafting the PRD. Use the same phase capability process above. If a suitable capability helps, record which option, assumption, or counterexample changed a requirement, comparison, or test. Place reviewed decisions in the task PRD and supporting work under the task's `reference/` when needed. If the design is clear, proceed to planning. If no available capability fits or helps, use the profile's built-in method and record the phase outcome through the same process. +Use the built-in method while drafting each applicable artifact. Before requesting approval, start from the task documents and read the first executable Step as a fresh executor would. Resolve any missing input, comparison rule, expected result, or stop condition that would force the executor to ask the author. Record the check in `## Plan Review`. + **The first body write of each stage document is gated.** Before invoking a capability, run `bash /hooks/capability-context stage `, using the session ID delivered by SessionStart. The recorder binds a successful invocation to the task, version, stage and session captured when the call started. Only a matching unconsumed record can release the document; unbound legacy evidence remains preserved but cannot release a new stage. For Test, run `bash /hooks/capability-context release-test ` after its invocation. If the host does not expose both session and tool-call identity, use `task declared` for an actually invoked capability or `task unaided` when none applies. `## Skills / Tools Used` is a report of what happened. Record stage-tagged lines there; approval checks the capability released for that stage. Never treat shell writes as gated. See `references/runtime.md` for limits. For a non-trivial task: diff --git a/skills/taskflow/references/artifacts.md b/skills/taskflow/references/artifacts.md index d475ddd..7154387 100644 --- a/skills/taskflow/references/artifacts.md +++ b/skills/taskflow/references/artifacts.md @@ -239,11 +239,14 @@ The second is the one that does the work. Mark what breaks quietly and forgets i Discuss the profile when an admitted TaskFlow task delivers research, a decision or an experiment. Mark the PRD with `## Planning Profile` and one `- Type: research`, `- Type: decision`, or `- Type: experiment`. Work through the plans below with suitable tools or unaided. Use the same criteria for judging the plan in either case. The headings, types, and field names in this section are parsed in English. Write their values in the user's working language, keeping the literal `pending`, `Step N`, and `none` where used. -1. Frame the decision as a question with a supported audience and outcome. If meaningful choices are open, draft distinct options, surface assumptions, and try a counterexample for each. Narrow the options using the evidence that can actually be collected. -2. List admissible evidence, units, scope, comparability, and exclusions before choosing a winner. Write a decision rule that permits keeping the baseline or leaving the question unresolved. Record the evidence in the existing task index where available. -3. Divide the work into steps with an observable artifact and criteria for moving forward. Put the earliest check for a material unknown in one of those steps. For experiments, define the baseline, versioned input freeze, scoring, and stop or rerun conditions before looking at results. +### Built-in drafting method -For example, a decision about selecting a team for an isolated trial can use: +1. **PRD.** Identify who will make which decision and what evidence could change it. If the direction is open, compare the status quo and one or more plausible alternatives. For each, write an assumption, a counterexample that could disqualify it, and the cheapest check that would distinguish it. Carry the chosen question, scope, constraints, and observable acceptance into the PRD. Record open questions and their effect on the decision. +2. **Evidence and design.** Separate known facts from evidence still to collect. For each material claim identify the source or collection step. Define the unit of comparison, exclusions, and what counts as comparable. State the decision rule before collecting outcomes, including when to retain the baseline or defer the decision. For a large task put the comparison protocol and error handling in the Spec. For a small task carry these directly into the Plan. For experiments, freeze the inputs and define the baseline, scoring, and stop or rerun conditions before reading results. +3. **Plan.** Turn each evidence gap or design decision into an action with an input, a task-relative deliverable, and an observable condition for the next step. Put a cheap check for the most consequential unknown first. Cover the route from evidence collection through the decision or handoff. A runnable first step should explain where to get its input, what to do with it, and when to stop if it is missing or unusable. +4. **Review.** Walk through the Plan from the task documents alone. Trace the first step to an input, then trace a plausible success and failure to their next actions. Trace the final decision back to the acceptance criteria. Put concrete results in `## Plan Review`. A listed source with no retrieval instructions, an undefined comparison, or a Step that just says “research and decide” needs revision before a sound verdict. + +In a team selection study, the PRD could define independence as preserving all required inputs on the first attempt and state that missing permission evidence blocks a recommendation. The Spec could freeze the same goal and manifest for each candidate and define how manual corrections are flagged. The Plan turns those decisions into two executable steps: ```markdown ## Planning Method @@ -259,8 +262,15 @@ For example, a decision about selecting a team for an isolated trial can use: ### Step 1 — Compare pre-dispatch manifests -- Deliverable: A table of accessed inputs, permissions and attachments for each candidate, with missing records marked. +- Start from the task's candidate list. Retrieve the first pre-dispatch receipt for each candidate. Compare goal, permissions, and attachment identifiers with the approved input manifest. Mark missing records and candidates that received a manual correction. +- Deliverable: `reference/manifest-audit.md` with one row per candidate, its received inputs and permissions, and each exclusion with its reason. - Next condition: Start candidate trials only if the pairs are comparable. Pause the affected trial if a required record is missing. + +### Step 2 — Run and score independent trials + +- Use the comparable candidates from Step 1 and send the frozen manifest three times per candidate. Read the first attempt before inspecting any repair. Score input, permission, and attachment checks separately. +- Deliverable: `reference/trial-verdict.md` with per-attempt results, receipt links, exclusions, and the decision under the predeclared rule. +- Next condition: Recommend a candidate only when all three trials pass. Keep the baseline for tied or incomplete results and list the missing evidence needed for another comparison. ``` Add `Baseline`, `Data freeze`, `Scoring` and `Stop or rerun` to the experiment's `## Planning Method`. Keep the same structured fields if a tool supplies a result. In `Method`, say what changed because of that result, or document the concrete method followed unaided. For `Evidence`, use a nonempty Markdown file under `reference/`, a public URL, or `pending | Step N | evidence to collect`. Use `none` for evaluated unknowns when there are none, or `pending | Step N | impact and verification`. Record facts the PRD already relies on under `## External Facts`. Keep unanswered questions open until the planned evidence step can settle them. Every numbered Step under `## Steps` states its `Deliverable` and `Next condition` along with the ordinary execution fields. `task approve` checks these fields for marked tasks. Review the evidence and decision rule before requesting approval. From 44b72d4f6d1d68ec8f25570ecac529a0582b39c8 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:37:38 +0800 Subject: [PATCH 6/8] test: verify tool-backed research cites a current plan step --- TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md | 1 + hooks/test-research-planning | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index a6c2e3e..5dd8cd9 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -109,6 +109,7 @@ - 五个 Agent 的配置和启动器已通过合成事件复核,详见 `reference/host-checks.md`。 - 工具选择修订后,Windows 定向回归通过 `test-research-planning`、`test-capability-attribution` 和 `smoke-test-windows.ps1` 的生命周期及写入保护路径。静态核对确认研究流程和夹具使用能力类别或通用模拟标识。 - 兜底质量复验:用隔离的历史决策检索案例从零编写 PRD、Spec、Plan,四个阶段均登记 Unaided,真实 `task approve` 通过。按 Plan 读回输入路径、冻结和配对结果,完整四组时输出试用建议,两种方式的中位数为 74 秒和 46.5 秒。删除一条回执后,Plan 的停止条件输出待补的 Q4 并延期决策。数据及结果仅用于合成验证。 +- 阶段能力 v3 集成回归:有工具的研究夹具将阶段贡献关联到实际计划步骤。该夹具在本分支和临时组合的批准入口均通过,Unaided 与证据不足拒绝路径继续可用。 - host-coverage/claude-code: verified | reference/host-checks.md - host-coverage/codex: verified | reference/host-checks.md diff --git a/hooks/test-research-planning b/hooks/test-research-planning index d22a02b..610643c 100755 --- a/hooks/test-research-planning +++ b/hooks/test-research-planning @@ -153,6 +153,10 @@ PLAN - Next condition: Select a team only when all three attempts meet the decision rule. Record unresolved evidence gaps. - Status: pending PLAN + if [ "$path" = declared ]; then + printf '\n%s\n\n%s\n' '## Capability Contributions' \ + '- [Plan] `fixture:option-review` | plan.md#Step 1 — Audit GoGo input and shortlist candidate teams | Separate shortlisting with matched inputs from later dispatch trials.' + fi } setup_task unaided small From 07c936e90a6d17390866ae43141dbf35d06931e3 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:35:09 +0800 Subject: [PATCH 7/8] docs: record TaskFlow pull request scope --- .../2026-12-02-research-planning-fallback/plan.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md index fe0cf8a..b20a697 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md @@ -133,3 +133,11 @@ ## Version History - v1 — implemented, verification in progress. + + +## Pull request + +- Summary: 为研究、决策和实验提供可执行的同标准计划与无工具兜底。 +- TaskFlow traceability: TF-20261024-b48e56,当前任务代码、文档和回归,目标 hkwuks/TaskFlow 的 main。 +- Verification: 记录定向回归、差异检查、宿主覆盖及 GitHub CI。 +- Review boundaries: 单独交付当前已批准范围,明确实际宿主覆盖边界。 From 54b175ba10363b332f6a81cf8f8ae9fdf6e465c7 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:48:34 +0800 Subject: [PATCH 8/8] docs: archive verified TaskFlow task --- .../plan.md | 18 ++++++++++++++---- .../prd.md | 2 +- .../reference/host-checks.md | 0 .../spec.md | 0 TaskFlowDocs/todo.md | 13 +++---------- 5 files changed, 18 insertions(+), 15 deletions(-) rename TaskFlowDocs/{ => achieved}/2026-12-02-research-planning-fallback/plan.md (89%) rename TaskFlowDocs/{ => achieved}/2026-12-02-research-planning-fallback/prd.md (99%) rename TaskFlowDocs/{ => achieved}/2026-12-02-research-planning-fallback/reference/host-checks.md (100%) rename TaskFlowDocs/{ => achieved}/2026-12-02-research-planning-fallback/spec.md (100%) diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/plan.md similarity index 89% rename from TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md rename to TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/plan.md index b20a697..23fc39c 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/plan.md +++ b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/plan.md @@ -1,6 +1,6 @@ # Plan — 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: checking +> Status: completed ## Spec Pointers @@ -93,15 +93,17 @@ - Acceptance: 两种案例均有阶段产物与最终判定。凭合成仓库可复现批准和拒绝,区分宿主接线和真实运行。 - Verification: 定向回归、三系统冒烟与适用的宿主观察。 - Rollback: 回退示例与适用的能力指引,保留原 Todo。 -- Status: in_progress +- Status: done ## Checkpoints ## Verification / Review +- 2026-12-02 Step 3: PR #161 的提交 07c936e 已通过三平台 Hooks CI。用户要求通过验证后分别归档合并。[CI](https://github.com/hkwuks/TaskFlow/actions/runs/46842685288) + - 2026-12-02:用户确认保留当前 main 的有效检查与本任务研究行为,测试保留双方用例。 -- 2026-12-02 Step 3: GoGo 合成案例及五宿主启动器复核通过。运行 hooks/smoke-test-windows.ps1,完整套件退出 0,末项记录 WINDOWS OPEN STDIN PASSED in 120s。Ubuntu 和 macOS 待 CI。 +- 2026-12-02 Step 3: GoGo 合成案例及五宿主启动器复核通过。运行 hooks/smoke-test-windows.ps1,完整套件退出 0,末项记录 WINDOWS OPEN STDIN PASSED in 120s。三平台结果见本节 CI 记录。 - 2026-12-02 Step 2: 真实批准验证工具声明、Unaided 和带证据索引的决策三条通过路径,同时拦截缺失方法、证据、数据冻结或放行条件的计划。 @@ -127,7 +129,7 @@ ## Follow-ups -- 候选改动待 Ubuntu 和 macOS CI。五宿主的实际会话覆盖限制见 reference/host-checks.md。 +- 五宿主的实际会话覆盖限制见 reference/host-checks.md。 - 阶段能力归属 Todo TF-20261121-1cee4b 的相邻边界:现有声明只能证明 Agent 登记了阶段和工具名。已在因子挖掘案例确认,纯代码检索的声明仍可占据 PRD 阶段;计划评审需核对实际作用,机制补强应携带该误标用例。 ## Version History @@ -141,3 +143,11 @@ - TaskFlow traceability: TF-20261024-b48e56,当前任务代码、文档和回归,目标 hkwuks/TaskFlow 的 main。 - Verification: 记录定向回归、差异检查、宿主覆盖及 GitHub CI。 - Review boundaries: 单独交付当前已批准范围,明确实际宿主覆盖边界。 + +## Todo Record + +Moved verbatim from the TODO entry by `hooks/archive`, grouped by the field each block followed. + +### `- Notes:` + +- Reported by the user 2026-10-24 while defining TF-20261024-310937. The user's wording: 这类引入工具的策略,当没有工具可以引入的时候,就用模型自己的能力。Related to TF-20261024-310937 (the Test stage's carrier): that task adds a fourth stage to the same set, so its line shape has to say what the model supplied for a stage no tool covers. Not the same gap as TF-20261009-8abbd6 (give a phase a way to record a selection that is not a tool-call artifact) -- this one is about what the fallback IS, not about how to record it. diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/prd.md similarity index 99% rename from TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md rename to TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/prd.md index 0da3ae7..b3165ff 100644 --- a/TaskFlowDocs/2026-12-02-research-planning-fallback/prd.md +++ b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/prd.md @@ -1,6 +1,6 @@ # 让研究和决策计划在无专用工具时也可执行 > Task version: v1 -> Status: checking +> Status: completed ## Goal diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/reference/host-checks.md similarity index 100% rename from TaskFlowDocs/2026-12-02-research-planning-fallback/reference/host-checks.md rename to TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/reference/host-checks.md diff --git a/TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md b/TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/spec.md similarity index 100% rename from TaskFlowDocs/2026-12-02-research-planning-fallback/spec.md rename to TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/spec.md diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index 0e0d48c..86ae5f2 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -480,17 +480,10 @@ has an issue number or URL. ## When a phase has no capability worth invoking, the fallback is the model's own a - ID: TF-20261024-b48e56 -- Status: in_progress -- Priority: normal -- Owner: Claude -- Source: user request 2026-10-24 -- Added: 2026-10-24 -- Updated: 2026-12-02 +- Status: done - Goal: When a phase has no capability worth invoking, the fallback is the model's own ability, and the docs should say so in those words instead of only describing it as nothing having been invoked -- Task: `TaskFlowDocs/2026-12-02-research-planning-fallback/` -- Initial files: plan.md=365853a405d7b862da6b76d6bbf1606ae6edcc765c19fcb04c6431960be81909 prd.md=4d4272c218632c0df8cf1b3a1cc942c207339f2695e4e8ce2182132a9b7a02f3 spec.md=6d02e970120e9e7da48c20b7e56fcfa3592cd80453bc240192a350d4da748fcc -- Next action: Complete candidate CI, then collect acceptance. -- Notes: Reported by the user 2026-10-24 while defining TF-20261024-310937. The user's wording: 这类引入工具的策略,当没有工具可以引入的时候,就用模型自己的能力。Related to TF-20261024-310937 (the Test stage's carrier): that task adds a fourth stage to the same set, so its line shape has to say what the model supplied for a stage no tool covers. Not the same gap as TF-20261009-8abbd6 (give a phase a way to record a selection that is not a tool-call artifact) -- this one is about what the fallback IS, not about how to record it. +- Task: `TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/` +- Next action: None — completed and archived. ## Test generation and test writing should draw in tools through the same mechanism