repo-harness 0.30.0 → 0.32.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.
- package/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/assets/herdr/github-events/filter.mjs +2 -1
- package/assets/reference-configs/agentic-development-flow.md +3 -2
- package/assets/reference-configs/design-options.md +3 -1
- package/assets/reference-configs/document-generation.md +2 -2
- package/assets/reference-configs/external-tooling.md +11 -10
- package/assets/reference-configs/heartbeat-triage.md +2 -3
- package/assets/reference-configs/herdr-notify.md +22 -16
- package/assets/reference-configs/hook-operations.md +10 -9
- package/assets/reference-configs/host-invariants.md +15 -15
- package/assets/reference-configs/minimal-change-hooks.md +3 -6
- package/assets/reference-configs/release-deploy.md +61 -76
- package/assets/reference-configs/ux-feature-guard.md +3 -1
- package/assets/review-high-list.v1.json +1 -1
- package/assets/skill-commands/repo-harness-architecture/references/worker.md +1 -1
- package/assets/skill-commands/repo-harness-ship/references/worker.md +2 -2
- package/assets/skill-version.json +2 -2
- package/assets/skills/repo-harness-advisor/SKILL.md +1 -1
- package/assets/skills/repo-harness-archimap/SKILL.md +17 -7
- package/assets/skills/repo-harness-archimap/assets/template.html +38 -4
- package/assets/skills/repo-harness-archimap/references/boards.md +24 -1
- package/assets/skills/repo-harness-archimap/references/visual-language.md +4 -1
- package/assets/skills/repo-harness-archimap/scripts/measure.ts +69 -9
- package/assets/skills/repo-harness-issue-flow/SKILL.md +37 -11
- package/assets/skills/repo-harness-issue-flow/references/acceptor.md +21 -33
- package/assets/skills/repo-harness-issue-flow/references/advisor.md +114 -0
- package/assets/skills/repo-harness-issue-flow/references/board.md +24 -31
- package/assets/skills/repo-harness-issue-flow/references/events.md +5 -1
- package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +192 -153
- package/assets/skills/repo-harness-issue-flow/references/replan.md +4 -6
- package/assets/skills/repo-harness-issue-flow/references/templates.md +25 -72
- package/assets/skills/repo-harness-issue-flow/references/worker.md +12 -6
- package/assets/skills/repo-harness-orchestrator/SKILL.md +1 -1
- package/assets/skills/repo-harness-product/references/prd.md +4 -3
- package/assets/skills/repo-harness-seat-handoff/SKILL.md +2 -1
- package/assets/skills/repo-harness-setup/references/ci-scope.md +1 -2
- package/assets/skills/repo-harness-test/references/authoring.md +10 -10
- package/assets/skills/repo-harness-test/references/refactor-evidence.md +1 -1
- package/assets/skills/repo-harness-test/references/running.md +3 -3
- package/assets/templates/helpers/capability-resolver.ts +223 -15
- package/assets/templates/runtime-state.gitignore +37 -0
- package/assets/templates/runtime.gitignore +1 -37
- package/assets/workflow-contract.v1.json +50 -13
- package/dist/hook-entry.js +715 -525
- package/dist/oar-review-host.js +70 -59
- package/package.json +3 -4
- package/scripts/capability-config.ts +5 -23
- package/scripts/changelog-fragments.ts +152 -0
- package/scripts/check-archimap-links.ts +61 -0
- package/scripts/check-changelog-released-sections.ts +219 -0
- package/scripts/check-ci.sh +71 -14
- package/scripts/check-release-upgrade-rehearsal.sh +223 -0
- package/scripts/check-skill-version.ts +70 -0
- package/scripts/check-state-boundaries.ts +0 -4
- package/scripts/check-tarball-install-smoke.sh +1 -1
- package/scripts/contract-worktree-runtime.ts +3 -3
- package/scripts/contract-worktree.sh +4 -5
- package/scripts/cutover-closure.ts +0 -1
- package/scripts/inspect-project-state.ts +0 -21
- package/scripts/lib/ci-run-tests.sh +31 -0
- package/scripts/lib/test-home-isolation.mjs +1 -1
- package/scripts/new-spec.sh +4 -24
- package/scripts/release-owner-steps.sh +26 -21
- package/scripts/report-ci.ts +71 -71
- package/scripts/run-skill-routing-eval.ts +3 -4
- package/scripts/select-ci-coverage.ts +52 -20
- package/scripts/select-test-suite.ts +99 -20
- package/scripts/sync-helper-sources.ts +8 -0
- package/src/cli/commands/adoption-plan.ts +1 -4
- package/src/cli/commands/board.ts +14 -16
- package/src/cli/commands/brain.ts +14 -17
- package/src/cli/commands/candidate-reconciliation.ts +6 -17
- package/src/cli/commands/capability-context.ts +10 -33
- package/src/cli/commands/docs.ts +13 -7
- package/src/cli/commands/global-runtime.ts +69 -19
- package/src/cli/commands/herdr-skill.ts +4 -8
- package/src/cli/commands/init-hook.ts +2 -5
- package/src/cli/commands/init.ts +0 -8
- package/src/cli/commands/operator.ts +0 -2
- package/src/cli/commands/publication.ts +3 -21
- package/src/cli/commands/seats.ts +90 -41
- package/src/cli/commands/security.ts +20 -22
- package/src/cli/commands/status.ts +2 -10
- package/src/cli/commands/upgrade-registered.ts +12 -11
- package/src/cli/commands/upgrade.ts +3 -28
- package/src/cli/hook/agent-notice.ts +77 -26
- package/src/cli/hook/handler-registry.ts +4 -3
- package/src/cli/hook/stop-handler.ts +11 -9
- package/src/cli/index.ts +10 -7
- package/src/cli/installer/configuration-ownership.ts +2 -1
- package/src/cli/installer/global-context.ts +1 -4
- package/src/cli/installer/install-profile.ts +25 -27
- package/src/cli/installer/install-state.ts +1 -4
- package/src/cli/installer/managed-entries.ts +3 -5
- package/src/cli/installer/shared.ts +2 -1
- package/src/cli/installer/uninstall.ts +16 -1
- package/src/cli/installer/waza-rules.ts +1 -1
- package/src/cli/mcp/audit.ts +2 -2
- package/src/cli/mcp/auth.ts +8 -10
- package/src/cli/mcp/doctor.ts +2 -6
- package/src/cli/mcp/fleet-tools.ts +5 -33
- package/src/cli/mcp/general-repo-access/authority.ts +7 -29
- package/src/cli/mcp/general-repo-access.ts +59 -85
- package/src/cli/mcp/guarded-write.ts +4 -6
- package/src/cli/mcp/local-config-check.ts +30 -0
- package/src/cli/mcp/paths.ts +17 -9
- package/src/cli/mcp/reader-tools.ts +12 -54
- package/src/cli/mcp/repo.ts +2 -5
- package/src/cli/mcp/result.ts +27 -0
- package/src/cli/mcp/server.ts +1 -3
- package/src/cli/mcp/tools.ts +20 -54
- package/src/cli/mcp/workspaces.ts +6 -12
- package/src/cli/tools/codegraph-reader.ts +3 -11
- package/src/cli/tools/codegraph.ts +0 -4
- package/src/core/adoption/modes.ts +0 -4
- package/src/core/adoption/render.ts +3 -7
- package/src/core/architecture/projection.ts +19 -1
- package/src/core/board/attention-delivery.ts +54 -11
- package/src/core/board/attention.ts +297 -36
- package/src/core/board/board.ts +190 -74
- package/src/core/board/dependency-migration.ts +2 -2
- package/src/core/board/desk.ts +1 -19
- package/src/core/board/dispatch.ts +10 -20
- package/src/core/board/hazards.ts +2 -5
- package/src/core/board/merge.ts +13 -4
- package/src/core/board/plan-block.ts +7 -20
- package/src/core/board/quota.ts +3 -1
- package/src/core/board/review.ts +28 -9
- package/src/core/board/seat-launch.ts +18 -16
- package/src/core/board/seat-reset.ts +61 -16
- package/src/core/board/seat-routing.ts +95 -34
- package/src/core/board/seats-settings.ts +49 -9
- package/src/core/board/source.ts +183 -32
- package/src/core/capabilities/resolver.ts +2 -9
- package/src/core/ci/documentation-path.ts +21 -0
- package/src/core/ci/test-report.ts +5 -1
- package/src/core/dev-activity/decode.ts +2 -10
- package/src/core/evidence/byte-compare.ts +7 -0
- package/src/core/evidence/canonical-json.ts +23 -19
- package/src/core/evidence/checkpoint.ts +1 -5
- package/src/core/evidence/decode-readers.ts +31 -0
- package/src/core/evidence/error-message.ts +7 -0
- package/src/core/evidence/fold.ts +3 -5
- package/src/core/evidence/idempotency.ts +2 -3
- package/src/core/evidence/is-record.ts +8 -0
- package/src/core/evidence/record-validators.ts +36 -0
- package/src/core/evidence/redaction.ts +2 -2
- package/src/core/evidence/required-check-evidence.ts +2 -29
- package/src/core/evidence/sha256-pattern.ts +6 -0
- package/src/core/evidence/sha256.ts +15 -0
- package/src/core/evidence/test-execution-evidence.ts +0 -5
- package/src/core/evidence/types.ts +0 -8
- package/src/core/evidence/verification-plan.ts +9 -18
- package/src/core/fleet/admitted-task-message.ts +29 -59
- package/src/core/fleet/task-inbox-layout.ts +0 -1
- package/src/core/fleet/task-message.ts +52 -85
- package/src/core/messages/mechanics.ts +21 -14
- package/src/core/messages/task-message-claim.ts +2 -2
- package/src/core/operator/agent-config.ts +2 -252
- package/src/core/operator/architecture-map.ts +5 -4
- package/src/core/operator/board-read.ts +2 -2
- package/src/core/operator/bot-access.ts +6 -6
- package/src/core/operator/docs.ts +22 -0
- package/src/core/operator/notify-status.ts +0 -2
- package/src/core/operator/runtime-capture.ts +0 -1
- package/src/core/operator/slack-review.ts +2 -7
- package/src/core/operator/tests.ts +4 -2
- package/src/core/operator/worktree-cleanup-observation.ts +15 -0
- package/src/core/operator/worktree-cleanup-plan.ts +3 -5
- package/src/core/publication/acceptance-merge-policy.ts +3 -12
- package/src/core/publication/feedback.ts +6 -8
- package/src/core/publication/generated-artifacts.ts +2 -13
- package/src/core/publication/merge-readiness.ts +45 -71
- package/src/core/publication/publication-receipt.ts +3 -13
- package/src/core/publication/required-check-coverage.ts +2 -31
- package/src/core/review/acceptance-receipt.ts +17 -33
- package/src/core/review/authority-context.ts +7 -7
- package/src/core/review/change-assessment.ts +20 -28
- package/src/core/review/check-records.ts +4 -2
- package/src/core/review/control-delegation.ts +3 -11
- package/src/core/review/model-family.ts +1 -1
- package/src/core/review/module-review-prompt.ts +3 -4
- package/src/core/review/review-publish.ts +3 -5
- package/src/core/setup/cli-inventory.ts +3 -18
- package/src/core/setup/decode.ts +2 -12
- package/src/core/shell-quote.ts +4 -0
- package/src/core/skill-surface/catalog.ts +4 -8
- package/src/core/state/project-continuation-envelope.ts +2 -2
- package/src/core/state/project-effective-state.ts +3 -3
- package/src/core/terminal/herdr-core-pin.json +11 -11
- package/src/core/tools/catalog.ts +2 -10
- package/src/core/workflow/policy-schema.ts +163 -0
- package/src/core/worktree-location.d.mts +0 -1
- package/src/core/worktree-location.mjs +1 -1
- package/src/effects/admission/admission-store.ts +10 -11
- package/src/effects/admission/issue-goal.ts +3 -13
- package/src/effects/adoption/gitignore-plan.ts +67 -1
- package/src/effects/adoption/standard-plan.ts +32 -233
- package/src/effects/architecture/archcontext-owners.ts +1 -4
- package/src/effects/architecture/archcontext-resolve-cache.ts +2 -1
- package/src/effects/architecture/archctx-provider.ts +10 -7
- package/src/effects/architecture/architecture-read.ts +1 -4
- package/src/effects/architecture/capability-resolver.ts +18 -7
- package/src/effects/architecture/model-reader.ts +8 -7
- package/src/effects/artifact-retention.ts +16 -18
- package/src/effects/atomic-append.ts +68 -5
- package/src/effects/board/attention-watch.ts +45 -13
- package/src/effects/board/closeout.ts +38 -6
- package/src/effects/board/collect.ts +153 -58
- package/src/effects/board/dispatch.ts +2 -13
- package/src/effects/board/keyed-sources.ts +147 -0
- package/src/effects/board/pi-fleet-roles.ts +2 -2
- package/src/effects/board/pi-shell.ts +70 -0
- package/src/effects/board/quota.ts +2 -1
- package/src/effects/board/review.ts +19 -24
- package/src/effects/board/seat-reset.ts +260 -92
- package/src/effects/board/seats-configuration.ts +3 -1
- package/src/effects/bot-registry.ts +2 -1
- package/src/effects/configuration/global-configuration.ts +4 -4
- package/src/effects/dev-activity/collector.ts +19 -27
- package/src/effects/evidence/attested-import.ts +1 -5
- package/src/effects/evidence/blob-store.ts +3 -33
- package/src/effects/evidence/checkpoint-store.ts +6 -9
- package/src/effects/evidence/eval-catalog.ts +4 -7
- package/src/effects/evidence/event-writer.ts +1 -5
- package/src/effects/evidence/verification-execution.ts +18 -20
- package/src/effects/fleet/provider-feedback.ts +3 -2
- package/src/effects/fleet/task-inbox-layout-migration.ts +16 -16
- package/src/effects/fleet/task-inbox-layout.ts +1 -8
- package/src/effects/fleet/task-inbox.ts +6 -33
- package/src/effects/fs-transaction.ts +3 -6
- package/src/effects/git/managed-worktree.ts +2 -10
- package/src/effects/git/repository-identity.ts +1 -5
- package/src/effects/git/runner.ts +14 -0
- package/src/effects/git/worktree-record.ts +5 -3
- package/src/effects/github/policy.ts +10 -8
- package/src/effects/locking/exclusive-directory-lock.ts +20 -17
- package/src/effects/locking/host-test-queue.ts +7 -13
- package/src/effects/locking/process-start-time.ts +58 -18
- package/src/effects/locking/runtime-transaction-lock.ts +5 -18
- package/src/effects/observation-loop.ts +194 -0
- package/src/effects/operator/architecture-map-collector.ts +40 -48
- package/src/effects/operator/architecture-map-worker.ts +13 -5
- package/src/effects/operator/board-observer-worker.ts +92 -0
- package/src/effects/operator/board-observer.ts +368 -28
- package/src/effects/operator/board-read.ts +6 -49
- package/src/effects/operator/bot-access.ts +17 -27
- package/src/effects/operator/docs-collector.ts +48 -46
- package/src/effects/operator/docs-reader.ts +3 -7
- package/src/effects/operator/execution-collector.ts +24 -42
- package/src/effects/operator/execution-state.ts +2 -2
- package/src/effects/operator/language-settings-route.ts +2 -1
- package/src/effects/operator/notify-collector.ts +18 -24
- package/src/effects/operator/runtime-source.ts +1 -4
- package/src/effects/operator/server.ts +45 -167
- package/src/effects/operator/slack-review-collector.ts +27 -33
- package/src/effects/operator/task-read-process.ts +1 -19
- package/src/effects/operator/tests-collector.ts +21 -38
- package/src/effects/operator/worktree-cleanup-archive.ts +11 -13
- package/src/effects/operator/worktree-cleanup-investigation.ts +14 -9
- package/src/effects/operator/worktree-cleanup-observation.ts +56 -9
- package/src/effects/operator/worktree-cleanup-plan.ts +5 -7
- package/src/effects/operator/worktree-cleanup-publish.ts +64 -2
- package/src/effects/operator/worktree-cleanup-removal.ts +2 -2
- package/src/effects/operator/worktree-cleanup-route.ts +4 -4
- package/src/effects/operator/worktree-cleanup-store.ts +3 -5
- package/src/effects/operator/worktree-cleanup.ts +2 -2
- package/src/effects/operator/worktree-collector.ts +21 -16
- package/src/effects/operator/write-run.ts +3 -3
- package/src/effects/path-containment.ts +11 -0
- package/src/effects/process-group-registry.ts +2 -11
- package/src/effects/process-group-termination.ts +3 -10
- package/src/effects/process-supervisor.ts +14 -12
- package/src/effects/publication/draft-pull-request.ts +3 -2
- package/src/effects/publication/feedback-store.ts +9 -38
- package/src/effects/publication/generated-artifacts.ts +1 -4
- package/src/effects/publication/merge-executor.ts +167 -399
- package/src/effects/publication/merge-readiness.ts +76 -59
- package/src/effects/repo-registry.ts +7 -52
- package/src/effects/review/acceptance-receipt.ts +21 -25
- package/src/effects/review/diff-fingerprint.ts +11 -24
- package/src/effects/review/generic-review.ts +1 -1
- package/src/effects/review/review-isolation.ts +2 -2
- package/src/effects/review/review-publish.ts +1 -4
- package/src/effects/review-runner/task-oar-host.ts +4 -3
- package/src/effects/review-runner/task-pre-prompt-inbox-consumer.ts +2 -2
- package/src/effects/runtime/helper-runner.ts +1 -1
- package/src/effects/runtime/node-runtime.ts +13 -3
- package/src/effects/runtime/protected-helper-platform.ts +1 -4
- package/src/effects/setup/cli-inventory.ts +25 -38
- package/src/effects/setup/collector.ts +30 -44
- package/src/effects/skill-tree-integrity.ts +2 -1
- package/src/effects/state/collect-state-inputs.ts +3 -7
- package/src/effects/state/coordination-worktree-topology.ts +14 -12
- package/src/effects/state/git-state-version-store.ts +2 -1
- package/src/effects/state/policy-file.ts +27 -0
- package/src/effects/state/pruned-worktree-intents.ts +3 -7
- package/src/effects/state/resolve-effective-state.ts +68 -94
- package/src/effects/state/worktree-trash.ts +4 -3
- package/src/effects/strategy/context.ts +2 -2
- package/src/effects/terminal/herdr-core.ts +30 -18
- package/src/effects/terminal/native-task-session.ts +2 -2
- package/src/effects/terminal/task-session-admission.ts +2 -2
- package/src/effects/terminal/task-session-record.ts +3 -2
- package/src/effects/terminal/task-session.ts +3 -6
- package/src/effects/upgrade/legacy-inventory.ts +20 -24
- package/src/effects/upgrade/operator-decisions.ts +2 -2
- package/src/pi/hook-bridge.ts +0 -2
- package/scripts/test-file-durations.json +0 -208
- package/src/cli/commands/doc-sessions-actions.ts +0 -89
- package/src/cli/commands/doc-sessions.ts +0 -36
- package/src/cli/tty-prompt.ts +0 -25
- package/src/core/board/summary.ts +0 -157
- package/src/core/operator/doc-citation.ts +0 -105
- package/src/core/operator/doc-session-agent-record.ts +0 -26
- package/src/core/operator/doc-session-changes.ts +0 -191
- package/src/core/operator/doc-session-events.ts +0 -197
- package/src/core/operator/doc-session-finalization-view.ts +0 -44
- package/src/core/operator/doc-session-finalize.ts +0 -42
- package/src/core/operator/doc-session-record.ts +0 -58
- package/src/core/operator/doc-session-views.ts +0 -99
- package/src/core/sessions/session-selector.ts +0 -5
- package/src/effects/board/merge-only-sync.ts +0 -116
- package/src/effects/operator/board-summary.ts +0 -50
- package/src/effects/operator/doc-session-changes.ts +0 -431
- package/src/effects/operator/doc-session-events.ts +0 -198
- package/src/effects/operator/doc-session-finalization-view.ts +0 -12
- package/src/effects/operator/doc-session-finalize-github.ts +0 -70
- package/src/effects/operator/doc-session-finalize-scope.ts +0 -40
- package/src/effects/operator/doc-session-finalize.ts +0 -400
- package/src/effects/operator/doc-session-views.ts +0 -131
- package/src/effects/operator/doc-session.ts +0 -277
- package/src/effects/operator/task-diff.ts +0 -23
- package/src/effects/publication/batch-build.ts +0 -478
- package/src/effects/review/docs-host-isolation.ts +0 -312
- package/src/effects/review/docs-host-proxy.ts +0 -162
- package/src/effects/sessions/admitted-source.ts +0 -22
- package/src/effects/state/canonical-target.ts +0 -36
- package/src/effects/upgrade/worktree-template-migration.ts +0 -141
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 (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
|
|
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 word for each release (it starts the host command list that publishes both packages to npm, creates the release tag and 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.
|
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 (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
|
|
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 word for each release (it starts the host command list that publishes both packages to npm, creates the release tag and 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.
|
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.
|
|
334
|
+
- npm: `repo-harness@0.32.0` · workflow stamp `repo-harness@0.32.0+template@0.32.0`
|
|
335
335
|
- History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
336
336
|
- License: MIT — see [`LICENSE`](LICENSE)
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
export const PROTOCOL_HEADERS = [
|
|
6
6
|
'repo-harness issue claim', 'repo-harness issue claim status', 'repo-harness boundary question',
|
|
7
7
|
'repo-harness scope change', 'repo-harness decision', 'repo-harness plan', 'repo-harness handoff',
|
|
8
|
-
'repo-harness acceptance claim', 'repo-harness acceptance record',
|
|
8
|
+
'repo-harness acceptance claim', 'repo-harness acceptance record',
|
|
9
|
+
'repo-harness acceptance disposition', 'repo-harness review reply',
|
|
9
10
|
'repo-harness unblocked', 'repo-harness integration status', 'repo-harness merge hold',
|
|
10
11
|
'repo-harness merge hold released',
|
|
11
12
|
];
|
|
@@ -27,6 +27,8 @@ Size PR CI by the diff, the same as step 4. A full suite on each small PR spends
|
|
|
27
27
|
- Matrix: each axis must change the runtime that the tests run on. When the test runner is pinned, for example one Bun version, a Node-version axis reaches only the scripts and tests that spawn Node. Run only that subset on the axis; a full suite on 3 OS × 3 Node versions repeats each OS run three times. On a PR, run a matrix cell only when the diff touches code that depends on its axis. The daily run covers each cell with its dependent subset. Set `fail-fast: false` so one cell failure does not hide the others.
|
|
28
28
|
- Limits: set `timeout-minutes` on each job; the GitHub default of 360 minutes lets a hung job spend all of it. Cache dependencies keyed on the lockfile.
|
|
29
29
|
|
|
30
|
+
Manual probe: to see what named test files do on one runner for a branch head, dispatch `.github/workflows/probe.yml` with `gh workflow run probe.yml --ref <branch> -f runner=<ubuntu-latest|macos-latest|windows-latest> -f files='<test paths>'`. Do not open a probe PR and do not commit a temporary test case or a wide-selection edit. Lane `home-isolation` (default) runs each file as `Test HOME isolation` does, on any runner. Lane `affected-shard` (ubuntu-latest only, with `-f shard=<index>/<total>`) splits the files as the selection job does and runs `scripts/check-ci.sh affected` for the chosen shard only; an empty shard fails the run. To run the files of one shard from an earlier selection log (its `shard i/3:` line), pass that list with `-f shard=0/1`. For shard 0 of a full-width selection, pass the whole suite, `bun scripts/select-test-suite.ts full | cut -f2 | paste -sd' ' -`, with `-f shard=0/3`. `-f repeat=<1-5>` runs more rounds. Each lane fails when a named file is missing. A green `home-isolation` run proves that each named file ran: each file must leave a JUnit report. A green `affected-shard` run proves only that the files of the chosen shard ran; the log line `shard <index>/<total>: N of M files: ...` names them. The probe has a read-only token, is never a required check and writes no record: put the run URL and head SHA in the PR or issue. It does not run the daily mode, which stays main-only.
|
|
31
|
+
|
|
30
32
|
## Report SOP
|
|
31
33
|
- Give a Feynman report: explain the work to a reader who does not know this project. Use plain language. Explain the goal, user value, how it works, completed work and remaining gaps. Explain each technical term at first use.
|
|
32
34
|
- State the conclusion, changes, reasons, verification and remaining risks. Link each claim to its source or label it as an inference. Use observed results. Name failed, incomplete and omitted checks.
|
|
@@ -157,7 +159,7 @@ The board rule R5 reads only the rows with `path_visible: true`: a changed path
|
|
|
157
159
|
| Reads, moves or exposes credentials, tokens or secrets. | `src/core/security/**` |
|
|
158
160
|
| Changes a path that deletes files, worktrees, branches or seats. | `src/effects/board/closeout.ts`, `src/cli/installer/uninstall.ts`, `scripts/ship-worktrees.sh`, `scripts/worktree-merge-lib.sh` |
|
|
159
161
|
| Changes release, publish or deploy, including `deploy/sql/`. | `deploy/sql/**`, `src/core/release/**`, `src/effects/release/**`, `scripts/check-npm-release.sh`, `scripts/check-release-published.sh` |
|
|
160
|
-
| Changes a merge or push path: the publication executor, branch protection or force push. | `src/core/publication/acceptance-merge-policy.ts`, `src/core/publication/merge-readiness.ts`, `src/effects/publication/
|
|
162
|
+
| Changes a merge or push path: the publication executor, branch protection or force push. | `src/core/publication/acceptance-merge-policy.ts`, `src/core/publication/merge-readiness.ts`, `src/effects/publication/merge-executor.ts`, `src/effects/publication/merge-readiness.ts`, `src/effects/publication/new-remote-ref-push.ts`, `scripts/merge-gate.ts` |
|
|
161
163
|
<!-- review-high-list:list:end -->
|
|
162
164
|
|
|
163
165
|
Review follows the `repo-harness-issue-flow` skill, [references/acceptor.md](../../assets/skills/repo-harness-issue-flow/references/acceptor.md). The tier selects the depth: no independent review for Low, one fresh-context review from a model family different from the writer's for Medium, and the gatekeeper plus one review for High, at least one of the two from a model family different from the writer's. The round rules (who reviews each round, the claims of a round, the round-2 scope and the convergence rule) are only in [references/acceptor.md §2.2](../../assets/skills/repo-harness-issue-flow/references/acceptor.md#22-rounds). The Acceptor SOP owns the round, findings and publish steps.
|
|
@@ -173,7 +175,6 @@ Rules for every tier:
|
|
|
173
175
|
- A low tier adds no review. A new test file or a rebase does not raise the tier.
|
|
174
176
|
- Changing implementation and test assertions together does not raise the tier. Within the tier's existing review, check whether assertions preserve the intended behavior and whether removed or weakened coverage has a valid requirement-based reason. At Low, the author performs this check in self-review. Record the reason for each assertion change in the PR; never change assertions only to make a test pass. Do not dispatch a separate test-review gate.
|
|
175
177
|
- A parent, coordinator or merge session reuses recorded acceptance when the reviewed diff, relevant base context, verification inputs and environment still match, and the review meets the current tier. The PR records the reviewed revision or diff, commands, results and finding dispositions. A change of session or reviewer is not a reason to repeat acceptance.
|
|
176
|
-
- A batch integration PR (`repo-harness-issue-flow`, [references/orchestrator.md](../../assets/skills/repo-harness-issue-flow/references/orchestrator.md) §9.3) reuses the acceptance record of each member when every member merged without conflict and the batch adds no commit of its own. It needs no new review round. A Low member has no acceptance record to reuse. Required checks on the batch head still apply.
|
|
177
178
|
- After a change, verify the affected behavior. The review scope of each round after a change is in [references/acceptor.md §2.2](../../assets/skills/repo-harness-issue-flow/references/acceptor.md#22-rounds). Retain valid evidence for unchanged scope; add only missing tier coverage. A rebase alone does not require a new full review, but changed base behavior or conflict resolution can invalidate affected evidence. Reuse never substitutes for required checks on the current head or the current-main merge requirement.
|
|
178
179
|
- A downstream repository maps its own release surfaces, for example public API, wire format, DDL/SQL and permissions, to the High tier.
|
|
179
180
|
|
|
@@ -171,7 +171,9 @@ not limited to the two named above.
|
|
|
171
171
|
|
|
172
172
|
## Design-Brief Hand-off
|
|
173
173
|
|
|
174
|
-
The chosen direction feeds the
|
|
174
|
+
The chosen direction feeds the design-brief template (the repository's own
|
|
175
|
+
`.claude/templates/design-brief.template.md` when present, otherwise
|
|
176
|
+
`repo-harness docs path design-brief.template`) /
|
|
175
177
|
frontend `task_profile` gate as its decided direction — this convention does
|
|
176
178
|
not duplicate that checklist.
|
|
177
179
|
|
|
@@ -18,8 +18,8 @@ Create these only when the agent has concrete repo evidence or the user asks:
|
|
|
18
18
|
- `docs/decisions.md`: accepted architecture decisions with trade-offs.
|
|
19
19
|
- Mermaid fenced blocks in `docs/architecture/modules/**.md`: semantic diagram source for agents and review diffs.
|
|
20
20
|
- `docs/packages.md`: package inventory for real multi-package repos.
|
|
21
|
-
- `docs/prds/*.prd.md`: upper-layer PRDs generated through `repo-harness-product`'s PRD mode from `docs/prds/prd.template.md`.
|
|
22
|
-
- `docs/prds/DESIGN-*.md`: optional design briefs generated from `.claude/templates/design-brief.template.md` when the task requests design work.
|
|
21
|
+
- `docs/prds/*.prd.md`: upper-layer PRDs generated through `repo-harness-product`'s PRD mode from the repository's own `docs/prds/prd.template.md` when present, otherwise from `repo-harness docs path prd.template`.
|
|
22
|
+
- `docs/prds/DESIGN-*.md`: optional design briefs generated from the repository's own `.claude/templates/design-brief.template.md` when present, otherwise from `repo-harness docs path design-brief.template`, when the task requests design work.
|
|
23
23
|
|
|
24
24
|
## Rules
|
|
25
25
|
|
|
@@ -140,8 +140,7 @@ repo-harness upgrade --registered --apply --expected-revision sha256:REPLACE_WIT
|
|
|
140
140
|
|
|
141
141
|
A changed registry refuses the whole apply with exit 2. Apply checks each repo
|
|
142
142
|
again just before its first write. It then runs the `init` refresh transaction,
|
|
143
|
-
`upgrade --scope project --apply`
|
|
144
|
-
given) and the managed worktree sweep. A failed repo does not stop or roll back
|
|
143
|
+
`upgrade --scope project --apply` and the managed worktree sweep. A failed repo does not stop or roll back
|
|
145
144
|
the other repos. The `init` refresh updates the repo's registry row, so preview
|
|
146
145
|
again before the next apply. The command never commits, pushes or opens a PR.
|
|
147
146
|
`--json` prints one object with `revision`, `apply`, `exitCode` and `repos`.
|
|
@@ -761,9 +760,7 @@ head SHA, full binary diff fingerprint, installed helper fingerprint, and PR
|
|
|
761
760
|
number. The seal has no receipt field. It never owns provider credentials or
|
|
762
761
|
starts a reviewer.
|
|
763
762
|
|
|
764
|
-
|
|
765
|
-
`.ai/harness/policy.json#merge_gate`; the candidate cannot disable that base
|
|
766
|
-
requirement. Runtime setup installs no merge-gate skill, agent, or provider
|
|
763
|
+
Runtime setup installs no merge-gate skill, agent, or provider
|
|
767
764
|
runtime. Caller `HOME`, helper-source, and runner environment overrides are ignored for
|
|
768
765
|
the protected ship/gate helpers. The official runner pins Bash, Git, and Bun;
|
|
769
766
|
where a fixed trusted host `gh` is present it pins that executable too, and it
|
|
@@ -1083,11 +1080,15 @@ for the checked commit. It fetches before its first render and again in its
|
|
|
1083
1080
|
internal retry loop. A main move after the writer's check, before either fetch,
|
|
1084
1081
|
can render one newer commit with the older writer. The rolling PR's CI does not
|
|
1085
1082
|
compare renders. The Daily architecture freshness lane runs render equivalence
|
|
1086
|
-
on main
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1083
|
+
on main. When the published output differs from what current main renders, the
|
|
1084
|
+
lane warns while the oldest unpublished main commit is younger than 3 h, and
|
|
1085
|
+
fails after that. The oldest unpublished commit is the first first-parent commit
|
|
1086
|
+
after the newest commit that changes the projection manifest, else that commit.
|
|
1087
|
+
A version mismatch that renders the same output is harmless. The next main move
|
|
1088
|
+
renders again with the new writer. The upstream fix is
|
|
1089
|
+
Ancienttwo/arch-context#504 (`--base-sha`). A projection that stays stale for
|
|
1090
|
+
3 h then fails the daily architecture freshness check on main, which opens a CI
|
|
1091
|
+
repair issue. A
|
|
1091
1092
|
local commit or a dirty file that blocks the fast-forward needs an operator
|
|
1092
1093
|
repair. The installed package is not used for `follow`: releases lag main, and
|
|
1093
1094
|
a long-running process does not reload a `repo-harness update`. The operator supplies
|
|
@@ -13,9 +13,8 @@ repo-harness run heartbeat-triage run --source scheduled
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The command appends a run section to `.ai/harness/triage/inbox.md` and writes a
|
|
16
|
-
JSON snapshot under `.ai/harness/runs/`. Each run records
|
|
17
|
-
|
|
18
|
-
- `workflow-check`: `repo-harness run check-task-workflow`
|
|
16
|
+
JSON snapshot under `.ai/harness/runs/`. Each run records the run id, its
|
|
17
|
+
source, the snapshot path and the adoption review date.
|
|
19
18
|
|
|
20
19
|
## cron
|
|
21
20
|
|
|
@@ -27,10 +27,10 @@ This topology applies to issue-flow work (`repo-harness-issue-flow`) on herdr-co
|
|
|
27
27
|
- Tab 1 holds two panes: the orchestrator on the left and its advisor on the right. Tab 1 may take one worker as its third pane.
|
|
28
28
|
- The orchestrator holds the issue-flow coordinator and integrator seats. It only dispatches, accepts and merges. It does not implement a child issue.
|
|
29
29
|
- The advisor serves only the orchestrator. It does research and writes proposals. It may edit files for its proposals. It does not commit or write to GitHub. It collects evidence through the sub-agents of its seat (`seats.advisor.fleet`) and keeps judgment, synthesis and the proposal. The orchestrator asks it for a board replan by [Replan](https://github.com/aimpact-inc/repo-harness/blob/main/assets/skills/repo-harness-issue-flow/references/replan.md).
|
|
30
|
-
- Owner decisions and seat authority (owner, 2026-11-09, #2008): the root `CLAUDE.md` and `AGENTS.md` hold the life-cycle rules and the owner list. The orchestrator dispatches an owner-approved batch plan in order, merges by rule 2 at every tier and runs fix rounds up to round 5 by rule 1. A seat that receives an owner decision in its pane posts it on the issue or PR; that comment authorizes the other seats. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. The orchestrator and the advisor make a non-security decision together when both agree, and the orchestrator posts it first as `Joint decision (orchestrator + advisor)` with the reason. The advisor makes no GitHub write. A "stop" or "no" comment from any participant, the owner account included, is a reference that the orchestrator and the advisor weigh by joint decision.
|
|
30
|
+
- Owner decisions and seat authority (owner, 2026-11-09, #2008): the root `CLAUDE.md` and `AGENTS.md` hold the life-cycle rules and the owner list. The orchestrator dispatches an owner-approved batch plan in order, merges by rule 2 at every tier and runs fix rounds up to round 5 by rule 1. A seat that receives an owner decision in its pane posts it on the issue or PR; that comment authorizes the other seats. A seat message carries pointers, not content: it names the issue, the PR, the comment URL or the sha, and the content lives in GitHub. The message still wakes the receiving seat; it does not replace the record. The advisor sends the orchestrator only a mismatch between a seat report and the GitHub state, not a confirmation. A comment is a record: a local seat writes it, and a locally run command may read it as data; it never starts an action. The orchestrator and the advisor make a non-security decision together when both agree, and the orchestrator posts it first as `Joint decision (orchestrator + advisor)` with the reason. The advisor makes no GitHub write. A "stop" or "no" comment from any participant, the owner account included, is a reference that the orchestrator and the advisor weigh by joint decision.
|
|
31
31
|
- One PR has one pane and one worker agent. Each further worker gets its own pane, as the right split of a tab that is not full or in a new tab. The worker may use the agent-fleet sub-agents (`agents/fleet/`) inside its own pane.
|
|
32
|
-
- Recommended models for a Claude-only setup: the orchestrator runs Opus at high effort, and the advisor runs
|
|
33
|
-
- Cleanup: after a PR merges, the orchestrator runs `repo-harness board closeout --pr <n>` in the primary checkout. It first proves the merge and the worktree: merge commit in the fetched `origin/main`, PR head worktree at the PR head sha, not locked, clean, and no owner marker but its own. A missing proof stops before any pane closes. It then closes each seat terminal bound to the PR (its `pr` label, or the `issue` label of a closing issue in this repository, or a cwd in the PR head worktree on the PR head branch when the seat has an `issue` label that the PR body names after `Refs`; a cwd in the primary checkout never binds; a binding without the PR's `pr` label next to another PR's `pr` label is a conflict) whose checkout belongs to this repository, is clean and has no commit outside `origin/<branch>`. When every bound pane is closed and no process runs in the worktree, it removes the worktree and the local branch through the exact closeout path of `contract-worktree cleanup`, which drops only the worktree's own active-worktree marker. A dirty, unpushed, conflicting, locked, other-owner or unmerged pane or worktree stays; the JSON names the reason, and the board rule A9 reports each live seat of a merged PR. The remote branch is left to GitHub.
|
|
32
|
+
- Recommended models for a Claude-only setup: the orchestrator runs Opus at high effort, and the advisor runs Fable at high effort. This is a recommendation, not a requirement. No seat requires a specific model (issue-flow D7).
|
|
33
|
+
- Cleanup: after a PR merges, the orchestrator runs `repo-harness board closeout --pr <n>` in the primary checkout. It first proves the merge and the worktree: merge commit in the fetched `origin/main`, PR head worktree at the PR head sha, not locked, clean, and no owner marker but its own. A missing proof stops before any pane closes. It then closes each seat terminal bound to the PR (its `pr` label, or the `issue` label of a closing issue in this repository, or a cwd in the PR head worktree on the PR head branch when the seat has an `issue` label that the PR body names after `Refs`; a cwd in the primary checkout never binds; a binding without the PR's `pr` label next to another PR's `pr` label is a conflict) whose checkout belongs to this repository, is clean and has no commit outside `origin/<branch>`. When every bound pane is closed and no process runs in the worktree, it removes the worktree and the local branch through the exact closeout path of `contract-worktree cleanup`, which drops only the worktree's own active-worktree marker. The same pass removes each finished seat terminal of the repository whose cwd directory is gone, also one that no merge binds, and lists it in `stale_terminals`; a failed `hc rm` there is listed as `kept` and keeps no worktree. A dirty, unpushed, conflicting, locked, other-owner or unmerged pane or worktree stays; the JSON names the reason, and the board rule A9 reports each live seat of a merged PR. The remote branch is left to GitHub.
|
|
34
34
|
- Before a worker reports DONE, it stops the background programs it started (a dev server, a daemon started with `nohup` or `setsid`). On Linux and macOS, herdr-core 0.1.19 keeps a deliberately detached program running after its terminal closes, and Windows ends it.
|
|
35
35
|
|
|
36
36
|
### Runtime commands
|
|
@@ -52,6 +52,8 @@ Commands for the topology steps:
|
|
|
52
52
|
| Wait for a worker | `hc wait <t>` |
|
|
53
53
|
| Close a worker pane | `herdr-app do pane.close --pane <pane>` |
|
|
54
54
|
|
|
55
|
+
The board of a parent selects a worker, gatekeeper or reviewer seat by its `issue` label (an item of the parent) or its `pr` label (a pull request of the board). `--parent` is optional for that. It names the worker tab `#<n>` (`other` without it), so the worker rows keep it.
|
|
56
|
+
|
|
55
57
|
A Codex worker seat in a linked contract worktree edits files and runs checks only. It runs no `git fetch`, `git commit` or `git push`. Its last message gives the commit subject and body, the PR title and body, and the check results. The orchestrator commits the worktree diff with that message and explicit paths only, pushes the branch and opens the PR. The orchestrator is the head owner of record and pushes each fix round; no other agent pushes to that PR. The Codex seat remains the content author and answers review threads through the orchestrator. A seat with the `net` tool group can use the network. A writable Codex seat with `net` can reach loopback services, including the Operator console and herdr-core socket (#1961).
|
|
56
58
|
|
|
57
59
|
`repo-harness seats argv <seat>` prints the argv of the seat from the `seats` section of `~/.repo-harness/config.json`, or from the seat defaults when the section is absent. The argv holds the model, the effort, the tool limits and the seat brief. Its stderr names the source and each limit. A limit marked `instructions_only` is written into the launch instructions only; the host does not enforce it. Without `--argv`, the pane opens a shell.
|
|
@@ -66,28 +68,31 @@ Before each dispatch wave, run `repo-harness quota`. Launch each task with `repo
|
|
|
66
68
|
| `worker-important-fast` | Claude, `sonnet`, medium |
|
|
67
69
|
| `worker-light` | Pi, `magpie/cursor/deepseek-v41-flash-1017`, no effort and no account; worker tool groups; no fleet. A Pi seat on `magpie/codex/<model>` ("pi-gpt") is a user-selected alternative to a Codex seat: it runs the same GPT models, takes an effort (`--thinking`) and counts against the `chatgpt` account |
|
|
68
70
|
| `gatekeeper` | Codex, `gpt-6.1-terra`, high; read, shell and network |
|
|
71
|
+
| `gatekeeper-fallback` | `null` (not configured); when configured, the gatekeeper ranges: read, shell and network, no fleet |
|
|
69
72
|
| `reviewer` | Claude, `opus`, high; read, shell and network |
|
|
70
73
|
|
|
71
74
|
All worker seats use worker briefs, labels and pane names. `gatekeeper` and `reviewer` need `--pr <n>`; their pane names are `<prefix>-gk-<pr>` and `<prefix>-rv-<pr>`. They report a read-only verdict first and do not edit, commit, push or write to GitHub.
|
|
72
75
|
|
|
76
|
+
`gatekeeper-fallback` is optional and is no launch target: `seats argv gatekeeper-fallback` returns `seat_unknown`. While the gatekeeper account is exhausted and the fallback account is not, the route line names the fallback, for example `gatekeeper: gatekeeper-fallback (pi magpie/cursor/deepseek-v41-flash-1017; gatekeeper: chatgpt exhausted)`, and `seats argv gatekeeper --pr <n>` prints the fallback argv with the gatekeeper label, pane name and brief. A tight, unknown or reserved gatekeeper keeps its own rule; with no usable fallback the line stays `gatekeeper: none (...)`. `repo-harness board review` starts a gatekeeper only when this effective gatekeeper has a known model family, and not `anthropic` when the head needs a non-Claude gatekeeper. Its family must differ from the writer's only where it gives the different-family row: a Medium head, or a High head that needs no Claude review. A High head with a Claude review may use a gatekeeper of the writer's family; else it skips the PR with `review_family_unavailable` and the route line. A stored section without the key needs `repo-harness update`, which sets it to `null`.
|
|
77
|
+
|
|
73
78
|
On Pi, review seats pass `--exclude-tools edit,write`. Direct edit/write tools are off. The edit limit is `common_commands` because the shell stays available; shell writes remain prohibited by the brief. Codex review seats use the read-only sandbox.
|
|
74
79
|
|
|
75
80
|
`seats.routing` holds ordered lists for `important_deep`, `important_fast`, `simple_deep`, `simple_fast` and `frontend`. Lists are non-empty and distinct. The first four accept configured worker seats only; a list cannot name a null seat. `frontend` accepts only `worker-important` and `worker-important-fast`, and both must run Claude when selected in that list. Defaults are `[worker-important, worker-deep]`, `[worker-important-fast, worker]`, `[worker-deep, worker-important]`, `[worker]` and `[worker-important, worker-important-fast]`, in that order. `worker-light` defaults to the Pi seat above. A stored `null` stays null during migration; its argv returns `seat_not_configured`. Each configured seat must use an enabled runtime when saved. The default Pi seat prevents a Seats page save until Pi is enabled or `worker-light` is set to `null`.
|
|
76
81
|
|
|
77
|
-
Routing selects the first eligible seat with a known account state, or a Pi seat without an account (the DeepSeek `worker-light`). A Pi seat on `magpie/codex/` has the `chatgpt` account. It selects an unknown account only when no such seat is eligible. Exhausted accounts are excluded. Claude in saving mode or exhausted stays reserved for the advisor and orchestrator.
|
|
82
|
+
Routing selects the first eligible seat with a known account state, or a Pi seat without an account (the DeepSeek `worker-light`). A Pi seat on `magpie/codex/` has the `chatgpt` account. It selects an unknown account only when no such seat is eligible. Exhausted accounts are excluded. The one exception is `routing.codex_credit_mode` (`off`, `review` or `all`; default `off`): while the ChatGPT account is exhausted and reports credits at or above `routing.codex_credit_floor` (default 0), `review` admits the gatekeeper, the gatekeeper fallback and a ChatGPT-bound reviewer, and `all` admits every ChatGPT-bound seat. Their route and seat lines say `on credits`; the `chatgpt` account line stays `exhausted`. Only the owner sets `codex_credit_mode`, on the console Seats page; a seat does not write it, and a joint decision does not cover it. Claude in saving mode or exhausted stays reserved for the advisor and orchestrator. An important non-frontend route that holds a Claude-account seat then uses a configured Pi `worker-light`; a null or non-Pi `worker-light` gives a `none` route. An important route without a Claude-account seat is read as stored. Frontend waits for Claude. `tight` is a display state only. When Claude is reserved, the explorer line uses `routing.low_quota_explorer` (default `haiku` high). Pass its model when you call the explorer. Otherwise the line says `default`.
|
|
78
83
|
|
|
79
|
-
`routing.claude_saving_below_remaining` defaults to 20. Claude saving mode applies when weekly remaining quota is below that percent; otherwise its mode is normal. `routing.codex_hyper_at_or_above_remaining` defaults to 50. Codex hyper mode applies when weekly remaining quota is at or above that percent; otherwise its mode is normal. A missing weekly reading gives an unknown mode.
|
|
84
|
+
`routing.claude_saving_below_remaining` defaults to 20. Claude saving mode applies when weekly remaining quota is below that percent. `routing.claude_hyper_at_or_above_remaining` defaults to 50. Claude hyper mode applies when weekly remaining quota is at or above that percent and saving does not apply; otherwise its mode is normal. Only in Claude hyper does the advisor take its config entry; in normal, saving, exhausted and unknown it uses `opus` high, and the `advisor:` line of `repo-harness quota` names it. Claude hyper routes workers as normal and does not change the orchestrator entry. `routing.codex_hyper_at_or_above_remaining` defaults to 50. Codex hyper mode applies when weekly remaining quota is at or above that percent; otherwise its mode is normal. A missing weekly reading gives an unknown mode. Quota modes are derived, never stored; the credit mode is the one stored owner choice. Codex hyper uses the code constant `gpt-6-astra` high for Codex seats. Reserved Claude advisor and orchestrator seats use `opus` high. There is no Codex advisor fallback. A Pi seat on `magpie/codex/` gets the Codex hyper model as `magpie/codex/gpt-6-astra` with the hyper effort. Other Pi seats, tools, fleet and class lists stay as configured. An absent seats section uses defaults. Run `repo-harness update` for the one-shot migration of stored sections. The decoder refuses old keys before and after migration; a POST writes the full section.
|
|
80
85
|
|
|
81
86
|
With `--repository-id`, the argv labels its own terminal before the agent starts: it runs `repo-harness seats label`, which sets the seat labels on `HC_TERMINAL_ID`, and then starts the agent. The board finds seats only by these labels; a terminal without them leaves the execution axis `unavailable` (`no_seat_terminals`). When the label fails, the agent does not start and the terminal shows the error. Each start prints the new `terminal`. `<repository-id>` is the GitHub numeric repository id (`gh api repos/<owner>/<repo> --jq .id`). Leave out `--issue` and `--pr` for the orchestrator and the advisor.
|
|
82
87
|
|
|
83
88
|
### Seat reset
|
|
84
89
|
|
|
85
|
-
A Claude orchestrator or advisor seat resets through a handoff before auto-compaction (#1972). Opus auto-compaction started at 461k-467k context tokens on Max. With `--repository-id`, `seats argv` sets `REPO_HARNESS_SEAT` and `REPO_HARNESS_SEAT_REPOSITORY` in the env of these two seats. Only that env names the seat for the Stop hook. Worker seats do not reset.
|
|
90
|
+
A Claude orchestrator or advisor seat resets through a handoff before auto-compaction (#1972). Opus auto-compaction started at 461k-467k context tokens on Max. With `--repository-id`, `seats argv` sets `REPO_HARNESS_SEAT` and `REPO_HARNESS_SEAT_REPOSITORY` in the env of these two seats, and `REPO_HARNESS_SEAT_MODEL` and `REPO_HARNESS_SEAT_EFFORT` with the effective model and effort of the launch (#2633). Every seat argv unsets the four values that it inherits. Only that env names the seat for the Stop hook. The SessionStart hook records the model and effort in `session.json`. Worker seats do not reset.
|
|
86
91
|
|
|
87
|
-
1. When the context of the last assistant entry of the transcript is 380,000 tokens or more, the Stop hook blocks the stop once per
|
|
88
|
-
2. The seat writes `/tmp/repo-harness-seats/<repository-id>/<seat>/handoff.md` with the fixed sections that the block reason gives: role, hard rules, current state, in progress, owner decisions pending, next actions and the resume checklist. It sends `RESET-REQUEST <path> <sha256>` to the peer seat.
|
|
89
|
-
3. The peer runs `repo-harness seats reset <path> <sha256>` in the background; one run can take about 10 minutes. The command finds the requester by the `repo-harness.seat` and `repo-harness.repository` labels. When the handoff is not newer than the request, its sha256 is different, or a section is missing, it sends `REWRITE` to the requester and resets nothing. Otherwise it waits with `hc wait` and
|
|
90
|
-
4. The requester reads the handoff
|
|
92
|
+
1. When the context of the last assistant entry of the transcript is 380,000 tokens or more, the Stop hook blocks the stop once per session segment. A segment ends when the SessionStart hook records a new session (`startup`, `clear` or `compact`): a request is open while no `session.json` record is newer than it. The hook is the one authority for the action (#2625). A transcript file below 32 MiB gives `compact`; 32 MiB or more gives `reset`. It records the request time, the transcript path, the `action` and the `transcript_bytes` in `/tmp/repo-harness-seats/<repository-id>/<seat>/request.json`, and the block reason names the action. `/compact` keeps the transcript file, so it grows by 3.4-4.7 MB per cycle; the bound gives 6 to 9 compactions before a `/clear` starts a new file.
|
|
93
|
+
2. The seat finishes the planning and the dispatch that it has in hand and starts nothing new; this is not a hard stop (joint decision on #2625, owner word 2026-11-12). Then it writes `/tmp/repo-harness-seats/<repository-id>/<seat>/handoff.md` with the fixed sections that the block reason gives: role, hard rules, current state, in progress, owner decisions pending, next actions and the resume checklist. It sends `RESET-REQUEST <path> <sha256>` to the peer seat.
|
|
94
|
+
3. The peer runs `repo-harness seats reset <path> <sha256>` in the background; one run can take about 10 minutes. The command finds the requester by the `repo-harness.seat` and `repo-harness.repository` labels. When the handoff is not newer than the request, its sha256 is different, or a section is missing, it sends `REWRITE` to the requester and resets nothing. Otherwise it waits with `hc wait` and types the recorded action: `/compact` for `compact`, `/clear` for `reset`. It does not measure the transcript again. One validator reads the request for the Stop hook and for `seats reset`. A request without a valid time or `action` (for example from the old code), or a file that is not a JSON object (for example `null`), is not open for the Stop hook. `seats reset` types nothing for it: after the peer and requester checks it sends `NO-RESET` (`request_invalid`), and the next crossing writes a fresh request. A missing request is `request_missing` and sends nothing. After the claim, a `session.json` record newer than the request (an auto-compaction or another reset) means a new segment: the command types nothing and sends `NO-RESET` (`request_closed`). The SessionStart hook writes `session.json` next to the handoff. After `/clear` the command sends the resume prompt only after that file names a new transcript (budget 60 s). After `/compact` it waits for a `compact` record of the same transcript (budget 300 s: a compaction took 71 s median and 237 s max). The resume prompt asks for `RESUMED` first. The resume evidence is an assistant Bash tool call in the transcript, after the user entry that holds the prompt, whose command is exactly the one simple command `hc send <peer> RESUMED` (the message bare or in plain quotes), and then its tool result without an error. A compound command, another address and a command that only prints the text are no evidence. Only the bytes appended after the prompt send are read.
|
|
95
|
+
4. The requester reads the handoff and sends `RESUMED` to the peer. After `/clear` it then checks the current state with git and gh and continues. After `/compact` it continues: the compaction summary holds the live state.
|
|
91
96
|
|
|
92
97
|
Protocol rules. The reset runs with no human step; an owner command is never part of it (owner decision 2026-11-08):
|
|
93
98
|
|
|
@@ -95,10 +100,11 @@ Protocol rules. The reset runs with no human step; an owner command is never par
|
|
|
95
100
|
- The peer sends no other message to the requester from `RESET-REQUEST` until `RESUMED`.
|
|
96
101
|
- Handoff check fails: the peer asks for a rewrite, at most 3 times. Then no reset: the seat continues, and Claude Code auto-compaction handles its context.
|
|
97
102
|
- Peer seat missing or not answering: no reset, same as above.
|
|
98
|
-
- No new-session signal
|
|
103
|
+
- No new-session signal after `/clear`: `/clear` is typed again. No signal after `/compact`: no second `/compact`; one log entry and one notice, the seat continues, and auto-compaction stays as the net. No answer to the resume prompt (no `RESUMED` send): the prompt is sent again. One attempt and at most 3 retries in total, then the other seat starts the requester again in the same terminal from `repo-harness seats argv <seat> --repository-id <id>` and sends the resume prompt with the git and gh check. The restart is a new process with no compaction summary.
|
|
104
|
+
- Mode change (#2633): `/clear` and `/compact` keep the model, so for the action `reset` the command first computes the effective model and effort of the requester under the current quota. When they differ from the `session.json` record, it starts the requester again from its seat argv (`/exit`, then the relaunch line) and types no `/clear`; the result has `relaunched: true` and the log entry has the detail `restarted`. When they are equal, or the record has no model, it types `/clear`. A launch that cannot be built, or a launch under an unknown quota mode (a missing, unreadable or stale weekly reading), gives one `model_check_failed` log entry and one notice, and the command types `/clear`: a missing reading is no authority to move a running seat. A new `seats argv` launch still takes the unknown-mode model. The action `compact` never restarts. The restart comes only inside this reset, after the handoff, so the seat finishes its planning and dispatch first. No `/model` or effort command is typed into a running session.
|
|
99
105
|
- Each of these failures writes one entry to a reset log next to the handoff and sends one notice. The flow does not wait for anyone to read it.
|
|
100
106
|
|
|
101
|
-
`seats reset` runs these rules. It types `/clear`, `/exit` and the relaunch line (`sh <reset dir>/relaunch.sh`) with `hc keys`: `hc send` wraps its text in an envelope, so Claude reads a sent slash command as chat text. The reset log `reset-log.jsonl` is the only record of the rewrite and resend counts across runs; one run also stops after one attempt and 3 retries when the log cannot be written. Before
|
|
107
|
+
`seats reset` runs these rules. It types `/compact`, `/clear`, `/exit` and the relaunch line (`sh <reset dir>/relaunch.sh`) with `hc keys`: `hc send` wraps its text in an envelope, so Claude reads a sent slash command as chat text. The reset log `reset-log.jsonl` is the only record of the rewrite and resend counts across runs; one run also stops after one attempt and 3 retries when the log cannot be written. Before the first typed command, a run claims the request with an exclusive create of `claim-<requested_at digits>` next to the handoff. A second run for the same request, also after an uncertain first run, sends nothing (`already_claimed`); a claim that cannot be created types nothing (`claim_failed`). A completed reset adds a `reset` entry with the detail `compacted`, `cleared`, `relaunched` or `restarted`. Each failure first appends its log entry, then posts one `seat.reset_failed` bot event to the notify channels; the run waits at most 5 s in total for the notices at its end. A log entry that cannot be written is reported in the result as `logErrors`. Without a notify config, the log entry records `not_configured`. A handoff path that is not `/tmp/repo-harness-seats/<repository-id>/<seat>/handoff.md` names no seat, so it gives only the command error, with no log entry and no notice.
|
|
102
108
|
|
|
103
109
|
### Pane and tab names
|
|
104
110
|
|
|
@@ -132,10 +138,10 @@ A new pane goes into the first tab of its kind with fewer than 3 panes. When eve
|
|
|
132
138
|
|
|
133
139
|
### Test and Review Rules
|
|
134
140
|
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
141
|
+
- A writer runs `bun run check:type`, `bun run check:helpers` and at most 3 test files that own the change. `Required / CI` on the head is the affected-gate evidence.
|
|
142
|
+
- `bash scripts/check-ci.sh <lane>` on the host only reproduces a CI failure.
|
|
143
|
+
- A reviewer runs no test that CI passed.
|
|
144
|
+
- The full suite runs in the daily run and for a release.
|
|
139
145
|
- Test commands take the host test queue themselves: `bash scripts/check-ci.sh <lane>`, `bun run test:files` and the `test:*` suites wait their turn, run alone and release. Release checks go first, then FIFO. Do not wait for a coordinator message to start them. `bun scripts/host-test-queue.ts status` shows the holder and the waiters.
|
|
140
146
|
- Full runs use eight isolated file workers. Run files with shared ports or shared HOME writes in the serial tail.
|
|
141
147
|
- Tests with port 0 and an isolated HOME can run in parallel.
|
|
@@ -129,8 +129,7 @@ spawn an LLM or a long-running worker.
|
|
|
129
129
|
|
|
130
130
|
## Host and Adoption Operations
|
|
131
131
|
|
|
132
|
-
`repo-harness init` writes the workflow contract
|
|
133
|
-
in `.ai/hooks/README.md`. It does not install user-level adapters;
|
|
132
|
+
`repo-harness init` writes the workflow contract. It does not install user-level adapters;
|
|
134
133
|
`repo-harness install` and `repo-harness update` own them.
|
|
135
134
|
It does not copy the operator library into consumer repositories.
|
|
136
135
|
It removes retired generated hook entry scripts by exact manifest ownership and
|
|
@@ -316,7 +315,6 @@ or `repair`). The error names the one-shot cleanup. Run
|
|
|
316
315
|
Hooks do not record architecture drift. They keep no queue and no drift cursor,
|
|
317
316
|
and they run no projection or LLM work. Architecture updates are explicit:
|
|
318
317
|
|
|
319
|
-
- `repo-harness run workstream-sync` maintains durable capability workstreams.
|
|
320
318
|
- Agents read architecture documents on demand, fix debt, and update the model and human prose. The archctx rolling writer publishes generated regions and the manifest.
|
|
321
319
|
|
|
322
320
|
`repo-harness state resolve --json` reports `capability_ownership`. It is a
|
|
@@ -379,7 +377,9 @@ runs), a missing global architecture configuration, and archctx setup errors
|
|
|
379
377
|
such as `AC_MODEL_ADOPTION_REQUIRED` or `AC_CODE_FACTS_NOT_READY`. An
|
|
380
378
|
explicit `projection_provider=disabled` gives no line. Another failure gives one
|
|
381
379
|
`[Architecture] notice unavailable (<code>)` line and keeps the one-line stderr
|
|
382
|
-
diagnostic at exit 0. A
|
|
380
|
+
diagnostic at exit 0. A timeout on the notice path (an archctx deadline or
|
|
381
|
+
process, a Git call, or the ownership resolve) gives no notice and one fixed
|
|
382
|
+
stderr line per hook run that names no command; the next hook measures again. A failed unowned-path filter in a setup state keeps the
|
|
383
383
|
setup state, and only stderr gets the error. The Git-ignored marker `.ai/harness/state/agent-notice-status`
|
|
384
384
|
dedupes these lines: once per cause, and once per branch and code for a failure.
|
|
385
385
|
A working notice records an active key, so a returning cause prints again. A
|
|
@@ -393,8 +393,8 @@ Git-ignored` line and one human `systemMessage`. This line takes the place of
|
|
|
393
393
|
the notice text, because no marker can deduplicate that text. Claude Stop and
|
|
394
394
|
Codex UserPromptSubmit keep only the stderr diagnostic of a failed marker write.
|
|
395
395
|
Without a marker, the line would repeat at each turn, and each Claude Stop line
|
|
396
|
-
starts one more turn.
|
|
397
|
-
|
|
396
|
+
starts one more turn. Run `repo-harness update`; it writes the runtime-state
|
|
397
|
+
block to the user-level Git excludes file.
|
|
398
398
|
|
|
399
399
|
| Point | Hosts | When |
|
|
400
400
|
| --- | --- | --- |
|
|
@@ -484,7 +484,8 @@ After handler or workflow-contract changes, run:
|
|
|
484
484
|
|
|
485
485
|
```bash
|
|
486
486
|
bun test
|
|
487
|
-
|
|
488
|
-
repo-harness run check-task-workflow
|
|
489
|
-
repo-harness init --repo . --dry-run
|
|
487
|
+
bash scripts/check-ci.sh governance
|
|
490
488
|
```
|
|
489
|
+
|
|
490
|
+
That lane also runs the state boundary check, the helper projection check and
|
|
491
|
+
`repo-harness init --repo . --dry-run` (`scripts/check-ci.sh#governance`).
|
|
@@ -18,24 +18,24 @@ The grades describe repository boundaries. The delegation rows use evidence from
|
|
|
18
18
|
|
|
19
19
|
| Requirement | Level | Current boundary and evidence | Source of truth |
|
|
20
20
|
|---|---|---|---|
|
|
21
|
-
| Assign a single writer per directory; never give concurrent agents overlapping write ownership. | **G** | The root agent instructions
|
|
22
|
-
| Run parallel writers only in separate worktrees from a clean source. Never silently drop isolation when worktree creation fails. | **G** | This is the upstream host requirement. The inspected start helper creates a Git worktree and rejects residual state with `--fresh`, but has no source-clean check in its start path (`scripts/contract-worktree.sh
|
|
23
|
-
| Refuse reuse when the caller requests a fresh contract worktree. | **E** | `--fresh` refuses an already-linked tree and existing metadata, path, worktree, or branch; it is an explicit option, not the default (`scripts/contract-worktree.sh
|
|
24
|
-
| Child agents default to fresh task context and do not spawn further children. | **G** | The Codex install guidance asks for `fork_turns="none"` (`docs/reference-configs/install-profiles.md
|
|
25
|
-
| Accept the exact subject with its evidence, rather than treating exit code zero as acceptance. | **E** | Acceptance parsing refuses stale subject
|
|
26
|
-
| After an interrupted managed push/PR/merge, recover explicitly with `recover reconcile`; never automatically replay the external effect. | **E** | Managed
|
|
21
|
+
| Assign a single writer per directory; never give concurrent agents overlapping write ownership. | **G** | The root agent instructions give each task its own worktree at `/tmp/<repo>-wt-<slug>` and forbid one beside the main checkout (`CLAUDE.md#worktrees`, `AGENTS.md#worktrees`). No hook renders a single-writer rule, and no code acquires a directory-wide edit lease. | Root agent instructions; the active task's allowed paths and ownership brief. |
|
|
22
|
+
| Run parallel writers only in separate worktrees from a clean source. Never silently drop isolation when worktree creation fails. | **G** | This is the upstream host requirement. The inspected start helper creates a Git worktree and rejects residual state with `--fresh`, but has no source-clean check in its start path (`scripts/contract-worktree.sh#start_worktree`). Do not describe the complete requirement as enforced. | Active contract's worktree boundary; `docs/researches/20260930-pi-harness-packages-extraction.md`, section 6.4. |
|
|
23
|
+
| Refuse reuse when the caller requests a fresh contract worktree. | **E** | `--fresh` refuses an already-linked tree and existing metadata, path, worktree, or branch; it is an explicit option, not the default (`scripts/contract-worktree.sh#require_fresh`). | `contract-worktree start --fresh`. |
|
|
24
|
+
| Child agents default to fresh task context and do not spawn further children. | **G** | The Codex install guidance asks for `fork_turns="none"` (`docs/reference-configs/install-profiles.md#fork_turns`). No hook or policy key sets spawn depth or validates the child's inherited transcript. `SubagentStart` records the native role observation and refuses no spawn (`src/cli/hook/subagent-context.ts#persistNativeRoleRoutingEvidence`). | Host-native spawn configuration. |
|
|
25
|
+
| Accept the exact subject with its evidence, rather than treating exit code zero as acceptance. | **E** | Acceptance parsing refuses stale subject and contract evidence on its own: `validateAcceptanceReceiptAgainstPolicy` refuses a stale repository root, campaign, admission or goal, and `inspectAcceptanceCurrentBinding` refuses a stale semantic subject, verification evidence or observation (`src/effects/review/acceptance-receipt.ts#validateAcceptanceReceiptAgainstPolicy`, `src/effects/review/acceptance-receipt.ts#inspectAcceptanceCurrentBinding`). Scope: the receipt-backed completion gate. | Acceptance Policy in the active contract; the `repo-harness-issue-flow` skill (`references/acceptor.md`); AcceptanceReceipt and prepared verification evidence. |
|
|
26
|
+
| After an interrupted managed push/PR/merge, recover explicitly with `recover reconcile`; never automatically replay the external effect. | **E** | Managed ship refuses unfinished closeout re-entry (`scripts/ship-worktrees.sh#closeout_journal_guard_reentry`). Reconcile requires an already-landed push and completes the missing phases without pushing again (`scripts/ship-worktrees.sh#recover_ship`). Normal first execution may perform the effect; before it lands, recovery uses `abort`. | `long-run-continuation.md`, Crash Recovery; the worktree-scoped closeout journal. |
|
|
27
27
|
| Apply the same explicit-recovery discipline to external effects outside managed closeout. | **G** | The inspected closeout helpers do not intercept arbitrary host shell commands. A host must not replace the managed recovery protocol with its own retry loop. | `long-run-continuation.md`, Crash Recovery; the operation's authorization. |
|
|
28
28
|
| Missing metadata means unknown; absence alone never authorizes destructive cleanup. | **G** | This is a host-wide rule, not a universal metadata gate (`docs/researches/20260930-pi-harness-packages-extraction.md`, section 6.4). Resolve authoritative Git/store state and ownership before cleanup. | Host guidance; the operation's cleanup/recovery authority. |
|
|
29
|
-
| Refuse managed worktree cleanup when merge proof or readable, clean, unlocked worktree state is unavailable. | **E** | Cleanup requires merge proof and refuses unreadable status, a locked worktree, or dirty content. Runtime metadata absence does not replace these checks (`scripts/contract-worktree.sh
|
|
30
|
-
| Enforce MCP write authorization/admission independently of tool exposure. | **E** |
|
|
29
|
+
| Refuse managed worktree cleanup when merge proof or readable, clean, unlocked worktree state is unavailable. | **E** | Cleanup requires merge proof and refuses unreadable status, a locked worktree, or dirty content. Runtime metadata absence does not replace these checks (`scripts/contract-worktree.sh#cleanup_worktree`). Scope: real cleanup, not a dry-run preview. | `contract-worktree cleanup`; Git topology, merge proof, and worktree status. |
|
|
30
|
+
| Enforce MCP write authorization/admission independently of tool exposure. | **E** | MCP startup resolves one profile with its own read and write globs (`src/cli/mcp/policy.ts#getMcpPolicy`, `src/cli/mcp/server.ts#createMcpToolContext`). A repository mutation refuses a `read_only` registry entry (`src/cli/mcp/general-repo-access/authority.ts#assertRepoWriteEnabled`), and a fleet tool refuses a target outside the adopted registry (`src/cli/mcp/fleet-tools.ts#targetFromArgs`). Workflow-artifact writes separately use their policy path guard (`src/cli/mcp/tools.ts#writeMarkdownArtifact`). These are distinct write paths, not one universal grant. | MCP policy and registered-repository authorization; each owner handler. |
|
|
31
31
|
| Keep MCP writes bounded, inspect each result, and retain operation evidence even when an enclosing script fails. | **G** | No inspected exposure setting or audit helper enforces this complete requirement. The audit is best-effort; the narrower write protections and durable-record example below are **E** only within their own paths. | MCP usage guidance below; each tool's structured result and canonical store. |
|
|
32
32
|
|
|
33
33
|
## Host Landing
|
|
34
34
|
|
|
35
35
|
| Host | Native execution and repo-harness landing | Enforcement boundary |
|
|
36
36
|
|---|---|---|
|
|
37
|
-
| Claude Code | Use the host's native subagent surface. The shared route registry attaches `PreToolUse` edit and subagent routes; the `Task`/`Agent` handler appends a return contract to the prompt (`src/cli/hook/route-registry.ts
|
|
38
|
-
| Codex | Use native `spawn_agent` with the installed role and a self-contained task packet. The registry selects the Codex-only `SubagentStart.context` route; the handler emits the child scope context (`src/cli/hook/route-registry.ts
|
|
37
|
+
| Claude Code | Use the host's native subagent surface. The shared route registry attaches `PreToolUse` edit and subagent routes; the `Task`/`Agent` handler appends a return contract to the prompt (`src/cli/hook/route-registry.ts#ROUTES`, `src/cli/hook/return-channel.ts#runReturnChannel`). | **E** for installed typed-hook behavior and invoked CLI/MCP gates only. Appended instructions do not make writer ownership, fresh context, or spawn depth mechanically enforced. The Codex-only `SubagentStart.context` route does not run here. |
|
|
38
|
+
| Codex | Use native `spawn_agent` with the installed role and a self-contained task packet. The registry selects the Codex-only `SubagentStart.context` route; the handler emits the child scope context (`src/cli/hook/route-registry.ts#ROUTES`, `src/cli/hook/subagent-context.ts#runSubagentContext`). | **E** for the installed route's handling. SubagentStart records the native role observation and refuses no spawn. Fresh-context and depth requirements remain **G**; scope text is guidance, not a filesystem lock. |
|
|
39
39
|
| Pi | Load `src/pi/extension.ts` through the package's `pi.extensions` entry. Map native edit, write and bash calls, including codemode nested calls, to the typed guards. Pi has no built-in subagent route. | **E** within the extension's `tool_call` path. A failed capability probe blocks these tools in an opted-in repository. Other write paths remain outside this boundary. |
|
|
40
40
|
|
|
41
41
|
Install and trust the user-level hook adapters before relying on their routes. Read the active contract for scope; use the receipt-backed gate for acceptance and the journal-backed helper for closeout. Native process/session state is an observation, not permission to change workflow authority.
|
|
@@ -62,17 +62,17 @@ If using Pi MCP, keep ordinary discovery in `codemode` and set `hidden` only for
|
|
|
62
62
|
|
|
63
63
|
Write safety has three parts:
|
|
64
64
|
|
|
65
|
-
1. **Usage constraint (G).** Do not batch writes inside codemode scripts. Dispatch a bounded mutation, inspect its result and authoritative state, then decide the next action. A failed outer script does not undo completed effects. Inspect `isError` and `structuredContent.error` where provided: Pi resolves MCP error results rather than rejecting them (`docs/researches/20260930-pi-codemode-lazy-loading.md
|
|
65
|
+
1. **Usage constraint (G).** Do not batch writes inside codemode scripts. Dispatch a bounded mutation, inspect its result and authoritative state, then decide the next action. A failed outer script does not undo completed effects. Inspect `isError` and `structuredContent.error` where provided: Pi resolves MCP error results rather than rejecting them (`docs/researches/20260930-pi-codemode-lazy-loading.md#isError`). Workflow-tool errors also require inspecting their error payload: `errorResult` does not set `isError` (`src/cli/mcp/tools.ts#errorResult`).
|
|
66
66
|
2. **Server authorization and admission (E, path-specific).** Retain profile, repository/path authorization, revision preconditions, and owner fences. Do not derive authorization from discovery, exposure, or `readOnlyHint`. A hidden tool in one host is not a revoked server-side grant.
|
|
67
|
-
3. **Audit and evidence (G for complete coverage).** Request and retain each operation's canonical evidence. MCP audit writes go to `.ai/harness/mcp/audit.log`, but `tryWriteMcpAuditEntry` returns `false` on storage failure and callers ignore
|
|
67
|
+
3. **Audit and evidence (G for complete coverage).** Request and retain each operation's canonical evidence. MCP audit writes go to `.ai/harness/mcp/audit.log`, but `tryWriteMcpAuditEntry` returns `false` on storage failure and its callers ignore the result (`src/core/public-projections/mcp-audit-log.ts#MCP_AUDIT_LOG_RELATIVE_PATH`, `src/cli/mcp/audit.ts#tryWriteMcpAuditEntry`, `src/cli/mcp/tools.ts#audit`). A successful mutation can therefore lack an audit entry. Host nested-call records do not upgrade this server-side behavior.
|
|
68
68
|
|
|
69
69
|
### Inspected Write Paths
|
|
70
70
|
|
|
71
71
|
| Path | Level and actual protection | Evidence limit |
|
|
72
72
|
|---|---|---|
|
|
73
|
-
| Workflow artifacts: `writeMarkdownArtifact` → `guardedWriteFile` → audit → result | **E**: policy path guard, target-type/revision refusal, exclusive per-file lock, file fsync and rename (`src/cli/mcp/tools.ts
|
|
74
|
-
| General repository mutations: `write_file` and shared dispatch | **E**: read-write admission, path locks and revision/absence conditions in the inspected file-write path (`src/cli/mcp/general-repo-access.ts
|
|
75
|
-
| Fleet
|
|
73
|
+
| Workflow artifacts: `writeMarkdownArtifact` → `guardedWriteFile` → audit → result | **E**: policy path guard, target-type/revision refusal, exclusive per-file lock, file fsync and rename (`src/cli/mcp/tools.ts#writeMarkdownArtifact`, `src/cli/mcp/guarded-write.ts#guardedWriteFileUnderLock`). | The returned hash describes the artifact; it is not a persisted audit receipt. Audit happens after the write and its failure does not block success (`src/cli/mcp/tools.ts#audit`). Directory fsync is best-effort. No fail-closed audit-evidence path was found here. |
|
|
74
|
+
| General repository mutations: `write_file` and shared dispatch | **E**: read-write admission, path locks and revision/absence conditions in the inspected file-write path (`src/cli/mcp/general-repo-access.ts#writeFileTool`, `src/cli/mcp/general-repo-access.ts#withMutationLocks`, `src/cli/mcp/general-repo-access.ts#readExpectedExistingWriteTarget`, `src/cli/mcp/general-repo-access.ts#assertWriteTargetAbsent`). | Shared dispatch audits after the operation; audit and metric/trace appends swallow storage failure (`src/cli/mcp/general-repo-access.ts#audit`, `src/cli/mcp/general-repo-access.ts#tryAppendJsonLine`). No universal evidence-before-mutation gate was found. |
|
|
75
|
+
| Fleet adapter | **E** for the inspected fleet authorization checks; no complete-audit grade. | The adapter calls the same best-effort audit helper (`src/cli/mcp/fleet-tools.ts#audit`). Domain records are separate from audit; their existence must be verified in their owner path. |
|
|
76
76
|
|
|
77
77
|
The inspected paths do not establish equivalent semantics for every MCP write. Keep artifact persistence, operation evidence, diagnostic audit, and semantic acceptance distinct. If required evidence is unavailable, stop and report the gap rather than infer acceptance from a returned status.
|
|
78
78
|
|
|
@@ -11,12 +11,9 @@ that used it (#692, #695):
|
|
|
11
11
|
|
|
12
12
|
## Policy Status
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`off`. Stop never blocks on a minimal-change finding. This repository sets
|
|
18
|
-
`mode: "advice"`. `repo-harness init` writes `{ "mode": "advice" }`. No code
|
|
19
|
-
reads the value after validation.
|
|
14
|
+
No code reads or validates `minimal_change`. The key is outside the policy
|
|
15
|
+
schema, so `repo-harness init` removes it and names it in the
|
|
16
|
+
`unknown-policy-keys` warning. Stop never blocks on a minimal-change finding.
|
|
20
17
|
|
|
21
18
|
`.ai/harness/checks/minimal-change.latest.json` and
|
|
22
19
|
`.ai/harness/checks/minimal-change-audit.latest.json` have no writer and no
|