coding-agent-harness 1.0.2 → 1.0.5

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 (219) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/CONTRIBUTING.md +98 -0
  3. package/LICENSE +661 -21
  4. package/LICENSE-EXCEPTION.md +37 -0
  5. package/README.md +244 -87
  6. package/README.zh-CN.md +77 -35
  7. package/SKILL.md +32 -24
  8. package/docs-release/README.md +9 -5
  9. package/docs-release/architecture/overview.md +17 -5
  10. package/docs-release/architecture/overview.zh-CN.md +9 -5
  11. package/docs-release/architecture/system-explainer/01-system-overview.md +217 -0
  12. package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
  13. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
  14. package/docs-release/architecture/system-explainer/04-check-and-governance.md +239 -0
  15. package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
  16. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +303 -0
  17. package/docs-release/architecture/system-explainer/README.md +67 -0
  18. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +226 -0
  19. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
  20. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
  21. package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +250 -0
  22. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
  23. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +323 -0
  24. package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
  25. package/docs-release/assets/dashboard-overview.png +0 -0
  26. package/docs-release/guides/agent-installation.en-US.md +39 -15
  27. package/docs-release/guides/agent-installation.md +43 -16
  28. package/docs-release/guides/contributing.md +100 -0
  29. package/docs-release/guides/contributing.zh-CN.md +99 -0
  30. package/docs-release/guides/document-audience-and-surfaces.en-US.md +3 -2
  31. package/docs-release/guides/document-audience-and-surfaces.md +3 -2
  32. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +2 -2
  33. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +2 -2
  34. package/docs-release/guides/legacy-migration-agent-prompt.md +0 -11
  35. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +0 -11
  36. package/docs-release/guides/migration-playbook.en-US.md +14 -15
  37. package/docs-release/guides/migration-playbook.md +14 -15
  38. package/docs-release/guides/parent-control-repository-pattern.en-US.md +7 -5
  39. package/docs-release/guides/parent-control-repository-pattern.md +7 -5
  40. package/docs-release/guides/preset-development.md +238 -0
  41. package/docs-release/guides/repository-operating-models.en-US.md +5 -4
  42. package/docs-release/guides/repository-operating-models.md +5 -4
  43. package/docs-release/guides/task-state-machine.en-US.md +224 -0
  44. package/docs-release/guides/task-state-machine.md +231 -0
  45. package/docs-release/intl/en-US.md +1 -1
  46. package/docs-release/intl/zh-CN.md +1 -1
  47. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/INDEX.md +60 -0
  48. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
  49. package/package.json +10 -4
  50. package/presets/legacy-migration/checks/preset-check.mjs +3 -0
  51. package/presets/legacy-migration/preset.yaml +134 -0
  52. package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
  53. package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
  54. package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
  55. package/presets/legacy-migration/templates/findings.seed.md +17 -0
  56. package/presets/legacy-migration/templates/review.seed.md +12 -0
  57. package/presets/legacy-migration/templates/task_plan.append.md +9 -0
  58. package/presets/legacy-migration/templates/visual_map.append.md +12 -0
  59. package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
  60. package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
  61. package/presets/lesson-sedimentation/preset.yaml +23 -0
  62. package/presets/lesson-sedimentation/templates/prompt.md +23 -0
  63. package/presets/module/preset.yaml +25 -0
  64. package/presets/module/templates/execution_strategy.append.md +8 -0
  65. package/presets/module/templates/task_plan.append.md +17 -0
  66. package/presets/standard-task/preset.yaml +31 -0
  67. package/presets/standard-task/templates/task_plan.append.md +7 -0
  68. package/references/adversarial-review-standard.md +2 -2
  69. package/references/agents-md-pattern.md +2 -2
  70. package/references/delivery-operating-model-standard.md +3 -3
  71. package/references/docs-directory-standard.md +6 -7
  72. package/references/harness-ledger.md +53 -96
  73. package/references/lessons-governance.md +88 -93
  74. package/references/module-parallel-standard.md +14 -14
  75. package/references/planning-loop.md +12 -6
  76. package/references/pull-request-standard.md +118 -0
  77. package/references/repo-governance-standard.md +11 -2
  78. package/references/review-routing-standard.md +7 -1
  79. package/references/ssot-governance.md +67 -59
  80. package/references/taskr-gap-analysis.md +600 -0
  81. package/references/walkthrough-closeout.md +7 -7
  82. package/scripts/check-harness.mjs +40 -301
  83. package/scripts/commands/dashboard-command.mjs +67 -0
  84. package/scripts/commands/migration-command.mjs +126 -0
  85. package/scripts/commands/preset-command.mjs +73 -0
  86. package/scripts/commands/task-command.mjs +328 -0
  87. package/scripts/harness.mjs +59 -260
  88. package/scripts/lib/capability-registry.mjs +82 -28
  89. package/scripts/lib/check-module-parallel.mjs +230 -0
  90. package/scripts/lib/check-profiles.mjs +90 -228
  91. package/scripts/lib/check-task-contracts.mjs +55 -0
  92. package/scripts/lib/core-shared.mjs +65 -2
  93. package/scripts/lib/dashboard-data.mjs +155 -24
  94. package/scripts/lib/dashboard-workbench.mjs +131 -12
  95. package/scripts/lib/dashboard-writer.mjs +20 -4
  96. package/scripts/lib/git-status-summary.mjs +46 -0
  97. package/scripts/lib/governance-index-generator.mjs +174 -0
  98. package/scripts/lib/governance-sync.mjs +611 -0
  99. package/scripts/lib/governance-table-boundary.mjs +175 -0
  100. package/scripts/lib/harness-core.mjs +6 -0
  101. package/scripts/lib/lesson-maintenance.mjs +36 -29
  102. package/scripts/lib/markdown-utils.mjs +33 -0
  103. package/scripts/lib/migration-planner.mjs +4 -6
  104. package/scripts/lib/migration-support.mjs +1 -1
  105. package/scripts/lib/phase-kind.mjs +50 -0
  106. package/scripts/lib/preset-audit-contracts.mjs +37 -0
  107. package/scripts/lib/preset-engine.mjs +494 -0
  108. package/scripts/lib/preset-registry.mjs +776 -0
  109. package/scripts/lib/preset-resource-contracts.mjs +83 -0
  110. package/scripts/lib/review-confirm-git-gate.mjs +248 -0
  111. package/scripts/lib/status-builder.mjs +88 -0
  112. package/scripts/lib/status-dashboard-renderer.mjs +105 -0
  113. package/scripts/lib/subagent-authorization-audit.mjs +196 -0
  114. package/scripts/lib/task-audit-metadata.mjs +385 -0
  115. package/scripts/lib/task-audit-migration.mjs +350 -0
  116. package/scripts/lib/task-completion-consistency.mjs +26 -0
  117. package/scripts/lib/task-index.mjs +93 -0
  118. package/scripts/lib/task-lesson-candidates.mjs +242 -0
  119. package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
  120. package/scripts/lib/task-lifecycle/create-task-helpers.mjs +67 -0
  121. package/scripts/lib/task-lifecycle/phase-sync.mjs +88 -0
  122. package/scripts/lib/task-lifecycle/review-confirm.mjs +112 -0
  123. package/scripts/lib/task-lifecycle/review-gates.mjs +73 -0
  124. package/scripts/lib/task-lifecycle/review-submission.mjs +63 -0
  125. package/scripts/lib/task-lifecycle/scaffold-provenance.mjs +49 -0
  126. package/scripts/lib/task-lifecycle/template-files.mjs +53 -0
  127. package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
  128. package/scripts/lib/task-lifecycle.mjs +338 -477
  129. package/scripts/lib/task-metadata.mjs +118 -0
  130. package/scripts/lib/task-review-model.mjs +455 -0
  131. package/scripts/lib/task-scanner.mjs +193 -372
  132. package/scripts/lib/task-tombstone-commands.mjs +140 -0
  133. package/scripts/postinstall.mjs +14 -0
  134. package/skills/preset-creator/SKILL.md +179 -0
  135. package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
  136. package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
  137. package/skills/preset-creator/references/complex-task-skeleton/brief.md +43 -0
  138. package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
  139. package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
  140. package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
  141. package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
  142. package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
  143. package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
  144. package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
  145. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
  146. package/skills/preset-creator/references/complex-task-skeleton/visual_map.md +50 -0
  147. package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
  148. package/templates/AGENTS.md.template +24 -18
  149. package/templates/dashboard/assets/app-src/00-state.js +13 -0
  150. package/templates/dashboard/assets/app-src/10-router.js +5 -1
  151. package/templates/dashboard/assets/app-src/20-overview.js +18 -8
  152. package/templates/dashboard/assets/app-src/30-tasks.js +92 -246
  153. package/templates/dashboard/assets/app-src/35-task-detail.js +286 -0
  154. package/templates/dashboard/assets/app-src/45-review.js +241 -22
  155. package/templates/dashboard/assets/app-src/50-migration.js +24 -10
  156. package/templates/dashboard/assets/app-src/55-presets.js +375 -0
  157. package/templates/dashboard/assets/app-src/60-shared.js +3 -1
  158. package/templates/dashboard/assets/app-src/90-bindings.js +302 -29
  159. package/templates/dashboard/assets/app.css +1501 -376
  160. package/templates/dashboard/assets/app.css.manifest.json +10 -0
  161. package/templates/dashboard/assets/app.js +1240 -101
  162. package/templates/dashboard/assets/app.manifest.json +2 -0
  163. package/templates/dashboard/assets/css-src/00-foundation.css +346 -0
  164. package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
  165. package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
  166. package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
  167. package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
  168. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +489 -0
  169. package/templates/dashboard/assets/css-src/45-presets.css +516 -0
  170. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
  171. package/templates/dashboard/assets/i18n.js +263 -23
  172. package/templates/ledger/Harness-Ledger.md +13 -25
  173. package/templates/lessons/lesson-arch-process-change.md +1 -1
  174. package/templates/lessons/lesson-new-doc.md +1 -1
  175. package/templates/lessons/lesson-ref-change.md +1 -1
  176. package/templates/planning/INDEX.md +87 -0
  177. package/templates/planning/brief.md +1 -1
  178. package/templates/planning/execution_strategy.md +31 -0
  179. package/templates/planning/lesson_candidates.md +18 -6
  180. package/templates/planning/module_session_prompt.md +1 -0
  181. package/templates/planning/optional/artifacts/INDEX.md +3 -3
  182. package/templates/planning/optional/references/INDEX.md +3 -3
  183. package/templates/planning/review.md +41 -0
  184. package/templates/planning/task_plan.md +5 -21
  185. package/templates/planning/visual_map.md +13 -9
  186. package/templates/planning/visual_map.simple.md +52 -0
  187. package/templates/reference/execution-workflow-standard.md +31 -3
  188. package/templates/reference/pull-request-standard.md +80 -0
  189. package/templates/reference/repo-governance-standard.md +7 -6
  190. package/templates/reference/review-routing-standard.md +6 -0
  191. package/templates/reference/walkthrough-standard.md +2 -1
  192. package/templates/verifier/verifier-output.md +1 -1
  193. package/templates-zh-CN/AGENTS.md.template +25 -19
  194. package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
  195. package/templates-zh-CN/planning/INDEX.md +87 -0
  196. package/templates-zh-CN/planning/brief.md +1 -1
  197. package/templates-zh-CN/planning/execution_strategy.md +30 -0
  198. package/templates-zh-CN/planning/lesson_candidates.md +18 -6
  199. package/templates-zh-CN/planning/module_session_prompt.md +1 -0
  200. package/templates-zh-CN/planning/review.md +41 -1
  201. package/templates-zh-CN/planning/task_plan.md +4 -44
  202. package/templates-zh-CN/planning/visual_map.md +14 -7
  203. package/templates-zh-CN/planning/visual_map.simple.md +48 -0
  204. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  205. package/templates-zh-CN/reference/docs-library-standard.md +1 -1
  206. package/templates-zh-CN/reference/execution-workflow-standard.md +33 -7
  207. package/templates-zh-CN/reference/harness-ledger-standard.md +2 -2
  208. package/templates-zh-CN/reference/pull-request-standard.md +106 -0
  209. package/templates-zh-CN/reference/repo-governance-standard.md +4 -3
  210. package/templates-zh-CN/reference/review-routing-standard.md +8 -1
  211. package/templates-zh-CN/reference/walkthrough-standard.md +3 -2
  212. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +1 -1
  213. package/docs-release/assets/dashboard-overview-en.png +0 -0
  214. package/scripts/smoke-dashboard.mjs +0 -92
  215. package/scripts/test-harness.mjs +0 -1395
  216. package/templates/ssot/Feature-SSoT.md +0 -43
  217. package/templates/ssot/Lessons-SSoT.md +0 -44
  218. package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
  219. package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
@@ -1,6 +1,6 @@
1
1
  # {{TASK_TITLE}} - Lesson Candidates
2
2
 
3
- This file is the task-local lesson candidate queue. It is not the Lessons SSoT. Human review decides whether any candidate should move into governance promotion.
3
+ This file is the task-local lesson candidate queue. Human review decides whether any candidate should stay task-local, be rejected, enter dry-run promotion, become a promoted lesson detail doc, or become a separate sedimentation task.
4
4
 
5
5
  ## Candidate Status
6
6
 
@@ -24,14 +24,14 @@ Allowed task-level status:
24
24
  - `pending-review`: candidate file exists, but human decision is not complete.
25
25
  - `no-candidate-accepted`: human accepted the agent's no-candidate reason.
26
26
  - `needs-promotion`: at least one candidate is queued for governance promotion.
27
- - `promoted`: all accepted candidates were promoted to Lessons SSoT.
27
+ - `promoted`: all accepted candidates were promoted to the agreed governance target.
28
28
  - `rejected`: all candidates were rejected or archived with reasons.
29
29
 
30
30
  Allowed row status:
31
31
 
32
32
  - `ready-for-review`: agent believes this candidate may matter.
33
- - `needs-promotion`: human marked the candidate worth preserving.
34
- - `promoted`: maintenance CLI promoted the candidate to Lessons SSoT.
33
+ - `needs-promotion`: human marked the candidate worth preserving through dry-run promotion or a follow-up sedimentation task.
34
+ - `promoted`: maintenance CLI or an approved follow-up task promoted the candidate to the agreed governance target.
35
35
  - `rejected`: human rejected the candidate with a reason.
36
36
 
37
37
  Aggregation rule:
@@ -44,8 +44,8 @@ Aggregation rule:
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 @@ Not decided yet. Fill this only when review accepts that the task produced no re
54
54
  ## Promotion Notes
55
55
 
56
56
  - If human review decides a candidate is worth preserving, mark the row `needs-promotion` and record the target governance location.
57
+ - If a candidate is marked `needs-promotion`, write the full task-local detail artifact while the source task context is fresh, then link it in `Detail Artifact`.
58
+ - Use `Scope` values `task`, `module`, or `global`; module-scoped candidates must fill `Module Key`.
57
59
  - If human review rejects a candidate, mark the row `rejected` and keep the reason in the review decision.
58
60
  - `needs-promotion` does not block task closeout, but it must remain visible in the maintenance queue and closeout record.
61
+ - Default promotion behavior is dry-run or follow-up-task first. Do not write a shared Lessons table; accepted candidates become promoted lesson detail docs.
62
+ - A sedimentation task must classify scope, check conflicts against existing lessons and standards, propose the target change, and report verification before applying.
63
+
64
+ ## Queue Routing
65
+
66
+ | Queue | When this task enters it | Exit condition |
67
+ | --- | --- | --- |
68
+ | Lessons | Any candidate is `ready-for-review` or `needs-promotion`. | Human rejects it, keeps it task-local, creates a sedimentation task, or approves promotion. |
69
+ | Missing Materials | The file is absent, has invalid status, or lacks a required no-candidate reason. | Agent repairs the candidate file. |
70
+ | Confirmed / Finalized | Human review is confirmed but a candidate still has deferred governance work. | Follow-up task or dry-run decision is recorded. |
@@ -34,6 +34,7 @@ Do not edit shared SSoT files, coordinator-owned integration files, or unrelated
34
34
 
35
35
  - Keep `task.state`, `lifecycleState`, `reviewStatus`, and `closeoutStatus` separate when reporting progress.
36
36
  - `done` means the implementation step finished. It is not `closed` until closeout evidence is recorded.
37
+ - Use the current task `visual_map.md` phase table as the lifecycle map. At the end of a slice, inspect the current gate phase and follow its `Exit Command` only when its `Actor` is `agent`.
37
38
  - If review is required, update `review.md`. Human review completion must be confirmed through the local dashboard workbench or by the coordinator with `harness review-confirm`; do not mark it complete while open P0/P1/P2 findings remain.
38
39
 
39
40
  ## Shared Sync Rule
@@ -2,9 +2,9 @@
2
2
 
3
3
  Use this index for generated outputs that support the task but are not the source of truth.
4
4
 
5
- | Artifact | Purpose | Generated By | Keep? |
6
- | --- | --- | --- | --- |
7
- | [file] | [why it exists] | [command, tool, or agent] | yes / no |
5
+ | ID | Type | Path | Summary | Produced By |
6
+ | --- | --- | --- | --- | --- |
7
+ | [artifact-id] | command / diff / fixture / screenshot / review / report | TARGET:path or URL:https://example.com | [why it exists] | coordinator |
8
8
 
9
9
  ## Retention Notes
10
10
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  Use this index for sources the task depends on but does not own.
4
4
 
5
- | Reference | Type | Why It Matters | Source |
6
- | --- | --- | --- | --- |
7
- | [name] | doc / link / transcript / code | [why this source is relevant] | [path or URL] |
5
+ | ID | Type | Path | Summary | Used By |
6
+ | --- | --- | --- | --- | --- |
7
+ | [reference-id] | doc / link / transcript / code | TARGET:path or URL:https://example.com | [why this source is relevant] | coordinator |
8
8
 
9
9
  ## Source Rules
10
10
 
@@ -13,6 +13,36 @@
13
13
  - Out of scope: [explicit exclusions]
14
14
  - Source materials: [task plan, diff, test output, runtime evidence]
15
15
 
16
+ ## Agent Review Submission
17
+
18
+ This section is written by the agent or coordinator when the review packet is ready.
19
+ It is not human approval.
20
+
21
+ | Field | Value |
22
+ | --- | --- |
23
+ | Submission ID | [generated by task-review] |
24
+ | Submitted At | [timestamp] |
25
+ | Submitted By | [agent or coordinator identity] |
26
+ | Task Key | {{TASK_ID}} |
27
+ | Materials Checklist Hash | [generated by task-review; informational, not a manual gate] |
28
+ | Evidence Summary | [tests, diff, runtime, and review packet evidence] |
29
+ | Open Findings Count | [number] |
30
+ | Scanner Version | [generated scanner version] |
31
+
32
+ ### Material Checklist
33
+
34
+ | Material | Required? | Status | Evidence |
35
+ | --- | --- | --- | --- |
36
+ | Brief | yes / no | present / missing / incomplete | [path or reason] |
37
+ | Task plan | yes / no | present / missing / incomplete | [path or reason] |
38
+ | Progress and evidence | yes / no | present / missing / incomplete | [path or reason] |
39
+ | Visual map | yes / no | present / missing / incomplete | [path or reason] |
40
+ | Lesson candidate decision | yes / no | present / missing / incomplete | [path or reason] |
41
+ | Walkthrough or closeout link | yes / no | present / missing / incomplete | [path or reason] |
42
+
43
+ The scanner derives `materialsReady` from required files, sections, evidence, and this strict submission block. If materials are not ready, route the task to Missing Materials instead of Human Review Confirmation.
44
+ If there are open P0/P1/P2 blocking findings, route the task to Blocked instead of Human Review Confirmation.
45
+
16
46
  ## Confidence Challenge
17
47
 
18
48
  Answer directly: do you have 100% confidence in the plan, implementation, and strategy?
@@ -43,6 +73,17 @@ Do not keep sample findings. If there are no material findings, leave only the h
43
73
  | --- | --- | --- | --- |
44
74
  | [risk] | [owner] | yes / no | [path or next action] |
45
75
 
76
+ ## Lifecycle Queue Routing
77
+
78
+ | Queue | Applies? | Reason | Exit condition |
79
+ | --- | --- | --- | --- |
80
+ | Review | yes / no | Submitted review packet is ready for human confirmation. | Human confirms or returns it. |
81
+ | Missing Materials | yes / no | Required file, section, evidence, or review submission is absent/incomplete. | Agent repairs materials and resubmits review. |
82
+ | Blocked | yes / no | Open blocking finding, invalid state transition, failed audit, or human waiver needed. | Blocker is fixed, closed, or explicitly waived. |
83
+ | Lessons | yes / no | Lesson candidate needs rejection, task-local retention, dry-run promotion, or a sedimentation task. | Human decides candidate routing; promotion remains a separate maintenance task unless explicitly approved. |
84
+ | Confirmed / Finalized | yes / no | Human confirmation exists; closeout or governance work may still be pending. | Closeout, ledger, and lesson routing are complete. |
85
+ | Soft-deleted / Superseded | yes / no | Task has tombstone, superseded-by, archive, duplicate, or abandoned status. | Reopen or keep as read-only audit history. |
86
+
46
87
  ## Final Confidence Basis
47
88
 
48
89
  [Explain the final confidence basis after fixes and verification. If confidence is limited, name the remaining limits and who owns them.]
@@ -1,6 +1,7 @@
1
1
  # [Task Name]
2
2
 
3
3
  Task Contract: harness-task/v1
4
+ Task Package Index: required
4
5
 
5
6
  ## Goal
6
7
 
@@ -11,34 +12,18 @@ Task Contract: harness-task/v1
11
12
  - In scope: [specific files, modules, behavior, or docs]
12
13
  - Out of scope: [explicit exclusions]
13
14
 
14
- ## Task Budget
15
-
16
- | Budget | Use When | Required Structure |
17
- | --- | --- | --- |
18
- | simple | One owner, no subagent, L0/L1 evidence, no formal review gate | `brief.md`, `task_plan.md`, `visual_map.md`, `progress.md` |
19
- | standard | Normal feature, fix, or documentation change | Plan, strategy, roadmap, progress, findings, and review as needed |
20
- | complex | Multi-hour work, L2/L3 evidence, subagent/reviewer, or optional artifact/reference indexes | Standard files plus optional structures as needed |
15
+ ## Selected Budget
21
16
 
22
17
  Selected budget: {{TASK_BUDGET}}
23
18
 
19
+ Rationale: [why this budget fits this task]
20
+
24
21
  ## Context Packet
25
22
 
26
23
  | ID | Type | Path | Why It Matters | Used By |
27
24
  | --- | --- | --- | --- | --- |
28
25
  | C-001 | public-doc / private-plan / external / code | PUBLIC:path or PRIVATE:path or TARGET:path or URL:https://example.com | [why this source matters] | coordinator / reviewer / worker |
29
26
 
30
- ## Required Files
31
-
32
- | Contract File | Required | Purpose |
33
- | --- | --- | --- |
34
- | `execution_strategy.md` | yes | Operating model, allocation, conflict control, and evidence strategy |
35
- | `visual_map.md` | yes | Diagram collection: phase map, optional architecture/sequence/data-flow/state diagrams, completion state, evidence state, and blocking risk |
36
- | `progress.md` | yes | Execution log, decisions, and handoff |
37
- | `findings.md` | yes | Findings, research notes, and unresolved risks |
38
- | `lesson_candidates.md` | yes for standard/complex | Task-local lesson candidate queue. Human review must accept no-candidate, reject candidates, or queue promotion before review confirmation |
39
- | `review.md` | if needed | Adversarial or specialist review report |
40
- | `long-running-task-contract.md` | if needed | Continuous execution permission, loop rules, and stop conditions |
41
-
42
27
  ## Steps
43
28
 
44
29
  1. [First concrete step]
@@ -75,10 +60,9 @@ Selected budget: {{TASK_BUDGET}}
75
60
 
76
61
  ## Links
77
62
 
78
- - Feature SSoT entry: [reference]
79
63
  - Related Regression Gate: [reference]
80
64
  - Review Report: [path / n/a]
81
- - Harness Ledger entry: [complete at closeout]
65
+ - Generated Ledger: rebuilt by lifecycle CLI / `harness governance rebuild`
82
66
  - Prerequisite tasks: [reference or none]
83
67
 
84
68
  ## Coordinator Handoff
@@ -15,22 +15,26 @@ Include only diagrams that materially help a human or agent understand the task.
15
15
 
16
16
  ```mermaid
17
17
  flowchart LR
18
- PH01["PH-01 Plan"] --> PH02["PH-02 Implement"]
19
- PH02 --> PH03["PH-03 Verify"]
20
- PH03 --> PH04["PH-04 Review and Closeout"]
18
+ INIT01["INIT-01 Scope and Context\nkind=init"] --> EXEC01["EXEC-01 Implementation Slice\nkind=execution"]
19
+ EXEC01 --> GATE01["GATE-01 Agent Review Submission\nkind=gate"]
20
+ GATE01 --> GATE02["GATE-02 Human Review Confirmation\nkind=gate"]
21
21
  ```
22
22
 
23
23
  ## Phase Table
24
24
 
25
- | Phase ID | Depends On | State | Completion | Output | Required Evidence | Evidence Status | Blocking Risk | Owner / Handoff |
26
- | --- | --- | --- | ---: | --- | --- | --- | --- | --- |
27
- | PH-01 | none | planned | 0 | Approved task plan and execution strategy | `task_plan.md`, `execution_strategy.md` | missing | none | coordinator |
28
- | PH-02 | PH-01 | planned | 0 | Scoped implementation or document update | diff, worker handoff, or artifact path | missing | [risk] | [owner] |
29
- | PH-03 | PH-02 | planned | 0 | Verification evidence | commands, logs, screenshots, or runtime proof | missing | [risk] | [owner] |
30
- | PH-04 | PH-03 | planned | 0 | Review disposition and closeout updates | `review.md`, progress update, ledger updates | missing | [risk] | coordinator |
25
+ | Phase ID | Kind | Depends On | State | Completion | Output | Required Evidence | Exit Command | Actor | Evidence Status | Blocking Risk | Owner / Handoff |
26
+ | --- | --- | --- | --- | ---: | --- | --- | --- | --- | --- | --- | --- |
27
+ | INIT-01 | init | none | planned | 0 | Approved task plan and execution strategy | `task_plan.md`, `execution_strategy.md` | `harness task-start {{TASK_ID}}` | agent | missing | none | coordinator |
28
+ | EXEC-01 | execution | INIT-01 | planned | 0 | Scoped implementation, document update, and verification evidence | diff, commands, worker handoff, or artifact path | `harness task-phase {{TASK_ID}} EXEC-01 --state done --completion 100 --evidence present` | agent | missing | [risk] | [owner] |
29
+ | GATE-01 | gate | EXEC-01 | planned | 0 | Agent Review Submission | `review.md`, progress update, lesson routing | `harness task-review {{TASK_ID}} --message "<summary>"` | agent | missing | [risk] | coordinator |
30
+ | GATE-02 | gate | GATE-01 | planned | 0 | Human Review Confirmation | review packet and human confirmation | `harness review-confirm {{TASK_ID}} --confirm {{TASK_ID}}` | human | missing | agent must not perform human confirmation | human |
31
31
 
32
+ Allowed Kind: init, execution, gate.
33
+ Allowed Actor: agent, human, coordinator.
32
34
  Allowed Evidence Status: missing, partial, present, waived.
33
35
 
36
+ Dashboard implementation completion is computed from non-skipped `execution` phases only. `init` and `gate` phases route lifecycle readiness and next actions; they must not make implementation progress look incomplete.
37
+
34
38
  ## Supporting Maps
35
39
 
36
40
  Add optional diagrams only when useful:
@@ -0,0 +1,52 @@
1
+ # [Task Name] - Visual Map
2
+
3
+ Visual Map Contract: v1.0
4
+
5
+ This file is the task's diagram collection. It is not only a phase roadmap.
6
+ Include only diagrams that materially help a human or agent understand the task.
7
+
8
+ ## Map Index
9
+
10
+ | ID | Type | Purpose | Required For Understanding | Source Evidence | Promotion Candidate |
11
+ | --- | --- | --- | --- | --- | --- |
12
+ | MAP-01 | phase | Show the execution phases and dependencies | yes | `task_plan.md` | no |
13
+
14
+ ## Phase Graph
15
+
16
+ ```mermaid
17
+ flowchart LR
18
+ INIT01["INIT-01 Scope and Context\nkind=init"] --> EXEC01["EXEC-01 Implementation Slice\nkind=execution"]
19
+ EXEC01 --> GATE01["GATE-01 Direct Completion\nkind=gate"]
20
+ ```
21
+
22
+ ## Phase Table
23
+
24
+ | Phase ID | Kind | Depends On | State | Completion | Output | Required Evidence | Exit Command | Actor | Evidence Status | Blocking Risk | Owner / Handoff |
25
+ | --- | --- | --- | --- | ---: | --- | --- | --- | --- | --- | --- | --- |
26
+ | INIT-01 | init | none | planned | 0 | Task scope is clear enough to execute | `task_plan.md` | `harness task-start {{TASK_ID}}` | agent | missing | none | coordinator |
27
+ | EXEC-01 | execution | INIT-01 | planned | 0 | Simple implementation or documentation change is complete | diff, command, or artifact path | `harness task-phase {{TASK_ID}} EXEC-01 --state done --completion 100 --evidence present` | agent | missing | [risk] | [owner] |
28
+ | GATE-01 | gate | EXEC-01 | planned | 0 | Direct task completion | progress update and final evidence note | `harness task-complete {{TASK_ID}} --message "<summary>"` | agent | missing | [risk] | coordinator |
29
+
30
+ Allowed Kind: init, execution, gate.
31
+ Allowed Actor: agent, human, coordinator.
32
+ Allowed Evidence Status: missing, partial, present, waived.
33
+
34
+ Dashboard implementation completion is computed from non-skipped `execution` phases only. `init` and `gate` phases route lifecycle readiness and next actions; they must not make implementation progress look incomplete.
35
+
36
+ ## Supporting Maps
37
+
38
+ Add optional diagrams only when useful:
39
+
40
+ - architecture: module, component, or service structure.
41
+ - sequence: frontend/backend/service/database/agent interaction.
42
+ - data-flow: data movement and ownership.
43
+ - state: state machine or lifecycle.
44
+ - topology: repo, service, worker, or worktree layout.
45
+ - decision: branch and tradeoff tree.
46
+
47
+ ## Map Notes
48
+
49
+ - Use `missing` when no evidence has been checked.
50
+ - Use `partial` when some evidence exists but required checks remain.
51
+ - Use `present` when the phase has sufficient evidence for its current claim.
52
+ - Use `waived` only when the reason and owner are recorded in `progress.md`.
@@ -12,16 +12,44 @@ Define the standard lifecycle for non-trivial work from intake through planning,
12
12
  4. Implement in small reviewable slices and keep the plan current when scope changes.
13
13
  5. Run checks that match the risk surface before claiming completion.
14
14
  6. Route material findings through review and do not bury unresolved issues in summaries.
15
- 7. Proactively commit each verified, meaningful slice. A completed slice should not remain only as unstaged or staged working-tree state unless the user explicitly asked to defer commits or a documented blocker prevents a clean commit.
16
- 8. Close the loop by updating walkthrough, SSoT, regression, ledger, or docs artifacts when the work changes durable project knowledge. New non-simple tasks should keep `lesson_candidates.md` reviewable before human review confirmation.
15
+ 7. Proactively commit each verified, meaningful slice. A completed slice should not remain only as unstaged or staged working-tree state unless the user explicitly asked to defer commits, checks failed, dirty ownership is unclear, or a documented blocker prevents a clean commit. Deferred commits require a no-commit reason, owner, and next step.
16
+ 8. Use CLI lifecycle commands for mechanical Harness writes whenever available. CLI-owned writes use locked, allowlisted auto-commit. `new-task` may preserve unrelated dirty files while committing only its own write scope; overlapping dirty paths or unrelated staged files still block the command. Other lifecycle commands may still require a clean tree. Agent-owned manual edits still need an explicit task commit or deferred-commit rationale.
17
+ 9. Treat `visual_map.md` as the lifecycle phase map. `init` phases prepare work, `execution` phases define implementation completion, and `gate` phases define review, human confirmation, lesson routing, and closeout. Follow a phase `Exit Command` only when its `Actor` matches the current operator; agents must not perform `human` gates.
18
+ 10. New task directories must carry machine-readable Task Audit Metadata in `INDEX.md`. The normal path is `Created By: harness new-task`; manual creation is allowed only as `manual-exception` with a concrete reason, and historical migration must use `historical-backfill`.
19
+ 11. Close the loop by updating walkthrough, SSoT, regression, ledger, or docs artifacts when the work changes durable project knowledge. New non-simple tasks should keep `lesson_candidates.md` reviewable before human review confirmation.
20
+
21
+ ## Task Package Structure
22
+
23
+ Use `harness new-task` instead of hand-copying task files. The CLI creates the selected budget file set and records task audit metadata in `INDEX.md` so `harness check` can validate it.
24
+
25
+ | Budget | Required Files |
26
+ | --- | --- |
27
+ | simple | `INDEX.md`, `brief.md`, `task_plan.md`, `visual_map.md`, `progress.md` |
28
+ | standard | simple files plus `execution_strategy.md`, `findings.md`, `lesson_candidates.md`, `review.md` |
29
+ | complex | standard files plus `references/INDEX.md`, `artifacts/INDEX.md` |
30
+ | long-running add-on | `long-running-task-contract.md` when `--long-running` is selected |
31
+
32
+ `INDEX.md` is the task package navigation page and audit metadata SSoT. It points to contract files and optional indexes but does not replace them.
33
+
34
+ Optional directories are created only when triggered:
35
+
36
+ - `references/INDEX.md`: task-local sources, external links, reviewer input packages, and preset-provided required reads.
37
+ - `artifacts/INDEX.md`: command output, screenshots, fixtures, generated reports, reviews, and other evidence.
38
+ - `lessons/LC-*.md`: task-local lesson detail artifacts for candidates marked `needs-promotion`.
39
+ - `slices/<slice-id>/`: multi-slice task material, when a task explicitly uses slice packets.
40
+
41
+ Preset packages must not add or replace root-level base scaffold documents. Presets may append controlled sections to fixed base documents or add isolated resources under `references/**` and `artifacts/**`. Resource rows belong only in `references/INDEX.md` and `artifacts/INDEX.md`; the root `INDEX.md` may show only system-rendered preset summary fields.
17
42
 
18
43
  ## Required Checklist
19
44
 
20
45
  - Goal, scope, acceptance criteria, and constraints are written down.
46
+ - Task Audit Metadata is present in `INDEX.md`, or the manual/historical exception reason is explicit.
47
+ - The task package `INDEX.md` is present for new generated tasks.
21
48
  - Current repo state and ownership boundaries were checked.
22
49
  - Implementation notes identify changed surfaces.
23
50
  - Required checks and evidence are captured.
24
- - Verified slices have commit SHAs, or the reason for deferring commit is written down.
51
+ - Verified slices have commit SHAs, or the no-commit reason, owner, and next step are written down.
52
+ - The current lifecycle gate in `visual_map.md` has either been executed or has a recorded blocker.
25
53
  - Review status and material findings are recorded.
26
54
  - Residuals are explicit and assigned.
27
55
  - Closeout artifacts are updated when required.
@@ -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
 
@@ -15,10 +15,11 @@
15
15
 
16
16
  1. 遵守 `docs/11-REFERENCE/engineering-standard.md` 中的架构边界。
17
17
  2. 不提交密钥、令牌、私有接口、用户隐私数据或生产凭据。
18
- 3. 非平凡任务先在 `docs/09-PLANNING/TASKS/` 下建立任务目录。
18
+ 3. 非平凡任务先用 Harness CLI 在 `docs/09-PLANNING/TASKS/` 下建立任务目录。
19
19
  4. 声称完成前必须记录证据。
20
20
  5. 保护无关工作区改动,不回滚任务范围外文件。
21
- 6. 已验证的、有意义的工作切片要主动提交,除非用户明确说不要提交。
21
+ 6. 已验证的、有意义的工作切片要主动提交。除非用户明确暂停提交、检查失败、dirty 归属不清,或安全边界导致无法形成干净提交,否则不要把已完成工作只留在未提交文件里;不能提交时,必须在 progress、handoff 或 closeout 中写明 no-commit reason、owner 和下一步。不要把无关 dirty 改动混入本任务提交。
22
+ 7. 最终回复前检查当前任务 `visual_map.md` 的 gate 阶段。如果当前 `Exit Command` 的 `Actor` 是 `agent`,就执行它或记录 blocker。不得执行 `review-confirm` 这类 `human` gate,除非用户已经明确完成或委托了人工确认。
22
23
 
23
24
  ## 任务阅读矩阵
24
25
 
@@ -31,8 +32,8 @@
31
32
  | 本地开发、mock、stub、跨仓调试 | `docs/04-DEVELOPMENT/README.md`、`docs/04-DEVELOPMENT/codebase-map.md` |
32
33
  | API、event、webhook、SDK、第三方契约 | `docs/06-INTEGRATIONS/README.md` 和相关契约文件 |
33
34
  | 测试、冒烟、回归 | `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` |
35
- | 创建或推进任务 | `docs/09-PLANNING/TASKS/` 下的当前任务目录;如果本项目已配置 Harness CLI,优先用 CLI |
35
+ | 开发执行、提交、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` |
36
+ | 创建或推进任务 | `docs/09-PLANNING/TASKS/` 下的当前任务目录;如果本项目已配置 Harness CLI,使用 `harness new-task` / lifecycle 命令 |
36
37
  | Brief、Execution Strategy、Visual Map | 当前任务的 `brief.md`、`execution_strategy.md`、`visual_map.md` |
37
38
  | 长程任务 | `docs/11-REFERENCE/long-running-task-standard.md` |
38
39
  | reviewer、subagent、对抗性审查 | `docs/11-REFERENCE/review-routing-standard.md`、`docs/11-REFERENCE/adversarial-review-standard.md` |
@@ -41,39 +42,44 @@
41
42
  | 文档治理或 Harness 更新 | `docs/11-REFERENCE/docs-library-standard.md`、`.harness-capabilities.json` |
42
43
  | 外部资料摄取 | `docs/11-REFERENCE/external-source-intake-standard.md` |
43
44
  | 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` |
45
+ | 收口、walkthrough、Lessons | `docs/11-REFERENCE/walkthrough-standard.md`、`docs/10-WALKTHROUGH/Closeout-SSoT.md`、当前任务 `lesson_candidates.md`、`docs/01-GOVERNANCE/lessons/` |
45
46
  | Worktree、并行开发隔离 | `docs/11-REFERENCE/worktree-standard.md` |
46
47
 
47
48
  ## 标准执行流程
48
49
 
49
50
  1. 先确认请求、范围和受影响文件。
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
+ 2. 非平凡任务先创建或更新任务计划,再改代码。优先使用 `harness new-task`;CLI 不可用时必须在任务 `INDEX.md` 保留任务审计元数据,并把 `Created By` 设为 `manual-exception`,写清具体原因。
52
+ 3. 根据用户目标主动判断是否需要分工;用户不需要知道或主动要求 subagent。
53
+ 4. 只读取任务阅读矩阵要求的 reference 文档。
54
+ 5. 保留已有项目事实;新增上下文使用 merge / append,不覆盖历史。
55
+ 6. 需要隔离或并行时,使用独立 worktree 或分支。
56
+ 7. 只在确认范围内实现。
57
+ 8. 运行相关检查,并把证据写入任务记录。
58
+ 9. 按需触发 review,关闭阻塞发现。
59
+ 10. 按当前 `visual_map.md` lifecycle gate 的 `Exit Command` / `Actor` 收口。
60
+ 11. 写入或更新 walkthrough 与 closeout 记录。
61
+ 12. 只更新本任务实际触达的 SSoT / ledger;任务生命周期总账优先由 Harness CLI 生成,不手写任务行。
59
62
 
60
63
  ## 协作规则
61
64
 
62
- - reviewer 默认只读,除非明确分配写入范围。
63
- - worker 只能编辑分配给自己的分支、worktree 和文件范围。
65
+ - 任务开始时,先读取当前任务 `execution_strategy.md` 的 Subagent Authorization 和 Subagent Delegation Decision,并说明是否应该使用 reviewer 或 worker subagent;即使用户只说目标,也要主动判断。
66
+ - reviewer subagent 默认允许,只能做当前任务的只读审查。
67
+ - 如果 worker subagent 对任务有明显帮助但尚未授权,用白话主动向用户申请一次 task/scope/worktree 授权;可以直接说 worker subagent,但不要等用户知道或主动提醒你用 subagent。
68
+ - 如果独立切片已经明显但精确文件路径还不清楚,先确认文件路径,然后在 implementation 前立刻申请独立执行助手授权。
69
+ - worker subagent 需要用户授权一次,并记录到 `execution_strategy.md`;之后只可在同一任务、同一范围、同一 worktree/branch 内复用。
64
70
  - 共享 ledger、registry 和 SSoT 默认由 coordinator 维护,除非明确登记锁。
65
71
  - worker 交接必须包含分支或 worktree、改动文件、检查、证据和残余风险。
66
72
 
67
73
  ## 单一事实源
68
74
 
69
- - Feature SSoT:`docs/09-PLANNING/Feature-SSoT.md`
75
+ - Harness Ledger:`docs/Harness-Ledger.md`(任务生命周期总账,由 CLI 生成)
70
76
  - Delivery SSoT:`docs/09-PLANNING/Delivery-SSoT.md`
71
77
  - Module Registry:`docs/09-PLANNING/Module-Registry.md`
72
78
  - Regression SSoT:`docs/05-TEST-QA/Regression-SSoT.md`
73
79
  - Cadence Ledger:`docs/05-TEST-QA/Cadence-Ledger.md`
74
- - Lessons SSoT:`docs/01-GOVERNANCE/Lessons-SSoT.md`
80
+ - Lesson Candidates:当前任务 `lesson_candidates.md`
81
+ - Lesson Detail Docs:`docs/01-GOVERNANCE/lessons/`
75
82
  - Closeout SSoT:`docs/10-WALKTHROUGH/Closeout-SSoT.md`
76
- - Harness Ledger:`docs/Harness-Ledger.md`
77
83
 
78
84
  ## 本地命令
79
85