repo-harness 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/assets/reference-configs/agentic-development-flow.md +1 -1
  3. package/assets/reference-configs/external-tooling.md +45 -9
  4. package/assets/reference-configs/global-working-rules.md +1 -1
  5. package/assets/reference-configs/herdr-notify.md +31 -8
  6. package/assets/skill-commands/repo-harness-architecture/references/worker.md +3 -2
  7. package/assets/skill-version.json +2 -2
  8. package/assets/skills/repo-harness-issue-flow/SKILL.md +6 -4
  9. package/assets/skills/repo-harness-issue-flow/references/acceptor.md +5 -4
  10. package/assets/skills/repo-harness-issue-flow/references/orchestrator.md +24 -9
  11. package/dist/hook-entry.js +310 -122
  12. package/package.json +18 -18
  13. package/scripts/check-agent-tooling.sh +32 -13
  14. package/src/cli/commands/board.ts +15 -1
  15. package/src/cli/commands/global-runtime.ts +65 -6
  16. package/src/cli/commands/init-hook.ts +11 -1
  17. package/src/cli/commands/operator-actions.ts +20 -1
  18. package/src/cli/commands/operator.ts +1 -0
  19. package/src/cli/commands/quota.ts +4 -3
  20. package/src/cli/commands/seats.ts +53 -18
  21. package/src/cli/hook/handler-registry.ts +23 -1
  22. package/src/cli/hook/stop-handler.ts +35 -4
  23. package/src/cli/index.ts +3 -1
  24. package/src/cli/installer/install-profile.ts +6 -4
  25. package/src/core/architecture/projection.ts +3 -33
  26. package/src/core/board/quota.ts +6 -0
  27. package/src/core/board/seat-launch.ts +60 -29
  28. package/src/core/board/seat-reset.ts +108 -0
  29. package/src/core/board/seat-routing.ts +66 -31
  30. package/src/core/board/seats-settings.ts +34 -34
  31. package/src/core/terminal/herdr-core-pin.json +11 -11
  32. package/src/effects/architecture/projection-writer.ts +137 -3
  33. package/src/effects/board/pi-fleet-roles.ts +60 -0
  34. package/src/effects/board/seat-reset.ts +471 -0
  35. package/src/effects/board/seats-configuration.ts +21 -22
  36. package/src/effects/board/seats.ts +40 -0
  37. package/src/effects/operator/seats-settings-route.ts +0 -1
  38. package/src/effects/terminal/herdr-core.ts +22 -6
  39. package/src/effects/terminal/native-task-session.ts +1 -1
  40. package/src/effects/terminal/notify-relay.ts +21 -0
  41. package/src/effects/terminal/runtime-closeout.ts +72 -6
  42. package/src/pi/compat.ts +1 -1
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.27.0` · workflow stamp `repo-harness@0.27.0+template@0.27.0`
334
+ - npm: `repo-harness@0.28.0` · workflow stamp `repo-harness@0.28.0+template@0.28.0`
335
335
  - History: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
336
336
  - License: MIT — see [`LICENSE`](LICENSE)
@@ -112,7 +112,7 @@ The orchestrator seat is the long-lived coordinator and integrator seat of
112
112
  `repo-harness-issue-flow`. Start it with the argv that
113
113
  `repo-harness seats argv orchestrator` prints. It dispatches work and follows
114
114
  PRs and CI. It edits no product code. It may call the read-only roles
115
- `gatekeeper`, `explorer` and `deep-reasoner` as sub-agents. The writers
115
+ `explorer` and `deep-reasoner` as sub-agents. The gatekeeper, the writers
116
116
  (`fast-worker`, `deep-worker`, `root-cause-prover`) and the Codex
117
117
  cross-review never run as its sub-agents: they run in Herdr seats, for
118
118
  worktree isolation and one writer per file.
@@ -1020,8 +1020,11 @@ provider process. `repo-harness architecture-projection status --json` adds the
1020
1020
  exact package capability handshake and project apply readiness.
1021
1021
  `projectionProvider.command` is the managed invocation `[nodePath, binaryPath]`.
1022
1022
  Guidance runs archctx only as `"$NODE" "$ARCHCTX" <command>`, with `NODE` and
1023
- `ARCHCTX` taken from that field. A bare archctx on PATH is an unrelated copy and
1024
- can have another version. When the repository has no complete ArchContext model,
1023
+ `ARCHCTX` taken from that field. Update installs the pinned CLI entry at
1024
+ `<BUN_INSTALL>/bin/archctx`. Setup check fails when PATH resolves to an unrelated
1025
+ copy and reports the owner-specific uninstall command. For an npm global copy,
1026
+ the command uses the owning prefix's Node and npm with `--prefix <prefix> -g
1027
+ uninstall archctx`. When the repository has no complete ArchContext model,
1025
1028
  `next` names the adoption flow in the `repo-harness-architecture` worker
1026
1029
  reference. The running
1027
1030
  repo-harness package owns the `archctx` executable and exact dependency version;
@@ -1051,11 +1054,43 @@ first: a stale `node_modules` fails the archctx version check. The command
1051
1054
  resolves the archctx pinned by the repo-harness package and a compatible Node
1052
1055
  runtime. It runs archctx in the target repository root, and archctx derives the
1053
1056
  writer repository from that directory. It fixes the upstream target to `origin`,
1054
- base `main`, branch `archctx/projection`, publisher `gh`. `follow` delegates the
1055
- 300-second loop to archctx. The command forwards SIGINT and SIGTERM to archctx
1056
- and returns its exit code. archctx owns the shared lock, worktree, render,
1057
- commit, push and rolling PR. It never pushes main. No GitHub App, new secret,
1058
- Actions writer or repo-harness publication loop is used. The operator supplies
1057
+ base `main`, branch `archctx/projection`, publisher `gh`. The command forwards
1058
+ SIGINT and SIGTERM to archctx and returns its exit code. archctx owns the shared
1059
+ lock, worktree, render, commit, push and rolling PR. It never pushes main. No
1060
+ GitHub App, new secret or Actions writer is used.
1061
+
1062
+ `follow` runs only under bun from a repo-harness Git source checkout. The
1063
+ checkout at `origin/main`, with its dependencies installed for that commit, is
1064
+ the one owner of the writer code version. archctx uses the checkout only as the
1065
+ Git repository and renders in its own detached worktree under
1066
+ `ARCHCONTEXT_STATE_DIR`, so moving the checkout does not move the projection
1067
+ target. Every 300 seconds, `follow` fetches `origin main`. When main moved, it
1068
+ refuses a checkout with local changes, fast-forwards, runs
1069
+ `bun install --frozen-lockfile`, records the installed commit in
1070
+ `node_modules/.repo-harness-writer-install`, writes an `updated` JSON line and
1071
+ exits with status 75. A missing install record also triggers the install and
1072
+ the restart. The supervisor restarts the process on that non-zero exit, so the
1073
+ next process runs the new code and the archctx that main pins. When the
1074
+ checkout, the install record and the running code all match main, `follow` runs
1075
+ one archctx `once` publication. When the fetch, the fast-forward or the install
1076
+ fails, `follow` writes an `update-failed` JSON line with code
1077
+ `writer_update_failed`, the checkout HEAD and the `origin/main` commit to stdout
1078
+ on each try, and the same line to stderr once per distinct error. It does not
1079
+ publish until the update succeeds. When main moves several times, each move
1080
+ costs at most one restart, and launchd `ThrottleInterval` spaces restarts at 300
1081
+ seconds. One window stays open: archctx fetches main itself and has no input
1082
+ for the checked commit. It fetches before its first render and again in its
1083
+ internal retry loop. A main move after the writer's check, before either fetch,
1084
+ can render one newer commit with the older writer. The rolling PR's CI does not
1085
+ compare renders. The Daily architecture freshness lane runs render equivalence
1086
+ on main and fails when the published output differs from what current main
1087
+ renders. A version mismatch that renders the same output is harmless. The next
1088
+ main move renders again with the new writer. The upstream fix is
1089
+ Ancienttwo/arch-context#504 (`--base-sha`). Stale projections then also fail the
1090
+ daily architecture freshness check on main, which opens a CI repair issue. A
1091
+ local commit or a dirty file that blocks the fast-forward needs an operator
1092
+ repair. The installed package is not used for `follow`: releases lag main, and
1093
+ a long-running process does not reload a `repo-harness update`. The operator supplies
1059
1094
  existing Git and gh authentication. The resulting PR runs normal CI. The merge
1060
1095
  rule for that PR is below.
1061
1096
 
@@ -1072,8 +1107,9 @@ writer-owned worktree. Do not replace a shared daemon or index other workspaces.
1072
1107
  Inspect facts again if archctx reports a stale index after the base moves; the
1073
1108
  command does not invent a repair.
1074
1109
 
1075
- Run `follow` under the operator's process supervisor after setup. Inspect each
1076
- JSON run result and `status`: `busy` means another writer holds the lock;
1110
+ Run `follow` under the operator's process supervisor after setup. The
1111
+ supervisor must restart the process after a non-zero exit (launchd: `KeepAlive`
1112
+ with `SuccessfulExit` false). Inspect each JSON run result and `status`: `busy` means another writer holds the lock;
1077
1113
  `human-action-required` needs the reported model, proof or ownership decision;
1078
1114
  `failed` carries the upstream error. Do not interpret a live process as
1079
1115
  successful publication.
@@ -84,7 +84,7 @@ When a task requires broad research, repo archaeology, multi-source synthesis, o
84
84
  - 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.
85
85
  - The parent agent owns task management, conflict resolution, build and post-merge integration verification, including typecheck and affected tests.
86
86
  - 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.
87
- - The orchestrator seat is a long-lived session that starts from `repo-harness seats argv orchestrator`, not a sub-agent. It may call the read-only roles `gatekeeper`, `explorer` and `deep-reasoner` as sub-agents. It dispatches writers (`fast-worker`, `deep-worker`, `root-cause-prover`) and the Codex cross-review only to Herdr seats, for worktree isolation and one writer per file. It edits no product code.
87
+ - The orchestrator seat is a long-lived session that starts from `repo-harness 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.
88
88
 
89
89
  ## Peer Harness Collaboration
90
90
 
@@ -30,11 +30,14 @@ This topology applies to issue-flow work (`repo-harness-issue-flow`) on herdr-co
30
30
  - 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.
31
31
  - Recommended models for a Claude-only setup: the orchestrator runs Opus at high effort, and the advisor runs Opus at max effort. This is a recommendation, not a requirement. No seat requires a specific model (issue-flow D7).
32
32
  - Cleanup: after a PR is accepted and merged, the orchestrator closes the worker's pane, which ends the worker process. It then removes the worker's worktree with `git worktree remove <path>` and deletes the merged branch. A pane or worktree with unmerged or dirty work stays, and the orchestrator reports it.
33
+ - 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.
33
34
 
34
35
  ### Runtime commands
35
36
 
36
37
  Use `hc` for terminals and `herdr-app do` for tabs and panes. In an hc terminal, `HC_TERMINAL_ID` is your address. `hc --help` and `herdr-app commands` are the syntax authority.
37
38
 
39
+ Find every live seat of the repository with `repo-harness board seats --json`, including seats without a parent issue. Wait with `hc wait <t>` or follow `hc events`. Never use `sleep` loops to wait for seats.
40
+
38
41
  Commands for the topology steps:
39
42
 
40
43
  | Step | Command |
@@ -48,7 +51,7 @@ Commands for the topology steps:
48
51
  | Wait for a worker | `hc wait <t>` |
49
52
  | Close a worker pane | `herdr-app do pane.close --pane <pane>` |
50
53
 
51
- 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. The seat runs with sandbox network off (#1770): it runs no `gh` or `hc`, and the orchestrator reads its last message.
54
+ 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).
52
55
 
53
56
  `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.
54
57
 
@@ -60,27 +63,47 @@ Before each dispatch wave, run `repo-harness quota`. Launch each task with `repo
60
63
  | `worker-deep` | Codex, `gpt-6.1-sol`, high |
61
64
  | `worker-important` | Claude, `opus`, medium |
62
65
  | `worker-important-fast` | Claude, `sonnet`, medium |
63
- | `worker-light` | Not configured (`null`); configure it before launch or routing |
64
- | `gatekeeper` | Codex, `gpt-6.1-terra`, high; read and shell only |
65
- | `reviewer` | Claude, `opus`, high; read and shell only |
66
+ | `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 |
67
+ | `gatekeeper` | Codex, `gpt-6.1-terra`, high; read, shell and network |
68
+ | `reviewer` | Claude, `opus`, high; read, shell and network |
66
69
 
67
70
  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.
68
71
 
69
72
  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.
70
73
 
71
- `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 `null`. Its argv returns `seat_not_configured` until it is configured. Each configured seat must use an enabled runtime when saved; the defaults do not require Pi.
74
+ `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`.
72
75
 
73
- Routing first selects normal or surplus accounts, or Pi without an account reading. A second pass selects unknown accounts or tight ChatGPT. Exhausted accounts are excluded. Tight or exhausted Claude stays reserved for the advisor and orchestrator; frontend waits for Claude. In those Claude states, the explorer line uses `routing.low_quota_explorer` (default `haiku` high); otherwise it says `default`.
76
+ Routing selects the first eligible seat with a known account state, or a Pi seat without an account (the DeepSeek `worker-light`). A Pi seat on `magpie/codex/` has the `chatgpt` account. It selects an unknown account only when no such seat is eligible. Exhausted accounts are excluded. Claude in saving mode or exhausted stays reserved for the advisor and orchestrator. Important non-frontend work then uses a configured Pi `worker-light`; a null or non-Pi seat gives a `none` route. Frontend waits for Claude. `tight` is a display state only. When Claude is reserved, the explorer line uses `routing.low_quota_explorer` (default `haiku` high). Pass its model when you call the explorer. Otherwise the line says `default`.
74
77
 
75
- `routing.mode` defaults to `standard`. In `hyper`, `routing.hyper.claude` replaces the model and effort of Claude seats (default `opus` high), `hyper.advisor` selects the advisor on Claude (default `opus` max), and `hyper.codex` replaces Codex models and efforts (default `gpt-6-astra` high). Pi, tools, fleet and class lists stay as configured. Only an exhausted Claude advisor falls back to Codex with `hyper.codex`; the quota output names this fallback. An absent section uses defaults. Stored sections may omit new seat keys and the whole routing block; a POST writes the full section.
78
+ `routing.claude_saving_below_remaining` defaults to 20. Claude saving mode applies when weekly remaining quota is below that percent; otherwise its mode is normal. `routing.codex_hyper_at_or_above_remaining` defaults to 50. Codex hyper mode applies when weekly remaining quota is at or above that percent; otherwise its mode is normal. A missing weekly reading gives an unknown mode. Modes are derived, never stored. Codex hyper uses the code constant `gpt-6-astra` high for Codex seats. Reserved Claude advisor and orchestrator seats use `opus` high. There is no Codex advisor fallback. A Pi seat on `magpie/codex/` gets the Codex hyper model as `magpie/codex/gpt-6-astra` with the hyper effort. Other Pi seats, tools, fleet and class lists stay as configured. An absent seats section uses defaults. Run `repo-harness update` for the one-shot migration of stored sections. The decoder refuses old keys before and after migration; a POST writes the full section.
76
79
 
77
80
  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.
78
81
 
82
+ ### Seat reset
83
+
84
+ 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.
85
+
86
+ 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 transcript. It records the request time and the transcript path in `/tmp/repo-harness-seats/<repository-id>/<seat>/request.json`. `/clear` starts a new transcript, so the next crossing blocks again.
87
+ 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.
88
+ 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 sends `/clear`. The SessionStart hook of the new session writes `session.json` next to the handoff. The command sends the resume prompt only after that file names a new transcript. The resume prompt asks for `RESUMED` first. The resume evidence is an assistant Bash tool call in the new 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.
89
+ 4. The requester reads the handoff, sends `RESUMED` to the peer, then checks the current state with git and gh and continues.
90
+
91
+ Protocol rules. The reset runs with no human step; an owner command is never part of it (owner decision 2026-11-08):
92
+
93
+ - One reset at a time. When both seats cross the threshold, the advisor resets first.
94
+ - The peer sends no other message to the requester from `RESET-REQUEST` until `RESUMED`.
95
+ - 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.
96
+ - Peer seat missing or not answering: no reset, same as above.
97
+ - No new-session signal: `/clear` is typed again. No answer to the resume prompt (no `RESUMED` send in the new transcript): 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.
98
+ - 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.
99
+
100
+ `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 `/clear`, 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. 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.
101
+
79
102
  ### Pane and tab names
80
103
 
81
104
  With `--repository-id`, `seats argv` also prints the pane name (`name`) and the base tab name (`tab`). Do not type a name.
82
105
 
83
- `herdr-app do tab.new` and `pane.split` set no terminal name: the `--name` of `tab.new` is the tab name, and `pane.split` takes no name. So a seat terminal started by the launch rows has no hc name. Only a Claude seat carries the pane name, as its session name (`-n`) in the argv. A Codex seat has no session-name flag and carries no name. Find a seat terminal by its labels (`hc ls --label`), not by its name.
106
+ `herdr-app do tab.new` and `pane.split` set no terminal name: the `--name` of `tab.new` is the tab name, and `pane.split` takes no name. So a seat terminal started by the launch rows has no hc name. Only a Claude seat carries the pane name, as its session name (`-n`) in the argv. A Codex seat has no session-name flag and carries no name. Find a seat terminal with `repo-harness board seats --json`, which reads its labels.
84
107
 
85
108
  The pane name is `<prefix>-<role>[-<item>][-<qualifier>]`: at most 32 characters of `a-z 0-9 -`. Examples: `rh-orch`, `rh-adv`, `rh-w-1508`, `rh-w-rel0252`, `rh-rv-1536-codex`, `aip-w-485-device`.
86
109
 
@@ -36,8 +36,9 @@ not run it unless its task authorizes the push. An operator with Git and gh
36
36
  authentication for the target repo sets `ARCHCONTEXT_STATE_DIR` to one stable
37
37
  absolute path. The operator then runs
38
38
  `repo-harness architecture-projection publish once` in the target repo, or runs
39
- `repo-harness architecture-projection publish follow` under a process
40
- supervisor. `repo-harness architecture-projection publish status` with the same
39
+ `publish follow` from a repo-harness Git source checkout under a process
40
+ supervisor; `follow` keeps that checkout at `origin/main` and does not publish
41
+ while it cannot update. `repo-harness architecture-projection publish status` with the same
41
42
  `ARCHCONTEXT_STATE_DIR` reports the last run; another state dir reports an empty
42
43
  state. The writer pushes only the `archctx/projection` branch and opens or
43
44
  updates one rolling PR. Before that PR merges, check out its head in a clean
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.27.0",
3
- "templateVersion": "0.27.0",
2
+ "version": "0.28.0",
3
+ "templateVersion": "0.28.0",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
@@ -27,9 +27,9 @@ executes them or stops and asks.
27
27
 
28
28
  A **seat** is a process seat: the orchestrator, the advisor or a worker. A
29
29
  **sub-agent** is an `agents/fleet/` role that runs inside a seat process.
30
- The orchestrator calls only the read-only sub-agents `gatekeeper`,
31
- `explorer` and `deep-reasoner`. Writers, `root-cause-prover` included, and
32
- the Codex cross-review run in seats.
30
+ The orchestrator calls only the read-only sub-agents `explorer` and
31
+ `deep-reasoner`. The gatekeeper, the writers, `root-cause-prover`
32
+ included, and the Codex cross-review run in Herdr seats.
33
33
  A **claim role** is the GitHub role that a claim gives: coordinator,
34
34
  writer, head owner, integrator or acceptor.
35
35
 
@@ -38,7 +38,7 @@ writer, head owner, integrator or acceptor.
38
38
  | Orchestrator | Any host's long-lived top-level session with network access, started from `repo-harness seats argv orchestrator` | Coordinator of the parent issue; integrator | Implements a child issue in its own sub-tree; calls a writer sub-agent (`fast-worker`, `deep-worker`, `root-cause-prover`) or runs the Codex cross-review as a sub-agent |
39
39
  | Gap reviewer | A different model family from the orchestrator, when one is available | None. Comments on the drafts | Rewrites the split or decides scope |
40
40
  | Worker | Any capable coding model | Writer of one issue or PR slot, dispatched by the coordinator; head owner of its PR | Posts its own claim, widens scope, merges, pushes to another owner's branch |
41
- | Acceptor | A seat holds the acceptor role and can call the gatekeeper sub-agent, the default reviewer. The orchestrator does not review a PR itself; an independent gatekeeper sub-agent of its seat may review a PR that it dispatched. The Codex cross-review and every other review run in another seat. For the High tier, a different model family when available; otherwise a fresh same-family context | Acceptor of one review in one round | Reviews its own code, pushes code |
41
+ | Acceptor | A seat holds the acceptor role. The default reviewer is the gatekeeper in its own Herdr seat; the acceptor does not call it as a sub-agent. The orchestrator does not review a PR itself; a gatekeeper seat reviews each PR that the orchestrator dispatches. The Codex cross-review and every other review run in another seat. For the High tier, a different model family when available; otherwise a fresh same-family context | Acceptor of one review in one round | Reviews its own code, pushes code |
42
42
 
43
43
  The suggested models are advice, not a requirement. Any capable host may
44
44
  hold any claim role. The High tier records its `model_relation` in the
@@ -72,6 +72,8 @@ the issue, credentials and releases keep their own approval rules.
72
72
 
73
73
  One-time decisions live in issue decision comments. Durable decisions live in `docs/adr/`. `docs/plans/` is banned. A decision is durable when an agent could violate the rule after the issue closes.
74
74
 
75
+ When the owner gives a decision in a seat's pane, that seat gets it onto the owning issue in the same turn. The active coordinator posts it as a `decision` comment with the date and the pane. Any other seat sends it to the coordinator in the same turn, with the date and the pane, and the coordinator posts it. When no issue owns the decision yet, the coordinator opens one or names the gap to the owner.
76
+
75
77
  The comment threads are the message board between agents. Every state
76
78
  change is a typed comment, and chat messages carry only its link. Do not
77
79
  copy an issue into a local file, and do not keep plan, task, review or
@@ -12,8 +12,8 @@ acceptance record (`docs/reference-configs/agentic-development-flow.md`,
12
12
  Review by risk).
13
13
 
14
14
  The gatekeeper is the default acceptor (D6). It reviews the diff and
15
- returns a verdict and findings. It has no network, so the session that
16
- runs the round publishes the result.
15
+ returns a verdict and findings. A seat without the `net` tool group has no
16
+ network, so the session that runs the round publishes the result.
17
17
 
18
18
  No host and no model is mandatory (D7). Any host that can read the PR and
19
19
  return the result schema can accept.
@@ -101,8 +101,9 @@ posts in this order:
101
101
  - the `acceptance record`.
102
102
 
103
103
  It posts no APPROVE review and no REQUEST_CHANGES review. A gatekeeper
104
- has no network, so the session that runs the round publishes its receipt.
105
- A reviewer with network access may publish its own round.
104
+ seat without the `net` tool group has no network, so the session that runs
105
+ the round publishes its receipt. A reviewer with the `net` tool group may
106
+ publish its own round.
106
107
 
107
108
  `review publish` accepts rounds 1 to 3 only. For a round above 3, the
108
109
  session that runs the round posts the `acceptance record` by hand, in the
@@ -218,29 +218,44 @@ module is in the title so that a list view shows the write scopes.
218
218
  ### 7.1 Quota check
219
219
 
220
220
  Before each dispatch wave, run `repo-harness quota`. It prints the account
221
- states and one route line per task class. Launch each task on the seat its
221
+ states, one mode line per account and one route line per task class. For
222
+ example: `claude mode: saving (5% left < 20%)` and
223
+ `codex mode: hyper (68% left >= 50%)`. Launch each task on the seat its
222
224
  route line names with `repo-harness seats argv <seat>`; state the boundary
223
225
  in the task. A `none` route waits.
224
-
225
- A tight or exhausted Claude account is reserved for the advisor and
226
- orchestrator. Its worker classes move to the next eligible seat in their
227
- ordered lists. Frontend waits for Claude; it has no non-Claude fallback.
226
+ Apply the explorer line through the Claude Agent tool's `model` parameter when you call the explorer.
227
+
228
+ Claude saving mode applies when weekly remaining quota is below
229
+ `routing.claude_saving_below_remaining` (default 20). Codex hyper mode applies
230
+ when weekly remaining quota is at or above
231
+ `routing.codex_hyper_at_or_above_remaining` (default 50). Modes are derived,
232
+ never stored. Codex hyper seats use `gpt-6-astra` high. A Pi seat on `magpie/codex/`
233
+ takes the same hyper model as `magpie/codex/gpt-6-astra` with that effort.
234
+
235
+ Claude in saving mode or exhausted is reserved for the advisor and
236
+ orchestrator; both use `opus` high. Important non-frontend work then uses a
237
+ configured Pi `worker-light`; a null or non-Pi seat gives a `none` route.
238
+ Frontend waits for Claude; it has no non-Claude fallback.
228
239
  An exhausted account takes no new dispatch, review seats included.
240
+ `tight` is a display state only; it does not reserve Claude or change routing.
229
241
 
230
- Claude seats use the Claude account, Codex seats use ChatGPT, and Pi seats
231
- have no account reading. Routing applies these rules in both standard and
232
- hyper mode. Put the reading in the `Dispatch reading:` line of each claim:
242
+ Claude seats use the Claude account, Codex seats and Pi seats on `magpie/codex/` use ChatGPT, and the DeepSeek Pi seat
243
+ has no account reading. Put the reading in the `Dispatch reading:` line of each claim:
233
244
  account state, used %, pace, reset time and reading time.
234
245
 
235
246
  | Account state | Route rule | Coordinator action |
236
247
  |---|---|---|
237
248
  | normal or surplus | First pass, in configured seat order | Dispatch to the named seat. |
238
249
  | unknown | Second pass; the line names the state | Dispatch to the named seat and record the unknown state. |
239
- | tight | Claude is reserved; ChatGPT is eligible in the second pass | Follow the named route; frontend waits for Claude. |
250
+ | tight | Display only; the seat stays eligible unless Claude is reserved | Follow the named route. |
240
251
  | exhausted | The account is excluded | Start no new turn on that account. |
241
252
 
242
253
  ## 8. Follow up
243
254
 
255
+ Find the repository's live seats with `repo-harness board seats --json`.
256
+ It includes seats without a parent issue. Wait for a seat with `hc wait <t>`
257
+ or follow `hc events`. Never use `sleep` loops to wait for seats.
258
+
244
259
  Follow the PR and the issue comments. Do not poll CI with sleeps. Use the
245
260
  host's PR events or check when the worker reports.
246
261