coding-agent-harness 1.0.2 → 1.0.4

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 (177) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/CONTRIBUTING.md +98 -0
  3. package/README.md +211 -86
  4. package/README.zh-CN.md +54 -34
  5. package/SKILL.md +25 -18
  6. package/docs-release/README.md +9 -5
  7. package/docs-release/architecture/overview.md +17 -5
  8. package/docs-release/architecture/overview.zh-CN.md +9 -5
  9. package/docs-release/assets/dashboard-overview.png +0 -0
  10. package/docs-release/guides/agent-installation.en-US.md +31 -8
  11. package/docs-release/guides/agent-installation.md +34 -9
  12. package/docs-release/guides/contributing.md +100 -0
  13. package/docs-release/guides/contributing.zh-CN.md +99 -0
  14. package/docs-release/guides/document-audience-and-surfaces.en-US.md +3 -2
  15. package/docs-release/guides/document-audience-and-surfaces.md +3 -2
  16. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +2 -2
  17. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +2 -2
  18. package/docs-release/guides/legacy-migration-agent-prompt.md +0 -11
  19. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +0 -11
  20. package/docs-release/guides/migration-playbook.en-US.md +14 -15
  21. package/docs-release/guides/migration-playbook.md +14 -15
  22. package/docs-release/guides/parent-control-repository-pattern.en-US.md +7 -5
  23. package/docs-release/guides/parent-control-repository-pattern.md +7 -5
  24. package/docs-release/guides/preset-development.md +214 -0
  25. package/docs-release/guides/repository-operating-models.en-US.md +5 -4
  26. package/docs-release/guides/repository-operating-models.md +5 -4
  27. package/docs-release/guides/task-state-machine.en-US.md +207 -0
  28. package/docs-release/guides/task-state-machine.md +214 -0
  29. package/docs-release/intl/en-US.md +1 -1
  30. package/docs-release/intl/zh-CN.md +1 -1
  31. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
  32. package/package.json +8 -3
  33. package/presets/legacy-migration/checks/preset-check.mjs +3 -0
  34. package/presets/legacy-migration/preset.yaml +134 -0
  35. package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
  36. package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
  37. package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
  38. package/presets/legacy-migration/templates/findings.seed.md +17 -0
  39. package/presets/legacy-migration/templates/review.seed.md +12 -0
  40. package/presets/legacy-migration/templates/task_plan.append.md +9 -0
  41. package/presets/legacy-migration/templates/visual_map.append.md +12 -0
  42. package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
  43. package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
  44. package/presets/lesson-sedimentation/preset.yaml +23 -0
  45. package/presets/lesson-sedimentation/templates/prompt.md +23 -0
  46. package/presets/module/preset.yaml +25 -0
  47. package/presets/module/templates/execution_strategy.append.md +8 -0
  48. package/presets/module/templates/task_plan.append.md +17 -0
  49. package/presets/standard-task/preset.yaml +31 -0
  50. package/presets/standard-task/templates/task_plan.append.md +7 -0
  51. package/references/adversarial-review-standard.md +2 -2
  52. package/references/agents-md-pattern.md +2 -2
  53. package/references/delivery-operating-model-standard.md +3 -3
  54. package/references/docs-directory-standard.md +6 -7
  55. package/references/harness-ledger.md +53 -96
  56. package/references/lessons-governance.md +88 -93
  57. package/references/module-parallel-standard.md +14 -14
  58. package/references/planning-loop.md +12 -6
  59. package/references/pull-request-standard.md +118 -0
  60. package/references/repo-governance-standard.md +11 -2
  61. package/references/review-routing-standard.md +7 -1
  62. package/references/ssot-governance.md +67 -59
  63. package/references/taskr-gap-analysis.md +600 -0
  64. package/references/walkthrough-closeout.md +7 -7
  65. package/scripts/check-harness.mjs +40 -301
  66. package/scripts/commands/dashboard-command.mjs +67 -0
  67. package/scripts/commands/migration-command.mjs +96 -0
  68. package/scripts/commands/preset-command.mjs +73 -0
  69. package/scripts/commands/task-command.mjs +327 -0
  70. package/scripts/harness.mjs +55 -260
  71. package/scripts/lib/capability-registry.mjs +66 -8
  72. package/scripts/lib/check-module-parallel.mjs +237 -0
  73. package/scripts/lib/check-profiles.mjs +61 -153
  74. package/scripts/lib/check-task-contracts.mjs +47 -0
  75. package/scripts/lib/core-shared.mjs +10 -0
  76. package/scripts/lib/dashboard-data.mjs +29 -6
  77. package/scripts/lib/dashboard-workbench.mjs +52 -12
  78. package/scripts/lib/dashboard-writer.mjs +14 -2
  79. package/scripts/lib/git-status-summary.mjs +46 -0
  80. package/scripts/lib/governance-index-generator.mjs +174 -0
  81. package/scripts/lib/governance-sync.mjs +514 -0
  82. package/scripts/lib/governance-table-boundary.mjs +175 -0
  83. package/scripts/lib/harness-core.mjs +5 -0
  84. package/scripts/lib/lesson-maintenance.mjs +36 -29
  85. package/scripts/lib/migration-support.mjs +1 -1
  86. package/scripts/lib/preset-audit-contracts.mjs +37 -0
  87. package/scripts/lib/preset-engine.mjs +497 -0
  88. package/scripts/lib/preset-registry.mjs +627 -0
  89. package/scripts/lib/preset-resource-contracts.mjs +83 -0
  90. package/scripts/lib/review-confirm-git-gate.mjs +248 -0
  91. package/scripts/lib/status-dashboard-renderer.mjs +102 -0
  92. package/scripts/lib/subagent-authorization-audit.mjs +196 -0
  93. package/scripts/lib/task-completion-consistency.mjs +16 -0
  94. package/scripts/lib/task-index.mjs +93 -0
  95. package/scripts/lib/task-lesson-candidates.mjs +242 -0
  96. package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
  97. package/scripts/lib/task-lifecycle/review-confirm.mjs +101 -0
  98. package/scripts/lib/task-lifecycle/review-gates.mjs +70 -0
  99. package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
  100. package/scripts/lib/task-lifecycle.mjs +297 -403
  101. package/scripts/lib/task-review-model.mjs +469 -0
  102. package/scripts/lib/task-scanner.mjs +130 -236
  103. package/scripts/lib/task-tombstone-commands.mjs +140 -0
  104. package/scripts/postinstall.mjs +14 -0
  105. package/skills/preset-creator/SKILL.md +179 -0
  106. package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
  107. package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
  108. package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -0
  109. package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
  110. package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
  111. package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
  112. package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
  113. package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
  114. package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
  115. package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
  116. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
  117. package/skills/preset-creator/references/complex-task-skeleton/visual_map.md +50 -0
  118. package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
  119. package/templates/AGENTS.md.template +19 -15
  120. package/templates/dashboard/assets/app-src/00-state.js +1 -0
  121. package/templates/dashboard/assets/app-src/10-router.js +2 -1
  122. package/templates/dashboard/assets/app-src/20-overview.js +11 -5
  123. package/templates/dashboard/assets/app-src/30-tasks.js +92 -246
  124. package/templates/dashboard/assets/app-src/35-task-detail.js +246 -0
  125. package/templates/dashboard/assets/app-src/45-review.js +241 -22
  126. package/templates/dashboard/assets/app-src/50-migration.js +24 -10
  127. package/templates/dashboard/assets/app-src/90-bindings.js +171 -29
  128. package/templates/dashboard/assets/app.css +698 -156
  129. package/templates/dashboard/assets/app.css.manifest.json +9 -0
  130. package/templates/dashboard/assets/app.js +662 -91
  131. package/templates/dashboard/assets/app.manifest.json +1 -0
  132. package/templates/dashboard/assets/css-src/00-foundation.css +342 -0
  133. package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
  134. package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
  135. package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
  136. package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
  137. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +427 -0
  138. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
  139. package/templates/dashboard/assets/i18n.js +123 -21
  140. package/templates/ledger/Harness-Ledger.md +13 -25
  141. package/templates/lessons/lesson-arch-process-change.md +1 -1
  142. package/templates/lessons/lesson-new-doc.md +1 -1
  143. package/templates/lessons/lesson-ref-change.md +1 -1
  144. package/templates/planning/execution_strategy.md +31 -0
  145. package/templates/planning/lesson_candidates.md +18 -6
  146. package/templates/planning/optional/artifacts/INDEX.md +3 -3
  147. package/templates/planning/optional/references/INDEX.md +3 -3
  148. package/templates/planning/review.md +59 -0
  149. package/templates/planning/task_plan.md +36 -13
  150. package/templates/reference/execution-workflow-standard.md +4 -3
  151. package/templates/reference/pull-request-standard.md +80 -0
  152. package/templates/reference/repo-governance-standard.md +7 -6
  153. package/templates/reference/review-routing-standard.md +6 -0
  154. package/templates/reference/walkthrough-standard.md +2 -1
  155. package/templates/verifier/verifier-output.md +1 -1
  156. package/templates-zh-CN/AGENTS.md.template +20 -16
  157. package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
  158. package/templates-zh-CN/planning/execution_strategy.md +30 -0
  159. package/templates-zh-CN/planning/lesson_candidates.md +18 -6
  160. package/templates-zh-CN/planning/review.md +59 -1
  161. package/templates-zh-CN/planning/task_plan.md +30 -10
  162. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  163. package/templates-zh-CN/reference/docs-library-standard.md +1 -1
  164. package/templates-zh-CN/reference/execution-workflow-standard.md +4 -3
  165. package/templates-zh-CN/reference/harness-ledger-standard.md +2 -2
  166. package/templates-zh-CN/reference/pull-request-standard.md +106 -0
  167. package/templates-zh-CN/reference/repo-governance-standard.md +4 -3
  168. package/templates-zh-CN/reference/review-routing-standard.md +8 -1
  169. package/templates-zh-CN/reference/walkthrough-standard.md +3 -2
  170. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +1 -1
  171. package/docs-release/assets/dashboard-overview-en.png +0 -0
  172. package/scripts/smoke-dashboard.mjs +0 -92
  173. package/scripts/test-harness.mjs +0 -1395
  174. package/templates/ssot/Feature-SSoT.md +0 -43
  175. package/templates/ssot/Lessons-SSoT.md +0 -44
  176. package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
  177. package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
@@ -0,0 +1,80 @@
1
+ # Pull Request Standard
2
+
3
+ ## Purpose
4
+
5
+ Every non-trivial PR must be reviewable without reading the full agent
6
+ conversation. The PR body is a handoff packet for maintainers: what changed,
7
+ why it changed, how it was verified, which version is affected, and what risks
8
+ remain.
9
+
10
+ ## Required Shape
11
+
12
+ The PR body must include:
13
+
14
+ 1. Summary
15
+ 2. What Changed
16
+ 3. Version Impact
17
+ 4. Verification
18
+ 5. Review Evidence
19
+ 6. Residual Risk
20
+ 7. References
21
+
22
+ Use a bilingual PR body when the repository has Chinese and English users or
23
+ the task discussion is Chinese. English comes first for public GitHub readers,
24
+ then the localized section follows after the English section.
25
+
26
+ ## Content Rules
27
+
28
+ - State the target version explicitly. If `package.json` changes from `1.0.3`
29
+ to `1.0.4`, say so in Version Impact.
30
+ - List changed surfaces by user-visible area or module, not by dumping every
31
+ file path.
32
+ - Verification must name the real commands, browser checks, CI runs, or
33
+ evidence artifacts. If a check was not run, say why.
34
+ - Review Evidence must mention self-review, subagent review, human review, or
35
+ code-quality review status. Release-blocking findings must be closed or
36
+ routed before merge.
37
+ - Residual Risk must distinguish accepted risk, deferred follow-up, and
38
+ unrelated local/private debt.
39
+ - References must link relevant task docs, SSoT rows, review files, commits,
40
+ issues, or PRs.
41
+
42
+ ## Template
43
+
44
+ ```markdown
45
+ ## Summary
46
+
47
+ [One or two sentences explaining the intent and outcome.]
48
+
49
+ ## What Changed
50
+
51
+ - [User-facing or module-level change.]
52
+ - [Governance, CLI, dashboard, docs, or template change.]
53
+
54
+ ## Version Impact
55
+
56
+ - Package version: `[old]` -> `[new]`
57
+ - Release notes: [CHANGELOG entry or reason no release note is needed]
58
+
59
+ ## Verification
60
+
61
+ - `[command]`: pass
62
+ - `[browser/runtime/CI evidence]`: pass
63
+ - Not run: [reason]
64
+
65
+ ## Review Evidence
66
+
67
+ - Self-review: [summary]
68
+ - Additional review: [reviewer/subagent/human result]
69
+ - Blocking findings: [none / closed / routed]
70
+
71
+ ## Residual Risk
72
+
73
+ - [none / accepted / deferred / unrelated debt]
74
+
75
+ ## References
76
+
77
+ - Task: [path or issue]
78
+ - Review: [path or PR review]
79
+ - Evidence: [path, commit, screenshot, workflow, or dashboard]
80
+ ```
@@ -10,10 +10,11 @@ Define repository-level rules for branches, commits, pull requests, ownership, g
10
10
  2. Use task-scoped branches and worktrees for non-trivial changes, especially when multiple workers are active.
11
11
  3. Keep commits focused on the requested scope and avoid mixing unrelated cleanup with feature work.
12
12
  4. Generated files, caches, build output, local runtime state, and secrets must be ignored or stored in the approved location.
13
- 5. Commit verified, meaningful slices proactively. Deferred commits require an explicit reason and owner.
14
- 6. Pull requests must describe intent, changed surfaces, checks run, checks not run, review status, and residual risk.
15
- 7. Required checks and material review findings block merge unless an approved exception is recorded.
16
- 8. Merge or release ownership must be explicit when several branches or workers contribute to the same outcome.
13
+ 5. Commit verified, meaningful slices proactively. Deferred commits require an explicit no-commit reason, owner, and next step.
14
+ 6. Do not mix unrelated dirty changes into a task commit. CLI-owned Harness writes should use the local Harness commands so their locked, allowlisted auto-commit can protect shared governance files.
15
+ 7. Pull requests must follow `docs/11-REFERENCE/pull-request-standard.md` and describe intent, changed surfaces, version impact, checks run, checks not run, review status, references, and residual risk.
16
+ 8. Required checks and material review findings block merge unless an approved exception is recorded.
17
+ 9. Merge or release ownership must be explicit when several branches or workers contribute to the same outcome.
17
18
 
18
19
  ## Required Checklist
19
20
 
@@ -21,8 +22,8 @@ Define repository-level rules for branches, commits, pull requests, ownership, g
21
22
  - Allowed and forbidden paths are respected.
22
23
  - Dirty worktree state was checked before edits.
23
24
  - Generated and private files are not accidentally staged.
24
- - Verified slices have commit SHAs, or deferred commit rationale is recorded.
25
- - PR summary includes evidence and residuals.
25
+ - Verified slices have commit SHAs, or deferred commit rationale records the no-commit reason, owner, and next step.
26
+ - PR summary follows `pull-request-standard.md` and includes evidence, version impact, references, and residuals.
26
27
  - Review findings are resolved or explicitly accepted.
27
28
  - Merge strategy and rollback or revert path are understood.
28
29
 
@@ -13,6 +13,12 @@ Define when work needs review, which reviewer identity is appropriate, and how r
13
13
  5. Reviewers must list `Evidence Checked`; unverified claims are questions, not conclusions.
14
14
  6. The implementation owner is responsible for reconciling conflicting reviewer feedback.
15
15
  7. Closeout must include the final review disposition and `Final Confidence Basis`.
16
+ 8. At task start, read the current task `execution_strategy.md` Subagent Authorization and Subagent Delegation Decision sections, then report the state and delegation choice; users do not need to know or ask for subagents.
17
+ 9. Reviewer subagents are allowed by default for read-only review within the current task.
18
+ 10. If a worker subagent would materially help and is not authorized, proactively ask the user once in plain language for task/scope/worktree authorization; it is fine to say "worker subagent", but do not wait for the user to know or suggest subagents.
19
+ 11. If independent slices are obvious but exact file paths are not, identify the file paths first and then immediately ask for independent-execution-helper authorization before implementation.
20
+ 12. Worker subagents require one user authorization recorded in `execution_strategy.md`; reuse is limited to the same task, scope, and worktree/branch.
21
+ 13. A `Would a worker subagent materially help?` decision of `ask-user` is a blocking gate until `User Authorization Decision` records `authorized`, `denied`, or `not-needed`.
16
22
 
17
23
  ## Required Checklist
18
24
 
@@ -10,7 +10,7 @@ Define the closeout walkthrough that converts implementation work into durable p
10
10
  2. A walkthrough must explain what changed, why it changed, how it was verified, what review found, and what residual risk remains.
11
11
  3. Do not paste large raw logs. Link to evidence files, commands, PRs, screenshots, or CI runs.
12
12
  4. Material findings and their resolution must be visible.
13
- 5. Lessons that change future behavior must first be routed through `lesson_candidates.md`; accepted candidates are then routed to the appropriate SSoT, reference standard, or Harness Ledger.
13
+ 5. Lessons that change future behavior must first be routed through `lesson_candidates.md`; candidates marked `needs-promotion` must link a task-local `lessons/LC-*.md` detail artifact before a follow-up task or promotion tries to preserve them.
14
14
  6. Walkthroughs must be written from the final integrated state, not from a single worker's partial view.
15
15
  7. If work is incomplete, the walkthrough must identify the next safe action and stop reason.
16
16
 
@@ -22,6 +22,7 @@ Define the closeout walkthrough that converts implementation work into durable p
22
22
  - Residual risk section.
23
23
  - Lesson or follow-up section.
24
24
  - Lesson candidate decision: `checked-candidate:<LC-ID>`, `queued-promotion:<LC-ID>`, `checked-created:<L-ID>`, or legacy `checked-none:<reason>`.
25
+ - Source lesson detail link for any queued or promoted candidate.
25
26
  - Links to updated SSoT, Regression SSoT, or Harness Ledger entries when applicable.
26
27
 
27
28
  ## Closeout Expectations
@@ -16,7 +16,7 @@
16
16
  | Tests and regression | yes / no | commands, CI runs, logs, screenshots |
17
17
  | SSoT and ledger updates | yes / no | Feature, Delivery, Regression, Closeout, or Harness Ledger links |
18
18
  | Review disposition | yes / no | review path, finding IDs, or no-finding statement |
19
- | Lessons and references | yes / no | Lessons SSoT, detail doc, or checked-none reason |
19
+ | Lessons and references | yes / no | lesson_candidates.md, detail doc, or checked-none reason |
20
20
 
21
21
  ## Explicit Exclusions
22
22
 
@@ -18,7 +18,7 @@
18
18
  3. 非平凡任务先在 `docs/09-PLANNING/TASKS/` 下建立任务目录。
19
19
  4. 声称完成前必须记录证据。
20
20
  5. 保护无关工作区改动,不回滚任务范围外文件。
21
- 6. 已验证的、有意义的工作切片要主动提交,除非用户明确说不要提交。
21
+ 6. 已验证的、有意义的工作切片要主动提交。除非用户明确暂停提交、检查失败、dirty 归属不清,或安全边界导致无法形成干净提交,否则不要把已完成工作只留在未提交文件里;不能提交时,必须在 progress、handoff 或 closeout 中写明 no-commit reason、owner 和下一步。不要把无关 dirty 改动混入本任务提交。
22
22
 
23
23
  ## 任务阅读矩阵
24
24
 
@@ -31,7 +31,7 @@
31
31
  | 本地开发、mock、stub、跨仓调试 | `docs/04-DEVELOPMENT/README.md`、`docs/04-DEVELOPMENT/codebase-map.md` |
32
32
  | API、event、webhook、SDK、第三方契约 | `docs/06-INTEGRATIONS/README.md` 和相关契约文件 |
33
33
  | 测试、冒烟、回归 | `docs/11-REFERENCE/testing-standard.md`、`docs/05-TEST-QA/Regression-SSoT.md` |
34
- | 开发执行、提交、PR、发布 | `docs/11-REFERENCE/execution-workflow-standard.md`、`docs/11-REFERENCE/repo-governance-standard.md`、`docs/11-REFERENCE/ci-cd-standard.md` |
34
+ | 开发执行、提交、PR、发布 | `docs/11-REFERENCE/execution-workflow-standard.md`、`docs/11-REFERENCE/repo-governance-standard.md`、`docs/11-REFERENCE/pull-request-standard.md`、`docs/11-REFERENCE/ci-cd-standard.md` |
35
35
  | 创建或推进任务 | `docs/09-PLANNING/TASKS/` 下的当前任务目录;如果本项目已配置 Harness CLI,优先用 CLI |
36
36
  | Brief、Execution Strategy、Visual Map | 当前任务的 `brief.md`、`execution_strategy.md`、`visual_map.md` |
37
37
  | 长程任务 | `docs/11-REFERENCE/long-running-task-standard.md` |
@@ -41,39 +41,43 @@
41
41
  | 文档治理或 Harness 更新 | `docs/11-REFERENCE/docs-library-standard.md`、`.harness-capabilities.json` |
42
42
  | 外部资料摄取 | `docs/11-REFERENCE/external-source-intake-standard.md` |
43
43
  | Regression SSoT 维护 | `docs/11-REFERENCE/regression-ssot-governance.md` |
44
- | 收口、walkthrough、Lessons | `docs/11-REFERENCE/walkthrough-standard.md`、`docs/10-WALKTHROUGH/Closeout-SSoT.md`、`docs/01-GOVERNANCE/Lessons-SSoT.md` |
44
+ | 收口、walkthrough、Lessons | `docs/11-REFERENCE/walkthrough-standard.md`、`docs/10-WALKTHROUGH/Closeout-SSoT.md`、当前任务 `lesson_candidates.md`、`docs/01-GOVERNANCE/lessons/` |
45
45
  | Worktree、并行开发隔离 | `docs/11-REFERENCE/worktree-standard.md` |
46
46
 
47
47
  ## 标准执行流程
48
48
 
49
49
  1. 先确认请求、范围和受影响文件。
50
50
  2. 非平凡任务先创建或更新任务计划,再改代码。
51
- 3. 只读取任务阅读矩阵要求的 reference 文档。
52
- 4. 保留已有项目事实;新增上下文使用 merge / append,不覆盖历史。
53
- 5. 需要隔离或并行时,使用独立 worktree 或分支。
54
- 6. 只在确认范围内实现。
55
- 7. 运行相关检查,并把证据写入任务记录。
56
- 8. 按需触发 review,关闭阻塞发现。
57
- 9. 写入或更新 walkthrough 与 closeout 记录。
58
- 10. 只更新本任务实际触达的 SSoT / ledger。
51
+ 3. 根据用户目标主动判断是否需要分工;用户不需要知道或主动要求 subagent。
52
+ 4. 只读取任务阅读矩阵要求的 reference 文档。
53
+ 5. 保留已有项目事实;新增上下文使用 merge / append,不覆盖历史。
54
+ 6. 需要隔离或并行时,使用独立 worktree 或分支。
55
+ 7. 只在确认范围内实现。
56
+ 8. 运行相关检查,并把证据写入任务记录。
57
+ 9. 按需触发 review,关闭阻塞发现。
58
+ 10. 写入或更新 walkthrough closeout 记录。
59
+ 11. 只更新本任务实际触达的 SSoT / ledger;任务生命周期总账优先由 Harness CLI 生成,不手写任务行。
59
60
 
60
61
  ## 协作规则
61
62
 
62
- - reviewer 默认只读,除非明确分配写入范围。
63
- - worker 只能编辑分配给自己的分支、worktree 和文件范围。
63
+ - 任务开始时,先读取当前任务 `execution_strategy.md` 的 Subagent Authorization 和 Subagent Delegation Decision,并说明是否应该使用 reviewer 或 worker subagent;即使用户只说目标,也要主动判断。
64
+ - reviewer subagent 默认允许,只能做当前任务的只读审查。
65
+ - 如果 worker subagent 对任务有明显帮助但尚未授权,用白话主动向用户申请一次 task/scope/worktree 授权;可以直接说 worker subagent,但不要等用户知道或主动提醒你用 subagent。
66
+ - 如果独立切片已经明显但精确文件路径还不清楚,先确认文件路径,然后在 implementation 前立刻申请独立执行助手授权。
67
+ - worker subagent 需要用户授权一次,并记录到 `execution_strategy.md`;之后只可在同一任务、同一范围、同一 worktree/branch 内复用。
64
68
  - 共享 ledger、registry 和 SSoT 默认由 coordinator 维护,除非明确登记锁。
65
69
  - worker 交接必须包含分支或 worktree、改动文件、检查、证据和残余风险。
66
70
 
67
71
  ## 单一事实源
68
72
 
69
- - Feature SSoT:`docs/09-PLANNING/Feature-SSoT.md`
73
+ - Harness Ledger:`docs/Harness-Ledger.md`(任务生命周期总账,由 CLI 生成)
70
74
  - Delivery SSoT:`docs/09-PLANNING/Delivery-SSoT.md`
71
75
  - Module Registry:`docs/09-PLANNING/Module-Registry.md`
72
76
  - Regression SSoT:`docs/05-TEST-QA/Regression-SSoT.md`
73
77
  - Cadence Ledger:`docs/05-TEST-QA/Cadence-Ledger.md`
74
- - Lessons SSoT:`docs/01-GOVERNANCE/Lessons-SSoT.md`
78
+ - Lesson Candidates:当前任务 `lesson_candidates.md`
79
+ - Lesson Detail Docs:`docs/01-GOVERNANCE/lessons/`
75
80
  - Closeout SSoT:`docs/10-WALKTHROUGH/Closeout-SSoT.md`
76
- - Harness Ledger:`docs/Harness-Ledger.md`
77
81
 
78
82
  ## 本地命令
79
83
 
@@ -1,50 +1,27 @@
1
- # 项目 Harness 总账 - [项目名称]
1
+ # 项目总账
2
2
 
3
- > 本文件记录非平凡任务是否完成了必要的 harness 上下文回写。它不是变更日志,也不替代 Feature SSoT、Regression SSoT、Lessons SSoT 或 walkthrough。
3
+ ## 用途
4
4
 
5
- ## 使用约定
5
+ 本文件是自动生成的任务生命周期总索引。人类查看当前状态应优先使用 Dashboard;Agent 快速检索应使用 `task-list`、`task-index` 或这张 generated ledger。
6
6
 
7
- - 开始任务时,为需要跨文件、跨模块、跨会话或影响发布质量的工作创建一行。
8
- - 收口任务时,更新任务计划、审查、回归、walkthrough、Lessons 检查和残余路由。
9
- - 不把聊天记录当证据;证据必须指向文件、命令输出、测试报告、PR、commit 或运行时验证记录。
10
- - 其他 worker 同时工作时,只更新自己负责的行;共享行由协调者或明确负责人更新。
7
+ 本文件不是手写工作日志。不要手工编辑生命周期行。需要改变事实时,更新任务本地文件(`task_plan.md`、`progress.md`、`review.md`、`lesson_candidates.md`、closeout / walkthrough 证据),然后运行 `harness governance rebuild --archive --apply`。
11
8
 
12
- ## 活跃任务
9
+ Repo Governance / CI-CD 变化仍通过对应 reference 和任务证据路由。Regression gate、交付顺序、回归节奏、closeout 合同和模块所有权继续保留在各自治理文件中,除非未来提供等价的 scanner-supported fact。
13
10
 
14
- | Harness ID | 日期 | 任务 | 负责人 | 任务计划 | 审查 | 回归 | Walkthrough / Closeout | Lessons 检查 | 证据 | 残余路由 | 状态 |
15
- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
16
- | HL-YYYY-MM-DD-001 | YYYY-MM-DD | [任务名称] | [负责人] | `docs/09-PLANNING/TASKS/[task]/task_plan.md` | `review.md` / `n/a` | `Regression-SSoT: RG-...` / `n/a` | `docs/10-WALKTHROUGH/[file].md` / 允许的跳过原因 | `checked-created: L-YYYY-MM-DD-001` / `checked-none: [原因]` | [测试、命令、PR、commit 或运行时证据] | `none` / [负责人 + 路径] | [open / closed / blocked] |
17
-
18
- ## 归档索引
19
-
20
- > 活跃表超过 50 行,或一次 release / wave 完成后,将 `closed`、`closed-with-residual`、`closed-local-only`、`superseded` 条目移入季度归档:`docs/01-GOVERNANCE/_archive/Harness-Ledger-archive-YYYY-QN.md`。
11
+ ## 活跃总表
21
12
 
22
- | 归档文件 | 覆盖范围 | 移入日期 | 说明 |
23
- | --- | --- | --- | --- |
24
- | `docs/01-GOVERNANCE/_archive/Harness-Ledger-archive-YYYY-QN.md` | HL-... HL-... | YYYY-MM-DD | [说明] |
25
-
26
- ## 状态说明
27
-
28
- - `open`:任务仍在进行,当前行可以继续更新。
29
- - `blocked`:任务或上下文回写被阻塞,必须在“残余路由”写清负责人、下一步和证据。
30
- - `closed`:任务完成,所需上下文和证据已回写,无未路由残余。
31
- - `closed-with-residual`:任务完成,但仍有已接受或已路由的残余。
32
- - `closed-local-only`:本地工作完成但尚未合并、发布或上线;必须写清后续负责人。
33
- - `superseded`:本行被后续 Harness ID 取代,必须指向新行。
13
+ | ID | Scope | Module | Task | State | Queues | Plan | Review | Lessons Check | Closeout | Residual | Updated |
14
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
15
+ | HL-YYYY-MM-DD-001 | task | none | 短任务标题 | planned | none | docs/09-PLANNING/TASKS/.../task_plan.md | pending | pending | pending | none | YYYY-MM-DD |
34
16
 
35
- ## 字段取值
17
+ ## 字段规则
36
18
 
37
- - `任务计划`:填任务计划路径;轻量任务可写 `n/a: [原因]`。
38
- - `审查`:填审查文件、PR review、人工确认,或 `n/a: [原因]`。
39
- - `回归`:填触发的 Regression Gate、Cadence Ledger 批次,或 `n/a: [原因]`。
40
- - `Walkthrough / Closeout`:已关闭任务必须对应 `Closeout-SSoT.md` 行;实现类任务应写 walkthrough。
41
- - `Lessons 检查`:只能写 `checked-created: L-YYYY-MM-DD-NNN` 或 `checked-none: [一句话原因]`。
42
- - `残余路由`:无残余写 `none`;否则写负责人、目标文件或任务、预期处理时间。
19
+ - `Scope`:根 planning 任务为 `task`,模块内任务为 `module`。
20
+ - `Module`:模块 key;非模块任务写 `none`。
21
+ - `Queues`:scanner 派生的生命周期队列;用 `harness task-list --queue` 查询。
22
+ - `Review`、`Lessons Check`、`Closeout`、`Residual`:scanner 派生摘要和路由;详细证据留在任务本地文件。
23
+ - `Updated`:生成日期,不是人工编辑时间。
43
24
 
44
- ## 路由规则
25
+ ## 旧表
45
26
 
46
- 1. 功能进度写入 Feature SSoT,不在本表展开。
47
- 2. 回归覆盖面、证据深度和失败项写入 Regression SSoT / Cadence Ledger。
48
- 3. 复用性流程经验写入 Lessons SSoT,并创建 lesson 详情文档。
49
- 4. 收口证据写入 `docs/10-WALKTHROUGH/Closeout-SSoT.md`。
50
- 5. 任意 `closed`、`closed-with-residual`、`closed-local-only` 行都必须能从本表追溯到任务计划、证据和 closeout。
27
+ `Feature-SSoT.md` `Private-Feature-SSoT.md` 是旧任务生命周期投影。当前 Harness 版本在 `harness governance rebuild --archive --apply` 时归档它们,不再重新生成。
@@ -1,5 +1,35 @@
1
1
  # 执行策略
2
2
 
3
+ ## Subagent Authorization
4
+
5
+ 任务开始时先读这一段,并向用户说明当前授权状态。这里是授权记录,不是执行沙箱。
6
+
7
+ | Role | Status | Permission | Authorized By | Authorized At | Scope | Worktree / Branch | Reuse |
8
+ | --- | --- | --- | --- | --- | --- | --- | --- |
9
+ | reviewer subagent | allowed by default | read-only | harness task policy | task creation | current task review | n/a | allowed within this task |
10
+ | worker subagent | not authorized | write only after user approval | pending | pending | pending | pending | allowed only within approved task/scope |
11
+
12
+ ## Subagent Delegation Decision
13
+
14
+ 任务开始时,coordinator 必须根据用户目标主动做这个判断,即使用户完全没有提到 subagent。
15
+ 不要假设用户知道 subagent 或 worker 是什么。如果分工有帮助,用白话说明收益,并向用户申请一次授权。
16
+ 可以直接对用户说 subagent 或 worker subagent;关键规则是 agent 不能等用户主动提出 subagent。
17
+ 如果任务已经明显拆成互不重叠的独立切片,implementation 前就应判断为 `ask-user`。如果还不知道精确文件路径,先确认路径,然后立刻申请独立执行助手授权。
18
+
19
+ | Question | Decision | Reason | Next Action |
20
+ | --- | --- | --- | --- |
21
+ | Should a reviewer subagent be used? | yes / no | [为什么需要或不需要 reviewer] | 如果 yes,直接调用只读 reviewer,不需要额外申请。 |
22
+ | Would a worker subagent materially help? | no / ask-user / already-authorized | [并行切片、独立实现、专项调查,或说明为什么不需要] | 如果 ask-user,直接问:“这个任务适合拆给 worker subagent 并行处理。是否授权我派一个 worker subagent,只修改 [scope],只在 [worktree/branch] 内执行,我负责协调和最终审查?” |
23
+
24
+ ## User Authorization Decision
25
+
26
+ 如果上方 worker 决策是 `ask-user`,implementation 必须暂停,直到这里记录用户答案。
27
+ 已解决状态只能是 `authorized`、`denied` 或 `not-needed`。选择 `ask-user` 后不得继续保持 `pending`。
28
+
29
+ | Gate | State | Decided By | Decided At | Scope | Worktree / Branch | Notes |
30
+ | --- | --- | --- | --- | --- | --- | --- |
31
+ | worker subagent | pending | pending | pending | pending | pending | 只有直接问过用户后才能填写。 |
32
+
3
33
  ## 决策表
4
34
 
5
35
  | 决策 | 选择 | 说明 |
@@ -1,6 +1,6 @@
1
1
  # {{TASK_TITLE}} - 教训候选
2
2
 
3
- 本文件是任务本地 lesson candidate queue。它不是 Lessons SSoT;只有人工审查确认值得沉淀后,才进入治理 promotion。
3
+ 本文件是任务本地 lesson candidate queue。人工审查需要决定候选是留在任务内、拒绝、进入 dry-run promotion、创建 promoted lesson 详情文档,还是创建单独的沉淀任务。
4
4
 
5
5
  ## Candidate Status
6
6
 
@@ -24,14 +24,14 @@
24
24
  - `pending-review`:候选文件存在,但人工判定还没完成。
25
25
  - `no-candidate-accepted`:人工接受本任务没有可复用候选的理由。
26
26
  - `needs-promotion`:至少一个候选已排队等待治理沉淀。
27
- - `promoted`:所有接受的候选都已写入 Lessons SSoT。
27
+ - `promoted`:所有接受的候选都已写入已确认的治理目标。
28
28
  - `rejected`:所有候选都已带理由拒绝或归档。
29
29
 
30
30
  允许的行级状态:
31
31
 
32
32
  - `ready-for-review`:agent 认为这个候选可能有复用价值。
33
- - `needs-promotion`:人工标记这个候选值得沉淀。
34
- - `promoted`:维护 CLI 已把候选写入 Lessons SSoT。
33
+ - `needs-promotion`:人工标记这个候选值得通过 dry-run promotion 或后续沉淀任务保留。
34
+ - `promoted`:维护 CLI 或已批准的后续任务已把候选写入确认的治理目标。
35
35
  - `rejected`:人工带理由拒绝这个候选。
36
36
 
37
37
  聚合规则:
@@ -44,8 +44,8 @@
44
44
 
45
45
  ## Candidates
46
46
 
47
- | ID | Row Status | Title | Why It Might Matter | Review Decision | Promotion Target |
48
- | --- | --- | --- | --- | --- | --- |
47
+ | ID | Row Status | Title | Scope | Module Key | Detail Artifact | Boundary Reason | Why It Might Matter | Review Decision | Promotion Target | Conflict Check | Required Standard Update | Follow-up Task |
48
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
49
49
 
50
50
  ## No-Candidate Reason
51
51
 
@@ -54,5 +54,17 @@
54
54
  ## Promotion Notes
55
55
 
56
56
  - 如果人工审查认为候选值得沉淀,把对应行标记为 `needs-promotion`,并记录目标治理位置。
57
+ - 候选标记为 `needs-promotion` 时,必须趁源任务上下文还新鲜写出完整 task-local detail artifact,并在 `Detail Artifact` 中链接。
58
+ - `Scope` 使用 `task`、`module` 或 `global`;module 级候选必须填写 `Module Key`。
57
59
  - 如果人工审查拒绝候选,把对应行标记为 `rejected`,并在 review decision 中保留理由。
58
60
  - `needs-promotion` 不阻止任务 closeout,但必须继续出现在维护队列和收口记录里。
61
+ - 默认 promotion 行为是先 dry-run 或创建后续沉淀任务。不要写共享 Lessons 表;被接受的候选应成为 promoted lesson 详情文档。
62
+ - 沉淀任务必须先分类 scope、检查既有 lessons 和 standards 冲突、提出目标改动,并在 apply 前报告验证证据。
63
+
64
+ ## Queue Routing
65
+
66
+ | Queue | When this task enters it | Exit condition |
67
+ | --- | --- | --- |
68
+ | Lessons | 任意候选是 `ready-for-review` 或 `needs-promotion`。 | 人工拒绝、保留在任务内、创建沉淀任务或批准 promotion。 |
69
+ | Missing Materials | 文件缺失、状态非法,或缺少必需的 no-candidate reason。 | Agent 修复候选文件。 |
70
+ | Confirmed / Finalized | 已人工确认,但候选仍有延后的治理事项。 | 记录后续任务或 dry-run 决策。 |
@@ -13,6 +13,35 @@
13
13
  - 范围外:[明确不审查的内容;如无写“无”]
14
14
  - 来源材料:[task plan、diff、commit、PR、测试输出、运行证据]
15
15
 
16
+ ## Agent Review Submission(Agent 提交审查)
17
+
18
+ 本节由 agent 或 coordinator 在审查材料包准备好时填写。它只表示“提交待审”,不表示人工批准。
19
+
20
+ | Field | Value |
21
+ | --- | --- |
22
+ | Submission ID | [由 task-review 生成] |
23
+ | Submitted At | [timestamp] |
24
+ | Submitted By | [agent 或 coordinator 身份] |
25
+ | Task Key | {{TASK_ID}} |
26
+ | Materials Checklist Hash | [由 task-review 生成;只作信息记录,不作为手工门禁] |
27
+ | Evidence Summary | [测试、diff、运行和审查材料证据] |
28
+ | Open Findings Count | [数字] |
29
+ | Scanner Version | [生成时的 scanner 版本] |
30
+
31
+ ### Material Checklist(材料清单)
32
+
33
+ | Material | Required? | Status | Evidence |
34
+ | --- | --- | --- | --- |
35
+ | Brief | yes / no | present / missing / incomplete | [路径或原因] |
36
+ | Task plan | yes / no | present / missing / incomplete | [路径或原因] |
37
+ | Progress and evidence | yes / no | present / missing / incomplete | [路径或原因] |
38
+ | Visual map | yes / no | present / missing / incomplete | [路径或原因] |
39
+ | Lesson candidate decision | yes / no | present / missing / incomplete | [路径或原因] |
40
+ | Walkthrough or closeout link | yes / no | present / missing / incomplete | [路径或原因] |
41
+
42
+ Scanner 会根据必需文件、章节、证据和这个严格提交块派生 `materialsReady`。如果材料未齐,任务应进入缺材料队列,而不是人工审查确认队列。
43
+ 如果存在开放的 P0/P1/P2 阻塞发现,任务应进入阻塞队列,而不是人工审查确认队列。
44
+
16
45
  ## 信心挑战(Confidence Challenge)
17
46
 
18
47
  直接回答:你是否对当前计划、实现和策略有 100% 信心?
@@ -49,19 +78,48 @@
49
78
 
50
79
  [如果没有重要发现,明确写:本轮已检查上述证据,未发现阻塞目标的重要发现。]
51
80
 
81
+ ## Human Review Confirmation(人工审查确认)
82
+
83
+ 本节只能由人工 reviewer,或代表明确人工确认的命令 / workbench 动作填写。Agent 提交审查、自查、subagent 审查都不能满足这个门禁。
84
+
85
+ | Field | Value |
86
+ | --- | --- |
87
+ | Confirmation ID | [由 review-confirm 生成] |
88
+ | Confirmed At | [timestamp] |
89
+ | Reviewer | [人工 reviewer 姓名] |
90
+ | Reviewer Email | [邮箱,如可用] |
91
+ | Task Key | {{TASK_ID}} |
92
+ | Confirm Text | [必须匹配任务 ID 或命令要求的确认短语] |
93
+ | Evidence Checked | [review packet / tests / diff 摘要] |
94
+ | Commit SHA | [由 review-confirm 生成的确认提交 SHA] |
95
+ | Audit Status | committed / blocked |
96
+
97
+ 任务仍属于缺材料、阻塞或 Lessons 路由时,不要填写本节。`review-confirm` 与 Dashboard Workbench 必须在 Git dirty、提交身份缺失、hook 失败,或写入超出当前任务 `review.md` / `progress.md` 白名单时拒绝确认。
98
+
52
99
  ## 残余风险
53
100
 
54
101
  | Risk | Owner | Accepted? | Follow-up |
55
102
  | --- | --- | --- | --- |
56
103
  | [风险] | [负责人] | yes / no | [后续路径或“无”] |
57
104
 
105
+ ## Lifecycle Queue Routing(生命周期队列路由)
106
+
107
+ | Queue | Applies? | Reason | Exit condition |
108
+ | --- | --- | --- | --- |
109
+ | Review | yes / no | 已提交审查材料包,且可等待人工确认。 | 人工确认或退回。 |
110
+ | Missing Materials | yes / no | 必需文件、章节、证据或 review submission 缺失 / 不完整。 | Agent 补齐材料并重新提交审查。 |
111
+ | Blocked | yes / no | 存在 open blocking finding、非法状态转换、审计失败或需要人工 waiver。 | blocker 被修复、关闭或明确豁免。 |
112
+ | Lessons | yes / no | Lesson candidate 需要拒绝、留在任务内、dry-run promotion 或创建沉淀任务。 | 人工决定候选路由;除非明确批准,promotion 仍是单独维护任务。 |
113
+ | Confirmed / Finalized | yes / no | 已有人工确认;可能仍待结项或治理收口。 | Closeout、ledger 和 lesson routing 都完成。 |
114
+ | Soft-deleted / Superseded | yes / no | 任务有 tombstone、superseded-by、archive、duplicate 或 abandoned 状态。 | reopen 或作为只读审计历史保留。 |
115
+
58
116
  ## 后续路由(Follow-Up Routing)
59
117
 
60
118
  - 任务计划:[是否需要更新,路径或“无”]
61
119
  - Progress:[对应 `progress.md` 条目]
62
120
  - 发现记录:[是否需要写入 `findings.md`]
63
121
  - Regression SSoT:[新增 / 调整 / 无]
64
- - Lessons SSoT:[checked-created: L-YYYY-MM-DD-NNN / checked-none: 一句话原因]
122
+ - Lessons:[checked-created: L-YYYY-MM-DD-NNN / checked-candidate: LC-YYYYMMDD-NNN / queued-promotion: LC-YYYYMMDD-NNN / checked-none: 一句话原因]
65
123
  - 收口记录:[收口时引用路径]
66
124
 
67
125
  ## 最终信心依据(Final Confidence Basis)
@@ -17,13 +17,14 @@ Task Contract: harness-task/v1
17
17
  | 预算 | 适用场景 | 必需结构 |
18
18
  | --- | --- | --- |
19
19
  | simple | 单 owner、无 subagent、证据深度为 L0/L1、不需要正式 review gate | `brief.md`、`task_plan.md`、`visual_map.md`、`progress.md` |
20
- | standard | 常规功能、修复或文档改动 | 完整任务文件:计划、策略、图谱、进度、发现和按需审查 |
21
- | complex | 需要 L2/L3 证据、subagent/reviewer、外部参考、生成产物,或超过 5 个切片 | 完整任务文件,并只启用实际需要的可选索引 |
20
+ | standard | 常规功能、修复或文档改动 | `brief.md`、`task_plan.md`、`execution_strategy.md`、`visual_map.md`、`findings.md`、`lesson_candidates.md`、`progress.md`、`review.md` |
21
+ | complex | 需要 L2/L3 证据、subagent/reviewer、外部参考、生成产物,或超过 5 个切片 | standard 文件,并额外创建 `references/INDEX.md` 与 `artifacts/INDEX.md` |
22
22
 
23
23
  选择预算:{{TASK_BUDGET}}
24
24
 
25
25
  可选子目录按触发条件创建,不作为默认脚手架:
26
26
 
27
+ - `lessons/LC-*.md`:进入 `needs-promotion` 的 lesson candidate 的任务本地详情文件。
27
28
  - `references/INDEX.md`:任务本地资料、外部链接、reviewer 输入包、跨仓上下文。
28
29
  - `artifacts/INDEX.md`:命令输出、截图、fixture、生成报告、审查记录等证据。
29
30
  - `slices/<slice-id>/`:多切片任务。每个切片使用 `brief.md`、`evidence.md`、`review.md`。
@@ -45,14 +46,34 @@ Task Contract: harness-task/v1
45
46
 
46
47
  ## 执行与可视化文件
47
48
 
49
+ 不要手工复制本模板来创建任务目录。必须使用 `harness new-task`,让所选预算自动
50
+ 创建正确文件集,并让 `harness check` 能按同一契约校验。
51
+
48
52
  `execution_strategy.md` 和 `visual_map.md` 是本任务的同级合同文件,不嵌入 `task_plan.md`。这样 dashboard 和 checker 可以稳定读取。
49
53
 
50
- | 合同文件 | 是否必需 | 用途 |
51
- | --- | --- | --- |
52
- | `execution_strategy.md` | yes | 执行模式、subagent 使用、冲突控制、证据深度、交接规则 |
53
- | `visual_map.md` | yes | 图表集合:阶段图、可选架构/时序/数据流/状态图、完成度、证据状态、阻塞风险 |
54
- | `lesson_candidates.md` | standard/complex 必需 | 任务本地教训候选队列。人工审查确认前必须接受无候选、拒绝候选,或排队 promotion |
55
- | `review.md` | 按需 | 对抗性审查、release review、外部 reviewer 结论 |
54
+ | 预算 | 必需文件 |
55
+ | --- | --- |
56
+ | simple | `brief.md`、`task_plan.md`、`visual_map.md`、`progress.md` |
57
+ | standard | simple 文件,加 `execution_strategy.md`、`findings.md`、`lesson_candidates.md`、`review.md` |
58
+ | complex | standard 文件,加 `references/INDEX.md`、`artifacts/INDEX.md` |
59
+ | long-running 附加项 | 选择 `--long-running` 时额外创建 `long-running-task-contract.md` |
60
+
61
+ 文件职责:
62
+
63
+ | 合同文件 | 用途 |
64
+ | --- | --- |
65
+ | `brief.md` | 面向人和下一轮 agent 的任务摘要与上下文包 |
66
+ | `task_plan.md` | 目标、范围、预算、验收与执行决策 |
67
+ | `execution_strategy.md` | 执行模式、subagent 使用、冲突控制、证据深度、交接规则 |
68
+ | `visual_map.md` | 图表集合:阶段图、可选架构/时序/数据流/状态图、完成度、证据状态、阻塞风险 |
69
+ | `progress.md` | 执行日志、决策和交接 |
70
+ | `findings.md` | 发现、研究记录和未解决风险 |
71
+ | `lesson_candidates.md` | 任务本地教训候选队列。人工审查确认前必须接受无候选、拒绝候选,或排队 promotion |
72
+ | `lessons/LC-*.md` | 可选的任务本地 lesson 详情文件,趁源任务上下文还新鲜写出,并由 `Detail Artifact` 链接 |
73
+ | `review.md` | Agent Review Submission、对抗性审查、release review、外部 reviewer 结论 |
74
+ | `references/INDEX.md` | complex 任务的资料包和参考索引 |
75
+ | `artifacts/INDEX.md` | complex 任务的生成证据和产物索引 |
76
+ | `long-running-task-contract.md` | 连续执行权限、循环规则和停止条件 |
56
77
 
57
78
  旧任务可以保留历史嵌入式段落作为 fallback;新任务必须使用独立文件。
58
79
 
@@ -101,10 +122,9 @@ Task Contract: harness-task/v1
101
122
 
102
123
  ## 关联
103
124
 
104
- - 功能 SSoT 条目:[引用]
105
125
  - 相关 Regression Gate:[引用]
106
126
  - 审查报告:[路径 / 不适用]
107
- - Harness Ledger 条目:[完成时填写 / HL-...]
127
+ - Generated Ledger:由 lifecycle CLI / `harness governance rebuild` 重建
108
128
  - 前置任务:[引用;如无写“无”]
109
129
 
110
130
  ## 模块关联(启用模块并行时填写)
@@ -64,7 +64,7 @@ docs/09-PLANNING/TASKS/<YYYY-MM-DD-任务名>/review.md
64
64
  - `not-reproducible`
65
65
  - `out-of-scope`
66
66
 
67
- `accepted-risk` 必须写明为什么不阻塞本轮目标,并路由到 task、SSoT、Regression SSoT、Lessons SSoT 或后续 PR。
67
+ `accepted-risk` 必须写明为什么不阻塞本轮目标,并路由到 task、SSoT、Regression SSoT、lesson candidates/detail docs 或后续 PR。
68
68
 
69
69
  ## 无发现结论
70
70
 
@@ -9,7 +9,7 @@
9
9
  | 位置 | 职责 |
10
10
  | --- | --- |
11
11
  | `docs/Harness-Ledger.md` | 全局上下文维护总账,记录非平凡任务是否完成计划、审查、回归、Lessons 和收口回写。 |
12
- | `docs/01-GOVERNANCE/` | Lessons SSoT、经验详情、治理记录、归档。 |
12
+ | `docs/01-GOVERNANCE/` | promoted lesson 详情、治理记录、归档。 |
13
13
  | `docs/03-ARCHITECTURE/` | ADR、架构设计、接口决策、关键技术方案。 |
14
14
  | `docs/04-DEVELOPMENT/` | 本地开发、代码地图、外部服务开发上下文、mock/stub、跨仓调试。 |
15
15
  | `docs/05-TEST-QA/` | Regression SSoT、Cadence Ledger、测试策略和回归证据索引。 |
@@ -27,7 +27,8 @@
27
27
  5. 可写 worker 必须在自己的 worktree 内实现、验证、提交,并 handoff branch、commit SHA、checks、residual。
28
28
  6. 遇到共享文件冲突,由 coordinator 或人工决定串行顺序。
29
29
  7. 遇到目标失效、权限阻塞、高风险决策或 stop condition 不适用,立即暂停并记录。
30
- 8. 主动提交已验证的、有意义的中间成果;commit message 应说明变更类型和范围。除非用户明确要求暂不提交,或检查失败 / diff 归属不清,否则不要把已完成切片长期留在未提交状态。
30
+ 8. 主动提交已验证的、有意义的中间成果;commit message 应说明变更类型和范围。除非用户明确要求暂不提交、检查失败、dirty 归属不清,或安全边界阻止干净提交,否则不要把已完成切片长期留在未提交状态;延期提交必须写明 no-commit reason、owner 和下一步。
31
+ 9. 机械化 Harness 写入优先使用 CLI lifecycle 命令。CLI-owned 写入会加锁、限制 allowlist 并自动提交,也会拒绝 dirty Git 状态;agent-owned 手工编辑仍需要明确任务提交或延期提交理由。
31
32
 
32
33
  ## 完成任务后
33
34
 
@@ -38,7 +39,7 @@
38
39
  5. 确认 `review.md` 没有 open P0/P1 finding;material P2 已修复或写为 `accepted-risk` 并路由。
39
40
  6. planned task 必须完成 closeout review,或写明 `skipped-with-reason`。
40
41
  7. 写 walkthrough,引用 task plan、review、证据、residual、Regression SSoT 和 commit。
41
- 8. 执行 Lessons 检查:新任务默认先写 `lesson_candidates.md` 并交给人工审查;人工标记后可记录 `queued-promotion`,再由维护命令写 lesson 详情并更新 Lessons SSoT。没有可复用候选时记录 `no-candidate-accepted`;旧任务兼容可记录 `checked-none: <reason>`。
42
+ 8. 执行 Lessons 检查:新任务默认先写 `lesson_candidates.md` 并交给人工审查;人工标记后可记录 `queued-promotion`,再由维护命令写 promoted lesson 详情文档。没有可复用候选时记录 `no-candidate-accepted`;旧任务兼容可记录 `checked-none: <reason>`。
42
43
  9. 最后更新 Harness Ledger,因为它记录本轮上下文维护的最终状态。
43
44
  10. 完成 commit / PR / release note,并确认本任务工作区没有未解释的遗留改动。
44
45
  11. 如使用 worker,coordinator 集成 worker commit 后运行最终 gates,并记录 integration evidence。
@@ -75,7 +76,7 @@ PR 描述必须包含:
75
76
 
76
77
  - 每个已验证的、有意义的切片默认都要提交。
77
78
  - 提交前只 stage 本任务范围内文件,不能顺手带入无关 dirty 文件、私有文件或生成产物。
78
- - 如果用户明确说不要提交、检查失败、或 diff 归属还没厘清,必须把未提交原因写入 `progress.md` 或交接说明。
79
+ - 如果用户明确说不要提交、检查失败、或 dirty 归属还没厘清,必须把 no-commit reason、owner 和下一步写入 `progress.md` 或交接说明。
79
80
  - closeout 时必须列出相关 commit SHA;如果没有 commit,必须说明为什么这是安全的例外。
80
81
 
81
82
  ## 禁止事项
@@ -8,7 +8,7 @@ Harness Ledger 是 `docs/` 骨架的全局上下文维护总账,固定位置
8
8
  docs/Harness-Ledger.md
9
9
  ```
10
10
 
11
- 它记录每个非平凡任务是否完成了 task plan、progress、review、功能 SSoT、Delivery SSoT、Regression SSoT、Lessons SSoT、walkthrough、Closeout SSoT、reference/template 和 CI/CD 治理回写。它不复制业务事实,只记录上下文维护是否合规。
11
+ 它记录每个非平凡任务是否完成了 task plan、progress、review、功能 SSoT、Delivery SSoT、Regression SSoT、lesson candidates/detail docs、walkthrough、Closeout SSoT、reference/template 和 CI/CD 治理回写。它不复制业务事实,只记录上下文维护是否合规。
12
12
 
13
13
  ## 必须更新的场景
14
14
 
@@ -17,7 +17,7 @@ docs/Harness-Ledger.md
17
17
  - 新增或修改 AGENTS.md、CLAUDE.md、reference、template、checker 或 dashboard。
18
18
  - coordinator pass 汇总模块任务、worker handoff、review、closeout 或 regression 结果。
19
19
  - 创建或更新 required review。
20
- - 修改功能 SSoT、Delivery SSoT、Regression SSoT、Lessons SSoT、Closeout SSoT 任一文件。
20
+ - 修改功能 SSoT、Delivery SSoT、Regression SSoT、lesson detail docs、Closeout SSoT 任一文件。
21
21
  - 创建 walkthrough 或接受受控跳过。
22
22
  - Lessons approved 后合入正式 reference。
23
23