repo-harness 0.22.1 → 0.23.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 (348) hide show
  1. package/AGENTS.md +20 -7
  2. package/CLAUDE.md +20 -7
  3. package/README.es.md +32 -45
  4. package/README.fr.md +32 -44
  5. package/README.ja.md +30 -43
  6. package/README.md +34 -93
  7. package/README.zh-CN.md +28 -61
  8. package/SKILL.md +5 -3
  9. package/agents/fleet/harness-evaluator.md +1 -1
  10. package/assets/partials/05-workflow.partial.md +1 -1
  11. package/assets/reference-configs/agentic-development-flow.md +45 -3
  12. package/assets/reference-configs/development-protocol.md +2 -4
  13. package/assets/reference-configs/external-tooling.md +131 -81
  14. package/assets/reference-configs/global-working-rules.md +4 -4
  15. package/assets/reference-configs/harness-overview.md +53 -25
  16. package/assets/reference-configs/herdr-notify.md +29 -1
  17. package/assets/reference-configs/hook-operations.md +177 -115
  18. package/assets/reference-configs/host-invariants.md +9 -12
  19. package/assets/reference-configs/minimal-change-hooks.md +25 -111
  20. package/assets/reference-configs/release-deploy.md +7 -4
  21. package/assets/skill-commands/AGENTS.md +0 -7
  22. package/assets/skill-commands/CLAUDE.md +0 -7
  23. package/assets/skill-commands/manifest.json +11 -13
  24. package/assets/skill-commands/repo-harness-architecture/SKILL.md +1 -0
  25. package/assets/skill-commands/repo-harness-architecture/agents/openai.yaml +2 -0
  26. package/assets/skill-commands/repo-harness-architecture/references/worker.md +98 -24
  27. package/assets/skill-commands/repo-harness-check/SKILL.md +2 -0
  28. package/assets/skill-commands/repo-harness-check/references/architecture-evidence.md +46 -15
  29. package/assets/skill-commands/repo-harness-check/references/deploy-readiness.md +0 -2
  30. package/assets/skill-commands/repo-harness-check/references/pr-verification.md +96 -0
  31. package/assets/skill-commands/repo-harness-check/references/review.md +0 -2
  32. package/assets/skill-commands/repo-harness-ship/SKILL.md +6 -0
  33. package/assets/skill-commands/repo-harness-ship/references/worker.md +3 -1
  34. package/assets/skill-version.json +2 -2
  35. package/assets/skills/repo-harness-chatgpt/SKILL.md +1 -1
  36. package/assets/skills/repo-harness-chatgpt/references/bridge.md +0 -8
  37. package/assets/skills/repo-harness-cross-review/SKILL.md +1 -2
  38. package/assets/skills/repo-harness-cross-review/references/generic-review.md +3 -43
  39. package/assets/skills/repo-harness-product/references/goal.md +0 -2
  40. package/assets/skills/repo-harness-product/references/prd.md +0 -2
  41. package/assets/skills/repo-harness-product/references/sprint.md +0 -2
  42. package/assets/skills/repo-harness-setup/references/capability.md +7 -2
  43. package/assets/skills/repo-harness-setup/references/init.md +0 -2
  44. package/assets/skills/repo-harness-setup/references/migrate.md +0 -5
  45. package/assets/skills/repo-harness-setup/references/repair.md +0 -2
  46. package/assets/skills/repo-harness-setup/references/scaffold.md +0 -2
  47. package/assets/skills/repo-harness-setup/references/upgrade.md +0 -2
  48. package/assets/skills/repo-harness-test/references/authoring.md +11 -3
  49. package/assets/skills/repo-harness-test/references/running.md +74 -25
  50. package/assets/skills/repo-harness-test/references/verification-plan.md +15 -13
  51. package/assets/templates/helpers/archive-workflow.sh +10 -16
  52. package/assets/templates/helpers/capability-resolver.ts +166 -58
  53. package/assets/templates/helpers/check-agent-tooling.sh +77 -16
  54. package/assets/templates/helpers/codex-handoff-resume.sh +4 -5
  55. package/assets/templates/helpers/contract-worktree-runtime.ts +18 -0
  56. package/assets/templates/helpers/contract-worktree.sh +38 -103
  57. package/assets/templates/helpers/evidence-gc.ts +103 -18
  58. package/assets/templates/helpers/install-agent-fleet.sh +2 -2
  59. package/assets/templates/helpers/prepare-codex-handoff.sh +3 -3
  60. package/assets/templates/helpers/prepare-handoff.sh +14 -21
  61. package/assets/templates/helpers/recovery-view-cli.ts +46 -783
  62. package/assets/templates/helpers/runtime-evidence-receipt.ts +6 -23
  63. package/assets/templates/helpers/select-agent-context-blocks.sh +72 -4
  64. package/assets/templates/helpers/ship-worktrees.sh +11 -209
  65. package/assets/templates/helpers/sprint-backlog.sh +11 -2
  66. package/assets/templates/helpers/summarize-failures.sh +16 -48
  67. package/assets/templates/helpers/workstream-sync.sh +5 -2
  68. package/assets/templates/helpers/worktree-merge-lib.sh +9 -9
  69. package/assets/templates/runtime.gitignore +4 -7
  70. package/assets/tool-catalog.v1.json +89 -0
  71. package/assets/workflow-contract.v1.json +13 -10
  72. package/dist/hook-entry.js +10319 -17414
  73. package/dist/oar-coding-host.js +193 -11
  74. package/dist/oar-review-host.js +197 -8
  75. package/dist/operator-ui/assets/ArchitectureWorkspace-CR9FiYz3.js +1 -0
  76. package/dist/operator-ui/assets/index-DY7Cw9qc.css +2 -0
  77. package/dist/operator-ui/assets/index-jrycyCyb.js +18 -0
  78. package/dist/operator-ui/index.html +2 -2
  79. package/package.json +6 -27
  80. package/references/bot-control.md +21 -25
  81. package/references/pm-operations.md +21 -1
  82. package/scripts/archive-workflow.sh +10 -16
  83. package/scripts/axr5-archctx-clean-room.ts +7 -3
  84. package/scripts/capability-resolver.ts +52 -14
  85. package/scripts/check-agent-tooling.sh +77 -16
  86. package/scripts/check-ci.sh +136 -39
  87. package/scripts/check-context-map.ts +15 -29
  88. package/scripts/check-npm-release.sh +6 -6
  89. package/scripts/check-release-published.sh +1 -2
  90. package/scripts/check-tarball-install-smoke.sh +7 -18
  91. package/scripts/ci-documentation-consumers.ts +31 -78
  92. package/scripts/ci-edge-audit.ts +102 -0
  93. package/scripts/ci-path-consumers.ts +111 -0
  94. package/scripts/codex-handoff-resume.sh +4 -5
  95. package/scripts/contract-worktree-runtime.ts +18 -0
  96. package/scripts/contract-worktree.sh +38 -103
  97. package/scripts/create-project-dirs.sh +2 -13
  98. package/scripts/evidence-gc.ts +103 -18
  99. package/scripts/init-project.sh +2 -13
  100. package/scripts/install-agent-fleet.sh +2 -2
  101. package/scripts/lib/ci-run-tests.sh +10 -0
  102. package/scripts/lib/path-values.ts +100 -0
  103. package/scripts/lib/project-init-lib.sh +29 -45
  104. package/scripts/prepare-codex-handoff.sh +3 -3
  105. package/scripts/prepare-handoff.sh +14 -21
  106. package/scripts/recovery-view-cli.ts +46 -758
  107. package/scripts/replay-ci-coverage.ts +120 -23
  108. package/scripts/report-ci.ts +97 -9
  109. package/scripts/run-harness-profile-benchmark.ts +62 -40
  110. package/scripts/runtime-evidence-receipt.ts +6 -23
  111. package/scripts/select-agent-context-blocks.sh +72 -4
  112. package/scripts/select-ci-coverage.ts +153 -34
  113. package/scripts/select-test-suite.ts +15 -0
  114. package/scripts/ship-worktrees.sh +11 -209
  115. package/scripts/sprint-backlog.sh +11 -2
  116. package/scripts/summarize-failures.sh +16 -48
  117. package/scripts/sync-helper-sources.ts +12 -27
  118. package/scripts/sync-reference-configs.ts +44 -4
  119. package/scripts/test-file-durations.json +0 -47
  120. package/scripts/workstream-sync.sh +5 -2
  121. package/scripts/worktree-merge-lib.sh +9 -9
  122. package/src/cli/chatgpt-browser/file-policy.ts +3 -6
  123. package/src/cli/commands/architecture-debt.ts +143 -0
  124. package/src/cli/commands/architecture-projection.ts +15 -12
  125. package/src/cli/commands/capability-context.ts +60 -28
  126. package/src/cli/commands/delegation.ts +1 -14
  127. package/src/cli/commands/docs.ts +0 -2
  128. package/src/cli/commands/doctor.ts +56 -27
  129. package/src/cli/commands/global-runtime.ts +62 -12
  130. package/src/cli/commands/init-hook.ts +23 -4
  131. package/src/cli/commands/init.ts +4 -3
  132. package/src/cli/commands/install.ts +18 -28
  133. package/src/cli/commands/mcp.ts +0 -20
  134. package/src/cli/commands/module.ts +22 -6
  135. package/src/cli/commands/refactor.ts +46 -19
  136. package/src/cli/commands/retention.ts +53 -0
  137. package/src/cli/commands/review.ts +1 -1
  138. package/src/cli/commands/security.ts +1 -1
  139. package/src/cli/commands/state.ts +0 -13
  140. package/src/cli/commands/status.ts +4 -3
  141. package/src/cli/commands/validators.ts +1 -1
  142. package/src/cli/hook/AGENTS.md +33 -0
  143. package/src/cli/hook/CLAUDE.md +33 -0
  144. package/src/cli/hook/board-slice-context.ts +11 -14
  145. package/src/cli/hook/circuit-breaker.ts +14 -36
  146. package/src/cli/hook/event-telemetry.ts +51 -387
  147. package/src/cli/hook/handler-contract.ts +24 -121
  148. package/src/cli/hook/handler-registry.ts +58 -156
  149. package/src/cli/hook/hook-input.ts +50 -206
  150. package/src/cli/hook/hook-protocol.ts +57 -0
  151. package/src/cli/hook/mutation-guard.ts +116 -820
  152. package/src/cli/hook/return-channel.ts +56 -0
  153. package/src/cli/hook/route-registry.ts +15 -67
  154. package/src/cli/hook/runtime.ts +125 -453
  155. package/src/cli/hook/session-context-budget.ts +28 -437
  156. package/src/cli/hook/session-context.ts +117 -1486
  157. package/src/cli/hook/stop-handler.ts +79 -421
  158. package/src/cli/hook/subagent-context.ts +485 -0
  159. package/src/cli/hook/task-inbox-handler.ts +23 -64
  160. package/src/cli/hook-entry.ts +21 -103
  161. package/src/cli/index.ts +23 -44
  162. package/src/cli/installer/configuration-ownership.ts +5 -1
  163. package/src/cli/installer/install-profile.ts +8 -7
  164. package/src/cli/installer/managed-entries.ts +8 -13
  165. package/src/cli/installer/targets/claude.ts +16 -28
  166. package/src/cli/installer/targets/codex.ts +16 -36
  167. package/src/cli/installer/types.ts +2 -7
  168. package/src/cli/installer/uninstall.ts +2 -2
  169. package/src/cli/mcp/auth.ts +0 -6
  170. package/src/cli/mcp/instructions.ts +0 -1
  171. package/src/cli/mcp/policy.ts +6 -22
  172. package/src/cli/mcp/server.ts +4 -42
  173. package/src/cli/mcp/setup.ts +2 -58
  174. package/src/cli/mcp/tools.ts +4 -148
  175. package/src/cli/mcp/transports/http.ts +11 -3
  176. package/src/cli/mcp/types.ts +0 -6
  177. package/src/core/adoption/managed-hook-config.ts +21 -16
  178. package/src/core/adoption/minimum-harness-version.ts +90 -0
  179. package/src/core/adoption/standard-plan.ts +22 -2
  180. package/src/core/adoption/workflow-contract-asset.ts +8 -2
  181. package/src/core/architecture/module-view.ts +52 -12
  182. package/src/core/architecture/projection.ts +55 -5
  183. package/src/core/capabilities/ownership-blocker.ts +69 -0
  184. package/src/core/capabilities/registry.ts +116 -43
  185. package/src/core/dev-activity/decode.ts +8 -37
  186. package/src/core/dev-activity/projection.ts +5 -131
  187. package/src/core/dev-activity/types.ts +9 -34
  188. package/src/core/engineers/delegation.ts +3 -9
  189. package/src/core/engineers/scheduling.ts +48 -5
  190. package/src/core/evidence/payload-cap.ts +2 -4
  191. package/src/core/operator/architecture.ts +10 -6
  192. package/src/core/operator/planning-snapshot.ts +2 -2
  193. package/src/core/operator/repository-snapshot.ts +14 -0
  194. package/src/core/refactor/provider-contract.ts +6 -2
  195. package/src/core/release/runtime-evidence.ts +5 -98
  196. package/src/core/review/module-review-prompt.ts +21 -3
  197. package/src/core/setup/projection.ts +2 -2
  198. package/src/core/setup/types.ts +4 -4
  199. package/src/core/skill-surface/catalog.ts +4 -7
  200. package/src/core/state/project-effective-state.ts +11 -3
  201. package/src/core/state/types.ts +26 -0
  202. package/src/core/tools/catalog.ts +101 -0
  203. package/src/core/upgrade/legacy-inventory.ts +3 -3
  204. package/src/effects/architecture/archctx-provider.ts +397 -177
  205. package/src/effects/architecture/model-reader.ts +265 -119
  206. package/src/effects/architecture/projection-apply.ts +18 -61
  207. package/src/effects/artifact-retention.ts +314 -0
  208. package/src/effects/capabilities/archcontext-owners.ts +43 -11
  209. package/src/effects/dev-activity/collector.ts +9 -74
  210. package/src/effects/engineers/delegated-run-store.ts +2 -40
  211. package/src/effects/engineers/profile-store.ts +7 -15
  212. package/src/effects/engineers/scheduling.ts +5 -5
  213. package/src/effects/evidence/recovery-materializer.ts +65 -85
  214. package/src/effects/locking/exclusive-directory-lock.ts +158 -79
  215. package/src/effects/loop/state-input-collector.ts +29 -118
  216. package/src/effects/operator/architecture.ts +3 -1
  217. package/src/effects/operator/{collaboration-worker.ts → repository-snapshot-worker.ts} +16 -16
  218. package/src/effects/operator/{collaboration.ts → repository-snapshot.ts} +40 -49
  219. package/src/effects/operator/runtime-service.ts +8 -59
  220. package/src/effects/operator/server.ts +146 -162
  221. package/src/effects/publication/feedback-store.ts +108 -58
  222. package/src/effects/publication/publication-receipt.ts +45 -0
  223. package/src/effects/refactor/archctx-provider.ts +14 -24
  224. package/src/effects/refactor/recommendations.ts +47 -26
  225. package/src/effects/release/runtime-evidence.ts +14 -53
  226. package/src/effects/review/diff-fingerprint.ts +21 -17
  227. package/src/effects/review/generic-review.ts +12 -9
  228. package/src/effects/review/oar-review-host.ts +16 -8
  229. package/src/effects/run-summary-retention.ts +44 -88
  230. package/src/effects/runtime/helper-runner.ts +2 -20
  231. package/src/effects/state/collect-board-inputs.ts +1 -2
  232. package/src/effects/state/coordination-claim-token.ts +9 -0
  233. package/src/effects/state/coordination-worktree-topology.ts +64 -37
  234. package/src/effects/state/owed-capabilities.ts +150 -0
  235. package/src/effects/state/resolve-effective-state.ts +286 -107
  236. package/src/effects/state/worktree-trash.ts +12 -4
  237. package/src/effects/terminal/coding-session.ts +3 -3
  238. package/src/effects/terminal/oar-coding-host.ts +10 -7
  239. package/src/effects/terminal/task-role-profiles.ts +14 -28
  240. package/src/effects/terminal/task-runtime-observation.ts +183 -0
  241. package/src/effects/terminal/task-session.ts +68 -107
  242. package/src/operator-web/App.tsx +42 -44
  243. package/src/operator-web/Board.tsx +9 -40
  244. package/src/operator-web/ItemDrawer.tsx +10 -41
  245. package/src/operator-web/ModuleGraph.tsx +1 -1
  246. package/src/operator-web/OrganizationSummary.tsx +3 -3
  247. package/src/operator-web/PlanningView.tsx +2 -2
  248. package/src/operator-web/RepositoryWorkspace.tsx +11 -234
  249. package/src/operator-web/RuntimeBadges.tsx +7 -60
  250. package/src/operator-web/SetupPages.tsx +1 -2
  251. package/src/operator-web/SystemPage.tsx +4 -8
  252. package/src/operator-web/ToolsPage.tsx +136 -0
  253. package/src/operator-web/app.css +11 -23
  254. package/src/operator-web/dev-activity.ts +13 -25
  255. package/src/operator-web/fixture.ts +7 -196
  256. package/src/operator-web/fixtures/dev-activity.ts +13 -30
  257. package/src/operator-web/fixtures/index.ts +5 -26
  258. package/src/operator-web/fixtures/setup.ts +17 -30
  259. package/src/operator-web/fleet-api.ts +20 -20
  260. package/src/operator-web/i18n.ts +90 -438
  261. package/src/operator-web/labels.ts +0 -9
  262. package/src/operator-web/types.ts +27 -200
  263. package/src/operator-web/workspace-location.ts +13 -2
  264. package/assets/hooks/AGENTS.md +0 -41
  265. package/assets/hooks/CLAUDE.md +0 -41
  266. package/assets/hooks/lib/workflow-state.sh +0 -1599
  267. package/assets/hooks/projection.json +0 -9
  268. package/assets/reference-configs/AGENTS.md +0 -13
  269. package/assets/reference-configs/CLAUDE.md +0 -13
  270. package/assets/skills/repo-harness-cross-review/references/codex-mode.md +0 -18
  271. package/dist/operator-ui/assets/ArchitectureWorkspace-D4OUgv7P.js +0 -1
  272. package/dist/operator-ui/assets/index-DAePh_VG.css +0 -2
  273. package/dist/operator-ui/assets/index-y71_oLs9.js +0 -18
  274. package/scripts/c9-collaboration-dispatch-runner.ts +0 -27
  275. package/scripts/check-pi-package-smoke.ts +0 -59
  276. package/scripts/sync-hook-sources.ts +0 -277
  277. package/scripts/sync-pi-package.ts +0 -27
  278. package/src/cli/commands/collaboration.ts +0 -297
  279. package/src/cli/commands/hook.ts +0 -44
  280. package/src/cli/commands/pipeline.ts +0 -46
  281. package/src/cli/commands/prompt-guard-decision.ts +0 -240
  282. package/src/cli/commands/task-agent.ts +0 -66
  283. package/src/cli/hook/command-observed.ts +0 -289
  284. package/src/cli/hook/delegation-state.ts +0 -315
  285. package/src/cli/hook/minimal-change-cli.ts +0 -130
  286. package/src/cli/hook/minimal-change-context.ts +0 -60
  287. package/src/cli/hook/minimal-change-policy.ts +0 -192
  288. package/src/cli/hook/minimal-change-signals.ts +0 -637
  289. package/src/cli/hook/mutation-observed.ts +0 -731
  290. package/src/cli/hook/prompt-guard-decision.ts +0 -248
  291. package/src/cli/hook/prompt-handler.ts +0 -41
  292. package/src/cli/hook/prompt-intents.ts +0 -580
  293. package/src/cli/hook/prompt-router.ts +0 -75
  294. package/src/cli/hook/review-rubric.ts +0 -78
  295. package/src/cli/hook/review-subject.ts +0 -45
  296. package/src/cli/hook/run-identity.ts +0 -173
  297. package/src/cli/hook/subagent-handler.ts +0 -909
  298. package/src/cli/hook/trace-observer.ts +0 -209
  299. package/src/cli/mcp/collaboration-tools.ts +0 -333
  300. package/src/core/collaboration/admission.ts +0 -245
  301. package/src/core/collaboration/adoption.ts +0 -154
  302. package/src/core/collaboration/common.ts +0 -396
  303. package/src/core/collaboration/context-packet.ts +0 -601
  304. package/src/core/collaboration/contribution.ts +0 -444
  305. package/src/core/collaboration/handoff.ts +0 -376
  306. package/src/core/collaboration/hotspot.ts +0 -146
  307. package/src/core/collaboration/run-binding.ts +0 -263
  308. package/src/core/collaboration/signal.ts +0 -174
  309. package/src/core/collaboration/thread-projection.ts +0 -390
  310. package/src/core/collaboration/work-exchange.ts +0 -531
  311. package/src/core/engineers/automation-attempt.ts +0 -93
  312. package/src/core/hook-work-budget.ts +0 -3
  313. package/src/core/loop/loop-event-protocol.ts +0 -248
  314. package/src/core/operator/collaboration-snapshot.ts +0 -304
  315. package/src/core/pipeline/board.ts +0 -43
  316. package/src/core/pipeline/gates.ts +0 -32
  317. package/src/core/pipeline/health.ts +0 -53
  318. package/src/core/pipeline/projection.ts +0 -63
  319. package/src/core/pipeline/stage-machine.ts +0 -47
  320. package/src/core/pipeline/types.ts +0 -108
  321. package/src/effects/collaboration/actor.ts +0 -167
  322. package/src/effects/collaboration/admission-bridge.ts +0 -410
  323. package/src/effects/collaboration/adoption-store.ts +0 -271
  324. package/src/effects/collaboration/agent-surface.ts +0 -547
  325. package/src/effects/collaboration/context-delivery.ts +0 -449
  326. package/src/effects/collaboration/contribution-collector.ts +0 -483
  327. package/src/effects/collaboration/contribution-store.ts +0 -118
  328. package/src/effects/collaboration/feature-flag.ts +0 -64
  329. package/src/effects/collaboration/handoff-store.ts +0 -260
  330. package/src/effects/collaboration/provider-output-adapter.ts +0 -281
  331. package/src/effects/collaboration/record-store.ts +0 -488
  332. package/src/effects/collaboration/signal-store.ts +0 -241
  333. package/src/effects/collaboration/succession.ts +0 -409
  334. package/src/effects/collaboration/work-exchange.ts +0 -410
  335. package/src/effects/engineers/automation-attempt-store.ts +0 -48
  336. package/src/effects/evidence/post-bash-importer.ts +0 -362
  337. package/src/effects/operator/pipeline-status.ts +0 -15
  338. package/src/effects/pipeline/authority.ts +0 -141
  339. package/src/effects/pipeline/ingest.ts +0 -91
  340. package/src/effects/pipeline/ledger.ts +0 -179
  341. package/src/effects/pipeline/read.ts +0 -93
  342. package/src/effects/pipeline/store.ts +0 -292
  343. package/src/effects/state/coordination-lease-reclaim.ts +0 -60
  344. package/src/effects/terminal/task-request-readback.ts +0 -79
  345. package/src/operator-web/PipelineBoard.tsx +0 -380
  346. package/src/pi/extension.ts +0 -214
  347. package/src/pi/hook-bridge.ts +0 -121
  348. package/src/pi/hook-protocol.ts +0 -37
package/AGENTS.md CHANGED
@@ -4,23 +4,34 @@
4
4
  - For non-trivial work, follow the global Progressive Due Diligence rule (P1 map, P2 trace, P3 decision) before design decisions or code edits.
5
5
  - Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
6
6
  - Read the current request and repo-local agent context, work on a branch, make bounded commits, verify once, then report the PR outcome.
7
+ - Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
8
+ - Finish the main task first. Fix a small problem found on the way directly. For a large problem, open a GitHub issue before you work on it.
7
9
  - Write output text (docs, PR descriptions, commit messages, reports) in ASD-STE100 Simplified Technical English: short sentences, one idea per sentence, active voice, approved-dictionary words; write Chinese output the same way, with short sentences and one idea per sentence.
8
10
  - Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No mandatory plan/contract/review/notes chain; notes are only for non-obvious decisions.
9
11
  - Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
10
12
  - Only when the current task explicitly authorizes main publication may a model squash-merge after automated checks pass and GitHub has no outstanding change requests or unresolved review threads; an explicit no-merge instruction always wins. Push/tag still require task authorization; credentials/permissions, other deletion and release/production retain their separate approval boundaries. Record authorized publication, the provider-confirmed merge SHA and parent SHA, `git revert <squash-commit>`, and the daily report. Do not create rollback tags.
11
- - Default task worktrees use `/tmp/<repo>-wt-<slug>` on POSIX. Native Windows uses `os.tmpdir()` as the root. Stored downstream templates stay unchanged. Commit or push work before a reboot or age-based tmp cleanup, such as `systemd-tmpfiles`. These cleaners can remove checkouts. Missing entries are pruned. The sweep saves missing registration identities before global prune. Later batches finish deferred branch cleanup. Unmerged branches remain.
12
- - Closeout removes a merged, clean checkout and its branch. It releases only that checkout's own canonical marker after merge proof under the topology lock. The sweep keeps dirty, locked, marked or leased worktrees. It keeps branch reflogs without a commit-creation message and missing or unreadable reflogs. Fast-forward, target-only automatic merges, reset and rebase-finish messages do not count. Dispatch must establish an unmerged commit or keep the worktree dirty, marked or leased. A merged, clean, unowned branch with its own commits can be swept.
13
- - `start` recovers only a real target directory registered by this clone on the expected branch, under the topology lock, with no lock or other owner. Recovery requires a current-user-owned checkout directory without group or other write access, a regular owned Git pointer, its matching admin backpointer, and the original directory identity saved by start. Git metadata can be group-writable but must not be other-writable. Start still creates a checkout when uid is unavailable; recovery then refuses. Exact removal retires the identity after Git readback. Missing identity or a replacement directory blocks recovery. Files, symlinks, unregistered paths and other branches are refused. Cleanup refuses a registered worktree whose branch is missing. MCP cleanup also refuses active markers and retained native verification evidence. Sweep reports name processed paths. Deferred entries are reported as counts. `kept` excludes deferred entries. A command timeout sends SIGTERM to the direct child only. A grandchild can briefly extend the deadline. No detached cleanup process starts. Herdr notifications accept registered default task worktrees and paths inside them. Other temporary paths and `rh-herdr-` labels stay filtered.
13
+ - Default worktrees are at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`). Commit or push before a reboot or a tmp cleanup.
14
+ - Closeout and sweep remove only merged, clean and unowned worktrees. To keep one, give it an unmerged commit, keep it dirty, or mark or lease it. Details: [agentic-development-flow](docs/reference-configs/agentic-development-flow.md).
14
15
  - Automatically delete only merged, clean worktrees/branches; ask the user for every other deletion. Credentials/permissions (including confirmation bypass) and release/production operations require user approval.
15
16
  - Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
16
17
  - When you delegate, investigate first, then split work by write ownership. Give each parallel writer its own worktree from a clean source. Implementation sub-agents edit only their scope. They do not run build, typecheck or tests. They commit early in their own worktree and return early. In a shared checkout they do not commit; the parent commits. Evidence roles run the named check that is their task and do not commit. The parent agent owns task management, conflict resolution, build, typecheck, tests and integration. After integration, the parent removes each sub-agent worktree and branch whose commits are in the task branch and whose checkout is clean. It also removes the intermediate build output and temporary files that the work created. Other deletion still needs the user.
17
- - Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/external-tooling.md#herdr-dispatch).
18
+ - Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/herdr-notify.md#herdr-dispatch).
18
19
  - GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
19
20
  - When one PR changes both test assertions and implementation code, run one read-only review focused on tests bent to fit a bug (on-demand, not a restored gate; dispatch per the herdr guide).
20
21
  - `.archcontext/model/` owns architecture boundaries; read `docs/architecture/` on demand and update only real responsibility changes. Architecture diagnostics do not block work or author nested agent instructions.
22
+ - When a branch changes a capability's responsibility, entrypoints, relations or flows, run `repo-harness architecture-projection check --json` before review and follow `repo-harness-architecture` (`assets/skill-commands/repo-harness-architecture/references/worker.md`).
21
23
  - Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract.
22
24
  - `_ops/` is ignored private operations state: never commit or agent-edit it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
23
25
 
26
+ ## GitHub Issue Claims
27
+ - Before an agent starts work on a GitHub issue, read its current state, assignees and all comments through `gh` or the GitHub API. Use pagination for comments. Check existing work claims, linked PRs and handoff notes.
28
+ - An active claim is an assignee other than the current task owner, an open PR that links the issue, or an active claim comment that no later status comment released. If another agent or person has an active claim, do not start duplicate work. Coordinate with that owner within the authorized task scope. Take over only after an explicit handoff or user instruction. Silence, an old timestamp or a disconnected session does not release a claim.
29
+ - When taking an unclaimed issue or an approved handoff, post a claim comment before edits, tests or worker dispatch. Use `gh issue comment <issue-url> --body-file <file>`. This rule authorizes claim and status comments for an issue within the user's task scope. It grants no other GitHub write authority.
30
+ - Start the comment with `repo-harness issue claim`. Include `Status: active`, the agent kind and unique session or task ID, the branch, the work scope and any prior claim comment URL for a handoff. Use this identity in later status comments. A shared GitHub login is not an agent identity. Do not include secrets or private host paths.
31
+ - Read the issue comments again after posting. Confirm the published comment URL and body. If a competing claim appeared, stop duplicate work and resolve ownership before continuing. For simultaneous claims without an explicit assignment or handoff, the earliest GitHub comment wins; break timestamp ties by comment ID. These comments coordinate agents; they are not an atomic lock and do not replace canonical task claims or leases.
32
+ - On resume, check the current claim before continuing. Reuse the same active claim instead of posting it again. If a read or post fails, or delivery is uncertain, stop and report the failure. Read back before retrying an uncertain post.
33
+ - Post a status comment that links the claim when the work is blocked, ready for review, complete or released. Keep a blocked or review-pending claim active. Include the PR or result when available. Release ownership explicitly on cancellation or handoff. Do not close the issue unless the task authorizes closure.
34
+
24
35
  ## Code Optimization Principles
25
36
  - Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
26
37
  - Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
@@ -31,10 +42,12 @@
31
42
  - Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
32
43
 
33
44
  ## Testing
34
- - Run `bun run check:type` plus tests covering the changed behavior once after the implementation is stable.
45
+ - Run `bun run check:type` for code changes and tests covering the changed behavior once after the implementation is stable. Development-time debugging can run focused checks before that final verification.
46
+ - For a bug fix, prefer a focused failing regression before the fix. Run only the reproducer during RED. Record a reproduction gap when the environment cannot produce it; ordinary tasks do not require RED artifacts.
47
+ - A diff's size, a new test file, a new agent or a rebase does not by itself require a full run.
35
48
  - Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
36
49
  - Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
37
- - Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
50
+ - Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting or that deleted files stay deleted.
38
51
  - Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
39
52
  - Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
40
53
  - Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
@@ -54,7 +67,7 @@
54
67
 
55
68
  ## Codex
56
69
  - Own backend implementation and testing; Claude owns frontend implementation and interaction, and the parent coordinates scope and integration.
57
- - User-level `~/.codex/hooks.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Repo-local hook adapters are retired. Operator helpers use the package path from `repo-harness hook-lib path`. This source repo keeps `.ai/hooks/lib/workflow-state.sh` for self-hosting.
70
+ - User-level `~/.codex/hooks.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Operator helpers run from the package through `repo-harness run <helper>`.
58
71
  - Use `~/.codex/skills` as the runtime skill source; `~/.agents/skills` is staging/cache only. Keep `think`, `hunt`, `check` and `health` updates verified before runtime use.
59
72
  - The Codex automation profile requires runtime-provided `health`, `check` and `mermaid`; do not vendor their bodies.
60
73
  - Treat auto-compact as a fallback; prepare ignored `.ai/harness/handoff/current.md` and `resume.md` when long-task rollover is needed.
package/CLAUDE.md CHANGED
@@ -4,23 +4,34 @@
4
4
  - For non-trivial work, follow the global Progressive Due Diligence rule (P1 map, P2 trace, P3 decision) before design decisions or code edits.
5
5
  - Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
6
6
  - Read the current request and repo-local agent context, work on a branch, make bounded commits, verify once, then report the PR outcome.
7
+ - Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
8
+ - Finish the main task first. Fix a small problem found on the way directly. For a large problem, open a GitHub issue before you work on it.
7
9
  - Write output text (docs, PR descriptions, commit messages, reports) in ASD-STE100 Simplified Technical English: short sentences, one idea per sentence, active voice, approved-dictionary words; write Chinese output the same way, with short sentences and one idea per sentence.
8
10
  - Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No mandatory plan/contract/review/notes chain; notes are only for non-obvious decisions.
9
11
  - Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
10
12
  - Only when the current task explicitly authorizes main publication may a model squash-merge after automated checks pass and GitHub has no outstanding change requests or unresolved review threads; an explicit no-merge instruction always wins. Push/tag still require task authorization; credentials/permissions, other deletion and release/production retain their separate approval boundaries. Record authorized publication, the provider-confirmed merge SHA and parent SHA, `git revert <squash-commit>`, and the daily report. Do not create rollback tags.
11
- - Default task worktrees use `/tmp/<repo>-wt-<slug>` on POSIX. Native Windows uses `os.tmpdir()` as the root. Stored downstream templates stay unchanged. Commit or push work before a reboot or age-based tmp cleanup, such as `systemd-tmpfiles`. These cleaners can remove checkouts. Missing entries are pruned. The sweep saves missing registration identities before global prune. Later batches finish deferred branch cleanup. Unmerged branches remain.
12
- - Closeout removes a merged, clean checkout and its branch. It releases only that checkout's own canonical marker after merge proof under the topology lock. The sweep keeps dirty, locked, marked or leased worktrees. It keeps branch reflogs without a commit-creation message and missing or unreadable reflogs. Fast-forward, target-only automatic merges, reset and rebase-finish messages do not count. Dispatch must establish an unmerged commit or keep the worktree dirty, marked or leased. A merged, clean, unowned branch with its own commits can be swept.
13
- - `start` recovers only a real target directory registered by this clone on the expected branch, under the topology lock, with no lock or other owner. Recovery requires a current-user-owned checkout directory without group or other write access, a regular owned Git pointer, its matching admin backpointer, and the original directory identity saved by start. Git metadata can be group-writable but must not be other-writable. Start still creates a checkout when uid is unavailable; recovery then refuses. Exact removal retires the identity after Git readback. Missing identity or a replacement directory blocks recovery. Files, symlinks, unregistered paths and other branches are refused. Cleanup refuses a registered worktree whose branch is missing. MCP cleanup also refuses active markers and retained native verification evidence. Sweep reports name processed paths. Deferred entries are reported as counts. `kept` excludes deferred entries. A command timeout sends SIGTERM to the direct child only. A grandchild can briefly extend the deadline. No detached cleanup process starts. Herdr notifications accept registered default task worktrees and paths inside them. Other temporary paths and `rh-herdr-` labels stay filtered.
13
+ - Default worktrees are at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`). Commit or push before a reboot or a tmp cleanup.
14
+ - Closeout and sweep remove only merged, clean and unowned worktrees. To keep one, give it an unmerged commit, keep it dirty, or mark or lease it. Details: [agentic-development-flow](docs/reference-configs/agentic-development-flow.md).
14
15
  - Automatically delete only merged, clean worktrees/branches; ask the user for every other deletion. Credentials/permissions (including confirmation bypass) and release/production operations require user approval.
15
16
  - Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
16
17
  - When you delegate, investigate first, then split work by write ownership. Give each parallel writer its own worktree from a clean source. Implementation sub-agents edit only their scope. They do not run build, typecheck or tests. They commit early in their own worktree and return early. In a shared checkout they do not commit; the parent commits. Evidence roles run the named check that is their task and do not commit. The parent agent owns task management, conflict resolution, build, typecheck, tests and integration. After integration, the parent removes each sub-agent worktree and branch whose commits are in the task branch and whose checkout is clean. It also removes the intermediate build output and temporary files that the work created. Other deletion still needs the user.
17
- - Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/external-tooling.md#herdr-dispatch).
18
+ - Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/herdr-notify.md#herdr-dispatch).
18
19
  - GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
19
20
  - When one PR changes both test assertions and implementation code, run one read-only review focused on tests bent to fit a bug (on-demand, not a restored gate; dispatch per the herdr guide).
20
21
  - `.archcontext/model/` owns architecture boundaries; read `docs/architecture/` on demand and update only real responsibility changes. Architecture diagnostics do not block work or author nested agent instructions.
22
+ - When a branch changes a capability's responsibility, entrypoints, relations or flows, run `repo-harness architecture-projection check --json` before review and follow `repo-harness-architecture` (`assets/skill-commands/repo-harness-architecture/references/worker.md`).
21
23
  - Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract.
22
24
  - `_ops/` is ignored private operations state: never commit or agent-edit it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
23
25
 
26
+ ## GitHub Issue Claims
27
+ - Before an agent starts work on a GitHub issue, read its current state, assignees and all comments through `gh` or the GitHub API. Use pagination for comments. Check existing work claims, linked PRs and handoff notes.
28
+ - An active claim is an assignee other than the current task owner, an open PR that links the issue, or an active claim comment that no later status comment released. If another agent or person has an active claim, do not start duplicate work. Coordinate with that owner within the authorized task scope. Take over only after an explicit handoff or user instruction. Silence, an old timestamp or a disconnected session does not release a claim.
29
+ - When taking an unclaimed issue or an approved handoff, post a claim comment before edits, tests or worker dispatch. Use `gh issue comment <issue-url> --body-file <file>`. This rule authorizes claim and status comments for an issue within the user's task scope. It grants no other GitHub write authority.
30
+ - Start the comment with `repo-harness issue claim`. Include `Status: active`, the agent kind and unique session or task ID, the branch, the work scope and any prior claim comment URL for a handoff. Use this identity in later status comments. A shared GitHub login is not an agent identity. Do not include secrets or private host paths.
31
+ - Read the issue comments again after posting. Confirm the published comment URL and body. If a competing claim appeared, stop duplicate work and resolve ownership before continuing. For simultaneous claims without an explicit assignment or handoff, the earliest GitHub comment wins; break timestamp ties by comment ID. These comments coordinate agents; they are not an atomic lock and do not replace canonical task claims or leases.
32
+ - On resume, check the current claim before continuing. Reuse the same active claim instead of posting it again. If a read or post fails, or delivery is uncertain, stop and report the failure. Read back before retrying an uncertain post.
33
+ - Post a status comment that links the claim when the work is blocked, ready for review, complete or released. Keep a blocked or review-pending claim active. Include the PR or result when available. Release ownership explicitly on cancellation or handoff. Do not close the issue unless the task authorizes closure.
34
+
24
35
  ## Code Optimization Principles
25
36
  - Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
26
37
  - Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
@@ -31,10 +42,12 @@
31
42
  - Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
32
43
 
33
44
  ## Testing
34
- - Run `bun run check:type` plus tests covering the changed behavior once after the implementation is stable.
45
+ - Run `bun run check:type` for code changes and tests covering the changed behavior once after the implementation is stable. Development-time debugging can run focused checks before that final verification.
46
+ - For a bug fix, prefer a focused failing regression before the fix. Run only the reproducer during RED. Record a reproduction gap when the environment cannot produce it; ordinary tasks do not require RED artifacts.
47
+ - A diff's size, a new test file, a new agent or a rebase does not by itself require a full run.
35
48
  - Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
36
49
  - Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
37
- - Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
50
+ - Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting or that deleted files stay deleted.
38
51
  - Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
39
52
  - Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
40
53
  - Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
@@ -55,6 +68,6 @@
55
68
  ## Claude Code
56
69
  - Own frontend implementation and interaction; Codex owns backend implementation and testing, and the parent coordinates scope and integration.
57
70
  - Use Claude Code's available tools within granted permissions; changes to tool grants, hooks or confirmation bypass require approval of the exact change.
58
- - User-level `~/.claude/settings.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Repo-local hook adapters are retired. Operator helpers use the package path from `repo-harness hook-lib path`. This source repo keeps `.ai/hooks/lib/workflow-state.sh` for self-hosting.
71
+ - User-level `~/.claude/settings.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Operator helpers run from the package through `repo-harness run <helper>`.
59
72
  - Write comments, commits and PR text from the final diff; comments explain non-obvious reasons, and PRs describe final behavior and material rationale.
60
73
  - Keep this file short; load [development flow](docs/reference-configs/agentic-development-flow.md) and [external tooling](docs/reference-configs/external-tooling.md) only when needed.
package/README.es.md CHANGED
@@ -156,9 +156,8 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
156
156
  - **Sesiones respaldadas por archivos, no por historial de chat.** Las
157
157
  sesiones separadas de Claude y Codex se mantienen coordinadas a través del
158
158
  repositorio. `SessionStart` inyecta el resume packet de la sesión anterior,
159
- `Stop` escribe el handoff, y cada edición registra un pequeño evento de
160
- bitácora. Una sesión puede terminar a mitad de tarea, y la siguiente retoma
161
- exactamente el próximo paso, los blockers y los archivos modificados, sin
159
+ y `Stop` escribe el handoff y el resume. Una sesión puede terminar a mitad
160
+ de tarea, y la siguiente retoma exactamente el próximo paso, los blockers y los archivos modificados, sin
162
161
  tener que volver a inferirlos.
163
162
  - **Ahorro de tokens por diseño.** En lugar de bucles de grep-and-read que
164
163
  reescanean el repositorio en cada sesión, el harness se apoya en un índice
@@ -222,7 +221,7 @@ escrito un humano.
222
221
  | | |
223
222
  | --- | --- |
224
223
  | **Sesiones respaldadas por archivos** | Plans, contracts, checks y handoffs viven en el repositorio, de modo que una sesión nueva retoma desde artefactos en vez de un hilo de chat |
225
- | **Typed hook runtime** | Ocho managed routes compartidas, más tres delegation routes exclusivas de Codex, cada una atada a exactamente un typed handler in-process, con guards fail-closed en el límite de edición |
224
+ | **Typed hook runtime** | 6 routes públicas (Claude 5, Codex 5), cada una atada a exactamente un typed handler in-process, con guards fail-closed en el límite de edición |
226
225
  | **Plan → Contract → Review** | Un solo ciclo de vida desde el plan aprobado hasta el contract proyectado, el worktree aislado, la evidencia estructurada y un closeout revisable |
227
226
  | **Programas planificados por el Bot** | Programas de collaboration con task offers de engineer y leases renovables; el Bot planifica, repo-harness aporta herramientas y evidencia |
228
227
  | **Carga de contexto progresiva** | Un root context estable de ~12KB más capability contracts de ~1KB que solo se cargan para los archivos que realmente se están tocando |
@@ -299,11 +298,11 @@ flowchart TD
299
298
  CurrentTree --> Implement
300
299
  ContractRun --> Changes
301
300
 
302
- Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>PlanStatusGuard, ContractScopeGuard, WorktreeGuard"]
303
- PreHooks -->|blocked| ScopeFix["Fix plan, contract, worktree, or scope"]
301
+ Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
302
+ PreHooks -->|blocked| ScopeFix["Fix the target path"]
304
303
  ScopeFix --> Implement
305
304
  PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
306
- Changes --> PostHooks["Post-edit and post-bash hooks<br/>trace, handoff, check evidence"]
305
+ Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
307
306
  PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
308
307
  ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
309
308
 
@@ -368,13 +367,13 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
368
367
  ### Refactor recommendations
369
368
 
370
369
  ```bash
371
- repo-harness refactor recommendations # measured suggestions with evidence
372
- repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
370
+ repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
371
+ repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
373
372
  ```
374
373
 
375
374
  ArchContext mide problemas estructurales como ciclos y violaciones de
376
- dirección. repo-harness muestra cada sugerencia con sus métricas y las
377
- estadísticas de sus módulos, y registra la decisión del usuario. Nunca ejecuta
375
+ dirección. repo-harness muestra cada sugerencia con sus métricas, su evidencia
376
+ acotada y las estadísticas de sus módulos, y registra la decisión del usuario. Nunca ejecuta
378
377
  un refactor; una sugerencia aceptada sigue el flujo normal de plan y pull request.
379
378
 
380
379
  ### Plano de colaboración
@@ -421,26 +420,11 @@ Un task-agent fleet `deep-reasoner` persiste en un linked checkout dedicado y la
421
420
 
422
421
  ## Hooks
423
422
 
424
- El adapter instalado posee ocho managed hook routes compartidas. El route
425
- tuple `event + routeId + matcher` es el contract estable; cada tuple ata
426
- exactamente un typed handler in-process.
427
-
428
- | Route | Matcher | Handler | Función |
429
- | --- | --- | --- | --- |
430
- | `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | Inyecta el handoff anterior, el estado del sprint, guía de minimal-change y hallazgos de config-security de solo lectura antes de que empiece el trabajo. |
431
- | `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | Aplica la worktree policy y la readiness de plan/contract antes de las ediciones de implementación. |
432
- | `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | Mantiene el trabajo delegado retornando a través de la sesión padre, en lugar de dejar escapar afirmaciones de finalización. |
433
- | `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | Escribe como máximo un pequeño evento de bitácora con dirty bits por cada edición calificada; la verificación del contract, el sync de architecture/context/capability y la evidencia de minimal-change se difieren a Stop en vez de ejecutarse por cada edición. |
434
- | `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | Observa los resultados de comandos y captura evidencia de verificación sin reemplazar el command runner. |
435
- | `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | Provee trace y runtime observation de bajo ruido y siempre activo. |
436
- | `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | Clasifica la intención del prompt, enruta hints de planning/check y renderiza guía de workflow host-safe. |
437
- | `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | Finaliza el handoff y protege contra terminar con draft-plans sin resolver o vacíos de evidencia de completion. |
438
-
439
- Codex también instala tres Codex-only bounded-delegation routes —
440
- `UserPromptSubmit.delegation`, `SubagentStart.context`, y
441
- `SubagentStop.quality`, todas atadas a `src/cli/hook/subagent-handler.ts`;
442
- Claude solo conserva la route compartida de return-channel,
443
- `PreToolUse.subagent`.
423
+ El adapter instalado ata 6 hook routes públicas: Claude instala 5 y Codex instala
424
+ 5. El route tuple `event + routeId + matcher` es el contract estable;
425
+ cada tuple ata exactamente un typed handler in-process. La tabla de routes, con una
426
+ columna Host, está en
427
+ [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map).
444
428
 
445
429
  `repo-harness-hook` y su typed handler registry son el host-event runtime;
446
430
  `~/.claude/settings.json` y `~/.codex/hooks.json` son los adapters a nivel de
@@ -449,13 +433,14 @@ esos hooks corran. `.claude/settings.json` y `.codex/hooks.json` repo-locales
449
433
  son config legacy a retirar. Depura en este orden: adapter config ->
450
434
  `repo-harness-hook` -> route registry -> typed handler.
451
435
 
452
- Cuando un hook bloquea el trabajo, lee primero el structured terminal
453
- output: `guard`, `reason`, `fix`, `failure_class`, y `run_id`. Los registros
454
- durables viven en `.ai/harness/failures/latest.jsonl`, con la actividad de
455
- tools circundante en `.claude/.trace.jsonl`. Los guards comunes son
456
- `PlanStatusGuard` (no hay plan activo o ejecutable), `ContractGuard` (falta
457
- el contract scaffold, o se afirma completion antes de que el contract
458
- pasara), y `WorktreeGuard` (escrituras desde el worktree equivocado).
436
+ Cuando un hook bloquea el trabajo, lee primero la salida del terminal: una
437
+ línea `[<Guard>] <reason>` y una línea `Fix:`. El registro durable en
438
+ `.ai/harness/failures/latest.jsonl` lleva `guard`, `reason`, `fix`,
439
+ `failure_class`, y `run_id`. `.ai/harness/runs/hook-events.jsonl` registra
440
+ cada evento de hook. Los edit guards son `RepoScopeGuard` (una ruta fuera del
441
+ repositorio), `ExternalReferenceGuard` (`_ref/`), `OpsPrivateGuard`
442
+ (`_ops/`), y `ApplyPatchScopeGuard` y `EditScopeGuard` (sin una ruta de
443
+ destino legible).
459
444
  Playbook completo:
460
445
  [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md).
461
446
 
@@ -598,9 +583,11 @@ Ese checkout es la única fuente de verdad editable; las rutas locales de
598
583
  skill de Claude/Codex son runtime entrypoints respaldados por symlinks,
599
584
  reconstruidos por `scripts/sync-codex-installed-copies.sh`.
600
585
 
601
- `bun run check:ci` es el único gate equivalente a CI; `bun run check:release`
602
- solo añade el preflight de unpublished-version de npm antes de delegar a ese
603
- mismo gate.
586
+ `bun run check:ci` es el único gate equivalente a CI. `bun run check:release`
587
+ añade el preflight de unpublished-version de npm y después ejecuta el lane
588
+ `release`: los tests protegidos por el gate de coste y el smoke de instalación
589
+ del tarball. No es una segunda suite completa ni el gate de CI; un release
590
+ depende de un CI en verde para el SHA del release.
604
591
  Las pruebas afectadas cubren el routing del runtime. El antiguo gate de routing eval está retirado.
605
592
 
606
593
  ```bash
@@ -611,8 +598,8 @@ repo-harness docs show harness-overview
611
598
  bun scripts/assemble-template.ts --plan C --name "MyProject"
612
599
  ```
613
600
 
614
- Los cambios de hook actualizan `assets/hooks/` canónico una vez, y luego
615
- corren `bun run sync:hooks` con `bun run check:hooks` en la verificación. Los
601
+ Los cambios de hook handler van a `src/cli/hook/`. Los operator helpers están en
602
+ `scripts/` y se ejecutan con `repo-harness run <helper>`. Los
616
603
  reference docs son canónicos bajo `assets/reference-configs/` y se proyectan
617
604
  en `docs/reference-configs/`; `bun run check:reference-configs` verifica esa
618
605
  proyección.
@@ -649,8 +636,8 @@ repositorio adopte la misma política.
649
636
 
650
637
  ## Versión actual
651
638
 
652
- - Paquete npm: `repo-harness@0.22.1`
653
- - Sello de workflow generado: `repo-harness@0.22.1+template@0.22.1`
639
+ - Paquete npm: `repo-harness@0.23.0`
640
+ - Sello de workflow generado: `repo-harness@0.23.0+template@0.23.0`
654
641
  - Repositorio de GitHub: `Ancienttwo/repo-harness`
655
642
  - Notas de versión e historial: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
656
643
 
package/README.fr.md CHANGED
@@ -154,10 +154,9 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
154
154
 
155
155
  - **Des sessions file-backed, pas de mémoire de chat.** Les sessions Claude et
156
156
  Codex séparées restent coordonnées via le dépôt. `SessionStart` injecte le
157
- resume packet de la session précédente, `Stop` écrit le handoff, et chaque
158
- édition enregistre un petit événement de journal. Une session peut
159
- s'arrêter en plein milieu d'une tâche, et la suivante reprend directement à
160
- l'étape suivante exacte, avec les blockers et les fichiers modifiés, sans
157
+ resume packet de la session précédente, et `Stop` écrit le handoff et le
158
+ resume. Une session peut s'arrêter en plein milieu d'une tâche, et la
159
+ suivante reprend directement à l'étape suivante exacte, avec les blockers et les fichiers modifiés, sans
161
160
  avoir à les redéduire.
162
161
  - **Économe en tokens par conception.** Au lieu de boucles grep-and-read qui
163
162
  rescannent le dépôt à chaque session, le harness s'appuie sur un index
@@ -220,7 +219,7 @@ humain aurait écrits.
220
219
  | | |
221
220
  | --- | --- |
222
221
  | **Sessions file-backed** | Les plans, contracts, checks et handoffs vivent dans le dépôt, si bien qu'une nouvelle session reprend à partir des artifacts plutôt que d'un chat thread |
223
- | **Runtime de hooks typés** | Huit routes managées partagées, plus trois routes de delegation réservées à Codex, chacune liée à exactement un typed handler in-process, avec des guards fail-closed à la frontière d'édition |
222
+ | **Runtime de hooks typés** | 6 routes publiques (Claude 5, Codex 5), chacune liée à exactement un typed handler in-process, avec des guards fail-closed à la frontière d'édition |
224
223
  | **Plan → Contract → Review** | Un seul lifecycle, du plan approuvé au contract projeté, en passant par le worktree isolé et l'evidence structurée, jusqu'à un closeout prêt pour la review |
225
224
  | **Programmes ordonnancés par le Bot** | Programmes de collaboration avec des task offers d'engineer et des leases renouvelables ; le Bot ordonnance, repo-harness fournit les outils et les preuves |
226
225
  | **Chargement de contexte progressif** | Un root context stable d'environ 12 Ko, plus des capability contracts d'environ 1 Ko chargés uniquement pour les fichiers réellement touchés |
@@ -297,11 +296,11 @@ flowchart TD
297
296
  CurrentTree --> Implement
298
297
  ContractRun --> Changes
299
298
 
300
- Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>PlanStatusGuard, ContractScopeGuard, WorktreeGuard"]
301
- PreHooks -->|blocked| ScopeFix["Fix plan, contract, worktree, or scope"]
299
+ Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
300
+ PreHooks -->|blocked| ScopeFix["Fix the target path"]
302
301
  ScopeFix --> Implement
303
302
  PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
304
- Changes --> PostHooks["Post-edit and post-bash hooks<br/>trace, handoff, check evidence"]
303
+ Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
305
304
  PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
306
305
  ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
307
306
 
@@ -366,13 +365,13 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
366
365
  ### Refactor recommendations
367
366
 
368
367
  ```bash
369
- repo-harness refactor recommendations # measured suggestions with evidence
370
- repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
368
+ repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
369
+ repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
371
370
  ```
372
371
 
373
372
  ArchContext mesure des problèmes structurels comme les cycles et les
374
373
  violations de direction. repo-harness montre chaque suggestion avec ses
375
- métriques et les statistiques de ses modules, et enregistre la décision de
374
+ métriques, ses preuves bornées et les statistiques de ses modules, et enregistre la décision de
376
375
  l'utilisateur. Il n'exécute jamais de refactor ; une suggestion acceptée suit le
377
376
  flux normal de plan et de pull request.
378
377
 
@@ -420,25 +419,11 @@ Un task-agent fleet `deep-reasoner` persiste dans un linked checkout dédié et
420
419
 
421
420
  ## Hooks
422
421
 
423
- L'adapter installé possède huit routes de hook managées et partagées. Le
424
- tuple de route `event + routeId + matcher` est le contrat stable ; chaque
425
- tuple lie exactement un typed handler in-process.
426
-
427
- | Route | Matcher | Handler | Fonction |
428
- | --- | --- | --- | --- |
429
- | `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | Injecte le handoff précédent, le statut sprint, la guidance minimal-change, et les findings config-security read-only avant le début du travail. |
430
- | `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | Impose la worktree policy et la readiness plan/contract avant les edits d'implémentation. |
431
- | `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | Garde le travail délégué qui revient via la session parent, au lieu de laisser fuiter des complétions prétendues. |
432
- | `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | Écrit au plus un petit événement de journal avec des dirty bits par edit qualifiant ; la contract verification, la sync architecture/context/capability, et l'evidence minimal-change sont différées jusqu'au Stop plutôt qu'exécutées à chaque edit. |
433
- | `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | Observe les résultats de commande et capture l'evidence de vérification sans remplacer le command runner. |
434
- | `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | Fournit une trace toujours active et à faible bruit, ainsi que l'observation runtime. |
435
- | `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | Classifie l'intent du prompt, route les hints de planning/check, et rend une guidance de workflow host-safe. |
436
- | `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | Finalise le handoff et empêche de terminer avec un draft-plan non résolu ou des gaps d'evidence de complétion. |
437
-
438
- Codex installe aussi trois routes de bounded-delegation réservées à Codex —
439
- `UserPromptSubmit.delegation`, `SubagentStart.context` et
440
- `SubagentStop.quality`, toutes liées à `src/cli/hook/subagent-handler.ts` ;
441
- Claude ne garde que la route partagée `PreToolUse.subagent` return-channel.
422
+ L'adapter installé lie 6 routes de hook publiques : Claude en installe 5 et Codex en
423
+ installe 5. Le tuple de route `event + routeId + matcher` est
424
+ le contrat stable ; chaque tuple lie exactement un typed handler in-process. La table
425
+ des routes, avec une colonne Host, est dans
426
+ [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map).
442
427
 
443
428
  `repo-harness-hook` et son typed handler registry constituent le host-event
444
429
  runtime ; `~/.claude/settings.json` et `~/.codex/hooks.json` sont les adapters
@@ -448,13 +433,14 @@ Settings avant que ces hooks ne s'exécutent. Les `.claude/settings.json` et
448
433
  l'ordre : adapter config -> `repo-harness-hook` -> route registry -> typed
449
434
  handler.
450
435
 
451
- Quand un hook bloque le travail, lisez d'abord la sortie terminal structurée :
452
- `guard`, `reason`, `fix`, `failure_class` et `run_id`. Les enregistrements
453
- durables vivent dans `.ai/harness/failures/latest.jsonl`, avec l'activité
454
- outil environnante dans `.claude/.trace.jsonl`. Les guards courants sont
455
- `PlanStatusGuard` (pas de plan actif ou exécutable), `ContractGuard` (contract
456
- scaffold manquant, ou complétion déclarée avant que le contract ne passe), et
457
- `WorktreeGuard` (écritures depuis le mauvais worktree). Guide complet :
436
+ Quand un hook bloque le travail, lisez d'abord la sortie terminal : une ligne
437
+ `[<Guard>] <reason>` et une ligne `Fix:`. L'enregistrement durable dans
438
+ `.ai/harness/failures/latest.jsonl` contient `guard`, `reason`, `fix`,
439
+ `failure_class` et `run_id`. `.ai/harness/runs/hook-events.jsonl` enregistre
440
+ chaque événement de hook. Les edit guards sont `RepoScopeGuard` (un chemin
441
+ hors du dépôt), `ExternalReferenceGuard` (`_ref/`), `OpsPrivateGuard`
442
+ (`_ops/`), et `ApplyPatchScopeGuard` et `EditScopeGuard` (aucun chemin cible
443
+ lisible). Guide complet :
458
444
  [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md).
459
445
 
460
446
  ## Console de contrôle humaine locale
@@ -595,8 +581,11 @@ Ce checkout est l'unique source of truth éditable ; les chemins de skill
595
581
  Claude/Codex locaux sont des runtime entrypoints adossés à des symlinks,
596
582
  reconstruits par `scripts/sync-codex-installed-copies.sh`.
597
583
 
598
- `bun run check:ci` est le gate unique équivalent CI ; `bun run check:release`
599
- ajoute seulement le preflight npm unpublished-version avant de lui déléguer.
584
+ `bun run check:ci` est le gate unique équivalent CI. `bun run check:release`
585
+ ajoute le preflight npm unpublished-version, puis exécute le lane `release` :
586
+ les tests protégés par le gate de coût et le smoke d'installation du tarball.
587
+ Ce n'est ni une deuxième suite complète ni le gate CI ; une release dépend d'un
588
+ CI vert pour le SHA de la release.
600
589
  Les tests concernés vérifient le routing du runtime. Le gate de routing eval est retiré.
601
590
 
602
591
  ```bash
@@ -607,9 +596,8 @@ repo-harness docs show harness-overview
607
596
  bun scripts/assemble-template.ts --plan C --name "MyProject"
608
597
  ```
609
598
 
610
- Les changements de hook mettent à jour `assets/hooks/` canonique une fois,
611
- puis lancent `bun run sync:hooks`, avec `bun run check:hooks` en
612
- vérification. Les reference docs sont canoniques sous
599
+ Les changements de hook handler vont dans `src/cli/hook/`. Les operator helpers sont dans
600
+ `scripts/` et s'exécutent avec `repo-harness run <helper>`. Les reference docs sont canoniques sous
613
601
  `assets/reference-configs/` et projetées dans `docs/reference-configs/` ;
614
602
  `bun run check:reference-configs` vérifie cette projection.
615
603
 
@@ -645,8 +633,8 @@ adopte la même policy.
645
633
 
646
634
  ## Release actuelle
647
635
 
648
- - Package npm : `repo-harness@0.22.1`
649
- - Generated workflow stamp : `repo-harness@0.22.1+template@0.22.1`
636
+ - Package npm : `repo-harness@0.23.0`
637
+ - Generated workflow stamp : `repo-harness@0.23.0+template@0.23.0`
650
638
  - Dépôt GitHub : `Ancienttwo/repo-harness`
651
639
  - Notes et historique de release : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
652
640
 
package/README.ja.md CHANGED
@@ -157,7 +157,7 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
157
157
  - **セッションの状態はファイルに残り、チャット履歴には残らない。** 別々の
158
158
  Claude セッションと Codex セッションは、リポジトリを介して同期を保ちます。
159
159
  `SessionStart` が前回セッションの resume packet を注入し、`Stop` が handoff
160
- を書き出し、各編集は小さな journal event を記録します。セッションはタスクの
160
+ と resume を書き出します。セッションはタスクの
161
161
  途中で終了でき、次のセッションは正確な次の一手・blocker・変更ファイルを、
162
162
  推測し直すことなくそのまま引き継ぎます。
163
163
  - **設計上 token を節約する。** セッションのたびにリポジトリを grep-and-read
@@ -217,7 +217,7 @@ Layer 2 は Layer 1 を置き換えるものではありません。program の
217
217
  | | |
218
218
  | --- | --- |
219
219
  | **File-backed sessions** | Plan、contract、check、handoff がリポジトリに残るので、新しいセッションはチャットスレッドではなく artifacts から再開します |
220
- | **Typed hook runtime** | 8 本の共有 managed route と 3 本の Codex 専用 delegation route があり、それぞれが exactly one の typed in-process handler に bind され、edit boundary で fail-closed な guard がかかります |
220
+ | **Typed hook runtime** | 6 本の公開 route(Claude 5 本、Codex 5 本)があり、それぞれが exactly one の typed in-process handler に bind され、edit boundary で fail-closed な guard がかかります |
221
221
  | **Plan → Contract → Review** | approved plan から投射された contract、隔離された worktree、構造化された evidence、review 可能な closeout までの 1 本の lifecycle |
222
222
  | **Bot-scheduled programs** | engineer task offer と更新可能な lease を持つ collaboration program。Bot がスケジュールし、repo-harness が tools と evidence を提供します |
223
223
  | **Progressive context loading** | 安定した約 12KB の root context に、実際に触れるファイルにだけ読み込まれる約 1KB の capability contract が加わります |
@@ -296,11 +296,11 @@ flowchart TD
296
296
  CurrentTree --> Implement
297
297
  ContractRun --> Changes
298
298
 
299
- Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>PlanStatusGuard, ContractScopeGuard, WorktreeGuard"]
300
- PreHooks -->|blocked| ScopeFix["Fix plan, contract, worktree, or scope"]
299
+ Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
300
+ PreHooks -->|blocked| ScopeFix["Fix the target path"]
301
301
  ScopeFix --> Implement
302
302
  PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
303
- Changes --> PostHooks["Post-edit and post-bash hooks<br/>trace, handoff, check evidence"]
303
+ Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
304
304
  PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
305
305
  ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
306
306
 
@@ -364,12 +364,12 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
364
364
  ### Refactor recommendations
365
365
 
366
366
  ```bash
367
- repo-harness refactor recommendations # measured suggestions with evidence
368
- repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
367
+ repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
368
+ repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
369
369
  ```
370
370
 
371
371
  ArchContext は循環や依存方向の違反などの構造上の問題を計測します。repo-harness は
372
- 各提案をその指標とモジュール統計とともに表示し、ユーザーの判断を記録します。
372
+ 各提案をその指標、上限付きの根拠、モジュール統計とともに表示し、ユーザーの判断を記録します。
373
373
  リファクタリング自体は実行しません。受け入れた提案は通常の plan と pull request の
374
374
  流れで進めます。
375
375
 
@@ -416,26 +416,11 @@ Herdr のない Claude デスクトップアプリでは `--launch app-terminal`
416
416
 
417
417
  ## Hooks
418
418
 
419
- インストールされた adapter は、8 本の共有 managed hook route を所有します。
420
- `event + routeId + matcher` の route tuple が安定した契約であり、各 tuple は
421
- exactly one の typed in-process handler に bind されます。
422
-
423
- | Route | Matcher | Handler | 機能 |
424
- | --- | --- | --- | --- |
425
- | `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | 作業開始前に、直前の handoff、sprint status、minimal-change guidance、read-only な config-security の findings を注入します。 |
426
- | `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | 実装編集の前に worktree policy と plan/contract の readiness を強制します。 |
427
- | `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | delegate された作業が completion claim を漏らさず、parent session を経由して戻るようにします。 |
428
- | `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | 該当する編集ごとに、dirty bits を伴う小さな journal event を高々 1 件書き込みます。contract verification、architecture/context/capability sync、minimal-change evidence は編集ごとには実行されず、Stop まで遅延されます。 |
429
- | `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | command runner を置き換えることなく、command の結果を観測し verification evidence を取得します。 |
430
- | `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | low-noise で常時稼働する trace と runtime observation を提供します。 |
431
- | `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | prompt の intent を分類し、planning/check の hint を route し、host-safe な workflow guidance を描画します。 |
432
- | `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | handoff を finalize し、未解決の draft-plan や completion evidence の gap を残したまま終了しないよう防ぎます。 |
433
-
434
- Codex はさらに、3 本の Codex 専用 bounded-delegation route —
435
- `UserPromptSubmit.delegation`、`SubagentStart.context`、`SubagentStop.quality`
436
- — をインストールし、すべて `src/cli/hook/subagent-handler.ts` に bind
437
- されます。Claude 側は共有の `PreToolUse.subagent` return-channel route だけを
438
- 保持します。
419
+ インストールされた adapter は 6 本の公開 hook route を bind します。Claude は 5 本、
420
+ Codex は 5 本をインストールします。`event + routeId + matcher` の
421
+ route tuple が安定した契約であり、各 tuple は exactly one の typed in-process
422
+ handler に bind されます。Host 列つきの route 表は
423
+ [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map) にあります。
439
424
 
440
425
  `repo-harness-hook` とその typed handler registry が host-event の runtime
441
426
  です。`~/.claude/settings.json` と `~/.codex/hooks.json` が user-level の
@@ -445,13 +430,14 @@ adapter であり、Codex は hooks が動く前に Settings でそのファイ
445
430
  adapter config -> `repo-harness-hook` -> route registry -> typed handler の
446
431
  順に確認してください。
447
432
 
448
- hook が作業を block したときは、まず構造化された terminal 出力 — `guard`、
449
- `reason`、`fix`、`failure_class`、`run_id` — を読んでください。持続的な記録は
450
- `.ai/harness/failures/latest.jsonl` にあり、周辺の tool activity は
451
- `.claude/.trace.jsonl` にあります。よくある guard は `PlanStatusGuard`(active
452
- または実行可能な plan がない)、`ContractGuard`(contract scaffold が存在
453
- しない、または contract が通る前に completion を主張した)、`WorktreeGuard`
454
- (誤った worktree からの書き込み)です。完全な playbook は
433
+ hook が作業を block したときは、まず terminal 出力を読んでください。
434
+ `[<Guard>] <reason>` の行と `Fix:` の行が 1 行ずつ出ます。持続的な記録は
435
+ `.ai/harness/failures/latest.jsonl` にあり、`guard`、`reason`、`fix`、
436
+ `failure_class`、`run_id` を持ちます。`.ai/harness/runs/hook-events.jsonl` は
437
+ 各 hook event を記録します。edit guard は `RepoScopeGuard`(リポジトリ外の
438
+ パス)、`ExternalReferenceGuard`(`_ref/`)、`OpsPrivateGuard`(`_ops/`)、
439
+ そして `ApplyPatchScopeGuard` と `EditScopeGuard`(解析できる対象パスがない)
440
+ です。完全な playbook は
455
441
  [`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md)
456
442
  を参照してください。
457
443
 
@@ -594,9 +580,11 @@ cd ~/Projects/repo-harness && bun src/cli/index.ts update
594
580
  Claude/Codex skill path は `scripts/sync-codex-installed-copies.sh` によって
595
581
  再構築される、symlink に裏打ちされた runtime entrypoint です。
596
582
 
597
- `bun run check:ci` が唯一の CI-equivalent gate であり、
598
- `bun run check:release` はそこへ委譲する前に npm の unpublished-version
599
- preflight を追加するだけです。
583
+ `bun run check:ci` が唯一の CI-equivalent gate です。
584
+ `bun run check:release` は npm の unpublished-version preflight の後に
585
+ `release` lane を実行します。この lane は高コスト gate 付きのテストと
586
+ tarball install smoke だけを実行します。2 回目の full suite でも CI gate
587
+ でもありません。release はその release SHA の CI が green であることを前提にします。
600
588
  Runtime routing の回帰テストは保持します。旧 routing eval gate は廃止しました。
601
589
 
602
590
  ```bash
@@ -607,9 +595,8 @@ repo-harness docs show harness-overview
607
595
  bun scripts/assemble-template.ts --plan C --name "MyProject"
608
596
  ```
609
597
 
610
- Hook の変更は、まず canonical な `assets/hooks/` を更新し、その後
611
- `bun run sync:hooks` を実行し、verification で `bun run check:hooks` を
612
- 使います。Reference docs は `assets/reference-configs/` 配下が canonical であり、
598
+ Hook handler の変更は `src/cli/hook/` を編集します。Operator helper は `scripts/` にあり、
599
+ `repo-harness run <helper>` で実行します。Reference docs は `assets/reference-configs/` 配下が canonical であり、
613
600
  `docs/reference-configs/` へ投射されます。`bun run check:reference-configs`
614
601
  がその投射を検証します。
615
602
 
@@ -645,8 +632,8 @@ commit script や hooks に組み込まないでください。
645
632
 
646
633
  ## 現在の Release
647
634
 
648
- - npm package:`repo-harness@0.22.1`
649
- - Generated workflow stamp:`repo-harness@0.22.1+template@0.22.1`
635
+ - npm package:`repo-harness@0.23.0`
636
+ - Generated workflow stamp:`repo-harness@0.23.0+template@0.23.0`
650
637
  - GitHub repository:`Ancienttwo/repo-harness`
651
638
  - Release notes and history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
652
639