agent-project-sdlc 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +11 -9
  2. package/assets/agents/AGENTS_CORE.md +2 -2
  3. package/assets/docs/README.md +12 -10
  4. package/assets/skills/pjsdlc_architect_design/SKILL.md +4 -2
  5. package/assets/skills/pjsdlc_dev_sprint/SKILL.md +11 -8
  6. package/assets/skills/pjsdlc_implementation_doc/SKILL.md +7 -3
  7. package/assets/skills/pjsdlc_manager/SKILL.md +4 -4
  8. package/assets/skills/pjsdlc_pm_prd/SKILL.md +3 -3
  9. package/assets/skills/pjsdlc_release_manager/SKILL.md +2 -0
  10. package/assets/skills/pjsdlc_reviewer/SKILL.md +5 -2
  11. package/assets/skills/pjsdlc_rfc_recalibrate/SKILL.md +5 -2
  12. package/assets/skills/pjsdlc_tester/SKILL.md +5 -4
  13. package/assets/templates/IMPLEMENTATION_DOC_TEMPLATE.md +21 -7
  14. package/assets/templates/PLAN_TEMPLATE.yaml +27 -6
  15. package/assets/templates/RFC_TEMPLATE.md +12 -1
  16. package/assets/templates/TECH_DESIGN_TEMPLATE.md +19 -2
  17. package/assets/tools/build_doc_overviews.py +152 -0
  18. package/assets/tools/harness_utils.py +858 -0
  19. package/assets/tools/impact_analyzer.py +51 -0
  20. package/assets/tools/run_current_gate.py +29 -0
  21. package/assets/tools/status.py +29 -0
  22. package/assets/tools/transition.py +68 -0
  23. package/assets/tools/validate_allowed_paths.py +44 -0
  24. package/assets/tools/validate_design.py +199 -0
  25. package/assets/tools/validate_dev_state.py +20 -0
  26. package/assets/tools/validate_harness.py +60 -0
  27. package/assets/tools/validate_plan.py +24 -0
  28. package/assets/tools/validate_plan_draft.py +19 -0
  29. package/assets/tools/validate_prd.py +27 -0
  30. package/assets/tools/validate_prompt_language.py +138 -0
  31. package/assets/tools/validate_release_plan.py +37 -0
  32. package/assets/tools/validate_review.py +59 -0
  33. package/assets/tools/validate_rfc.py +105 -0
  34. package/assets/tools/validate_task_docs.py +40 -0
  35. package/assets/tools/validate_test_plan.py +82 -0
  36. package/dist/lib/config.js +1 -0
  37. package/dist/lib/migrations.js +3 -0
  38. package/dist/lib/sync-engine.js +4 -0
  39. package/dist/lib/validators.js +351 -17
  40. package/package.json +1 -1
  41. package/source-mappings.yaml +6 -0
package/README.md CHANGED
@@ -26,10 +26,11 @@ npx sdlc-harness init --adopt
26
26
  | Upgrade | `npx sdlc-harness upgrade` | Runs migrations and sync for already-adopted projects, including legacy seed guidance migration. |
27
27
  | Diagnostics | `npx sdlc-harness doctor` | Reports Harness root, package version, schema version and key managed paths. |
28
28
  | Validators | `npx sdlc-harness validate-*`, `make validate-current`, `make validate-harness` | Checks product, design slicing, development, review, test, release, RFC, active plan shape, prompt language contract and generated overview freshness. |
29
+ | Harness Python tools | `tools/*.py` | Package-managed local workflow tools, including `transition.py`, Python validators and overview generation helpers. |
29
30
  | Lifecycle workflow | `<harnessRoot>/state/lifecycle.yaml`, `<harnessRoot>/state/plan.yaml`, `.docs/**` | Tracks REQUIREMENT_GATHERING, ARCHITECTING, SPRINTING, REVIEWING, TESTING, RELEASING and RFC_RECALIBRATION facts. |
30
31
  | Stage task control | `plan.yaml`, `make validate-plan`, `npx sdlc-harness validate-plan` | Keeps each stage's agent work in small `TASK-*` tasks with `phase` metadata and scoped paths/gates. |
31
32
  | Natural-language control | `AGENTS.md` plus workflow skills | Lets users say things like "continue", "start development", "run tests" or "requirements changed"; agents map these to workflow actions. |
32
- | Optional parallel execution contract | `plan.yaml#parallel_execution` | Enabled only when users explicitly request multi-agent, parallel or multi-worktree execution; supports runtime-managed subagents or user-orchestrated worker prompts. |
33
+ | Default parallel scheduling contract | `plan.yaml#parallel_execution` | Stage tasks default to a safe-parallelism check; suitable work uses Codex native subagents first, with user-orchestrated and worktree fallbacks. |
33
34
  | Workflow skills | `<harnessRoot>/skills/pjsdlc_*/SKILL.md` | Provides role prompts for product, architecture, development, implementation docs, review, testing, release and RFC recalibration. |
34
35
  | Project-local skill overrides | `<harnessRoot>/pjsdlc_managed/override_skills/<skill_name>.md` + `npx sdlc-harness sync` | Appends project-specific role instructions to generated Skill output without editing managed Skill files. |
35
36
  | Local policy overrides | `<harnessRoot>/pjsdlc_managed/policies/*.local.yaml` | Preserves project-specific policy additions separately from package defaults. |
@@ -61,16 +62,17 @@ npx sdlc-harness sync
61
62
 
62
63
  The sync output is the package base Skill plus one appended `Local Override` block. Override files support either a plain project-local snippet or a complete `SKILL.md` with `name` and `description` frontmatter. Complete Skill overrides are appended, not replaced: `sync` validates the override `name`, merges the override `description` into the generated top-level metadata, strips the override frontmatter, and appends the full body. After sync, users or their agents should review the merged Skill for semantic conflicts in phase boundaries, `allowed_paths`, `required_gates`, commit/release rules and completion checks. Unknown skill names block sync so misspellings do not silently fail.
63
64
 
64
- ## Optional Parallel Execution
65
+ ## Default Parallel Scheduling
65
66
 
66
- The default workflow is serial. Agents should only create `parallel_execution` in `plan.yaml` when the user explicitly asks for multi-agent, parallel or multi-worktree execution.
67
+ The default workflow evaluates each stage task for safe parallelism. When the task can be split safely, the main agent creates `parallel_execution.trigger: "workflow_default"` in `plan.yaml` and uses Codex native subagents first. If the task is not safe to split, the main agent keeps the workflow serial and records the reason. Explicit user requests for multi-agent, parallel or multi-worktree execution use `trigger: "user_requested"`.
67
68
 
68
- - `runtime_managed`: use only when the current agent runtime can spawn subagents. The main agent assigns workers, waits for results, reviews, merges or cherry-picks, and runs the total gate.
69
+ - `runtime_managed` with `runtime.provider: "codex_native_subagents"`: the default path. The main agent assigns workers, waits for results, reviews, merges or cherry-picks, and runs the total gate.
69
70
  - `user_orchestrated`: use when the runtime cannot spawn subagents. The main agent generates copyable worker prompts, and the user manually opens Codex conversations or worktrees and pastes them.
71
+ - `codex_exec_worktree`: fallback for high-risk writes or user-requested hard isolation. The first version does not add a `sdlc-harness parallel run` CLI.
70
72
 
71
73
  `parallel_execution` does not store duplicate current phase or current task fields. Agents read phase from `<harnessRoot>/state/lifecycle.yaml#current_phase` and task selection from `<harnessRoot>/state/plan.yaml#current_task_id`.
72
74
 
73
- The CLI does not promise to automatically launch Codex agents. Workers do not need to communicate with each other; the main agent owns final fact-source updates such as PRD, plan, implementation docs, test results and generated overviews.
75
+ SPRINTING write workers must use disjoint `owned_paths`, and each owned path must be within the current task `allowed_paths`. Workers do not own final PRD, plan, implementation docs, review/test/release reports, generated overviews or release actions; the main agent remains the integration owner.
74
76
 
75
77
  ## Stage Task Control
76
78
 
@@ -80,13 +82,13 @@ Release docs are current-state facts, not a version ledger. New release work sho
80
82
 
81
83
  The generic rule is that any workflow promoting a draft task into a formal `TASK-*` in `plan.yaml` must remove the source draft from its draft queue in the same state update. The formal task is then recovered only from `plan.yaml`; completed history lives in implementation docs, git, PR and CI records. The built-in Harness draft queue is currently `plan.draft.yaml.tasks[]`, which means unadopted development drafts only. `/devloop` treats the development queue as exhausted only when both `plan.yaml.tasks[]` and `plan.draft.yaml.tasks[]` have no executable task.
82
84
 
83
- Before development starts, `ARCHITECTING` can return to `REQUIREMENT_GATHERING` for PRD edits. The manager uses `python3 tools/transition.py --to REQUIREMENT_GATHERING`, the PM workflow updates the PRD through one `TASK-*`, then `validate-pm` and `python3 tools/transition.py --to ARCHITECTING` return the project to design. Requirement changes after `SPRINTING` still use RFC recalibration.
85
+ Before development starts, `ARCHITECTING` can return to `REQUIREMENT_GATHERING` for PRD edits. The manager uses `python3 tools/transition.py --to REQUIREMENT_GATHERING`, the PM workflow updates the PRD through one `TASK-*`, then `validate-pm` and `python3 tools/transition.py --to ARCHITECTING` return the project to design. Requirement or design changes after `SPRINTING` use RFC recalibration; `SPRINTING`, `REVIEWING`, `TESTING` and `RELEASING` can enter the controlled interrupt with `python3 tools/transition.py --to RFC_RECALIBRATION`, then return to `SPRINTING` after `validate-rfc`.
84
86
 
85
- `validate-design` treats semantic slicing as a hard gate. Generated `overview.md` files do not count as deliverables, development draft tasks in `plan.draft.yaml` must reference existing tech plan slices through `docs.tech_plan`, multiple development draft tasks need distinct primary tech plan slices, and explicit AI provider/copilot, external-system, or compliance/permission/audit themes require dedicated architecture slices.
87
+ `validate-design` treats semantic slicing as a hard gate. Generated `overview.md` files do not count as deliverables, development draft tasks in `plan.draft.yaml` must reference existing tech plan slices through `docs.tech_plan`, multiple development draft tasks need distinct primary tech plan slices, and explicit AI provider/copilot, external-system, or compliance/permission/audit themes require dedicated architecture slices. Draft tasks with runnable boundaries must also include `self_test_contract`, backed by a `Development Self-Test Contract` section in the tech plan; the contract must include `module_key_test_path` from local start or invocation to all self-test scenarios completion, covering every runnable entry promised by the current task/module and its internal key paths.
86
88
 
87
- SPRINTING Definition of Done includes runnable entry/exit boundaries. API, CLI, server route, service, agent, runtime, adapter, worker, provider, config-contract and fixture/live boundaries promised by a technical plan or task must be implemented or marked `BLOCKED` during development. Runtime/app/provider/live tasks must declare `evidence_level.required` and `target_runtime_environment` in `plan.yaml`; `deployed_runtime` cannot be closed by `unit`, `local_runtime`, `external_provider_live`, provider smoke, fake adapters or localhost smoke alone, and `business_handoff_ready` requires a Testing Handoff Contract. The current task implementation doc must also include `Development Evidence` with `Evidence Level`, `Target Runtime Environment`, `Runnable Entry`, `Observable Exit`, `Client / Server Initialization`, `Config Contract`, `Testing Handoff Readiness`, `Known Missing Runtime Boundaries`, `Basic Self-test Evidence`, or a justified `Not applicable`. Provider smoke, fixture smoke, fake adapters and one-shot smoke prove only local links; they do not by themselves prove application readiness. REVIEWING treats missing entry/exit, initialization, config contract, target runtime, evidence level or development evidence as blocking, and TESTING only exercises entrypoints that Review has confirmed as `PASS`; it must not add product runtime, bootstrap, provider adapter, deploy code or package runtime scripts.
89
+ SPRINTING Definition of Done includes module-level runnable delivery boundaries. API, CLI, server route, service, agent, runtime, adapter, worker, provider, config-contract and fixture/live boundaries promised by a technical plan or task must be implemented or marked `BLOCKED` during development. Runtime/app/provider/live tasks must declare `evidence_level.required`, `target_runtime_environment` and `self_test_contract` in `plan.yaml`; every gate in `self_test_contract.required_gates` must also appear in task `required_gates`, and `self_test_contract.module_key_test_path` must describe the path from local start or invocation to all self-test scenarios completion, covering every runnable entry promised by the current task/module and its internal key paths. `deployed_runtime` cannot be closed by `unit`, `local_runtime`, `external_provider_live`, provider smoke, fake adapters or localhost smoke alone, and `business_handoff_ready` requires a Testing Handoff Contract. The current task implementation doc must include `Development Evidence` and a completed `Development Self-Test Report` with contract source, scenario results, executed gates, Module Key Test Path, actual evidence, missing/blockers and Testing Handoff Readiness; Module Key Test Path records actual entries, internal key paths, boundaries, checkpoints and observable completion evidence. Provider smoke, fixture smoke, fake adapters and one-shot smoke prove only local links; they do not by themselves prove application readiness. REVIEWING treats missing entry/exit, initialization, config contract, target runtime, evidence level or development evidence as blocking, and TESTING only exercises entrypoints that Review has confirmed as `PASS`; it must not add product runtime, bootstrap, provider adapter, deploy code or package runtime scripts.
88
90
 
89
- `make validate-dev` and `npx sdlc-harness validate-dev` are in-development SPRINTING gates. They allow the current `current_task_id` open task to remain in `plan.yaml` while checking that it is a valid `phase: "SPRINTING"` task with `docs`, `allowed_paths`, `required_gates`, `acceptance_criteria`, `implementation_doc`, scoped dirty files, an empty `plan.draft.yaml` queue, runtime evidence task contract, linked runnable-entry implementation docs and structured development evidence. Page tasks need a dev server or page URL plus browser/Playwright/screenshot/equivalent interaction evidence; API/CLI/worker/service/agent/runtime tasks need a startup or invocation command, endpoint/health/status, and observable response/output/side effect. `make validate-current` and `/advance` are phase-exit gates; before moving to REVIEWING, the implementation commit and completion ledger must be done and no open task may remain.
91
+ `make validate-dev` and `npx sdlc-harness validate-dev` are in-development SPRINTING gates. They allow the current `current_task_id` open task to remain in `plan.yaml` while checking that it is a valid `phase: "SPRINTING"` task with `docs`, `allowed_paths`, `required_gates`, `acceptance_criteria`, `implementation_doc`, scoped dirty files, an empty `plan.draft.yaml` queue, runtime evidence task contract, `self_test_contract`, linked runnable-entry implementation docs, structured development evidence and a completed Development Self-Test Report. The report must include Module Key Test Path so later agents can reuse the debug path from local entry to all self-test scenarios completion; that path is scoped to entries and internal key paths promised by the current task/module, not the whole system. Page tasks need a dev server or page URL plus browser/Playwright/screenshot/equivalent interaction evidence; API/CLI/worker/service/agent/runtime tasks need a startup or invocation command, endpoint/health/status, and observable response/output/side effect. `make validate-current` and `/advance` are phase-exit gates; before moving to REVIEWING, the implementation commit and completion ledger must be done and no open task may remain.
90
92
 
91
93
  `validate-test` keeps its command name as the TESTING phase gate. `.docs/07_test/TEST_STRATEGY.md` describes scope, environment, priority and execution strategy; `.docs/07_test/TEST_CASES.md` describes cases bound to real runnable entry/exit; `.docs/07_test/TEST_REPORT.md` only records executed TESTING evidence, test matrix, regression evidence, runnable entry/exit coverage, coverage gaps and final decision. `validate-test` only accepts `TEST_REPORT.md`; it no longer treats `TEST_PLAN.md` as a report fallback.
92
94
 
@@ -168,12 +168,12 @@ Strong success criteria 可以让你 independent loop。Weak criteria,例如
168
168
  - “开始开发 / 做当前任务 / 做下一个任务” → 等价 `/dev`。
169
169
  - “开始循环:写任务,执行任务 / 把开发循环跑完” → 等价 `/devloop`。
170
170
  - “跑测试 / 验证一下” → 运行当前 task 或阶段对应 gate。
171
- - “并行 / 多 agent / 多 worktree / parallel” → 只有用户显式提出时,才创建或使用 `parallel_execution` 合同;默认 workflow 不启用并行。
171
+ - 每个阶段任务开始时,默认先做 parallel eligibility check;适合安全拆分时,主 Agent 创建或使用 `parallel_execution.trigger: "workflow_default"` 并调度 Codex native subagents。用户说“并行 / 多 agent / 多 worktree / parallel” → 使用 `trigger: "user_requested"` 强化该意图。
172
172
  - “准备 review / 帮我 review” → 进入只读 Review workflow。
173
173
  - “刷新文档总览 / 同步 overview” → 等价 `/overview`。
174
174
  - `/plan` 和 `/goal` 是客户端模式入口,不由 Harness 自动开启;用户可以手动组合,例如 `/plan /prd`、`/plan 完善产品方案`、`/goal /devloop` 或 `/goal 开始循环:写任务,执行任务`。
175
175
 
176
- Parallel Execution 是可选协作协议,不是默认模式,也不是 CLI 自动启动 Agent 的承诺。只有用户明确要求多 agent、并行或多 worktree,且当前阶段适合拆分时,Agent 才能在 `plan.yaml` 增加 `parallel_execution`。`parallel_execution` 不保存 `phase` 或 `linked_task_id`;当前阶段读取 `lifecycle.yaml#current_phase`,当前任务读取 `plan.yaml#current_task_id`。如果当前 runtime 支持 subagent,由主 Agent 使用 `runtime_managed` 模式编排;否则使用 `user_orchestrated` 模式,主 Agent 生成每个 worker 的可复制 prompt,用户手动打开对话或 worktree 后粘贴执行。worker 之间不要求通信,最终事实源更新、review、merge/cherry-pick 和总 gate 由主 Agent 负责。
176
+ Parallel Execution 是默认评估、按需启用的协作协议。`parallel_execution` 只在实际并行时写入 `plan.yaml`,不保存 `phase` 或 `linked_task_id`;当前阶段读取 `lifecycle.yaml#current_phase`,当前任务读取 `plan.yaml#current_task_id`。默认模式是 `runtime_managed` + `runtime.provider: "codex_native_subagents"`,由主 Agent 明确调度 Codex native subagents;如果 runtime 不可用则降级为 `user_orchestrated`,需要强隔离时可使用 `codex_exec_worktree` fallback。worker 之间不要求通信,最终事实源更新、review、merge/cherry-pick、总 gate、SPRINTING 两段提交和发布动作都由主 Agent 负责。
177
177
 
178
178
  如果自然语言意图会改变阶段、创建或删除 task、提交、push 或发布,Agent 先用一句话说明将执行的动作和验证方式,再继续。
179
179
 
@@ -64,10 +64,11 @@ npx sdlc-harness init --adopt
64
64
  | 生命周期工作流 | `lifecycle.yaml`、`plan.yaml`、`.docs/**` | 固定 REQUIREMENT_GATHERING、ARCHITECTING、SPRINTING、REVIEWING、TESTING、RELEASING、RFC_RECALIBRATION 等阶段事实链 |
65
65
  | 阶段小任务管控 | `plan.yaml`、`make validate-plan` | 每个阶段的 Agent 主任务都应拆成足够小的 `TASK-*` open task,并用 `phase` 标明所属阶段 |
66
66
  | 自然语言控制 | `AGENTS.md` + workflow skills | 用户可说“继续”“开始开发”“跑测试”“需求变了”等,由 Agent 映射到 `/next`、`/dev`、`/test`、RFC 等动作 |
67
- | 可选并行执行合同 | `plan.yaml#parallel_execution` | 用户明确要求多 agent/并行/多 worktree 时启用;支持 runtime-managed subagents user-orchestrated worker prompts |
67
+ | 默认并行调度合同 | `plan.yaml#parallel_execution` | 阶段任务默认评估是否可安全并行;适合时优先使用 Codex native subagents,并保留 user-orchestrated / worktree fallback |
68
68
  | Workflow skills | `<harnessRoot>/skills/pjsdlc_*/SKILL.md` | 提供 PM、架构、开发、实现文档、Review、测试、发布、RFC 等阶段角色提示词 |
69
69
  | 阶段角色提示词本地追加 | `<harnessRoot>/pjsdlc_managed/override_skills/<skill_name>.md` + `sync` | 用户不改 managed Skill,通过本地 override 追加项目规则,下一次 sync/upgrade 会重新合成 |
70
70
  | 本地策略覆盖 | `<harnessRoot>/pjsdlc_managed/policies/*.local.yaml` | 保留项目自己的策略补充,不和包内默认策略混写 |
71
+ | Harness Python tools | `tools/*.py` | package-managed 本地 workflow tools,包括 `transition.py`、validators 和 overview 生成器;`init/sync/upgrade` 会生成或更新这些脚本 |
71
72
  | Agent 可读用户指南 | `node_modules/agent-project-sdlc/assets/docs/README.md` | npm 包内附带本仓库根 README,方便用户 Agent 在安装包中读取完整工作流说明 |
72
73
  | 文档 overview | `make docs-overview`、`make validate-doc-overviews` | 从 `.docs/**` facts 生成各阶段 overview,避免手写派生视图 |
73
74
  | 包源码一致性检查 | `sdlc-harness package sync-source`、`sdlc-harness package check-source` | 供本仓库维护者同步和检查 package canonical assets,避免源码与发布内容漂移 |
@@ -101,13 +102,13 @@ Agent 会读取 `<harnessRoot>/state/lifecycle.yaml` 和 `<harnessRoot>/state/pl
101
102
 
102
103
  技术方案阶段需要产出 `plan.draft.yaml`,是为了解决跨阶段交接和当前执行队列纯净性的冲突。`ARCHITECTING` 必须在进入开发前证明方案可以拆成具体、可验证的开发单元,包括修改范围、gate、implementation doc 和执行顺序;但这些未来开发 task 如果直接进入 `plan.yaml`,会和当前架构阶段 task 混在一起,让阶段 gate 无法区分“架构任务未完成”和“下一阶段任务已预拆”。因此开发任务先作为 draft 暂存,进入 `SPRINTING` 后再逐个 promote 成正式 `TASK-*`。其它阶段默认根据上一阶段已经稳定的事实源即时创建当前阶段 task,只有当某个阶段也需要提前为后续阶段生成具体执行任务时,才应引入同类 draft queue。
103
104
 
104
- 在尚未进入开发前,`ARCHITECTING` 可以回到 `REQUIREMENT_GATHERING` 修改 PRD:Manager 使用 `python3 tools/transition.py --to REQUIREMENT_GATHERING` 切回 PM/PRD 工作流,完成 PRD task 和 `validate-pm` 后,再用 `python3 tools/transition.py --to ARCHITECTING` 回到设计阶段。进入 `SPRINTING` 后的需求变化仍走 RFC workflow。
105
+ 在尚未进入开发前,`ARCHITECTING` 可以回到 `REQUIREMENT_GATHERING` 修改 PRD:Manager 使用 `python3 tools/transition.py --to REQUIREMENT_GATHERING` 切回 PM/PRD 工作流,完成 PRD task 和 `validate-pm` 后,再用 `python3 tools/transition.py --to ARCHITECTING` 回到设计阶段。进入 `SPRINTING` 后的需求或设计变化走 RFC workflow;`SPRINTING`、`REVIEWING`、`TESTING` 和 `RELEASING` 都可以通过 `python3 tools/transition.py --to RFC_RECALIBRATION` 进入受控 RFC 中断,RFC 完成后回到 `SPRINTING` 重新完成开发自测和 handoff
105
106
 
106
- `validate-design` 会把架构阶段的语义切片作为硬 gate:`overview.md` 不计入 deliverables,`plan.draft.yaml` 中每个开发 draft task 必须通过 `docs.tech_plan` 指向存在的 tech plan slice;多个开发 draft task 默认需要不同 primary tech plan slice。PRD、tech plan 或 draft task 明确出现 AI provider / copilot、外部系统边界、合规 / 权限 / 审计等横切主题时,也需要对应的专门 architecture slice
107
+ `validate-design` 会把架构阶段的语义切片作为硬 gate:`overview.md` 不计入 deliverables,`plan.draft.yaml` 中每个开发 draft task 必须通过 `docs.tech_plan` 指向存在的 tech plan slice;多个开发 draft task 默认需要不同 primary tech plan slice。PRD、tech plan 或 draft task 明确出现 AI provider / copilot、外部系统边界、合规 / 权限 / 审计等横切主题时,也需要对应的专门 architecture slice。可运行边界类 draft task 还必须带 `self_test_contract`,并在 tech plan 中有 `Development Self-Test Contract`;合同必须记录 `module_key_test_path`,说明从本地启动或调用入口开始,到完成全部自测 scenario 的模块关键测试路径,并覆盖本 task / 本模块承诺的所有可运行入口和内部关键路径。
107
108
 
108
- SPRINTING 的 Definition of Done 包含可运行入口/出口:技术方案或 task 承诺的 API、CLI、server route、service、agent、runtime、adapter、worker、provider、配置契约和 fixture/live 边界必须在开发阶段实现或明确 `BLOCKED`。runtime/app/provider/live 类 task 必须在 `plan.yaml` 声明 `evidence_level.required` 和 `target_runtime_environment`;`deployed_runtime` 不能用 `unit`、`local_runtime`、`external_provider_live`、provider smoke、fake adapter 或 localhost smoke 单独关闭,`business_handoff_ready` 还必须有 Testing Handoff Contract。当前 task 的 implementation doc 还必须写入 `Development Evidence`,包含 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries`、`Basic Self-test Evidence`,或带原因的 `Not applicable`。provider smoke、fixture smoke、fake adapter 或 one-shot smoke 只能证明局部链路,不能单独证明 application readiness。REVIEWING 会把缺少入口/出口、初始化、配置契约、目标运行环境、证据等级或开发自测证据作为阻断项;TESTING 只调用 Review 已确认 `PASS` 的既有入口做输入输出验证,不能新增 product runtime、bootstrap、provider adapter、deploy 或 package runtime script。
109
+ SPRINTING 的 Definition of Done 包含模块级可运行交付边界:技术方案或 task 承诺的 API、CLI、server route、service、agent、runtime、adapter、worker、provider、配置契约和 fixture/live 边界必须在开发阶段实现或明确 `BLOCKED`。runtime/app/provider/live 类 task 必须在 `plan.yaml` 声明 `evidence_level.required`、`target_runtime_environment` 和 `self_test_contract`;`self_test_contract.required_gates` 必须同步出现在 task `required_gates`,`self_test_contract.module_key_test_path` 必须描述从本地启动或调用入口开始,到完成全部自测 scenario 的模块关键测试路径,并覆盖本 task / 本模块承诺的所有可运行入口和内部关键路径。`deployed_runtime` 不能用 `unit`、`local_runtime`、`external_provider_live`、provider smoke、fake adapter 或 localhost smoke 单独关闭,`business_handoff_ready` 还必须有 Testing Handoff Contract。当前 task 的 implementation doc 还必须写入 `Development Evidence` `Development Self-Test Report`,其中自测报告记录 contract source、scenario results、executed gates、Module Key Test Path、actual evidence、missing/blockers Testing Handoff Readiness;`Module Key Test Path` 必须记录实际入口、内部关键路径、关键边界、观察点和可观测完成证据。provider smoke、fixture smoke、fake adapter 或 one-shot smoke 只能证明局部链路,不能单独证明 application readiness。REVIEWING 会把缺少入口/出口、初始化、配置契约、目标运行环境、证据等级或开发自测证据作为阻断项;TESTING 只调用 Review 已确认 `PASS` 的既有入口做输入输出验证,不能新增 product runtime、bootstrap、provider adapter、deploy 或 package runtime script。
109
110
 
110
- `make validate-dev` / `npx sdlc-harness validate-dev` 是 SPRINTING 开发中 gate:当前 `current_task_id` 指向的 open task 可以继续留在 `plan.yaml`,validator 会检查它是否是合法 `phase: "SPRINTING"` task、是否具备 `docs`、`allowed_paths`、`required_gates`、`acceptance_criteria`、`implementation_doc`,并校验 dirty files、`plan.draft.yaml`、runtime evidence task contractimplementation doc 和结构化 `Development Evidence`。页面类证据需要 dev server/page URL 与 browser check;API/CLI/worker/service/agent/runtime 类证据需要 startup/invocation command、endpoint/health/status 与 response/output/side effect。`make validate-current` / `/advance` 是阶段出口 gate;进入 REVIEWING 前仍必须先完成 implementation commit 和 completion ledger,把 open task 从 `plan.yaml` 移除。
111
+ `make validate-dev` / `npx sdlc-harness validate-dev` 是 SPRINTING 开发中 gate:当前 `current_task_id` 指向的 open task 可以继续留在 `plan.yaml`,validator 会检查它是否是合法 `phase: "SPRINTING"` task、是否具备 `docs`、`allowed_paths`、`required_gates`、`acceptance_criteria`、`implementation_doc`,并校验 dirty files、`plan.draft.yaml`、runtime evidence task contract、`self_test_contract`、implementation doc、结构化 `Development Evidence` 和 `Development Self-Test Report`。自测报告必须记录 `Module Key Test Path`,便于后续 Agent 复用从本地入口到全部自测用例完成的 debug 路径;该路径只要求覆盖本 task / 本模块承诺范围内的可运行入口和内部关键路径,不要求覆盖全系统所有模块。页面类证据需要 dev server/page URL 与 browser check;API/CLI/worker/service/agent/runtime 类证据需要 startup/invocation command、endpoint/health/status 与 response/output/side effect。`make validate-current` / `/advance` 是阶段出口 gate;进入 REVIEWING 前仍必须先完成 implementation commit 和 completion ledger,把 open task 从 `plan.yaml` 移除。
111
112
 
112
113
  `validate-test` 仍然是 TESTING 阶段 gate 名称。`.docs/07_test/TEST_STRATEGY.md` 描述测试范围、环境、优先级和执行策略;`.docs/07_test/TEST_CASES.md` 描述绑定真实 runnable entry/exit 的测试用例;`.docs/07_test/TEST_REPORT.md` 只记录 TESTING 阶段实际执行后的 test matrix、regression evidence、runnable entry/exit coverage、coverage gaps 和 final decision。`validate-test` 只接受 `TEST_REPORT.md`,不会把 `TEST_PLAN.md` 当作 report fallback。
113
114
 
@@ -156,16 +157,17 @@ override 文件支持两种写法:普通项目追加片段,或带 `name`/`de
156
157
 
157
158
  `sync` 会把通用 Skill 和本地 override 合成到最终 `SKILL.md`。v1 只支持追加覆盖,不替换 package base Skill;`<skill_name>` 必须匹配已有 workflow Skill,例如 `pjsdlc_pm_prd`、`pjsdlc_architect_design` 或 `pjsdlc_dev_sprint`。合并后应由用户或用户的 Agent 检查 base Skill 与 local override 是否存在语义冲突,尤其是阶段边界、`allowed_paths`、`required_gates`、提交/发布规则和完成检查。
158
159
 
159
- ### 可选并行执行
160
+ ### 默认并行调度
160
161
 
161
- 默认 workflow 是串行的。只有用户明确说“并行”“多 agent”或“多 worktree”时,Agent 才能在 `plan.yaml` 创建 `parallel_execution` 合同。
162
+ 默认 workflow 会先评估当前阶段 task 是否适合安全并行。适合拆分时,主 Agent `plan.yaml` 创建 `parallel_execution.trigger: "workflow_default"` 合同,并优先使用 Codex native subagents;不适合拆分时继续串行并记录原因。用户明确说“并行”“多 agent”或“多 worktree”时,使用 `trigger: "user_requested"` 强化该意图。
162
163
 
163
- - `runtime_managed`:当前 Agent runtime 支持创建 subagent 时,由主 Agent 分配 worker、等待结果、review、merge/cherry-pick 并跑总 gate。
164
- - `user_orchestrated`:runtime 不能自动创建 subagent 时,主 Agent 生成每个 worker 的可复制 prompt;用户手动打开多个对话或 worktree 后粘贴执行。
164
+ - `runtime_managed` + `runtime.provider: "codex_native_subagents"`:默认路径。主 Agent 分配 worker、等待结果、review、merge/cherry-pick 并跑总 gate。
165
+ - `user_orchestrated`:runtime 不能创建 subagent 时,主 Agent 生成每个 worker 的可复制 prompt;用户手动打开多个对话或 worktree 后粘贴执行。
166
+ - `codex_exec_worktree`:高风险写入或用户要求强隔离时的 fallback;第一版不新增 `sdlc-harness parallel run` CLI。
165
167
 
166
168
  `parallel_execution` 不保存当前阶段或当前任务副本;阶段只从 `lifecycle.yaml#current_phase` 读取,当前任务只从 `plan.yaml#current_task_id` 读取。
167
169
 
168
- Harness CLI v1 不承诺自动启动 Codex agent,也不要求 worker 之间通信。worker 只处理自己的 `owned_paths` gate,最终 PRD、plan、implementation doc、test result、overview 等事实源由主 Agent 集成。
170
+ SPRINTING 写入 worker 必须使用互不重叠的 `owned_paths`,且这些路径必须落在当前 task `allowed_paths` 内。worker 不直接拥有最终 PRD、plan、implementation doc、review/test/release report、overview 或发布动作;这些事实源和收尾动作仍由主 Agent 集成。
169
171
 
170
172
  常用快捷入口:
171
173
 
@@ -23,6 +23,8 @@ ADR 用来解决“后来的人只看到结果,看不到当年取舍”的问
23
23
 
24
24
  如果在 `ARCHITECTING` 中发现 PRD 缺失、验收标准不清或产品边界需要调整,且项目尚未进入 `SPRINTING`,不要用架构文档替代产品事实。先收尾或移除当前 open design task,再请 Manager 使用 `python3 tools/transition.py --to REQUIREMENT_GATHERING` 回到 PM/PRD 工作流修改 `.docs/01_product/**`。进入 `SPRINTING` 后的需求变化走 RFC workflow。
25
25
 
26
+ 架构阶段默认先评估是否适合并行调研或方案拆解。适合时,主 Agent 使用 `parallel_execution.trigger: "workflow_default"` 和 `runtime.provider: "codex_native_subagents"` 调度 worker 分别做架构草稿、接口分析、风险清单或方案对比;用户明确要求并行时使用 `trigger: "user_requested"`。worker 不直接写最终 architecture、tech plan、ADR 或 `plan.draft.yaml`,最终事实源和任务草案由主 Agent 合成;不适合拆分时保持串行并记录原因。
27
+
26
28
  ## 输入
27
29
 
28
30
  - `.docs/INDEX.md`
@@ -54,7 +56,7 @@ ADR 用来解决“后来的人只看到结果,看不到当年取舍”的问
54
56
  - 如果 PRD、tech plan 或 draft task 明确出现 AI provider / AI copilot、外部系统边界、合规 / 权限 / 审计等横切主题,应各自有专门的 architecture slice;不要把多个横切架构问题都塞进一个总览文档。
55
57
  - 如果实现计划改变了已有模块边界,应更新相关 architecture slice,而不是只在 task 描述里补一句。
56
58
  - 只要技术方案或 draft task 出现 service、agent、runtime、worker、frontend app、provider/live integration 或外部可运行边界,task breakdown 必须包含最后一公里 runtime 初始化和 testing handoff 交付:目标运行环境、启动/部署或预览方式、health/readiness、smoke 输入输出、日志/错误证据、测试可调用入口和出口。
57
- - 这类开发 draft task 必须写入 `evidence_level.required` 和 `target_runtime_environment`。`evidence_level.required` 只能使用 `unit`、`local_runtime`、`external_provider_live`、`deployed_runtime`、`business_handoff_ready`;`target_runtime_environment.kind` 只能使用 `local`、`ci`、`staging`、`cloud_vm`、`managed_service`、`browser`、`worker`、`not_applicable`。
59
+ - 这类开发 draft task 必须写入 `evidence_level.required`、`target_runtime_environment` 和 `self_test_contract`。`evidence_level.required` 只能使用 `unit`、`local_runtime`、`external_provider_live`、`deployed_runtime`、`business_handoff_ready`;`target_runtime_environment.kind` 只能使用 `local`、`ci`、`staging`、`cloud_vm`、`managed_service`、`browser`、`worker`、`not_applicable`。`self_test_contract` 的 `source` 必须引用当前 tech plan slice,`required_gates` 必须同步到 task `required_gates`,`scenarios[]` 至少覆盖一个可运行入口和可观测出口,`module_key_test_path` 必须描述从本地启动或调用入口开始,到完成所有自测 scenario 的模块关键测试路径,并覆盖本 task / 本模块承诺的所有可运行入口和内部关键路径。
58
60
  - 如果用户明确要求把既有完整技术方案文件切成多个 `.docs/03_tech_plan/` slices,先确认 replacement slices 覆盖原文件中仍有效的接口契约、数据模型、模块方案、任务组和 gate;切片完成并更新 `plan.draft.yaml` 引用、`.docs/INDEX.md`、刷新 `overview.md` 后,删除被替代的完整 tech plan file,避免同一事实由完整文件和 slices 双重保留。
59
61
  - 每次新增、拆分、合并或废弃 slice 后,都要更新 `.docs/INDEX.md`。
60
62
 
@@ -90,7 +92,7 @@ ADR 用来解决“后来的人只看到结果,看不到当年取舍”的问
90
92
  - [ ] 已判断 architecture / tech plan / ADR 的语义切片边界。
91
93
  - [ ] `plan.draft.yaml` 中每个开发 draft task 已通过 `docs.tech_plan` 绑定到对应 tech plan slice。
92
94
  - [ ] 如果用户要求把完整技术方案切成 tech plan slices,已删除被替代的完整 tech plan file,并同步 `plan.draft.yaml` 引用。
93
- - [ ] task draft 字段完整且范围清晰;runtime/app/provider/live 类 task 已声明 `evidence_level` 和 `target_runtime_environment`。
95
+ - [ ] task draft 字段完整且范围清晰;runtime/app/provider/live 类 task 已声明 `evidence_level`、`target_runtime_environment` 和 `self_test_contract`。
94
96
  - [ ] `.docs/INDEX.md` 已链接新增产物。
95
97
  - [ ] 已运行 `make docs-overview` 刷新 `.docs/<stage>/overview.md`。
96
98
  - [ ] `make validate-design` 准备通过。
@@ -15,7 +15,9 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
15
15
 
16
16
  开始编码前,先确认当前 open task 是否完整,修改范围是否覆盖必要文件,验收标准是否能被测试或 gate 验证。如果发现任务边界、产品行为或技术方案不清晰,要停下来说明 blocker、给出可能解释和推荐下一步,而不是扩大范围继续写。
17
17
 
18
- 开发阶段的 Definition of Done 包含可运行的系统入口/出口。凡技术方案或 task 承诺 API、CLI、server route、service、agent、runtime、adapter、worker、provider、外部发送/写入执行器、配置契约或 live/fixture 双模式边界,当前实现必须提供对应入口、调用方式、初始化方式、输出/副作用边界和验证方式;如果真实入口/出口尚不可运行,不能把 task 当作完成,也不能把缺口留给 TESTING 补 runtime。runtime/app/provider/live 类 task 必须在 `plan.yaml` 声明 `evidence_level.required` 和 `target_runtime_environment`,并按合同交付:`deployed_runtime` 不能用 `unit`、`local_runtime`、`external_provider_live`、provider smoke、fake adapter 或 localhost smoke 单独关闭;`business_handoff_ready` 必须提供 Testing Handoff Contract。Implementation doc 必须写明 `Runnable Entry/Exit`,并在 `Development Evidence` 中记录 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`;确实不适用时也要显式写 `Not applicable` 和具体原因。provider smoke、fixture smoke、fake adapter 或 one-shot smoke 只能证明局部链路,不能单独证明 `Application readiness`。此时应保留或创建 `BLOCKED`/后续 dev task,或通过 RFC/ARCHITECTING 处理边界变更。
18
+ 开发阶段的 Definition of Done 包含可运行的系统入口/出口。凡技术方案或 task 承诺 API、CLI、server route、service、agent、runtime、adapter、worker、provider、外部发送/写入执行器、配置契约或 live/fixture 双模式边界,当前实现必须提供对应入口、调用方式、初始化方式、输出/副作用边界和验证方式;如果真实入口/出口尚不可运行,不能把 task 当作完成,也不能把缺口留给 TESTING 补 runtime。runtime/app/provider/live 类 task 必须在 `plan.yaml` 声明 `evidence_level.required`、`target_runtime_environment` 和 `self_test_contract`,并按合同交付:`deployed_runtime` 不能用 `unit`、`local_runtime`、`external_provider_live`、provider smoke、fake adapter 或 localhost smoke 单独关闭;`business_handoff_ready` 必须提供 Testing Handoff Contract。Implementation doc 必须写明 `Runnable Entry/Exit`,并在 `Development Evidence` 中记录 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`;其中 `Basic Self-test Evidence` 应指向已执行的 `Development Self-Test Report`。确实不适用时也要显式写 `Not applicable` 和具体原因。provider smoke、fixture smoke、fake adapter 或 one-shot smoke 只能证明局部链路,不能单独证明 `Application readiness`。此时应保留或创建 `BLOCKED`/后续 dev task,或通过 RFC/ARCHITECTING 处理边界变更。
19
+
20
+ `self_test_contract` 是开发阶段自测合同,由 ARCHITECTING 或 RFC_RECALIBRATION 先定义,SPRINTING 负责执行并在 implementation doc 填写 `Development Self-Test Report`。开发者不得在开发结束后用现有实现反推自测合同;如果合同缺失、入口不匹配、required gates 未同步或场景无法执行,要先回到 ARCHITECTING/RFC 或把 task 保持为 `BLOCKED`。自测报告不是 TESTING 阶段产物,它只证明当前模块级可运行交付边界已经能被 Review/Testing 消费。报告还必须记录 `Module Key Test Path`:从本地启动或调用入口开始,执行并完成 `self_test_contract` 中全部自测用例的模块关键测试路径。该路径应覆盖本 task / 本模块承诺的所有可运行入口,以及自测用例实际经过的内部关键路径、关键边界、观察点和可观测完成证据,供后续 Agent 复用和 debug。
19
21
 
20
22
  页面类任务在开发阶段必须启动 dev server 或等价预览入口,并用浏览器、Playwright、截图或等价方式验证页面可加载、主入口可访问、核心按钮/表单/跳转可用、没有明显报错或空白页。API/CLI/worker/RPA/service/agent/runtime 类任务必须记录实际启动或调用命令、endpoint、worker command、dry-run/live preflight、health/status 或 server action,以及可观察的 response、队列 item、审计日志、文件产物、发送结果、错误码或 PASS/BLOCKED 结果。
21
23
 
@@ -23,7 +25,7 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
23
25
 
24
26
  实现时遵循小步闭环:先检查 `git status`,确认工作区没有未归属到当前 task 的脏变更;再定位相关代码和测试,做必要修改,运行 gate,修复失败,写入或更新相关 implementation doc 并刷新文档派生视图。直接运行 `make validate-dev` 或 `npx sdlc-harness validate-dev` 是开发中 gate,允许当前 `SPRINTING` task 仍然 open,并校验 `current_task_id`、task 合同、dirty files、draft queue 和 implementation doc。此时先不要从 `plan.yaml` 移除当前 task,要在当前 task 仍位于 `plan.yaml` 时创建 task implementation commit;随后再移除 task,创建 task completion ledger commit,并 push 两个 commit。`make validate-current` / `/advance` 是阶段出口 gate,必须在 open task 已移除后才通过。不要顺手重构、重排格式或处理无关问题;如果发现无关风险,只记录或报告。
25
27
 
26
- 如果用户明确要求并行、多 agent 或多 worktree,开发阶段可以启用可选 `parallel_execution`。主 Agent 先创建合同,声明每个 worker 的 `branch`、`worktree`、`owned_paths`、`forbidden_paths`、`expected_output` 和 `required_gates`。worker 可以在各自 owned paths 内实现,但不得直接修改 `plan.yaml`、`lifecycle.yaml`、`.docs/INDEX.md`、overview 或最终 implementation doc。主 Agent 负责 review、merge/cherry-pick、运行总 gate、更新事实源和完成两段提交。没有用户显式要求时,继续使用串行 `/dev` 或 `/devloop`。
28
+ 开发阶段默认先评估当前 task 是否能安全并行。适合时,主 Agent 创建 `parallel_execution.trigger: "workflow_default"` 合同,默认使用 `runtime_managed` + `runtime.provider: "codex_native_subagents"` 调度 worker;用户明确要求并行、多 agent 或多 worktree 时使用 `trigger: "user_requested"`。主 Agent 声明每个 worker 的 `owned_paths`、`forbidden_paths`、`expected_output` 和 `required_gates`;非 native fallback 写仓库时还要声明 `branch` 和 `worktree`。worker 可以在各自非空、互不重叠且属于当前 task `allowed_paths` 的 owned paths 内实现,但不得直接修改 `plan.yaml`、`lifecycle.yaml`、`.docs/INDEX.md`、overview 或最终 implementation doc。主 Agent 负责 review、merge/cherry-pick、运行总 gate、更新事实源和完成两段提交。不适合拆分时继续串行 `/dev` 或 `/devloop` 并记录原因。
27
29
 
28
30
  ## 输入
29
31
 
@@ -39,7 +41,7 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
39
41
  - 当前 task `allowed_paths` 范围内的测试改动
40
42
  - `.docs/04_implementation/` 下相关模块、子系统或核心数据流的 implementation doc
41
43
  - 当前 task `working_notes` 或 implementation doc `Verification` 中的 gate evidence
42
- - implementation doc 中的 runnable entry/exit、observable exit、basic self-test evidence、配置契约和 fixture/live 边界事实
44
+ - implementation doc 中的 runnable entry/exit、observable exit、Development Self-Test Report、Module Key Test Path、配置契约和 fixture/live 边界事实
43
45
  - 更新后的 `<harnessRoot>/state/plan.yaml`
44
46
  - 如果本轮 promote draft,更新后的 `<harnessRoot>/state/plan.draft.yaml`
45
47
  - 更新后的 `.docs/INDEX.md`
@@ -61,14 +63,14 @@ description: Use during SPRINTING to execute one task from plan.yaml, respecting
61
63
  - 如果一个任务实际变成多个独立实现边界,应停止扩大范围,拆分后续任务或回到任务规划。
62
64
  - `/dev` 是单任务执行入口:没有 open task 时,先根据 PRD、architecture、tech plan 和 `plan.draft.yaml` 创建一个最小 `TASK-*` open task;如果从 `plan.draft.yaml.tasks[]` 采用 draft,必须同次从 draft 列表删除源项;已有 open task 时,直接执行该 task;完成后停止。
63
65
  - `/devloop` 是连续执行入口:每完成一个 task 并 push 两段提交后,重新读取 lifecycle、`plan.yaml`、`plan.draft.yaml`、PRD、architecture 和 tech plan,再决定是否创建/执行下一个最小 task;没有 open task 且没有未采用 draft,或出现 blocker 时停止并报告。
64
- - Parallel Execution 是当前 task 的可选协作方式,不替代 task completion protocol;`SPRINTING` 并行从 lifecycle 的 `current_phase` 和 plan 的 `current_task_id` 推断上下文,不在 `parallel_execution` 内重复保存。
66
+ - Parallel Execution 是当前 task 的默认评估协作方式,不替代 task completion protocol;`SPRINTING` 并行从 lifecycle 的 `current_phase` 和 plan 的 `current_task_id` 推断上下文,不在 `parallel_execution` 内重复保存。
65
67
 
66
68
  ## Plan Protocol
67
69
 
68
70
  每个 open task 都必须在 `plan.yaml` 中包含完整执行合同:
69
71
 
70
72
  1. `current_task_id` 指向正在执行的 open task。
71
- 2. open task 直接声明 `phase: "SPRINTING"`、`docs`、`allowed_paths`、`required_gates`、`acceptance_criteria` 和 `implementation_doc`;runtime/app/provider/live 类 task 还必须声明 `evidence_level` 和 `target_runtime_environment`。
73
+ 2. open task 直接声明 `phase: "SPRINTING"`、`docs`、`allowed_paths`、`required_gates`、`acceptance_criteria` 和 `implementation_doc`;runtime/app/provider/live 类 task 还必须声明 `evidence_level`、`target_runtime_environment` 和 `self_test_contract`。`self_test_contract.required_gates` 必须同步出现在 task `required_gates`,`self_test_contract.module_key_test_path` 必须描述从本地启动或调用入口开始,到完成所有自测 scenario 的模块关键测试路径,并覆盖本 task / 本模块承诺的所有可运行入口和内部关键路径。
72
74
  3. 如果 open task 是由 `plan.draft.yaml.tasks[]` promote 而来,创建正式 `TASK-*` 和删除源 draft 必须发生在同一次状态更新中;正式 task 的恢复现场只保存在 `plan.yaml`。
73
75
  4. 任务执行中只保留恢复所需的简短 `working_notes`。
74
76
  5. gate、implementation doc、`.docs/INDEX.md` 和 `overview.md` 完成后,在当前 task 仍位于 `plan.yaml` 时创建 task implementation commit。
@@ -87,15 +89,15 @@ done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认
87
89
  6. 如果 gate 因代码或测试逻辑失败,在任务范围内修复。
88
90
  7. 如果 gate 因基础设施、凭证缺失、产品行为不清或高风险架构变化失败,进入 `BLOCKED`。
89
91
  8. gate 通过后调用 `pjsdlc_implementation_doc`。
90
- 9. 只有 gate 通过、承诺的 runnable entry/exit 已实现或明确 `BLOCKED`,implementation doc 包含结构化 `Development Evidence`,且 implementation doc 校验通过后,才能把任务标记为 `done`。
92
+ 9. 只有 gate 通过、承诺的 runnable entry/exit 已实现或明确 `BLOCKED`,implementation doc 包含结构化 `Development Evidence` 和已执行的 `Development Self-Test Report`,且 implementation doc 校验通过后,才能把任务标记为 `done`。
91
93
  10. 任务完成并写入或更新相关 implementation doc、刷新 `overview.md`、记录 gate 后,先创建 task implementation commit;此时不要移除该 task。
92
94
  11. task implementation commit 必须发生在 task 移除前;后续默认不要读取其中的执行期字段,历史查询以模块级 implementation doc、RFC、PRD、tech plan 和代码为主。
93
95
  12. implementation commit 完成后,从当前 `plan.yaml` 移除该 task,并创建 task completion ledger commit。
94
96
  13. 默认不追溯已完成 task 的执行流水;只有显式 forensic/audit/regression 任务才临时查询 git、PR 或 CI 记录。
95
97
  14. 两个 commit 后必须 `git push` 到当前 upstream branch;如果没有 remote/upstream、权限或凭证导致无法 push,停止推进并报告 blocker。
96
98
  15. `/devloop` 每轮都必须重新读取当前状态,不得在一次上下文中假设 plan、draft、代码或远端状态未变化。
97
- 16. 只有用户明确要求并行、多 agent 或多 worktree 时,才允许创建 `parallel_execution`;否则不得默认并行。
98
- 17. `runtime_managed` 只在当前 runtime 支持 subagent 时使用;没有该能力时,输出 `user_orchestrated` worker prompt,由用户手动打开对话或 worktree 后粘贴。
99
+ 16. 每个开发 task 开始时默认评估是否适合并行;适合时使用 `parallel_execution.trigger: "workflow_default"`,用户明确要求并行、多 agent 或多 worktree 时使用 `trigger: "user_requested"`。
100
+ 17. 默认使用 `runtime_managed` + `runtime.provider: "codex_native_subagents"`;没有 native subagent 能力时输出 `user_orchestrated` worker prompt,由用户手动打开对话或 worktree 后粘贴;高风险写入或用户要求强隔离时可使用 `codex_exec_worktree` fallback。
99
101
  18. worker 不更新主事实源;主 Agent 才能更新 `plan.yaml`、`.docs/INDEX.md`、overview、implementation doc 和最终 gate 证据。
100
102
 
101
103
  ## 完成检查
@@ -106,6 +108,7 @@ done task 的执行流水不在当前 `plan.yaml` 长期保留,也不是默认
106
108
  - [ ] 当前任务仍然是单一清晰的执行单元。
107
109
  - [ ] 技术方案或 task 承诺的 API/CLI/adapter/worker/provider、配置契约、输出/副作用和 fixture/live 边界已可运行并写入 implementation doc,或已明确 `BLOCKED`/后续 dev task。
108
110
  - [ ] implementation doc `Development Evidence` 已记录 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries`、`Basic Self-test Evidence`,或写明带原因的 `Not applicable`。
111
+ - [ ] 如果当前 task 有 `self_test_contract.status: "required"`,implementation doc 已填写 `Development Self-Test Report`,包含 contract source、scenario results、executed gates、Module Key Test Path、actual evidence、missing/blockers 和 Testing Handoff Readiness,且没有 `BLOCKED` 场景。
109
112
  - [ ] 如果 task 要求 `business_handoff_ready`,implementation doc 已写入 Testing Handoff Contract,包含入口、配置、初始化/health、输入样例、预期出口、清理方式和证据等级。
110
113
  - [ ] 如果当前 task 来自 `plan.draft.yaml.tasks[]`,源 draft 已在 promote 时从 draft 列表删除。
111
114
  - [ ] implementation doc 已生成或更新,并反映相关模块的真实代码。
@@ -17,7 +17,9 @@ description: Use after development gates pass to update module-level implementat
17
17
 
18
18
  文档应帮助后来者快速理解:某个模块或核心数据流的当前实现是什么、关键对象/函数职责是什么、行为如何从输入流到输出、测试覆盖了什么、还有什么未覆盖。task id 只作为 provenance,不作为默认切片粒度。
19
19
 
20
- 如果模块包含或承诺可运行系统边界,implementation doc 必须记录 runnable entry/exit:API/CLI/server route/service/agent/runtime/adapter/worker/provider 的调用方式、初始化方式、配置契约、输入来源、输出或副作用、fixture/live 模式边界,以及哪些真实外部执行器尚未实现。还必须在 `Development Evidence` 中记录开发阶段实际验证过的 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`;确实没有应用入口时,`Not applicable` 必须写清原因。不能把未来才会实现的入口写成当前事实,不能把 provider smoke、fixture smoke、fake adapter 或 one-shot smoke 单独写成 application readiness。如果 task 要求 `business_handoff_ready`,还必须写 Testing Handoff Contract,包含入口、配置、初始化/health、输入样例、预期出口、清理/reset/幂等说明和证据等级。
20
+ 如果模块包含或承诺可运行系统边界,implementation doc 必须记录 runnable entry/exit:API/CLI/server route/service/agent/runtime/adapter/worker/provider 的调用方式、初始化方式、配置契约、输入来源、输出或副作用、fixture/live 模式边界,以及哪些真实外部执行器尚未实现。还必须在 `Development Evidence` 中记录开发阶段实际验证过的 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`;`Basic Self-test Evidence` 应指向已执行的 `Development Self-Test Report`。确实没有应用入口时,`Not applicable` 必须写清原因。不能把未来才会实现的入口写成当前事实,不能把 provider smoke、fixture smoke、fake adapter 或 one-shot smoke 单独写成 application readiness。如果 task 要求 `business_handoff_ready`,还必须写 Testing Handoff Contract,包含入口、配置、初始化/health、输入样例、预期出口、清理/reset/幂等说明和证据等级。
21
+
22
+ 如果当前 task 有 `self_test_contract.status: "required"`,implementation doc 必须填写 `Development Self-Test Report`,把设计/RFC 阶段定义的自测合同执行完成:记录 contract source、每个 scenario 的 `PASS` / `BLOCKED` 结果、实际执行入口、实际出口、证据位置或命令输出、executed gates、Module Key Test Path、missing/blockers 和 Testing Handoff Readiness。`Module Key Test Path` 必须说明从本地启动或调用入口开始,执行并完成 `self_test_contract` 中全部自测用例的模块关键测试路径。该路径应覆盖本 task / 本模块承诺的所有可运行入口,以及自测用例实际经过的内部关键路径、关键边界、观察点和可观测完成证据,供后续 Agent 复用和 debug。任何 scenario 为 `BLOCKED` 时,不得把开发 task 写成完成。
21
23
 
22
24
  ## 输入
23
25
 
@@ -49,8 +51,9 @@ description: Use after development gates pass to update module-level implementat
49
51
  3. 与技术方案的偏移必须明确记录,即便该偏移是合理的。
50
52
  4. runnable entry/exit、配置契约和 fixture/live 边界必须记录当前事实;缺失项写入 `未覆盖(Not covered)` 或方案偏移。
51
53
  5. `Development Evidence` 必须包含 task 合同要求的证据等级、目标运行环境、实际可调用入口、可观察出口、初始化方式、配置契约、测试交接状态、缺失 runtime 边界和开发自测证据;页面类任务记录 dev server/page URL 与 browser check,API/CLI/worker/RPA/service/agent/runtime 类任务记录 startup/invocation command、endpoint/health/status 与 response/output/side effect。
52
- 6. 测试覆盖必须列出具体测试,或明确记录覆盖缺口。
53
- 7. 文档粒度保持在模块、子系统或核心数据流级别;不要默认按 task 建文档,也不要写成跨全项目的巨型百科。
54
+ 6. `Development Self-Test Report` 必须执行 `self_test_contract` 中的全部 scenario 和 required gates,并记录从本地启动或调用入口开始,到完成所有自测用例的 `Module Key Test Path`;路径必须覆盖本 task / 本模块承诺的所有可运行入口、内部关键路径、关键边界、观察点和完成证据,不能只补一句 smoke 结果。
55
+ 7. 测试覆盖必须列出具体测试,或明确记录覆盖缺口。
56
+ 8. 文档粒度保持在模块、子系统或核心数据流级别;不要默认按 task 建文档,也不要写成跨全项目的巨型百科。
54
57
 
55
58
  ## 完成检查
56
59
 
@@ -60,6 +63,7 @@ description: Use after development gates pass to update module-level implementat
60
63
  - [ ] 核心数据流已说明。
61
64
  - [ ] runnable entry/exit、配置契约和 fixture/live 边界已记录,或缺失项已明确标注。
62
65
  - [ ] `Development Evidence` 已记录 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries`、`Basic Self-test Evidence`,或带原因的 `Not applicable`。
66
+ - [ ] 如果当前 task 有 `self_test_contract.status: "required"`,`Development Self-Test Report` 已记录 contract source、scenario results、executed gates、Module Key Test Path、actual evidence、missing/blockers 和 Testing Handoff Readiness。
63
67
  - [ ] `business_handoff_ready` task 已记录 Testing Handoff Contract。
64
68
  - [ ] 已判断 implementation doc 的语义切片边界。
65
69
  - [ ] 方案偏移和测试覆盖已记录。
@@ -20,7 +20,7 @@ Skill、执行出口 gate,并记录 blocker。
20
20
 
21
21
  自然语言和宏指令必须进入同一组 workflow action;区别在于 `/xxx` 入口携带更稳定的细节约束,简单自然语言入口更低成本,但需要你根据当前阶段、plan 和文档上下文补足细节。
22
22
 
23
- Parallel Execution 是显式 opt-in:只有用户明确提出“并行”“多 agent”“多 worktree”或等价意图时,才允许创建或使用 `parallel_execution`。不要因为任务看起来可拆就默认启用。当前 runtime subagent 能力时,主 Agent 可使用 `runtime_managed` 编排;没有该能力时,使用 `user_orchestrated`,输出 worker prompts 让用户手动多开对话或 worktree。无论哪种模式,主 Agent 都是 coordinator 和 integration owner。
23
+ Parallel Execution 是默认评估、按需启用:每个阶段 task 开始时,主 Agent 先做 parallel eligibility check;任务能安全拆分时创建或使用 `parallel_execution.trigger: "workflow_default"`,默认通过 `runtime_managed` + `runtime.provider: "codex_native_subagents"` 调度 Codex native subagents;不适合拆分时保持串行并在 task notes 或输出中简短记录原因。用户明确提出“并行”“多 agent”“多 worktree”或等价意图时,使用 `trigger: "user_requested"`。native subagent 不可用时降级为 `user_orchestrated`;高风险写入或用户要求强隔离时可使用 `codex_exec_worktree` fallback。无论哪种模式,主 Agent 都是 coordinator 和 integration owner。
24
24
 
25
25
  ## 输入
26
26
 
@@ -50,8 +50,8 @@ Parallel Execution 是显式 opt-in:只有用户明确提出“并行”“多
50
50
  17. 用户输入 `/dev`,或自然语言要求“开始开发”“做当前任务”“做下一个任务”“继续开发下一个任务”时,如果 `current_phase` 是 `SPRINTING`,创建或选择一个最小 `TASK-*` development task 并执行一个 task 闭环;如果 task 来自 `plan.draft.yaml.tasks[]`,promote 时必须同次删除源 draft;否则说明当前阶段冲突和推荐路径。
51
51
  18. 用户输入 `/devloop`,或自然语言要求“开始循环:写任务,执行任务”“把开发循环跑完”“连续开发”时,如果 `current_phase` 是 `SPRINTING`,连续运行 `/dev` 循环,直到 `plan.yaml.tasks[]` 和 `plan.draft.yaml.tasks[]` 都没有明确可做任务或遇到 blocker;否则说明当前阶段冲突和推荐路径。
52
52
  19. 用户自然语言要求跑测试或验证时,运行当前 task 或当前阶段的对应 gate。
53
- 20. 用户明确要求并行、多 agent 或多 worktree 时,先判断当前阶段是否是 `REQUIREMENT_GATHERING`、`SPRINTING` `TESTING`;如果是,生成或使用 `parallel_execution.trigger: "user_requested"` 合同;否则说明当前阶段不支持并行合同。
54
- 21. `runtime_managed` 模式只在当前 Agent runtime 真实具备 subagent 能力时使用;否则使用 `user_orchestrated` 并输出每个 worker 的可复制 prompt。
53
+ 20. 每个阶段 task 开始时先判断当前阶段和当前 task 是否适合并行;如果适合,生成或使用 `parallel_execution.trigger: "workflow_default"` 合同;如果用户明确要求并行、多 agent 或多 worktree,使用 `trigger: "user_requested"`。
54
+ 21. 默认使用 `runtime_managed` + `runtime.provider: "codex_native_subagents"`;native subagent 不可用时使用 `user_orchestrated` 并输出每个 worker 的可复制 prompt;高风险写入或用户要求强隔离时可选择 `codex_exec_worktree` fallback
55
55
  22. 用户自然语言要求 review 时,如果 `current_phase` 是 `REVIEWING`,创建或选择一个最小 `TASK-*` review task,并设置 `phase: "REVIEWING"`;reviewer 只读源码,不直接改源码。
56
56
  23. 用户自然语言要求刷新文档总览时,运行 `make docs-overview`。
57
57
  24. `/plan` 和 `/goal` 是客户端模式入口,不由 Harness 自动开启;如果用户手动组合 `/plan` 或 `/goal` 与自然语言或宏指令,应按对应 workflow action 继续执行。
@@ -63,7 +63,7 @@ Parallel Execution 是显式 opt-in:只有用户明确提出“并行”“多
63
63
 
64
64
  `/prd`、`/design`、`/dev`、`/review`、`/test`、`/release` 和 `/rfc` 都是单 task 推进:默认只完成一个 `TASK-*`。`validate-plan` 用于检查当前 open task 合同是否完整。direct `validate-dev` / `make validate-dev` 是 `SPRINTING` 开发中 gate,允许一个合法当前 open task 存在;`validate-current` / `/advance` 在 `SPRINTING` 下仍是阶段出口 gate,要求没有 open task 残留。其它阶段出口 gate `validate-pm`、`validate-design`、`validate-review`、`validate-test`、`validate-release` 和 `validate-rfc` 也要求没有 open task 残留。
65
65
 
66
- `parallel_execution` 是可选顶层合同,缺省表示串行。启用后必须声明 `enabled`、`trigger`、`mode`、`coordinator`、`workers` 和 `integration`;不要在合同内重复保存 `phase` 或 `linked_task_id`,当前阶段来自 lifecycle 的 `current_phase`,当前任务来自 plan 的 `current_task_id`。
66
+ `parallel_execution` 是按需顶层合同,缺省表示当前 task 串行。启用后必须声明 `enabled`、`trigger`、`mode`、`coordinator`、`workers` 和 `integration`;默认并行还应声明 `runtime.provider: "codex_native_subagents"`。不要在合同内重复保存 `phase` 或 `linked_task_id`,当前阶段来自 lifecycle 的 `current_phase`,当前任务来自 plan 的 `current_task_id`。
67
67
 
68
68
  `lifecycle.yaml` 和 `plan.yaml` 只用于当前可执行状态。默认不要读取过去 phase/task/gate 执行流水;只有用户明确要求 forensic/audit/regression 追溯时,才临时查询 git、PR、CI 或 release 记录。
69
69
 
@@ -21,7 +21,7 @@ PRD 产出本身是 workflow task,而不是一次性长文档生成。无论
21
21
 
22
22
  如果项目已经进入 `ARCHITECTING` 但尚未进入 `SPRINTING`,用户发现 PRD 需要补充或调整时,Manager 可以先通过 `python3 tools/transition.py --to REQUIREMENT_GATHERING` 回到本 Skill。此时按正常 PRD task protocol 修改 `.docs/01_product/**`,完成后再通过 `validate-pm` 回到 `ARCHITECTING`;进入 `SPRINTING` 后的需求变化仍走 RFC workflow。
23
23
 
24
- 如果用户在需求阶段明确要求并行、多 agent 或多 worktree,Parallel Execution 只能用于调研、草稿、场景拆解、风险列表或 open questions 收集。worker 不直接写最终 PRD;主 Agent 必须合成最终 `.docs/01_product/**`,并把假设、分歧和未决项写入 PRD。没有用户显式要求时,不要启用 `parallel_execution`。
24
+ 需求阶段默认先评估是否适合并行调研。适合时,主 Agent 使用 `parallel_execution.trigger: "workflow_default"` `runtime.provider: "codex_native_subagents"` 调度 worker 收集调研、草稿、场景拆解、风险列表或 open questions;用户明确要求并行时使用 `trigger: "user_requested"`。worker 不直接写最终 PRD;主 Agent 必须合成最终 `.docs/01_product/**`,并把假设、分歧和未决项写入 PRD。不适合拆分时保持串行并记录原因。
25
25
 
26
26
  ## 输入
27
27
 
@@ -68,7 +68,7 @@ PRD 产出本身是 workflow task,而不是一次性长文档生成。无论
68
68
  4. 如果需求与既有架构或已接受决策冲突,先写冲突说明,不要直接编写技术方案。
69
69
  5. 需求阶段一次只执行一个 `TASK-*` task;不要在单次回复里创建或改写大量 PRD slices。
70
70
  6. `make validate-pm` 是阶段出口 gate;如果还有 open `TASK-*` PRD task,不要请求进入 `ARCHITECTING`。
71
- 7. 需求阶段并行必须使用 `parallel_execution.trigger: "user_requested"`;`runtime_managed` 只在当前 runtime 支持 subagent 时使用,否则输出 `user_orchestrated` worker prompt。
71
+ 7. 需求阶段默认评估并行;workflow 默认触发使用 `parallel_execution.trigger: "workflow_default"` `runtime.provider: "codex_native_subagents"`,用户显式要求并行时使用 `trigger: "user_requested"`;native subagent 不可用时输出 `user_orchestrated` worker prompt。
72
72
  8. 本 Skill 不直接进入开发;PRD 完成后请求 `manager` 运行阶段出口 gate。
73
73
 
74
74
  ## 完成检查
@@ -81,7 +81,7 @@ PRD 产出本身是 workflow task,而不是一次性长文档生成。无论
81
81
  - [ ] 当前 task 已从 `plan.yaml` 移除,或因中断/blocker 保留为可恢复 open task。
82
82
  - [ ] 已判断是否需要新增、拆分、合并或废弃 PRD slice。
83
83
  - [ ] 如果用户要求把完整 PRD/产品方案切成 slices,已删除被替代的完整文件,并保留必要的 `.docs/00_raw/` 原始记录。
84
- - [ ] 如果用户要求并行,worker output 已由主 Agent 合成,最终 PRD 不由 worker 直接写入。
84
+ - [ ] 如果启用了并行,worker output 已由主 Agent 合成,最终 PRD 不由 worker 直接写入。
85
85
  - [ ] `.docs/INDEX.md` 已链接新增产物。
86
86
  - [ ] 已运行 `make docs-overview` 刷新 `.docs/<stage>/overview.md`。
87
87
  - [ ] `make validate-pm` 准备通过。
@@ -19,6 +19,8 @@ Current release status 面向当前发布决策,必须说明版本、变更价
19
19
 
20
20
  发布准备本身也是 workflow task。开始 release 工作前,先在 `<harnessRoot>/state/plan.yaml` 创建或选择一个足够小的 `TASK-*` open task,并设置 `phase: "RELEASING"`;当前轮只更新 `.docs/08_release/CURRENT_RELEASE.md` 中的当前发布状态、一次 smoke evidence 补充、一个部署检查或一个 rollback plan 单元。发布动作本身仍需用户明确授权。
21
21
 
22
+ 发布阶段默认先评估是否适合并行 read-only preflight。适合时,主 Release Manager 使用 `parallel_execution.trigger: "workflow_default"` 和 `runtime.provider: "codex_native_subagents"` 调度 worker 分别检查 release notes、build artifacts、smoke evidence、known limitations 或 rollback risk;用户明确要求并行时使用 `trigger: "user_requested"`。RELEASING worker 必须 `writes_repo: false`,不得执行 publish、tag、push、delete、deploy 或生产变更;最终 `CURRENT_RELEASE.md`、发布结论和任何真实发布动作由主 Release Manager 负责。
23
+
22
24
  ## 输入
23
25
 
24
26
  - `<harnessRoot>/state/plan.yaml`
@@ -17,10 +17,12 @@ Review 时先建立证据链:PRD 说什么、技术方案承诺什么、implem
17
17
 
18
18
  不要把个人偏好包装成 blocker。区分 blocking issue、follow-up improvement 和 open question。如果没有发现问题,要明确说明,同时列出剩余测试缺口或残余风险。
19
19
 
20
- Review 必须把“当前模块没有可运行入口/出口”视为阻断项,而不是普通测试缺口。凡 PRD、技术方案或 implementation doc 承诺 API、CLI、server route、service、agent、runtime、adapter、worker、provider、外部发送/写入执行器、配置契约或 live/fixture 双模式边界,Review 都要读取技术方案的 `Development Deliverable Contract` 或等价交付边界,并核对真实代码和实现文档是否提供可调用入口、初始化方式、输出/副作用边界和验证方式;如果 task 声明了 `evidence_level.required` 和 `target_runtime_environment`,还必须核对实际证据等级、执行地点和目标运行环境是否匹配。implementation doc 还必须包含结构化 `Development Evidence`,说明 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`,或带原因的 `Not applicable`。如果 task 要求 `deployed_runtime` 或 `business_handoff_ready`,但证据只是在开发机 `localhost`、provider live smoke、fixture smoke、fake adapter 或文档描述,应判 `BLOCKED`。缺失时 gate decision 应为 `BLOCKED`,并要求回到 SPRINTING/RFC,而不是允许进入 TESTING 后补 runtime。Review 报告必须写出 `Runnable Entry`、`Observable Exit`、`Initialization`、`Config Contract`、`Testing Handoff Readiness` 的 `PASS`/`BLOCKED` checklist;任一 `BLOCKED` 不得进入 TESTING。Review 不创建 `.docs/07_test/**` 正式测试产物;如果发现现有测试事实源仍链接已被 RFC supersede 的旧路线证据,应将其列为进入 TESTING 前的 blocker,并要求 RFC 清理或更新索引。
20
+ Review 必须把“当前模块没有可运行入口/出口”视为阻断项,而不是普通测试缺口。凡 PRD、技术方案或 implementation doc 承诺 API、CLI、server route、service、agent、runtime、adapter、worker、provider、外部发送/写入执行器、配置契约或 live/fixture 双模式边界,Review 都要读取技术方案的 `Development Deliverable Contract`、`Development Self-Test Contract` 或等价交付边界,并核对真实代码和实现文档是否提供可调用入口、初始化方式、输出/副作用边界和验证方式;如果 task 声明了 `evidence_level.required`、`target_runtime_environment` 或 `self_test_contract`,还必须核对实际证据等级、执行地点、目标运行环境、自测 scenario 结果、`module_key_test_path` required gates 是否匹配。implementation doc 还必须包含结构化 `Development Evidence`,说明 `Evidence Level`、`Target Runtime Environment`、`Runnable Entry`、`Observable Exit`、`Client / Server Initialization`、`Config Contract`、`Testing Handoff Readiness`、`Known Missing Runtime Boundaries` 和 `Basic Self-test Evidence`,或带原因的 `Not applicable`;如果 task 有 `self_test_contract.status: "required"`,还必须包含已执行的 `Development Self-Test Report`,并记录从本地启动或调用入口开始,到完成全部自测用例的 `Module Key Test Path`。该路径应覆盖本 task / 本模块承诺的所有可运行入口、内部关键路径、关键边界、观察点和可观测完成证据。如果 task 要求 `deployed_runtime` 或 `business_handoff_ready`,但证据只是在开发机 `localhost`、provider live smoke、fixture smoke、fake adapter 或文档描述,应判 `BLOCKED`。缺失时 gate decision 应为 `BLOCKED`,并要求回到 SPRINTING/RFC,而不是允许进入 TESTING 后补 runtime。Review 报告必须写出 `Runnable Entry`、`Observable Exit`、`Initialization`、`Config Contract`、`Testing Handoff Readiness` 的 `PASS`/`BLOCKED` checklist;任一 `BLOCKED` 不得进入 TESTING。Review 不创建 `.docs/07_test/**` 正式测试产物;如果发现现有测试事实源仍链接已被 RFC supersede 的旧路线证据,应将其列为进入 TESTING 前的 blocker,并要求 RFC 清理或更新索引。
21
21
 
22
22
  Review 产出本身也是 workflow task。开始 review 前,先在 `<harnessRoot>/state/plan.yaml` 创建或选择一个足够小的 `TASK-*` open task,并设置 `phase: "REVIEWING"`;当前轮只产出一个 review batch、一个风险主题 slice 或一次 PR review 结论。不要在一个任务里覆盖多个互不相关的 review 主题。
23
23
 
24
+ Review 阶段默认先评估是否适合并行只读审查。适合时,主 Reviewer 使用 `parallel_execution.trigger: "workflow_default"` 和 `runtime.provider: "codex_native_subagents"` 调度 worker 分别检查需求一致性、架构风险、测试缺口、runnable entry/exit 或安全风险;用户明确要求并行时使用 `trigger: "user_requested"`。worker 必须 `writes_repo: false`,只提交 findings 和证据;最终 `REVIEW_REPORT.md` 与 PASS/BLOCKED 结论由主 Reviewer 汇总。
25
+
24
26
  ## 输入
25
27
 
26
28
  - `<harnessRoot>/state/plan.yaml`
@@ -66,7 +68,7 @@ Review 阶段受 `plan.yaml` 管控:
66
68
  2. Findings 放在最前面,并按严重程度排序。
67
69
  3. 每条 finding 尽量引用文件、需求、任务或文档路径。
68
70
  4. 区分 blocking issues 和 follow-up improvements。
69
- 5. 缺少已承诺的 runnable entry/exit、配置契约、fixture/live 边界或 `Development Evidence` 时,必须作为 P0/P1 blocking finding。
71
+ 5. 缺少已承诺的 runnable entry/exit、配置契约、fixture/live 边界、`Development Evidence` 或 `Development Self-Test Report` 时,必须作为 P0/P1 blocking finding。
70
72
  6. 如果未发现问题,明确说明,并列出剩余测试缺口或残余风险。
71
73
  7. Review 阶段一次只执行一个 `TASK-*` task。
72
74
 
@@ -79,6 +81,7 @@ Review 阶段受 `plan.yaml` 管控:
79
81
  - [ ] 已评估架构和可维护性风险。
80
82
  - [ ] 已评估 runnable entry/exit、配置契约和 fixture/live 边界是否足以进入 TESTING。
81
83
  - [ ] 已评估 implementation doc 是否包含 Evidence Level、Target Runtime Environment、Runnable Entry、Observable Exit、Client / Server Initialization、Config Contract、Testing Handoff Readiness、Known Missing Runtime Boundaries 和 Basic Self-test Evidence。
84
+ - [ ] 已评估 `self_test_contract` 对应的 Development Self-Test Report 是否执行全部 scenario 和 required gates,并记录可复用的 Module Key Test Path。
82
85
  - [ ] 已核对证据等级和执行地点是否匹配 task / 技术方案承诺的目标运行环境。
83
86
  - [ ] 已判断 review slice 的范围和风险主题边界。
84
87
  - [ ] 已列出测试缺口。
@@ -19,10 +19,12 @@ description: Use during RFC_RECALIBRATION to process requirement changes with im
19
19
 
20
20
  影响面分析必须先于补丁。至少检查 docs/state/skills/policies/templates/tools/package assets/tests/migrations/generated artifacts 是否受影响;如果某一类不受影响,也要显式说明不受影响或不需要修改。对于 Harness package 相关变更,还要检查 `sync`、`upgrade`、source mappings、package assets 和用户项目迁移行为。
21
21
 
22
- 如果 RFC 替换模块技术路线、entry/exit、环境依赖或验收边界,必须同步审查 `.docs/07_test/**`。被新方案 supersede 的测试环境、测试进度、测试用例、测试报告和 partial evidence 要从当前测试事实源删除或迁出,并从 `.docs/INDEX.md` 和 generated overview 中移除链接;历史证据只保留在 RFC provenance、git history、CI/release 系统或明确 archive 语义中,不能继续放在当前 `.docs/07_test/**` 冒充现行测试依据。RFC 必须写明 `Test Fact Source Impact`:reviewed test docs、superseded test docs、retained test docs 和原因;如果只是文案澄清且不影响测试事实源,可写 `none`。
22
+ 如果 RFC 替换模块技术路线、entry/exit、环境依赖、required gates、handoff、blocker、模块关键测试路径或验收边界,必须同步审查 `.docs/07_test/**` 和开发自测链路。模块关键测试路径变化包括本 task / 本模块承诺的可运行入口、内部关键路径、关键边界、观察点或完成证据变化。被新方案 supersede 的测试环境、测试进度、测试用例、测试报告和 partial evidence 要从当前测试事实源删除或迁出,并从 `.docs/INDEX.md` 和 generated overview 中移除链接;历史证据只保留在 RFC provenance、git history、CI/release 系统或明确 archive 语义中,不能继续放在当前 `.docs/07_test/**` 冒充现行测试依据。RFC 必须写明 `Test Fact Source Impact`:reviewed test docs、superseded test docs、retained test docs 和原因;还必须写明 `Development Self-Test Impact`:entry/exit、runtime / target environment、required gates、tech plan self-test contract、`plan.yaml` / `plan.draft.yaml` task contract、implementation doc self-test report、Module Key Test Path、Review / Testing handoff 的影响。如果只是文案澄清且不影响测试事实源或自测链路,可分别写 `none`。
23
23
 
24
24
  RFC recalibration 本身也是 workflow task。开始处理变更前,先在 `<harnessRoot>/state/plan.yaml` 创建或选择一个足够小的 `TASK-*` open task,并设置 `phase: "RFC_RECALIBRATION"`;当前轮只处理一个 RFC 文件、一个 impact analysis 单元或一个局部补丁单元。
25
25
 
26
+ RFC 阶段默认先评估是否适合并行 impact analysis。适合时,主 Agent 使用 `parallel_execution.trigger: "workflow_default"` 和 `runtime.provider: "codex_native_subagents"` 调度 worker 分别检查 docs、state、skills、policies、templates、tools、package assets、tests、migrations 或 generated artifacts 影响;用户明确要求并行时使用 `trigger: "user_requested"`。worker 必须 `writes_repo: false`,只提交影响面、patch candidates 和风险清单;最终 RFC、事实源补丁和任务调整由主 Agent 汇总。
27
+
26
28
  ## 输入
27
29
 
28
30
  - `.docs/rfc/RFC_*.md`
@@ -45,7 +47,7 @@ RFC recalibration 本身也是 workflow task。开始处理变更前,先在 `<
45
47
 
46
48
  - `.docs/rfc/` 按一次需求变更切片,一份 RFC 只描述一个可独立评估、实现和回归的变更。
47
49
  - 如果用户一次提出多个互不依赖的变更,应拆成多份 RFC。
48
- - RFC 的 impact analysis 负责判断是否需要重切 PRD、tech planimplementation doc、test strategy、test cases 或 test report,并覆盖 state、tools、package assets、tests、migration 和 generated overview。
50
+ - RFC 的 impact analysis 负责判断是否需要重切 PRD、tech plan、`self_test_contract`、implementation doc、Development Self-Test Report、Module Key Test Path、test strategy、test cases 或 test report,并覆盖 state、tools、package assets、tests、migration 和 generated overview。
49
51
  - 对受影响产物做局部补丁,不重写无关稳定 slice。
50
52
  - 每次 RFC 影响了文档边界,都要更新 `.docs/INDEX.md` 并记录受影响任务状态。
51
53
 
@@ -80,6 +82,7 @@ RFC 阶段受 `plan.yaml` 管控:
80
82
  - [ ] 已判断 RFC 是否需要拆分,以及是否影响其它阶段 slice。
81
83
  - [ ] 已列出 docs/state/skills/policies/templates/tools/package assets/tests/migrations/generated artifacts 的影响面。
82
84
  - [ ] 已记录 `Test Fact Source Impact`,并清理被 supersede 的 `.docs/07_test/**` 当前事实链接。
85
+ - [ ] 已记录 `Development Self-Test Impact`;如果 RFC 改变 entry/exit、runtime、gate、handoff、blocker 或模块关键测试路径,已同步 tech plan、task contract、required gates、implementation doc 和 Review/Testing handoff 影响。
83
86
  - [ ] 受影响任务已标记或新增。
84
87
  - [ ] Regression requirements 已明确。
85
88
  - [ ] `.docs/INDEX.md` 已链接 RFC 和受影响产物。
@@ -17,11 +17,11 @@ description: Use during TESTING to produce a test matrix, run regression, and do
17
17
 
18
18
  执行回归时,优先选择能证明阶段出口的 gate。测试无法运行、环境缺失或数据不可得时,不要宣布通过;如果已经进入 TESTING,应在 `TEST_REPORT.md` 中记录 `BLOCKED`、已完成检查和恢复条件。
19
19
 
20
- TESTING 只能调用 SPRINTING/REVIEWING 已确认 `PASS` 的入口做输入/输出验证。可以补充测试、fixture、mock、assertion helper 和测试文档,但不能在 TESTING 中新增或长期维护 product runtime、server/API/CLI/adapter、direct poller、cloud bootstrap、systemd unit、真实 provider adapter、package runtime script 或部署脚本。如果发现真实入口/出口不存在、implementation doc 缺少 `Development Evidence`、live 模式不可调用、配置契约缺失、Review readiness checklist 不是全 `PASS`,或 `Evidence Level` / `Target Runtime Environment` 与 task 或技术方案承诺不一致,应记录 `BLOCKED`、生成 RFC 或后续 dev task 建议,并停止把测试阶段扩大成开发/集成搭建。开发尚未交付可测试 entry/exit、目标运行环境或 Testing Handoff Contract 时,不要在 `.docs/07_test/**` 提前生成正式测试用例或正式报告;验收思路应留在 PRD acceptance criteria、tech plan verification strategy 或非 `.docs/07_test/**` 的草稿说明里。`TEST_REPORT.md` 不能在描述缺少 entry/exit、缺少 Development Evidence、证据等级不匹配或未交付应用入口时给出 `PASS`。
20
+ TESTING 只能调用 SPRINTING/REVIEWING 已确认 `PASS` 的入口做输入/输出验证。可以补充测试、fixture、mock、assertion helper 和测试文档,但不能在 TESTING 中新增或长期维护 product runtime、server/API/CLI/adapter、direct poller、cloud bootstrap、systemd unit、真实 provider adapter、package runtime script 或部署脚本。如果发现真实入口/出口不存在、implementation doc 缺少 `Development Evidence` 或 `Development Self-Test Report`、自测报告缺少从本地启动或调用入口到完成全部自测用例的 `Module Key Test Path`、或该路径没有覆盖本 task / 本模块承诺的入口、内部关键路径、关键边界、观察点和完成证据,live 模式不可调用、配置契约缺失、Review readiness checklist 不是全 `PASS`,或 `Evidence Level` / `Target Runtime Environment` / `self_test_contract` 与 task 或技术方案承诺不一致,应记录 `BLOCKED`、生成 RFC 或后续 dev task 建议,并停止把测试阶段扩大成开发/集成搭建。开发尚未交付可测试 entry/exit、目标运行环境、Development Self-Test Report 或 Testing Handoff Contract 时,不要在 `.docs/07_test/**` 提前生成正式测试用例或正式报告;验收思路应留在 PRD acceptance criteria、tech plan verification strategy 或非 `.docs/07_test/**` 的草稿说明里。`TEST_REPORT.md` 不能在描述缺少 entry/exit、缺少 Development Evidence、缺少 Development Self-Test Report、证据等级不匹配或未交付应用入口时给出 `PASS`。
21
21
 
22
22
  测试设计和回归证据产出本身也是 workflow task。开始测试前,先在 `<harnessRoot>/state/plan.yaml` 创建或选择一个足够小的 `TASK-*` open task,并设置 `phase: "TESTING"`;当前轮只产出一个测试策略 slice、测试用例 slice、回归批次、风险验证片区或一组 scoped test changes。`plan.yaml` 仍是唯一执行计划事实源,`.docs/07_test/**` 只记录当前方案的 test strategy、test cases、executed regression evidence、coverage gaps 和 final decision,不表达“下一步如何开发”,也不保留已被 RFC supersede 的旧测试结果。
23
23
 
24
- 如果用户明确要求并行、多 agent 或多 worktree,测试阶段可以启用 `parallel_execution`,让 worker 分别执行互不依赖的回归片区、smoke、兼容性或风险验证。worker 只提交证据和必要的 scoped test changes;最终 `.docs/07_test/**`、coverage gaps、PASS/BLOCKED 决策和阶段 gate 由主 Agent 汇总。没有用户显式要求时,测试 workflow 保持串行。
24
+ 测试阶段默认先评估是否适合并行验证。适合时,主 Tester 使用 `parallel_execution.trigger: "workflow_default"` 和 `runtime.provider: "codex_native_subagents"` 调度 worker 分别执行互不依赖的回归片区、smoke、兼容性或风险验证;用户明确要求并行时使用 `trigger: "user_requested"`。worker 只提交证据和必要的 scoped test changes;最终 `.docs/07_test/**`、coverage gaps、PASS/BLOCKED 决策和阶段 gate 由主 Agent 汇总。不适合拆分时保持串行并记录原因。
25
25
 
26
26
  ## 输入
27
27
 
@@ -67,7 +67,7 @@ TESTING 只能调用 SPRINTING/REVIEWING 已确认 `PASS` 的入口做输入/输
67
67
 
68
68
  ## 规则
69
69
 
70
- 1. 测试用例必须追溯到 PRD acceptance criteria 或 Review findings,并绑定 SPRINTING/REVIEWING 已确认的 runnable entry/exit、Development Evidence、Evidence Level、Target Runtime Environment 和 Testing Handoff Contract。
70
+ 1. 测试用例必须追溯到 PRD acceptance criteria 或 Review findings,并绑定 SPRINTING/REVIEWING 已确认的 runnable entry/exit、Development Evidence、Development Self-Test Report、Evidence Level、Target Runtime Environment 和 Testing Handoff Contract。
71
71
  2. 根据风险补充边界、负向、回归和集成测试。
72
72
  3. 如果有意延后覆盖,必须记录风险和 follow-up。
73
73
  4. 不得新增 product runtime、server/API/CLI/adapter、poller、cloud bootstrap、systemd unit、真实 provider adapter、package runtime script 或部署脚本;这些属于 SPRINTING/RFC。
@@ -75,7 +75,7 @@ TESTING 只能调用 SPRINTING/REVIEWING 已确认 `PASS` 的入口做输入/输
75
75
  6. 新测试策略使用 `.docs/07_test/TEST_STRATEGY.md`,新测试用例使用 `.docs/07_test/TEST_CASES.md`,执行报告使用 `.docs/07_test/TEST_REPORT.md`;不要新建或继续依赖 `.docs/07_test/TEST_PLAN.md`。
76
76
  7. `TEST_REPORT.md` 不得包含 `pending`、`TBD`、`待填`、`TODO` 或占位结论;未执行或不可执行时 Final decision 必须为 `BLOCKED` 并给出恢复条件。
77
77
  8. RFC 改变技术路线、entry/exit 或验收边界后,必须确认 `.docs/07_test/**` 中旧路线测试证据已删除或不再从 `.docs/INDEX.md` 暴露。
78
- 9. 并行测试必须使用 `parallel_execution.trigger: "user_requested"`;`runtime_managed` 只在当前 runtime 支持 subagent 时使用,否则输出 `user_orchestrated` worker prompt。
78
+ 9. 测试阶段默认评估并行;workflow 默认触发使用 `parallel_execution.trigger: "workflow_default"` `runtime.provider: "codex_native_subagents"`,用户显式要求并行时使用 `trigger: "user_requested"`;native subagent 不可用时输出 `user_orchestrated` worker prompt。
79
79
  10. 宣布阶段完成前运行 `make test-all`。
80
80
  11. 测试阶段一次只执行一个 `TASK-*` task。
81
81
 
@@ -87,6 +87,7 @@ TESTING 只能调用 SPRINTING/REVIEWING 已确认 `PASS` 的入口做输入/输
87
87
  - [ ] Regression checklist 已完成。
88
88
  - [ ] 测试只调用既有 runnable entry/exit;未在 TESTING 中新增 product runtime、bootstrap、provider adapter、deploy 或 package runtime script。
89
89
  - [ ] 已核对 implementation doc 中的 Development Evidence、Evidence Level、Target Runtime Environment 和 Testing Handoff Contract,并只基于已交付入口设计测试。
90
+ - [ ] 已核对 Development Self-Test Report 中 scenario results、executed gates、Module Key Test Path 和 actual evidence。
90
91
  - [ ] 已判断 test report / test matrix 的语义切片边界。
91
92
  - [ ] 未把测试计划、测试用例或待填内容写成 `TEST_REPORT.md`。
92
93
  - [ ] 已确认 `.docs/07_test/**` 只包含当前方案仍有效的测试事实。