Files
orch/README.md
T
johannesandClaude Sonnet 5.5 7bf0986640 Add Needs-you queue and goal view with acceptance checks
- needs table: human steps, permission requests and agent questions wait
  for an answer written to the database; a/c/d, y/Y/n, r keys in the TUI
- goal view (g): task graph, critical path, decisions, acceptance checks;
  e edit goal, + add check, R run all checks on main
- checks.rs: acceptance checks on a branch or on main in a clean worktree
- runner: wait for --after dependencies, one session in merge at a time,
  all checks again on main after each merge
- orch goal / check / checks commands, ORCH_DB and {{repo}} for machine steps
- example machines merge with git merge --ff-only

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 12:38:46 +01:00

70 lines
3.8 KiB
Markdown

# orch
Runs many [hx](https://git.jokresner.de/johannes/hx) coding agents on tasks, one git worktree each. Not tied to a
git host: tasks come from a folder or any JSON command, results go to a local branch or any JSON command.
orch run TASK.md --repo DIR --profile NAME one task
orch pull --profile NAME [--limit N] everything the profile's source lists, `workers` at a time
orch status [ID] orch logs ID runs and their raw logs
orch report [FILE] success rate, tokens, retries, duration per profile and hx version
orch bench eval --profile NAME --out A.jsonl run the eval cases; then: orch eval A.jsonl B.jsonl
orch audit [ID] every allowed/denied tool call
## How a run goes
queued, running (hx `-p --mode json`), gating (profile gate), retry with the gate output on the same session, then
done, failed, needs-human (gate still red, or the agent wanted something the allowlist forbids) or requeued
(provider quota used up, the account is paused until its window resets). The work always stays on branch
`orch/ID`. Every finished run appends one line to `<state>/telemetry.jsonl`.
## Profile (`~/.config/orch/profiles/NAME.toml`)
`--profile` defaults to `default`; if `default.toml` does not exist, built-in defaults apply (`hx` from PATH, your own
`~/.hx` login, 2 retries, no allowlist). Any other missing profile name is an error.
```toml
hx = "hx" # command
home = "/work/hxhome" # own HOME => own hx login
provider = "claude"
gate = "sh tests/all.sh" # exit 0 = pass
max_retries = 2
workers = 2
account = "work-claude" # profiles on one login share quota pause and max_concurrent
allow = ["read", "write", "edit", "bash:cargo *"]
[budget]
wall_secs = 1800 # per attempt
max_turns = 40 # whole run
max_tokens = 400000
[source] # dir | cmd
kind = "dir"
path = "/work/tasks"
[sink] # local-branch | cmd
kind = "cmd"
command = "python3 /work/adapters/gitea.py"
```
## State-machine sessions and the TUI
`orch` without a subcommand opens the TUI: sessions overview (`enter` on a row opens the session detail, `esc` goes
back; `t` full test output, `d` diff, `l` event transcript, `o` open the worktree in hx). It reads `.hx/orch.db` of the
current directory. `orch session --repo . --machine task --name NAME [--profile P]` creates a session and runs it.
Machines are TOML files in `.hx/machines/` or `~/.hx/machines/` (examples in `examples/machines/`). A `computer` step
with `report = "junit"` writes its JUnit XML to `$ORCH_REPORT` (also available as `{{report}}` in `cmd`); orch parses
it into counts and failing tests. See ORCHESTRATOR.md for the whole design.
The goal lives in the same database: `orch goal "sentence"`, `orch check NAME CMD [--owner sN]` (an acceptance
check: pass = exit 0), `orch checks [--owner sN | --main]`. `g` in the TUI opens the goal view (task graph, critical
path, decisions, checks; `e` edit goal, `+` add check, `R` run all checks on main). `orch session --after s1,s2` makes
a session wait until those have merged. Only one session at a time runs the state that ends in `merged` (first come,
first served); after each merge all checks run again on main in a clean worktree. Machine steps get `ORCH_DB`,
`ORCH_REPO` and `ORCH_SESSION`, and `{{repo}}` in `cmd`; the example machines merge with
`git -C {{repo}} merge --ff-only {{branch}}` in `mark-merged`.
## More
- [docs/cmd-protocol.md](docs/cmd-protocol.md): task sources and result sinks as external commands (+ JSON schema)
- [docs/safety.md](docs/safety.md): allowlist, credential separation, audit log
- [eval/README.md](eval/README.md): the regression case set
- `sh tests/all.sh`: the full local gate
- `spike/` is the throwaway Python O0 spike, kept for reference