repo-harness 0.35.1 → 0.36.1

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 (177) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/README.md +1 -1
  4. package/agents/fleet/deep-reasoner.md +2 -2
  5. package/agents/fleet/explorer.md +4 -4
  6. package/assets/reference-configs/agentic-development-flow.md +12 -7
  7. package/assets/reference-configs/external-tooling.md +106 -38
  8. package/assets/reference-configs/global-working-rules.md +2 -1
  9. package/assets/reference-configs/herdr-notify.md +39 -33
  10. package/assets/reference-configs/hook-operations.md +6 -4
  11. package/assets/released-managed-values.v1.json +3 -1
  12. package/assets/review-hazards.v1.json +7 -2
  13. package/assets/skill-commands/repo-harness-check/references/architecture-evidence.md +34 -16
  14. package/assets/skill-version.json +2 -2
  15. package/assets/skills/repo-harness-advisor/SKILL.md +19 -0
  16. package/assets/skills/repo-harness-issue-flow/SKILL.md +15 -17
  17. package/assets/skills/repo-harness-issue-flow/references/acceptor.md +84 -28
  18. package/assets/skills/repo-harness-issue-flow/references/advisor.md +133 -18
  19. package/assets/skills/repo-harness-issue-flow/references/board.md +9 -7
  20. package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +178 -88
  21. package/assets/skills/repo-harness-issue-flow/references/templates.md +37 -10
  22. package/assets/skills/repo-harness-issue-flow/references/worker.md +45 -50
  23. package/dist/hook-entry.js +8168 -5797
  24. package/dist/oar-review-host.js +314 -41
  25. package/install.ps1 +51 -2
  26. package/install.sh +44 -4
  27. package/package.json +4 -4
  28. package/scripts/check-agent-tooling.sh +1 -1
  29. package/scripts/check-ci.sh +2 -2
  30. package/scripts/check-tarball-install-smoke.sh +31 -3
  31. package/scripts/contract-worktree-runtime.ts +3 -0
  32. package/scripts/contract-worktree.sh +21 -56
  33. package/scripts/install-agent-fleet.sh +12 -8
  34. package/scripts/sync-reference-configs.ts +7 -0
  35. package/src/cli/candidate-runtime-reconciliation.ts +146 -0
  36. package/src/cli/commands/adoption-plan.ts +41 -17
  37. package/src/cli/commands/arch-verify.ts +5 -22
  38. package/src/cli/commands/arch.ts +1 -1
  39. package/src/cli/commands/architecture-debt-report.ts +14 -222
  40. package/src/cli/commands/architecture-debt.ts +2 -1
  41. package/src/cli/commands/architecture-projection-actions.ts +65 -4
  42. package/src/cli/commands/architecture-projection.ts +5 -0
  43. package/src/cli/commands/board.ts +250 -11
  44. package/src/cli/commands/candidate-reconciliation.ts +28 -3
  45. package/src/cli/commands/config.ts +151 -0
  46. package/src/cli/commands/doctor.ts +41 -2
  47. package/src/cli/commands/global-runtime.ts +226 -232
  48. package/src/cli/commands/install.ts +144 -7
  49. package/src/cli/commands/publication.ts +5 -0
  50. package/src/cli/commands/refactor-actions.ts +89 -5
  51. package/src/cli/commands/refactor.ts +169 -20
  52. package/src/cli/commands/review.ts +9 -3
  53. package/src/cli/commands/rules.ts +24 -4
  54. package/src/cli/commands/seats.ts +353 -83
  55. package/src/cli/commands/status.ts +9 -2
  56. package/src/cli/commands/upgrade-registered.ts +7 -10
  57. package/src/cli/commands/upgrade.ts +38 -70
  58. package/src/cli/commands/validators.ts +13 -8
  59. package/src/cli/hook/handler-registry.ts +7 -4
  60. package/src/cli/hook/hook-protocol.ts +2 -2
  61. package/src/cli/hook/host-adapter.ts +145 -0
  62. package/src/cli/hook/mutation-guard.ts +14 -5
  63. package/src/cli/hook/route-registry.ts +4 -2
  64. package/src/cli/hook/runtime.ts +49 -27
  65. package/src/cli/hook/safety-hook.ts +13 -18
  66. package/src/cli/hook/stop-handler.ts +73 -17
  67. package/src/cli/hook-entry.ts +23 -7
  68. package/src/cli/index.ts +102 -655
  69. package/src/cli/installer/global-context.ts +67 -21
  70. package/src/cli/installer/install-profile.ts +185 -203
  71. package/src/cli/installer/install-state-migration.ts +60 -30
  72. package/src/cli/installer/install-state.ts +34 -15
  73. package/src/cli/installer/json-config-migration.ts +122 -28
  74. package/src/cli/installer/managed-entries.ts +57 -11
  75. package/src/cli/installer/pi-package.ts +126 -18
  76. package/src/cli/installer/replaced-agents-migration.ts +6 -5
  77. package/src/cli/installer/repository-excludes.ts +83 -83
  78. package/src/cli/installer/targets/antigravity.ts +564 -0
  79. package/src/cli/installer/targets/claude.ts +21 -3
  80. package/src/cli/installer/targets/registry.ts +9 -16
  81. package/src/cli/installer/types.ts +39 -14
  82. package/src/cli/installer/uninstall.ts +285 -112
  83. package/src/cli/runtime-transaction.ts +399 -0
  84. package/src/core/adoption/rollback.ts +4 -4
  85. package/src/core/architecture/arch-verify.ts +1 -1
  86. package/src/core/architecture/projection.ts +74 -14
  87. package/src/core/board/attention.ts +68 -14
  88. package/src/core/board/board.ts +15 -14
  89. package/src/core/board/cluster.ts +682 -0
  90. package/src/core/board/dispatch.ts +129 -39
  91. package/src/core/board/hazards.ts +81 -13
  92. package/src/core/board/merge.ts +17 -13
  93. package/src/core/board/model-catalog.ts +263 -0
  94. package/src/core/board/plan-block.ts +35 -17
  95. package/src/core/board/planner-consult.ts +79 -0
  96. package/src/core/board/post.ts +3 -3
  97. package/src/core/board/protocol-comments.ts +25 -6
  98. package/src/core/board/quota.ts +61 -6
  99. package/src/core/board/recommended-models.ts +93 -0
  100. package/src/core/board/retro.ts +208 -0
  101. package/src/core/board/review-rules.ts +109 -32
  102. package/src/core/board/review.ts +81 -43
  103. package/src/core/board/seat-launch.ts +200 -29
  104. package/src/core/board/seat-pool.ts +243 -0
  105. package/src/core/board/seat-reset.ts +23 -8
  106. package/src/core/board/seat-routing.ts +118 -69
  107. package/src/core/board/seats-settings.ts +367 -86
  108. package/src/core/board/triage-apply.ts +405 -0
  109. package/src/core/ci/rule-proposals.ts +221 -0
  110. package/src/core/host-config/json-fragment.ts +5 -4
  111. package/src/core/host-config/marked-block.ts +25 -12
  112. package/src/core/host-config/override.ts +41 -0
  113. package/src/core/host-config/path-entry.ts +55 -0
  114. package/src/core/host-config/registry.ts +16 -2
  115. package/src/core/host-config/types.ts +93 -5
  116. package/src/core/operator/architecture-map-model.ts +11 -4
  117. package/src/core/operator/architecture-map.ts +12 -1
  118. package/src/core/operator/architecture.ts +92 -1
  119. package/src/core/publication/merge-readiness.ts +8 -0
  120. package/src/core/refactor/provider-contract.ts +117 -19
  121. package/src/core/review/model-family.ts +1 -0
  122. package/src/core/review/module-review-prompt.ts +16 -0
  123. package/src/core/review/review-publish.ts +5 -2
  124. package/src/effects/adoption/standard-plan.ts +9 -22
  125. package/src/effects/architecture/archctx-provider.ts +125 -8
  126. package/src/effects/architecture/architecture-read.ts +50 -64
  127. package/src/effects/architecture/model-reader.ts +35 -6
  128. package/src/effects/artifact-retention.ts +5 -2
  129. package/src/effects/board/closeout.ts +9 -1
  130. package/src/effects/board/cluster.ts +353 -0
  131. package/src/effects/board/collect.ts +54 -29
  132. package/src/effects/board/dispatch.ts +38 -17
  133. package/src/effects/board/lifecycle-index.ts +143 -0
  134. package/src/effects/board/pi-fleet-roles.ts +24 -17
  135. package/src/effects/board/planner-consult.ts +195 -0
  136. package/src/effects/board/quota.ts +33 -5
  137. package/src/effects/board/review.ts +13 -6
  138. package/src/effects/board/seat-reset-store.ts +71 -21
  139. package/src/effects/board/seat-reset.ts +81 -28
  140. package/src/effects/board/seats-configuration.ts +300 -53
  141. package/src/effects/board/triage-apply.ts +283 -0
  142. package/src/effects/configuration/agents-configuration.ts +36 -0
  143. package/src/effects/fs-transaction.ts +315 -513
  144. package/src/effects/git/repository-identity.ts +6 -0
  145. package/src/effects/host-config/delegated.ts +152 -0
  146. package/src/effects/host-config/gate.ts +1473 -185
  147. package/src/effects/host-config/inspect.ts +249 -0
  148. package/src/effects/host-config/path-records.ts +87 -57
  149. package/src/effects/host-config/repository.ts +193 -0
  150. package/src/effects/host-config/store.ts +158 -27
  151. package/src/effects/host-config/tools.ts +314 -0
  152. package/src/effects/host-config/whole-path.ts +77 -10
  153. package/src/effects/host-skill-roots.ts +5 -0
  154. package/src/effects/operator/agents-settings-route.ts +4 -0
  155. package/src/effects/operator/architecture-map-worker.ts +82 -27
  156. package/src/effects/operator/architecture.ts +93 -1
  157. package/src/effects/operator/seats-settings-route.ts +17 -4
  158. package/src/effects/operator/server.ts +13 -2
  159. package/src/effects/publication/merge-readiness.ts +38 -11
  160. package/src/effects/refactor/archctx-provider.ts +174 -20
  161. package/src/effects/refactor/recommendations.ts +135 -48
  162. package/src/effects/review/acceptance-receipt-store.ts +52 -98
  163. package/src/effects/review/acceptance-receipt.ts +29 -21
  164. package/src/effects/review/magpie-endpoint.ts +1 -1
  165. package/src/effects/review/review-collect.ts +7 -3
  166. package/src/effects/review/review-publish.ts +5 -3
  167. package/src/effects/rules/proposals.ts +157 -0
  168. package/src/effects/self-ignoring-directory.ts +67 -0
  169. package/src/effects/skill-tree-integrity.ts +2 -126
  170. package/src/effects/state/coordination-worktree-topology.ts +98 -8
  171. package/src/effects/terminal/task-role-profiles.ts +2 -15
  172. package/src/effects/upgrade/repository-hooks.ts +78 -0
  173. package/src/pi/extension.ts +58 -4
  174. package/agents/fleet/deep-worker.md +0 -15
  175. package/agents/fleet/fast-worker.md +0 -15
  176. package/agents/fleet/gatekeeper.md +0 -24
  177. package/agents/fleet/root-cause-prover.md +0 -23
package/AGENTS.md CHANGED
@@ -13,7 +13,7 @@
13
13
  - Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
14
14
  - Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No plan, contract, review, notes or approval artifact is mandatory. Record a one-time decision in the issue.
15
15
  - GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
16
- - Preserve `agents/fleet/`, release checklists and downstream `assets/templates`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract. `_ops/` is ignored private operations state: never commit it. It has no per-directory allowlist and no Bash write denial; I2 covers any existing file in it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
16
+ - Preserve the retained read-only `agents/fleet/` scaffolding (`explorer`, `deep-reasoner`), release checklists and downstream `assets/templates`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract. `_ops/` is ignored private operations state: never commit it. It has no per-directory allowlist and no Bash write denial; I2 covers any existing file in it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
17
17
 
18
18
  ## Code Optimization Principles
19
19
  - Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
package/CLAUDE.md CHANGED
@@ -13,7 +13,7 @@
13
13
  - Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
14
14
  - Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No plan, contract, review, notes or approval artifact is mandatory. Record a one-time decision in the issue.
15
15
  - GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
16
- - Preserve `agents/fleet/`, release checklists and downstream `assets/templates`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract. `_ops/` is ignored private operations state: never commit it. It has no per-directory allowlist and no Bash write denial; I2 covers any existing file in it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
16
+ - Preserve the retained read-only `agents/fleet/` scaffolding (`explorer`, `deep-reasoner`), release checklists and downstream `assets/templates`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract. `_ops/` is ignored private operations state: never commit it. It has no per-directory allowlist and no Bash write denial; I2 covers any existing file in it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
17
17
 
18
18
  ## Code Optimization Principles
19
19
  - Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
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.35.1` · workflow stamp `repo-harness@0.35.1+template@0.35.1`
334
+ - npm: `repo-harness@0.36.1` · workflow stamp `repo-harness@0.36.1+template@0.36.1`
335
335
  - History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
336
336
  - License: MIT — see [`LICENSE`](LICENSE)
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: deep-reasoner
3
- description: Architecture research and judgment executor on Opus at xhigh effort. Use for architecture proposals, complex multi-step reasoning, and high-risk analysis — design trade-offs, risky migrations, security-sensitive choices; returns `RECOMMENDATION: <one-line> — confidence: HIGH/MEDIUM/LOW` with the reasoning, and the orchestrator confirms the final framework. Not for routine execution; use fast-worker for that.
3
+ description: Architecture research and judgment executor on Opus at xhigh effort. Use for architecture proposals, complex multi-step reasoning, and high-risk analysis — design trade-offs, risky migrations, security-sensitive choices; returns `RECOMMENDATION: <one-line> — confidence: HIGH/MEDIUM/LOW` with the reasoning, and the orchestrator confirms the final framework. Not for routine execution; a worker seat does that.
4
4
  model: opus
5
5
  effort: xhigh
6
6
  ---
7
7
 
8
8
  You are the executor for architecture research and hard judgment. An orchestrator delegates investigation, design proposals, trade-off analysis, and high-risk calls — design trade-offs, risky migrations, security-sensitive choices — and you research and recommend. You never present your proposal as the decision; the orchestrator confirms the final framework.
9
9
 
10
- - **Recommendation first.** Your final message opens with exactly: `RECOMMENDATION: <one sentence> — confidence: HIGH|MEDIUM|LOW`. The one-liner is your single committed answer; confidence tells the orchestrator how far to trust it before acting — `LOW` is a cue to run a second, independent track. If the task is actually routine execution, make the one-liner `hand back to orchestrator — route to fast-worker` at confidence HIGH.
10
+ - **Recommendation first.** Your final message opens with exactly: `RECOMMENDATION: <one sentence> — confidence: HIGH|MEDIUM|LOW`. The one-liner is your single committed answer; confidence tells the orchestrator how far to trust it before acting — `LOW` is a cue to run a second, independent track. If the task is actually routine execution, make the one-liner `hand back to orchestrator — routine execution goes to a worker seat` at confidence HIGH.
11
11
  - **Reason to one answer.** Think the problem through before answering. At genuinely contested points, weigh 2-3 viable options with their trade-offs, then commit to one — do not hedge across all of them.
12
12
  - **Ground every claim in evidence.** Read the actual code and constraints and verify instead of assuming. State a load-bearing claim plainly only if you checked it this turn (its command output or the file is in your context); otherwise mark it `[inferred]` (reasoned but unchecked) or `[unverified]` (needs a check you could not run).
13
13
  - **Recommend only — no side effects.** You investigate and advise; you do not decide, ship, or edit production code, and you do not commit, push, open PRs, or apply migrations. Read, grep, web search/fetch, and docs MCP lookups are in scope; any mutation is the orchestrator's call.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: explorer
3
- description: Read-only codebase explorer on Sonnet at medium effort. Use to locate files, symbols, call paths, tests, uncertainties, and candidate affected surfaces before implementation or judgment. Returns `FINDINGS: COMPLETE/PARTIAL/BLOCKED` with file:line evidence; never edits, decides architecture, or judges acceptance — hand the map to fast-worker, deep-reasoner, or gatekeeper.
3
+ description: Read-only codebase explorer on Haiku at high effort. Use to locate files, symbols, call paths, tests, uncertainties, and candidate affected surfaces before implementation or judgment. Returns `FINDINGS: COMPLETE/PARTIAL/BLOCKED` with file:line evidence; never edits, decides architecture, or judges acceptance — return the map to the caller; execution runs in a worker seat and acceptance in a review seat.
4
4
  tools: ["Read", "Grep", "Glob", "Bash"]
5
- model: sonnet
6
- effort: medium
5
+ model: haiku
6
+ effort: high
7
7
  ---
8
8
 
9
9
  You are the read-only explorer. An orchestrator hands you a question or task surface; you map the concrete repository evidence it needs and return. You do not edit, decide architecture, or judge acceptance.
@@ -11,7 +11,7 @@ You are the read-only explorer. An orchestrator hands you a question or task sur
11
11
  - **Findings first.** Your final message opens with exactly one of `FINDINGS: COMPLETE`, `FINDINGS: PARTIAL`, `FINDINGS: BLOCKED` — COMPLETE = every requested surface is mapped with cited evidence; PARTIAL = you mapped what you could but scope or access stopped you short; BLOCKED = the question is unanswerable without a decision only the orchestrator can make.
12
12
  - **Scope through the repo's own context before searching blind.** If the repo publishes a capability, ownership, or context map (e.g. a `CLAUDE.md`/`AGENTS.md` local to the area, or an explicit context index), check it first for the entrypoint and boundary that cover the question — it keeps you from mapping outside the relevant surface.
13
13
  - **Prefer structural code-intelligence tools over grep loops.** Reach for the CodeGraph MCP tool (or an equivalent code-intelligence/graph index) when one is available — it returns verbatim source plus call and dependency paths in far fewer round-trips than a manual Grep/Read sweep. Fall back to Grep/Glob/Read only when no such index exists or the question falls outside its coverage.
14
- - **Map, don't judge.** Identify relevant files and symbols, call and dependency paths, existing tests, and candidate affected surfaces. Flag contradictions or gaps as uncertainties instead of resolving them — architecture calls go to deep-reasoner, execution to fast-worker, acceptance to gatekeeper.
14
+ - **Map, don't judge.** Identify relevant files and symbols, call and dependency paths, existing tests, and candidate affected surfaces. Flag contradictions or gaps as uncertainties instead of resolving them — architecture calls go to deep-reasoner, execution to the caller's worker seat, acceptance to a review seat.
15
15
  - **Cite or mark unknown.** Every claim needs an absolute `file:line` reference or a command's actual output from this turn; otherwise label it `[inferred]` (reasoned but unchecked) or `[unverified]` (needs a check you could not run). Never state a load-bearing fact you have not checked this turn.
16
16
  - **Stay read-only and in scope.** No edits, no commits, no architecture recommendation, no acceptance verdict, no widening the question beyond what was asked. If the question turns out to need a decision, return `FINDINGS: BLOCKED` with what you found instead of deciding yourself.
17
17
  - **Sign-off.** Lead with the `FINDINGS:` line, then the evidence map: files/symbols with `file:line`, call/dependency paths when relevant, existing test coverage, uncertainties, and candidate affected surfaces. No process narration.
@@ -10,7 +10,7 @@
10
10
  3. Make small, bounded commits. Ordinary tasks live in the PR description: goal, changes, verification, risk and rollback.
11
11
  4. Freeze the candidate and verify once: typecheck plus affected tests. Reviewers and closeout consume the same evidence. Reopen acceptance only for blocking defects or changed inputs that affect the result. Record non-blocking improvements separately; do not change the frozen candidate for them.
12
12
  5. A model may squash-merge into main only when the current task explicitly authorizes main publication, the branch contains the current main tip, the required checks pass on that exact head, and GitHub has no outstanding change requests or unresolved review threads that a person started. A thread that a review bot (a GitHub App account such as Codex or Copilot) started is advisory and does not block the merge. An explicit no-merge instruction always wins. The next merge does not wait for the main push CI of the previous merge. Pending main push CI is not an extra acceptance gate. Read its status before the next merge; when it fails, the next merge is the revert or the fix. Each PR still meets its own exact-head and current-main requirements. Record the GitHub merge SHA and parent SHA. Record `git revert --no-edit <squash-commit>`. Do not create rollback tags.
13
- 6. Run the full suite daily, automatically open a repair task on failure, and produce the daily merge/check/rollback report. Run the [Lessons Retro](#lessons-retro) in the same nightly window.
13
+ 6. Run the full suite daily, automatically open a repair task on failure, and produce the daily merge/check/rollback report. This nightly run does not start the [Lessons Retro](#lessons-retro); that retro has its own trigger events.
14
14
  7. Use the [Report SOP](#report-sop) for formal progress, phase and final reports to the user, including the daily user summary. Raw automated CI reports are evidence inputs; they do not replace that summary and do not require this format.
15
15
 
16
16
  ## CI cost
@@ -52,7 +52,10 @@ Manual probe: to see what named test files do on one runner for a branch head, d
52
52
  `tasks/lessons.md` is the one lessons ledger. It has the role of a root `LESSONS.md`. Do not add a second lessons file. The retro and maintenance triage read the ledger. Sessions read its active lessons at start. Current code and evidence take precedence. Keep the path; do not move lessons to docs/.
53
53
 
54
54
  - The ledger keeps one watermark line before the first entry: `reviewed-through: <full commit SHA>`. If the line is missing, the first retro reviews the last 24 hours and adds it.
55
- - Each night, review the default-branch history after the watermark: `git log --first-parent <watermark>..origin/main`. Skip commits that change only `tasks/lessons.md`.
55
+ - Two events start a retro: the close-out of a batch parent (`repo-harness-issue-flow` `references/orchestrator.md` §10) and a release that shipped. No timer and no workflow starts one.
56
+ - The orchestrator starts the retro and dispatches a worker for the ledger PR. The advisor checks the watermark in its scheduled review (`repo-harness-issue-flow` `references/advisor.md` §2) and sends the orchestrator a notice when the fallback condition holds.
57
+ - Fallback: a retro is due when the watermark commit is older than 7 days or more than 100 first-parent commits behind `origin/main`. Either threshold alone makes the retro due.
58
+ - Review the default-branch history after the watermark: `git log --first-parent <watermark>..origin/main`. Skip commits that change only `tasks/lessons.md`.
56
59
  - Look for three signals: a fix that repairs recent work, a change that should not have merged, and verification that was too thin for the changed behavior. A revert or a follow-up hotfix is evidence.
57
60
  - Add at most one entry for each theme on one day. Keep the fields that `rh run maintenance-triage` reads. `- Date:` starts each entry:
58
61
 
@@ -86,6 +89,7 @@ Manual probe: to see what named test files do on one runner for a branch head, d
86
89
  - At `Seen: 3×` with `Enforced by: judgment`, promote the prevention rule into root `AGENTS.md` and root `CLAUDE.md` in the same PR. Add `- Promoted: <PR>` to that entry. A consolidated entry lists every `Promoted` reference of the entries it replaces, separated by `, `. A rule with a structural enforcer does not go into the root files.
87
90
  - When the mistake can no longer occur, delete its text rule from the agent instruction files. Keep its ledger entries.
88
91
  - Each retro advances the watermark to the last reviewed commit, also when it finds no lesson. If an earlier retro PR is still open, update that PR. Do not open a second retro PR.
92
+ - Reset: with the owner GO for the PR head, a PR may set `reviewed-through` to a named commit without a review of the skipped range. That PR body states the old watermark, the new watermark, the number of skipped first-parent commits and the reason. The GO rule below is unchanged.
89
93
  - Every change to `tasks/lessons.md` goes through a PR and merges only after GO. GO is an explicit go-ahead from the repository owner (Aimpact for repo-harness) for one reviewed head SHA. Task-level publication authorization does not replace it. Merge with `gh pr merge <pr> --squash --match-head-commit <reviewed-sha>`. Lessons are not task logs. Ordinary tasks record a one-time decision in the issue or PR. A correction in a task can add an entry; that entry follows the same PR and GO rule.
90
94
 
91
95
  ## Internal and external PRs
@@ -117,10 +121,9 @@ The orchestrator seat is the long-lived coordinator and integrator seat of
117
121
  `repo-harness-issue-flow`. Start it with the argv that
118
122
  `rh seats argv orchestrator` prints. It dispatches work and follows
119
123
  PRs and CI. It edits no product code. It may call the read-only roles
120
- `explorer` and `deep-reasoner` as sub-agents. The gatekeeper, the writers
121
- (`fast-worker`, `deep-worker`, `root-cause-prover`) and the Codex
122
- cross-review never run as its sub-agents: they run in Herdr seats, for
123
- worktree isolation and one writer per file.
124
+ `explorer` and `deep-reasoner` as sub-agents. Writes, the gatekeeper review
125
+ and the Codex cross-review never run as its sub-agents: they run in Herdr
126
+ seats, for worktree isolation and one writer per file.
124
127
 
125
128
  The bot selects scope, worker and verification by risk. Use independent gatekeeper/cross-model review for large changes, I1/I2 paths or model uncertainty; do not rerun a passing check or require multiple re-gates.
126
129
 
@@ -133,9 +136,11 @@ The board rule R3 reads only the rows with `path_visible: true`: a changed path
133
136
 
134
137
  | Hazard | Paths that R3 reads |
135
138
  | --- | --- |
136
- | Changes a workflow or other CI configuration under `.github/` where it changes secrets or permissions. | `.github/**` |
139
+ | Changes a workflow or other CI configuration under `.github/`. | `.github/**` |
137
140
  | Changes a release, publish, update or install script, or a package script that runs at install or release. | None (`path_visible: false`) |
138
141
  | Reads credentials, such as tokens, keys, `~/.ssh`, `~/.npmrc` or credential environment variables. | None (`path_visible: false`) |
142
+
143
+ R3 and the tier skip a `ci-config` hit on a modified file that matches `.github/workflows/*.yml` or `.github/workflows/*.yaml` when every YAML key that the diff changes is on or under `jobs.*.timeout-minutes`, `jobs.*.steps.*.timeout-minutes`, `on.*.paths` or `on.*.paths-ignore` (`*` matches one key or list index). The board reads the file at the merge base and the head commit. A cleared edit is at least Medium. An added, removed or renamed file, another changed key, and a failed read or parse stay High.
139
144
  <!-- review-hazards:list:end -->
140
145
 
141
146
  ### Review by risk
@@ -7,7 +7,7 @@ skill routing lives in `docs/reference-configs/agentic-development-flow.md`.
7
7
  - `hai-stack` supplies `geju` for live, pre-contract exploration; only its frozen output enters a contract
8
8
  - Codex automation requires `health`, `check`, and `mermaid` from `~/.codex/skills`
9
9
  - `CodeGraph` is required agent readiness for code navigation and impact tracing
10
- - repo-harness's packaged `agent_fleet` supplies the delegation loop's global agent definitions (`explorer`, `deep-reasoner`, `fast-worker`, `gatekeeper`, `root-cause-prover`, `harness-evaluator`) for both hosts
10
+ - repo-harness's packaged `agent_fleet` supplies the delegation loop's global agent definitions (`explorer`, `deep-reasoner`, `harness-evaluator`) for both hosts
11
11
 
12
12
  Waza is Codex-first in this contract. `~/.codex/skills` is the Codex runtime
13
13
  source, while `~/.agents/skills` is only the skills CLI staging/cache path used
@@ -47,12 +47,43 @@ is still as rh wrote it, and the other entries stay and are reported. Sibling ho
47
47
  configuration keys, user-edited surfaces and vault contents remain. It does not
48
48
  activate a runtime.
49
49
 
50
- Unproven old configuration, malformed configuration, changed owned surfaces and an
51
- edited managed block (the Global Working Rules block or the runtime-state ignore block)
52
- are reported as `unresolved`; the file stays unchanged, the command exits nonzero with
53
- `status: partial` and keeps remaining ownership evidence. Codex hook trust entries in
54
- `[hooks.state]` give a `note`: rh does not remove them, and they do not block
55
- completion. A preserved shared/pre-existing
50
+ Each item has one action. `restored`: the result was checked equal to the file
51
+ before rh (sha256, or absence). `reverted`: rh's changes went with no such proof;
52
+ for a file that an earlier rh version wrote, the reason says that equality with the
53
+ file before install cannot be proved. `kept`: rh leaves it. `note`: nothing to do,
54
+ for example a file that the user deleted. Unproven old configuration, malformed
55
+ configuration, changed owned surfaces and an edited managed block (the Global Working
56
+ Rules block or the runtime-state ignore block) are reported as `unresolved`; the file
57
+ stays unchanged, the command exits 1 with `status: partial` and keeps remaining
58
+ ownership evidence. `failed` (`host_config_restore_mismatch`): the reverted bytes
59
+ would not equal the known file before rh, so rh writes nothing, keeps the ledger
60
+ record and its vault copy, and exits 2 with `status: failed`. Codex hook trust
61
+ entries in `[hooks.state]` give a `note`: rh does not remove them, and they do not
62
+ block completion. `--remove-edited-block <path>` (repeatable) removes the Global
63
+ Working Rules block of that rules file also when you edited it: the whole file goes
64
+ to the vault first, and the item prints the copy's path; `rh config gc` never
65
+ deletes that copy.
66
+
67
+ `rh config status` prints the path, sha256 and state of each file, fragment and path
68
+ that the ledger records, `baseline unknown` for a file that an earlier rh version
69
+ wrote, and old `global-context-backups/*.bak` files as candidates that rh does not
70
+ use. `rh config diff <path>` prints rh's fragments of one file by hash;
71
+ `--show-values` adds only text that the ledger proves rh wrote, and prints any other
72
+ value as `<user value, N bytes, sha256:...>`. `rh config restore <path> [--owner
73
+ <id>]` reverts one file, or one owner's fragments, with the same actions and exit
74
+ codes as uninstall. `rh init` and `rh upgrade` strip retired rh hooks from a
75
+ repository's `.claude/settings.json` and `.codex/hooks.json` through a repository
76
+ ledger in `~/.repo-harness/config/repos/<key>/`, one per clone; it keeps the whole
77
+ file before the strip, and no copy goes into the working tree. `rh config restore
78
+ [<path>] --repo <dir>`, with `<dir>` the worktree root that holds `.git`, puts back
79
+ the recorded files of that worktree while each still holds the bytes that rh wrote. A
80
+ file below a link or below a nested checkout stays, with its reason. Copies of user
81
+ files wait in self-ignoring directories (a `.gitignore` with `*`), never beside the
82
+ target. With no record it stops with
83
+ `host_config_repository_unrecorded`. `rh uninstall` does not revert a repository
84
+ record. `rh config gc` deletes the vault copy of each finished revert in the user
85
+ ledger 30 days after it, while no record references it. Status and diff create no vault or lock;
86
+ on a ledger of an older protocol they name `rh update`. A preserved shared/pre-existing
56
87
  third-party installation is not claimed as repo-harness-owned.
57
88
 
58
89
  Standalone CodeGraph configuration and global install/update share one host lock.
@@ -62,6 +93,17 @@ archives and runtime history remain. Repository unadoption and package removal a
62
93
  separate operations; this command does not enumerate other repositories or remove
63
94
  third-party packages. Remove the CLI package only after configuration cleanup.
64
95
 
96
+ `rh install` and `rh update` take `--override <path>#<selector>` (repeatable):
97
+ rh writes its value at that fragment also over a value that it did not write,
98
+ and the gate keeps the file before the write in the vault. rh checks every
99
+ entry before any write and refuses one that no writer of the run can take; today
100
+ the Claude `settings.json` writers take a selection. A candidate package that
101
+ does not echo the selection in its receipt fails the update step.
102
+ `rh install --dry-run` and `rh update --dry-run` list each planned host-config
103
+ item as `add`, `refresh`, `override` or a skip code, with paths and selectors
104
+ only, and name the writers that they do not list yet. `rh update --dry-run`
105
+ starts no package install.
106
+
65
107
  `rh update` is a reconciliation command, not a best-effort package
66
108
  install. It verifies the installed package's exact `archctx` and
67
109
  `archctx-contracts` dependencies, package-local CodeGraph, compatible ArchContext
@@ -102,14 +144,14 @@ current content hash matches. A changed file is reported again as a stale
102
144
  decision. `keep` moves the item to `operatorKept`; it no longer counts as a
103
145
  leftover. `remove` is valid only for a regular file that is not a document with
104
146
  a retired-path reference. `upgrade --scope project --apply` then removes it
105
- through the project backup and rollback manifest. An invalid decision file
147
+ through the run's project backup. An invalid decision file
106
148
  fails the project upgrade.
107
149
 
108
150
  `upgrade --apply` backs up eligible targets and checks ownership again before
109
151
  removal. It keeps current global typed adapters, sibling user hooks, changed
110
152
  files, and files without proof. Apply exits 1 on failure and restores its target
111
- snapshots. Backup manifests list original paths. Project transactions use
112
- `rh init rollback`; global backups require manual target replacement from each snapshot.
153
+ snapshots. A completed run deletes its project copies. Global backup manifests
154
+ list original paths; a global backup needs manual target replacement from each snapshot.
113
155
  Do not overlay directory contents. Restore symlinks verbatim.
114
156
 
115
157
  Global upgrade backups stay in `~/.repo-harness/transactions/install-*`.
@@ -354,7 +396,18 @@ step edits no shell profile: it prints a hint when `~/.local/bin` is not on
354
396
  PATH, and `setup check` reports hc missing until the user adds it. On every
355
397
  platform, when the directory is not on the PATH of the run, the run puts it
356
398
  first on the PATH of its later steps, so the Herdr skill step reads the new hc.
357
- `rh uninstall` keeps hc and its PATH entry.
399
+ `rh uninstall` keeps hc and its PATH entry. `rh uninstall --with-tools` (only
400
+ with `--target both`) also removes each herdr-core file and link that is still
401
+ the object that rh wrote and holds the bytes that rh recorded, the empty
402
+ directories that rh created, and the PATH
403
+ entry while it is still the one recorded text in the recorded value kind; it
404
+ keeps every other entry of the value. A changed entry stays and is reported
405
+ `unresolved`. One ledger write releases every claim before the first removal,
406
+ so an entry that a failed removal leaves (on Windows, a running `hc.exe`) is no
407
+ longer rh's: stop hc and remove it by hand. rh does not remove the Windows
408
+ `conpty` directory: the run releases its record and reports it `kept`, and
409
+ the user removes it by hand. An hc that existed before the
410
+ install is never recorded and never removed. No command removes Bun.
358
411
 
359
412
  The step never overwrites an existing install file. A sha256 mismatch, a failed
360
413
  download, an archive without a complete hc (on Windows, `conpty\conpty.dll`), a
@@ -528,6 +581,30 @@ When a project builds on the Claude API, an agent can read
528
581
  `anthropics/claude-quickstarts` as reference code. Cite the upstream commit
529
582
  that the agent followed.
530
583
 
584
+ ## magpie for AI subscriptions and API keys
585
+
586
+ [magpie](https://github.com/yetone/magpie) is a desktop app and a local gateway
587
+ for AI subscriptions and API keys. If you use more than one subscription or
588
+ key, you can manage them in magpie and use its routes from Pi. Download magpie
589
+ from [usemagpie.ai](https://usemagpie.ai). Repo-harness does not install or
590
+ update it.
591
+
592
+ | The user has | Recommended route in rh | Not recommended |
593
+ | --- | --- | --- |
594
+ | Claude subscription | The Claude CLI only, in a Claude seat | A Claude subscription through magpie |
595
+ | Claude models inside another harness (Pi) | The magpie `agy-cli/claude-*` models on the Google Ultra quota | Never use the Claude subscription |
596
+ | Claude API key | The magpie Anthropic preset from Pi | — |
597
+ | Antigravity (agy) | The magpie `agy-cli/` models from Pi. Your own agy CLI makes the calls. | The direct Google sign-in route |
598
+ | ChatGPT plan, DeepSeek, GLM, or other providers | magpie routes from Pi (`magpie/codex/`, `magpie/group/`, `magpie/zcode/`) or the vendor CLI | — |
599
+
600
+ The magpie README lists Antigravity “through your own agy CLI.” Its reference
601
+ says the direct Google sign-in route uses Google’s Code Assist API and warns,
602
+ “Google may suspend an Antigravity account it sees used outside Antigravity,
603
+ so magpie asks before adding one; use an account you can afford to lose.”
604
+ The same reference says magpie “drives the genuine local `claude` binary for
605
+ every Claude subscription generation.” Check your provider’s terms for the
606
+ route you select. [magpie reference](https://github.com/yetone/magpie/blob/main/docs/reference.md)
607
+
531
608
  ## External Verification Evidence
532
609
 
533
610
  Runtime-heavy projects often prove work outside normal source files and unit
@@ -670,7 +747,7 @@ diff -qr ~/.agents/skills/geju ~/.codex/skills/geju
670
747
  ### CodeGraph
671
748
 
672
749
  ```bash
673
- bun add -g @colbymchenry/codegraph@1.6.2 && codegraph sync . && codegraph status .
750
+ bun add -g @colbymchenry/codegraph@1.6.4 && codegraph sync . && codegraph status .
674
751
  ```
675
752
 
676
753
  ## Agent Fleet
@@ -679,8 +756,15 @@ bun add -g @colbymchenry/codegraph@1.6.2 && codegraph sync . && codegraph status
679
756
  `.ai/harness/policy.json` under `external_tooling.agent_fleet` and detected by
680
757
  `check-agent-tooling.sh`. The single authored source is
681
758
  `package:agents/fleet`; it ships inside the npm package and never requires a
682
- network fetch. The managed list is `explorer`, `deep-reasoner`, `fast-worker`,
683
- `deep-worker`, `gatekeeper`, `root-cause-prover`, and `harness-evaluator`.
759
+ network fetch. The managed list is `explorer`, `deep-reasoner` and
760
+ `harness-evaluator`.
761
+
762
+ In-process sub-agent work serves cost control and read-only concurrency only,
763
+ such as an `explorer` fan-out. Each harness maps it to its own lightweight
764
+ family model: `claude` uses `haiku`/`sonnet`, `codex` uses
765
+ `gpt-6-luna`/`gpt-6.1-terra`, `agy`/Gemini uses
766
+ `gemini-4-carbon`/`gemini-4-neon`, and `pi` uses its configured setting. Code
767
+ writes, cross-family planning and formal acceptance reviews run in Herdr seats.
684
768
 
685
769
  ### Two targets, one source
686
770
 
@@ -705,25 +789,17 @@ mapping.
705
789
  | `sonnet`, `haiku` | `gpt-6-luna` | `low`, `medium`, `high`, `xhigh`, `max` | same string, unchanged |
706
790
  | `fable` | `gpt-6.2-sol` | `low`, `medium`, `high`, `xhigh`, `max` | same string, unchanged |
707
791
 
708
- Seven per-agent target overrides are applied after tuple validation, on top of
792
+ Three per-agent target overrides are applied after tuple validation, on top of
709
793
  the family row above, and are the only model/effort remaps in the generator:
710
794
  `explorer` (`sonnet`/`medium`) targets `gpt-6-luna` at `high` reasoning;
711
795
  `deep-reasoner` (`opus`/`xhigh`) targets `gpt-6.2-astra` at `high` reasoning;
712
- `fast-worker` (`sonnet`/`high`) targets `gpt-6.2-sol` at `medium` reasoning;
713
- `deep-worker` (`opus`/`high`) targets `gpt-6.2-sol` at `high` reasoning;
714
- `gatekeeper` (`opus`/`high`) targets `gpt-6.2-astra` at `medium` reasoning;
715
- `root-cause-prover` (`opus`/`xhigh`) targets `gpt-6.2-astra` at `high` reasoning;
716
796
  `harness-evaluator` (`opus`/`high`) targets `gpt-6.2-astra` at `medium` reasoning.
717
797
  `orchestrator` has no Codex target.
718
798
 
719
- `fast-worker`, `deep-worker`, `root-cause-prover`, and `harness-evaluator`
720
- receive `sandbox_mode = "workspace-write"`; every other role receives
799
+ `harness-evaluator` receives `sandbox_mode = "workspace-write"`; every other role receives
721
800
  `sandbox_mode = "read-only"`. Current assignments are explorer
722
- (`sonnet/medium`), deep-reasoner (`opus/xhigh`), fast-worker (`sonnet/high`),
723
- deep-worker (`opus/high`), gatekeeper (`opus/high`), root-cause-prover
724
- (`opus/xhigh`), and harness-evaluator (`opus/high`). Root-cause-prover's prompt further limits
725
- writes to bugfix evidence inside the active contract's allowed paths;
726
- harness-evaluator runs existing skill/adoption surfaces only when both repo and
801
+ (`sonnet/medium`), deep-reasoner (`opus/xhigh`) and harness-evaluator
802
+ (`opus/high`). Harness-evaluator runs existing skill/adoption surfaces only when both repo and
727
803
  HOME pass the runner's disposable boundary: skills uses `--require-disposable`,
728
804
  while adoption uses one `--run-adoption-profile` invocation that injects the
729
805
  validated repo/HOME into inspector and init dry-run. Guarded skills overrides
@@ -896,7 +972,7 @@ rh run install-agent-fleet
896
972
  The installer resolves `agents/fleet` from its authoritative helper source path,
897
973
  not from the target repository's current working directory. There is no source
898
974
  override, curl path, remote fallback, or alternate authority. It validates all
899
- six source files before mutating any target; a missing, malformed, mismatched,
975
+ three source files before mutating any target; a missing, malformed, mismatched,
900
976
  or unmapped source makes the whole run fail closed and leaves installed files
901
977
  untouched.
902
978
 
@@ -928,7 +1004,7 @@ the current bytes once:
928
1004
  rh run install-agent-fleet --accept-user-managed
929
1005
  ```
930
1006
 
931
- The acknowledgement validates all twelve target files before writing
1007
+ The acknowledgement validates all six target files before writing
932
1008
  `user_managed` path records into the host-config ledger
933
1009
  (`~/.repo-harness/config/ledger.json`). Claude files must have
934
1010
  well-formed frontmatter with the target role identity, model, effort, and body;
@@ -962,23 +1038,15 @@ generation.
962
1038
 
963
1039
  ### Uninstall
964
1040
 
965
- There is no uninstall command. Removing the fleet means deleting the fifteen
1041
+ There is no uninstall command. Removing the fleet means deleting the six
966
1042
  managed files by hand:
967
1043
 
968
1044
  ```text
969
1045
  ~/.claude/agents/explorer.md
970
1046
  ~/.claude/agents/deep-reasoner.md
971
- ~/.claude/agents/fast-worker.md
972
- ~/.claude/agents/deep-worker.md
973
- ~/.claude/agents/gatekeeper.md
974
- ~/.claude/agents/root-cause-prover.md
975
1047
  ~/.claude/agents/harness-evaluator.md
976
1048
  ~/.codex/agents/explorer.toml
977
1049
  ~/.codex/agents/deep-reasoner.toml
978
- ~/.codex/agents/fast-worker.toml
979
- ~/.codex/agents/deep-worker.toml
980
- ~/.codex/agents/gatekeeper.toml
981
- ~/.codex/agents/root-cause-prover.toml
982
1050
  ~/.codex/agents/harness-evaluator.toml
983
1051
  ```
984
1052
 
@@ -1384,7 +1452,7 @@ Read evidence and record a decision with:
1384
1452
 
1385
1453
  ```bash
1386
1454
  rh arch refactor recommendations [--json] [--import-node-limit <n>] [--timeout-ms <ms>]
1387
- rh arch refactor decide <recommendation-id> accept|defer|reject --reason "<text>" [--import-node-limit <n>] [--timeout-ms <ms>]
1455
+ rh arch refactor decide <recommendation-id> accept|defer|reject --reason "<text>" --snapshot-digest <digest> [--import-node-limit <n>] [--timeout-ms <ms>]
1388
1456
  ```
1389
1457
 
1390
1458
  `recommendations` shows each open suggestion with its explanation, the metrics
@@ -88,7 +88,8 @@ When a task requires broad research, repo archaeology, multi-source synthesis, o
88
88
  - Implementation sub-agents may run scoped typecheck and affected tests in their own worktree. They commit early and return their check results. An evidence role whose task is a named check, such as a root-cause reproduction, still runs that check and does not commit.
89
89
  - The parent agent owns task management, conflict resolution, build and post-merge integration verification, including typecheck and affected tests.
90
90
  - After integration, the parent removes each sub-agent worktree and branch whose commits are in the task branch and whose checkout is clean. It also removes the intermediate build output and temporary files that the work created. Other deletion still needs the user.
91
- - The orchestrator seat is a long-lived session that starts from `rh seats argv orchestrator`, not a sub-agent. It may call the read-only roles `explorer` and `deep-reasoner` as sub-agents. It dispatches writers (`fast-worker`, `deep-worker`, `root-cause-prover`), the gatekeeper and the Codex cross-review only to Herdr seats, for worktree isolation and one writer per file. It edits no product code.
91
+ - The orchestrator seat is a long-lived session that starts from `rh seats argv orchestrator`, not a sub-agent. It may call the read-only roles `explorer` and `deep-reasoner` as sub-agents. It dispatches the gatekeeper, every writer and the Codex cross-review only to Herdr seats, for worktree isolation and one writer per file. It edits no product code.
92
+ - In-process sub-agents serve cost control and read-only concurrency only, such as an `explorer` fan-out. Each harness maps them to its own lightweight family model: `claude` uses `haiku`/`sonnet`, `codex` uses `gpt-6-luna`/`gpt-6.1-terra`, `agy`/Gemini uses `gemini-4-carbon`/`gemini-4-neon`, and `pi` uses its configured setting. Code writes, cross-family planning and formal acceptance reviews run in Herdr seats.
92
93
 
93
94
  ## Peer Harness Collaboration
94
95