coding-agent-harness 1.0.7 → 1.1.0

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 (238) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/CONTRIBUTING.md +9 -5
  3. package/README.md +12 -2
  4. package/README.zh-CN.md +10 -2
  5. package/SKILL.md +14 -3
  6. package/dist/build-dist.mjs +32 -6
  7. package/dist/check-dist-observation.mjs +73 -28
  8. package/dist/check-harness.mjs +0 -1
  9. package/dist/check-import-graph.mjs +44 -27
  10. package/dist/check-lite-forbidden-surfaces.mjs +121 -0
  11. package/dist/check-no-ts-nocheck.mjs +88 -0
  12. package/dist/check-runtime-emit.mjs +10 -3
  13. package/dist/check-type-boundaries.mjs +67 -8
  14. package/dist/commands/dashboard-command.mjs +52 -14
  15. package/dist/commands/migration-command.mjs +18 -8
  16. package/dist/commands/module-command.mjs +142 -0
  17. package/dist/commands/preset-command.mjs +65 -4
  18. package/dist/commands/registry.mjs +483 -0
  19. package/dist/commands/task-command.mjs +111 -53
  20. package/dist/harness.mjs +6 -303
  21. package/dist/lib/capability-registry.mjs +229 -53
  22. package/dist/lib/check-module-parallel.mjs +1 -6
  23. package/dist/lib/check-profiles.mjs +39 -46
  24. package/dist/lib/check-task-contracts.mjs +6 -4
  25. package/dist/lib/command-registry.mjs +248 -0
  26. package/dist/lib/core-shared.mjs +78 -3
  27. package/dist/lib/dashboard-data.mjs +203 -22
  28. package/dist/lib/dashboard-workbench.mjs +245 -21
  29. package/dist/lib/dashboard-writer.mjs +4 -1
  30. package/dist/lib/git-status-summary.mjs +0 -1
  31. package/dist/lib/governance-index-generator.mjs +7 -5
  32. package/dist/lib/governance-sync.mjs +46 -121
  33. package/dist/lib/governance-table-boundary.mjs +1 -14
  34. package/dist/lib/harness-core.mjs +5 -1
  35. package/dist/lib/harness-paths.mjs +115 -1
  36. package/dist/lib/impact-classifier.mjs +420 -0
  37. package/dist/lib/lesson-maintenance.mjs +1 -2
  38. package/dist/lib/markdown-utils.mjs +50 -1
  39. package/dist/lib/migration-planner.mjs +31 -16
  40. package/dist/lib/migration-support.mjs +5 -4
  41. package/dist/lib/module-registry.mjs +296 -0
  42. package/dist/lib/preset-audit-contracts.mjs +24 -1
  43. package/dist/lib/preset-engine.mjs +68 -29
  44. package/dist/lib/preset-registry.mjs +374 -72
  45. package/dist/lib/preset-runner.mjs +560 -0
  46. package/dist/lib/review-confirm-git-gate.mjs +73 -19
  47. package/dist/lib/status-builder.mjs +23 -8
  48. package/dist/lib/structure-migration.mjs +6 -4
  49. package/dist/lib/subagent-authorization-audit.mjs +8 -2
  50. package/dist/lib/task-archive-eligibility.mjs +65 -0
  51. package/dist/lib/task-audit-metadata.mjs +25 -11
  52. package/dist/lib/task-audit-migration.mjs +21 -14
  53. package/dist/lib/task-discovery-contract.mjs +32 -0
  54. package/dist/lib/task-index.mjs +4 -2
  55. package/dist/lib/task-lesson-candidates.mjs +1 -2
  56. package/dist/lib/task-lesson-sedimentation.mjs +310 -9
  57. package/dist/lib/task-lifecycle/create-task-helpers.mjs +6 -3
  58. package/dist/lib/task-lifecycle/phase-sync.mjs +0 -1
  59. package/dist/lib/task-lifecycle/preset-interop.mjs +16 -0
  60. package/dist/lib/task-lifecycle/review-confirm.mjs +34 -2
  61. package/dist/lib/task-lifecycle/review-gates.mjs +12 -5
  62. package/dist/lib/task-lifecycle/review-submission.mjs +1 -2
  63. package/dist/lib/task-lifecycle/scaffold-provenance.mjs +0 -1
  64. package/dist/lib/task-lifecycle/template-files.mjs +2 -5
  65. package/dist/lib/task-lifecycle.mjs +117 -159
  66. package/dist/lib/task-metadata.mjs +10 -5
  67. package/dist/lib/task-preset-contract-drift.mjs +45 -0
  68. package/dist/lib/task-repository.mjs +192 -0
  69. package/dist/lib/task-review-model.mjs +38 -17
  70. package/dist/lib/task-scanner.mjs +75 -23
  71. package/dist/lib/task-template-materials.mjs +131 -0
  72. package/dist/lib/task-tombstone-commands.mjs +187 -18
  73. package/dist/lib/types/check-profiles.js +1 -0
  74. package/dist/lib/types/impact.js +1 -0
  75. package/dist/lib/types/preset.js +1 -0
  76. package/dist/lib/types/task-lifecycle.js +1 -0
  77. package/dist/lib/types/task-scanner.js +1 -0
  78. package/dist/postinstall.mjs +2 -2
  79. package/dist/run-built-tests.mjs +10 -3
  80. package/docs-release/README.md +2 -1
  81. package/docs-release/architecture/document-contract-kernel/README.md +150 -0
  82. package/docs-release/architecture/document-contract-kernel/products/full-skill-overlay.md +29 -0
  83. package/docs-release/architecture/document-contract-kernel/products/lite-forbidden-surfaces.txt +26 -0
  84. package/docs-release/architecture/document-contract-kernel/products/lite-skill-overlay.md +37 -0
  85. package/docs-release/architecture/overview.md +2 -2
  86. package/docs-release/architecture/overview.zh-CN.md +2 -2
  87. package/docs-release/architecture/system-explainer/01-system-overview.md +11 -7
  88. package/docs-release/architecture/system-explainer/02-module-dependency.md +4 -4
  89. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +17 -12
  90. package/docs-release/architecture/system-explainer/05-data-flow.md +6 -6
  91. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +2 -2
  92. package/docs-release/architecture/system-explainer/README.md +1 -1
  93. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +12 -8
  94. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +5 -5
  95. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +19 -11
  96. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +5 -5
  97. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +2 -2
  98. package/docs-release/architecture/system-explainer/en-US/README.md +1 -1
  99. package/docs-release/guides/agent-installation.en-US.md +4 -6
  100. package/docs-release/guides/agent-installation.md +11 -8
  101. package/docs-release/guides/contributing.md +10 -3
  102. package/docs-release/guides/contributing.zh-CN.md +10 -3
  103. package/docs-release/guides/legacy-migration-agent-prompt.md +1 -1
  104. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +1 -1
  105. package/docs-release/guides/migration-playbook.en-US.md +9 -6
  106. package/docs-release/guides/migration-playbook.md +9 -6
  107. package/docs-release/guides/preset-development.md +68 -2
  108. package/docs-release/guides/task-state-machine.en-US.md +8 -8
  109. package/docs-release/guides/task-state-machine.md +7 -7
  110. package/docs-release/guides/typescript-runtime-migration-closeout.md +17 -13
  111. package/package.json +19 -11
  112. package/postinstall.mjs +37 -0
  113. package/presets/legacy-migration/preset.yaml +5 -5
  114. package/presets/legacy-migration/templates/execution_strategy.append.md +1 -1
  115. package/presets/lesson-sedimentation/preset.yaml +3 -3
  116. package/presets/module/preset.yaml +2 -2
  117. package/presets/module/templates/execution_strategy.append.md +1 -1
  118. package/presets/module/templates/task_plan.append.md +3 -3
  119. package/presets/release-closeout/checks/check-release-package.mjs +29 -0
  120. package/presets/release-closeout/preset.yaml +100 -0
  121. package/presets/release-closeout/scripts/generate-release-package.mjs +572 -0
  122. package/presets/release-closeout/templates/execution_strategy.append.md +7 -0
  123. package/presets/release-closeout/templates/findings.seed.md +5 -0
  124. package/presets/release-closeout/templates/review.seed.md +3 -0
  125. package/presets/release-closeout/templates/task_plan.append.md +24 -0
  126. package/presets/standard-task/preset.yaml +2 -2
  127. package/references/agents-md-pattern.md +23 -17
  128. package/references/lessons-governance.md +2 -2
  129. package/references/module-parallel-standard.md +3 -6
  130. package/references/pull-request-standard.md +2 -2
  131. package/references/ssot-governance.md +2 -2
  132. package/references/taskr-gap-analysis.md +3 -3
  133. package/run-dist.mjs +34 -0
  134. package/skills/preset-creator/SKILL.md +40 -8
  135. package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -8
  136. package/skills/preset-creator/references/preset-package-skeleton.md +15 -5
  137. package/skills/preset-creator/references/structure-aware-paths.md +112 -0
  138. package/templates/AGENTS.md.template +28 -26
  139. package/templates/architecture/README.md +2 -2
  140. package/templates/architecture/service-catalog.md +2 -2
  141. package/templates/architecture/services/service-template.md +1 -1
  142. package/templates/dashboard/assets/app-src/00-state.js +5 -1
  143. package/templates/dashboard/assets/app-src/10-router.js +7 -0
  144. package/templates/dashboard/assets/app-src/20-overview.js +8 -8
  145. package/templates/dashboard/assets/app-src/30-tasks.js +132 -40
  146. package/templates/dashboard/assets/app-src/32-task-swimlane.js +314 -0
  147. package/templates/dashboard/assets/app-src/35-task-detail.js +35 -5
  148. package/templates/dashboard/assets/app-src/40-modules.js +257 -41
  149. package/templates/dashboard/assets/app-src/45-review.js +127 -1
  150. package/templates/dashboard/assets/app-src/90-bindings.js +185 -2
  151. package/templates/dashboard/assets/app.css +928 -53
  152. package/templates/dashboard/assets/app.css.manifest.json +2 -0
  153. package/templates/dashboard/assets/app.js +1071 -98
  154. package/templates/dashboard/assets/app.manifest.json +1 -0
  155. package/templates/dashboard/assets/css-src/00-foundation.css +12 -6
  156. package/templates/dashboard/assets/css-src/10-panels-flow.css +2 -2
  157. package/templates/dashboard/assets/css-src/30-task-index.css +21 -13
  158. package/templates/dashboard/assets/css-src/31-archive.css +94 -0
  159. package/templates/dashboard/assets/css-src/32-task-swimlane.css +487 -0
  160. package/templates/dashboard/assets/css-src/35-review-workspace.css +78 -0
  161. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +191 -14
  162. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +23 -0
  163. package/templates/dashboard/assets/i18n.js +166 -2
  164. package/templates/development/README.md +9 -9
  165. package/templates/development/cross-repo-debugging.md +3 -3
  166. package/templates/development/external-context/service-template.md +1 -1
  167. package/templates/development/external-source-packs/README.md +2 -2
  168. package/templates/integrations/README.md +4 -4
  169. package/templates/integrations/api-contract.md +1 -1
  170. package/templates/integrations/event-contract.md +1 -1
  171. package/templates/integrations/third-party/vendor-template.md +1 -1
  172. package/templates/integrations/webhook-contract.md +1 -1
  173. package/templates/ledger/Harness-Ledger.md +1 -1
  174. package/templates/modules/module_brief.md +50 -0
  175. package/templates/modules/module_plan.md +49 -0
  176. package/templates/modules/registry_view.md +9 -0
  177. package/templates/modules/session_prompt_pack.md +55 -0
  178. package/templates/planning/brief.md +32 -8
  179. package/templates/planning/module_brief.md +28 -3
  180. package/templates/planning/module_plan.md +26 -11
  181. package/templates/planning/module_session_prompt.md +11 -2
  182. package/templates/planning/optional/slices/_slice-template/brief.md +28 -0
  183. package/templates/planning/review.md +1 -1
  184. package/templates/planning/visual_map.md +1 -1
  185. package/templates/reference/docs-library-standard.md +7 -7
  186. package/templates/reference/execution-workflow-standard.md +13 -0
  187. package/templates/reference/external-source-intake-standard.md +10 -10
  188. package/templates/reference/pull-request-standard.md +2 -2
  189. package/templates/reference/repo-governance-standard.md +1 -1
  190. package/templates/reference/review-routing-standard.md +4 -0
  191. package/templates/ssot/Module-Registry.md +4 -38
  192. package/templates/walkthrough/walkthrough-template.md +1 -1
  193. package/templates-zh-CN/AGENTS.md.template +27 -25
  194. package/templates-zh-CN/CLAUDE.md.template +1 -1
  195. package/templates-zh-CN/architecture/README.md +2 -2
  196. package/templates-zh-CN/architecture/service-catalog.md +2 -2
  197. package/templates-zh-CN/architecture/services/service-template.md +1 -1
  198. package/templates-zh-CN/development/README.md +9 -9
  199. package/templates-zh-CN/development/cross-repo-debugging.md +3 -3
  200. package/templates-zh-CN/development/external-context/service-template.md +1 -1
  201. package/templates-zh-CN/development/external-source-packs/README.md +2 -2
  202. package/templates-zh-CN/integrations/README.md +4 -4
  203. package/templates-zh-CN/integrations/api-contract.md +1 -1
  204. package/templates-zh-CN/integrations/event-contract.md +1 -1
  205. package/templates-zh-CN/integrations/third-party/vendor-template.md +1 -1
  206. package/templates-zh-CN/integrations/webhook-contract.md +1 -1
  207. package/templates-zh-CN/ledger/Harness-Ledger.md +1 -1
  208. package/templates-zh-CN/lessons/lesson-arch-process-change.md +1 -1
  209. package/templates-zh-CN/lessons/lesson-new-doc.md +3 -3
  210. package/templates-zh-CN/lessons/lesson-ref-change.md +4 -4
  211. package/templates-zh-CN/modules/module_brief.md +47 -0
  212. package/templates-zh-CN/modules/module_plan.md +48 -0
  213. package/templates-zh-CN/modules/registry_view.md +9 -0
  214. package/templates-zh-CN/modules/session_prompt_pack.md +50 -0
  215. package/templates-zh-CN/planning/INDEX.md +1 -0
  216. package/templates-zh-CN/planning/brief.md +26 -7
  217. package/templates-zh-CN/planning/module_brief.md +24 -2
  218. package/templates-zh-CN/planning/module_plan.md +35 -29
  219. package/templates-zh-CN/planning/module_session_prompt.md +15 -11
  220. package/templates-zh-CN/planning/optional/slices/_slice-template/brief.md +28 -11
  221. package/templates-zh-CN/planning/review.md +1 -1
  222. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  223. package/templates-zh-CN/reference/delivery-operating-model-standard.md +3 -3
  224. package/templates-zh-CN/reference/docs-library-standard.md +27 -27
  225. package/templates-zh-CN/reference/execution-workflow-standard.md +12 -2
  226. package/templates-zh-CN/reference/external-source-intake-standard.md +10 -10
  227. package/templates-zh-CN/reference/harness-ledger-standard.md +3 -3
  228. package/templates-zh-CN/reference/pull-request-standard.md +1 -1
  229. package/templates-zh-CN/reference/regression-ssot-governance.md +2 -2
  230. package/templates-zh-CN/reference/repo-governance-standard.md +1 -1
  231. package/templates-zh-CN/reference/review-routing-standard.md +3 -0
  232. package/templates-zh-CN/reference/walkthrough-standard.md +2 -2
  233. package/templates-zh-CN/reference/worktree-standard.md +1 -1
  234. package/templates-zh-CN/regression/Cadence-Ledger.md +2 -2
  235. package/templates-zh-CN/ssot/Delivery-SSoT.md +2 -2
  236. package/templates-zh-CN/ssot/Module-Registry.md +5 -44
  237. package/templates-zh-CN/ssot/Regression-SSoT.md +2 -2
  238. package/templates-zh-CN/walkthrough/walkthrough-template.md +4 -4
@@ -1,25 +1,26 @@
1
1
  # TypeScript Runtime Migration Closeout
2
2
 
3
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.
4
+ TypeScript runtime migration. The package executes generated `dist/**/*.mjs`
5
+ artifacts, while `scripts/**/*.mts` and `tests/**/*.mts` are the source ownership
6
+ surfaces. Historical checked-in `scripts/**/*.mjs` and `tests/**/*.mjs` shims
7
+ have been removed after the dist observation gates passed.
8
8
 
9
9
  ## Current State
10
10
 
11
11
  All Node runtime and test sources under `scripts/` and `tests/` are now
12
12
  TypeScript-first:
13
13
 
14
- - `scripts/**/*.mts` builds to committed `dist/**/*.mjs` artifacts.
14
+ - `scripts/**/*.mts` builds to generated `dist/**/*.mjs` artifacts.
15
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.
16
+ - `dist/**/*.mjs` is the package runtime surface for npm bin and installed
17
+ execution. Source checkout npm scripts refresh it before running.
18
18
  - `scripts/**/*.mjs` and `tests/**/*.mjs` have a final inventory of zero.
19
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.
20
+ The source repository ignores `dist/`, but the npm package publishes generated
21
+ `dist/` and no longer publishes `scripts/` or `tests/`. This keeps installed
22
+ execution independent from TypeScript source files and from the deleted
23
+ historical shims.
23
24
 
24
25
  ## Final Closeout Evidence
25
26
 
@@ -42,12 +43,15 @@ dashboard exceptions below.
42
43
  ## Runtime Contract
43
44
 
44
45
  The package is an ESM package and its current public runtime contract points at
45
- the committed dist build output:
46
+ generated dist build output:
46
47
 
47
48
  - `package.json` maps the `harness` executable to `dist/harness.mjs`.
48
- - npm postinstall runs `dist/postinstall.mjs`.
49
+ - npm postinstall runs the source-safe `postinstall.mjs` bootstrap, which
50
+ delegates to `dist/postinstall.mjs` after generating `dist/` in a source
51
+ checkout.
49
52
  - npm helper scripts such as `check`, `status`, and dashboard generation run
50
- through `dist/harness.mjs`.
53
+ through `run-dist.mjs`, which refreshes `dist/` in a source checkout and then
54
+ runs the relevant dist entrypoint.
51
55
  - Runtime modules import sibling `.mjs` files inside `dist/`, so installed
52
56
  package execution does not depend on TypeScript loaders.
53
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-agent-harness",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Document governance kernel for long-running coding agents.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -26,20 +26,23 @@
26
26
  "harness": "dist/harness.mjs"
27
27
  },
28
28
  "scripts": {
29
- "check": "node dist/harness.mjs check --profile source-package .",
30
- "check:private": "node dist/harness.mjs check --profile private-harness .harness-private",
29
+ "check": "node run-dist.mjs harness.mjs check --profile source-package .",
30
+ "check:private": "node run-dist.mjs harness.mjs check --profile private-harness .harness-private",
31
31
  "build:runtime": "node scripts/build-dist.mts",
32
32
  "prepack": "node scripts/build-dist.mts --quiet",
33
+ "prepublishOnly": "node run-dist.mjs check-dist-observation.mjs --skip-install-smoke",
34
+ "prepare": "node postinstall.mjs --build-only",
33
35
  "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",
36
+ "typecheck:guards": "node run-dist.mjs check-type-boundaries.mjs && node run-dist.mjs check-no-ts-nocheck.mjs",
37
+ "check:nocheck": "node run-dist.mjs check-no-ts-nocheck.mjs",
38
+ "status": "node run-dist.mjs harness.mjs status --json .",
39
+ "dashboard": "node run-dist.mjs harness.mjs dashboard --out tmp/harness-dashboard.html examples/minimal-project",
40
+ "dashboard:folder": "node run-dist.mjs harness.mjs dashboard --out-dir tmp/harness-dashboard examples/minimal-project",
38
41
  "pack:dry-run": "npm pack --dry-run --json",
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"
42
+ "postinstall": "node postinstall.mjs",
43
+ "observe:dist": "node run-dist.mjs check-dist-observation.mjs --skip-pack --skip-install-smoke",
44
+ "smoke:dashboard": "node run-dist.mjs run-built-tests.mjs --test tests/smoke-dashboard.mjs",
45
+ "test": "node run-dist.mjs run-built-tests.mjs"
43
46
  },
44
47
  "files": [
45
48
  "README.md",
@@ -48,6 +51,8 @@
48
51
  "CONTRIBUTING.md",
49
52
  "CHANGELOG.md",
50
53
  "SKILL.md",
54
+ "postinstall.mjs",
55
+ "run-dist.mjs",
51
56
  "tsconfig.json",
52
57
  "tsconfig.dist.json",
53
58
  "tsconfig.runtime.json",
@@ -62,6 +67,9 @@
62
67
  "docs-release/",
63
68
  "examples/"
64
69
  ],
70
+ "devDependencies": {
71
+ "@types/node": "24"
72
+ },
65
73
  "engines": {
66
74
  "node": ">=24"
67
75
  },
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { spawnSync } from "node:child_process";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
+
7
+ const root = path.dirname(fileURLToPath(import.meta.url));
8
+ const buildScript = path.join(root, "scripts/build-dist.mts");
9
+ const distPostinstall = path.join(root, "dist/postinstall.mjs");
10
+ const buildOnly = process.argv.includes("--build-only");
11
+ const skipPostinstall = process.env.CODING_AGENT_HARNESS_SKIP_POSTINSTALL === "1";
12
+
13
+ function runBuild() {
14
+ if (!fs.existsSync(buildScript)) return false;
15
+ const result = spawnSync(process.execPath, [buildScript, "--quiet"], {
16
+ cwd: root,
17
+ stdio: "inherit",
18
+ });
19
+ if (result.status !== 0) process.exit(result.status ?? 1);
20
+ return true;
21
+ }
22
+
23
+ if (!fs.existsSync(distPostinstall)) {
24
+ runBuild();
25
+ }
26
+
27
+ if (buildOnly || skipPostinstall) {
28
+ process.exit(0);
29
+ }
30
+
31
+ if (!fs.existsSync(distPostinstall)) {
32
+ console.error("coding-agent-harness postinstall failed: missing dist/postinstall.mjs");
33
+ console.error("Run npm run build:runtime from a source checkout, or reinstall a complete package.");
34
+ process.exit(1);
35
+ }
36
+
37
+ await import(pathToFileURL(distPostinstall).href);
@@ -43,7 +43,7 @@ templateValues:
43
43
  entrypoints:
44
44
  newTask:
45
45
  type: template
46
- writes: [coding-agent-harness/planning/tasks/**]
46
+ writes: [{{paths.tasksRoot}}/**]
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: [coding-agent-harness/planning/tasks/**]
58
+ writes: [{{paths.tasksRoot}}/**]
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: [coding-agent-harness/planning/tasks/**]
64
+ writes: [{{paths.tasksRoot}}/**]
65
65
  reads: [docs/**]
66
66
  audit: true
67
67
  check:
68
68
  type: check
69
69
  command: checks/preset-check.mjs
70
- writes: [coding-agent-harness/planning/tasks/**]
70
+ writes: [{{paths.tasksRoot}}/**]
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: coding-agent-harness/planning/tasks/**
133
+ path: {{paths.tasksRoot}}/**
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 | 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 . |
18
+ | coordinator | {{paths.harnessRoot}}/planning/tasks/** | AGENTS.md, CLAUDE.md, {{paths.harnessRoot}}/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: [coding-agent-harness/planning/tasks/**]
13
- reads: [coding-agent-harness/planning/tasks/**/lesson_candidates.md]
12
+ writes: [{{paths.tasksRoot}}/**]
13
+ reads: [{{paths.tasksRoot}}/**/lesson_candidates.md]
14
14
  audit: true
15
15
  templates:
16
16
  prompt: templates/prompt.md
17
17
  writeScopes:
18
18
  taskDocs:
19
- path: coding-agent-harness/planning/tasks/**
19
+ path: {{paths.tasksRoot}}/**
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: [coding-agent-harness/planning/**]
11
+ writes: [{{paths.planningRoot}}/**]
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: coding-agent-harness/planning/**
24
+ path: {{paths.planningRoot}}/**
25
25
  access: write
@@ -3,6 +3,6 @@
3
3
  | Field | Value |
4
4
  | --- | --- |
5
5
  | Module Key | {{moduleKey}} |
6
- | Module Plan | coding-agent-harness/planning/modules/{{moduleKey}}/module_plan.md |
6
+ | Module Plan | {{paths.harnessRoot}}/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 | 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. |
15
+ | Module brief | {{paths.harnessRoot}}/planning/modules/{{moduleKey}}/brief.md | Start here for the module purpose and current scope. |
16
+ | Module plan | {{paths.harnessRoot}}/planning/modules/{{moduleKey}}/module_plan.md | Use this for module steps, active task links, and handoff state. |
17
+ | Module visual map | {{paths.harnessRoot}}/planning/modules/{{moduleKey}}/visual_map.md | Inspect when the change affects module sequencing or dependencies. |
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+
6
+ const context = JSON.parse(fs.readFileSync(process.env.HARNESS_PRESET_CONTEXT, "utf8"));
7
+ const release = String(context.inputs.release || "").trim();
8
+ const governanceRoot = context.paths?.governanceRoot;
9
+ if (!governanceRoot) {
10
+ console.error("release-closeout check requires structure-aware context.paths from the preset runner");
11
+ process.exit(2);
12
+ }
13
+ const releaseRoot = path.join(context.targetRoot, governanceRoot, "releases", release);
14
+ const required = ["INDEX.md", "task-aggregate.json", "task-archive-plan.md", "public-summary.md", "public-redaction-report.json"];
15
+ const missing = required.filter((file) => !fs.existsSync(path.join(releaseRoot, file)));
16
+ if (missing.length) {
17
+ console.error(`release package missing files: ${missing.join(", ")}`);
18
+ process.exit(2);
19
+ }
20
+ const redaction = JSON.parse(fs.readFileSync(path.join(releaseRoot, "public-redaction-report.json"), "utf8"));
21
+ if (redaction.status !== "pass") {
22
+ console.error("release public redaction report is not passing");
23
+ process.exit(3);
24
+ }
25
+ fs.writeFileSync(context.materializationManifestPath, `${JSON.stringify({
26
+ schemaVersion: "preset-materialization/v1",
27
+ status: "pass",
28
+ writes: [],
29
+ }, null, 2)}\n`);
@@ -0,0 +1,100 @@
1
+ id: release-closeout
2
+ version: 1
3
+ purpose: Create and run a release closeout task that aggregates version tasks into an auditable release package
4
+ compatibleBudgets: [complex]
5
+ localeSupport: [en-US, zh-CN]
6
+ task:
7
+ kind: release-closeout
8
+ defaultTaskId: release-closeout
9
+ defaultOutcome: Produce a release closeout task whose runner entrypoints generate the version package, archive plan, and public summary.
10
+ projectLevelOnly: true
11
+ inputs:
12
+ release:
13
+ type: text
14
+ flag: --release
15
+ required: true
16
+ previousRelease:
17
+ type: text
18
+ flag: --previous-release
19
+ required: false
20
+ nextRelease:
21
+ type: text
22
+ flag: --next-release
23
+ required: false
24
+ taskQuery:
25
+ type: text
26
+ flag: --task-query
27
+ required: false
28
+ taskList:
29
+ type: json-file
30
+ flag: --task-list
31
+ required: false
32
+ publicSummary:
33
+ type: flag
34
+ flag: --public-summary
35
+ required: false
36
+ templateValues:
37
+ release:
38
+ from: inputs.release
39
+ previousRelease:
40
+ from: inputs.previousRelease
41
+ nextRelease:
42
+ from: inputs.nextRelease
43
+ taskQuery:
44
+ from: inputs.taskQuery
45
+ taskId:
46
+ from: task.id
47
+ entrypoints:
48
+ newTask:
49
+ type: template
50
+ writes: [{{paths.tasksRoot}}/**]
51
+ audit: true
52
+ templates:
53
+ taskPlanAppend: templates/task_plan.append.md
54
+ executionStrategyAppend: templates/execution_strategy.append.md
55
+ findingsSeed: templates/findings.seed.md
56
+ reviewSeed: templates/review.seed.md
57
+ plan:
58
+ type: script
59
+ command: scripts/generate-release-package.mjs
60
+ writes: [{{paths.governanceRoot}}/releases/**]
61
+ reads: [{{paths.tasksRoot}}/**, {{paths.modulesRoot}}/**]
62
+ audit: true
63
+ scaffold:
64
+ type: script
65
+ command: scripts/generate-release-package.mjs
66
+ writes: [{{paths.governanceRoot}}/releases/**]
67
+ reads: [{{paths.tasksRoot}}/**, {{paths.modulesRoot}}/**]
68
+ audit: true
69
+ check:
70
+ type: check
71
+ command: checks/check-release-package.mjs
72
+ writes: [{{paths.governanceRoot}}/releases/**]
73
+ reads: [{{paths.governanceRoot}}/releases/**, {{paths.tasksRoot}}/**, {{paths.modulesRoot}}/**]
74
+ audit: true
75
+ evidence:
76
+ bundleDir: artifacts/preset
77
+ files:
78
+ release:
79
+ path: release.txt
80
+ type: text
81
+ value: inputs.release
82
+ presetAudit:
83
+ path: preset-audit.json
84
+ type: preset-audit
85
+ presetManifest:
86
+ path: preset-manifest.json
87
+ type: preset-manifest
88
+ writeScope:
89
+ path: write-scope.json
90
+ type: write-scope
91
+ audit:
92
+ manifestRequired: true
93
+ evidenceFiles: [preset-audit.json, preset-manifest.json, write-scope.json]
94
+ writeScopes:
95
+ taskDocs:
96
+ path: {{paths.tasksRoot}}/**
97
+ access: write
98
+ releasePackage:
99
+ path: {{paths.governanceRoot}}/releases/**
100
+ access: write