repo-harness 0.30.0 → 0.31.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 (312) hide show
  1. package/README.md +1 -1
  2. package/assets/herdr/github-events/filter.mjs +2 -1
  3. package/assets/reference-configs/agentic-development-flow.md +1 -2
  4. package/assets/reference-configs/design-options.md +3 -1
  5. package/assets/reference-configs/document-generation.md +2 -2
  6. package/assets/reference-configs/external-tooling.md +11 -10
  7. package/assets/reference-configs/heartbeat-triage.md +2 -3
  8. package/assets/reference-configs/herdr-notify.md +12 -7
  9. package/assets/reference-configs/hook-operations.md +7 -8
  10. package/assets/reference-configs/host-invariants.md +15 -15
  11. package/assets/reference-configs/minimal-change-hooks.md +3 -6
  12. package/assets/reference-configs/release-deploy.md +13 -7
  13. package/assets/reference-configs/ux-feature-guard.md +3 -1
  14. package/assets/review-high-list.v1.json +1 -1
  15. package/assets/skill-commands/repo-harness-architecture/references/worker.md +1 -1
  16. package/assets/skill-commands/repo-harness-ship/references/worker.md +2 -2
  17. package/assets/skill-version.json +2 -2
  18. package/assets/skills/repo-harness-advisor/SKILL.md +1 -1
  19. package/assets/skills/repo-harness-issue-flow/SKILL.md +37 -11
  20. package/assets/skills/repo-harness-issue-flow/references/acceptor.md +21 -33
  21. package/assets/skills/repo-harness-issue-flow/references/advisor.md +114 -0
  22. package/assets/skills/repo-harness-issue-flow/references/board.md +24 -31
  23. package/assets/skills/repo-harness-issue-flow/references/events.md +5 -1
  24. package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +171 -146
  25. package/assets/skills/repo-harness-issue-flow/references/replan.md +4 -6
  26. package/assets/skills/repo-harness-issue-flow/references/templates.md +25 -72
  27. package/assets/skills/repo-harness-issue-flow/references/worker.md +11 -5
  28. package/assets/skills/repo-harness-orchestrator/SKILL.md +1 -1
  29. package/assets/skills/repo-harness-product/references/prd.md +4 -3
  30. package/assets/skills/repo-harness-test/references/authoring.md +10 -10
  31. package/assets/skills/repo-harness-test/references/refactor-evidence.md +1 -1
  32. package/assets/skills/repo-harness-test/references/running.md +3 -3
  33. package/assets/templates/helpers/capability-resolver.ts +223 -15
  34. package/assets/templates/runtime-state.gitignore +37 -0
  35. package/assets/templates/runtime.gitignore +1 -37
  36. package/assets/workflow-contract.v1.json +50 -13
  37. package/dist/hook-entry.js +504 -435
  38. package/dist/oar-review-host.js +67 -59
  39. package/package.json +3 -4
  40. package/scripts/capability-config.ts +5 -23
  41. package/scripts/check-ci.sh +51 -12
  42. package/scripts/check-state-boundaries.ts +0 -4
  43. package/scripts/check-tarball-install-smoke.sh +1 -1
  44. package/scripts/contract-worktree-runtime.ts +3 -3
  45. package/scripts/contract-worktree.sh +4 -5
  46. package/scripts/cutover-closure.ts +0 -1
  47. package/scripts/inspect-project-state.ts +0 -21
  48. package/scripts/new-spec.sh +4 -24
  49. package/scripts/report-ci.ts +23 -56
  50. package/scripts/run-skill-routing-eval.ts +3 -4
  51. package/scripts/select-ci-coverage.ts +51 -17
  52. package/scripts/select-test-suite.ts +83 -20
  53. package/scripts/sync-helper-sources.ts +8 -0
  54. package/src/cli/commands/adoption-plan.ts +1 -4
  55. package/src/cli/commands/board.ts +14 -16
  56. package/src/cli/commands/brain.ts +14 -17
  57. package/src/cli/commands/candidate-reconciliation.ts +6 -17
  58. package/src/cli/commands/capability-context.ts +10 -33
  59. package/src/cli/commands/docs.ts +13 -7
  60. package/src/cli/commands/global-runtime.ts +48 -8
  61. package/src/cli/commands/herdr-skill.ts +4 -8
  62. package/src/cli/commands/init-hook.ts +2 -5
  63. package/src/cli/commands/init.ts +0 -8
  64. package/src/cli/commands/operator.ts +0 -2
  65. package/src/cli/commands/publication.ts +3 -21
  66. package/src/cli/commands/quota.ts +3 -2
  67. package/src/cli/commands/seats.ts +57 -29
  68. package/src/cli/commands/security.ts +20 -22
  69. package/src/cli/commands/status.ts +2 -10
  70. package/src/cli/commands/upgrade-registered.ts +12 -11
  71. package/src/cli/commands/upgrade.ts +3 -28
  72. package/src/cli/hook/agent-notice.ts +21 -11
  73. package/src/cli/index.ts +10 -7
  74. package/src/cli/installer/global-context.ts +1 -4
  75. package/src/cli/installer/install-profile.ts +21 -24
  76. package/src/cli/installer/install-state.ts +1 -4
  77. package/src/cli/installer/managed-entries.ts +3 -5
  78. package/src/cli/installer/uninstall.ts +16 -1
  79. package/src/cli/installer/waza-rules.ts +1 -1
  80. package/src/cli/mcp/audit.ts +2 -2
  81. package/src/cli/mcp/auth.ts +8 -10
  82. package/src/cli/mcp/doctor.ts +2 -6
  83. package/src/cli/mcp/fleet-tools.ts +5 -33
  84. package/src/cli/mcp/general-repo-access/authority.ts +7 -29
  85. package/src/cli/mcp/general-repo-access.ts +59 -85
  86. package/src/cli/mcp/guarded-write.ts +4 -6
  87. package/src/cli/mcp/local-config-check.ts +30 -0
  88. package/src/cli/mcp/paths.ts +17 -9
  89. package/src/cli/mcp/reader-tools.ts +12 -54
  90. package/src/cli/mcp/repo.ts +2 -5
  91. package/src/cli/mcp/result.ts +27 -0
  92. package/src/cli/mcp/server.ts +1 -3
  93. package/src/cli/mcp/tools.ts +20 -54
  94. package/src/cli/mcp/workspaces.ts +6 -12
  95. package/src/cli/tools/codegraph-reader.ts +3 -11
  96. package/src/cli/tools/codegraph.ts +0 -4
  97. package/src/core/adoption/modes.ts +0 -4
  98. package/src/core/adoption/render.ts +3 -7
  99. package/src/core/architecture/projection.ts +19 -1
  100. package/src/core/board/attention-delivery.ts +54 -11
  101. package/src/core/board/attention.ts +296 -32
  102. package/src/core/board/board.ts +190 -74
  103. package/src/core/board/dependency-migration.ts +2 -2
  104. package/src/core/board/desk.ts +1 -19
  105. package/src/core/board/dispatch.ts +10 -20
  106. package/src/core/board/hazards.ts +2 -5
  107. package/src/core/board/merge.ts +13 -4
  108. package/src/core/board/plan-block.ts +7 -20
  109. package/src/core/board/quota.ts +3 -1
  110. package/src/core/board/review.ts +28 -9
  111. package/src/core/board/seat-launch.ts +10 -10
  112. package/src/core/board/seat-routing.ts +48 -10
  113. package/src/core/board/seats-settings.ts +15 -6
  114. package/src/core/board/source.ts +183 -32
  115. package/src/core/capabilities/resolver.ts +2 -9
  116. package/src/core/ci/documentation-path.ts +21 -0
  117. package/src/core/dev-activity/decode.ts +2 -10
  118. package/src/core/evidence/byte-compare.ts +7 -0
  119. package/src/core/evidence/canonical-json.ts +23 -19
  120. package/src/core/evidence/checkpoint.ts +1 -5
  121. package/src/core/evidence/decode-readers.ts +31 -0
  122. package/src/core/evidence/error-message.ts +7 -0
  123. package/src/core/evidence/fold.ts +3 -5
  124. package/src/core/evidence/idempotency.ts +2 -3
  125. package/src/core/evidence/is-record.ts +8 -0
  126. package/src/core/evidence/record-validators.ts +36 -0
  127. package/src/core/evidence/redaction.ts +2 -2
  128. package/src/core/evidence/required-check-evidence.ts +2 -29
  129. package/src/core/evidence/sha256-pattern.ts +6 -0
  130. package/src/core/evidence/sha256.ts +15 -0
  131. package/src/core/evidence/test-execution-evidence.ts +0 -5
  132. package/src/core/evidence/types.ts +0 -8
  133. package/src/core/evidence/verification-plan.ts +9 -18
  134. package/src/core/fleet/admitted-task-message.ts +29 -59
  135. package/src/core/fleet/task-inbox-layout.ts +0 -1
  136. package/src/core/fleet/task-message.ts +52 -85
  137. package/src/core/messages/mechanics.ts +21 -14
  138. package/src/core/messages/task-message-claim.ts +2 -2
  139. package/src/core/operator/agent-config.ts +2 -252
  140. package/src/core/operator/architecture-map.ts +5 -4
  141. package/src/core/operator/board-read.ts +2 -2
  142. package/src/core/operator/bot-access.ts +6 -6
  143. package/src/core/operator/notify-status.ts +0 -2
  144. package/src/core/operator/runtime-capture.ts +0 -1
  145. package/src/core/operator/slack-review.ts +2 -7
  146. package/src/core/operator/tests.ts +4 -2
  147. package/src/core/operator/worktree-cleanup-observation.ts +15 -0
  148. package/src/core/operator/worktree-cleanup-plan.ts +3 -5
  149. package/src/core/publication/acceptance-merge-policy.ts +3 -12
  150. package/src/core/publication/feedback.ts +6 -8
  151. package/src/core/publication/generated-artifacts.ts +2 -13
  152. package/src/core/publication/merge-readiness.ts +45 -71
  153. package/src/core/publication/publication-receipt.ts +3 -13
  154. package/src/core/publication/required-check-coverage.ts +2 -31
  155. package/src/core/review/acceptance-receipt.ts +17 -33
  156. package/src/core/review/authority-context.ts +7 -7
  157. package/src/core/review/change-assessment.ts +20 -28
  158. package/src/core/review/check-records.ts +4 -2
  159. package/src/core/review/control-delegation.ts +3 -11
  160. package/src/core/review/model-family.ts +1 -1
  161. package/src/core/review/module-review-prompt.ts +3 -4
  162. package/src/core/review/review-publish.ts +3 -5
  163. package/src/core/setup/cli-inventory.ts +3 -18
  164. package/src/core/setup/decode.ts +2 -12
  165. package/src/core/shell-quote.ts +4 -0
  166. package/src/core/skill-surface/catalog.ts +4 -8
  167. package/src/core/state/project-continuation-envelope.ts +2 -2
  168. package/src/core/state/project-effective-state.ts +3 -3
  169. package/src/core/terminal/herdr-core-pin.json +11 -11
  170. package/src/core/tools/catalog.ts +2 -10
  171. package/src/core/workflow/policy-schema.ts +163 -0
  172. package/src/core/worktree-location.d.mts +0 -1
  173. package/src/core/worktree-location.mjs +1 -1
  174. package/src/effects/admission/admission-store.ts +10 -11
  175. package/src/effects/admission/issue-goal.ts +3 -13
  176. package/src/effects/adoption/gitignore-plan.ts +67 -1
  177. package/src/effects/adoption/standard-plan.ts +32 -233
  178. package/src/effects/architecture/archcontext-owners.ts +1 -4
  179. package/src/effects/architecture/archcontext-resolve-cache.ts +2 -1
  180. package/src/effects/architecture/archctx-provider.ts +9 -6
  181. package/src/effects/architecture/architecture-read.ts +1 -4
  182. package/src/effects/architecture/capability-resolver.ts +18 -7
  183. package/src/effects/architecture/model-reader.ts +8 -7
  184. package/src/effects/artifact-retention.ts +16 -18
  185. package/src/effects/atomic-append.ts +43 -5
  186. package/src/effects/board/attention-watch.ts +45 -13
  187. package/src/effects/board/collect.ts +153 -58
  188. package/src/effects/board/dispatch.ts +2 -13
  189. package/src/effects/board/keyed-sources.ts +147 -0
  190. package/src/effects/board/pi-fleet-roles.ts +2 -2
  191. package/src/effects/board/pi-shell.ts +70 -0
  192. package/src/effects/board/review.ts +19 -24
  193. package/src/effects/board/seat-reset.ts +21 -5
  194. package/src/effects/board/seats-configuration.ts +1 -0
  195. package/src/effects/configuration/global-configuration.ts +2 -2
  196. package/src/effects/dev-activity/collector.ts +19 -27
  197. package/src/effects/evidence/attested-import.ts +1 -5
  198. package/src/effects/evidence/blob-store.ts +3 -33
  199. package/src/effects/evidence/checkpoint-store.ts +6 -9
  200. package/src/effects/evidence/eval-catalog.ts +4 -7
  201. package/src/effects/evidence/event-writer.ts +1 -5
  202. package/src/effects/evidence/verification-execution.ts +18 -20
  203. package/src/effects/fleet/provider-feedback.ts +3 -2
  204. package/src/effects/fleet/task-inbox-layout-migration.ts +16 -16
  205. package/src/effects/fleet/task-inbox-layout.ts +1 -8
  206. package/src/effects/fleet/task-inbox.ts +5 -32
  207. package/src/effects/fs-transaction.ts +3 -6
  208. package/src/effects/git/managed-worktree.ts +2 -10
  209. package/src/effects/git/repository-identity.ts +1 -5
  210. package/src/effects/git/runner.ts +14 -0
  211. package/src/effects/git/worktree-record.ts +3 -2
  212. package/src/effects/github/policy.ts +10 -8
  213. package/src/effects/locking/exclusive-directory-lock.ts +34 -15
  214. package/src/effects/locking/host-test-queue.ts +3 -11
  215. package/src/effects/locking/process-start-time.ts +58 -18
  216. package/src/effects/locking/runtime-transaction-lock.ts +5 -18
  217. package/src/effects/observation-loop.ts +194 -0
  218. package/src/effects/operator/architecture-map-collector.ts +40 -48
  219. package/src/effects/operator/architecture-map-worker.ts +13 -5
  220. package/src/effects/operator/board-observer-worker.ts +92 -0
  221. package/src/effects/operator/board-observer.ts +368 -28
  222. package/src/effects/operator/board-read.ts +6 -49
  223. package/src/effects/operator/bot-access.ts +17 -27
  224. package/src/effects/operator/docs-collector.ts +23 -36
  225. package/src/effects/operator/docs-reader.ts +3 -7
  226. package/src/effects/operator/execution-collector.ts +24 -42
  227. package/src/effects/operator/execution-state.ts +2 -2
  228. package/src/effects/operator/notify-collector.ts +18 -24
  229. package/src/effects/operator/runtime-source.ts +1 -4
  230. package/src/effects/operator/server.ts +35 -166
  231. package/src/effects/operator/slack-review-collector.ts +27 -33
  232. package/src/effects/operator/task-read-process.ts +1 -19
  233. package/src/effects/operator/tests-collector.ts +21 -38
  234. package/src/effects/operator/worktree-cleanup-archive.ts +11 -13
  235. package/src/effects/operator/worktree-cleanup-investigation.ts +3 -2
  236. package/src/effects/operator/worktree-cleanup-observation.ts +56 -9
  237. package/src/effects/operator/worktree-cleanup-plan.ts +5 -7
  238. package/src/effects/operator/worktree-cleanup-publish.ts +64 -2
  239. package/src/effects/operator/worktree-cleanup-removal.ts +2 -2
  240. package/src/effects/operator/worktree-cleanup-route.ts +4 -4
  241. package/src/effects/operator/worktree-cleanup-store.ts +3 -5
  242. package/src/effects/operator/worktree-cleanup.ts +2 -2
  243. package/src/effects/operator/worktree-collector.ts +21 -16
  244. package/src/effects/operator/write-run.ts +3 -3
  245. package/src/effects/path-containment.ts +11 -0
  246. package/src/effects/process-group-registry.ts +2 -11
  247. package/src/effects/process-group-termination.ts +3 -10
  248. package/src/effects/process-supervisor.ts +14 -12
  249. package/src/effects/publication/draft-pull-request.ts +3 -2
  250. package/src/effects/publication/feedback-store.ts +8 -37
  251. package/src/effects/publication/generated-artifacts.ts +1 -4
  252. package/src/effects/publication/merge-executor.ts +167 -399
  253. package/src/effects/publication/merge-readiness.ts +76 -59
  254. package/src/effects/repo-registry.ts +5 -51
  255. package/src/effects/review/acceptance-receipt.ts +17 -22
  256. package/src/effects/review/diff-fingerprint.ts +11 -24
  257. package/src/effects/review/generic-review.ts +1 -1
  258. package/src/effects/review/review-isolation.ts +2 -2
  259. package/src/effects/review/review-publish.ts +1 -4
  260. package/src/effects/review-runner/task-oar-host.ts +4 -3
  261. package/src/effects/review-runner/task-pre-prompt-inbox-consumer.ts +2 -2
  262. package/src/effects/runtime/helper-runner.ts +1 -1
  263. package/src/effects/runtime/protected-helper-platform.ts +1 -4
  264. package/src/effects/setup/cli-inventory.ts +25 -38
  265. package/src/effects/setup/collector.ts +30 -44
  266. package/src/effects/skill-tree-integrity.ts +2 -1
  267. package/src/effects/state/collect-state-inputs.ts +3 -7
  268. package/src/effects/state/coordination-worktree-topology.ts +14 -12
  269. package/src/effects/state/policy-file.ts +27 -0
  270. package/src/effects/state/pruned-worktree-intents.ts +3 -7
  271. package/src/effects/state/resolve-effective-state.ts +58 -88
  272. package/src/effects/state/worktree-trash.ts +4 -3
  273. package/src/effects/strategy/context.ts +2 -2
  274. package/src/effects/terminal/herdr-core.ts +30 -18
  275. package/src/effects/terminal/native-task-session.ts +2 -2
  276. package/src/effects/terminal/task-session-admission.ts +2 -2
  277. package/src/effects/terminal/task-session-record.ts +3 -2
  278. package/src/effects/terminal/task-session.ts +3 -6
  279. package/src/effects/upgrade/legacy-inventory.ts +20 -24
  280. package/src/effects/upgrade/operator-decisions.ts +2 -2
  281. package/src/pi/hook-bridge.ts +0 -2
  282. package/scripts/test-file-durations.json +0 -208
  283. package/src/cli/commands/doc-sessions-actions.ts +0 -89
  284. package/src/cli/commands/doc-sessions.ts +0 -36
  285. package/src/cli/tty-prompt.ts +0 -25
  286. package/src/core/board/summary.ts +0 -157
  287. package/src/core/operator/doc-citation.ts +0 -105
  288. package/src/core/operator/doc-session-agent-record.ts +0 -26
  289. package/src/core/operator/doc-session-changes.ts +0 -191
  290. package/src/core/operator/doc-session-events.ts +0 -197
  291. package/src/core/operator/doc-session-finalization-view.ts +0 -44
  292. package/src/core/operator/doc-session-finalize.ts +0 -42
  293. package/src/core/operator/doc-session-record.ts +0 -58
  294. package/src/core/operator/doc-session-views.ts +0 -99
  295. package/src/core/sessions/session-selector.ts +0 -5
  296. package/src/effects/board/merge-only-sync.ts +0 -116
  297. package/src/effects/operator/board-summary.ts +0 -50
  298. package/src/effects/operator/doc-session-changes.ts +0 -431
  299. package/src/effects/operator/doc-session-events.ts +0 -198
  300. package/src/effects/operator/doc-session-finalization-view.ts +0 -12
  301. package/src/effects/operator/doc-session-finalize-github.ts +0 -70
  302. package/src/effects/operator/doc-session-finalize-scope.ts +0 -40
  303. package/src/effects/operator/doc-session-finalize.ts +0 -400
  304. package/src/effects/operator/doc-session-views.ts +0 -131
  305. package/src/effects/operator/doc-session.ts +0 -277
  306. package/src/effects/operator/task-diff.ts +0 -23
  307. package/src/effects/publication/batch-build.ts +0 -478
  308. package/src/effects/review/docs-host-isolation.ts +0 -312
  309. package/src/effects/review/docs-host-proxy.ts +0 -162
  310. package/src/effects/sessions/admitted-source.ts +0 -22
  311. package/src/effects/state/canonical-target.ts +0 -36
  312. package/src/effects/upgrade/worktree-template-migration.ts +0 -141
package/README.md CHANGED
@@ -331,6 +331,6 @@ None of these are bundled dependencies; see
331
331
 
332
332
  ## Release & license
333
333
 
334
- - npm: `repo-harness@0.30.0` · workflow stamp `repo-harness@0.30.0+template@0.30.0`
334
+ - npm: `repo-harness@0.31.0` · workflow stamp `repo-harness@0.31.0+template@0.31.0`
335
335
  - History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
336
336
  - License: MIT — see [`LICENSE`](LICENSE)
@@ -5,7 +5,8 @@
5
5
  export const PROTOCOL_HEADERS = [
6
6
  'repo-harness issue claim', 'repo-harness issue claim status', 'repo-harness boundary question',
7
7
  'repo-harness scope change', 'repo-harness decision', 'repo-harness plan', 'repo-harness handoff',
8
- 'repo-harness acceptance claim', 'repo-harness acceptance record', 'repo-harness review reply',
8
+ 'repo-harness acceptance claim', 'repo-harness acceptance record',
9
+ 'repo-harness acceptance disposition', 'repo-harness review reply',
9
10
  'repo-harness unblocked', 'repo-harness integration status', 'repo-harness merge hold',
10
11
  'repo-harness merge hold released',
11
12
  ];
@@ -157,7 +157,7 @@ The board rule R5 reads only the rows with `path_visible: true`: a changed path
157
157
  | Reads, moves or exposes credentials, tokens or secrets. | `src/core/security/**` |
158
158
  | Changes a path that deletes files, worktrees, branches or seats. | `src/effects/board/closeout.ts`, `src/cli/installer/uninstall.ts`, `scripts/ship-worktrees.sh`, `scripts/worktree-merge-lib.sh` |
159
159
  | Changes release, publish or deploy, including `deploy/sql/`. | `deploy/sql/**`, `src/core/release/**`, `src/effects/release/**`, `scripts/check-npm-release.sh`, `scripts/check-release-published.sh` |
160
- | Changes a merge or push path: the publication executor, branch protection or force push. | `src/core/publication/acceptance-merge-policy.ts`, `src/core/publication/merge-readiness.ts`, `src/effects/publication/batch-build.ts`, `src/effects/publication/merge-executor.ts`, `src/effects/publication/merge-readiness.ts`, `src/effects/publication/new-remote-ref-push.ts`, `scripts/merge-gate.ts` |
160
+ | Changes a merge or push path: the publication executor, branch protection or force push. | `src/core/publication/acceptance-merge-policy.ts`, `src/core/publication/merge-readiness.ts`, `src/effects/publication/merge-executor.ts`, `src/effects/publication/merge-readiness.ts`, `src/effects/publication/new-remote-ref-push.ts`, `scripts/merge-gate.ts` |
161
161
  <!-- review-high-list:list:end -->
162
162
 
163
163
  Review follows the `repo-harness-issue-flow` skill, [references/acceptor.md](../../assets/skills/repo-harness-issue-flow/references/acceptor.md). The tier selects the depth: no independent review for Low, one fresh-context review from a model family different from the writer's for Medium, and the gatekeeper plus one review for High, at least one of the two from a model family different from the writer's. The round rules (who reviews each round, the claims of a round, the round-2 scope and the convergence rule) are only in [references/acceptor.md §2.2](../../assets/skills/repo-harness-issue-flow/references/acceptor.md#22-rounds). The Acceptor SOP owns the round, findings and publish steps.
@@ -173,7 +173,6 @@ Rules for every tier:
173
173
  - A low tier adds no review. A new test file or a rebase does not raise the tier.
174
174
  - Changing implementation and test assertions together does not raise the tier. Within the tier's existing review, check whether assertions preserve the intended behavior and whether removed or weakened coverage has a valid requirement-based reason. At Low, the author performs this check in self-review. Record the reason for each assertion change in the PR; never change assertions only to make a test pass. Do not dispatch a separate test-review gate.
175
175
  - A parent, coordinator or merge session reuses recorded acceptance when the reviewed diff, relevant base context, verification inputs and environment still match, and the review meets the current tier. The PR records the reviewed revision or diff, commands, results and finding dispositions. A change of session or reviewer is not a reason to repeat acceptance.
176
- - A batch integration PR (`repo-harness-issue-flow`, [references/orchestrator.md](../../assets/skills/repo-harness-issue-flow/references/orchestrator.md) §9.3) reuses the acceptance record of each member when every member merged without conflict and the batch adds no commit of its own. It needs no new review round. A Low member has no acceptance record to reuse. Required checks on the batch head still apply.
177
176
  - After a change, verify the affected behavior. The review scope of each round after a change is in [references/acceptor.md §2.2](../../assets/skills/repo-harness-issue-flow/references/acceptor.md#22-rounds). Retain valid evidence for unchanged scope; add only missing tier coverage. A rebase alone does not require a new full review, but changed base behavior or conflict resolution can invalidate affected evidence. Reuse never substitutes for required checks on the current head or the current-main merge requirement.
178
177
  - A downstream repository maps its own release surfaces, for example public API, wire format, DDL/SQL and permissions, to the High tier.
179
178
 
@@ -171,7 +171,9 @@ not limited to the two named above.
171
171
 
172
172
  ## Design-Brief Hand-off
173
173
 
174
- The chosen direction feeds the existing `design-brief.template.md` /
174
+ The chosen direction feeds the design-brief template (the repository's own
175
+ `.claude/templates/design-brief.template.md` when present, otherwise
176
+ `repo-harness docs path design-brief.template`) /
175
177
  frontend `task_profile` gate as its decided direction — this convention does
176
178
  not duplicate that checklist.
177
179
 
@@ -18,8 +18,8 @@ Create these only when the agent has concrete repo evidence or the user asks:
18
18
  - `docs/decisions.md`: accepted architecture decisions with trade-offs.
19
19
  - Mermaid fenced blocks in `docs/architecture/modules/**.md`: semantic diagram source for agents and review diffs.
20
20
  - `docs/packages.md`: package inventory for real multi-package repos.
21
- - `docs/prds/*.prd.md`: upper-layer PRDs generated through `repo-harness-product`'s PRD mode from `docs/prds/prd.template.md`.
22
- - `docs/prds/DESIGN-*.md`: optional design briefs generated from `.claude/templates/design-brief.template.md` when the task requests design work.
21
+ - `docs/prds/*.prd.md`: upper-layer PRDs generated through `repo-harness-product`'s PRD mode from the repository's own `docs/prds/prd.template.md` when present, otherwise from `repo-harness docs path prd.template`.
22
+ - `docs/prds/DESIGN-*.md`: optional design briefs generated from the repository's own `.claude/templates/design-brief.template.md` when present, otherwise from `repo-harness docs path design-brief.template`, when the task requests design work.
23
23
 
24
24
  ## Rules
25
25
 
@@ -140,8 +140,7 @@ repo-harness upgrade --registered --apply --expected-revision sha256:REPLACE_WIT
140
140
 
141
141
  A changed registry refuses the whole apply with exit 2. Apply checks each repo
142
142
  again just before its first write. It then runs the `init` refresh transaction,
143
- `upgrade --scope project --apply` (with `--migrate-worktree-template` only when
144
- given) and the managed worktree sweep. A failed repo does not stop or roll back
143
+ `upgrade --scope project --apply` and the managed worktree sweep. A failed repo does not stop or roll back
145
144
  the other repos. The `init` refresh updates the repo's registry row, so preview
146
145
  again before the next apply. The command never commits, pushes or opens a PR.
147
146
  `--json` prints one object with `revision`, `apply`, `exitCode` and `repos`.
@@ -761,9 +760,7 @@ head SHA, full binary diff fingerprint, installed helper fingerprint, and PR
761
760
  number. The seal has no receipt field. It never owns provider credentials or
762
761
  starts a reviewer.
763
762
 
764
- The exact target base commit enables the local gate in
765
- `.ai/harness/policy.json#merge_gate`; the candidate cannot disable that base
766
- requirement. Runtime setup installs no merge-gate skill, agent, or provider
763
+ Runtime setup installs no merge-gate skill, agent, or provider
767
764
  runtime. Caller `HOME`, helper-source, and runner environment overrides are ignored for
768
765
  the protected ship/gate helpers. The official runner pins Bash, Git, and Bun;
769
766
  where a fixed trusted host `gh` is present it pins that executable too, and it
@@ -1083,11 +1080,15 @@ for the checked commit. It fetches before its first render and again in its
1083
1080
  internal retry loop. A main move after the writer's check, before either fetch,
1084
1081
  can render one newer commit with the older writer. The rolling PR's CI does not
1085
1082
  compare renders. The Daily architecture freshness lane runs render equivalence
1086
- on main and fails when the published output differs from what current main
1087
- renders. A version mismatch that renders the same output is harmless. The next
1088
- main move renders again with the new writer. The upstream fix is
1089
- Ancienttwo/arch-context#504 (`--base-sha`). Stale projections then also fail the
1090
- daily architecture freshness check on main, which opens a CI repair issue. A
1083
+ on main. When the published output differs from what current main renders, the
1084
+ lane warns while the oldest unpublished main commit is younger than 3 h, and
1085
+ fails after that. The oldest unpublished commit is the first first-parent commit
1086
+ after the newest commit that changes the projection manifest, else that commit.
1087
+ A version mismatch that renders the same output is harmless. The next main move
1088
+ renders again with the new writer. The upstream fix is
1089
+ Ancienttwo/arch-context#504 (`--base-sha`). A projection that stays stale for
1090
+ 3 h then fails the daily architecture freshness check on main, which opens a CI
1091
+ repair issue. A
1091
1092
  local commit or a dirty file that blocks the fast-forward needs an operator
1092
1093
  repair. The installed package is not used for `follow`: releases lag main, and
1093
1094
  a long-running process does not reload a `repo-harness update`. The operator supplies
@@ -13,9 +13,8 @@ repo-harness run heartbeat-triage run --source scheduled
13
13
  ```
14
14
 
15
15
  The command appends a run section to `.ai/harness/triage/inbox.md` and writes a
16
- JSON snapshot under `.ai/harness/runs/`. Each run records:
17
-
18
- - `workflow-check`: `repo-harness run check-task-workflow`
16
+ JSON snapshot under `.ai/harness/runs/`. Each run records the run id, its
17
+ source, the snapshot path and the adoption review date.
19
18
 
20
19
  ## cron
21
20
 
@@ -27,9 +27,9 @@ This topology applies to issue-flow work (`repo-harness-issue-flow`) on herdr-co
27
27
  - Tab 1 holds two panes: the orchestrator on the left and its advisor on the right. Tab 1 may take one worker as its third pane.
28
28
  - The orchestrator holds the issue-flow coordinator and integrator seats. It only dispatches, accepts and merges. It does not implement a child issue.
29
29
  - The advisor serves only the orchestrator. It does research and writes proposals. It may edit files for its proposals. It does not commit or write to GitHub. It collects evidence through the sub-agents of its seat (`seats.advisor.fleet`) and keeps judgment, synthesis and the proposal. The orchestrator asks it for a board replan by [Replan](https://github.com/aimpact-inc/repo-harness/blob/main/assets/skills/repo-harness-issue-flow/references/replan.md).
30
- - Owner decisions and seat authority (owner, 2026-11-09, #2008): the root `CLAUDE.md` and `AGENTS.md` hold the life-cycle rules and the owner list. The orchestrator dispatches an owner-approved batch plan in order, merges by rule 2 at every tier and runs fix rounds up to round 5 by rule 1. A seat that receives an owner decision in its pane posts it on the issue or PR; that comment authorizes the other seats. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. The orchestrator and the advisor make a non-security decision together when both agree, and the orchestrator posts it first as `Joint decision (orchestrator + advisor)` with the reason. The advisor makes no GitHub write. A "stop" or "no" comment from any participant, the owner account included, is a reference that the orchestrator and the advisor weigh by joint decision.
30
+ - Owner decisions and seat authority (owner, 2026-11-09, #2008): the root `CLAUDE.md` and `AGENTS.md` hold the life-cycle rules and the owner list. The orchestrator dispatches an owner-approved batch plan in order, merges by rule 2 at every tier and runs fix rounds up to round 5 by rule 1. A seat that receives an owner decision in its pane posts it on the issue or PR; that comment authorizes the other seats. A seat message carries pointers, not content: it names the issue, the PR, the comment URL or the sha, and the content lives in GitHub. The message still wakes the receiving seat; it does not replace the record. The advisor sends the orchestrator only a mismatch between a seat report and the GitHub state, not a confirmation. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. The orchestrator and the advisor make a non-security decision together when both agree, and the orchestrator posts it first as `Joint decision (orchestrator + advisor)` with the reason. The advisor makes no GitHub write. A "stop" or "no" comment from any participant, the owner account included, is a reference that the orchestrator and the advisor weigh by joint decision.
31
31
  - One PR has one pane and one worker agent. Each further worker gets its own pane, as the right split of a tab that is not full or in a new tab. The worker may use the agent-fleet sub-agents (`agents/fleet/`) inside its own pane.
32
- - Recommended models for a Claude-only setup: the orchestrator runs Opus at high effort, and the advisor runs Opus at max effort. This is a recommendation, not a requirement. No seat requires a specific model (issue-flow D7).
32
+ - Recommended models for a Claude-only setup: the orchestrator runs Opus at high effort, and the advisor runs Fable at high effort. This is a recommendation, not a requirement. No seat requires a specific model (issue-flow D7).
33
33
  - Cleanup: after a PR merges, the orchestrator runs `repo-harness board closeout --pr <n>` in the primary checkout. It first proves the merge and the worktree: merge commit in the fetched `origin/main`, PR head worktree at the PR head sha, not locked, clean, and no owner marker but its own. A missing proof stops before any pane closes. It then closes each seat terminal bound to the PR (its `pr` label, or the `issue` label of a closing issue in this repository, or a cwd in the PR head worktree on the PR head branch when the seat has an `issue` label that the PR body names after `Refs`; a cwd in the primary checkout never binds; a binding without the PR's `pr` label next to another PR's `pr` label is a conflict) whose checkout belongs to this repository, is clean and has no commit outside `origin/<branch>`. When every bound pane is closed and no process runs in the worktree, it removes the worktree and the local branch through the exact closeout path of `contract-worktree cleanup`, which drops only the worktree's own active-worktree marker. A dirty, unpushed, conflicting, locked, other-owner or unmerged pane or worktree stays; the JSON names the reason, and the board rule A9 reports each live seat of a merged PR. The remote branch is left to GitHub.
34
34
  - Before a worker reports DONE, it stops the background programs it started (a dev server, a daemon started with `nohup` or `setsid`). On Linux and macOS, herdr-core 0.1.19 keeps a deliberately detached program running after its terminal closes, and Windows ends it.
35
35
 
@@ -52,6 +52,8 @@ Commands for the topology steps:
52
52
  | Wait for a worker | `hc wait <t>` |
53
53
  | Close a worker pane | `herdr-app do pane.close --pane <pane>` |
54
54
 
55
+ The board of a parent selects a worker, gatekeeper or reviewer seat by its `issue` label (an item of the parent) or its `pr` label (a pull request of the board). `--parent` is optional for that. It names the worker tab `#<n>` (`other` without it), so the worker rows keep it.
56
+
55
57
  A Codex worker seat in a linked contract worktree edits files and runs checks only. It runs no `git fetch`, `git commit` or `git push`. Its last message gives the commit subject and body, the PR title and body, and the check results. The orchestrator commits the worktree diff with that message and explicit paths only, pushes the branch and opens the PR. The orchestrator is the head owner of record and pushes each fix round; no other agent pushes to that PR. The Codex seat remains the content author and answers review threads through the orchestrator. A seat with the `net` tool group can use the network. A writable Codex seat with `net` can reach loopback services, including the Operator console and herdr-core socket (#1961).
56
58
 
57
59
  `repo-harness seats argv <seat>` prints the argv of the seat from the `seats` section of `~/.repo-harness/config.json`, or from the seat defaults when the section is absent. The argv holds the model, the effort, the tool limits and the seat brief. Its stderr names the source and each limit. A limit marked `instructions_only` is written into the launch instructions only; the host does not enforce it. Without `--argv`, the pane opens a shell.
@@ -66,15 +68,18 @@ Before each dispatch wave, run `repo-harness quota`. Launch each task with `repo
66
68
  | `worker-important-fast` | Claude, `sonnet`, medium |
67
69
  | `worker-light` | Pi, `magpie/cursor/deepseek-v41-flash-1017`, no effort and no account; worker tool groups; no fleet. A Pi seat on `magpie/codex/<model>` ("pi-gpt") is a user-selected alternative to a Codex seat: it runs the same GPT models, takes an effort (`--thinking`) and counts against the `chatgpt` account |
68
70
  | `gatekeeper` | Codex, `gpt-6.1-terra`, high; read, shell and network |
71
+ | `gatekeeper-fallback` | `null` (not configured); when configured, the gatekeeper ranges: read, shell and network, no fleet |
69
72
  | `reviewer` | Claude, `opus`, high; read, shell and network |
70
73
 
71
74
  All worker seats use worker briefs, labels and pane names. `gatekeeper` and `reviewer` need `--pr <n>`; their pane names are `<prefix>-gk-<pr>` and `<prefix>-rv-<pr>`. They report a read-only verdict first and do not edit, commit, push or write to GitHub.
72
75
 
76
+ `gatekeeper-fallback` is optional and is no launch target: `seats argv gatekeeper-fallback` returns `seat_unknown`. While the gatekeeper account is exhausted and the fallback account is not, the route line names the fallback, for example `gatekeeper: gatekeeper-fallback (pi magpie/cursor/deepseek-v41-flash-1017; gatekeeper: chatgpt exhausted)`, and `seats argv gatekeeper --pr <n>` prints the fallback argv with the gatekeeper label, pane name and brief. A tight, unknown or reserved gatekeeper keeps its own rule; with no usable fallback the line stays `gatekeeper: none (...)`. `repo-harness board review` starts a gatekeeper only when this effective gatekeeper has a known model family, and not `anthropic` when the head needs a non-Claude gatekeeper. Its family must differ from the writer's only where it gives the different-family row: a Medium head, or a High head that needs no Claude review. A High head with a Claude review may use a gatekeeper of the writer's family; else it skips the PR with `review_family_unavailable` and the route line. A stored section without the key needs `repo-harness update`, which sets it to `null`.
77
+
73
78
  On Pi, review seats pass `--exclude-tools edit,write`. Direct edit/write tools are off. The edit limit is `common_commands` because the shell stays available; shell writes remain prohibited by the brief. Codex review seats use the read-only sandbox.
74
79
 
75
80
  `seats.routing` holds ordered lists for `important_deep`, `important_fast`, `simple_deep`, `simple_fast` and `frontend`. Lists are non-empty and distinct. The first four accept configured worker seats only; a list cannot name a null seat. `frontend` accepts only `worker-important` and `worker-important-fast`, and both must run Claude when selected in that list. Defaults are `[worker-important, worker-deep]`, `[worker-important-fast, worker]`, `[worker-deep, worker-important]`, `[worker]` and `[worker-important, worker-important-fast]`, in that order. `worker-light` defaults to the Pi seat above. A stored `null` stays null during migration; its argv returns `seat_not_configured`. Each configured seat must use an enabled runtime when saved. The default Pi seat prevents a Seats page save until Pi is enabled or `worker-light` is set to `null`.
76
81
 
77
- Routing selects the first eligible seat with a known account state, or a Pi seat without an account (the DeepSeek `worker-light`). A Pi seat on `magpie/codex/` has the `chatgpt` account. It selects an unknown account only when no such seat is eligible. Exhausted accounts are excluded. Claude in saving mode or exhausted stays reserved for the advisor and orchestrator. Important non-frontend work then uses a configured Pi `worker-light`; a null or non-Pi seat gives a `none` route. Frontend waits for Claude. `tight` is a display state only. When Claude is reserved, the explorer line uses `routing.low_quota_explorer` (default `haiku` high). Pass its model when you call the explorer. Otherwise the line says `default`.
82
+ Routing selects the first eligible seat with a known account state, or a Pi seat without an account (the DeepSeek `worker-light`). A Pi seat on `magpie/codex/` has the `chatgpt` account. It selects an unknown account only when no such seat is eligible. Exhausted accounts are excluded; only the explicit `--spend-credits` of `repo-harness quota` and `repo-harness seats argv` admits a ChatGPT account that still has credits, and only while an owner authorization for credits is recorded. Claude in saving mode or exhausted stays reserved for the advisor and orchestrator. Important non-frontend work then uses a configured Pi `worker-light`; a null or non-Pi seat gives a `none` route. Frontend waits for Claude. `tight` is a display state only. When Claude is reserved, the explorer line uses `routing.low_quota_explorer` (default `haiku` high). Pass its model when you call the explorer. Otherwise the line says `default`.
78
83
 
79
84
  `routing.claude_saving_below_remaining` defaults to 20. Claude saving mode applies when weekly remaining quota is below that percent; otherwise its mode is normal. `routing.codex_hyper_at_or_above_remaining` defaults to 50. Codex hyper mode applies when weekly remaining quota is at or above that percent; otherwise its mode is normal. A missing weekly reading gives an unknown mode. Modes are derived, never stored. Codex hyper uses the code constant `gpt-6-astra` high for Codex seats. Reserved Claude advisor and orchestrator seats use `opus` high. There is no Codex advisor fallback. A Pi seat on `magpie/codex/` gets the Codex hyper model as `magpie/codex/gpt-6-astra` with the hyper effort. Other Pi seats, tools, fleet and class lists stay as configured. An absent seats section uses defaults. Run `repo-harness update` for the one-shot migration of stored sections. The decoder refuses old keys before and after migration; a POST writes the full section.
80
85
 
@@ -132,10 +137,10 @@ A new pane goes into the first tab of its kind with fewer than 3 panes. When eve
132
137
 
133
138
  ### Test and Review Rules
134
139
 
135
- - The merge gate is typecheck plus affected tests. Run `bash scripts/check-ci.sh affected --base origin/main` locally.
136
- - Run the full suite for dependency manifests, shared test/runtime foundations, releases, the daily run, or a named integration invariant that focused checks cannot cover.
137
- - When full coverage is required, run `bun run test:full` once on the final rebased head.
138
- - `test:core` excludes the slow integration files. `test:integration` runs those files. `test:full` runs their complete union.
140
+ - A writer runs `bun run check:type`, `bun run check:helpers` and at most 3 test files that own the change. `Required / CI` on the head is the affected-gate evidence.
141
+ - `bash scripts/check-ci.sh <lane>` on the host only reproduces a CI failure.
142
+ - A reviewer runs no test that CI passed.
143
+ - The full suite runs in the daily run and for a release.
139
144
  - Test commands take the host test queue themselves: `bash scripts/check-ci.sh <lane>`, `bun run test:files` and the `test:*` suites wait their turn, run alone and release. Release checks go first, then FIFO. Do not wait for a coordinator message to start them. `bun scripts/host-test-queue.ts status` shows the holder and the waiters.
140
145
  - Full runs use eight isolated file workers. Run files with shared ports or shared HOME writes in the serial tail.
141
146
  - Tests with port 0 and an isolated HOME can run in parallel.
@@ -129,8 +129,7 @@ spawn an LLM or a long-running worker.
129
129
 
130
130
  ## Host and Adoption Operations
131
131
 
132
- `repo-harness init` writes the workflow contract and package helper guidance
133
- in `.ai/hooks/README.md`. It does not install user-level adapters;
132
+ `repo-harness init` writes the workflow contract. It does not install user-level adapters;
134
133
  `repo-harness install` and `repo-harness update` own them.
135
134
  It does not copy the operator library into consumer repositories.
136
135
  It removes retired generated hook entry scripts by exact manifest ownership and
@@ -316,7 +315,6 @@ or `repair`). The error names the one-shot cleanup. Run
316
315
  Hooks do not record architecture drift. They keep no queue and no drift cursor,
317
316
  and they run no projection or LLM work. Architecture updates are explicit:
318
317
 
319
- - `repo-harness run workstream-sync` maintains durable capability workstreams.
320
318
  - Agents read architecture documents on demand, fix debt, and update the model and human prose. The archctx rolling writer publishes generated regions and the manifest.
321
319
 
322
320
  `repo-harness state resolve --json` reports `capability_ownership`. It is a
@@ -393,8 +391,8 @@ Git-ignored` line and one human `systemMessage`. This line takes the place of
393
391
  the notice text, because no marker can deduplicate that text. Claude Stop and
394
392
  Codex UserPromptSubmit keep only the stderr diagnostic of a failed marker write.
395
393
  Without a marker, the line would repeat at each turn, and each Claude Stop line
396
- starts one more turn. Add `.ai/harness/state/` to `.gitignore`; the
397
- `repo-harness init` ignore block has it.
394
+ starts one more turn. Run `repo-harness update`; it writes the runtime-state
395
+ block to the user-level Git excludes file.
398
396
 
399
397
  | Point | Hosts | When |
400
398
  | --- | --- | --- |
@@ -484,7 +482,8 @@ After handler or workflow-contract changes, run:
484
482
 
485
483
  ```bash
486
484
  bun test
487
- repo-harness run check-task-sync
488
- repo-harness run check-task-workflow
489
- repo-harness init --repo . --dry-run
485
+ bash scripts/check-ci.sh governance
490
486
  ```
487
+
488
+ That lane also runs the state boundary check, the helper projection check and
489
+ `repo-harness init --repo . --dry-run` (`scripts/check-ci.sh#governance`).
@@ -18,24 +18,24 @@ The grades describe repository boundaries. The delegation rows use evidence from
18
18
 
19
19
  | Requirement | Level | Current boundary and evidence | Source of truth |
20
20
  |---|---|---|---|
21
- | Assign a single writer per directory; never give concurrent agents overlapping write ownership. | **G** | The root agent instructions ask for one worktree per parallel writer (`CLAUDE.md:17`, `AGENTS.md:17`). No hook renders this rule, and no code acquires a directory-wide edit lease. | Root agent instructions; the active task's allowed paths and ownership brief. |
22
- | Run parallel writers only in separate worktrees from a clean source. Never silently drop isolation when worktree creation fails. | **G** | This is the upstream host requirement. The inspected start helper creates a Git worktree and rejects residual state with `--fresh`, but has no source-clean check in its start path (`scripts/contract-worktree.sh:523`, `scripts/contract-worktree.sh:556`, `scripts/contract-worktree.sh:588`). Do not describe the complete requirement as enforced. | Active contract's worktree boundary; `docs/researches/20260930-pi-harness-packages-extraction.md`, section 6.4. |
23
- | Refuse reuse when the caller requests a fresh contract worktree. | **E** | `--fresh` refuses an already-linked tree and existing metadata, path, worktree, or branch; it is an explicit option, not the default (`scripts/contract-worktree.sh:533`, `scripts/contract-worktree.sh:556`). | `contract-worktree start --fresh`. |
24
- | Child agents default to fresh task context and do not spawn further children. | **G** | The Codex install guidance asks for `fork_turns="none"` (`docs/reference-configs/install-profiles.md:417`). No hook or policy key sets spawn depth or validates the child's inherited transcript. `SubagentStart` records the native role observation and refuses no spawn (`src/cli/hook/subagent-context.ts:428`). | Host-native spawn configuration. |
25
- | Accept the exact subject with its evidence, rather than treating exit code zero as acceptance. | **E** | Acceptance parsing refuses stale subject/contract evidence before checking command success; `verify-sprint` invokes receipt verification and fails that gate when verification fails (`scripts/acceptance-receipt.ts:415`, `scripts/acceptance-receipt.ts:434`, `scripts/verify-sprint.sh:1211`). Scope: the receipt-backed completion gate. | Acceptance Policy in the active contract; the `repo-harness-issue-flow` skill (`references/acceptor.md`); AcceptanceReceipt and prepared verification evidence. |
26
- | After an interrupted managed push/PR/merge, recover explicitly with `recover reconcile`; never automatically replay the external effect. | **E** | Managed finish/ship refuse unfinished closeout re-entry. Reconcile requires an already-landed merge/push and completes missing phases without merging/pushing again (`scripts/contract-worktree.sh:1028`, `scripts/contract-worktree.sh:1426`, `scripts/ship-worktrees.sh:611`, `scripts/ship-worktrees.sh:1539`). Normal first execution may perform the effect; before it lands, recovery uses `abort`. | `long-run-continuation.md`, Crash Recovery; the worktree-scoped closeout journal. |
21
+ | Assign a single writer per directory; never give concurrent agents overlapping write ownership. | **G** | The root agent instructions give each task its own worktree at `/tmp/<repo>-wt-<slug>` and forbid one beside the main checkout (`CLAUDE.md#worktrees`, `AGENTS.md#worktrees`). No hook renders a single-writer rule, and no code acquires a directory-wide edit lease. | Root agent instructions; the active task's allowed paths and ownership brief. |
22
+ | Run parallel writers only in separate worktrees from a clean source. Never silently drop isolation when worktree creation fails. | **G** | This is the upstream host requirement. The inspected start helper creates a Git worktree and rejects residual state with `--fresh`, but has no source-clean check in its start path (`scripts/contract-worktree.sh#start_worktree`). Do not describe the complete requirement as enforced. | Active contract's worktree boundary; `docs/researches/20260930-pi-harness-packages-extraction.md`, section 6.4. |
23
+ | Refuse reuse when the caller requests a fresh contract worktree. | **E** | `--fresh` refuses an already-linked tree and existing metadata, path, worktree, or branch; it is an explicit option, not the default (`scripts/contract-worktree.sh#require_fresh`). | `contract-worktree start --fresh`. |
24
+ | Child agents default to fresh task context and do not spawn further children. | **G** | The Codex install guidance asks for `fork_turns="none"` (`docs/reference-configs/install-profiles.md#fork_turns`). No hook or policy key sets spawn depth or validates the child's inherited transcript. `SubagentStart` records the native role observation and refuses no spawn (`src/cli/hook/subagent-context.ts#persistNativeRoleRoutingEvidence`). | Host-native spawn configuration. |
25
+ | Accept the exact subject with its evidence, rather than treating exit code zero as acceptance. | **E** | Acceptance parsing refuses stale subject and contract evidence on its own: `validateAcceptanceReceiptAgainstPolicy` refuses a stale repository root, campaign, admission or goal, and `inspectAcceptanceCurrentBinding` refuses a stale semantic subject, verification evidence or observation (`src/effects/review/acceptance-receipt.ts#validateAcceptanceReceiptAgainstPolicy`, `src/effects/review/acceptance-receipt.ts#inspectAcceptanceCurrentBinding`). Scope: the receipt-backed completion gate. | Acceptance Policy in the active contract; the `repo-harness-issue-flow` skill (`references/acceptor.md`); AcceptanceReceipt and prepared verification evidence. |
26
+ | After an interrupted managed push/PR/merge, recover explicitly with `recover reconcile`; never automatically replay the external effect. | **E** | Managed ship refuses unfinished closeout re-entry (`scripts/ship-worktrees.sh#closeout_journal_guard_reentry`). Reconcile requires an already-landed push and completes the missing phases without pushing again (`scripts/ship-worktrees.sh#recover_ship`). Normal first execution may perform the effect; before it lands, recovery uses `abort`. | `long-run-continuation.md`, Crash Recovery; the worktree-scoped closeout journal. |
27
27
  | Apply the same explicit-recovery discipline to external effects outside managed closeout. | **G** | The inspected closeout helpers do not intercept arbitrary host shell commands. A host must not replace the managed recovery protocol with its own retry loop. | `long-run-continuation.md`, Crash Recovery; the operation's authorization. |
28
28
  | Missing metadata means unknown; absence alone never authorizes destructive cleanup. | **G** | This is a host-wide rule, not a universal metadata gate (`docs/researches/20260930-pi-harness-packages-extraction.md`, section 6.4). Resolve authoritative Git/store state and ownership before cleanup. | Host guidance; the operation's cleanup/recovery authority. |
29
- | Refuse managed worktree cleanup when merge proof or readable, clean, unlocked worktree state is unavailable. | **E** | Cleanup requires merge proof and refuses unreadable status, a locked worktree, or dirty content. Runtime metadata absence does not replace these checks (`scripts/contract-worktree.sh:2365`, `scripts/contract-worktree.sh:2383`, `scripts/contract-worktree.sh:2394`). Scope: real cleanup, not a dry-run preview. | `contract-worktree cleanup`; Git topology, merge proof, and worktree status. |
30
- | Enforce MCP write authorization/admission independently of tool exposure. | **E** | Coding/engineer startup requires an enabled profile, explicit read-write grant, and current authorization revision; fleet mutations additionally check the target and return a revision fence (`src/cli/mcp/server.ts:187-197`, `src/cli/mcp/fleet-tools.ts:280`). Workflow-artifact writes separately use their policy path guard (`src/cli/mcp/tools.ts:656`). These are distinct write paths, not one universal grant. | MCP policy and registered-repository authorization; each owner handler. |
29
+ | Refuse managed worktree cleanup when merge proof or readable, clean, unlocked worktree state is unavailable. | **E** | Cleanup requires merge proof and refuses unreadable status, a locked worktree, or dirty content. Runtime metadata absence does not replace these checks (`scripts/contract-worktree.sh#cleanup_worktree`). Scope: real cleanup, not a dry-run preview. | `contract-worktree cleanup`; Git topology, merge proof, and worktree status. |
30
+ | Enforce MCP write authorization/admission independently of tool exposure. | **E** | MCP startup resolves one profile with its own read and write globs (`src/cli/mcp/policy.ts#getMcpPolicy`, `src/cli/mcp/server.ts#createMcpToolContext`). A repository mutation refuses a `read_only` registry entry (`src/cli/mcp/general-repo-access/authority.ts#assertRepoWriteEnabled`), and a fleet tool refuses a target outside the adopted registry (`src/cli/mcp/fleet-tools.ts#targetFromArgs`). Workflow-artifact writes separately use their policy path guard (`src/cli/mcp/tools.ts#writeMarkdownArtifact`). These are distinct write paths, not one universal grant. | MCP policy and registered-repository authorization; each owner handler. |
31
31
  | Keep MCP writes bounded, inspect each result, and retain operation evidence even when an enclosing script fails. | **G** | No inspected exposure setting or audit helper enforces this complete requirement. The audit is best-effort; the narrower write protections and durable-record example below are **E** only within their own paths. | MCP usage guidance below; each tool's structured result and canonical store. |
32
32
 
33
33
  ## Host Landing
34
34
 
35
35
  | Host | Native execution and repo-harness landing | Enforcement boundary |
36
36
  |---|---|---|
37
- | Claude Code | Use the host's native subagent surface. The shared route registry attaches `PreToolUse` edit and subagent routes; the `Task`/`Agent` handler appends a return contract to the prompt (`src/cli/hook/route-registry.ts:76`, `src/cli/hook/route-registry.ts:84`, `src/cli/hook/return-channel.ts:36`). | **E** for installed typed-hook behavior and invoked CLI/MCP gates only. Appended instructions do not make writer ownership, fresh context, or spawn depth mechanically enforced. The Codex-only `SubagentStart.context` route does not run here. |
38
- | Codex | Use native `spawn_agent` with the installed role and a self-contained task packet. The registry selects the Codex-only `SubagentStart.context` route; the handler emits the child scope context (`src/cli/hook/route-registry.ts:100`, `src/cli/hook/subagent-context.ts:428`). | **E** for the installed route's handling. SubagentStart records the native role observation and refuses no spawn. Fresh-context and depth requirements remain **G**; scope text is guidance, not a filesystem lock. |
37
+ | Claude Code | Use the host's native subagent surface. The shared route registry attaches `PreToolUse` edit and subagent routes; the `Task`/`Agent` handler appends a return contract to the prompt (`src/cli/hook/route-registry.ts#ROUTES`, `src/cli/hook/return-channel.ts#runReturnChannel`). | **E** for installed typed-hook behavior and invoked CLI/MCP gates only. Appended instructions do not make writer ownership, fresh context, or spawn depth mechanically enforced. The Codex-only `SubagentStart.context` route does not run here. |
38
+ | Codex | Use native `spawn_agent` with the installed role and a self-contained task packet. The registry selects the Codex-only `SubagentStart.context` route; the handler emits the child scope context (`src/cli/hook/route-registry.ts#ROUTES`, `src/cli/hook/subagent-context.ts#runSubagentContext`). | **E** for the installed route's handling. SubagentStart records the native role observation and refuses no spawn. Fresh-context and depth requirements remain **G**; scope text is guidance, not a filesystem lock. |
39
39
  | Pi | Load `src/pi/extension.ts` through the package's `pi.extensions` entry. Map native edit, write and bash calls, including codemode nested calls, to the typed guards. Pi has no built-in subagent route. | **E** within the extension's `tool_call` path. A failed capability probe blocks these tools in an opted-in repository. Other write paths remain outside this boundary. |
40
40
 
41
41
  Install and trust the user-level hook adapters before relying on their routes. Read the active contract for scope; use the receipt-backed gate for acceptance and the journal-backed helper for closeout. Native process/session state is an observation, not permission to change workflow authority.
@@ -62,17 +62,17 @@ If using Pi MCP, keep ordinary discovery in `codemode` and set `hidden` only for
62
62
 
63
63
  Write safety has three parts:
64
64
 
65
- 1. **Usage constraint (G).** Do not batch writes inside codemode scripts. Dispatch a bounded mutation, inspect its result and authoritative state, then decide the next action. A failed outer script does not undo completed effects. Inspect `isError` and `structuredContent.error` where provided: Pi resolves MCP error results rather than rejecting them (`docs/researches/20260930-pi-codemode-lazy-loading.md:15`). Workflow-tool errors also require inspecting their error payload: `tools.ts` does not set `isError` in its `errorResult` (`src/cli/mcp/tools.ts:120`).
65
+ 1. **Usage constraint (G).** Do not batch writes inside codemode scripts. Dispatch a bounded mutation, inspect its result and authoritative state, then decide the next action. A failed outer script does not undo completed effects. Inspect `isError` and `structuredContent.error` where provided: Pi resolves MCP error results rather than rejecting them (`docs/researches/20260930-pi-codemode-lazy-loading.md#isError`). Workflow-tool errors also require inspecting their error payload: `errorResult` does not set `isError` (`src/cli/mcp/tools.ts#errorResult`).
66
66
  2. **Server authorization and admission (E, path-specific).** Retain profile, repository/path authorization, revision preconditions, and owner fences. Do not derive authorization from discovery, exposure, or `readOnlyHint`. A hidden tool in one host is not a revoked server-side grant.
67
- 3. **Audit and evidence (G for complete coverage).** Request and retain each operation's canonical evidence. MCP audit writes go to `.ai/harness/mcp/audit.log`, but `tryWriteMcpAuditEntry` returns `false` on storage failure and callers ignore it (`src/cli/mcp/audit.ts:11`, `src/cli/mcp/audit.ts:25`, `src/cli/mcp/tools.ts:124`). A successful mutation can therefore lack an audit entry. Host nested-call records do not upgrade this server-side behavior.
67
+ 3. **Audit and evidence (G for complete coverage).** Request and retain each operation's canonical evidence. MCP audit writes go to `.ai/harness/mcp/audit.log`, but `tryWriteMcpAuditEntry` returns `false` on storage failure and its callers ignore the result (`src/core/public-projections/mcp-audit-log.ts#MCP_AUDIT_LOG_RELATIVE_PATH`, `src/cli/mcp/audit.ts#tryWriteMcpAuditEntry`, `src/cli/mcp/tools.ts#audit`). A successful mutation can therefore lack an audit entry. Host nested-call records do not upgrade this server-side behavior.
68
68
 
69
69
  ### Inspected Write Paths
70
70
 
71
71
  | Path | Level and actual protection | Evidence limit |
72
72
  |---|---|---|
73
- | Workflow artifacts: `writeMarkdownArtifact` → `guardedWriteFile` → audit → result | **E**: policy path guard, target-type/revision refusal, exclusive per-file lock, file fsync and rename (`src/cli/mcp/tools.ts:656`, `src/cli/mcp/guarded-write.ts:103`, `src/cli/mcp/guarded-write.ts:133`, `src/cli/mcp/guarded-write.ts:163`, `src/cli/mcp/guarded-write.ts:209`). | The returned hash describes the artifact; it is not a persisted audit receipt. Audit happens after commit and its failure does not block success (`src/cli/mcp/tools.ts:666`). Directory fsync is best-effort. No fail-closed audit-evidence path was found here. |
74
- | General repository mutations: `write_file` and shared dispatch | **E**: read-write admission, path locks and revision/absence conditions in the inspected file-write path (`src/cli/mcp/general-repo-access.ts:2042`). | Shared dispatch audits after the operation; audit and metric/trace appends swallow storage failure (`src/cli/mcp/general-repo-access.ts:221`, `src/cli/mcp/general-repo-access.ts:444`, `src/cli/mcp/general-repo-access.ts:2893`). No universal evidence-before-mutation gate was found. |
75
- | Fleet and Engineer adapters | **E** for the inspected fleet authorization checks; no complete-audit grade. | The adapters call the same best-effort audit helper (`src/cli/mcp/fleet-tools.ts:144`, `src/cli/mcp/engineer-tools.ts:423`). Domain records are separate from audit; their existence must be verified in their owner path. |
73
+ | Workflow artifacts: `writeMarkdownArtifact` → `guardedWriteFile` → audit → result | **E**: policy path guard, target-type/revision refusal, exclusive per-file lock, file fsync and rename (`src/cli/mcp/tools.ts#writeMarkdownArtifact`, `src/cli/mcp/guarded-write.ts#guardedWriteFileUnderLock`). | The returned hash describes the artifact; it is not a persisted audit receipt. Audit happens after the write and its failure does not block success (`src/cli/mcp/tools.ts#audit`). Directory fsync is best-effort. No fail-closed audit-evidence path was found here. |
74
+ | General repository mutations: `write_file` and shared dispatch | **E**: read-write admission, path locks and revision/absence conditions in the inspected file-write path (`src/cli/mcp/general-repo-access.ts#writeFileTool`, `src/cli/mcp/general-repo-access.ts#withMutationLocks`, `src/cli/mcp/general-repo-access.ts#readExpectedExistingWriteTarget`, `src/cli/mcp/general-repo-access.ts#assertWriteTargetAbsent`). | Shared dispatch audits after the operation; audit and metric/trace appends swallow storage failure (`src/cli/mcp/general-repo-access.ts#audit`, `src/cli/mcp/general-repo-access.ts#tryAppendJsonLine`). No universal evidence-before-mutation gate was found. |
75
+ | Fleet adapter | **E** for the inspected fleet authorization checks; no complete-audit grade. | The adapter calls the same best-effort audit helper (`src/cli/mcp/fleet-tools.ts#audit`). Domain records are separate from audit; their existence must be verified in their owner path. |
76
76
 
77
77
  The inspected paths do not establish equivalent semantics for every MCP write. Keep artifact persistence, operation evidence, diagnostic audit, and semantic acceptance distinct. If required evidence is unavailable, stop and report the gap rather than infer acceptance from a returned status.
78
78
 
@@ -11,12 +11,9 @@ that used it (#692, #695):
11
11
 
12
12
  ## Policy Status
13
13
 
14
- The only key of the block is `mode`. Policy validation accepts `off` and
15
- `advice`. Any other value, such as the retired `enforce`, fails policy
16
- validation. State resolution then fails until the operator sets `advice` or
17
- `off`. Stop never blocks on a minimal-change finding. This repository sets
18
- `mode: "advice"`. `repo-harness init` writes `{ "mode": "advice" }`. No code
19
- reads the value after validation.
14
+ No code reads or validates `minimal_change`. The key is outside the policy
15
+ schema, so `repo-harness init` removes it and names it in the
16
+ `unknown-policy-keys` warning. Stop never blocks on a minimal-change finding.
20
17
 
21
18
  `.ai/harness/checks/minimal-change.latest.json` and
22
19
  `.ai/harness/checks/minimal-change-audit.latest.json` have no writer and no
@@ -58,9 +58,14 @@ that an earlier step of the same job ran. The run has six jobs:
58
58
  3. `publish` (`release` environment, `contents: read` and `id-token: write`):
59
59
  no checkout. It downloads the tarballs. Inline steps check that each
60
60
  tarball holds the package name and version and that npm does not have the
61
- version. `npm publish <tarball> --provenance --ignore-scripts` publishes
62
- `repo-harness-operator-web`, waits until npm shows it, then publishes
63
- `repo-harness`. No package script runs.
61
+ version. One step then loops over `repo-harness-operator-web` and
62
+ `repo-harness`. For each package it runs the same
63
+ `npm publish <tarball> --provenance --ignore-scripts`, and then the same
64
+ wait: 30 polls of `npm view <name>@<version> version`, 10 s apart, so
65
+ 5 minutes. npm must show the web package before the core publish starts,
66
+ and the core wait ends before the read-back. When npm does not show a
67
+ package after 5 minutes, the step fails and `published` does not run. No
68
+ package script runs.
64
69
  4. `published` (`contents: read`): checks out the SHA, runs `bun install` and
65
70
  `check published <version>`.
66
71
  5. `tag` (`contents: write`): no checkout. Inline git fetches the SHA and awk
@@ -91,10 +96,11 @@ PR merges, so that the two commits are the same or close.
91
96
 
92
97
  ### Partial publish recovery
93
98
 
94
- When the run stops after a publish, a rerun refuses. The owner completes the
95
- release by hand from the release commit. Read the state of each step before
96
- the step, and do only the steps that are not done. Stop at the first failure
97
- and report it.
99
+ When the run stops after a publish, a rerun refuses. A core npm lag over
100
+ 5 minutes fails the `publish` job, so a rerun stops at `already on npm`.
101
+ The release uses this recovery. The owner completes the release by hand from
102
+ the release commit. Read the state of each step before the step, and do only
103
+ the steps that are not done. Stop at the first failure and report it.
98
104
 
99
105
  1. Worktree: `git fetch origin && git worktree add --detach /tmp/repo-harness-wt-release-<version> <sha> && cd /tmp/repo-harness-wt-release-<version> && bun install --frozen-lockfile`
100
106
  2. Console package: when `npm view repo-harness-operator-web@<version> version`
@@ -43,7 +43,9 @@ Do not pick the convenient wording or make the contract/test silently win.
43
43
 
44
44
  ## Guard Card
45
45
 
46
- The design-brief template owns the exact Guard Card field schema. This runtime
46
+ The design-brief template owns the exact Guard Card field schema: the
47
+ repository's own `.claude/templates/design-brief.template.md` when present,
48
+ otherwise `repo-harness docs path design-brief.template`. This runtime
47
49
  doc owns the interpretation rules and hard stops. Fill every template field; do
48
50
  not restate the schema in a PRD, contract, sidecar, or local checklist, and do
49
51
  not create a parallel guard artifact.
@@ -35,7 +35,7 @@
35
35
  "id": "merge-push",
36
36
  "text": "Changes a merge or push path: the publication executor, branch protection or force push.",
37
37
  "path_visible": true,
38
- "paths": ["src/core/publication/acceptance-merge-policy.ts", "src/core/publication/merge-readiness.ts", "src/effects/publication/batch-build.ts", "src/effects/publication/merge-executor.ts", "src/effects/publication/merge-readiness.ts", "src/effects/publication/new-remote-ref-push.ts", "scripts/merge-gate.ts"]
38
+ "paths": ["src/core/publication/acceptance-merge-policy.ts", "src/core/publication/merge-readiness.ts", "src/effects/publication/merge-executor.ts", "src/effects/publication/merge-readiness.ts", "src/effects/publication/new-remote-ref-push.ts", "scripts/merge-gate.ts"]
39
39
  }
40
40
  ]
41
41
  }
@@ -15,7 +15,7 @@ Worker reference. Use only within the assigned architecture scope.
15
15
  - `repo-harness architecture-debt --json --base <review-base>` (handle debt in scope)
16
16
  - `repo-harness architecture-projection anchors --json` (read-only; see "Drift signals")
17
17
  - `repo-harness run capability-resolver validate --repo <repo> --format text`
18
- - `repo-harness run check-task-workflow` when repo workflow surfaces changed
18
+ - `bun run check:helpers` when a helper source or its standalone projection changed
19
19
  - The module reader and the review diff read the committed HEAD model, but archctx `resolve` reads the worktree model. Commit the model before a review diff.
20
20
 
21
21
  ## Managed archctx command
@@ -55,8 +55,8 @@ Then run `repo-harness run contract-worktree sweep` from the primary checkout.
55
55
  Only merged, clean, unlocked worktrees qualify for automatic cleanup.
56
56
  Retain dirty, locked or unmerged work. Never use reset, clean or stash to hide it.
57
57
 
58
- An external PR or a `tasks/lessons.md` change needs the owner's GO. Its merge uses
59
- `gh pr merge <pr> --squash --match-head-commit <reviewed-sha>`.
58
+ An external PR or a `tasks/lessons.md` change needs the owner's GO. Its
59
+ merge uses `gh pr merge <pr> --squash --match-head-commit <reviewed-sha>`.
60
60
  Default publication opens a PR. Do not commit to or fast-forward main.
61
61
  Find an existing open PR for this branch before creation; reuse it.
62
62
  Do not publish when required checks or required review evidence are missing
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.30.0",
3
- "templateVersion": "0.30.0",
2
+ "version": "0.31.0",
3
+ "templateVersion": "0.31.0",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
@@ -42,7 +42,7 @@ spaces=$(printf '%s' "$layout" | jq -ec --arg n "$name" --arg s "$SPACE" '.space
42
42
  space=$(printf '%s' "$spaces" | jq -r '.[0]')
43
43
 
44
44
  # 3. Live seats of the repository, local terminals only: no advisor, exactly one orchestrator.
45
- # Seats are per host: the board reads local terminals only (src/effects/terminal/herdr-core.ts:337), and another machine may run the same seat.
45
+ # Seats are per host: the board reads local terminals only (src/effects/terminal/herdr-core.ts#isRemoteTerminal), and another machine may run the same seat.
46
46
  live() {
47
47
  seats=$(hc ls --json --label "repo-harness.seat=$1" --label "repo-harness.repository=$id") || stop 'hc ls failed'
48
48
  printf '%s' "$seats" | jq -ec '.terminals | arrays | [.[] | .address | select(contains("/") | not)]' || stop 'hc ls has no terminal list'
@@ -36,6 +36,7 @@ writer, head owner, integrator or acceptor.
36
36
  | Agent | Suggested model | Claim roles it holds | Never does |
37
37
  |---|---|---|---|
38
38
  | Orchestrator | Any host's long-lived top-level session with network access, started from `repo-harness seats argv orchestrator` | Coordinator of the parent issue; integrator | Implements a child issue in its own sub-tree; calls a writer sub-agent (`fast-worker`, `deep-worker`, `root-cause-prover`) or runs the Codex cross-review as a sub-agent |
39
+ | Advisor | A long-lived session beside the orchestrator, started from `repo-harness seats argv advisor` | None. It researches, reviews the board on a schedule and gives its half of a joint decision (`references/advisor.md`) | Writes to GitHub, commits, sends a message to a worker, decides alone |
39
40
  | Gap reviewer | A different model family from the orchestrator, when one is available | None. Comments on the drafts | Rewrites the split or decides scope |
40
41
  | Worker | Any capable coding model | Writer of one issue or PR slot, dispatched by the coordinator; head owner of its PR | Posts its own claim, widens scope, merges, pushes to another owner's branch |
41
42
  | Acceptor | A seat holds the acceptor role. The default reviewer is the gatekeeper in its own Herdr seat; the acceptor does not call it as a sub-agent. The orchestrator does not review a PR itself; a gatekeeper seat reviews each PR that the orchestrator dispatches. The Codex cross-review and every other review run in another seat. For the High tier, two reviews of each head, at least one from a model family different from the writer's; the other can be a fresh same-family context (`references/acceptor.md` §2.2) | Acceptor of one review in one round | Reviews its own code, pushes code |
@@ -64,7 +65,8 @@ every other decision by the rules below and the root life-cycle rules
64
65
  | Product intent | PRD or source document named in the parent issue |
65
66
  | Requirement, scope, boundaries, acceptance | Child issue body |
66
67
  | Parent membership, dependencies, release window, plan tier | GitHub sub-issue, blocked-by link, milestone, `tier:` label (`references/templates.md`, Plan data) |
67
- | Merge order, holds, batches, seat limit | The plan block in the parent's newest `plan` comment |
68
+ | Merge order, holds, seat limit | The plan block in the parent's newest `plan` comment |
69
+ | Release set: the issues that the next release ships | The milestone of each issue. A train is a blocked-by chain inside the set (`references/orchestrator.md` §4.1) |
68
70
  | Claim, status, handoff, scope changes, decisions | Issue comments |
69
71
  | Change, verification, risk, rollback | PR body |
70
72
  | Verification result | CI checks on the PR head |
@@ -75,7 +77,7 @@ every other decision by the rules below and the root life-cycle rules
75
77
 
76
78
  One-time decisions live in issue decision comments. Durable decisions live in `docs/adr/`. `docs/plans/` is banned. A decision is durable when an agent could violate the rule after the issue closes.
77
79
 
78
- When the owner gives a decision in a seat's pane, that seat gets it onto the owning issue in the same turn. The active coordinator posts it as a `decision` comment with the date and the pane. Any other seat sends it to the coordinator in the same turn, with the date and the pane, and the coordinator posts it. When no issue owns the decision yet, the coordinator opens one or names the gap to the owner. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action.
80
+ When the owner gives a decision in a seat's pane, that seat gets it onto the owning issue in the same turn. The active coordinator posts it as a `decision` comment with the date and the pane. Any other seat sends it to the coordinator in the same turn, with the date and the pane, and the coordinator posts it. When no issue owns the decision yet, the coordinator opens one or names the gap to the owner. The record holds the owner's words as given, and the time. An owner authorization covers the case that its words name: a wider or a standing rule needs the owner to say so, because a seat that widens it spends the owner's money or attention without a decision. Users have special cases, and most of them are temporary. Record a temporary exception with its end (a time or an event), carry it out for that case, and let it lapse. Do not turn it into a standing rule or a product default, and do not refuse it because the standing rule says otherwise. Ask the owner one time, with a recommendation and the default that proceeds; do not raise a declined item again. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action.
79
81
 
80
82
  The comment threads are the message board between agents. Every state
81
83
  change is a typed comment, and chat messages carry only its link. Do not
@@ -89,6 +91,8 @@ Every comment that a seat writes ends with one line `Seat: <seat id> <hc address
89
91
 
90
92
  - Orchestrator work (split a goal, write or fix issues, dispatch, follow PRs,
91
93
  accept, merge order, close out): read `references/orchestrator.md`.
94
+ - Advisor work (the scheduled board review, a proposal, the advisor half of a
95
+ joint decision, the release set): read `references/advisor.md`.
92
96
  - Replan (re-plan the board with the advisor): read `references/replan.md`.
93
97
  - Worker work (deliver one claimed issue): read `references/worker.md`.
94
98
  - Acceptance work (take a review round, publish its result, resolve its
@@ -121,9 +125,7 @@ map ─▶ split ─▶ gap review ─▶ publish ─▶ dispatch ─▶ worker
121
125
  "seen again" comment; the reporter appends evidence through `report-ci`
122
126
  only.
123
127
  - One child issue has one write scope. It has one PR, or PR slots that the
124
- issue names in advance. The one exception is a batch integration PR
125
- (`references/orchestrator.md` §9.3): it merges several accepted PRs and
126
- adds no change of its own. Parallel workers never share a file.
128
+ issue names in advance. Parallel workers never share a file.
127
129
  - One head owner per PR. Any other agent asks on the board, or takes the
128
130
  head-owner role through a handoff comment before it pushes.
129
131
  - The worker follows the issue boundary. A needed change outside it is a
@@ -164,11 +166,35 @@ map ─▶ split ─▶ gap review ─▶ publish ─▶ dispatch ─▶ worker
164
166
  the orchestrator dispatches the plan's issues in plan order with no other
165
167
  owner step. A new issue or a changed order goes to the owner or to a joint
166
168
  decision.
167
- - Joint decision. The orchestrator and the advisor make a decision that
168
- otherwise goes to the owner when both agree, unless it touches security.
169
- Before the action, the orchestrator posts it on the owning issue or PR as
170
- `Joint decision (orchestrator + advisor)` with the reason. A joint decision
171
- never replaces the High-tier cross-model review.
169
+ - Intake. Open issues are cleared before new ones are filed. During a batch,
170
+ file a new issue only when it blocks an issue of the release set, records
171
+ a defect that a user meets, or the owner asks for it. Search the open
172
+ issues first and fold a duplicate into the older issue
173
+ (`references/orchestrator.md` §4.2).
174
+ - Release set. A release ships a planned set of issue trains, ordered by
175
+ their dependencies. The release run starts when every train of the set is
176
+ merged. Do not propose a release for a few merged issues or to put one
177
+ change on the host (`references/orchestrator.md` §4.1).
178
+ - Joint decision. The flow aims at full automation outside security and
179
+ deployment. The seats decide and act on every other item, by rule or by
180
+ joint decision. An owner message applies to the item it names and stops
181
+ or reorders no other work. The orchestrator and the advisor make a
182
+ decision that otherwise goes to the owner when both agree, unless it
183
+ touches security. Before the action, the orchestrator posts it on the
184
+ owning issue or PR as `Joint decision (orchestrator + advisor)` with the
185
+ reason. A joint decision never replaces the High-tier cross-model review,
186
+ and it does not reverse an explicit owner decision. When the two seats do
187
+ not agree, nothing changes; the item goes to the owner only when it is
188
+ the owner's to decide.
189
+ - Command refusals. A refusal of a repo-harness command (seat launch, seats
190
+ configuration range, merge gate, required check) is the rule in force.
191
+ Change the input that the command reads, through its own configuration
192
+ path, or wait. Do not build an argv, a record or a state by hand to pass
193
+ it: the refusal is the one place where the rule is checked. A rule that a
194
+ user can have reason to lift for a time needs a setting or a flag for
195
+ that. When an owner exception meets a refusal that has none, tell the
196
+ owner in the same turn what the exception cannot reach, and file the
197
+ setting.
172
198
  - Stop in a comment. Any participant, the owner account included, may post
173
199
  "stop" or "no" on the issue or PR. It is a reference: the orchestrator and
174
200
  the advisor weigh it, decide locally by joint decision and record the
@@ -178,4 +204,4 @@ map ─▶ split ─▶ gap review ─▶ publish ─▶ dispatch ─▶ worker
178
204
  after a joint decision or an owner authorization for the batch; board rule
179
205
  A11 only wakes it. A hold record (`repo-harness merge hold`) only narrows:
180
206
  a seat that decides a stop locally posts it in the same turn
181
- (`references/orchestrator.md` §9.4).
207
+ (`references/orchestrator.md` §9.3).