TUI hosts sessions: new-session form, named worktrees, resume, faster permissions

- Use the terminal's own colors and background; the key bar and the Needs-you
  panel wrap, fixed-width panels shrink on narrow terminals.
- Sessions run on threads of the TUI (tui/host.rs), capped by the profile's
  `workers`; quitting asks for `yes` and suspends them. New `suspend` command
  keeps the state so a session can be resumed.
- `N` opens a new-session form: machine, name, --after, a named branch or
  worktree (place.rs; never deleted by orch), and a "keep for a PR" option.
- `u` resumes suspended sessions and ones whose process died.
- `A` allows identical permission requests across sessions, `P` saves an allow
  rule to the profile with toml_edit (comments kept).
- Fix clippy lint in report.rs so tests/all.sh passes; add GLOSSARY.md.

Includes the already staged `orch init` work (init.rs, example profile).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
johannesandClaude Sonnet 5.5 committed 2026-11-14 18:04:41 +01:00
1 parent 5a80bc9fe1
commit cfb735cdb3
22 files changed
+1623 -115

No files matched your search

+11 -5
View File
@@ -93,12 +93,12 @@ pub struct Need {
}
impl Need {
/// The key line under the item, like `[y] allow once [Y] always for s4 [n] deny`.
/// The key line under the item, like `[y] allow once [Y] always for s4 [A] all same [n] deny`.
pub fn keys(&self) -> String {
match self.kind {
NeedKind::Review => "[a] approve [d] open diff [c] comment back".into(),
NeedKind::Permission => format!(
"[y] allow once [Y] always for {} [n] deny",
"[y] allow once [Y] always for {} [A] all same [n] deny",
self.session
),
NeedKind::Input => "[r] reply".into(),
@@ -119,6 +119,8 @@ pub struct EventLine {
#[derive(Clone, Default, PartialEq, Debug)]
pub struct Overview {
pub goal: String,
/// Unfinished sessions nobody runs (suspended, or their process died): `u` resumes them.
pub resumable: usize,
pub rows: Vec<Row>,
pub needs: Vec<Need>,
pub events: Vec<EventLine>,
@@ -205,9 +207,9 @@ pub fn build(i: &Input) -> Overview {
.is_none_or(|x| x.status != "merged")
});
let status = match s.status.as_str() {
"merged" => Status::Done,
"merged" | "done" => Status::Done,
"failed" | "aborted" => Status::Fail,
"waiting" | "escalated" => Status::Wait,
"waiting" | "escalated" | "suspended" => Status::Wait,
"queued" if unmet.is_some() => Status::Blocked,
_ if !scan.retry.is_empty() => Status::Fix,
_ => Status::Run,
@@ -216,7 +218,11 @@ pub fn build(i: &Input) -> Overview {
(Status::Blocked, Some(d)) => format!("waits on {d} {}", name_of(d)),
(Status::Done, _) => {
let at = evs.last().map_or(0, |e| e.at);
format!("merged · {} ago", ago(i.now_ms.saturating_sub(at) / 1000))
format!(
"{} · {} ago",
s.status,
ago(i.now_ms.saturating_sub(at) / 1000)
)
}
_ => evs.last().map_or_else(String::new, |e| describe(e)),
};