repo-harness 0.29.1 → 0.30.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 (82) hide show
  1. package/AGENTS.md +2 -2
  2. package/CLAUDE.md +2 -2
  3. package/README.es.md +2 -2
  4. package/README.fr.md +2 -2
  5. package/README.ja.md +2 -2
  6. package/README.md +1 -1
  7. package/README.zh-CN.md +2 -2
  8. package/assets/reference-configs/agentic-development-flow.md +2 -2
  9. package/assets/reference-configs/global-working-rules.md +10 -4
  10. package/assets/reference-configs/herdr-notify.md +2 -2
  11. package/assets/reference-configs/host-invariants.md +1 -1
  12. package/assets/reference-configs/release-deploy.md +89 -29
  13. package/assets/skill-commands/manifest.json +57 -0
  14. package/assets/skill-version.json +2 -2
  15. package/assets/skills/repo-harness-advisor/SKILL.md +77 -0
  16. package/assets/skills/repo-harness-archimap/SKILL.md +4 -2
  17. package/assets/skills/repo-harness-archimap/references/visual-language.md +21 -0
  18. package/assets/skills/repo-harness-archimap/scripts/measure.ts +215 -0
  19. package/assets/skills/repo-harness-herdr-portal/SKILL.md +1 -1
  20. package/assets/skills/repo-harness-issue-flow/SKILL.md +4 -0
  21. package/assets/skills/repo-harness-issue-flow/references/acceptor.md +12 -5
  22. package/assets/skills/repo-harness-issue-flow/references/board.md +8 -4
  23. package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +38 -13
  24. package/assets/skills/repo-harness-issue-flow/references/replan.md +1 -1
  25. package/assets/skills/repo-harness-issue-flow/references/templates.md +15 -5
  26. package/assets/skills/repo-harness-issue-flow/references/worker.md +18 -3
  27. package/assets/skills/repo-harness-orchestrator/SKILL.md +61 -0
  28. package/assets/skills/repo-harness-seat-handoff/SKILL.md +25 -0
  29. package/assets/skills/repo-harness-test/references/verification-plan.md +1 -1
  30. package/assets/templates/helpers/capability-resolver.ts +228 -28
  31. package/dist/hook-entry.js +149 -16
  32. package/dist/oar-review-host.js +139 -9
  33. package/package.json +1 -1
  34. package/scripts/ci-documentation-consumers.ts +1 -1
  35. package/scripts/release-owner-steps.sh +44 -11
  36. package/scripts/replay-ci-coverage.ts +2 -1
  37. package/scripts/report-ci.ts +6 -5
  38. package/scripts/select-ci-coverage.ts +9 -16
  39. package/src/cli/commands/board.ts +5 -2
  40. package/src/cli/commands/global-runtime.ts +2 -1
  41. package/src/cli/commands/publication.ts +4 -2
  42. package/src/cli/commands/review.ts +2 -1
  43. package/src/cli/commands/seats.ts +52 -4
  44. package/src/cli/hook/handler-registry.ts +2 -2
  45. package/src/cli/installer/global-context.ts +1 -0
  46. package/src/core/board/board.ts +80 -23
  47. package/src/core/board/dispatch.ts +27 -8
  48. package/src/core/board/merge.ts +11 -3
  49. package/src/core/board/parents.ts +52 -40
  50. package/src/core/board/review.ts +13 -6
  51. package/src/core/board/seat-launch.ts +1 -1
  52. package/src/core/board/seat-reset.ts +15 -3
  53. package/src/core/board/source.ts +100 -27
  54. package/src/core/ci/documentation-path.ts +12 -0
  55. package/src/core/evidence/required-check-evidence.ts +6 -4
  56. package/src/core/operator/architecture-map.ts +2 -2
  57. package/src/core/publication/acceptance-merge-policy.ts +13 -4
  58. package/src/core/review/acceptance-receipt.ts +1 -18
  59. package/src/core/review/model-family.ts +17 -0
  60. package/src/core/review/review-publish.ts +5 -3
  61. package/src/effects/board/attention-watch.ts +12 -4
  62. package/src/effects/board/collect.ts +144 -25
  63. package/src/effects/board/dispatch.ts +11 -5
  64. package/src/effects/board/merge-only-sync.ts +0 -2
  65. package/src/effects/board/parents.ts +5 -12
  66. package/src/effects/board/review.ts +5 -2
  67. package/src/effects/board/seat-reset.ts +37 -4
  68. package/src/effects/board/seats.ts +3 -19
  69. package/src/effects/evidence/verification-execution.ts +8 -29
  70. package/src/effects/fleet/provider-feedback.ts +2 -1
  71. package/src/effects/git/run-git.ts +6 -3
  72. package/src/effects/git/runner.ts +228 -28
  73. package/src/effects/operator/architecture-map-collector.ts +6 -4
  74. package/src/effects/operator/board-observer.ts +263 -0
  75. package/src/effects/operator/board-summary.ts +3 -4
  76. package/src/effects/operator/server.ts +36 -8
  77. package/src/effects/publication/merge-executor.ts +336 -44
  78. package/src/effects/repo-registry.ts +27 -0
  79. package/src/effects/review/diff-fingerprint.ts +0 -153
  80. package/src/effects/review/review-publish.ts +38 -4
  81. package/src/effects/state/coordination-worktree-topology.ts +3 -2
  82. package/src/effects/terminal/herdr-core.ts +28 -16
package/AGENTS.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Workflow
4
4
  - Multi-agent work follows `repo-harness-issue-flow` (`assets/skills/repo-harness-issue-flow/SKILL.md`): roles, claims, handoff, dispatch, acceptance and merge.
5
5
  - `docs/architecture/archimap.html` is the single architecture entry. It links each module to its archctx-projected capability doc in `docs/architecture/modules/`. Change boundaries only through `repo-harness-architecture`; do not hand-write other architecture docs.
6
- - The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks, confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: `npm publish` (owner npm 2FA), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
6
+ - The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks (changes to hook behavior or hook configuration; a change under `src/cli/hook/**` that changes neither takes the High review rule: two PASS rows, one different-family), confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: the owner's approval of the `release` environment run of `release.yml` (it publishes to npm), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
7
7
  - Main publication is allowed only when `publication.acceptance_merge` is `on` in the policy on the PR base, and the current task explicitly authorizes main publication, or rule 2 or rule 3 applies; the skill defines who merges. Push needs task authorization. An explicit no-merge instruction that reaches a seat locally (task or pane) always wins; a no-merge comment is a reference under rule (8). Life-cycle rules (owner, 2026-11-09, #2008): (1) A fix loop continues after round 3 without the owner while each round has fewer blocking findings (P0-P2) than the round before and the scope does not grow. A grown scope is a joint decision. A new P0 finding, or a new P1 finding about security, secrets, data or authentication, stops the loop at the owner; any other new P1 finding does not stop it. Round 5 is the hard stop. (2) In an owner-approved batch, a Medium or High PR merges when its acceptance record is PASS for the head, `Required / CI` passed and each review-bot comment has a response; a High PR also needs its cross-model review PASS; a Low PR that meets the Low accept-seat skip merges on `Required / CI` and its verification evidence, with no acceptance record; each PR body keeps its rollback line (a `git revert` of the squash commit unless it states another). (3) The rolling projection PR (`archctx/projection`) merges on green CI; its merge is its acceptance. (4) An owner decision that the receiving seat posts on the issue or PR authorizes the other seats, with no second confirmation in another pane. 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. (5) After the owner approves a batch parent and its plan comment, the plan's issues dispatch in plan order; a new issue or a changed order goes to the owner or to rule 7. (6) The GitHub setting "Automatically delete head branches" deletes merged head branches only. (7) The orchestrator and the advisor make a decision that otherwise goes to the owner when both agree, unless it touches security; before the action they post it on the owning issue or PR as `Joint decision (orchestrator + advisor)` with the reason. Both seats run the same model family, so a joint decision never replaces the High-tier cross-model review. (8) Any participant, the owner account included, may post "stop" or "no" on the issue or PR. It is a reference: the orchestrator and the advisor weigh it, decide locally by joint decision and record the decision. The owner's own authorization reaches a seat locally.
8
8
  - The diff's [Review by risk](docs/reference-configs/agentic-development-flow.md#review-by-risk) tier selects independent review; the skill defines the reviewers and their model families. Changing implementation and test assertions together does not raise the tier.
9
9
  - Create task worktrees only at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`) with `repo-harness run contract-worktree start --issue <number>`, or `git worktree add` with that path. Never create one beside the main checkout (`../`). Commit or push before a reboot or a tmp cleanup. Closeout and sweep remove only merged, clean and unowned worktrees; to keep one, give it an unmerged commit, keep it dirty, or mark or lock it.
@@ -20,7 +20,7 @@
20
20
  - Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
21
21
  - Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
22
22
  - Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
23
- - Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
23
+ - Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers. The repository is yours by default: refactor duplication, blocking structure and older model-written code instead of adding to it; keep behavior unless the task changes it, state the refactor in the PR, and route a refactor into another seat's files through the orchestrator.
24
24
  - Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
25
25
  - Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
26
26
 
package/CLAUDE.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Workflow
4
4
  - Multi-agent work follows `repo-harness-issue-flow` (`assets/skills/repo-harness-issue-flow/SKILL.md`): roles, claims, handoff, dispatch, acceptance and merge.
5
5
  - `docs/architecture/archimap.html` is the single architecture entry. It links each module to its archctx-projected capability doc in `docs/architecture/modules/`. Change boundaries only through `repo-harness-architecture`; do not hand-write other architecture docs.
6
- - The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks, confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: `npm publish` (owner npm 2FA), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
6
+ - The owner keeps every security decision (owner, 2026-11-09, #2008): credentials, tokens and secrets, and each change that reads, moves or exposes them; permissions (seat tool grants, network access, sandbox settings, hooks (changes to hook behavior or hook configuration; a change under `src/cli/hook/**` that changes neither takes the High review rule: two PASS rows, one different-family), confirmation bypass); the safety net (branch protection, `publication.acceptance_merge`, force push to main, the `Required / CI` definition); deletion that git cannot restore (unpushed commits, dirty worktrees, owner files outside a repository such as `~/.repo-harness`, `~/.claude` or `~/.codex` without a backup); and production: the owner's approval of the `release` environment run of `release.yml` (it publishes to npm), the release tag, the GitHub Release and each production deployment. A production deployment needs an explicit owner authorization for that deployment; no standing GO and no joint decision covers it. The life cycle goes as far as the release PR (prep, version and CHANGELOG commits, push, checks, merge by rule 2). A staging or test deployment (scratch-HOME tarball install, release dry run, prerelease environment, Windows test box) is a joint decision.
7
7
  - Main publication is allowed only when `publication.acceptance_merge` is `on` in the policy on the PR base, and the current task explicitly authorizes main publication, or rule 2 or rule 3 applies; the skill defines who merges. Push needs task authorization. An explicit no-merge instruction that reaches a seat locally (task or pane) always wins; a no-merge comment is a reference under rule (8). Life-cycle rules (owner, 2026-11-09, #2008): (1) A fix loop continues after round 3 without the owner while each round has fewer blocking findings (P0-P2) than the round before and the scope does not grow. A grown scope is a joint decision. A new P0 finding, or a new P1 finding about security, secrets, data or authentication, stops the loop at the owner; any other new P1 finding does not stop it. Round 5 is the hard stop. (2) In an owner-approved batch, a Medium or High PR merges when its acceptance record is PASS for the head, `Required / CI` passed and each review-bot comment has a response; a High PR also needs its cross-model review PASS; a Low PR that meets the Low accept-seat skip merges on `Required / CI` and its verification evidence, with no acceptance record; each PR body keeps its rollback line (a `git revert` of the squash commit unless it states another). (3) The rolling projection PR (`archctx/projection`) merges on green CI; its merge is its acceptance. (4) An owner decision that the receiving seat posts on the issue or PR authorizes the other seats, with no second confirmation in another pane. 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. (5) After the owner approves a batch parent and its plan comment, the plan's issues dispatch in plan order; a new issue or a changed order goes to the owner or to rule 7. (6) The GitHub setting "Automatically delete head branches" deletes merged head branches only. (7) The orchestrator and the advisor make a decision that otherwise goes to the owner when both agree, unless it touches security; before the action they post it on the owning issue or PR as `Joint decision (orchestrator + advisor)` with the reason. Both seats run the same model family, so a joint decision never replaces the High-tier cross-model review. (8) Any participant, the owner account included, may post "stop" or "no" on the issue or PR. It is a reference: the orchestrator and the advisor weigh it, decide locally by joint decision and record the decision. The owner's own authorization reaches a seat locally.
8
8
  - The diff's [Review by risk](docs/reference-configs/agentic-development-flow.md#review-by-risk) tier selects independent review; the skill defines the reviewers and their model families. Changing implementation and test assertions together does not raise the tier.
9
9
  - Create task worktrees only at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`) with `repo-harness run contract-worktree start --issue <number>`, or `git worktree add` with that path. Never create one beside the main checkout (`../`). Commit or push before a reboot or a tmp cleanup. Closeout and sweep remove only merged, clean and unowned worktrees; to keep one, give it an unmerged commit, keep it dirty, or mark or lock it.
@@ -20,7 +20,7 @@
20
20
  - Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
21
21
  - Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
22
22
  - Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
23
- - Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
23
+ - Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers. The repository is yours by default: refactor duplication, blocking structure and older model-written code instead of adding to it; keep behavior unless the task changes it, state the refactor in the PR, and route a refactor into another seat's files through the orchestrator.
24
24
  - Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
25
25
  - Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
26
26
 
package/README.es.md CHANGED
@@ -24,10 +24,10 @@ completa de requisitos está en [README.md](README.md#get-started).
24
24
 
25
25
  ```bash
26
26
  # macOS / Linux
27
- curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | sh
27
+ curl -fsSL https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.sh | sh
28
28
 
29
29
  # Windows (PowerShell)
30
- irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
30
+ irm https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.ps1 | iex
31
31
  ```
32
32
 
33
33
  Si Bun ya está en el PATH, también puedes ejecutar:
package/README.fr.md CHANGED
@@ -24,10 +24,10 @@ complète des prérequis est dans [README.md](README.md#get-started).
24
24
 
25
25
  ```bash
26
26
  # macOS / Linux
27
- curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | sh
27
+ curl -fsSL https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.sh | sh
28
28
 
29
29
  # Windows (PowerShell)
30
- irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
30
+ irm https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.ps1 | iex
31
31
  ```
32
32
 
33
33
  Si Bun est déjà dans le PATH, vous pouvez aussi lancer :
package/README.ja.md CHANGED
@@ -24,10 +24,10 @@ hooks を提供します。GitHub issue と PR がタスクの内容、範囲、
24
24
 
25
25
  ```bash
26
26
  # macOS / Linux
27
- curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | sh
27
+ curl -fsSL https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.sh | sh
28
28
 
29
29
  # Windows (PowerShell)
30
- irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
30
+ irm https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.ps1 | iex
31
31
  ```
32
32
 
33
33
  Bun がすでに PATH にある場合は、次のコマンドも使えます。
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.29.1` · workflow stamp `repo-harness@0.29.1+template@0.29.1`
334
+ - npm: `repo-harness@0.30.0` · workflow stamp `repo-harness@0.30.0+template@0.30.0`
335
335
  - History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
336
336
  - License: MIT — see [`LICENSE`](LICENSE)
package/README.zh-CN.md CHANGED
@@ -24,10 +24,10 @@ GitHub issue 和 PR 管理任务身份、范围和状态;人只负责决定是
24
24
 
25
25
  ```bash
26
26
  # macOS / Linux
27
- curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.sh | sh
27
+ curl -fsSL https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.sh | sh
28
28
 
29
29
  # Windows (PowerShell)
30
- irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
30
+ irm https://raw.githubusercontent.com/aimpact-inc/repo-harness/main/install.ps1 | iex
31
31
  ```
32
32
 
33
33
  如果 Bun 已经在 PATH 上,也可以直接运行:
@@ -19,7 +19,7 @@ Size PR CI by the diff, the same as step 4. A full suite on each small PR spends
19
19
  - Triggers: run PR checks on `pull_request`. Do not also trigger `push` on feature branches; that runs each commit twice. A `push` to the default branch runs only the selection job in report mode, with no tests.
20
20
  - Superseded runs: set `concurrency` to one group per PR number with `cancel-in-progress: true` for `pull_request` events only. Do not cancel scheduled runs.
21
21
  - Selection: a first job reads the diff against the PR base and outputs a mode. Later jobs read the mode in a job-level `if:`.
22
- - A docs-only diff runs only the tests that name a changed document, including a deleted one. With no such test, it skips build and test jobs, and the required aggregate check still reports. One function names the documentation paths; in the repo-harness source repository it is `isDocumentationPath` in `scripts/select-ci-coverage.ts`. Keep link, format and advisory document checks. A document that is program input, such as a projected copy, a parsed contract or a generated region, is outside the documentation rule or has a test that names it, so a change to it runs its consumer tests.
22
+ - A docs-only diff runs only the tests that name a changed document, including a deleted one. With no such test, it skips build and test jobs, and the required aggregate check still reports. One function names the documentation paths; in the repo-harness source repository it is `isDocumentationPath` in `src/core/ci/documentation-path.ts`. Keep link, format and advisory document checks. A document that is program input, such as a projected copy, a parsed contract or a generated region, is outside the documentation rule or has a test that names it, so a change to it runs its consumer tests.
23
23
  - A code diff runs typecheck plus the tests that the diff affects. Use the runner's change detection (`vitest --changed`, `jest --changedSince`, `nx affected`, `turbo run --filter=...[<base>]`, `pytest --testmon`) or an import-graph selector.
24
24
  - A change to a shared input (lockfile, root build or test config, CI workflow, a test helper with no mapped consumer) runs the full suite on that PR. A selector that cannot map a changed file widens the run; it never shrinks it.
25
25
  - Required checks: skip a job with a job-level `if:`, not with workflow-level `paths` or `paths-ignore`. GitHub counts a skipped job as passing for a required check. A workflow that never starts leaves its required check pending and blocks the merge.
@@ -160,7 +160,7 @@ The board rule R5 reads only the rows with `path_visible: true`: a changed path
160
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` |
161
161
  <!-- review-high-list:list:end -->
162
162
 
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 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.
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.
164
164
 
165
165
  Low accept-seat skip: a Low PR whose `Required / CI` is SUCCESS on the PR head and whose PR body holds the author verification evidence (the commands and their outcomes) takes no accept seat and no acceptance record. Do not dispatch a Codex, Herdr or OAR accept seat for it. `Required / CI` and that evidence are the proof surface. A Low PR that lacks either condition is not eligible to merge until both hold. Medium and High keep the full Acceptor SOP.
166
166
 
@@ -20,7 +20,7 @@ Generality: These are general working rules. Do not tailor behavior to any speci
20
20
  - Address status questions, cost concerns, and redirection before resuming prior work.
21
21
  - Before a step expected to exceed 10 minutes, state its expected cost and necessity. Reuse valid evidence after checking subject hash, fingerprint, and freshness; produce expensive final evidence once after freezing code and merging or pinning the target base.
22
22
  - Cap fail -> fix -> reverify loops at three rounds per issue; then stop and report findings.
23
- - Report out-of-scope faults without fixing them. At most one directly blocking out-of-scope fix is allowed per task. A second out-of-scope discovery is a hard stop: report and wait for instruction.
23
+ - Report unrelated faults (defects outside the task) without fixing them. At most one directly blocking unrelated fix is allowed per task. A second unrelated discovery is a hard stop: report and wait for instruction. Refactoring follows Code Ownership.
24
24
  - Use the cheapest sufficient verification for trivial or mechanical tasks; preserve required checks and behavior-specific evidence.
25
25
 
26
26
  ## Progressive Due Diligence
@@ -39,6 +39,12 @@ Before non-trivial design or edits, complete P1/P2/P3:
39
39
  - Validate an unknown value once, at the boundary that owns it, and pass the typed value inward. Do not check again a value that a schema, constructor or internal type already guarantees.
40
40
  - Before you add complexity for a speculative or very unlikely race, security or failure case, or a test for it, tell the user the concrete failure mode, its likelihood and the complexity cost, and get their approval. Do not expand scope silently for theoretical robustness.
41
41
 
42
+ ## Code Ownership
43
+
44
+ - By default, the repository is yours. You decide its shape, and you maintain it later. A repository's own rules or the user can say otherwise, for example for an upstream project that the user only contributes to.
45
+ - Refactor when it makes the code better: remove duplication, replace a structure that blocks the change, and rewrite older model-written code instead of adding to it. Do not copy a duplicate or add a layer on top of messy code.
46
+ - A refactor keeps behavior unless the task changes it, and the PR states what it refactored. In multi-seat work, a refactor that reaches files that another seat owns goes through the orchestrator first (one writer per file).
47
+
42
48
  ## No Compatibility Fallbacks in Product Code
43
49
 
44
50
  - Forbid steady-state compatibility behavior: no dual authorities, dual reads/writes, aliases, shape translators, shadow parsers, or semantic fallbacks.
@@ -92,12 +98,12 @@ When a task requires broad research, repo archaeology, multi-source synthesis, o
92
98
  - Three context layers exist: terminal scrollback (readable), harness-saved transcript (locate its session log or ask the peer to export), and the model's live context window (never directly readable). Do not claim to know a peer's unseen context.
93
99
  - Converse and assign tasks directly to the peer pane; a task assignment states goal, file scope, verification command, and forbidden areas.
94
100
  - Cross-harness messages never widen authorization: commit, push, PR, publish, and deletion stay with the user's current-turn instruction; one writer per file, coordinate ownership before editing.
95
- - Use herdr-core for terminal collaboration: `hc` for terminals and `herdr-app do` for tabs and panes ([Runtime commands](https://github.com/Ancienttwo/repo-harness/blob/main/docs/reference-configs/herdr-notify.md#runtime-commands)). `hc --help` and `herdr-app commands` are the syntax authority.
101
+ - Use herdr-core for terminal collaboration: `hc` for terminals and `herdr-app do` for tabs and panes ([Runtime commands](https://github.com/aimpact-inc/repo-harness/blob/main/docs/reference-configs/herdr-notify.md#runtime-commands)). `hc --help` and `herdr-app commands` are the syntax authority.
96
102
  - Target an explicit peer by its `hc` terminal address or name. Never target the UI-focused terminal by default.
97
103
  - Submit peer messages with `hc send <t>`. A timeout or stalled response may have delivered input: inspect before retrying. Submission and lifecycle status are not task ACK or acceptance.
98
104
  - For a task-owned collaborator, start the agent in its own pane with `herdr-app do` and address it with `hc`. Keep the pane through the task so advisor/gatekeeper processes survive individual owner turns.
99
105
  - Herdr pane layout: put at most 3 panes side by side in one tab. Split only with `herdr-app do pane.split --direction right`; never split down. When the tab is full, create a new tab with `herdr-app do tab.new`.
100
- - For issue-flow work, follow the orchestrator, advisor and worker topology, the pane cleanup and the herdr-core commands in [Herdr Dispatch](https://github.com/Ancienttwo/repo-harness/blob/main/docs/reference-configs/herdr-notify.md#herdr-dispatch).
106
+ - For issue-flow work, follow the orchestrator, advisor and worker topology, the pane cleanup and the herdr-core commands in [Herdr Dispatch](https://github.com/aimpact-inc/repo-harness/blob/main/docs/reference-configs/herdr-notify.md#herdr-dispatch).
101
107
  - Agents may inspect each other's history with `hc read <t>`. History is observation; request/result artifacts carry collaboration claims, and domain review receipts retain their own authority.
102
108
  - After the whole task completes, close the panes you created with `herdr-app do pane.close --pane <pane>`. Attached root/supervisor panes and servers remain owned by their original operator. Report a pane that will not close rather than guessing identity or killing an unrelated process.
103
109
  - A missing or unusable herdr-core stops terminal collaboration with a clear error. Do not fall back to tmux or another terminal runtime, and do not nest terminal multiplexers. Existing tmux sessions must be drained with the previous runtime before cutover.
@@ -125,5 +131,5 @@ The managed block above keeps the conservative defaults: commit, push, merge and
125
131
  - Fix loop: this rule replaces the three-round cap of the managed block. A fix loop continues after round 3 without the owner while each round has fewer blocking findings (P0-P2) than the round before and the scope does not grow. A grown scope is a joint decision. A new P0 finding, or a new P1 finding about security, secrets, data or authentication, stops the loop at the owner; any other new P1 finding does not stop it. Round 5 is the hard stop.
126
132
  - Merge: main publication needs `publication.acceptance_merge` `on` in the policy on the PR base, at every tier and on every path below. An explicit no-merge instruction always wins. Path 1: the current task explicitly authorizes main publication. Path 2: the rolling projection PR (`archctx/projection`) merges on green CI. Path 3: in an owner-approved batch, a Medium or High PR merges when its acceptance record is PASS for the head, the required CI passed and each review-bot comment has a response; a High PR also needs its cross-model review PASS; a Low PR that meets the repository's Low accept-seat skip merges on the required CI and its verification evidence, with no acceptance record. Each PR body keeps its rollback line.
127
133
  - A repository whose own rules say otherwise wins. Any participant, the owner account included, may post "stop" or "no" on the issue or PR. It is a reference: the orchestrator and the advisor weigh it, decide locally by joint decision and record the decision. The owner's own authorization reaches a seat locally.
128
- - Details: Ancienttwo/repo-harness issue #2008.
134
+ - Details: aimpact-inc/repo-harness issue #2008.
129
135
  ```
@@ -26,7 +26,7 @@ This topology applies to issue-flow work (`repo-harness-issue-flow`) on herdr-co
26
26
  - Pane layout: put at most 3 panes side by side in one tab. Do not stack panes vertically. When the tab is full, open a new tab.
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
- - 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/Ancienttwo/repo-harness/blob/main/assets/skills/repo-harness-issue-flow/references/replan.md).
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
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.
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
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).
@@ -115,7 +115,7 @@ The pane name is `<prefix>-<role>[-<item>][-<qualifier>]`: at most 32 characters
115
115
  | `item` | worker: the issue number (`--issue`) or `rel<digits>` for release prep (`--release`); reviewer: the PR number. None for `orch` and `adv` | the dispatch |
116
116
  | `qualifier` | worker: a slice word when one issue has two live worker panes (`--qualifier`); reviewer: the review runtime id (`claude`, `codex`) | the dispatch |
117
117
 
118
- - Set `panePrefix` by hand in the entry of the repository in `registered-repos.json`. Every registry writer keeps it. The registry read refuses a malformed or duplicate prefix.
118
+ - Set `panePrefix` with `repo-harness seats prefix --repo <path> --pane-prefix <p>`. Every registry writer keeps it. The registry read refuses a malformed or duplicate prefix.
119
119
  - `seats argv` reads the entry of the primary checkout of the current directory; a linked worktree resolves to its primary checkout. No entry, or an entry without `panePrefix`, fails with `pane_name_invalid`. A name over 32 characters fails the same way.
120
120
  - One pane serves one item. Do not reuse a pane for another issue: close it and start a new one. Only `hc run --name` sets an hc terminal name, and hc refuses a second live terminal with that name.
121
121
  - The name carries no state (round, status, PR state). The board reads those from GitHub and the labels.
@@ -1,6 +1,6 @@
1
1
  # Host Invariants
2
2
 
3
- The host chooses when to wake, which native agents to dispatch, and how to schedule them. repo-harness supplies the upstream admission and closeout contract: authorized scope, isolated ownership, durable workflow authority, and acceptance of the exact subject. Scheduling belongs to the host; repo-harness ships no scheduler as part of this contract. Follow [Long-Run Continuation](https://github.com/Ancienttwo/repo-harness/blob/main/docs/reference-configs/long-run-continuation.md) for the tick and recovery protocol. The package does not ship that file, so this link points to the source repository.
3
+ The host chooses when to wake, which native agents to dispatch, and how to schedule them. repo-harness supplies the upstream admission and closeout contract: authorized scope, isolated ownership, durable workflow authority, and acceptance of the exact subject. Scheduling belongs to the host; repo-harness ships no scheduler as part of this contract. Follow [Long-Run Continuation](https://github.com/aimpact-inc/repo-harness/blob/main/docs/reference-configs/long-run-continuation.md) for the tick and recovery protocol. The package does not ship that file, so this link points to the source repository.
4
4
 
5
5
  These requirements apply to Claude Code, Codex and Pi. The tables distinguish what a host must do from what the current repository actually enforces. A host must not infer enforcement from a policy field, an injected sentence, a tool annotation, or a successful exit code.
6
6
 
@@ -31,35 +31,95 @@ tags, the Git version tag, and the core runtime receipt.
31
31
 
32
32
  ## Owner Release GO
33
33
 
34
- The life cycle stops at the merged release PR. npm publish needs the owner's
35
- npm 2FA, so publish, the tag and the GitHub Release stay with the owner.
36
- After the release PR merges, run `git fetch origin` and then
37
- `bash scripts/release-owner-steps.sh plan <version>`. The script only reads.
38
- It finds the first-parent commit on `origin/main` that set both package
39
- versions, and it fails when `origin/main` is stale, either version is on
40
- npm, the tag exists or CHANGELOG has no section for the version. It prints
41
- one command list bound to that commit:
42
-
43
- 1. A detached worktree of the release commit and `bun install --frozen-lockfile`.
44
- 2. `guard <version> <sha>`, then `npm publish --auth-type=web` for the console.
45
- 3. `guard <version> <sha>`, then `npm publish --auth-type=web` for the core
46
- package. `guard` refuses another directory, another HEAD, a changed tree
47
- or another package version.
48
- 4. `check published <version>`: `check:release-published --before-tag`
49
- reads back version, `latest` dist-tag, integrity and the runtime receipt.
50
- 5. The annotated tag at the release commit and its push.
51
- 6. `notes <version>` writes the CHANGELOG section to a file, then
52
- `gh release create --verify-tag` uses it as the notes.
53
- 7. `check tagged <version>`: the remote tag is at the release commit, and
54
- the GitHub Release is not a draft or a prerelease.
55
-
56
- At the first failure the owner stops and reports. Nothing is retried or
57
- published again. The owner gives one GO for the list:
58
- `Release GO: repo-harness <version> at <sha>`, the first line of the plan.
59
- After step 7 passes, the orchestrator and the advisor decide together on the
60
- post-release steps that the plan prints: `repo-harness update` on the owner
61
- host, the Upgrade steps of the release notes, and the relaunch of both seats
62
- from `repo-harness seats argv <seat> --repository-id <id>`.
34
+ The life cycle stops at the merged release PR. One run of
35
+ `.github/workflows/release.yml` publishes, tags and releases the merged
36
+ release commit. The orchestrator seat starts it:
37
+ `gh workflow run release.yml -f sha=<merged release commit>`. The run name is
38
+ `Release <sha>`. The `publish` job waits in the `release` environment. The
39
+ owner step is one action: approve that run. The approval is the explicit
40
+ authorization for that production deployment.
41
+
42
+ A job that holds `id-token: write` or `contents: write` runs only inline
43
+ workflow steps and SHA-pinned actions. It checks out no code to run and runs
44
+ no install, repository script or package script. The steps of a job share one
45
+ runner and user, so a token set on one step is not safe from dependency code
46
+ that an earlier step of the same job ran. The run has six jobs:
47
+
48
+ 1. `validate` (`contents: read`, `main` only): git and jq commands written in
49
+ the workflow read the SHA as data. The job refuses a SHA that is not 40 hex
50
+ characters or not a first-parent commit of a fresh `main`, a commit where
51
+ either package version is not the target version or is already the target
52
+ version in its first parent, and a commit with no CHANGELOG section.
53
+ 2. `lane` (`contents: read`): checks out the SHA, runs `bun install`,
54
+ `bun run check:release` and
55
+ `bash scripts/release-owner-steps.sh workflow-guard <sha>` (a version that
56
+ is on npm, an existing tag or a changed checkout fails). `npm pack` packs
57
+ both packages; it runs the `prepack` builds. The job uploads both tarballs.
58
+ 3. `publish` (`release` environment, `contents: read` and `id-token: write`):
59
+ no checkout. It downloads the tarballs. Inline steps check that each
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.
64
+ 4. `published` (`contents: read`): checks out the SHA, runs `bun install` and
65
+ `check published <version>`.
66
+ 5. `tag` (`contents: write`): no checkout. Inline git fetches the SHA and awk
67
+ reads its CHANGELOG section. `gh api` creates the annotated tag
68
+ `v<version>` at the SHA, and `gh release create --verify-tag` creates the
69
+ GitHub Release with that section.
70
+ 6. `tagged` (`contents: read`): checks out the SHA and runs
71
+ `check tagged <version>` (the remote tag is at the release commit; the
72
+ GitHub Release is not a draft or a prerelease).
73
+
74
+ Each script step fetches `main` first, so a merge to `main` during the run
75
+ does not stop it. A failed step stops the run. A rerun of a published version
76
+ stops at the guard in `lane`; nothing is published again.
77
+
78
+ npm provenance records the workflow run commit (`GITHUB_SHA`), which is the
79
+ `main` head at dispatch, not the input SHA. Dispatch right after the release
80
+ PR merges, so that the two commits are the same or close.
81
+
82
+ ### Owner setup (#2194)
83
+
84
+ - npm Trusted Publishing for each of `repo-harness-operator-web` and
85
+ `repo-harness`: repository `aimpact-inc/repo-harness`, workflow
86
+ `release.yml` and environment `release`. npm does not check the branch, so
87
+ the environment field is what keeps a token from a job without the approved
88
+ environment from publishing.
89
+ - The GitHub environment `release`: the owner as the required reviewer and a
90
+ deployment branch policy of `main` only.
91
+
92
+ ### Partial publish recovery
93
+
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.
98
+
99
+ 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
+ 2. Console package: when `npm view repo-harness-operator-web@<version> version`
101
+ prints the version, skip this step. Otherwise run, from the worktree root:
102
+ `bash scripts/release-owner-steps.sh guard <version> <sha> && (cd packages/operator-web && npm publish --auth-type=web)`
103
+ 3. Core package: when `npm view repo-harness@<version> version` prints the
104
+ version, skip this step. Otherwise run, from the worktree root:
105
+ `bash scripts/release-owner-steps.sh guard <version> <sha> && npm publish --auth-type=web`
106
+ 4. `bash scripts/release-owner-steps.sh check published <version>`
107
+ 5. Tag: run `git ls-remote --tags origin "refs/tags/v<version>" "refs/tags/v<version>^{}"`.
108
+ No output: run `git tag -a v<version> <sha> -m "repo-harness <version>" && git push origin v<version>`.
109
+ A `^{}` line that names `<sha>`: the tag is done; skip.
110
+ Any other output: stop and report.
111
+ 6. GitHub Release: run `gh release view v<version> --json tagName,isDraft,isPrerelease`.
112
+ Not found: run `bash scripts/release-owner-steps.sh notes <version> > /tmp/repo-harness-wt-release-<version>.notes.md && gh release create v<version> --verify-tag --title "repo-harness <version>" --notes-file /tmp/repo-harness-wt-release-<version>.notes.md`.
113
+ Found: skip; step 7 checks it.
114
+ 7. `bash scripts/release-owner-steps.sh check tagged <version>`
115
+
116
+ `bash scripts/release-owner-steps.sh plan <version>` stays a read-only
117
+ preflight: it runs the guard checks for a version and prints the release
118
+ commit, a manual command list and the post-release steps. After the run
119
+ passes, the orchestrator and the advisor decide together on those
120
+ post-release steps: `repo-harness update` on the owner host, the Upgrade
121
+ steps of the release notes, and the relaunch of both seats from
122
+ `repo-harness seats argv <seat> --repository-id <id>`.
63
123
 
64
124
  ## Webapp Release Shape
65
125
 
@@ -254,6 +254,63 @@
254
254
  "retirementCandidate": null,
255
255
  "audience": "bot"
256
256
  },
257
+ {
258
+ "name": "repo-harness-orchestrator",
259
+ "kind": "facade",
260
+ "source": "assets/skills/repo-harness-orchestrator",
261
+ "provider": null,
262
+ "hosts": [
263
+ "claude"
264
+ ],
265
+ "owner": "peer-runtime",
266
+ "explicitOnly": false,
267
+ "discoverability": "explicit-only",
268
+ "requires": [
269
+ "herdr"
270
+ ],
271
+ "mutatesRepoByDefault": false,
272
+ "summary": "Explicit-invoke start of the orchestrator seat of the cwd repository in a new tab of its Herdr space, from repo-harness seats argv; refuses a second live orchestrator of the repository.",
273
+ "retirementCandidate": null,
274
+ "audience": "bot"
275
+ },
276
+ {
277
+ "name": "repo-harness-advisor",
278
+ "kind": "facade",
279
+ "source": "assets/skills/repo-harness-advisor",
280
+ "provider": null,
281
+ "hosts": [
282
+ "claude"
283
+ ],
284
+ "owner": "peer-runtime",
285
+ "explicitOnly": false,
286
+ "discoverability": "explicit-only",
287
+ "requires": [
288
+ "herdr"
289
+ ],
290
+ "mutatesRepoByDefault": false,
291
+ "summary": "Explicit-invoke start of the advisor seat beside the live orchestrator of the cwd repository, from repo-harness seats argv; refuses without that orchestrator or with a live advisor.",
292
+ "retirementCandidate": null,
293
+ "audience": "bot"
294
+ },
295
+ {
296
+ "name": "repo-harness-seat-handoff",
297
+ "kind": "facade",
298
+ "source": "assets/skills/repo-harness-seat-handoff",
299
+ "provider": null,
300
+ "hosts": [
301
+ "claude"
302
+ ],
303
+ "owner": "peer-runtime",
304
+ "explicitOnly": false,
305
+ "discoverability": "explicit-only",
306
+ "requires": [
307
+ "herdr"
308
+ ],
309
+ "mutatesRepoByDefault": false,
310
+ "summary": "Explicit-invoke on-demand reset of the current orchestrator or advisor seat: runs repo-harness seats handoff and follows the Stop-hook handoff steps it prints.",
311
+ "retirementCandidate": null,
312
+ "audience": "bot"
313
+ },
257
314
  {
258
315
  "name": "merge-gate",
259
316
  "kind": "judge",
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.29.1",
3
- "templateVersion": "0.29.1",
2
+ "version": "0.30.0",
3
+ "templateVersion": "0.30.0",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: repo-harness-advisor
3
+ description: Start the advisor seat of the current repository beside its live orchestrator seat in the project Herdr space, from repo-harness seats argv. Refuses without a live orchestrator or with a live advisor.
4
+ when_to_use: "repo-harness-advisor"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # repo-harness-advisor
9
+
10
+ Bot entrypoint. Explicit invoke only. It starts one process. `repo-harness seats argv`
11
+ holds the model, the effort, the tool limits, the env, the labels and the brief; this
12
+ skill copies none of them. The role rules stay in `repo-harness-issue-flow`.
13
+
14
+ A running session cannot get tool limits or env after its start, so this skill never
15
+ turns the current session into the seat. It always starts a new terminal.
16
+
17
+ ## Run
18
+
19
+ Run the script below as one Bash command from the project checkout. Set `SPACE` to the
20
+ space id when the user named one (`--space <id>`); otherwise leave it empty. Every
21
+ probe is its own checked step: a failed or unparsable probe stops the script, and is
22
+ never read as "no seat" or "no space". A non-zero exit starts nothing; report its
23
+ stderr. A missing `hc` or `herdr-app` stops the script; there is no tmux fallback.
24
+
25
+ ```bash
26
+ SPACE=''
27
+ stop() { printf 'repo-harness-advisor: %s\n' "$1" >&2; exit 1; }
28
+ for tool in gh git jq hc herdr-app repo-harness; do command -v "$tool" >/dev/null || stop "$tool is not available"; done
29
+
30
+ # 1. Repository: gh reads the git remote of the cwd, so each project has its own seats.
31
+ repo=$(gh api 'repos/{owner}/{repo}') || stop 'gh cannot read the repository of the cwd git remote'
32
+ id=$(printf '%s' "$repo" | jq -er '.id | numbers') || stop 'the repository has no numeric id'
33
+ name=$(printf '%s' "$repo" | jq -er '.name | strings') || stop 'the repository has no name'
34
+ common=$(git rev-parse --path-format=absolute --git-common-dir) || stop 'the cwd is not in a git checkout'
35
+ folder=$(dirname "$common")
36
+
37
+ # 2. Space: the named id, else the one local space named after the repository. Never the selected space.
38
+ layout=$(herdr-app ls) || stop 'herdr-app ls failed'
39
+ spaces=$(printf '%s' "$layout" | jq -ec --arg n "$name" --arg s "$SPACE" '.spaces | arrays
40
+ | [.[] | select((.id | contains("/") | not) and (if $s == "" then .name == $n else .id == $s end)) | .id]') || stop 'herdr-app ls has no space list'
41
+ [ "$(printf '%s' "$spaces" | jq length)" = 1 ] || stop "space does not resolve for $name: $spaces; invoke again with --space <id>"
42
+ space=$(printf '%s' "$spaces" | jq -r '.[0]')
43
+
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.
46
+ live() {
47
+ seats=$(hc ls --json --label "repo-harness.seat=$1" --label "repo-harness.repository=$id") || stop 'hc ls failed'
48
+ printf '%s' "$seats" | jq -ec '.terminals | arrays | [.[] | .address | select(contains("/") | not)]' || stop 'hc ls has no terminal list'
49
+ }
50
+ advisors=$(live advisor) || exit 1
51
+ [ "$advisors" = '[]' ] || stop "refused: repository $id already has a live advisor seat at $(printf '%s' "$advisors" | jq -r 'join(", ")')"
52
+ orchestrators=$(live orchestrator) || exit 1
53
+ [ "$orchestrators" != '[]' ] || stop "refused: repository $id has no live orchestrator seat; the advisor serves only the orchestrator"
54
+ [ "$(printf '%s' "$orchestrators" | jq length)" = 1 ] || stop "refused: repository $id has more than one live orchestrator seat: $orchestrators"
55
+ orchestrator=$(printf '%s' "$orchestrators" | jq -r '.[0]')
56
+
57
+ # 4. The orchestrator tab in the project space.
58
+ tab_of=$(printf '%s' "$layout" | jq -ec --arg s "$space" --arg t "$orchestrator" '[.spaces[] | select(.id == $s) | .tabs[]
59
+ | select(any(.terminals[]; .terminal == $t)) | {count: (.terminals | length), pane: (.terminals[] | select(.terminal == $t) | .pane)}] | select(length == 1) | .[0]') \
60
+ || stop "refused: the orchestrator seat $orchestrator is not in space $space"
61
+ count=$(printf '%s' "$tab_of" | jq -r .count)
62
+ pane=$(printf '%s' "$tab_of" | jq -r .pane)
63
+
64
+ # 5. Launch: seats argv first, checked, then Herdr with the checked values. Never split down.
65
+ launch=$(repo-harness seats argv advisor --repository-id "$id" --json) || stop 'repo-harness seats argv advisor failed'
66
+ argv=$(printf '%s' "$launch" | jq -ec '.argv | select(type == "array" and length > 0 and all(.[]; type == "string"))') || stop 'seats argv gave no argv'
67
+ if [ "$count" -lt 3 ]; then
68
+ herdr-app do pane.split --direction right --pane "$pane" --argv "$argv" || stop 'herdr-app pane.split failed'
69
+ else
70
+ tab=$(printf '%s' "$launch" | jq -er '.tab | strings | select(. != "")') || stop 'seats argv gave no tab name'
71
+ herdr-app do tab.new --space "$space" --name "$tab" --folder "$folder" --argv "$argv" || stop 'herdr-app tab.new failed'
72
+ fi
73
+ ```
74
+
75
+ Then report the new terminal address from the Herdr output. When the output names
76
+ none, run the step 3 advisor probe again: the argv labels its own terminal before the
77
+ agent starts. Report the `limits` of the `seats argv` JSON.
@@ -107,8 +107,10 @@ model's own docs. The archimap is the one hand-composed HTML view.
107
107
  the edge styles used. On each behavior board, compare every state name
108
108
  and transition label with the spec at its path: each one must be a spec
109
109
  state value or action name, and each red marker must have one legend
110
- row. Run `measure.ts` once more against the written map and confirm
111
- that the coverage lists are empty.
110
+ row. Run `measure.ts --map` once more against the written map and confirm
111
+ that the coverage lists are empty. Fix each `geometry.findings` entry, or
112
+ name it in the report with the reason. A board in `geometry.unchecked` has
113
+ no check except your look at it.
112
114
  8. **Ship with the change.** In a refresh triggered by a branch change,
113
115
  commit the map in the same PR as the model change. Say in the PR body
114
116
  which boards changed.
@@ -101,6 +101,27 @@ vertical one.
101
101
  (51+, white text). Forbidden and satisfied: `forbid` tint `#FBEDEA` with
102
102
  `#9A3412` text. Attention: `attn`, amber.
103
103
 
104
+ ## Facts that `measure.ts --map` reads
105
+
106
+ On a board that holds a `.node`, the geometry check reads three facts:
107
+
108
+ - `.node` and `.panel` carry inline `left`, `top`, `width` and `height` in px.
109
+ - Each edge is a `<path>` of `M`, `H`, `V` and `L` commands in board
110
+ coordinates. Any other command is a usage error. A path inside `<defs>` is
111
+ a marker.
112
+ - Each `.elabel` carries inline `left` and `top`. Its box is 7 px per
113
+ character wide and 16 px high.
114
+
115
+ `line_end_open`: the first or last point of a path is more than 8 px from the
116
+ border of every `.node` and `.panel`.
117
+
118
+ `line_through_box`: a path segment has a point inside a `.node` that is more
119
+ than 8 px from the nearest border of that node. A zero-length segment is tested
120
+ as a point. Path ends have no special case: an end more than 8 px inside a node
121
+ gives `line_end_open` and `line_through_box`. A node at most 16 px wide or high
122
+ gets no `line_through_box`, and a line that stays within 8 px of a border gets
123
+ none.
124
+
104
125
  ## Quality checks
105
126
 
106
127
  - No two boxes overlap unless one contains the other.