Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Plan — 让研究和决策计划在无专用工具时也可执行
> Task version: v1
> Status: completed

## 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: 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

- 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:
- [x] 显示发散能力适用条件和实际用法。方向、方法及验收已定时直接进入计划。
- [x] 在计划说明哪项取舍、问题或验收因工具输出改变。没有可用结果时进入兜底。
- Acceptance: 对 GoGo 未定范围的案例,能说明为什么必须分开组队、路由和自主首派。对已明确范围的例子可直接规划。
- Verification: 复查路由说明和合成案例记录,区分考虑、调用、采用。
- Rollback: 回退新增的发散路由与引用规则。
- Status: done

### Step 2 — 实现同一质量标准下的内置兜底

- Goal: 有用工具、工具失败或没有工具时,计划都能支持下一位执行者采取行动。
- Dependencies: Step 1 判明发散和收敛边界。
- Files: 工件参考、可复用示例、共享批准检查。
- Implementation checklist:
- [x] 已进入 TaskFlow 且以调研、方案决策或实验为交付的任务可显式采用研究计划要求。既有 Unaided 登记形状继续可用。
- [x] 核对问题、证据准入、比较或判定标准、阶段产物及放行条件。实验另列基线、数据冻结、计分、停止或复跑条件。
- [x] 复用已有研究证据索引。未知需要指出影响和最先验证的步骤,允许证据不足时延期作结论。
- Acceptance: 同一个案例用工具或自带方法都能批准。仅填工具名、空泛步骤或没有可判定的验收都要返回缺项。
- Verification: 在两条路径的夹具中对照 Plan 产物和真实批准输出。
- Rollback: 回退特定计划类型的结构校验,保留既有能力登记。
- Status: done

### Step 3 — 以研究案例和宿主验证可执行性

- Goal: 确认计划能交给不同宿主的 Agent 接着执行,并能解释何时可以下结论。
- Dependencies: Step 2 的兜底和批准出口。
- Files: 合成研究、非开发决策样例和五宿主验收记录。
- Implementation checklist:
- [x] GoGo 夹具覆盖候选筛选、入队前状态、实际输入核对、冻结、基线与计分。通用决策夹具覆盖证据、备选、选择阈值和待补问题。
- [x] 核对五个 Agent 的共用流程、使用证据和实际验证边界。
- Acceptance: 两种案例均有阶段产物与最终判定。凭合成仓库可复现批准和拒绝,区分宿主接线和真实运行。
- Verification: 定向回归、三系统冒烟与适用的宿主观察。
- Rollback: 回退示例与适用的能力指引,保留原 Todo。
- 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。三平台结果见本节 CI 记录。

- 2026-12-02 Step 2: 真实批准验证工具声明、Unaided 和带证据索引的决策三条通过路径,同时拦截缺失方法、证据、数据冻结或放行条件的计划。

- 2026-12-02 Step 1: GoGo 合成案例对照发散输出和兜底方法。两条路线都区分组队、路由和第一次独立派发。

- `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 并延期决策。数据及结果仅用于合成验证。
- 阶段能力 v3 集成回归:有工具的研究夹具将阶段贡献关联到实际计划步骤。该夹具在本分支和临时组合的批准入口均通过,Unaided 与证据不足拒绝路径继续可用。

- 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:根据用户确认的两个修复方向维护原 Todo 并形成当前计划。
- 2026-12-02:各任务类型共用阶段能力引入机制,发散只提出所需能力类别。计划评审按具体贡献核对能力标记,并将资料核对、工作区准备和验证执行记到各自位置。
- 2026-12-02:补细无专用工具时从 PRD、Spec 到 Plan 的写法和交接走查。验收增加独立样例的可执行结果与缺证据分支。

## Follow-ups

- 五宿主的实际会话覆盖限制见 reference/host-checks.md。
- 阶段能力归属 Todo TF-20261121-1cee4b 的相邻边界:现有声明只能证明 Agent 登记了阶段和工具名。已在因子挖掘案例确认,纯代码检索的声明仍可占据 PRD 阶段;计划评审需核对实际作用,机制补强应携带该误标用例。

## Version History

- v1 — implemented, verification in progress.


## Pull request

- Summary: 为研究、决策和实验提供可执行的同标准计划与无工具兜底。
- 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.
50 changes: 50 additions & 0 deletions TaskFlowDocs/achieved/2026-12-02-research-planning-fallback/prd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 让研究和决策计划在无专用工具时也可执行
> Task version: v1
> Status: completed

## 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

- 通过待审计划确认具体实施边界。
Original file line number Diff line number Diff line change
@@ -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 各自运行新计划的端到端会话证据。
Original file line number Diff line number Diff line change
@@ -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

- 无未列的外部依赖。
12 changes: 3 additions & 9 deletions TaskFlowDocs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +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: inbox
- Priority: normal
- Owner: Claude
- Source: user request 2026-10-24
- Added: 2026-10-24
- Updated: 2026-10-24
- 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: 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.
- 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

Expand Down
2 changes: 2 additions & 0 deletions hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ taskflow/hooks/
├── capability-records # read effective stage records and corrections
├── capability-contribution # check contribution and artifact before approval
├── 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
Expand All @@ -66,6 +67,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
Expand Down
Loading
Loading