repo-harness 0.5.2 → 0.6.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 (34) hide show
  1. package/README.es.md +13 -8
  2. package/README.fr.md +14 -8
  3. package/README.ja.md +6 -7
  4. package/README.md +26 -21
  5. package/README.zh-CN.md +24 -19
  6. package/assets/reference-configs/external-tooling.md +11 -5
  7. package/assets/skill-version.json +10 -2
  8. package/assets/templates/helpers/workflow-contract.ts +11 -0
  9. package/assets/workflow-contract.v1.json +67 -0
  10. package/package.json +4 -2
  11. package/scripts/check-ci.sh +3 -0
  12. package/scripts/workflow-contract.ts +11 -0
  13. package/src/cli/commands/adopt-plan.ts +186 -0
  14. package/src/cli/commands/global-runtime.ts +6 -10
  15. package/src/cli/commands/init.ts +9 -16
  16. package/src/cli/commands/install.ts +19 -6
  17. package/src/cli/index.ts +135 -39
  18. package/src/cli/runtime/helper-runner.ts +13 -10
  19. package/src/cli/tools/codegraph.ts +9 -17
  20. package/src/core/adoption/gitignore-plan.ts +98 -0
  21. package/src/core/adoption/helper-wrapper-plan.ts +159 -0
  22. package/src/core/adoption/manifest-templates.ts +60 -0
  23. package/src/core/adoption/modes.ts +7 -0
  24. package/src/core/adoption/operations.ts +126 -0
  25. package/src/core/adoption/plan.ts +145 -0
  26. package/src/core/adoption/render.ts +70 -0
  27. package/src/core/adoption/rollback.ts +62 -0
  28. package/src/core/adoption/summary.ts +43 -0
  29. package/src/core/adoption/workflow-contract-asset.ts +12 -0
  30. package/src/core/adoption/workflow-contract-plan.ts +31 -0
  31. package/src/effects/fs-transaction.ts +265 -0
  32. package/src/effects/managed-block.ts +86 -0
  33. package/src/effects/path-safety.ts +47 -0
  34. package/src/effects/process-runner.ts +91 -0
package/README.es.md CHANGED
@@ -56,12 +56,17 @@ En un repositorio adoptado, la superficie se mantiene pequeña:
56
56
  | `tasks/contracts/`, `tasks/reviews/` y `.ai/harness/checks/` | Scope, verificación y evidencia de review para probar que el trabajo terminó. |
57
57
  | `.ai/harness/handoff/` y `tasks/current.md` | Session journal y estado resumible, derivados de workflow artifacts en vez de chat memory. |
58
58
 
59
- ## Novedades en 0.5.2
60
-
61
- - **Tooling advisories más silenciosos.** Los update checks de SessionStart usan por defecto un timestamp cache semanal, para que los avisos de Waza y CodeGraph no aparezcan en cada sesión.
62
- - **Safety hooks locales revisados.** `repo-harness security scan` separa active findings y reviewed exceptions; los hooks user-level warning-only necesitan exact command match, y los comandos de alto riesgo siguen activos.
63
- - **Setup checks más limpios.** `repo-harness setup check --check-updates` trata el skip de DB de gbrain fast-mode como readiness aceptado, pero mantiene visibles los warnings reales de gbrain.
64
- - **Cross-review más resistente.** El skill bundled `claude-review` puede recuperar resultados print-mode con stdout vacío desde los transcripts de sesión de Claude Code.
59
+ ## Novedades en 0.6.0
60
+
61
+ - **Transactional adoption plans.** `repo-harness adopt --dry-run --json` ahora
62
+ emite un operation plan protocol v1 con IDs estables, summary, content hashes
63
+ y rollback metadata.
64
+ - **Bootstrap files gestionados por el manifest.** Los templates iniciales
65
+ `docs/spec.md`, `tasks/todos.md`, `tasks/current.md` y `tasks/lessons.md`
66
+ ahora salen del workflow contract manifest, no de strings locales del planner.
67
+ - **Apply TypeScript experimental.** `repo-harness adopt --experimental-ts-apply`
68
+ puede aplicar el safe operation subset con atomic writes, target locks,
69
+ backups y preflight rejection para boundaries self-host no soportadas.
65
70
 
66
71
  ## Qué hace el producto
67
72
 
@@ -378,8 +383,8 @@ Guards habituales:
378
383
 
379
384
  ## Release actual
380
385
 
381
- - npm package: `repo-harness@0.5.2`
382
- - Generated workflow stamp: `repo-harness@0.5.2+template@0.5.2`
386
+ - npm package: `repo-harness@0.6.0`
387
+ - Generated workflow stamp: `repo-harness@0.6.0+template@0.6.0`
383
388
  - GitHub repository: `Ancienttwo/repo-harness`
384
389
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
385
390
 
package/README.fr.md CHANGED
@@ -56,12 +56,18 @@ Dans un dépôt adopté, la surface à comprendre reste volontairement réduite
56
56
  | `tasks/contracts/`, `tasks/reviews/` et `.ai/harness/checks/` | Scope, vérification et preuves de review pour démontrer que le travail est terminé. |
57
57
  | `.ai/harness/handoff/` et `tasks/current.md` | Session journal et état resumable dérivés des workflow artifacts plutôt que de la chat memory. |
58
58
 
59
- ## Nouveautés de la 0.5.2
60
-
61
- - **Tooling advisories plus calmes.** Les checks update de SessionStart utilisent désormais un cache timestamp d'une semaine par défaut, afin que les advisories Waza et CodeGraph restent utiles sans apparaître à chaque session.
62
- - **Safety hooks locaux reviewés.** `repo-harness security scan` sépare les active findings des reviewed exceptions, avec exact command match pour les hooks user-level warning-only ; les commandes à haut risque restent actives.
63
- - **Setup checks plus propres.** `repo-harness setup check --check-updates` traite le skip DB de gbrain fast-mode comme un état readiness accepté, tout en gardant les vrais warnings gbrain visibles.
64
- - **Cross-review plus robuste.** Le skill bundled `claude-review` peut récupérer les résultats print-mode à stdout vide depuis les transcripts de session Claude Code.
59
+ ## Nouveautés de la 0.6.0
60
+
61
+ - **Transactional adoption plans.** `repo-harness adopt --dry-run --json` émet
62
+ maintenant un operation plan protocol v1 avec IDs stables, summary, content
63
+ hashes et rollback metadata.
64
+ - **Bootstrap files gérés par le manifest.** Les templates initiaux
65
+ `docs/spec.md`, `tasks/todos.md`, `tasks/current.md` et `tasks/lessons.md`
66
+ viennent désormais du workflow contract manifest plutôt que de strings locales
67
+ au planner.
68
+ - **Apply TypeScript expérimental.** `repo-harness adopt --experimental-ts-apply`
69
+ peut appliquer le safe operation subset avec atomic writes, target locks,
70
+ backups et preflight rejection des boundaries self-host non prises en charge.
65
71
 
66
72
  ## Ce que fait le produit
67
73
 
@@ -382,8 +388,8 @@ Guards courants :
382
388
 
383
389
  ## Release actuelle
384
390
 
385
- - npm package : `repo-harness@0.5.2`
386
- - Generated workflow stamp : `repo-harness@0.5.2+template@0.5.2`
391
+ - npm package : `repo-harness@0.6.0`
392
+ - Generated workflow stamp : `repo-harness@0.6.0+template@0.6.0`
387
393
  - GitHub repository : `Ancienttwo/repo-harness`
388
394
  - Release history : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
389
395
 
package/README.ja.md CHANGED
@@ -47,12 +47,11 @@ Agent に完全な PRD または Sprint を渡せば、あとは review and `nex
47
47
  | `tasks/contracts/`, `tasks/reviews/`, `.ai/harness/checks/` | 作業完了を証明する scope、verification、review evidence。 |
48
48
  | `.ai/harness/handoff/` と `tasks/current.md` | chat memory ではなく workflow artifacts から派生する session journal と resumable status。 |
49
49
 
50
- ## 0.5.2 の新機能
50
+ ## 0.6.0 の新機能
51
51
 
52
- - **静かな tooling advisory。** SessionStart update check はデフォルトで 1 週間の timestamp cache を使い、Waza と CodeGraph の advisory が毎 session で出続けないようにしました。
53
- - **Reviewed local safety hooks。** `repo-harness security scan` は active findings と reviewed exceptions を分離し、user-level warning-only hook は exact command match の場合だけ reviewed 扱いにします。高リスク command は引き続き active です。
54
- - **Cleaner setup checks。** `repo-harness setup check --check-updates` は gbrain fast-mode DB skip を受け入れ済み readiness として扱い、実際の gbrain warning はそのまま表示します。
55
- - **Resilient cross-review。** bundled `claude-review` skill は Claude Code print-mode の stdout が空でも session transcript から最終出力を復旧できます。
52
+ - **Transactional adoption plans。** `repo-harness adopt --dry-run --json` は、安定した ID、summary、content hash、rollback metadata を含む protocol v1 operation plan を出力します。
53
+ - **Manifest-owned bootstrap files。** 初期 `docs/spec.md`、`tasks/todos.md`、`tasks/current.md`、`tasks/lessons.md` templates は、planner-local strings ではなく workflow contract manifest から来るようになりました。
54
+ - **Experimental TypeScript apply。** `repo-harness adopt --experimental-ts-apply` は、atomic writes、target locks、backups、unsupported self-host boundary の preflight rejection を使って safe operation subset を適用できます。
56
55
 
57
56
  ## repo-harness は何をするか
58
57
 
@@ -352,8 +351,8 @@ hook がブロックしたときは、まず terminal の構造化された出
352
351
 
353
352
  ## 現在の Release
354
353
 
355
- - npm package:`repo-harness@0.5.2`
356
- - Generated workflow stamp:`repo-harness@0.5.2+template@0.5.2`
354
+ - npm package:`repo-harness@0.6.0`
355
+ - Generated workflow stamp:`repo-harness@0.6.0+template@0.6.0`
357
356
  - GitHub repository:`Ancienttwo/repo-harness`
358
357
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
359
358
 
package/README.md CHANGED
@@ -50,19 +50,17 @@ In an adopted repo, the surface area is intentionally small:
50
50
  | `tasks/contracts/`, `tasks/reviews/`, and `.ai/harness/checks/` | Scope, verification, and review evidence for proving the work is done. |
51
51
  | `.ai/harness/handoff/` and `tasks/current.md` | Session journal and resumable status, derived from workflow artifacts instead of chat memory. |
52
52
 
53
- ## What's New in 0.5.2
54
-
55
- - **Quieter tooling advisories.** SessionStart update checks now use a weekly
56
- timestamp cache by default, so Waza and CodeGraph advisories stay useful
57
- without firing on every new agent session.
58
- - **Reviewed local safety hooks.** `repo-harness security scan` separates
59
- active findings from reviewed exceptions, using exact command matches for
60
- user-level warning-only hooks while keeping high-risk commands blocking.
61
- - **Cleaner setup checks.** `repo-harness setup check --check-updates` now
62
- treats gbrain fast-mode DB skips as accepted readiness and keeps real gbrain
63
- warnings visible.
64
- - **More resilient cross-review.** The bundled `claude-review` skill can recover
65
- empty-stdout print-mode results from Claude Code session transcripts.
53
+ ## What's New in 0.6.0
54
+
55
+ - **Transactional adoption plans.** `repo-harness adopt --dry-run --json` now
56
+ emits a protocol v1 operation plan with stable IDs, summaries, content hashes,
57
+ and rollback metadata.
58
+ - **Manifest-owned bootstrap files.** The initial `docs/spec.md`,
59
+ `tasks/todos.md`, `tasks/current.md`, and `tasks/lessons.md` templates now
60
+ come from the workflow contract manifest instead of planner-local strings.
61
+ - **Experimental TypeScript apply.** `repo-harness adopt --experimental-ts-apply`
62
+ can apply the safe operation subset with atomic writes, target locks, backups,
63
+ and preflight rejection for unsupported self-host boundaries.
66
64
 
67
65
  ## What repo-harness Does
68
66
 
@@ -238,10 +236,10 @@ irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 |
238
236
  ```bash
239
237
  # Bun
240
238
  bun add -g repo-harness
241
- repo-harness init
239
+ repo-harness install
242
240
 
243
241
  # Node/npm, with Bun already on PATH because the CLI runs on Bun
244
- npx -y repo-harness init
242
+ npx -y repo-harness install
245
243
  ```
246
244
 
247
245
  </details>
@@ -249,14 +247,15 @@ npx -y repo-harness init
249
247
  ### 2. Bootstrap the host runtime once
250
248
 
251
249
  ```bash
252
- repo-harness init
250
+ repo-harness install
253
251
  ```
254
252
 
255
- `init` is the first-run global bootstrap path. It installs the current npm
253
+ `install` is the first-run global bootstrap path. It installs the current npm
256
254
  package as the global CLI, refreshes repo-harness skill aliases, installs
257
255
  user-level hook adapters, configures Waza runtime skills, persists a brain root
258
256
  under `~/.repo-harness/config.json`, and configures CodeGraph MCP. It does not
259
- apply repo-local workflow files to the current directory.
257
+ apply repo-local workflow files to the current directory. `repo-harness init`
258
+ remains a compatibility alias for existing scripts.
260
259
 
261
260
  For an Agent-owned, read-only bootstrap audit, run `npx -y repo-harness setup
262
261
  check --json` or add `--check-updates` for version advisories. `setup check` is
@@ -269,11 +268,17 @@ optional command, and verification surface for the Agent to execute deliberately
269
268
 
270
269
  ```bash
271
270
  # First machine bootstrap after installing the CLI: skills, host adapters, Waza, brain, CodeGraph.
272
- repo-harness init
271
+ repo-harness install
273
272
 
274
273
  # Refresh user-level CLI/runtime pieces after a package update.
275
274
  repo-harness update
276
275
 
276
+ # Remove repo-harness managed host adapters without deleting sibling hooks or third-party tools.
277
+ repo-harness uninstall
278
+
279
+ # Install only the host hook adapters, preserving the older adapter-only surface.
280
+ repo-harness install --target both --location global
281
+
277
282
  # Ask for read-only repair guidance without writing files.
278
283
  repo-harness update --check
279
284
 
@@ -459,8 +464,8 @@ Most common guards:
459
464
 
460
465
  ## Current Release
461
466
 
462
- - npm package: `repo-harness@0.5.2`
463
- - Generated workflow stamp: `repo-harness@0.5.2+template@0.5.2`
467
+ - npm package: `repo-harness@0.6.0`
468
+ - Generated workflow stamp: `repo-harness@0.6.0+template@0.6.0`
464
469
  - GitHub repository: `Ancienttwo/repo-harness`
465
470
  - Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
466
471
 
package/README.zh-CN.md CHANGED
@@ -43,17 +43,16 @@ handoff、检查结果和 review evidence 写回项目文件,让下一个 agen
43
43
  | `tasks/contracts/`、`tasks/reviews/`、`.ai/harness/checks/` | 证明完成所需的 scope、verification 和 review evidence。 |
44
44
  | `.ai/harness/handoff/` 和 `tasks/current.md` | session journal 与可恢复状态,从 workflow artifacts 派生,而不是依赖聊天记忆。 |
45
45
 
46
- ## 0.5.2 新特性
47
-
48
- - **更安静的 tooling advisory。** SessionStart update check 默认使用一周
49
- timestamp cache,Waza 和 CodeGraph advisory 不会每个新 session 都触发。
50
- - **可审阅的本地 safety hooks。** `repo-harness security scan` 会把 active
51
- findings 与 reviewed exceptions 分开;user-level warning-only hooks 必须 exact
52
- command match,高风险命令仍然保持 active。
53
- - **更干净的 setup check。** `repo-harness setup check --check-updates` 会把
54
- gbrain fast-mode DB skip 当成已接受的 readiness 状态,同时保留真实 gbrain warning。
55
- - **更稳的 cross-review。** bundled `claude-review` skill 可以从 Claude Code
56
- session transcript 恢复 print-mode 空 stdout 的最终输出。
46
+ ## 0.6.0 新特性
47
+
48
+ - **事务型 adoption plan。** `repo-harness adopt --dry-run --json` 现在输出
49
+ protocol v1 operation plan,包含稳定 ID、summary、content hash 和 rollback metadata。
50
+ - **Manifest-owned bootstrap 文件。** 初始 `docs/spec.md`、`tasks/todos.md`、
51
+ `tasks/current.md`、`tasks/lessons.md` 模板改由 workflow contract manifest 管理,
52
+ 不再放在 planner 本地字符串里。
53
+ - **实验性 TypeScript apply。** `repo-harness adopt --experimental-ts-apply`
54
+ 可以执行 safe operation subset,并使用 atomic write、target lock、backup 和
55
+ unsupported self-host boundary preflight。
57
56
 
58
57
  ## 产品做什么
59
58
 
@@ -207,10 +206,10 @@ irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 |
207
206
  ```bash
208
207
  # Bun
209
208
  bun add -g repo-harness
210
- repo-harness init
209
+ repo-harness install
211
210
 
212
211
  # Node/npm;仍要求 Bun 已在 PATH 上,因为 CLI runtime 是 Bun
213
- npx -y repo-harness init
212
+ npx -y repo-harness install
214
213
  ```
215
214
 
216
215
  </details>
@@ -218,13 +217,13 @@ npx -y repo-harness init
218
217
  ### 2. 先做一次 host runtime bootstrap
219
218
 
220
219
  ```bash
221
- repo-harness init
220
+ repo-harness install
222
221
  ```
223
222
 
224
- `init` 是首次全局引导入口。它把当前 npm 包安装成全局 CLI,刷新 repo-harness
223
+ `install` 是首次全局引导入口。它把当前 npm 包安装成全局 CLI,刷新 repo-harness
225
224
  skill aliases,安装 user-level hook adapters,配置 Waza runtime skills,把 brain
226
225
  root 持久化到 `~/.repo-harness/config.json`,并配置 CodeGraph MCP。它不会把当前目录
227
- 默认迁移成 repo-local workflow。
226
+ 默认迁移成 repo-local workflow。`repo-harness init` 保留为兼容 alias,给已有脚本用。
228
227
 
229
228
  如果要让 Agent 做只读 bootstrap audit,运行 `npx -y repo-harness setup check
230
229
  --json`;需要版本提示时加 `--check-updates`。`setup check` 不是 runtime hook:
@@ -236,11 +235,17 @@ targets、可选 command 和 verification 的 `agent_actions`,由 Agent 再显
236
235
 
237
236
  ```bash
238
237
  # 安装 CLI 后做首次机器级 bootstrap:skills、host adapters、Waza、brain、CodeGraph。
239
- repo-harness init
238
+ repo-harness install
240
239
 
241
240
  # 包更新后刷新 user-level CLI/runtime。
242
241
  repo-harness update
243
242
 
243
+ # 移除 repo-harness 管理的 host adapters,不删除 sibling hooks 或第三方工具。
244
+ repo-harness uninstall
245
+
246
+ # 只安装 host hook adapters,保留旧版 adapter-only surface。
247
+ repo-harness install --target both --location global
248
+
244
249
  # 只读检查需要 agent 修复什么,不写文件。
245
250
  repo-harness update --check
246
251
 
@@ -413,8 +418,8 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
413
418
 
414
419
  ## 当前 Release
415
420
 
416
- - npm package:`repo-harness@0.5.2`
417
- - Generated workflow stamp:`repo-harness@0.5.2+template@0.5.2`
421
+ - npm package:`repo-harness@0.6.0`
422
+ - Generated workflow stamp:`repo-harness@0.6.0+template@0.6.0`
418
423
  - GitHub repository:`Ancienttwo/repo-harness`
419
424
  - Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
420
425
 
@@ -14,11 +14,17 @@ source, while `~/.agents/skills` is only the skills CLI staging/cache path used
14
14
  to receive upstream `tw93/Waza` updates before syncing verified copies into
15
15
  Codex.
16
16
 
17
- `repo-harness init` is allowed to bootstrap the workflow-owned global runtime in
18
- one pass: the `repo-harness` CLI, repo-harness runtime aliases, user-level
17
+ `repo-harness install` is allowed to bootstrap the workflow-owned global runtime
18
+ in one pass: the `repo-harness` CLI, repo-harness runtime aliases, user-level
19
19
  Codex/Claude hook adapters, Waza (`think`, `hunt`, `check`, `health`), brain
20
- root persistence, Mermaid, and CodeGraph CLI/MCP configuration. It must not
21
- silently install unrelated toolchains or Claude marketplace plugins.
20
+ root persistence, Mermaid, and CodeGraph CLI/MCP configuration.
21
+ `repo-harness init` remains a compatibility alias for existing automation. The
22
+ bootstrap path must not silently install unrelated toolchains or Claude
23
+ marketplace plugins.
24
+
25
+ `repo-harness uninstall` removes repo-harness managed Codex/Claude hook
26
+ adapters. It intentionally does not uninstall Waza, Mermaid, CodeGraph, gbrain,
27
+ brain config, package-manager globals, or user-authored sibling hook entries.
22
28
 
23
29
  `repo-harness update` refreshes only the CLI and repo-harness-owned user-level
24
30
  runtime by default. Third-party tooling and CodeGraph registration stay
@@ -30,7 +36,7 @@ The cross-review skills are **harness-owned and self-contained** — their sourc
30
36
  lives in `assets/skills/<skill>/` and they wrap the peer CLI (`codex exec` /
31
37
  `claude -p`) in a read-only sandbox with no gstack dependency, so installing them
32
38
  is a workflow-owned runtime concern, not an unrelated toolchain. They install
33
- host-aware during `repo-harness init` and explicit external-skill refreshes:
39
+ host-aware during `repo-harness install`/`init` and explicit external-skill refreshes:
34
40
  `codex-review` only into `~/.claude/skills` (a Claude session asking
35
41
  Codex for an independent review) and `claude-review` only into `~/.codex/skills`
36
42
  (a Codex session asking Claude). When gstack is present, its `/codex` and
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.5.2",
3
- "templateVersion": "0.5.2",
2
+ "version": "0.6.0",
3
+ "templateVersion": "0.6.0",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "retiredAliases": [
@@ -135,6 +135,14 @@
135
135
  {
136
136
  "version": "0.5.2",
137
137
  "description": "Adds weekly tooling-update advisory caching, reviewed security exceptions, gbrain fast-doctor warning handling, and Claude review transcript recovery"
138
+ },
139
+ {
140
+ "version": "0.5.3",
141
+ "description": "Fixes repo-harness update --version so the update command can install a pinned package version without being intercepted by the top-level CLI version flag"
142
+ },
143
+ {
144
+ "version": "0.6.0",
145
+ "description": "Adds the transactional adoption planner foundation with protocol v1 dry-run plans, manifest-owned bootstrap templates, experimental TypeScript apply, atomic writes, and rollback metadata"
138
146
  }
139
147
  ],
140
148
  "generatedProjectStamp": {
@@ -75,12 +75,23 @@ export type WorkflowContract = {
75
75
  };
76
76
  documents: {
77
77
  spec: string;
78
+ currentStatus?: string;
78
79
  planDirectory: string;
79
80
  taskChecklist?: string;
80
81
  deferredGoalLedger?: string;
81
82
  researchReportsDirectory: string;
82
83
  lessonsLog: string;
83
84
  };
85
+ adoptionTemplates?: {
86
+ files?: Record<
87
+ string,
88
+ {
89
+ document: string;
90
+ reason: string;
91
+ lines: string[];
92
+ }
93
+ >;
94
+ };
84
95
  migrations: {
85
96
  legacyVersions: string[];
86
97
  legacyPaths: string[];
@@ -266,12 +266,79 @@
266
266
  },
267
267
  "documents": {
268
268
  "spec": "docs/spec.md",
269
+ "currentStatus": "tasks/current.md",
269
270
  "planDirectory": "plans",
270
271
  "deferredGoalLedger": "tasks/todos.md",
271
272
  "implementationNotesDirectory": "tasks/notes",
272
273
  "lessonsLog": "tasks/lessons.md",
273
274
  "researchReportsDirectory": "docs/researches"
274
275
  },
276
+ "adoptionTemplates": {
277
+ "files": {
278
+ "spec": {
279
+ "document": "spec",
280
+ "reason": "Create deterministic product spec placeholder when missing",
281
+ "lines": [
282
+ "# Product Spec: {{repoName}}",
283
+ "",
284
+ "> **Status**: Draft",
285
+ "",
286
+ "Describe the product intent, users, workflows, acceptance scenarios, and constraints before implementation.",
287
+ ""
288
+ ]
289
+ },
290
+ "deferredGoalLedger": {
291
+ "document": "deferredGoalLedger",
292
+ "reason": "Create deferred-goal ledger when missing",
293
+ "lines": [
294
+ "# Deferred Goal Ledger",
295
+ "",
296
+ "> **Status**: Backlog",
297
+ "> **Updated**: (initial)",
298
+ "> **Scope**: Medium/long-term goals deferred from active plan execution",
299
+ "",
300
+ "Current plan tasks live in the active plan's `## Task Breakdown`.",
301
+ "Do not duplicate that execution checklist here. Record only work intentionally deferred beyond this slice, with the tradeoff and revisit trigger.",
302
+ "",
303
+ "## Deferred Goals",
304
+ "",
305
+ "| Goal | Why Deferred | Tradeoff | Revisit Trigger |",
306
+ "|------|--------------|----------|-----------------|",
307
+ "| (none) | No deferred medium/long-term goal recorded yet. | Keep the first sprint bounded. | Add a row when a real follow-up is postponed. |",
308
+ ""
309
+ ]
310
+ },
311
+ "currentStatus": {
312
+ "document": "currentStatus",
313
+ "reason": "Create tracked current-status snapshot when missing",
314
+ "lines": [
315
+ "# Current Status Snapshot",
316
+ "",
317
+ "<!-- generated-by: repo-harness refresh-current-status v1 -->",
318
+ "",
319
+ "> **Status**: Idle",
320
+ "> **Reason**: repo-harness adoption bootstrap",
321
+ "",
322
+ "This file is a tracked mainline snapshot derived from repo artifacts. It is not a live lock, not a kanban board, and not an implementation gate.",
323
+ ""
324
+ ]
325
+ },
326
+ "lessonsLog": {
327
+ "document": "lessonsLog",
328
+ "reason": "Create correction-derived lessons ledger when missing",
329
+ "lines": [
330
+ "# Lessons",
331
+ "",
332
+ "Correction-derived rules that should influence future repo work.",
333
+ "",
334
+ "## Active Lessons",
335
+ "",
336
+ "- (none yet)",
337
+ ""
338
+ ]
339
+ }
340
+ }
341
+ },
275
342
  "migrations": {
276
343
  "legacyVersions": [
277
344
  "pre-tasks-first",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-harness",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Installs, migrates, audits, and repairs repo-local agentic development harnesses",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  "benchmark:skills": "bun scripts/run-skill-evals.ts",
33
33
  "test": "bun test",
34
34
  "test:coverage": "bun test --coverage",
35
+ "check:type": "tsc --noEmit",
35
36
  "check:ci": "bash scripts/check-ci.sh",
36
37
  "check:release": "bash scripts/check-npm-release.sh",
37
38
  "check:brain-manifest": "bash scripts/check-brain-manifest.sh",
@@ -46,7 +47,8 @@
46
47
  },
47
48
  "devDependencies": {
48
49
  "@colbymchenry/codegraph": "1.0.1",
49
- "@types/bun": "latest"
50
+ "@types/bun": "latest",
51
+ "typescript": "^6.0.3"
50
52
  },
51
53
  "dependencies": {
52
54
  "commander": "^14.0.3"
@@ -10,6 +10,9 @@ BUN_TEST_MAX_CONCURRENCY="${BUN_TEST_MAX_CONCURRENCY:-4}"
10
10
  echo "[ci] install"
11
11
  bun install --frozen-lockfile
12
12
 
13
+ echo "[ci] typecheck"
14
+ bun run check:type
15
+
13
16
  echo "[ci] tests"
14
17
  bun test --timeout "$BUN_TEST_TIMEOUT_MS" --max-concurrency "$BUN_TEST_MAX_CONCURRENCY"
15
18
 
@@ -75,12 +75,23 @@ export type WorkflowContract = {
75
75
  };
76
76
  documents: {
77
77
  spec: string;
78
+ currentStatus?: string;
78
79
  planDirectory: string;
79
80
  taskChecklist?: string;
80
81
  deferredGoalLedger?: string;
81
82
  researchReportsDirectory: string;
82
83
  lessonsLog: string;
83
84
  };
85
+ adoptionTemplates?: {
86
+ files?: Record<
87
+ string,
88
+ {
89
+ document: string;
90
+ reason: string;
91
+ lines: string[];
92
+ }
93
+ >;
94
+ };
84
95
  migrations: {
85
96
  legacyVersions: string[];
86
97
  legacyPaths: string[];