coding-agent-harness 1.0.4 → 1.0.6

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 (279) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/LICENSE +661 -21
  4. package/LICENSE-EXCEPTION.md +37 -0
  5. package/README.md +96 -4
  6. package/README.zh-CN.md +75 -4
  7. package/SKILL.md +52 -51
  8. package/dist/build-dist.mjs +189 -0
  9. package/dist/check-dist-observation.mjs +428 -0
  10. package/dist/check-harness.mjs +489 -0
  11. package/dist/check-import-graph.mjs +511 -0
  12. package/dist/check-runtime-emit.mjs +304 -0
  13. package/dist/check-type-boundaries.mjs +139 -0
  14. package/dist/commands/dashboard-command.mjs +80 -0
  15. package/dist/commands/migration-command.mjs +152 -0
  16. package/dist/commands/preset-command.mjs +91 -0
  17. package/dist/commands/task-command.mjs +324 -0
  18. package/dist/harness.mjs +304 -0
  19. package/dist/lib/capability-registry.mjs +643 -0
  20. package/dist/lib/check-module-parallel.mjs +227 -0
  21. package/dist/lib/check-profiles.mjs +414 -0
  22. package/dist/lib/check-task-contracts.mjs +54 -0
  23. package/dist/lib/core-shared.mjs +254 -0
  24. package/dist/lib/dashboard-data.mjs +608 -0
  25. package/dist/lib/dashboard-workbench.mjs +334 -0
  26. package/dist/lib/dashboard-writer.mjs +200 -0
  27. package/dist/lib/git-status-summary.mjs +45 -0
  28. package/dist/lib/governance-index-generator.mjs +236 -0
  29. package/dist/lib/governance-sync.mjs +617 -0
  30. package/dist/lib/governance-table-boundary.mjs +161 -0
  31. package/{scripts → dist}/lib/harness-core.mjs +3 -0
  32. package/dist/lib/harness-paths.mjs +338 -0
  33. package/dist/lib/lesson-maintenance.mjs +139 -0
  34. package/dist/lib/markdown-utils.mjs +193 -0
  35. package/dist/lib/migration-planner.mjs +439 -0
  36. package/dist/lib/migration-support.mjs +317 -0
  37. package/dist/lib/phase-kind.mjs +46 -0
  38. package/dist/lib/preset-audit-contracts.mjs +40 -0
  39. package/dist/lib/preset-engine.mjs +516 -0
  40. package/dist/lib/preset-registry.mjs +831 -0
  41. package/dist/lib/preset-resource-contracts.mjs +83 -0
  42. package/dist/lib/review-confirm-git-gate.mjs +244 -0
  43. package/dist/lib/status-builder.mjs +87 -0
  44. package/{scripts → dist}/lib/status-dashboard-renderer.mjs +48 -47
  45. package/dist/lib/structure-migration.mjs +404 -0
  46. package/dist/lib/subagent-authorization-audit.mjs +198 -0
  47. package/dist/lib/task-audit-metadata.mjs +376 -0
  48. package/dist/lib/task-audit-migration.mjs +355 -0
  49. package/dist/lib/task-completion-consistency.mjs +29 -0
  50. package/dist/lib/task-index.mjs +133 -0
  51. package/dist/lib/task-lesson-candidates.mjs +239 -0
  52. package/dist/lib/task-lesson-sedimentation.mjs +300 -0
  53. package/dist/lib/task-lifecycle/create-task-helpers.mjs +84 -0
  54. package/dist/lib/task-lifecycle/phase-sync.mjs +82 -0
  55. package/dist/lib/task-lifecycle/review-confirm.mjs +93 -0
  56. package/dist/lib/task-lifecycle/review-gates.mjs +62 -0
  57. package/dist/lib/task-lifecycle/review-submission.mjs +52 -0
  58. package/dist/lib/task-lifecycle/scaffold-provenance.mjs +54 -0
  59. package/dist/lib/task-lifecycle/template-files.mjs +52 -0
  60. package/dist/lib/task-lifecycle/text-utils.mjs +26 -0
  61. package/dist/lib/task-lifecycle.mjs +611 -0
  62. package/dist/lib/task-metadata.mjs +116 -0
  63. package/dist/lib/task-review-model.mjs +474 -0
  64. package/dist/lib/task-scanner.mjs +439 -0
  65. package/dist/lib/task-tombstone-commands.mjs +125 -0
  66. package/dist/postinstall.mjs +14 -0
  67. package/dist/run-built-tests.mjs +84 -0
  68. package/docs-release/README.md +1 -0
  69. package/docs-release/architecture/overview.md +13 -13
  70. package/docs-release/architecture/overview.zh-CN.md +13 -13
  71. package/docs-release/architecture/system-explainer/01-system-overview.md +218 -0
  72. package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
  73. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
  74. package/docs-release/architecture/system-explainer/04-check-and-governance.md +241 -0
  75. package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
  76. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +300 -0
  77. package/docs-release/architecture/system-explainer/README.md +67 -0
  78. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +227 -0
  79. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
  80. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
  81. package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +252 -0
  82. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
  83. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +320 -0
  84. package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
  85. package/docs-release/guides/agent-installation.en-US.md +22 -15
  86. package/docs-release/guides/agent-installation.md +23 -15
  87. package/docs-release/guides/contributing.md +3 -3
  88. package/docs-release/guides/contributing.zh-CN.md +3 -3
  89. package/docs-release/guides/document-audience-and-surfaces.en-US.md +10 -10
  90. package/docs-release/guides/document-audience-and-surfaces.md +10 -10
  91. package/docs-release/guides/legacy-migration-agent-prompt.md +25 -2
  92. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +25 -2
  93. package/docs-release/guides/migration-playbook.en-US.md +63 -1
  94. package/docs-release/guides/migration-playbook.md +59 -1
  95. package/docs-release/guides/parent-control-repository-pattern.en-US.md +25 -25
  96. package/docs-release/guides/parent-control-repository-pattern.md +25 -25
  97. package/docs-release/guides/preset-development.md +28 -4
  98. package/docs-release/guides/repository-operating-models.en-US.md +21 -21
  99. package/docs-release/guides/repository-operating-models.md +21 -21
  100. package/docs-release/guides/task-state-machine.en-US.md +35 -18
  101. package/docs-release/guides/task-state-machine.md +35 -18
  102. package/docs-release/guides/typescript-runtime-migration-closeout.md +96 -0
  103. package/examples/minimal-project/AGENTS.md +2 -2
  104. package/examples/minimal-project/coding-agent-harness/harness.yaml +14 -0
  105. package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/INDEX.md +60 -0
  106. package/examples/minimal-project/coding-agent-harness/planning/tasks/demo-task/progress.md +11 -0
  107. package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/review.md +1 -1
  108. package/package.json +22 -13
  109. package/presets/legacy-migration/preset.yaml +5 -5
  110. package/presets/legacy-migration/templates/execution_strategy.append.md +1 -1
  111. package/presets/lesson-sedimentation/preset.yaml +3 -3
  112. package/presets/module/preset.yaml +2 -2
  113. package/presets/module/templates/execution_strategy.append.md +1 -1
  114. package/presets/module/templates/task_plan.append.md +3 -3
  115. package/presets/standard-task/preset.yaml +2 -2
  116. package/references/adversarial-review-standard.md +2 -2
  117. package/references/agents-md-pattern.md +14 -14
  118. package/references/cadence-ledger.md +1 -1
  119. package/references/ci-cd-standard.md +1 -1
  120. package/references/delivery-operating-model-standard.md +4 -4
  121. package/references/docs-directory-standard.md +65 -159
  122. package/references/external-source-intake-standard.md +10 -10
  123. package/references/harness-ledger.md +6 -6
  124. package/references/legacy-12-phase-bootstrap.md +2 -2
  125. package/references/lessons-governance.md +15 -15
  126. package/references/long-running-task-standard.md +6 -6
  127. package/references/module-parallel-standard.md +34 -34
  128. package/references/planning-loop.md +6 -6
  129. package/references/project-onboarding-audit.md +4 -4
  130. package/references/regression-system.md +2 -2
  131. package/references/repo-governance-standard.md +4 -4
  132. package/references/review-routing-standard.md +1 -1
  133. package/references/ssot-governance.md +19 -19
  134. package/references/taskr-gap-analysis.md +5 -5
  135. package/references/walkthrough-closeout.md +14 -14
  136. package/references/worktree-parallel.md +3 -3
  137. package/skills/preset-creator/references/complex-task-skeleton/brief.md +11 -0
  138. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +1 -1
  139. package/skills/preset-creator/references/preset-package-skeleton.md +5 -5
  140. package/templates/AGENTS.md.template +31 -29
  141. package/templates/architecture/README.md +4 -4
  142. package/templates/architecture/service-catalog.md +2 -2
  143. package/templates/architecture/services/service-template.md +1 -1
  144. package/templates/dashboard/assets/app-src/00-state.js +12 -0
  145. package/templates/dashboard/assets/app-src/10-router.js +3 -0
  146. package/templates/dashboard/assets/app-src/20-overview.js +13 -3
  147. package/templates/dashboard/assets/app-src/35-task-detail.js +46 -6
  148. package/templates/dashboard/assets/app-src/40-modules.js +1 -1
  149. package/templates/dashboard/assets/app-src/55-presets.js +375 -0
  150. package/templates/dashboard/assets/app-src/60-shared.js +3 -1
  151. package/templates/dashboard/assets/app-src/90-bindings.js +131 -0
  152. package/templates/dashboard/assets/app.css +583 -0
  153. package/templates/dashboard/assets/app.css.manifest.json +1 -0
  154. package/templates/dashboard/assets/app.js +585 -11
  155. package/templates/dashboard/assets/app.manifest.json +1 -0
  156. package/templates/dashboard/assets/css-src/00-foundation.css +4 -0
  157. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +62 -0
  158. package/templates/dashboard/assets/css-src/45-presets.css +516 -0
  159. package/templates/dashboard/assets/i18n.js +144 -4
  160. package/templates/development/README.md +10 -10
  161. package/templates/development/cross-repo-debugging.md +3 -3
  162. package/templates/development/external-context/service-template.md +2 -2
  163. package/templates/development/external-source-packs/README.md +4 -4
  164. package/templates/integrations/README.md +4 -4
  165. package/templates/integrations/api-contract.md +2 -2
  166. package/templates/integrations/event-contract.md +2 -2
  167. package/templates/integrations/third-party/vendor-template.md +2 -2
  168. package/templates/integrations/webhook-contract.md +2 -2
  169. package/templates/ledger/Harness-Ledger.md +1 -1
  170. package/templates/planning/INDEX.md +88 -0
  171. package/templates/planning/brief.md +1 -1
  172. package/templates/planning/module_session_prompt.md +2 -1
  173. package/templates/planning/review.md +0 -18
  174. package/templates/planning/task_plan.md +5 -44
  175. package/templates/planning/visual_map.md +13 -9
  176. package/templates/planning/visual_map.simple.md +52 -0
  177. package/templates/planning/walkthrough.md +47 -0
  178. package/templates/reference/docs-library-standard.md +8 -8
  179. package/templates/reference/execution-workflow-standard.md +29 -2
  180. package/templates/reference/external-source-intake-standard.md +15 -15
  181. package/templates/reference/repo-governance-standard.md +1 -1
  182. package/templates/ssot/Module-Registry.md +1 -1
  183. package/templates/walkthrough/walkthrough-template.md +2 -2
  184. package/templates-zh-CN/AGENTS.md.template +31 -29
  185. package/templates-zh-CN/CLAUDE.md.template +1 -1
  186. package/templates-zh-CN/architecture/README.md +4 -4
  187. package/templates-zh-CN/architecture/service-catalog.md +2 -2
  188. package/templates-zh-CN/architecture/services/service-template.md +1 -1
  189. package/templates-zh-CN/development/README.md +10 -10
  190. package/templates-zh-CN/development/cross-repo-debugging.md +3 -3
  191. package/templates-zh-CN/development/external-context/service-template.md +2 -2
  192. package/templates-zh-CN/development/external-source-packs/README.md +4 -4
  193. package/templates-zh-CN/integrations/README.md +4 -4
  194. package/templates-zh-CN/integrations/api-contract.md +2 -2
  195. package/templates-zh-CN/integrations/event-contract.md +2 -2
  196. package/templates-zh-CN/integrations/third-party/vendor-template.md +2 -2
  197. package/templates-zh-CN/integrations/webhook-contract.md +2 -2
  198. package/templates-zh-CN/ledger/Harness-Ledger.md +1 -1
  199. package/templates-zh-CN/lessons/lesson-arch-process-change.md +1 -1
  200. package/templates-zh-CN/lessons/lesson-new-doc.md +3 -3
  201. package/templates-zh-CN/lessons/lesson-ref-change.md +4 -4
  202. package/templates-zh-CN/planning/INDEX.md +87 -0
  203. package/templates-zh-CN/planning/brief.md +1 -1
  204. package/templates-zh-CN/planning/module_session_prompt.md +12 -11
  205. package/templates-zh-CN/planning/review.md +0 -18
  206. package/templates-zh-CN/planning/task_plan.md +3 -63
  207. package/templates-zh-CN/planning/visual_map.md +14 -7
  208. package/templates-zh-CN/planning/visual_map.simple.md +48 -0
  209. package/templates-zh-CN/planning/walkthrough.md +47 -0
  210. package/templates-zh-CN/reference/adversarial-review-standard.md +2 -2
  211. package/templates-zh-CN/reference/delivery-operating-model-standard.md +3 -3
  212. package/templates-zh-CN/reference/docs-library-standard.md +28 -28
  213. package/templates-zh-CN/reference/execution-workflow-standard.md +32 -7
  214. package/templates-zh-CN/reference/external-source-intake-standard.md +16 -16
  215. package/templates-zh-CN/reference/harness-ledger-standard.md +6 -6
  216. package/templates-zh-CN/reference/regression-ssot-governance.md +2 -2
  217. package/templates-zh-CN/reference/repo-governance-standard.md +1 -1
  218. package/templates-zh-CN/reference/review-routing-standard.md +1 -1
  219. package/templates-zh-CN/reference/walkthrough-standard.md +7 -7
  220. package/templates-zh-CN/reference/worktree-standard.md +1 -1
  221. package/templates-zh-CN/regression/Cadence-Ledger.md +2 -2
  222. package/templates-zh-CN/ssot/Delivery-SSoT.md +3 -3
  223. package/templates-zh-CN/ssot/Module-Registry.md +3 -3
  224. package/templates-zh-CN/ssot/Regression-SSoT.md +2 -2
  225. package/templates-zh-CN/walkthrough/walkthrough-template.md +5 -5
  226. package/tsconfig.dist.json +16 -0
  227. package/tsconfig.json +25 -0
  228. package/tsconfig.runtime.json +24 -0
  229. package/examples/minimal-project/.harness-capabilities.json +0 -8
  230. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +0 -11
  231. package/scripts/check-harness.mjs +0 -508
  232. package/scripts/commands/dashboard-command.mjs +0 -67
  233. package/scripts/commands/migration-command.mjs +0 -96
  234. package/scripts/commands/preset-command.mjs +0 -73
  235. package/scripts/commands/task-command.mjs +0 -327
  236. package/scripts/harness.mjs +0 -287
  237. package/scripts/lib/capability-registry.mjs +0 -591
  238. package/scripts/lib/check-module-parallel.mjs +0 -237
  239. package/scripts/lib/check-profiles.mjs +0 -418
  240. package/scripts/lib/check-task-contracts.mjs +0 -47
  241. package/scripts/lib/core-shared.mjs +0 -196
  242. package/scripts/lib/dashboard-data.mjs +0 -412
  243. package/scripts/lib/dashboard-workbench.mjs +0 -257
  244. package/scripts/lib/dashboard-writer.mjs +0 -198
  245. package/scripts/lib/git-status-summary.mjs +0 -46
  246. package/scripts/lib/governance-index-generator.mjs +0 -174
  247. package/scripts/lib/governance-sync.mjs +0 -514
  248. package/scripts/lib/governance-table-boundary.mjs +0 -175
  249. package/scripts/lib/lesson-maintenance.mjs +0 -152
  250. package/scripts/lib/markdown-utils.mjs +0 -158
  251. package/scripts/lib/migration-planner.mjs +0 -478
  252. package/scripts/lib/migration-support.mjs +0 -312
  253. package/scripts/lib/preset-audit-contracts.mjs +0 -37
  254. package/scripts/lib/preset-engine.mjs +0 -497
  255. package/scripts/lib/preset-registry.mjs +0 -627
  256. package/scripts/lib/preset-resource-contracts.mjs +0 -83
  257. package/scripts/lib/review-confirm-git-gate.mjs +0 -248
  258. package/scripts/lib/subagent-authorization-audit.mjs +0 -196
  259. package/scripts/lib/task-completion-consistency.mjs +0 -16
  260. package/scripts/lib/task-index.mjs +0 -93
  261. package/scripts/lib/task-lesson-candidates.mjs +0 -242
  262. package/scripts/lib/task-lesson-sedimentation.mjs +0 -326
  263. package/scripts/lib/task-lifecycle/review-confirm.mjs +0 -101
  264. package/scripts/lib/task-lifecycle/review-gates.mjs +0 -70
  265. package/scripts/lib/task-lifecycle/text-utils.mjs +0 -24
  266. package/scripts/lib/task-lifecycle.mjs +0 -649
  267. package/scripts/lib/task-review-model.mjs +0 -469
  268. package/scripts/lib/task-scanner.mjs +0 -576
  269. package/scripts/lib/task-tombstone-commands.mjs +0 -140
  270. package/scripts/postinstall.mjs +0 -14
  271. package/templates/walkthrough/Closeout-SSoT.md +0 -43
  272. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +0 -42
  273. /package/examples/minimal-project/{docs → coding-agent-harness/governance/generated}/Harness-Ledger.md +0 -0
  274. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/brief.md +0 -0
  275. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/execution_strategy.md +0 -0
  276. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/findings.md +0 -0
  277. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/lesson_candidates.md +0 -0
  278. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/task_plan.md +0 -0
  279. /package/examples/minimal-project/{docs/09-PLANNING/TASKS → coding-agent-harness/planning/tasks}/demo-task/visual_map.md +0 -0
@@ -5,9 +5,10 @@ Chinese mirror: `docs-release/guides/task-state-machine.md`
5
5
  Coding Agent Harness does not model task state as a single field. The Dashboard derives the visible lifecycle from multiple files:
6
6
 
7
7
  - `progress.md` stores raw `task.state` and execution evidence.
8
- - `review.md` stores Agent Review Submission, material findings, and Human Review Confirmation.
8
+ - `review.md` stores Agent Review Submission, material findings, and review evidence.
9
+ - `INDEX.md` stores Task Audit Metadata, including task creation and human review confirmation audit fields.
9
10
  - `lesson_candidates.md` records lesson candidate decisions and sedimentation routing.
10
- - `10-WALKTHROUGH/Closeout-SSoT.md` records closeout status and links walkthrough evidence.
11
+ - `coding-agent-harness/governance/generated/Closeout-Index.md` records closeout status and links walkthrough evidence.
11
12
  - Tombstone / supersede metadata records whether a task was soft-deleted, merged, archived, or replaced.
12
13
  - The scanner derives `lifecycleState`, `reviewStatus`, `closeoutStatus`, `taskQueues[]`, `queueReasons[]`, and `repairPrompt` from those files.
13
14
 
@@ -32,20 +33,37 @@ stateDiagram-v2
32
33
  finalized --> [*]
33
34
  ```
34
35
 
35
- `task-review` means the agent submitted a review packet. It does not mean human approval. `review-confirm` is the Human Review Confirmation gate. `task-complete` / closeout is not a substitute for review confirmation.
36
+ `task-review` means the agent submitted a review packet. It does not mean human approval. `review-confirm` is the human confirmation gate and writes its audit fields to `INDEX.md`. `task-complete` / closeout is not a substitute for review confirmation.
37
+
38
+ ## Phase Kind Map
39
+
40
+ `visual_map.md` is the machine-readable phase timeline. New phase tables may include `Kind`, `Exit Command`, and `Actor` columns:
41
+
42
+ | Kind | Purpose | Counts Toward Implementation Completion | Typical Exit |
43
+ | --- | --- | --- | --- |
44
+ | `init` | Scope, context, budget, and execution strategy. | no | `harness task-start <task-id>` |
45
+ | `execution` | Implementation, documentation, and verification slices. | yes | `harness task-phase <task-id> <phase-id> --state done --completion 100 --evidence present` |
46
+ | `gate` | Agent review submission, human confirmation, lesson routing, walkthrough, and closeout. | no | `harness task-review`, `harness review-confirm`, or `harness task-complete` |
47
+
48
+ Older phase tables without `Kind` remain valid and are treated as `execution`.
49
+ The Dashboard implementation score uses non-skipped `execution` phases only.
50
+ Gate phases explain the next lifecycle action and owner; they do not make a finished implementation look incomplete.
51
+ Agents may run `Exit Command` values with `Actor: agent`. `Actor: human` gates, especially `review-confirm`, require explicit human action.
36
52
 
37
53
  ## Derived State
38
54
 
39
55
  ```mermaid
40
56
  flowchart TB
41
57
  Progress["progress.md<br/>task.state + evidence"]
42
- Review["review.md<br/>Agent Review Submission + findings + Human Review Confirmation"]
58
+ Index["INDEX.md<br/>Task Audit Metadata"]
59
+ Review["review.md<br/>Agent Review Submission + findings + evidence"]
43
60
  Lessons["lesson_candidates.md<br/>decision + sedimentation route"]
44
- Closeout["Closeout-SSoT.md<br/>closeout row + walkthrough"]
61
+ Closeout["Closeout-Index.md<br/>closeout row + walkthrough"]
45
62
  Tombstone["tombstone / supersede metadata"]
46
63
  Scanner["scanner"]
47
64
 
48
65
  Progress --> Scanner
66
+ Index --> Scanner
49
67
  Review --> Scanner
50
68
  Lessons --> Scanner
51
69
  Closeout --> Scanner
@@ -62,8 +80,8 @@ flowchart TB
62
80
  | Field | Source | Purpose |
63
81
  | --- | --- | --- |
64
82
  | `task.state` | `progress.md` | Raw execution stage. |
65
- | `reviewStatus` | `review.md` + findings + Human Review Confirmation | Separates missing review, agent-submitted review, blockers, and human confirmation. |
66
- | `closeoutStatus` | `Closeout-SSoT.md` | Separates missing, pending, and closed closeout. |
83
+ | `reviewStatus` | `INDEX.md` Task Audit Metadata + `review.md` findings/submission | Separates missing review, agent-submitted review, blockers, and human confirmation. |
84
+ | `closeoutStatus` | `Closeout-Index.md` | Separates missing, pending, and closed closeout. |
67
85
  | `lifecycleState` | scanner-derived | Main Dashboard lifecycle meaning. |
68
86
  | `taskQueues[]` | scanner-derived | Which lifecycle queues include the task. A task can be visible in more than one governance queue. |
69
87
  | `queueReasons[]` | scanner-derived | Why the task entered a queue, including source file, field, and repair action. |
@@ -76,9 +94,9 @@ flowchart TB
76
94
  | Tombstone, superseded-by, archive, or abandoned marker exists | `soft-deleted-superseded` | Hidden by default, but preserved for audit and replacement tracing. |
77
95
  | Open P0-P2 finding, invalid transition, audit failure, or failed human-review gate | `blocked` | Cannot enter human confirmation until the blocker is fixed or waived. |
78
96
  | Standard / complex task is missing required files, sections, evidence, lesson decision, or review submission | `missing-materials` | Needs agent repair; not part of the human review queue. |
79
- | `task-review` was submitted, materials are ready, and Human Review Confirmation is missing | `review-submitted` | Truly waiting for human review. |
80
- | Human Review Confirmation exists, but closeout / ledger / lessons are not fully closed | `confirmed-finalization-pending` | Accountability moved to the reviewer, but governance closeout remains. |
81
- | Human Review Confirmation exists, and closeout / ledger / lesson routing are complete | `finalized` | Truly complete and traceable. |
97
+ | `task-review` was submitted, materials are ready, and `INDEX.md` does not show human confirmation | `review-submitted` | Truly waiting for human review. |
98
+ | `INDEX.md` shows human confirmation, but closeout / ledger / lessons are not fully closed | `confirmed-finalization-pending` | Accountability moved to the reviewer, but governance closeout remains. |
99
+ | `INDEX.md` shows human confirmation, and closeout / ledger / lesson routing are complete | `finalized` | Truly complete and traceable. |
82
100
  | `task.state = blocked` without a review blocker | `active-blocked` | Execution is blocked. |
83
101
  | `task.state = in_progress` | `active` | Work is active. |
84
102
  | `task.state = planned/not_started` | `ready` | Work has not started; not in human review by default. |
@@ -91,9 +109,9 @@ flowchart TB
91
109
  | `required` | Review document exists, but the packet is not ready for human review. |
92
110
  | `submitted` | An agent submitted a review packet. This is not human confirmation. |
93
111
  | `blocked-open-findings` | There is an open P0-P2 finding or a finding that blocks release / confirmation. |
94
- | `confirmed` | `Human Review Confirmation` exists. |
112
+ | `confirmed` | `INDEX.md` Task Audit Metadata has `Human Review Status: confirmed` and committed audit fields. |
95
113
 
96
- Agent self-review, subagent review, and coordinator review can only move a task toward `submitted`. Only `review-confirm` or an explicit Dashboard Workbench human confirmation writes `Human Review Confirmation`.
114
+ Agent self-review, subagent review, and coordinator review can only move a task toward `submitted`. Only `review-confirm` or an explicit Dashboard Workbench human confirmation writes the confirmation audit fields in `INDEX.md`.
97
115
 
98
116
  ## Lifecycle Queues
99
117
 
@@ -135,11 +153,11 @@ Global governance tables only keep index, state, route, and audit summary. They
135
153
 
136
154
  | Layer | Should record | Should not record |
137
155
  | --- | --- | --- |
138
- | Global tables: Harness Ledger, Closeout SSoT, Regression SSoT, Cadence Ledger, Delivery SSoT | Current state, owner, task/module/detail links, regression gate, delivery sequence, closeout or audit summary | Module-internal steps, undecided lesson candidates, full command output, long evidence paragraphs, review transcripts, temporary repair prompts |
156
+ | Global tables: Harness Ledger, Closeout Index, Regression SSoT, Cadence Ledger, Delivery SSoT | Current state, owner, task/module/detail links, regression gate, delivery sequence, closeout or audit summary | Module-internal steps, undecided lesson candidates, full command output, long evidence paragraphs, review transcripts, temporary repair prompts |
139
157
  | Module layer: Module Registry, `module_plan.md` | Module boundary, module steps, handoff, current blockers, and local evidence indexes | Final promoted lesson body or cross-module release audit ledger |
140
158
  | Task layer: `brief.md`, `task_plan.md`, `progress.md`, `review.md`, `lesson_candidates.md`, `lessons/LC-*.md`, `artifacts/INDEX.md` | Execution detail, evidence, agent review, candidate lessons, task-local lesson detail, repair prompts, and raw artifact routing | Cross-task ledgers or promoted lesson detail bodies |
141
159
 
142
- The checker enforces this boundary for new global table rows. Overloaded rows that already existed before 2026-05-24 are surfaced in Dashboard migration advice as `legacy-report-only`; they are not automatically deleted or bulk-rewritten. New rows that continue placing task/module-local detail in global tables are reported as `governance-table-entropy` failures. Lesson candidates stay in `lesson_candidates.md`; candidates that enter `needs-promotion` must link a task-local `lessons/LC-*.md` detail artifact, and accepted reusable lessons live in `docs/01-GOVERNANCE/lessons/*.md`. The fix is to keep the global summary row and move detail into module/task/detail documents linked from that row.
160
+ The checker enforces this boundary for new global table rows. Overloaded rows that already existed before 2026-05-24 are surfaced in Dashboard migration advice as `legacy-report-only`; they are not automatically deleted or bulk-rewritten. New rows that continue placing task/module-local detail in global tables are reported as `governance-table-entropy` failures. Lesson candidates stay in `lesson_candidates.md`; candidates that enter `needs-promotion` must link a task-local `lessons/LC-*.md` detail artifact, and accepted reusable lessons live in `coding-agent-harness/governance/lessons/*.md`. The fix is to keep the global summary row and move detail into module/task/detail documents linked from that row.
143
161
 
144
162
  ## Human Confirmation Loop
145
163
 
@@ -167,16 +185,15 @@ sequenceDiagram
167
185
  else accepted
168
186
  API->>Lifecycle: confirmTaskReview()
169
187
  Lifecycle->>Lifecycle: verify clean Git state, identity, hooks, allowlist
170
- Lifecycle->>Docs: write Human Review Confirmation
171
- Lifecycle->>Docs: append review-confirm log
172
- Lifecycle->>Lifecycle: commit allowlisted review/progress files
188
+ Lifecycle->>Docs: write confirmation fields to INDEX.md
189
+ Lifecycle->>Lifecycle: commit allowlisted INDEX.md
173
190
  Lifecycle->>Docs: record confirmation commit SHA + committed audit status
174
191
  API->>Scanner: regenerate dashboard snapshot
175
192
  API-->>UI: confirmed task
176
193
  end
177
194
  ```
178
195
 
179
- Strict rule: an agent can prepare review evidence and submit the task for review, but the task is not human-confirmed until the Human Review Confirmation block exists. Confirmation must use gated auto-commit: the CLI and Workbench reject dirty Git state, missing commit identity, hook/preflight failure, or writes outside the current task `review.md` / `progress.md` allowlist, and return recovery guidance.
196
+ Strict rule: an agent can prepare review evidence and submit the task for review, but the task is not human-confirmed until the task `INDEX.md` contains committed confirmation audit fields. Confirmation must use gated auto-commit: the CLI and Workbench reject dirty Git state, missing commit identity, hook/preflight failure, or writes outside the current task `INDEX.md` allowlist, and return recovery guidance.
180
197
 
181
198
  CLI-owned mechanical writes and agent-owned manual slices have different boundaries. `new-task`, `task-*`, `task-phase`, `module-step`, `review-confirm`, `lesson-sediment`, and `lesson-promote --apply` acquire a lock, restrict writes to an allowlist, and auto-commit in a clean Git root. When an agent manually edits code, templates, or task docs, it still needs to proactively commit after verification; if it cannot commit, it must record the no-commit reason, owner, and next step, and must not mix unrelated dirty changes into the task commit.
182
199
 
@@ -5,9 +5,10 @@ English mirror: `docs-release/guides/task-state-machine.en-US.md`
5
5
  Coding Agent Harness 的任务状态不是一个单字段。Dashboard 里看到的生命周期由多个文件共同推导:
6
6
 
7
7
  - `progress.md` 记录原始 `task.state` 和执行证据。
8
- - `review.md` 记录 Agent Review Submission、material findings 和 Human Review Confirmation。
8
+ - `review.md` 记录 Agent Review Submission、material findings 和审查证据。
9
+ - `INDEX.md` 记录任务审计元数据,包括任务创建和人工确认审计字段。
9
10
  - `lesson_candidates.md` 记录 lesson candidate 的人工判定和后续沉淀路由。
10
- - `10-WALKTHROUGH/Closeout-SSoT.md` 记录任务是否完成收口,并链接 walkthrough。
11
+ - `coding-agent-harness/governance/generated/Closeout-Index.md` 记录任务是否完成收口,并链接 walkthrough。
11
12
  - Tombstone / supersede 信息记录任务是否被软删除、合并、归档或替代。
12
13
  - Scanner 从这些文件推导 `lifecycleState`、`reviewStatus`、`closeoutStatus`、`taskQueues[]`、`queueReasons[]` 和 `repairPrompt`。
13
14
 
@@ -32,20 +33,37 @@ stateDiagram-v2
32
33
  finalized --> [*]
33
34
  ```
34
35
 
35
- `task-review` 表示 Agent 提交审查材料包,不表示人工批准。`review-confirm` 才表示 Human Review Confirmation。`task-complete` / closeout 也不是 review confirmation 的替代品。
36
+ `task-review` 表示 Agent 提交审查材料包,不表示人工批准。`review-confirm` 才表示人工确认门禁,并把审计字段写入 `INDEX.md`。`task-complete` / closeout 也不是 review confirmation 的替代品。
37
+
38
+ ## 阶段类型地图
39
+
40
+ `visual_map.md` 是机器可读的阶段时间线。新的阶段表可以包含 `Kind`、`Exit Command` 和 `Actor` 三列:
41
+
42
+ | Kind | 作用 | 是否计入实现完成度 | 典型出口 |
43
+ | --- | --- | --- | --- |
44
+ | `init` | 范围、上下文、预算和执行策略。 | 否 | `harness task-start <task-id>` |
45
+ | `execution` | 实现、文档和验证切片。 | 是 | `harness task-phase <task-id> <phase-id> --state done --completion 100 --evidence present` |
46
+ | `gate` | Agent 提交审查、人工确认、lesson routing、walkthrough 和 closeout。 | 否 | `harness task-review`、`harness review-confirm` 或 `harness task-complete` |
47
+
48
+ 旧阶段表没有 `Kind` 也继续有效,默认按 `execution` 处理。
49
+ Dashboard 实现完成度只计算非 skipped 的 `execution` 阶段。
50
+ Gate 阶段用于解释下一步生命周期动作和责任人,不会让已完成的实现看起来未完成。
51
+ Agent 只能执行 `Actor: agent` 的 `Exit Command`。`Actor: human` 的 gate,尤其是 `review-confirm`,必须由人工明确执行。
36
52
 
37
53
  ## 派生状态
38
54
 
39
55
  ```mermaid
40
56
  flowchart TB
41
57
  Progress["progress.md<br/>task.state + evidence"]
42
- Review["review.md<br/>Agent Review Submission + findings + Human Review Confirmation"]
58
+ Index["INDEX.md<br/>Task Audit Metadata"]
59
+ Review["review.md<br/>Agent Review Submission + findings + evidence"]
43
60
  Lessons["lesson_candidates.md<br/>decision + sedimentation route"]
44
- Closeout["Closeout-SSoT.md<br/>closeout row + walkthrough"]
61
+ Closeout["Closeout-Index.md<br/>closeout row + walkthrough"]
45
62
  Tombstone["tombstone / supersede metadata"]
46
63
  Scanner["scanner"]
47
64
 
48
65
  Progress --> Scanner
66
+ Index --> Scanner
49
67
  Review --> Scanner
50
68
  Lessons --> Scanner
51
69
  Closeout --> Scanner
@@ -62,8 +80,8 @@ flowchart TB
62
80
  | 字段 | 来源 | 作用 |
63
81
  | --- | --- | --- |
64
82
  | `task.state` | `progress.md` | 原始执行阶段。 |
65
- | `reviewStatus` | `review.md` + findings + Human Review Confirmation | 区分缺审查、Agent 已提交审查、阻塞、人工确认。 |
66
- | `closeoutStatus` | `Closeout-SSoT.md` | 区分收口缺失、待处理、已关闭。 |
83
+ | `reviewStatus` | `INDEX.md` Task Audit Metadata + `review.md` findings/submission | 区分缺审查、Agent 已提交审查、阻塞、人工确认。 |
84
+ | `closeoutStatus` | `Closeout-Index.md` | 区分收口缺失、待处理、已关闭。 |
67
85
  | `lifecycleState` | scanner 派生 | Dashboard 的主生命周期语义。 |
68
86
  | `taskQueues[]` | scanner 派生 | 任务属于哪些生命周期队列。一个任务可同时在多个治理队列中可见。 |
69
87
  | `queueReasons[]` | scanner 派生 | 为什么进入队列,以及对应源文件、字段和修复动作。 |
@@ -76,9 +94,9 @@ flowchart TB
76
94
  | 有 tombstone、superseded-by、archive 或 abandoned 标记 | `soft-deleted-superseded` | 默认隐藏,但保留审计和替代链。 |
77
95
  | 有 open P0-P2 finding、非法状态转换、审计失败或人审门禁失败 | `blocked` | 不能进入人工确认,必须先修 blocker 或记录 waiver。 |
78
96
  | 标准/复杂任务缺必需文件、章节、证据、lesson decision 或 review submission | `missing-materials` | 需要 Agent 补材料,不属于人审队列。 |
79
- | 已执行 `task-review`,材料齐全,且未 Human Review Confirmation | `review-submitted` | 真正等待人审。 |
80
- | Human Review Confirmation,但 closeout / ledger / lessons 仍未全部收口 | `confirmed-finalization-pending` | 责任已转移给确认人,但治理收口仍待完成。 |
81
- | Human Review Confirmation,且 closeout / ledger / lesson routing 完成 | `finalized` | 真正完成,可只读追溯。 |
97
+ | 已执行 `task-review`,材料齐全,且 `INDEX.md` 尚未显示人工确认 | `review-submitted` | 真正等待人审。 |
98
+ | `INDEX.md` 已显示人工确认,但 closeout / ledger / lessons 仍未全部收口 | `confirmed-finalization-pending` | 责任已转移给确认人,但治理收口仍待完成。 |
99
+ | `INDEX.md` 已显示人工确认,且 closeout / ledger / lesson routing 完成 | `finalized` | 真正完成,可只读追溯。 |
82
100
  | `task.state = blocked` 但没有 review blocker | `active-blocked` | 执行阻塞。 |
83
101
  | `task.state = in_progress` | `active` | 执行中。 |
84
102
  | `task.state = planned/not_started` | `ready` | 准备中,默认不进入人审队列。 |
@@ -91,9 +109,9 @@ flowchart TB
91
109
  | `required` | 有 review 文档,但还没有足够材料可提交人审。 |
92
110
  | `submitted` | Agent 已提交审查材料包;这不是人工确认。 |
93
111
  | `blocked-open-findings` | 有 open P0-P2 finding,或 finding 阻塞发布 / 确认。 |
94
- | `confirmed` | 已写入 `Human Review Confirmation`。 |
112
+ | `confirmed` | `INDEX.md` Task Audit Metadata 包含 `Human Review Status: confirmed` 和已提交审计字段。 |
95
113
 
96
- Agent 自查、subagent 审查和 coordinator 审查都只能让任务接近 `submitted`。只有 `review-confirm` 或 Workbench 的明确人工确认动作会写入 `Human Review Confirmation`。
114
+ Agent 自查、subagent 审查和 coordinator 审查都只能让任务接近 `submitted`。只有 `review-confirm` 或 Workbench 的明确人工确认动作会把确认审计字段写入 `INDEX.md`。
97
115
 
98
116
  ## 生命周期队列
99
117
 
@@ -136,7 +154,7 @@ Review 队列只等人确认。缺材料、阻塞、lesson 沉淀、已确认待
136
154
 
137
155
  | 层级 | 应该记录什么 | 不应该记录什么 |
138
156
  | --- | --- | --- |
139
- | 全局表:Harness Ledger、Closeout SSoT、Regression SSoT、Cadence Ledger、Delivery SSoT | 当前状态、负责人、任务/模块/详情文档链接、回归 gate、交付顺序、收口或审计摘要 | 模块内步骤、未判定 lesson candidate、完整命令输出、长证据段落、review transcript、临时 repair prompt |
157
+ | 全局表:Harness Ledger、Closeout Index、Regression SSoT、Cadence Ledger、Delivery SSoT | 当前状态、负责人、任务/模块/详情文档链接、回归 gate、交付顺序、收口或审计摘要 | 模块内步骤、未判定 lesson candidate、完整命令输出、长证据段落、review transcript、临时 repair prompt |
140
158
  | 模块层:Module Registry、`module_plan.md` | 模块边界、模块内步骤、handoff、当前阻塞和局部证据索引 | 已 promotion 的全局 lesson 正文、跨模块发布审计总账 |
141
159
  | 任务层:`brief.md`、`task_plan.md`、`progress.md`、`review.md`、`lesson_candidates.md`、`lessons/LC-*.md`、`artifacts/INDEX.md` | 执行细节、证据、agent review、候选 lesson、task-local lesson 详情、修复提示和 raw artifact 路由 | 跨任务总账或 promoted lesson 详情正文 |
142
160
 
@@ -145,7 +163,7 @@ Checker 对新增全局表行执行该边界。2026-05-24 之前已经存在的
145
163
  新增行如果把 task/module 局部细节继续塞进全局表,会作为 `governance-table-entropy`
146
164
  失败项报告。Lesson candidate 留在 `lesson_candidates.md`;进入 `needs-promotion`
147
165
  的候选必须链接任务本地 `lessons/LC-*.md` 详情文件,已接受的经验再写入
148
- `docs/01-GOVERNANCE/lessons/*.md` promoted 详情文档。修复方式是保留必要全局摘要行,
166
+ `coding-agent-harness/governance/lessons/*.md` promoted 详情文档。修复方式是保留必要全局摘要行,
149
167
  把细节移动到 module/task/detail 文档并在全局表中链接过去。
150
168
 
151
169
  ## 人工确认闭环
@@ -174,16 +192,15 @@ sequenceDiagram
174
192
  else accepted
175
193
  API->>Lifecycle: confirmTaskReview()
176
194
  Lifecycle->>Lifecycle: verify Git clean, identity, hooks, allowlist
177
- Lifecycle->>Docs: write Human Review Confirmation
178
- Lifecycle->>Docs: append review-confirm log
179
- Lifecycle->>Lifecycle: commit allowlisted review/progress files
195
+ Lifecycle->>Docs: write confirmation fields to INDEX.md
196
+ Lifecycle->>Lifecycle: commit allowlisted INDEX.md
180
197
  Lifecycle->>Docs: record confirmation commit SHA + committed audit status
181
198
  API->>Scanner: regenerate dashboard snapshot
182
199
  API-->>UI: confirmed task
183
200
  end
184
201
  ```
185
202
 
186
- 严格规则:Agent 可以准备 review evidence,也可以提交审查;但任务只有在 Human Review Confirmation block 存在后,才算人工确认。确认动作必须通过 gated auto-commit:Git 状态不干净、提交身份缺失、hook/preflight 失败,或待写文件超出当前任务 `review.md` / `progress.md` 白名单时,CLI 和 Workbench 都会拒绝并返回恢复建议。
203
+ 严格规则:Agent 可以准备 review evidence,也可以提交审查;但任务只有在任务 `INDEX.md` 包含已提交的确认审计字段后,才算人工确认。确认动作必须通过 gated auto-commit:Git 状态不干净、提交身份缺失、hook/preflight 失败,或待写文件超出当前任务 `INDEX.md` 白名单时,CLI 和 Workbench 都会拒绝并返回恢复建议。
187
204
 
188
205
  CLI-owned 机械写入和 agent-owned 手工切片是两条边界。`new-task`、`task-*`、`task-phase`、`module-step`、`review-confirm`、`lesson-sediment` 和 `lesson-promote --apply` 会在干净 Git root 中加锁、限制写入范围并自动提交。Agent 手工编辑代码、模板或任务文档时仍要在验证后主动提交;无法提交时必须记录 no-commit reason、owner 和下一步,不能把 unrelated dirty changes 混入任务提交。
189
206
 
@@ -0,0 +1,96 @@
1
+ # TypeScript Runtime Migration Closeout
2
+
3
+ This closeout records the public package rule after the progressive JavaScript to
4
+ TypeScript runtime migration. The package now executes committed
5
+ `dist/**/*.mjs` artifacts, while `scripts/**/*.mts` and `tests/**/*.mts` are the
6
+ source ownership surfaces. Historical checked-in `scripts/**/*.mjs` and
7
+ `tests/**/*.mjs` shims have been removed after the dist observation gates passed.
8
+
9
+ ## Current State
10
+
11
+ All Node runtime and test sources under `scripts/` and `tests/` are now
12
+ TypeScript-first:
13
+
14
+ - `scripts/**/*.mts` builds to committed `dist/**/*.mjs` artifacts.
15
+ - `tests/**/*.mts` runs through the built test runner.
16
+ - `dist/**/*.mjs` is the package runtime surface for npm bin, npm scripts, and
17
+ postinstall.
18
+ - `scripts/**/*.mjs` and `tests/**/*.mjs` have a final inventory of zero.
19
+
20
+ The npm package publishes `dist/` and no longer publishes `scripts/` or `tests/`.
21
+ This keeps installed execution independent from TypeScript source files and from
22
+ the deleted historical shims.
23
+
24
+ ## Final Closeout Evidence
25
+
26
+ The TS-first runtime closeout is based on the PR-28 deletion gate plus the PR-29
27
+ final inventory:
28
+
29
+ - final `scripts/` and `tests/` JavaScript shim inventory is zero;
30
+ - packed package file inventory includes `dist/` and excludes `scripts/` and
31
+ `tests/`;
32
+ - Node 24 tarball smoke proved installed `harness` commands execute from
33
+ `dist/` with a temporary `HOME` and PATH isolated to the temp consumer
34
+ `node_modules/.bin`;
35
+ - source-package and target-project checks pass through `dist/harness.mjs`;
36
+ - snapshot matrix reported no blocking drift after shim deletion.
37
+
38
+ That means remaining package-included JavaScript is not unfinished CLI/test
39
+ runtime migration work. The remaining files are the documented preset and
40
+ dashboard exceptions below.
41
+
42
+ ## Runtime Contract
43
+
44
+ The package is an ESM package and its current public runtime contract points at
45
+ the committed dist build output:
46
+
47
+ - `package.json` maps the `harness` executable to `dist/harness.mjs`.
48
+ - npm postinstall runs `dist/postinstall.mjs`.
49
+ - npm helper scripts such as `check`, `status`, and dashboard generation run
50
+ through `dist/harness.mjs`.
51
+ - Runtime modules import sibling `.mjs` files inside `dist/`, so installed
52
+ package execution does not depend on TypeScript loaders.
53
+
54
+ The PR-27 observation gate proved the package was dist-primary before deletion.
55
+ The PR-28 deletion gate keeps that proof executable by requiring final inventory
56
+ counts of zero for `scripts/**/*.mjs` and `tests/**/*.mjs`, package dry-run with
57
+ no `scripts/**` or `tests/**`, snapshot matrix, and Node 24 tarball smoke.
58
+
59
+ ## Documented Exceptions
60
+
61
+ The following package-included JavaScript files are not part of the Node runtime
62
+ source-twin cleanup target.
63
+
64
+ | Path | Reason To Keep |
65
+ | --- | --- |
66
+ | `presets/legacy-migration/checks/preset-check.mjs` | Preset executable hook. It belongs to the preset extension surface, not core runtime migration. |
67
+ | `presets/legacy-migration/scripts/plan-work-queue.mjs` | Preset helper script loaded as packaged preset material. |
68
+ | `presets/legacy-migration/scripts/scaffold-task-contracts.mjs` | Preset helper script loaded as packaged preset material. |
69
+ | `templates/dashboard/assets/app-src/*.js` | Browser dashboard source assets. They are shipped as template assets, not Node runtime modules. |
70
+ | `templates/dashboard/assets/app.js` | Built browser dashboard bundle. Keep until a separate dashboard asset pipeline replaces it. |
71
+ | `templates/dashboard/assets/i18n.js` | Browser dashboard localization asset. |
72
+ | `templates/dashboard/assets/markdown-reader.js` | Browser dashboard helper asset. |
73
+ | `templates/dashboard/assets/mermaid-renderer.js` | Browser dashboard helper asset. |
74
+
75
+ These files should not be deleted by a runtime `.mjs` cleanup PR. If they are
76
+ migrated later, use a dedicated preset or dashboard asset migration plan with its
77
+ own package and browser checks.
78
+
79
+ ## Future Cleanup Gate
80
+
81
+ Any future PR that removes or migrates the remaining preset/dashboard JavaScript
82
+ exceptions must prove all of the following for its own surface:
83
+
84
+ - package `bin` and `postinstall` still work from a packed tarball;
85
+ - installed package execution works with a temp `HOME` and PATH isolated to the
86
+ temp consumer `node_modules/.bin`;
87
+ - `npm pack --dry-run --json` includes the intended runtime files and excludes
88
+ private, temporary, and test-only material;
89
+ - snapshot matrix has no blocking drift;
90
+ - real target smoke passes;
91
+ - the PR is independently revertible without reverting the earlier dist runtime
92
+ cutover or the PR-28 historical shim deletion.
93
+
94
+ `dist/**/*.mjs` remains the supported package execution surface. Preset `.mjs`
95
+ hooks and dashboard browser `.js` assets remain documented exceptions, not
96
+ unfinished CLI runtime migration work.
@@ -1,4 +1,4 @@
1
1
  # Minimal Harness Example
2
2
 
3
- Use `docs/11-REFERENCE/` for project rules and `docs/09-PLANNING/TASKS/` for
4
- task execution records.
3
+ Use `coding-agent-harness/governance/standards/` for project rules and
4
+ `coding-agent-harness/planning/tasks/` for task execution records.
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ locale: en-US
3
+ capabilities:
4
+ - core
5
+ - dashboard
6
+ structure:
7
+ harnessRoot: coding-agent-harness
8
+ planningRoot: coding-agent-harness/planning
9
+ tasksRoot: coding-agent-harness/planning/tasks
10
+ modulesRoot: coding-agent-harness/planning/modules
11
+ externalRoot: coding-agent-harness/planning/external
12
+ governanceRoot: coding-agent-harness/governance
13
+ generatedRoot: coding-agent-harness/governance/generated
14
+ regressionRoot: coding-agent-harness/governance/regression
@@ -0,0 +1,60 @@
1
+ # Demo task - Task Package Index
2
+
3
+ Task Contract: harness-task/v1
4
+
5
+ ## Task Identity
6
+
7
+ | Field | Value |
8
+ | --- | --- |
9
+ | Task ID | `demo-task` |
10
+ | Budget | `standard` |
11
+ | Preset | `none` |
12
+ | Module | `n/a` |
13
+ | Long-running | `no` |
14
+ | Created | 2026-05-25 |
15
+
16
+ ## Task Audit Metadata
17
+
18
+ | Field | Value |
19
+ | --- | --- |
20
+ | Created By | historical-backfill |
21
+ | Created At | 2026-05-25 |
22
+ | Command Shape | n/a |
23
+ | Budget | standard |
24
+ | Template Source | examples/minimal-project historical fixture |
25
+ | Task Creator | n/a |
26
+ | Task Creator Source | legacy-unavailable |
27
+ | Human Review Status | not-confirmed |
28
+ | Confirmation ID | n/a |
29
+ | Confirmed At | n/a |
30
+ | Reviewer | n/a |
31
+ | Reviewer Email | n/a |
32
+ | Confirm Text | n/a |
33
+ | Evidence Checked | n/a |
34
+ | Review Commit SHA | n/a |
35
+ | Audit Source | migrated-legacy-scaffold |
36
+ | Audit Status | migrated |
37
+ | Exception Reason | Existing demo task predates scaffold provenance enforcement. |
38
+ | Message | n/a |
39
+ | Migration Status | migrated |
40
+ | Migrated From | brief.md#Scaffold Provenance |
41
+ | Legacy Extra Fields | {} |
42
+ | Migration Notes | example fixture backfilled to INDEX audit metadata |
43
+
44
+ ## Core Contract Files
45
+
46
+ | File | Purpose |
47
+ | --- | --- |
48
+ | `brief.md` | Human-readable task summary and context entry. |
49
+ | `task_plan.md` | Current task goal, scope, selected budget, acceptance, and operating decisions. |
50
+ | `visual_map.md` | Phase map, evidence status, next lifecycle commands, and supporting diagrams. |
51
+ | `progress.md` | Execution log, verification evidence, decisions, and handoff notes. |
52
+
53
+ ## Standard Task Files
54
+
55
+ | File | Purpose |
56
+ | --- | --- |
57
+ | `execution_strategy.md` | Execution mode, ownership, conflict control, and evidence strategy. |
58
+ | `findings.md` | Findings, research notes, accepted risks, and unresolved questions. |
59
+ | `lesson_candidates.md` | Task-local lesson candidate decisions before closeout. |
60
+ | `review.md` | Agent review submission, adversarial review, findings, evidence, and routing. |
@@ -0,0 +1,11 @@
1
+ # Demo Task - Progress
2
+
3
+ ## Status
4
+
5
+ in-progress
6
+
7
+ ## Updates
8
+
9
+ | Date | Update | Evidence |
10
+ | --- | --- | --- |
11
+ | 2026-05-18 | Created example visual map | report:TARGET:coding-agent-harness/planning/tasks/demo-task/visual_map.md:example phase table |
@@ -14,7 +14,7 @@ No material finding for this example.
14
14
 
15
15
  | Evidence ID | Type | Path | Summary |
16
16
  | --- | --- | --- | --- |
17
- | E-001 | review | TARGET:docs/09-PLANNING/TASKS/demo-task/task_plan.md | Visual roadmap table exists |
17
+ | E-001 | review | TARGET:coding-agent-harness/planning/tasks/demo-task/task_plan.md | Visual map table exists |
18
18
 
19
19
  ## Findings
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-agent-harness",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Document governance kernel for long-running coding agents.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -23,18 +23,23 @@
23
23
  "url": "https://github.com/FairladyZ625/coding-agent-harness/issues"
24
24
  },
25
25
  "bin": {
26
- "harness": "scripts/harness.mjs"
26
+ "harness": "dist/harness.mjs"
27
27
  },
28
28
  "scripts": {
29
- "check": "node scripts/harness.mjs check --profile source-package .",
30
- "check:private": "node scripts/harness.mjs check --profile private-harness .harness-private",
31
- "status": "node scripts/harness.mjs status --json .",
32
- "dashboard": "node scripts/harness.mjs dashboard --out tmp/harness-dashboard.html examples/minimal-project",
33
- "dashboard:folder": "node scripts/harness.mjs dashboard --out-dir tmp/harness-dashboard examples/minimal-project",
29
+ "check": "node dist/harness.mjs check --profile source-package .",
30
+ "check:private": "node dist/harness.mjs check --profile private-harness .harness-private",
31
+ "build:runtime": "node scripts/build-dist.mts",
32
+ "prepack": "node scripts/build-dist.mts --quiet",
33
+ "typecheck": "npm exec --yes --package typescript@5.9.3 -- tsc -p tsconfig.json",
34
+ "typecheck:guards": "node dist/check-type-boundaries.mjs",
35
+ "status": "node dist/harness.mjs status --json .",
36
+ "dashboard": "node dist/harness.mjs dashboard --out tmp/harness-dashboard.html examples/minimal-project",
37
+ "dashboard:folder": "node dist/harness.mjs dashboard --out-dir tmp/harness-dashboard examples/minimal-project",
34
38
  "pack:dry-run": "npm pack --dry-run --json",
35
- "postinstall": "node scripts/postinstall.mjs",
36
- "smoke:dashboard": "node tests/smoke-dashboard.mjs",
37
- "test": "node tests/run-all.mjs"
39
+ "postinstall": "node dist/postinstall.mjs",
40
+ "observe:dist": "node dist/check-dist-observation.mjs --skip-pack --skip-install-smoke",
41
+ "smoke:dashboard": "node dist/run-built-tests.mjs --test tests/smoke-dashboard.mjs",
42
+ "test": "node dist/run-built-tests.mjs"
38
43
  },
39
44
  "files": [
40
45
  "README.md",
@@ -43,18 +48,22 @@
43
48
  "CONTRIBUTING.md",
44
49
  "CHANGELOG.md",
45
50
  "SKILL.md",
51
+ "tsconfig.json",
52
+ "tsconfig.dist.json",
53
+ "tsconfig.runtime.json",
46
54
  "LICENSE",
55
+ "LICENSE-EXCEPTION.md",
47
56
  "references/",
48
57
  "skills/",
49
58
  "presets/",
50
59
  "templates/",
51
60
  "templates-zh-CN/",
52
- "scripts/",
61
+ "dist/",
53
62
  "docs-release/",
54
63
  "examples/"
55
64
  ],
56
65
  "engines": {
57
- "node": ">=18"
66
+ "node": ">=24"
58
67
  },
59
- "license": "MIT"
68
+ "license": "AGPL-3.0-or-later"
60
69
  }
@@ -43,7 +43,7 @@ templateValues:
43
43
  entrypoints:
44
44
  newTask:
45
45
  type: template
46
- writes: [docs/09-PLANNING/TASKS/**]
46
+ writes: [coding-agent-harness/planning/tasks/**]
47
47
  reads: [session.json]
48
48
  audit: true
49
49
  templates:
@@ -55,19 +55,19 @@ entrypoints:
55
55
  plan:
56
56
  type: script
57
57
  command: scripts/plan-work-queue.mjs
58
- writes: [docs/09-PLANNING/TASKS/**]
58
+ writes: [coding-agent-harness/planning/tasks/**]
59
59
  reads: [docs/**, .git/**]
60
60
  audit: true
61
61
  scaffold:
62
62
  type: script
63
63
  command: scripts/scaffold-task-contracts.mjs
64
- writes: [docs/09-PLANNING/TASKS/**]
64
+ writes: [coding-agent-harness/planning/tasks/**]
65
65
  reads: [docs/**]
66
66
  audit: true
67
67
  check:
68
68
  type: check
69
69
  command: checks/preset-check.mjs
70
- writes: [docs/09-PLANNING/TASKS/**]
70
+ writes: [coding-agent-harness/planning/tasks/**]
71
71
  reads: [docs/**]
72
72
  audit: true
73
73
  workbench:
@@ -130,5 +130,5 @@ audit:
130
130
  evidenceFiles: [preset-manifest.json, preset-audit.json, write-scope.json]
131
131
  writeScopes:
132
132
  taskArtifacts:
133
- path: docs/09-PLANNING/TASKS/**
133
+ path: coding-agent-harness/planning/tasks/**
134
134
  access: write
@@ -15,4 +15,4 @@ Declare lanes before dispatching workers.
15
15
 
16
16
  | Lane ID | Allowed globs | Forbidden globs | Shared file owner | Worktree / branch | Handoff path | Merge order | Verification command |
17
17
  | --- | --- | --- | --- | --- | --- | --- | --- |
18
- | coordinator | docs/09-PLANNING/TASKS/** | AGENTS.md, CLAUDE.md, docs/Harness-Ledger.md until closeout | coordinator | current | progress.md | 1 | harness check --profile target-project . |
18
+ | coordinator | coding-agent-harness/planning/tasks/** | AGENTS.md, CLAUDE.md, coding-agent-harness/governance/generated/Harness-Ledger.md until closeout | coordinator | current | progress.md | 1 | harness check --profile target-project . |
@@ -9,14 +9,14 @@ task:
9
9
  entrypoints:
10
10
  newTask:
11
11
  type: template
12
- writes: [docs/09-PLANNING/TASKS/**]
13
- reads: [docs/09-PLANNING/TASKS/**/lesson_candidates.md]
12
+ writes: [coding-agent-harness/planning/tasks/**]
13
+ reads: [coding-agent-harness/planning/tasks/**/lesson_candidates.md]
14
14
  audit: true
15
15
  templates:
16
16
  prompt: templates/prompt.md
17
17
  writeScopes:
18
18
  taskDocs:
19
- path: docs/09-PLANNING/TASKS/**
19
+ path: coding-agent-harness/planning/tasks/**
20
20
  access: write
21
21
  audit:
22
22
  manifestRequired: true
@@ -8,7 +8,7 @@ task:
8
8
  entrypoints:
9
9
  newTask:
10
10
  type: template
11
- writes: [docs/09-PLANNING/**]
11
+ writes: [coding-agent-harness/planning/**]
12
12
  audit: true
13
13
  templates:
14
14
  taskPlanAppend: templates/task_plan.append.md
@@ -21,5 +21,5 @@ audit:
21
21
  evidenceFiles: [preset-audit.json]
22
22
  writeScopes:
23
23
  planningDocs:
24
- path: docs/09-PLANNING/**
24
+ path: coding-agent-harness/planning/**
25
25
  access: write
@@ -3,6 +3,6 @@
3
3
  | Field | Value |
4
4
  | --- | --- |
5
5
  | Module Key | {{moduleKey}} |
6
- | Module Plan | docs/09-PLANNING/MODULES/{{moduleKey}}/module_plan.md |
6
+ | Module Plan | coding-agent-harness/planning/modules/{{moduleKey}}/module_plan.md |
7
7
 
8
8
  Keep shared module decisions in the module plan or module context files. Keep task-specific evidence in this task directory.
@@ -12,6 +12,6 @@ Read these module-level entry points before changing shared module behavior. Con
12
12
 
13
13
  | Reference | Path | Why / When |
14
14
  | --- | --- | --- |
15
- | Module brief | docs/09-PLANNING/MODULES/{{moduleKey}}/brief.md | Start here for the module purpose and current scope. |
16
- | Module plan | docs/09-PLANNING/MODULES/{{moduleKey}}/module_plan.md | Use this for module steps, active task links, and handoff state. |
17
- | Module visual map | docs/09-PLANNING/MODULES/{{moduleKey}}/visual_map.md | Inspect when the change affects module sequencing or dependencies. |
15
+ | Module brief | coding-agent-harness/planning/modules/{{moduleKey}}/brief.md | Start here for the module purpose and current scope. |
16
+ | Module plan | coding-agent-harness/planning/modules/{{moduleKey}}/module_plan.md | Use this for module steps, active task links, and handoff state. |
17
+ | Module visual map | coding-agent-harness/planning/modules/{{moduleKey}}/visual_map.md | Inspect when the change affects module sequencing or dependencies. |