Merge branch 'feat/tui-implementation'
This commit is contained in:
commit
f1ab948bb4
29 files changed
+11321
-8
No files matched your search
@@ -44,6 +44,37 @@ 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.
|
||||
|
||||
A running session can be steered from the session screen, also when `orch session` runs in another terminal: `i`
|
||||
interrupt (the agent stops, you reply with a hint), `m` message to the agent, `s` force a state, `k` kill (type
|
||||
`yes`; goes to `on_abort`), and `r` re-plan from the start state while the loop detector box shows (the last test
|
||||
runs failed on the same tests). On the goal screen `j/k` selects a decision and `v` vetoes it: the agent is told and
|
||||
the session goes back to `code`. The commands go through the database (`commands` table) and the runner picks them
|
||||
up within a fraction of a second, even in the middle of a shell command. A machine can set limits:
|
||||
|
||||
[budget]
|
||||
wall_secs = 5400 # time spent working, waiting for you does not count
|
||||
cost = 5.0 # US dollars
|
||||
compact_at = 85 # percent of the context window; hx gets `hx/compact`
|
||||
|
||||
Passing wall time or cost sends the session to `on_budget` (or fails it when the machine has none).
|
||||
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user