coding-agent-harness 1.0.1 → 1.0.2

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 (159) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.en-US.md +14 -0
  3. package/README.md +111 -86
  4. package/README.zh-CN.md +270 -0
  5. package/SKILL.md +116 -189
  6. package/docs-release/README.md +72 -5
  7. package/docs-release/architecture/overview.md +286 -28
  8. package/docs-release/architecture/overview.zh-CN.md +288 -0
  9. package/docs-release/assets/dashboard-overview-en.png +0 -0
  10. package/docs-release/assets/harness-architecture.svg +163 -0
  11. package/docs-release/assets/harness-workflow.svg +64 -0
  12. package/docs-release/guides/agent-installation.en-US.md +214 -0
  13. package/docs-release/guides/agent-installation.md +123 -26
  14. package/docs-release/guides/document-audience-and-surfaces.en-US.md +112 -0
  15. package/docs-release/guides/document-audience-and-surfaces.md +112 -0
  16. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +334 -0
  17. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +334 -0
  18. package/docs-release/guides/legacy-migration-agent-prompt.md +384 -0
  19. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +361 -0
  20. package/docs-release/guides/migration-playbook.en-US.md +325 -0
  21. package/docs-release/guides/migration-playbook.md +329 -0
  22. package/docs-release/guides/parent-control-repository-pattern.en-US.md +252 -0
  23. package/docs-release/guides/parent-control-repository-pattern.md +252 -0
  24. package/docs-release/guides/repository-operating-models.en-US.md +196 -0
  25. package/docs-release/guides/repository-operating-models.md +196 -0
  26. package/docs-release/intl/README.md +15 -0
  27. package/docs-release/intl/de-DE.md +18 -0
  28. package/docs-release/intl/en-US.md +18 -0
  29. package/docs-release/intl/es-ES.md +18 -0
  30. package/docs-release/intl/fr-FR.md +18 -0
  31. package/docs-release/intl/ja-JP.md +18 -0
  32. package/docs-release/intl/ko-KR.md +18 -0
  33. package/docs-release/intl/zh-CN.md +18 -0
  34. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/brief.md +13 -0
  35. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/lesson_candidates.md +24 -0
  36. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +1 -1
  37. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/task_plan.md +4 -2
  38. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/{visual_roadmap.md → visual_map.md} +9 -1
  39. package/package.json +3 -1
  40. package/references/agents-md-pattern.md +3 -3
  41. package/references/docs-directory-standard.md +47 -3
  42. package/references/external-source-intake-standard.md +75 -0
  43. package/references/harness-ledger.md +5 -3
  44. package/references/legacy-12-phase-bootstrap.md +41 -0
  45. package/references/lessons-governance.md +23 -6
  46. package/references/planning-loop.md +41 -3
  47. package/references/project-onboarding-audit.md +10 -0
  48. package/references/repo-governance-standard.md +2 -0
  49. package/references/testing-standard.md +50 -0
  50. package/references/walkthrough-closeout.md +6 -5
  51. package/scripts/check-harness.mjs +76 -35
  52. package/scripts/harness.mjs +303 -12
  53. package/scripts/lib/capability-registry.mjs +533 -0
  54. package/scripts/lib/check-profiles.mjs +510 -0
  55. package/scripts/lib/core-shared.mjs +186 -0
  56. package/scripts/lib/dashboard-data.mjs +389 -0
  57. package/scripts/lib/dashboard-workbench.mjs +217 -0
  58. package/scripts/lib/dashboard-writer.mjs +93 -2
  59. package/scripts/lib/harness-core.mjs +10 -1318
  60. package/scripts/lib/lesson-maintenance.mjs +145 -0
  61. package/scripts/lib/markdown-utils.mjs +158 -0
  62. package/scripts/lib/migration-planner.mjs +478 -0
  63. package/scripts/lib/migration-support.mjs +312 -0
  64. package/scripts/lib/task-lifecycle.mjs +755 -0
  65. package/scripts/lib/task-scanner.mjs +682 -0
  66. package/scripts/smoke-dashboard.mjs +22 -0
  67. package/scripts/test-harness.mjs +926 -14
  68. package/templates/AGENTS.md.template +41 -30
  69. package/templates/architecture/Architecture-SSoT.md +21 -0
  70. package/templates/architecture/README.md +49 -0
  71. package/templates/architecture/critical-flows.md +22 -0
  72. package/templates/architecture/local-repo-context.md +20 -0
  73. package/templates/architecture/service-catalog.md +17 -0
  74. package/templates/architecture/services/service-template.md +31 -0
  75. package/templates/architecture/system-map.md +22 -0
  76. package/templates/dashboard/assets/app-src/00-state.js +41 -0
  77. package/templates/dashboard/assets/app-src/10-router.js +76 -0
  78. package/templates/dashboard/assets/app-src/20-overview.js +235 -0
  79. package/templates/dashboard/assets/app-src/30-tasks.js +563 -0
  80. package/templates/dashboard/assets/app-src/40-modules.js +58 -0
  81. package/templates/dashboard/assets/app-src/45-review.js +128 -0
  82. package/templates/dashboard/assets/app-src/50-migration.js +169 -0
  83. package/templates/dashboard/assets/app-src/60-shared.js +61 -0
  84. package/templates/dashboard/assets/app-src/90-bindings.js +382 -0
  85. package/templates/dashboard/assets/app.css +2575 -310
  86. package/templates/dashboard/assets/app.js +1498 -307
  87. package/templates/dashboard/assets/app.manifest.json +11 -0
  88. package/templates/dashboard/assets/i18n.js +429 -44
  89. package/templates/dashboard/assets/mermaid-renderer.js +58 -8
  90. package/templates/development/README.md +52 -0
  91. package/templates/development/codebase-map.md +11 -0
  92. package/templates/development/cross-repo-debugging.md +18 -0
  93. package/templates/development/external-context/service-template.md +33 -0
  94. package/templates/development/external-source-packs/README.md +24 -0
  95. package/templates/development/external-source-packs/digest-template.md +28 -0
  96. package/templates/development/local-setup.md +16 -0
  97. package/templates/development/stubs-and-mocks.md +11 -0
  98. package/templates/integrations/README.md +40 -0
  99. package/templates/integrations/api-contract.md +42 -0
  100. package/templates/integrations/event-contract.md +46 -0
  101. package/templates/integrations/third-party/vendor-template.md +42 -0
  102. package/templates/integrations/webhook-contract.md +41 -0
  103. package/templates/planning/brief.md +32 -0
  104. package/templates/planning/lesson_candidates.md +58 -0
  105. package/templates/planning/long-running-task-contract.md +7 -0
  106. package/templates/planning/module_brief.md +25 -0
  107. package/templates/planning/module_session_prompt.md +6 -0
  108. package/templates/planning/task_plan.md +7 -5
  109. package/templates/planning/{visual_roadmap.md → visual_map.md} +24 -2
  110. package/templates/reference/docs-library-standard.md +31 -0
  111. package/templates/reference/execution-workflow-standard.md +4 -2
  112. package/templates/reference/external-source-intake-standard.md +82 -0
  113. package/templates/reference/harness-ledger-standard.md +1 -0
  114. package/templates/reference/repo-governance-standard.md +6 -4
  115. package/templates/reference/walkthrough-standard.md +2 -1
  116. package/templates/walkthrough/walkthrough-template.md +2 -2
  117. package/templates-zh-CN/AGENTS.md.template +69 -70
  118. package/templates-zh-CN/architecture/Architecture-SSoT.md +21 -0
  119. package/templates-zh-CN/architecture/README.md +51 -0
  120. package/templates-zh-CN/architecture/critical-flows.md +24 -0
  121. package/templates-zh-CN/architecture/local-repo-context.md +20 -0
  122. package/templates-zh-CN/architecture/service-catalog.md +17 -0
  123. package/templates-zh-CN/architecture/services/service-template.md +31 -0
  124. package/templates-zh-CN/architecture/system-map.md +22 -0
  125. package/templates-zh-CN/development/README.md +54 -0
  126. package/templates-zh-CN/development/codebase-map.md +11 -0
  127. package/templates-zh-CN/development/cross-repo-debugging.md +18 -0
  128. package/templates-zh-CN/development/external-context/service-template.md +33 -0
  129. package/templates-zh-CN/development/external-source-packs/README.md +24 -0
  130. package/templates-zh-CN/development/external-source-packs/digest-template.md +28 -0
  131. package/templates-zh-CN/development/local-setup.md +16 -0
  132. package/templates-zh-CN/development/stubs-and-mocks.md +11 -0
  133. package/templates-zh-CN/integrations/README.md +42 -0
  134. package/templates-zh-CN/integrations/api-contract.md +42 -0
  135. package/templates-zh-CN/integrations/event-contract.md +46 -0
  136. package/templates-zh-CN/integrations/third-party/vendor-template.md +42 -0
  137. package/templates-zh-CN/integrations/webhook-contract.md +41 -0
  138. package/templates-zh-CN/planning/brief.md +32 -0
  139. package/templates-zh-CN/planning/lesson_candidates.md +58 -0
  140. package/templates-zh-CN/planning/long-running-task-contract.md +1 -1
  141. package/templates-zh-CN/planning/module_brief.md +25 -0
  142. package/templates-zh-CN/planning/module_plan.md +2 -2
  143. package/templates-zh-CN/planning/module_session_prompt.md +4 -3
  144. package/templates-zh-CN/planning/task_plan.md +10 -4
  145. package/templates-zh-CN/planning/{visual_roadmap.md → visual_map.md} +21 -2
  146. package/templates-zh-CN/reference/docs-library-standard.md +35 -0
  147. package/templates-zh-CN/reference/execution-workflow-standard.md +9 -2
  148. package/templates-zh-CN/reference/external-source-intake-standard.md +82 -0
  149. package/templates-zh-CN/reference/harness-ledger-standard.md +5 -2
  150. package/templates-zh-CN/reference/repo-governance-standard.md +2 -0
  151. package/templates-zh-CN/reference/walkthrough-standard.md +4 -4
  152. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +2 -2
  153. package/templates-zh-CN/walkthrough/walkthrough-template.md +2 -2
  154. package/templates-zh-CN/dashboard/assets/app.css +0 -399
  155. package/templates-zh-CN/dashboard/assets/app.js +0 -435
  156. package/templates-zh-CN/dashboard/assets/i18n.js +0 -47
  157. package/templates-zh-CN/dashboard/assets/markdown-reader.js +0 -116
  158. package/templates-zh-CN/dashboard/assets/mermaid-renderer.js +0 -59
  159. package/templates-zh-CN/dashboard/index.html +0 -18
@@ -0,0 +1,24 @@
1
+ # 外部资料包索引 / External Source Packs
2
+
3
+ Context Doc Type: external-source-pack-registry
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Purpose
9
+
10
+ 这个目录只承载外部资料的摄取、索引和摘要。稳定事实必须投影到 `03-ARCHITECTURE`、`04-DEVELOPMENT/external-context` 或 `06-INTEGRATIONS` 后才算进入 Harness 执行上下文。
11
+
12
+ 先读 `docs/11-REFERENCE/external-source-intake-standard.md`,再新增资料包。
13
+
14
+ ## Source Packs
15
+
16
+ | Source Key | External Project / Service | Raw Storage Mode | Source Count | Digest Status | Projected To 03/04/06 | Owner | Last Verified | Confidence |
17
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
18
+
19
+ ## Placement Rule
20
+
21
+ - 资料量小于 5 份时,优先在 `03/04/06` 的 `Source Evidence` 中引用,不必建资料包。
22
+ - 资料很多、跨多个主题或会持续增长时,创建 `<source-key>/README.md` 和 `digests/`。
23
+ - `raw/` 只能放允许入仓、无密钥、无隐私、无客户数据的原始材料。
24
+ - 不能入仓的资料只记录外部路径、owner、访问条件和 digest。
@@ -0,0 +1,28 @@
1
+ # 外部资料摘要:<source-id> / External Source Digest: <source-id>
2
+
3
+ Context Doc Type: external-source-digest
4
+ Source Pack: <source-key>
5
+ Original Location: <path-or-url-or-owner>
6
+ Digest Owner: project coordinator
7
+ Last Verified: unknown
8
+ Confidence: low
9
+
10
+ ## Source Summary
11
+
12
+ [用 5-10 行说明原始资料是什么、覆盖范围、可信度和更新时间。]
13
+
14
+ ## Extracted Facts
15
+
16
+ | Fact ID | Fact | Category | Project To | Source Evidence | Last Verified | Confidence |
17
+ | --- | --- | --- | --- | --- | --- | --- |
18
+ | F-001 | [可验证事实] | architecture / development / integration / security / operations / product / unknown | `docs/...` 或 hold | <source-id> | unknown | low |
19
+
20
+ ## Questions / Unsafe Assumptions
21
+
22
+ | ID | Question Or Assumption | Why It Matters | Owner | Status |
23
+ | --- | --- | --- | --- | --- |
24
+
25
+ ## Projection Status
26
+
27
+ | Target Doc | Action | Status | Evidence |
28
+ | --- | --- | --- | --- |
@@ -0,0 +1,16 @@
1
+ # 本地启动 / Local Setup
2
+
3
+ Context Doc Type: local-setup
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Commands
9
+
10
+ | Task | Command | Expected Result | Source Evidence | Last Verified | Confidence |
11
+ | --- | --- | --- | --- | --- | --- |
12
+
13
+ ## Environment
14
+
15
+ | Variable | Required | Purpose | Source Evidence |
16
+ | --- | --- | --- | --- |
@@ -0,0 +1,11 @@
1
+ # Stub 与 Mock / Stubs and Mocks
2
+
3
+ Context Doc Type: stubs-and-mocks
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Available Stubs
9
+
10
+ | External Service | Scenario | Stub Path | How To Run | Source Evidence | Last Verified | Confidence |
11
+ | --- | --- | --- | --- | --- | --- | --- |
@@ -0,0 +1,42 @@
1
+ # 接口契约 / Integrations
2
+
3
+ Context Doc Type: integration-index
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Purpose
9
+
10
+ 这个文件夹只放具体接口契约:API、event、webhook、SDK、第三方集成、auth、payload、error 和 contract tests。
11
+
12
+ Keep the English field names and section headings because CLI checks rely on them.
13
+
14
+ ## Boundary
15
+
16
+ - 服务拓扑和职责归属放 `docs/03-ARCHITECTURE/`。
17
+ - 开发 mock 和调试说明放 `docs/04-DEVELOPMENT/`。
18
+ - endpoint、payload、error、auth、event、webhook、SDK 契约放这里。
19
+
20
+ ## Structure Contract
21
+
22
+ | 文件 / 路径 | 必须维护的事实 | 写入规则 |
23
+ | --- | --- | --- |
24
+ | `<service-key>-api.md` | API endpoint、auth、payload、error、contract test | 从 `api-contract.md` 创建 |
25
+ | `<event-name>-event.md` | event producer/consumer、schema、delivery、retry | 从 `event-contract.md` 创建 |
26
+ | `<webhook-name>-webhook.md` | webhook source、target、signature、payload、retry | 从 `webhook-contract.md` 创建 |
27
+ | `third-party/<vendor-key>.md` | 第三方平台、账号/权限边界、SDK 使用、限制 | 从 `third-party/vendor-template.md` 创建 |
28
+
29
+ ## Contract Rule
30
+
31
+ 每个接口契约必须是独立文件,并链接回对应服务:
32
+
33
+ - 服务职责和上下游关系:`docs/03-ARCHITECTURE/service-catalog.md` 或 `services/<service-key>.md`
34
+ - 本地 mock / stub / debug:`docs/04-DEVELOPMENT/external-context/<service-key>.md`
35
+ - 具体 payload、auth、error、contract test:本文件夹
36
+
37
+ 不要在一个“接口说明”大文档里混写多个服务。多个微服务就维护多个契约文件;README 里的 Contract Index 负责让人和 Agent 快速定位。
38
+
39
+ ## Contract Index
40
+
41
+ | Contract | Type | Producer | Consumer | Service Profile | Development Context | Contract Tests | Last Verified | Confidence |
42
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
@@ -0,0 +1,42 @@
1
+ # API 契约:<service-or-api> / API Contract: <service-or-api>
2
+
3
+ Context Doc Type: api-contract
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Contract Type
9
+
10
+ API
11
+
12
+ ## Index Links
13
+
14
+ | Service Profile | Development Context | Contract Index | Last Verified | Confidence |
15
+ | --- | --- | --- | --- | --- |
16
+ | `docs/03-ARCHITECTURE/services/<service-key>.md` | `docs/04-DEVELOPMENT/external-context/<service-key>.md` | `docs/06-INTEGRATIONS/README.md` | unknown | low |
17
+
18
+ ## Auth
19
+
20
+ [认证和授权要求。不要写入真实密钥。]
21
+
22
+ ## Endpoints
23
+
24
+ | Method | Path | Purpose | Request Payload | Response Payload | Errors | Source Evidence | Last Verified | Confidence |
25
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
26
+
27
+ ## Payload
28
+
29
+ [请求/响应 schema,或指向 schema 的路径。]
30
+
31
+ ## Errors
32
+
33
+ [错误码、重试规则、用户可见行为。]
34
+
35
+ ## Contract Tests
36
+
37
+ | Test | Command / Path | Expected Result |
38
+ | --- | --- | --- |
39
+
40
+ ## Placement Rule
41
+
42
+ 本文件只写一个 API 契约。服务职责放 `03-ARCHITECTURE`,本地 mock/stub/debug 放 `04-DEVELOPMENT`。
@@ -0,0 +1,46 @@
1
+ # 事件契约:<event-name> / Event Contract: <event-name>
2
+
3
+ Context Doc Type: event-contract
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Contract Type
9
+
10
+ Event
11
+
12
+ ## Index Links
13
+
14
+ | Service Profile | Development Context | Contract Index | Last Verified | Confidence |
15
+ | --- | --- | --- | --- | --- |
16
+ | `docs/03-ARCHITECTURE/services/<service-key>.md` | `docs/04-DEVELOPMENT/external-context/<service-key>.md` | `docs/06-INTEGRATIONS/README.md` | unknown | low |
17
+
18
+ ## Topic / Channel
19
+
20
+ [Queue、topic、stream 或 bus。]
21
+
22
+ ## Auth
23
+
24
+ [生产者/消费者权限、签名或访问控制。没有也要写 N/A 和证据。]
25
+
26
+ ## Payload
27
+
28
+ [事件 schema 或 schema 路径。]
29
+
30
+ ## Producers and Consumers
31
+
32
+ | Role | Service | Responsibility | Source Evidence |
33
+ | --- | --- | --- | --- |
34
+
35
+ ## Errors
36
+
37
+ [Dead-letter、retry、兼容性策略。]
38
+
39
+ ## Contract Tests
40
+
41
+ | Test | Command / Path | Expected Result |
42
+ | --- | --- | --- |
43
+
44
+ ## Placement Rule
45
+
46
+ 本文件只写一个 event 契约。服务职责放 `03-ARCHITECTURE`,本地 mock/stub/debug 放 `04-DEVELOPMENT`。
@@ -0,0 +1,42 @@
1
+ # 第三方集成:<vendor> / Third-Party Integration: <vendor>
2
+
3
+ Context Doc Type: third-party-integration
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Contract Type
9
+
10
+ Third-party service
11
+
12
+ ## Index Links
13
+
14
+ | Service Profile | Development Context | Contract Index | Last Verified | Confidence |
15
+ | --- | --- | --- | --- | --- |
16
+ | `docs/03-ARCHITECTURE/services/<vendor-key>.md` | `docs/04-DEVELOPMENT/external-context/<vendor-key>.md` | `docs/06-INTEGRATIONS/README.md` | unknown | low |
17
+
18
+ ## Auth
19
+
20
+ [凭证与权限模型。不要写入真实密钥。]
21
+
22
+ ## API / SDK Surface
23
+
24
+ | Surface | Purpose | Contract Link | Source Evidence | Last Verified | Confidence |
25
+ | --- | --- | --- | --- | --- | --- |
26
+
27
+ ## Payload
28
+
29
+ [重要请求/响应体,或相关 schema 路径。]
30
+
31
+ ## Errors
32
+
33
+ [供应商错误、额度限制、重试和降级策略。]
34
+
35
+ ## Contract Tests
36
+
37
+ | Test | Command / Path | Expected Result |
38
+ | --- | --- | --- |
39
+
40
+ ## Placement Rule
41
+
42
+ 本文件只写一个第三方集成。账号/权限/SDK/限制放这里;业务职责和系统拓扑放 `03-ARCHITECTURE`。
@@ -0,0 +1,41 @@
1
+ # Webhook 契约:<webhook-name> / Webhook Contract: <webhook-name>
2
+
3
+ Context Doc Type: webhook-contract
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Contract Type
9
+
10
+ Webhook
11
+
12
+ ## Index Links
13
+
14
+ | Service Profile | Development Context | Contract Index | Last Verified | Confidence |
15
+ | --- | --- | --- | --- | --- |
16
+ | `docs/03-ARCHITECTURE/services/<service-key>.md` | `docs/04-DEVELOPMENT/external-context/<service-key>.md` | `docs/06-INTEGRATIONS/README.md` | unknown | low |
17
+
18
+ ## Auth
19
+
20
+ [签名、token、IP allowlist 或其他认证方式。不要写入真实密钥。]
21
+
22
+ ## Payload
23
+
24
+ [Webhook body schema 或 schema 路径。]
25
+
26
+ ## Source Evidence
27
+
28
+ [代码、供应商文档、负责人说明或发现命令。]
29
+
30
+ ## Errors
31
+
32
+ [重试、超时、幂等行为。]
33
+
34
+ ## Contract Tests
35
+
36
+ | Test | Command / Path | Expected Result |
37
+ | --- | --- | --- |
38
+
39
+ ## Placement Rule
40
+
41
+ 本文件只写一个 webhook 契约。服务职责放 `03-ARCHITECTURE`,本地 mock/stub/debug 放 `04-DEVELOPMENT`。
@@ -0,0 +1,32 @@
1
+ # {{TASK_TITLE}}
2
+
3
+ ## Brief
4
+
5
+ ## Task ID
6
+
7
+ `{{TASK_ID}}`
8
+
9
+ ## 创建日期
10
+
11
+ {{DATE}}
12
+
13
+ ## 目标结果
14
+
15
+ 说明这个任务完成后,用户或项目能直接看到的结果。
16
+
17
+ ## 边界
18
+
19
+ - 范围内:本任务允许修改的文件、行为、文档或验证内容。
20
+ - 范围外:不能顺手塞进来的工作。
21
+ - 停止条件:遇到不确定性、风险或缺少权限时,必须回到 coordinator 或用户确认。
22
+
23
+ ## 执行合同
24
+
25
+ - Owner:coordinator
26
+ - 生命周期状态:未开始
27
+ - 必需文件:`task_plan.md`、`execution_strategy.md`、`visual_map.md`、`progress.md`、`findings.md`、`review.md`
28
+ - 完成条件:验证证据必须记录到 `progress.md`
29
+
30
+ ## 第一步
31
+
32
+ 开始实现前,把这里替换成第一个具体动作。
@@ -0,0 +1,58 @@
1
+ # {{TASK_TITLE}} - 教训候选
2
+
3
+ 本文件是任务本地 lesson candidate queue。它不是 Lessons SSoT;只有人工审查确认值得沉淀后,才进入治理 promotion。
4
+
5
+ ## Candidate Status
6
+
7
+ | Field | Value |
8
+ | --- | --- |
9
+ | Schema version | lesson-candidate-v1 |
10
+ | Task-level status | pending-review |
11
+ | Review gate | candidate-file-present |
12
+ | Review decision | pending-human-review |
13
+ | Promotion state | not-promoted |
14
+ | Closeout token | pending |
15
+ | Source task | {{TASK_ID}} |
16
+ | Owner | coordinator |
17
+ | Last updated | {{DATE}} |
18
+
19
+ ## Schema
20
+
21
+ 允许的任务级状态:
22
+
23
+ - `missing`:候选文件不存在。
24
+ - `pending-review`:候选文件存在,但人工判定还没完成。
25
+ - `no-candidate-accepted`:人工接受本任务没有可复用候选的理由。
26
+ - `needs-promotion`:至少一个候选已排队等待治理沉淀。
27
+ - `promoted`:所有接受的候选都已写入 Lessons SSoT。
28
+ - `rejected`:所有候选都已带理由拒绝或归档。
29
+
30
+ 允许的行级状态:
31
+
32
+ - `ready-for-review`:agent 认为这个候选可能有复用价值。
33
+ - `needs-promotion`:人工标记这个候选值得沉淀。
34
+ - `promoted`:维护 CLI 已把候选写入 Lessons SSoT。
35
+ - `rejected`:人工带理由拒绝这个候选。
36
+
37
+ 聚合规则:
38
+
39
+ - 任意 `ready-for-review` 行会让任务级状态保持 `pending-review`。
40
+ - 任意 `needs-promotion` 行会让任务级状态变成 `needs-promotion`,除非仍有 `ready-for-review` 行。
41
+ - 全部行都是 `promoted` 时,任务级状态为 `promoted`。
42
+ - 全部行都是 `rejected` 时,任务级状态为 `rejected`。
43
+ - 没有候选的任务必须使用 `no-candidate-accepted`,并填写 `No-Candidate Reason`。
44
+
45
+ ## Candidates
46
+
47
+ | ID | Row Status | Title | Why It Might Matter | Review Decision | Promotion Target |
48
+ | --- | --- | --- | --- | --- | --- |
49
+
50
+ ## No-Candidate Reason
51
+
52
+ 尚未判定。只有人工审查接受本任务没有可复用候选时,才填写这里。
53
+
54
+ ## Promotion Notes
55
+
56
+ - 如果人工审查认为候选值得沉淀,把对应行标记为 `needs-promotion`,并记录目标治理位置。
57
+ - 如果人工审查拒绝候选,把对应行标记为 `rejected`,并在 review decision 中保留理由。
58
+ - `needs-promotion` 不阻止任务 closeout,但必须继续出现在维护队列和收口记录里。
@@ -113,6 +113,6 @@
113
113
  - [ ] `progress.md` / `findings.md` 更新
114
114
  - [ ] Harness Ledger 更新
115
115
  - [ ] 收口记录
116
- - [ ] Lessons 反思与检查(`checked-created` `checked-none`)
116
+ - [ ] Lessons 反思与检查:`lesson_candidates.md` 已进入 `no-candidate-accepted` / `needs-promotion` / `promoted` / `rejected`
117
117
  - [ ] PR / commit / 发布说明
118
118
  - [ ] 残余风险摘要
@@ -0,0 +1,25 @@
1
+ # {{TASK_TITLE}} 模块
2
+
3
+ ## Brief
4
+
5
+ ## 模块 Key
6
+
7
+ `{{TASK_ID}}`
8
+
9
+ ## 创建日期
10
+
11
+ {{DATE}}
12
+
13
+ ## 模块职责
14
+
15
+ 说明这个模块负责什么,以及为什么需要独立管理。
16
+
17
+ ## 边界
18
+
19
+ - 负责:本模块拥有的目录、服务或文档区域。
20
+ - 共享面:需要 coordinator 同步的文件。
21
+ - 不负责:相邻模块或未声明的全局文件。
22
+
23
+ ## 当前工作
24
+
25
+ 列出当前模块任务,或指向 `module_plan.md`。
@@ -17,12 +17,12 @@
17
17
 
18
18
  ## 执行与可视化文件
19
19
 
20
- 模块级 `execution_strategy.md` 和 `visual_roadmap.md` 应放在本模块目录,与 `module_plan.md` 同级,不嵌入本文件。
20
+ 模块级 `execution_strategy.md` 和 `visual_map.md` 应放在本模块目录,与 `module_plan.md` 同级,不嵌入本文件。
21
21
 
22
22
  | 合同文件 | 是否必需 | 用途 |
23
23
  | --- | --- | --- |
24
24
  | `execution_strategy.md` | yes | 模块执行模式、写入边界、subagent 使用、全局同步 owner、验证深度 |
25
- | `visual_roadmap.md` | yes | 模块阶段图、状态、完成度、证据状态、阻塞风险 |
25
+ | `visual_map.md` | yes | 模块图表集合、阶段图、状态、完成度、证据状态、阻塞风险 |
26
26
 
27
27
  旧模块目录可以保留历史嵌入式段落作为 fallback;新模块目录必须使用独立文件。
28
28
 
@@ -28,8 +28,8 @@
28
28
  - 编辑前检查 dirty state,不要 revert 无关改动。
29
29
  - 如果另一个活跃会话拥有该模块或必需共享文件,停止并记录冲突。
30
30
  - 代码编辑前,基于项目 planning 模板创建或更新 docs/09-PLANNING/MODULES/<module-key>/TASKS/<current-step>-<short-name>/task_plan.md,写清范围、验收、验证、分支/worktree 和共享协调。
31
- - 代码编辑前,确认模块任务目录含有 `execution_strategy.md` 与 `visual_roadmap.md`。如缺失,先补齐再实现。
32
- - 如果 docs/09-PLANNING/MODULES/<module-key>/ 缺少模块级 `execution_strategy.md` 或 `visual_roadmap.md`,在派发 worker 前补齐或更新。
31
+ - 代码编辑前,确认模块任务目录含有 `execution_strategy.md` 与 `visual_map.md`。如缺失,先补齐再实现。
32
+ - 如果 docs/09-PLANNING/MODULES/<module-key>/ 缺少模块级 `execution_strategy.md` 或 `visual_map.md`,在派发 worker 前补齐或更新。
33
33
 
34
34
  分支与工作树:
35
35
  - Worktree path: <worktree-path>.
@@ -55,8 +55,9 @@
55
55
  - 除非 coordinator 明确分配共享锁,worker session 不得更新 docs/09-PLANNING/Module-Registry.md、docs/Harness-Ledger.md、Closeout SSoT、Regression SSoT 或 Cadence Ledger。
56
56
  - 如果需要全局表更新,在 task_plan.md 或 progress.md 写 Coordinator 交接,并标记 `Global sync status: pending-coordinator-pass`。
57
57
  - 只有 coordinator pass 或明确的 shared-lock owner 可以更新 docs/09-PLANNING/Module-Registry.md。
58
+ - 汇报状态时区分 `task.state`、`lifecycleState`、`reviewStatus` 和 `closeoutStatus`;`done` 只表示实现步骤完成,不等于 `closed`。
58
59
  - 更新 docs/09-PLANNING/MODULES/<module-key>/module_plan.md。
59
- - 写 review.md,或记录 review skipped-with-reason
60
+ - 写 review.md,或记录 review skipped-with-reason。需要人工确认审查完成时,必须通过本地 dashboard workbench,或由 coordinator 执行 `harness review-confirm`;存在开放 P0/P1/P2 finding 时不得确认。
60
61
  - 步骤完成时写 walkthrough,并包含 Lessons 反思。
61
62
  - Coordinator pass 在任务关闭时更新 Closeout SSoT 和 Lessons 检查。
62
63
  - Coordinator pass 在行为、测试、架构或流程改变时更新 Regression SSoT 和 Harness Ledger。
@@ -1,5 +1,7 @@
1
1
  # [任务名称]
2
2
 
3
+ Task Contract: harness-task/v1
4
+
3
5
  ## 目标
4
6
 
5
7
  [用一句话说明本任务完成后应达到的状态。]
@@ -14,8 +16,11 @@
14
16
 
15
17
  | 预算 | 适用场景 | 必需结构 |
16
18
  | --- | --- | --- |
17
- | simple | 单 owner、无 subagent、证据深度为 L0/L1 | 使用标准任务文件即可 |
18
- | complex | 需要 L2/L3 证据、subagent/reviewer、外部参考、生成产物,或超过 5 个切片 | 只启用实际需要的可选索引 |
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 个切片 | 完整任务文件,并只启用实际需要的可选索引 |
22
+
23
+ 选择预算:{{TASK_BUDGET}}
19
24
 
20
25
  可选子目录按触发条件创建,不作为默认脚手架:
21
26
 
@@ -40,12 +45,13 @@
40
45
 
41
46
  ## 执行与可视化文件
42
47
 
43
- `execution_strategy.md` 和 `visual_roadmap.md` 是本任务的同级合同文件,不嵌入 `task_plan.md`。这样 dashboard 和 checker 可以稳定读取。
48
+ `execution_strategy.md` 和 `visual_map.md` 是本任务的同级合同文件,不嵌入 `task_plan.md`。这样 dashboard 和 checker 可以稳定读取。
44
49
 
45
50
  | 合同文件 | 是否必需 | 用途 |
46
51
  | --- | --- | --- |
47
52
  | `execution_strategy.md` | yes | 执行模式、subagent 使用、冲突控制、证据深度、交接规则 |
48
- | `visual_roadmap.md` | yes | Mermaid 路线图、阶段表、完成度、证据状态、阻塞风险 |
53
+ | `visual_map.md` | yes | 图表集合:阶段图、可选架构/时序/数据流/状态图、完成度、证据状态、阻塞风险 |
54
+ | `lesson_candidates.md` | standard/complex 必需 | 任务本地教训候选队列。人工审查确认前必须接受无候选、拒绝候选,或排队 promotion |
49
55
  | `review.md` | 按需 | 对抗性审查、release review、外部 reviewer 结论 |
50
56
 
51
57
  旧任务可以保留历史嵌入式段落作为 fallback;新任务必须使用独立文件。
@@ -1,6 +1,14 @@
1
- # 可视化路线图
1
+ # Visual Map / 可视化图谱
2
2
 
3
- 本文件供 HTML dashboard 和人工审查同时使用。Mermaid 图展示阶段关系;阶段表提供可解析的状态、完成度和证据状态。
3
+ Visual Map Contract: v1.0
4
+
5
+ 本文件是任务图表集合,不只是阶段路线图。只有对人或 agent 理解任务有实际帮助的图才放进来。
6
+
7
+ ## 图表索引(Map Index)
8
+
9
+ | ID | Type | Purpose | Required For Understanding | Source Evidence | Promotion Candidate |
10
+ | --- | --- | --- | --- | --- | --- |
11
+ | MAP-01 | phase | 展示执行阶段和依赖关系 | yes | `task_plan.md` | no |
4
12
 
5
13
  ## 阶段关系图(Phase Graph)
6
14
 
@@ -22,3 +30,14 @@ flowchart LR
22
30
  允许的 `Evidence Status`:`missing`, `partial`, `present`, `waived`。
23
31
 
24
32
  `Completion` 使用 `0..100` 的整数;`done` 应为 `100`,`planned` 应为 `0`,`skipped` 不计入 dashboard 总完成度。dashboard 以阶段表计算进度,不从正文推断。
33
+
34
+ ## 支持性图表(Supporting Maps)
35
+
36
+ 按需添加,不要求每类都存在:
37
+
38
+ - architecture:模块、组件、服务结构。
39
+ - sequence:前端、后端、服务、数据库、agent 时序。
40
+ - data-flow:数据流转和所有权。
41
+ - state:状态机或生命周期。
42
+ - topology:repo、服务、worker、worktree 拓扑。
43
+ - decision:方案分叉和决策树。
@@ -11,6 +11,7 @@
11
11
  | `docs/Harness-Ledger.md` | 全局上下文维护总账,记录非平凡任务是否完成计划、审查、回归、Lessons 和收口回写。 |
12
12
  | `docs/01-GOVERNANCE/` | Lessons SSoT、经验详情、治理记录、归档。 |
13
13
  | `docs/03-ARCHITECTURE/` | ADR、架构设计、接口决策、关键技术方案。 |
14
+ | `docs/04-DEVELOPMENT/` | 本地开发、代码地图、外部服务开发上下文、mock/stub、跨仓调试。 |
14
15
  | `docs/05-TEST-QA/` | Regression SSoT、Cadence Ledger、测试策略和回归证据索引。 |
15
16
  | `docs/09-PLANNING/` | Delivery SSoT、Module Registry、任务目录、模块计划。 |
16
17
  | `docs/09-PLANNING/TASKS/` | 每个任务一个目录,包含 task plan、progress、findings、review。 |
@@ -18,6 +19,39 @@
18
19
  | `docs/11-REFERENCE/` | agent 按需加载的标准文件,控制行为而不是记录流水账。 |
19
20
  | `docs/99-TMP/` | 临时材料,定期清理,不作为长期事实来源。 |
20
21
 
22
+ ## 03 / 04 / 06 路由规则
23
+
24
+ ```text
25
+ 03 = 它在系统里是什么
26
+ 04 = 我开发当前仓时怎么面对它
27
+ 06 = 我和它具体怎么对接
28
+ ```
29
+
30
+ | 目录 | 负责 | 不负责 | 必需 schema 信号 |
31
+ | --- | --- | --- | --- |
32
+ | `docs/03-ARCHITECTURE/` | 系统结构、服务职责、owner、service catalog、critical flows、ADR | endpoint payload、mock 指南、任务日志 | `Context Doc Type`, `Source Evidence`, `Last Verified`, `Confidence` |
33
+ | `docs/04-DEVELOPMENT/` | local setup、codebase map、external development context、external source packs、mock/stub、cross-repo debugging | 长期架构事实、API payload 合同、未经摘要的外部资料堆 | `Context Doc Type`, `Development Use`, `Do Not Assume`, `Mocks / Stubs`, `Source Evidence`, `Last Verified`, `Confidence` |
34
+ | `docs/06-INTEGRATIONS/` | API/event/webhook/SDK/third-party contract、auth、payload、errors、contract tests | 全局拓扑、service ownership catalog、调试笔记 | `Context Doc Type`, `Contract Type`, `Auth`, `Payload`, `Errors`, `Contract Tests`, `Source Evidence`, `Last Verified`, `Confidence` |
35
+
36
+ 具体分工:
37
+
38
+ - `03-ARCHITECTURE/service-catalog.md` 只写服务摘要和链接。
39
+ - `06-INTEGRATIONS/<service>-api-contract.md` 才写 payload、auth、errors、contract tests。
40
+ - `04-DEVELOPMENT/external-context/<service>.md` 写 mock/stub、不安全假设和调试说明。
41
+ - `04-DEVELOPMENT/external-source-packs/` 只写外部资料索引、digest 和投影状态;最终事实必须回写到 `03/04/06`。
42
+
43
+ ## 外部资料摄取规则
44
+
45
+ 如果目标项目属于微服务、多仓、前后端分仓或依赖外部团队文档,Agent 在 Diagnose / Decide 阶段必须询问用户是否有外部资料。资料少时直接作为 `Source Evidence` 链接;资料多时按 `external-source-intake-standard.md` 创建 source pack。
46
+
47
+ 外部资料处理顺序固定为:
48
+
49
+ ```text
50
+ Inventory -> Classify -> Sanitize -> Digest -> Project -> Verify -> Residual
51
+ ```
52
+
53
+ 未经 digest 和 projection 的原始资料不能直接作为执行事实。
54
+
21
55
  ## 命名规则
22
56
 
23
57
  - 目录可使用编号前缀,例如 `09-PLANNING`、`11-REFERENCE`。
@@ -57,3 +91,4 @@
57
91
  3. 证据用路径、命令、日志、截图、PR、CI run 引用,不依赖聊天记录。
58
92
  4. 表格用于状态和路由;段落用于解释判断和边界。
59
93
  5. 更新 reference 或 template 时,必须在 Harness Ledger 记录本次上下文维护。
94
+ 6. `03/04/06` 文档必须使用 schema 信号,发现内容错位时迁移到正确目录。
@@ -27,7 +27,7 @@
27
27
  5. 可写 worker 必须在自己的 worktree 内实现、验证、提交,并 handoff branch、commit SHA、checks、residual。
28
28
  6. 遇到共享文件冲突,由 coordinator 或人工决定串行顺序。
29
29
  7. 遇到目标失效、权限阻塞、高风险决策或 stop condition 不适用,立即暂停并记录。
30
- 8. 有意义地提交中间成果;commit message 应说明变更类型和范围。
30
+ 8. 主动提交已验证的、有意义的中间成果;commit message 应说明变更类型和范围。除非用户明确要求暂不提交,或检查失败 / diff 归属不清,否则不要把已完成切片长期留在未提交状态。
31
31
 
32
32
  ## 完成任务后
33
33
 
@@ -38,7 +38,7 @@
38
38
  5. 确认 `review.md` 没有 open P0/P1 finding;material P2 已修复或写为 `accepted-risk` 并路由。
39
39
  6. planned task 必须完成 closeout review,或写明 `skipped-with-reason`。
40
40
  7. 写 walkthrough,引用 task plan、review、证据、residual、Regression SSoT 和 commit。
41
- 8. 执行 Lessons 检查:有可复用经验则写 lesson 详情并更新 Lessons SSoT;没有也记录 `checked-none: <reason>`。
41
+ 8. 执行 Lessons 检查:新任务默认先写 `lesson_candidates.md` 并交给人工审查;人工标记后可记录 `queued-promotion`,再由维护命令写 lesson 详情并更新 Lessons SSoT。没有可复用候选时记录 `no-candidate-accepted`;旧任务兼容可记录 `checked-none: <reason>`。
42
42
  9. 最后更新 Harness Ledger,因为它记录本轮上下文维护的最终状态。
43
43
  10. 完成 commit / PR / release note,并确认本任务工作区没有未解释的遗留改动。
44
44
  11. 如使用 worker,coordinator 集成 worker commit 后运行最终 gates,并记录 integration evidence。
@@ -71,6 +71,13 @@ PR 描述必须包含:
71
71
  - residual、owner 和不阻塞理由。
72
72
  - required checks、reviewer、merge method 是否满足 `repo-governance-standard.md`。
73
73
 
74
+ ## 主动提交规则
75
+
76
+ - 每个已验证的、有意义的切片默认都要提交。
77
+ - 提交前只 stage 本任务范围内文件,不能顺手带入无关 dirty 文件、私有文件或生成产物。
78
+ - 如果用户明确说不要提交、检查失败、或 diff 归属还没厘清,必须把未提交原因写入 `progress.md` 或交接说明。
79
+ - closeout 时必须列出相关 commit SHA;如果没有 commit,必须说明为什么这是安全的例外。
80
+
74
81
  ## 禁止事项
75
82
 
76
83
  - 非平凡任务跳过 task plan 直接实现。