Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

mtui — the Maintenance Test Update Installer — is SUSE QE’s tool for validating maintenance updates: load a request by RRID, install and test it on reference hosts over SSH in parallel, then approve or reject. It drives the OBS/IBS and Gitea review workflows and openQA/QEM; reports load from and upload to TeReGen’s v2 API.

mtui is memory-safe, async-native, and distributed as two static binaries. Its data-format and workflow contracts keep it interoperable with the SUSE maintenance ecosystem: the RRID grammar, the refhosts.yml schema, the report document schema, and the remote-lock wire format.

Two surfaces

  • mtui — the interactive REPL (line editing, tab completion, history). See Invocation for how to launch it and seed a session.
  • mtui-mcp — a Model Context Protocol server whose tools are synthesised from the same command registry as the REPL, so the CLI and the MCP surface never drift. See MCP server.

This book

  • Installation — prebuilt packages, release tarballs, the container image, building from source, completions, and man pages.
  • Invocation — the mtui and mtui-mcp binary flags and how to start a session.
  • Configuration — the TOML config file, its resolution order, and every option with its default.
  • Command reference — every REPL command and its arguments, generated directly from the command registry.
  • Workflow concepts — fan-out across templates, reference-host pool selection, host state, and locking.
  • MCP server — running mtui-mcp, the tool surface, the report-document, file-transfer and job tools, the audit log, profiles, and the security boundary.
  • Architecture — the crate layout and the data-format contracts.
  • Developer guide — the toolchain, quality gates, the command trait, how to add a command, and testing conventions.
  • FAQ.

For contributor conventions and the definition of done, see AGENTS.md, which lives in the repository root.

Installation

mtui ships as two static binaries — mtui (the REPL) and mtui-mcp (the MCP server) — with no runtime interpreter. The channels are:

  • the package from the openSUSE Build Service (OBS), on openSUSE;
  • the release tarballs for x86_64-unknown-linux-musl and aarch64-apple-darwin, each with a .sha256, and the x86_64 .deb/.rpm packages, all on the release page;
  • crates.io (cargo install --locked suse-mtui);
  • the container image;
  • building from source.

Requirements

  • A Rust toolchain, edition 2024, MSRV 1.96. The MSRV is pinned via rust-version in Cargo.toml. There is no rust-toolchain.toml.
  • Optional runtime tools (see Runtime dependencies).

Build from source

# Both binaries, optimized.
cargo build --release

The root suse-mtui facade package exposes a cli and an mcp feature, both enabled by default, so a plain cargo build --release produces both binaries. cargo install --locked suse-mtui installs both mtui and mtui-mcp (the crates.io name differs because mtui belongs to an unrelated project). --no-default-features --features cli (or mcp) builds only the REPL (or only the MCP server), if you want to skip pulling in the MCP SDK (rmcp/axum) or the REPL’s dependencies.

The binaries land in target/release/:

install -Dm755 target/release/mtui     /usr/local/bin/mtui
install -Dm755 target/release/mtui-mcp /usr/local/bin/mtui-mcp

Verify:

mtui --help
mtui --version        # prints version + build provenance (sha, profile, target)
mtui-mcp --help

Shell completions

Completions for bash, zsh, and fish are pre-generated (from the two clap parsers) and checked into dist/completions/. They are regenerable with cargo xtask gen. Install the ones your shell uses:

# bash
install -Dm644 dist/completions/bash/mtui.bash     /usr/share/bash-completion/completions/mtui
install -Dm644 dist/completions/bash/mtui-mcp.bash /usr/share/bash-completion/completions/mtui-mcp

# zsh
install -Dm644 dist/completions/zsh/_mtui     /usr/share/zsh/site-functions/_mtui
install -Dm644 dist/completions/zsh/_mtui-mcp /usr/share/zsh/site-functions/_mtui-mcp

# fish
install -Dm644 dist/completions/fish/mtui.fish     /usr/share/fish/vendor_completions.d/mtui.fish
install -Dm644 dist/completions/fish/mtui-mcp.fish /usr/share/fish/vendor_completions.d/mtui-mcp.fish

Man pages

Man pages for both binaries are pre-generated into dist/man/ (regenerable with cargo xtask gen, byte-stable — they carry the plain crate version, not the build-provenance string):

install -Dm644 dist/man/mtui.1     /usr/share/man/man1/mtui.1
install -Dm644 dist/man/mtui-mcp.1 /usr/share/man/man1/mtui-mcp.1

Runtime dependencies

mtui needs no external programs beyond its own binaries.

The QAM review workflow (assign/unassign/approve/reject/comment) talks to the OBS/IBS API natively — no osc subprocess. It reads credentials from your oscrc, located exactly like osc itself: $OSC_CONFIG, then $XDG_CONFIG_HOME/osc/oscrc, then ~/.oscrc. See the [obs] table in Configuration.

Prebuilt packages (GitHub releases)

Every release carries .deb and .rpm packages next to the tarballs, built by the package job in .github/workflows/release.yml. They split the same way the spec does — mtui recommends mtui-mcp, so installing mtui alone still gets both — with three caveats the OBS build does not have:

  • x86_64 only, built for x86_64-unknown-linux-musl. No aarch64, no macOS.
  • Same Name: as the OBS RPM. In a repository carrying both, they compete by version comparison alone. On openSUSE prefer the OBS package.
  • The .rpms own no directories. cargo-generate-rpm has no %dir, so erasing them leaves the doc- and licensedirs behind.

Because the binaries are static the packages declare no mandatory runtime or library dependencies — no libc, and no shell either, since nothing they ship is a script. Both are asserted by the release job. mtui declares mtui-mcp as a recommends.

Verify with sha256sum --ignore-missing -c mtui-packages.sha256 — one file covers all four packages, so a partial download needs --ignore-missing.

Packaged install (openSUSE)

On openSUSE, prefer the mtui.spec package build, which installs the binaries, completions, and man pages into the standard system paths. It builds two packages:

  • mtui — the REPL, its completions and man page. Recommends mtui-mcp, so a plain zypper in mtui still gets both binaries.
  • mtui-mcp — the MCP server, its completions and man page. Installable on its own; it reads the same config.

Container image

Every push to main and every release tag cut on a branch that carries container.yml (the 26.3.x branch has no container.yml and no Dockerfile) also ships a multi-arch (linux/amd64, linux/arm64) image with both binaries, built by .github/workflows/container.yml:

  • ghcr.io/opensuse/mtui:latest (GA releases), :<X.Y.Z>, :<X.Y> (GA releases), :edge (main branch). Pre-release tags (-rcN) publish only their exact version, never latest or :<X.Y>.
  • The same tags are mirrored to registry.opensuse.org/opensuse/mtui once the mirror credentials are wired up (see the workflow).
  • Images are signed with cosign (keyless) and carry a build-provenance attestation; gh attestation verify oci://ghcr.io/opensuse/mtui:<tag> --repo openSUSE/mtui checks the attestation.

The image runs as a non-root user (mtui, uid 10001) on the openSUSE base with an SSH client for debugging; mtui itself speaks SSH through its own stack, never through that binary. Unlike the static musl release binaries, the image binaries are dynamically linked against the base image’s glibc. No credentials are baked in: mount yours from the host — config files read-only, the ssh copy writable so learned host keys persist. Stage copies owned by the container user (uid 10001) — a host-only ~/.ssh at mode 700 is invisible inside, so copy first. The staged copy is already private (owned by uid 10001, never group/other-readable), so no extra overlay is needed. Never mount the live ~/.ssh with :Z: the private relabel can lock a confined host sshd out of authorized_keys. The copies below use the shared :z label instead. ~/.cache/mtui-container holds secret material (plaintext OBS password, private keys): the recipe scopes it to uid 10001, never group/other-readable.

# Stage copies owned by the container user (once; re-run after rotation).
mkdir -p ~/.cache/mtui-container
cp -p ~/.oscrc ~/.cache/mtui-container/oscrc
cp -rp ~/.ssh ~/.cache/mtui-container/ssh
cp -p ~/.config/mtui/mtui.toml ~/.cache/mtui-container/mtui.toml
podman unshare chown -R 10001:10001 ~/.cache/mtui-container
podman unshare chmod -R u+rwX,go-rwx ~/.cache/mtui-container

To refresh after rotation, remove the container-owned tree from inside the user namespace first, then re-run the recipe: podman unshare rm -rf ~/.cache/mtui-container.

The ssh copy is mounted writable so mtui can persist newly seen host keys there (temp-file + rename in ~/.ssh/): under the default auto_add policy a new host connects once and is remembered across sessions.

A passphrase-protected key needs the agent — mtui tries SSH_AUTH_SOCK first, then identity files, and never prompts for a passphrase. Forward yours with two extra flags on any example below:

-v "$SSH_AUTH_SOCK:/ssh-agent.sock:ro" -e SSH_AUTH_SOCK=/ssh-agent.sock

Note :ro does not restrict what the container can do with the agent: anything reaching the socket can use every loaded key, so forward an agent holding only the keys mtui needs.

$HOME is /home/mtui, and the default template_dir (.) and the history file resolve under it, so back it with a writable volume — that same volume makes the container read-only-rootfs friendly:

# REPL (needs a TTY for `shell`/`edit`).
podman run -it --rm \
  -v mtui-home:/home/mtui \
  -v "$HOME/.cache/mtui-container/oscrc:/home/mtui/.oscrc:ro,z" \
  -v "$HOME/.cache/mtui-container/ssh:/home/mtui/.ssh:z" \
  -v "$HOME/.cache/mtui-container/mtui.toml:/home/mtui/.config/mtui/mtui.toml:ro,z" \
  ghcr.io/opensuse/mtui:latest mtui

With --read-only, add only the mtui-home volume (writable) and keep the credential mounts as above:

podman run -it --rm --read-only \
  -v mtui-home:/home/mtui \
  -v "$HOME/.cache/mtui-container/oscrc:/home/mtui/.oscrc:ro,z" \
  -v "$HOME/.cache/mtui-container/ssh:/home/mtui/.ssh:z" \
  ghcr.io/opensuse/mtui:latest mtui

Serve the MCP tools over HTTP (one process, many isolated clients):

podman run -d --name mtui-mcp -p 127.0.0.1:8000:8000 \
  -v mtui-home:/home/mtui \
  -v "$HOME/.cache/mtui-container/oscrc:/home/mtui/.oscrc:ro,z" \
  -v "$HOME/.cache/mtui-container/ssh:/home/mtui/.ssh:z" \
  ghcr.io/opensuse/mtui:latest \
  mtui-mcp --transport http --host 0.0.0.0 --port 8000

--host 0.0.0.0 binds all container interfaces so the published port reaches the server; -p 127.0.0.1: keeps it off the LAN. Reach it through localhost: rmcp’s DNS-rebinding guard compares the request’s Host header against its allowlist (localhost, 127.0.0.1, ::1 by default), not the client’s address, so any LAN client sending Host: localhost would pass it. Commands on the MCP deny-list are not MCP tools.

Cutting a release (maintainers)

The supported openSUSE RPM is built and published from the Build Service, not from CI. The package sources at the repo root — _service and mtui.spec — build it fully offline from vendored crates via the OBS source services, so nothing is fetched during the network-isolated build. CI’s .deb/.rpm are a separate, x86_64-only convenience (see above) and do not replace this recipe.

One-time maintainer setup

Install the source-service packages and confirm your ibs alias (the same oscrc the native review backend reads):

zypper install obs-service-cargo osc obs-service-tar obs-service-obs_scm \
  obs-service-recompress obs-service-set_version obs-service-format_spec_file \
  cargo cargo-packaging
osc -A ibs whois         # confirms the `ibs` alias resolves

The crates.io publish uses Trusted Publishing: no registry token is stored. One-time setup:

  • the crates-io environment on openSUSE/mtui (GitHub web UI, needs repo admin; optionally with required reviewers, so a publish waits for a human click);
  • on crates.io, for each of the ten crates (suse-mtui and the nine mtui-* crates; Settings → Trusted Publishing, as an owner): repository owner openSUSE, repository mtui, workflow release.yml, environment crates-io.

The crates-io job requests id-token: write, and rust-lang/crates-io-auth-action swaps the job’s OIDC token for a short-lived crates.io token that is revoked when the job ends. A crate that does not exist yet cannot be configured, and crates.io refuses to let a Trusted Publishing token create one. So the first publish of a new crate name is the whole workspace, run locally before the tag is pushed, from a clean checkout of the tag, with a scoped API token (publish-new + publish-update, crate scopes suse-mtui and mtui-*, a one-day expiry) exported as CARGO_REGISTRY_TOKEN:

git worktree add ../mtui-tag X.Y.Z   # the tag exists locally, not yet pushed
cd ../mtui-tag
CARGO_REGISTRY_TOKEN=… cargo publish --workspace --locked

Push the tag only once all ten crates show X.Y.Z on crates.io. The tag’s crates-io job then stops at already exists on crates.io index without uploading anything. Afterwards add the new crate’s Trusted Publishing entry, revoke the token, and keep no registry token in GitHub.

Release model

main is development. Its version is X.Y.0 and it never tags or publishes a release. A release is always cut on a per-minor branch (26.3.x, 26.4.x, …, forked from main and never merged back):

  • The stable branch is the highest-numbered X.Y.x branch (compared as numbers, so 26.10.x is higher than 26.9.x). Its versions are X.Y.Z with Z >= 1.
  • Only a plain X.Y.Z tag (Z >= 1, no pre-release suffix) whose commit is on the stable branch publishes to crates.io. The gate job in release.yml decides this with .github/scripts/crates-io-gate.sh (tested by xtask/tests/crates_io_gate.rs) plus a git merge-base --is-ancestor check of the tagged commit.
  • Every tag still gets a GitHub release. A tag on an older branch, an X.Y.0 tag or a pre-release tag is not published to crates.io.
  • After 26.5.x is forked and before 26.5.1 is tagged, a 26.4.z tag does not publish. That is by design.

All ten publishable crates move together: the suse-mtui facade (binaries stay mtui/mtui-mcp) and the nine mtui-* libraries (xtask has publish = false and is skipped). Cargo publishes them in dependency order.

Release flow

  1. Cherry-pick the fixes onto the stable branch (for a new line, fork X.Y.x from main and set the first patch version X.Y.1).
  2. Bump the version, as its own commit (chore(release): bump version to X.Y.Z): [workspace.package] version plus the =… pins in [workspace.dependencies], then refresh Cargo.lock and run cargo xtask gen. The pins cannot derive the workspace version with plain cargo, so the bump is manual, and cargo test -p xtask --test packaging fails until all match.
  3. Cut the changelog (chore(release): cut X.Y.Z): rename ## [Unreleased] to ## [X.Y.Z] - <date>.
  4. Check the publish locally: cargo publish --workspace --locked --dry-run.
  5. Tag the commit (git tag X.Y.Z) and push the branch and the tag (git push origin X.Y.x X.Y.Z). The tag is the bare version; a v-prefixed tag is invalid. If the release adds a crate that is not on crates.io yet, publish the workspace locally first (see One-time maintainer setup) and push the tag after.
  6. The tag push drives .github/workflows/release.yml: build and package, the GitHub release, then, when the gate says so, cargo publish --workspace --locked in the crates-io job.
  7. The OBS recipe below then ships the openSUSE RPM from the tag.

main takes no release commit. Do not tag on main: an X.Y.0 tag would get a GitHub release but never publishes.

Recovering from a partial publish

cargo publish --workspace is not atomic, and crates.io limits new crate names to a burst of five, then about one every ten minutes, so the first publish of a line with more than five new crates stops with HTTP 429 after some crates are out. Existing crate names are not limited, so later releases do not hit this.

A published version cannot be re-published, and re-running the failed job cannot work: cargo publish --workspace does not skip crates that already exist and fails on the first one. Publish the rest by hand, in dependency order, from a checkout of the tag, retrying on a 429:

cargo publish -p mtui-core --locked   # then mtui-cli, mtui-mcp, suse-mtui

If a published crate has a defect, cargo yank hides it, but the fix is a new patch release.

Maintenance branches (X.Y.x)

The release flow above applies to every branch. Pushing the tag drives release.yml exactly like a stable-branch release, and its notes-base walk picks the predecessor by version order across the sibling branches — no ancestry needed.

Release recipe (build.suse.de / IBS, project QA:Maintenance:Test)

  1. Bump the lockstep version in the root Cargo.toml: [workspace.package] version plus the nine =… pins in [workspace.dependencies] (mtui-cli, mtui-config, mtui-core, mtui-datasources, mtui-hosts, mtui-mcp, mtui-testreport, mtui-tui, mtui-types). The pins cannot derive the workspace version with plain cargo — a path dep’s version needs an explicit exact pin so a future publish resolves — so the bump stays manual and cargo test -p xtask --test packaging fails until all nine match. This is step 2 of the release flow.

  2. Tag the release commit so tar_scm‘s revision=@PARENT_TAG@ resolves and set_version can fill the spec Version:. The binaries’ version is always the crate version (CARGO_PKG_VERSION); in a git checkout git describe adds only a provenance ref to --version. The tag goes on the release branch, never on main (step 5 of the release flow). The _service versionrewrite pattern (v?([0-9].*)) tolerates a leading v but does not require one, and mtui’s tags carry none: 26.4.1 becomes Version: 26.4.1. The format is XX.Y.Z — year-based line, major, patch. The unprefixed numeric tag is the single valid shape: it is what the release.yml push filter matches ([0-9]+.[0-9]+.[0-9]+, with an optional suffix), so a v-prefixed tag is invalid and does not trigger the release workflow.

    git tag 26.4.1
    git push origin 26.4.1
    
  3. Check out the IBS package and drop in the sources:

    osc -A ibs checkout QA:Maintenance:Test mtui
    cd QA:Maintenance:Test/mtui
    cp /path/to/mtui/_service /path/to/mtui/mtui.spec .
    
  4. Run all source services. This fetches the tagged source, compresses it, fills the spec Version:, and vendors + audits every crate dependency:

    osc service ra
    # emits: mtui-<ver>.tar.zst, vendor.tar.zst (with .cargo/config +
    #        Cargo.lock + vendor/), cargo_config, _servicedata
    
  5. Commit and build:

    osc add _service _servicedata cargo_config \
      mtui-<ver>.tar.zst mtui.spec vendor.tar.zst
    osc ci
    osc build          # local build against the service-generated tarballs
    osc results        # watch the OBS build
    

cargo_vendor audits the vendored crates against RustSec and can fail on an advisory; triage it — i-accept-the-risk=<RUSTSEC-ID> is the security-reviewed escape hatch, not a default. update=false in _service pins the checked-in Cargo.lock; flip it to true only if a crate-conflict build error appears.

Local distributable tarball (optional)

To build a plain binary tarball locally (e.g. to test the install layout) without OBS, use the xtask package helper — it assembles the documented tree (both binaries, completions, man pages, LICENSE, README) into a mtui-<version>-<target>.tar.gz plus a .sha256:

TRIPLE="$(rustc -vV | sed -n 's/host: //p')"
cargo build --release --target "$TRIPLE"
cargo xtask package --version 26.4.1 --target "$TRIPLE"
# → dist/release/mtui-26.4.1-<target>.tar.gz (+ .sha256)

--bin-dir (default target/<TRIPLE>/release) names where the built binaries are, and --out-dir (default dist/release) where the tarball goes.

This tarball is a local convenience only; the OBS build uses the git-tag source from tar_scm, not this artifact.

Invocation

mtui ships two binaries. mtui is the interactive REPL; mtui-mcp is the MCP server. Both read the same configuration and accept overrides on the command line.

mtui is REPL-only. There is no positional single-command mode: mtui always starts the interactive shell (optionally seeding it with -a/-k/-s). Headless, one-shot command dispatch is served by mtui-mcp, not by a CLI flag.

mtui

Maintenance Test Update Installer

Usage: mtui [OPTIONS]

Options:
  -t, --template-dir <DIR>
          Override config `mtui.template_dir`

  -s, --sut <HOSTS>
          Cumulatively override the default hosts from the template (format: `hostname,hostname2`). May be given more than once

  -w, --connection-timeout <SECONDS>
          Override config `connection.connection_timeout` (seconds)

      --reboot-timeout <SECONDS>
          Override config `connection.reboot_timeout`: the backoff base (seconds) for post-reboot reconnect retries

      --reboot-retries <COUNT>
          Override config `connection.reboot_retries`: the number of post-reboot reconnect attempts beyond the first probe

  -d, --debug
          Enable debugging output

  -c, --config <FILE>
          Override the default config path

      --color <COLOR>
          Control coloured output

          Possible values:
          - auto:   Colour iff stderr is a TTY and `NO_COLOR` is unset. The default
          - always: Always emit colour escapes
          - never:  Never emit colour escapes
          
          [default: auto]

  -g, --gitea-token <TOKEN>
          Gitea access token

      --ssl-verify <BOOL|PATH>
          Override config `mtui.ssl_verify`: TLS certificate verification for all outbound HTTP. Accepts `true`/`false` (and the spellings `yes`/`no`/ `on`/`off`/`1`/`0`), or a path to a custom CA bundle/certificate

  -a, --auto-review-id <RequestReviewID>
          OBS request review id, run under the automatic workflow (example: `SUSE:Maintenance:1:1`)

  -k, --kernel-review-id <RequestReviewID>
          OBS kernel/live-patch request review id, run under the kernel workflow (example: `SUSE:Maintenance:1:1`)

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Loading an update at start with -a/-k connects its reference hosts and, under the automatic workflow, downloads openQA install logs — the same as running load_template in the REPL. -s/--sut overrides the hosts drawn from the template.

mtui-mcp

MCP server for mtui (tools synthesised from the command registry)

Usage: mtui-mcp [OPTIONS]

Options:
  -t, --template-dir <DIR>
          Override config `mtui.template_dir`

  -w, --connection-timeout <SECONDS>
          Override config `connection.connection_timeout` (seconds)

  -d, --debug
          Enable debugging output

  -c, --config <FILE>
          Override the default config path

      --color <COLOR>
          Control coloured (log) output. Logs go to stderr; stdout is the transport

          Possible values:
          - auto:   Colour iff stderr is a TTY and `NO_COLOR` is unset. The default
          - always: Always emit colour escapes
          - never:  Never emit colour escapes
          
          [default: auto]

  -g, --gitea-token <TOKEN>
          Gitea access token

      --ssl-verify <BOOL|PATH>
          Override config `mtui.ssl_verify`: TLS certificate verification for all outbound HTTP. Accepts `true`/`false` (and the spellings `yes`/`no`/ `on`/`off`/`1`/`0`), or a path to a custom CA bundle/certificate

      --transport <TRANSPORT>
          MCP transport to serve on: `stdio` (default, one client) or `http` (streamable HTTP, per-client session isolation)

          Possible values:
          - stdio: Serve over stdin/stdout (default). One process serves one client
          - http:  Serve over streamable HTTP. One process serves many isolated clients
          
          [default: stdio]

      --host <ADDR>
          Bind address for `--transport http` (default: 127.0.0.1). Ignored under stdio. The address is not restricted, but rmcp's DNS-rebinding guard answers 403 to any request whose `Host` header is not `localhost`, `127.0.0.1` or `::1`: bind loopback, or put the listener behind an authenticated boundary
          
          [default: 127.0.0.1]

      --port <PORT>
          Bind port for `--transport http` (default: 8000). Ignored under stdio
          
          [default: 8000]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

mtui-mcp takes no boot-time update/host flags (-a/-k/-s are mtui only): each MCP client loads its own state at runtime via the load_template and add_host tools. See MCP server.

Configuration

mtui is configured with a sectioned TOML file. All configuration is optional: with no file present, mtui runs on built-in defaults.

File resolution

The config file is resolved in this order:

  1. --config <file> — an explicit path. Short-circuits the search.

  2. $MTUI_CONF — an explicit path in the environment. Short-circuits the search.

  3. Otherwise the default pair is merged, lowest precedence first:

    • /etc/mtui.toml (system-wide)
    • ~/.mtui.toml (home dotfile)
    • $XDG_CONFIG_HOME/mtui/mtui.toml (per-user XDG; falls back to ~/.config/mtui/mtui.toml). On macOS the per-user file is ~/Library/Application Support/mtui/mtui.toml and $XDG_CONFIG_HOME is not consulted.

    When several of these exist they are merged: an option set in a higher-precedence file overrides the same option in a lower one. The per-user XDG file therefore wins over /etc on shared keys.

Command-line flags are the highest-precedence layer, applied on top of every file: -t/--template-dir, -w/--connection-timeout, --reboot-timeout and --reboot-retries (both mtui only), -g/--gitea-token and --ssl-verify.

Loading is lenient and never hard-fails:

  • A missing file is skipped silently, including a mistyped --config path or $MTUI_CONF.
  • A file that fails to parse as TOML, or holds a value of the wrong type, is logged at ERROR and skipped whole; its options take their defaults.
  • A value check — a zero where a positive number is required, an invalid install_logs — rejects only that key, logs it at ERROR, and keeps the rest of the file. A relative put_dirs entry is dropped on its own, with an error.
  • A key or table that no option reads (a typo, a key under the wrong table, a key a release removed) is ignored, and named — file, table and key, never its value — in a WARN line at start-up and in a note: line at the top of config show, for example unknown key [mtui] tempdir in ~/.config/mtui/mtui.toml; ignored. An unknown table is named once, as unknown table [svn] in …. At most 20 keys are named per file; the rest are counted. The rest of the file still loads.

mtui does not read the INI ~/.mtuirc of the releases before 26.0. When that file exists, neither --config nor $MTUI_CONF is given and no TOML file was loaded, mtui says once, at WARN and at the top of config show, that it is not read and names the per-user TOML path to move its settings to. It never reads, renames or changes the file.

Over MCP, config_show shows a path under your home directory as ~/….

~ is expanded to your home directory in path-valued options, except in the CA-bundle path of ssl_verify.

The data directory ($XDG_DATA_HOME/mtui, or ~/Library/Application Support/mtui on macOS) holds the REPL history and the cached teregen-token.json.

Inspecting and changing config at runtime

The config command shows the resolved configuration and can set individual options for the running session:

config show                 # print all resolved options
config show connection_timeout
config set max_parallel 8

config addresses options by flattened attribute names — session_user, refhosts_*, openqa_instance*, target_tempdir, lock_*, slack_*, and so on — rather than by [section] key. config show lists 41 attributes and omits max_oqa_parallel, the [mcp] table and the [obs] table. template_dir, install_logs, refhosts_path, target_tempdir, target_protected_packages, target_required_packages and target_min_root_free can be shown but not set.

Secret options are never echoed: config show/config set print <set> for a configured secret (gitea_token and slack_token) instead of its value. Over MCP, config show additionally refuses the bulk dump and operator-local values; see MCP server.

Options

Defaults below are the built-in values.

[mtui]

KeyTypeDefaultMeaning
template_dirpath$TEMPLATE_DIR or .Directory holding each loaded report’s working directory (install logs, result files).
userstringcurrent login userUser attributed to this session (locks, logs).
install_logsrelative dir nameinstall_logsSub-directory (single relative name, no separators) where install logs are written per update.
ssl_verifybool / stringtrueTLS verification for outbound HTTP: a boolean, a boolean spelling (yes/no/on/off/…), or a path to a custom CA bundle.

[connection]

KeyTypeDefaultMeaning
connection_timeoutseconds (>0)300SSH per-command no-output timeout. The SSH link is kept alive, so this window, not a transport idle limit, decides when a quiet command is aborted. Does not bound the connect handshake — see connect_timeout.
connect_timeoutseconds (>0)60SSH connect handshake budget (TCP connect, banner, and auth). Also bounds each SFTP request (lock/history file operations), which otherwise defaults to a fixed 10s. Raise it for a host with a genuinely slow banner or link (e.g. a loaded s390x LPAR, a jump-path host, or a WAN/VPN refhost); a host slower than this to respond is dropped from a batch with a warning instead of eventually connecting.
reboot_timeoutseconds (>0)10Backoff base for reconnecting after a reboot (prepare/reboot/update). Sleeps grow as 2*(reboot_timeout + 5*count) across attempts.
reboot_retriesint (>0)10Number of post-reboot reconnect attempts beyond the first. With the defaults this gives a rebooting host up to ~12.7 minutes to come back.
max_parallelint (>0)50Max hosts to fan out to concurrently (SSH/SFTP/lock/connect batches).
max_oqa_parallelint (>0)8Max concurrent openQA/QAM HTTP requests in the overview search (kept low to be polite to shared hosts).
ssh_strict_host_key_checkingstringauto_addSSH host-key checking policy: auto_add, warn or reject. An unknown value falls back to auto_add with a warning.

SSH is pubkey-only by design. mtui authenticates from the SSH agent or ~/.ssh/id_*; there is no password auth.

reboot_timeout/reboot_retries only apply to the post-reboot reconnect budget. A dead SSH link mid-run/shell, or the sftp pre-op check, still fails on the first probe — those are not recovering from a reboot.

[refhosts]

KeyTypeDefaultMeaning
resolversstringhttps,pathComma-separated ordered list of refhosts resolvers.
https_uriURLhttps://qam.suse.de/refhosts/refhosts.ymlHTTPS URI of the refhosts database.
https_expirationseconds (>0)43200 (12h)Age before a cached HTTPS fetch is considered stale.
pathpath~/.local/share/refdb/refhosts.ymlLocal filesystem refhosts database (also used as the HTTPS resolver’s on-disk mirror; shared with the refdb tooling).

[url]

KeyTypeDefaultMeaning
bugzillaURLhttps://bugzilla.suse.comBugzilla base URL.
testreportsURLhttps://qam.suse.de/testreportsTestreports base URL.
fancy_reportsURLhttps://qam.suse.de/reports“Fancy” reports base URL.

[target]

KeyTypeDefaultMeaning
tempdirpath/tmpRemote scratch directory on target hosts, and where put publishes uploads (see Remote uploads).
protected_packagesarray of strings[]Package names the removal guard protects on top of its built-in list. Matched by exact name, with no glob or grub2-*-style family matching: list each kernel flavour or service package by its full name. Each entry is trimmed; an empty or non-string entry, or one with a character rpm does not allow in a package name, is dropped with an error and the rest are kept. A value that is not an array, or an array with no valid name, is ignored with an error and the list from a lower-precedence file stays; an explicit [] clears it. It only adds names: the built-in list always applies. Like every list option, a later file’s list replaces an earlier file’s rather than adding to it. config show prints it as target_protected_packages.
required_packagesarray of strings[]Package names check_hosts requires on every host on top of its core set (rpm, zypper, glibc, systemd except on SLE 11, bash) and one kernel flavour; a missing one makes packages fail. For the site’s own provisioning: a monitoring agent, a CA bundle, a test-tools package. Matched by exact name and read like protected_packages: a bad entry is dropped with an error, a value that is not an array or holds no valid name is ignored, [] clears it. config show prints it as target_required_packages.
min_root_freeinteger (MiB)1024Free space on /, in MiB, below which check_hosts fails a host’s root_space check; 0 never fails it. config show prints it as target_min_root_free.

[qem_dashboard]

KeyTypeDefaultMeaning
apiURLhttps://dashboard.qam.suse.de/apiQEM Dashboard API base URL.

[teregen]

KeyTypeDefaultMeaning
apiURLhttps://qam.suse.de/api/v1TeReGen report/queue API base URL.
api_v2URLhttps://qam.suse.de/api/v2TeReGen v2 API base URL: reading and writing report documents, teregen_login/whoami, checkout, regenerate and the MCP document tools.

[openqa]

KeyTypeDefaultMeaning
openqaURLhttps://openqa.suse.deopenQA instance URL.
baremetalURLhttp://openqa.qam.suse.czBaremetal openQA instance URL.

openQA API credentials (key/secret, used to sign requests with X-API-Hash) are not part of mtui.toml. mtui delegates their discovery to the ruoqa client, which resolves them in this order:

  1. $OPENQA_API_KEY/$OPENQA_API_SECRET, honoured as a pair — setting only one is a configuration error. When both are set they are used for every instance, ahead of client.conf.
  2. The openQA project’s own client.conf — an INI file with one [host[:port]] section per instance — found via a tiered, non-merging search: $OPENQA_CONFIG (when set), else the user config directory ($XDG_CONFIG_HOME/openqa, or ~/.config/openqa when $XDG_CONFIG_HOME is unset), else /etc/openqa and /usr/etc/openqa. The first tier that yields any file wins outright; later tiers are not read at all — a ~/.config/openqa/client.conf does not merge with sections that exist only in /etc/openqa/client.conf; it replaces it. Within the winning tier, each directory contributes its client.conf (if present) followed by its sorted client.conf.d/*.conf drop-ins, later files overriding earlier keys.

An instance with no matching section (or no client.conf at all, and no $OPENQA_API_KEY/$OPENQA_API_SECRET pair) is queried unauthenticated, which openQA permits for GET requests.

[gitea]

KeyTypeDefaultMeaning
tokenstring (secret)(empty)API token for the Gitea PR review workflow. The Gitea connector refuses to build without it. Masked as <set> in config output; sent only in an Authorization header, never logged.
urlURLhttps://src.suse.deTrusted Gitea origin the token may be sent to. A PR API URL comes from checked-out metadata (which is not fully trusted), so the token is attached only to requests whose origin (scheme/host/port) matches this value, over https, with no embedded userinfo. Point it at another instance (e.g. https://src.opensuse.org) to use that one. A metadata URL on any other origin is refused before the token is sent.

[slack]

The Slack review-request integration behind the request_review command.

Off by default. Posting into a chat workspace is an outward-facing side effect, so it never happens implicitly: enabled must be true and both token and channel must be set. An mtui with no [slack] section never contacts Slack, and request_review refuses with the reason.

Enabling it also gates approve. Once enabled = true, an update can only be approved after its Slack review request has been acknowledged. approve refuses unless all three hold:

  1. request_review recorded a marker for the update (and committed it, so a reviewer approving from a different checkout sees it);
  2. the marked Slack message still names that RRID — a marker copied between templates cannot launder an approval;
  3. somebody other than the bot left an approving reaction (👍, ✅; skin tone ignored).

If Slack cannot be read, approve fails closed — an unreadable review request is not an approved one. There is deliberately no per-command bypass flag: a gate with one is not a gate. Turning it off is a config change (config set slack_enabled false), which is explicit and auditable. reject is never gated — blocking it would strand an update a reviewer wants stopped.

KeyTypeDefaultMeaning
enabledboolfalseWhether the integration is available at all. Set true to opt in; leaving it unset (or false) makes request_review refuse up front, which is how a site that does not use Slack — or wants the feature switched off despite credentials being present — runs mtui.
tokenstring (secret)(empty)Slack bot token. Required scopes: chat:write, reactions:read, channels:history. Masked as <set> in config output; sent only in an Authorization header, never logged.
channelstring(empty)Channel review requests are posted to — an ID (C0123456789) or a #name. Overridable per call with request_review --channel.
api_urlURLhttps://slack.com/apiSlack API base the token may be sent to. Refused unless it is https (or http to loopback, which is what makes the test suite’s mock server possible) and carries no userinfo.
poll_intervalint (seconds)120How often request_review --watch polls for reactions. Jittered by ±15% so several mtui instances watching the same channel do not synchronise. Slack’s tier-3 methods allow roughly 50 requests/minute.
watch_timeoutint (seconds)3600How long request_review --watch runs before giving up.

Example:

[slack]
enabled = true
token = "xoxb-…"
channel = "#qam-review"

[report]

What the report document must hold before approve posts.

KeyTypeDefaultMeaning
approve_checkboolfalseWhen true, approve refuses while TeReGen’s copy of the report document has a report_check error (unanswered, missing-section, contradiction), naming the findings; a maintenance or SLFO copy without review is a missing-section under any workflow. It runs on the document the verdict gate already reads, on OBS and Gitea alike, so it costs no extra request; warnings never refuse, and reject is unchanged. Like the verdict gate it does not apply to a Product Increment. missing-section follows the loaded template’s workflow, set at load (auto for load_template -a, switched to manual when the QEM Dashboard has no install results; kernel for -k) and changed with set_workflow, which the refusal names for a missing testing section: the same server copy can pass under one workflow and be refused under another. A copy without review is refused under any workflow, and the refusal says to regenerate the document or report it to TeReGen, since commit cannot add the section.

[lock]

Remote-lock behaviour on target hosts, so concurrent testers can share a fleet.

KeyTypeDefaultMeaning
reap_stalebooltrueOn connect, force-remove a pre-existing operation lock older than stale_age, regardless of owner.
stale_ageseconds86400Age beyond which an operation lock is stale and reapable. 0 disables reaping.
pool_reap_stalebooltrueOn a pool claim attempt, force-remove a pre-existing pool claim older than pool_stale_age, regardless of owner. The only automatic recovery for a claim orphaned by an uncatchable exit (SIGKILL/panic/power loss).
pool_stale_ageseconds86400Age beyond which a pool claim is stale and reapable. 0 disables pool-claim reaping.
pi_autolockbooltrueWhen testing a Product Increment (PI), lock each refhost as it connects while the report is loaded, released on unload/quit.
waitseconds0Queueing budget for pool arbitration: 0 fails fast on a busy host. It also applies when an operation-lock create loses a race to another tester; a host already held by someone else when install/update probe it is refused at once.
wait_pollseconds (>0)15Poll interval while waiting for a busy lock to free.

[mcp]

mtui-mcp server behaviour. See MCP server.

KeyTypeDefaultMeaning
max_output_bytesbytes100000Upper bound on a single tool result (truncated at the tail with a notice). 0 disables the cap.
max_input_bytesbytes10000000Per-host source cap on data a tool reads before returning it (testreport reads, get downloads; put payloads above it are refused). 0 disables.
max_request_bytesbytes10000000Upper bound on an inbound HTTP request body under --transport http (oversized requests are rejected with 413 before rmcp buffers them). Also sets rmcp’s own request-body ceiling (default 4 MB), so a single knob governs both gates. 0 disables mtui’s limit entirely, dropping even axum’s implicit 2 MB floor, and raises rmcp’s gate to unlimited.
max_active_jobsint16Ceiling on concurrent background jobs per session. 0 disables.
max_completed_jobsint128Ceiling on retained terminal job records per session (FIFO eviction). 0 disables.
session_capint (>0)32Ceiling on concurrent per-client sessions under --transport http.
session_idle_timeoutseconds (>0)14400Inactivity before an idle http session is swept. Also pins rmcp’s streamable-HTTP keep-alive (rmcp’s own default is 300 s), so the transport never tears a quiet session down before this sweeper would.
sweep_parallelint (>0)4Max stale sessions the idle sweeper tears down concurrently per cycle.
profilestringfullTool-surface profile: full (every synthesised tool) or core (curated everyday subset). Unknown → full with a warning. Agent clients should prefer core (45 vs 78 tools on every request); see MCP server.
tools_allowarray of strings(empty)Extra tool names to keep on top of the profile.
tools_denyarray of strings(empty)Tool names to remove regardless of profile/allow (deny wins last). E.g. ["updates", "openqa_overview"] for a workflow that never lists the queue or polls openQA.
audit_logpath(unset)Durable audit sink for tool calls (versioned JSONL, 0600): one or two records per call — an intent before and an outcome after for a tool without readOnlyHint, an outcome alone for a read-only one — plus a terminal record per background job. Unset disables auditing. A path that cannot be opened refuses to start the server; afterwards a failed pre-dispatch intent write refuses the call (nothing ran), while a failed outcome write returns the result with an in-band notice. See MCP server.
audit_log_max_bytesbytes268435456Size at which audit_log rotates to <path>.1, keeping five generations (.1….5); the oldest is discarded, so archiving beyond it is yours to arrange. Rotation never blocks the dispatch worker and never refuses a call: it takes the file’s advisory lock without waiting, and a lock it cannot take or a rename it cannot perform warns once and keeps appending past the cap. 0 disables rotation entirely; any other value below 4096 is raised to it with a warning.
put_dirsarray of paths(empty)Opt-in allowlist for the MCP put tool’s source argument: absolute directories on the mtui-mcp host whose files put may upload without the bytes passing through the call (a leading ~ is expanded; an empty or relative entry is dropped with an error). Empty disables source. List only directories that nobody but the operator can write. A later config file replaces the list wholesale.

OTLP export of the same record needs no TOML key by design: it is env-only (OTEL_EXPORTER_OTLP_ENDPOINT / ..._LOGS_ENDPOINT, ..._HEADERS / ..._LOGS_HEADERS, ..._PROTOCOL / ..._LOGS_PROTOCOL, OTEL_SERVICE_NAME). Endpoint set with audit_log unset is OTLP-only; neither is auditing off. See MCP server.

The profile key is profile, not tool_profile — it already sits under the tool-scoped [mcp] table. tools_allow/tools_deny are native TOML arrays, not comma-separated strings. (Both matter if you are carrying over a config from a pre-26.0 release.)

[obs]

The native OBS/IBS QAM review backend.

KeyTypeDefaultMeaning
api_urlURLhttps://api.suse.deOBS/IBS API the review backend acts against. Must equal a section header in your oscrc.
request_timeoutseconds (>0)180Coarse wall-clock budget for a whole native OBS operation, checked between HTTP calls (not a mid-call hard kill).

Credentials for OBS live only in your oscrc, not here. The oscrc is located like osc itself: $OSC_CONFIG → $XDG_CONFIG_HOME/osc/oscrc → ~/.oscrc. There is no mtui-side path option — set $OSC_CONFIG to point at a non-default oscrc.

Secrets and credentials

  • The gitea_token and slack_token are masked as <set> by both config show and config set, and are never written to logs or display output. -g/--gitea-token puts the Gitea token on the command line, where other local users can see it; prefer the config file.
  • Configured datasource URLs may embed credentials (scheme://user:pass@host). mtui sanitises the userinfo to *** before any URL reaches a log or an error message, keeping the host visible for diagnosis.
  • A repository URL from the report metadata may carry userinfo (https://user:token@host/repo/) and is sent to zypper unchanged, so authenticated repositories keep working. Everything mtui records about the command — log lines, the timeout prompt, errors, and the command and output kept in the per-host log that showlog and export print — masks the userinfo to ***, including a URL a remote tool echoes back in its output. A password that appears without a scheme://…@ URL around it is not recognised.

Example

[connection]
connection_timeout = 300
connect_timeout = 60
reboot_timeout = 10
reboot_retries = 10
max_parallel = 8

[refhosts]
resolvers = "https,path"

[obs]
api_url = "https://api.suse.de"

[mcp]
profile = "core"
tools_deny = ["put", "get"]

Remote uploads

put (REPL and MCP) never opens its destination for writing. The bytes go to a private .mtui-upload-<uuid> directory (mode 0700) beside the destination, the file is created there exclusively, given mode 0770 and verified, and then posix-rename@openssh.com swaps it in under the destination name. The destination path is exactly what it was before; only the mechanism changed.

Consequences to expect:

  • An existing file, symlink or hardlink at the destination is replaced, not written through: the old inode and anything it was linked to stay as they were, and the new file is owned by the login user with mode 0770.
  • Every directory on the way must be a real directory owned by root or the login user and not writable by anyone else (a sticky world-writable directory such as /tmp is fine). Missing directories are created 0755. Otherwise the host is refused, naming the directory; the destination is not relocated. .. in a path is refused.
  • The server must offer posix-rename@openssh.com (OpenSSH does). There is no slower fallback: a server without it fails the upload for that host.
  • The login’s numeric uid is read with a fixed id -u over the existing SSH connection, so a put runs one extra short command per host.
  • Replacement is atomic but not durable: nothing is fsynced.
  • A put that is cancelled or loses its connection mid-transfer can leave an empty-or-partial private .mtui-upload-* directory behind; it is never visible under the destination name and is safe to delete. If the link dies after the final rename was sent, the host reports that the upload may or may not have been published, and mtui does not retry it.
  • A sticky directory restricts replacing another user’s file; as a non-root login, uploading over a file owned by someone else there fails with an explicit error.

Command reference

Every command below is available in the mtui REPL (see Invocation for how to start it and load an update). Commands not on the MCP deny-list are also exposed as mtui-mcp tools. Commands that act on a loaded template additionally accept the shared template flags -T/--template <RRID> and --all-templates (session-level commands — load_template, unload, switch, list_templates, list_refhosts, updates, review_state, config, whoami, teregen_login, set_log_level, help, quit (exit/EOF) — take neither, regenerate only -T); the cross-command behaviour behind them (fan-out, host-pool selection, locking) is described in Workflow concepts.

run

Runs a command on a specified host or on all enabled targets. Package transactions belong in install/uninstall, where the removal check applies.

Usage: run [OPTIONS] [COMMAND]...

Arguments:
  [COMMAND]...
          Command as argv tokens (no shell); pipelines need three tokens: sh, -c, <line>

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

update

Applies the testing update to the target hosts.

Usage: update [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --allow-removal
          commit the transaction even when its dry run would remove a protected package (kernel, systemd, glibc, rpm, zypper, openssh, grub2, ...) or cannot be read

      --newpackage
          Install new packages after update

      --noprepare
          Skip prepare procedure

  -h, --help
          Print help

install

Installs packages from the current active repositories.

Usage: install [OPTIONS] <PACKAGE>...

Arguments:
  <PACKAGE>...
          package to install

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --allow-removal
          commit the transaction even when its dry run would remove a protected package (kernel, systemd, glibc, rpm, zypper, openssh, grub2, ...) or cannot be read

  -h, --help
          Print help

uninstall

Removes packages from the system.

Usage: uninstall [OPTIONS] <PACKAGE>...

Arguments:
  <PACKAGE>...
          package to remove

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --allow-removal
          commit the transaction even when its dry run would remove a protected package (kernel, systemd, glibc, rpm, zypper, openssh, grub2, ...) or cannot be read

  -h, --help
          Print help

prepare

Installs missing packages and updates existing packages.

Usage: prepare [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --allow-removal
          commit the transaction even when its dry run would remove a protected package (kernel, systemd, glibc, rpm, zypper, openssh, grub2, ...) or cannot be read

  -f, --force
          force package installation

  -i, --installed
          prepare only installed packages

  -u, --update
          enable test update repositories

  -h, --help
          Print help

downgrade

Downgrades all related packages to the last released version.

Usage: downgrade [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --allow-removal
          commit the transaction even when its dry run would remove a protected package (kernel, systemd, glibc, rpm, zypper, openssh, grub2, ...) or cannot be read

  -h, --help
          Print help

reboot

Reboots reference hosts and reconnects once they are back up.

Usage: reboot [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

set_repo

Adds or removes an issue repository to or from hosts. Takes the operation lock first, like prepare/update: refuses while another owner holds a host.

Usage: set_repo [OPTIONS] <--add|--remove>

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -A, --add
          Add issue repos to refhosts

  -R, --remove
          Remove issue repos from refhosts

  -h, --help
          Print help

show_update_repos

Shows the update repositories that are valid for the current update.

Usage: show_update_repos [OPTIONS]

Options:
      --check
          fetch each install target's repository (repodata/repomd.xml and its primary metadata) and report it as ok, missing (listed binaries not at their version-release.arch), empty, not published (repomd.xml 404) or no answer (any other failure); fails when any is not ok or none could be checked, after listing all

      --json
          with --check, print one JSON object {source, total, checked, not_ok, ok, repositories: [{product, version, arch, repository, status, packages, missing, reason}]} for one template: with --json the command never fans out, so --all-templates is refused and, with several templates loaded, -T picks one

  -h, --help
          Print help

add_host

Adds one or more reference hosts to the target host list.

Usage: add_host [OPTIONS]

Options:
  -t, --target <HOST>
          Address of the target host (FQDN). Can be repeated

  -k, --keep-mode
          Do not switch to the manual workflow when in automatic mode

  -h, --help
          Print help

remove_host

Disconnects from a host and removes it from the list.

Usage: remove_host [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

set_host_state

Sets the state of a host.

Usage: set_host_state [OPTIONS] <state>

Arguments:
  <state>
          enabled | disabled
          
          [possible values: disabled, enabled]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

lock

Locks hosts for exclusive usage (the operation/zypper lock).

Usage: lock [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -c, --comment <COMMENT>...
          Lock comment (held across operations until unlock or session exit)

  -h, --help
          Print help

unlock

Unlocks hosts previously locked with lock.

Usage: unlock [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -f, --force
          Force unlock - remove locks set by other users or sessions

  -p, --pool
          Remove the pool claim instead of the zypper/operation lock

  -h, --help
          Print help

switch

Switches the active template to another loaded one.

Usage: switch <RRID>

Arguments:
  <RRID>
          RRID of the loaded template to make active

Options:
  -h, --help
          Print help

unload

Unloads one loaded template, closing only its host connections.

Usage: unload [OPTIONS] <RRID>

Arguments:
  <RRID>
          RRID of the loaded template to unload

Options:
      --discard-authored
          unload even though the report document holds edits that were never committed

  -h, --help
          Print help

list_templates

Lists all loaded templates, marking the active one.

Usage: list_templates

Options:
  -h, --help
          Print help

whoami

Displays the current user name, session PID and remote identity.

Usage: whoami

Options:
  -h, --help
          Print help

list_products

Prints the installed products on the reference hosts.

Usage: list_products [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

reload_products

Reloads and re-parses the products on the target reference hosts.

Usage: reload_products [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

config

Shows or sets runtime configuration values.

Usage: config <COMMAND>

Commands:
  show  Shows runtime configuration values (all when none named).
  set   Sets one runtime configuration value for the running session.
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help

quit

Aliases: exit, EOF

Disconnect from all hosts and exit (optionally reboot/poweroff).

Usage: quit [BOOTARG]

Arguments:
  [BOOTARG]
          reboot or poweroff refhosts on exit
          
          [possible values: reboot, poweroff]

Options:
  -h, --help
          Print help

shell

Opens an interactive shell on a reference host.

Usage: shell [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

checkout

Refreshes the loaded report document from teregen.

Usage: checkout [OPTIONS]

Options:
      --discard-authored
          refresh the report document even though it holds edits that were never committed

  -h, --help
          Print help

commit

Stores the report document and artifacts in teregen.

Usage: commit [OPTIONS]

Options:
      --allow-stale
          Commit a template that loaded with a stale Gitea hash (load_template --force-continue); refused otherwise.

  -h, --help
          Print help

report_check

Lists what the report document still owes before it can be approved.

Usage: report_check [OPTIONS]

Options:
      --source <SOURCE>
          local: the loaded document, uncommitted edits included; server: the copy TeReGen stores, which approve reads (an unauthenticated read; a failed read fails the command)
          
          [default: local]
          [possible values: local, server]

      --json
          print one JSON object {ok, errors, warnings, id, source, workflow, verdict, etag, dirty, listed, omitted: {errors, warnings}, findings: [{code, severity, pointer, message}]} for one template, at most 50 findings listed, errors first: with --json the command never fans out, so --all-templates is refused and, with several templates loaded, -T picks one

  -h, --help
          Print help

show_diff

Shows the update’s source diff, with invisible and control characters written as <U+XXXX>: the OBS source diff, or on a Gitea-workflow update the product pull request’s diff, then fails because no package source was reviewed.

Usage: show_diff

Options:
  -h, --help
          Print help

analyze_diff

Analyzes the OBS source diff to assist code review; on a Gitea-workflow update only the product pull request is available, and it refuses.

Usage: analyze_diff

Options:
  -h, --help
          Print help

coverage

Lists which declared test platforms of the report have an install check.

Usage: coverage

Options:
  -h, --help
          Print help

list_bugs

Lists related bugs and their Bugzilla/Jira URLs.

Usage: list_bugs

Options:
  -h, --help
          Print help

list_metadata

Lists the patchinfo metadata for the loaded test report.

Usage: list_metadata [OPTIONS]

Options:
      --json
          print one JSON object {rrid, embargoed, embargoed_reason, metadata: [{label, value}]} for one template: with --json the command never fans out, so --all-templates is refused and, with several templates loaded, -T picks one

  -h, --help
          Print help

list_hosts

Lists all connected hosts with their system and state.

Usage: list_hosts

Options:
  -h, --help
          Print help

check_hosts

Checks the connected hosts read-only (packages, root space, failed units, leftover test repositories) and gives each a verdict: ok, warn, fail or unknown. Fails when any host is fail or unknown. Takes no operation lock or pool claim, runs no zypper and changes nothing on the hosts.

Usage: check_hosts [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --json
          print one JSON document instead of the text blocks; it covers one template: the one -T names, else the only one loaded (in the REPL, the active one); refuses --all-templates

  -h, --help
          Print help

list_timeout

Prints the current command timeout per host, in seconds.

Usage: list_timeout

Options:
  -h, --help
          Print help

list_update_commands

Lists the commands mtui would invoke to apply the update on the hosts.

Usage: list_update_commands

Options:
  -h, --help
          Print help

list_sessions

Lists the active SSH sessions connected to each reference host.

Usage: list_sessions [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

list_locks

Lists the lock state of all connected hosts.

Usage: list_locks [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -p, --pool
          list pool-claim locks instead of zypper/operation locks

  -h, --help
          Print help

list_history

Lists the history of mtui events recorded on the reference hosts.

Usage: list_history [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -e, --event <event>
          event type to list (repeatable)
          
          [possible values: connect, disconnect, install, update, downgrade, prepare]

  -h, --help
          Print help

show_log

Prints the command protocol (issued commands + output) from the hosts.

Usage: show_log [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

      --offset <N>
          First log entry to show per host (1-based)
          
          [default: 1]

      --limit <N>
          Max log entries per host (0: headers with entry totals only)

  -h, --help
          Print help

list_versions

Lists the available versions of packages in the enabled repositories.

Usage: list_versions [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -p, --package <PACKAGE>
          package name to show versions for (repeatable)

  -h, --help
          Print help

list_packages

Lists packages and their installed versions on the reference hosts.

Usage: list_packages [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -p, --package <PACKAGE>
          package name to list (repeatable)

  -w, --wanted
          print versions wanted by the testreport

  -h, --help
          Print help

set_timeout

Sets the command-execution timeout, in seconds, for the selected hosts.

Usage: set_timeout [OPTIONS] <timeout>

Arguments:
  <timeout>
          Timeout in seconds; must be positive

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -h, --help
          Print help

put

Uploads a local file (or directory tree) to every enabled reference host.

Usage: put <filename>

Arguments:
  <filename>
          file (or directory) to upload to all hosts; the path is literal — shell-style globs are deliberately not expanded (put the directory, or let the invoking shell expand)

Options:
  -h, --help
          Print help

get

Downloads a remote file from every enabled reference host.

Usage: get <filename>

Arguments:
  <filename>
          file to download from the target hosts

Options:
  -h, --help
          Print help

checkers

Lists TeReGen’s checker result runs for the loaded update, or for –rrid’s update without loading it; TeReGen serves them for SLFO ids only.

Usage: checkers [OPTIONS]

Options:
      --rrid <RRID>
          read the checker results of this update instead of a loaded one; it need not be loaded, and nothing is loaded

      --full-output
          print every line of a non-passing check's output, untruncated, instead of a bounded first-line summary (some checks emit long diffs)

  -h, --help
          Print help

updates

Lists the update queue (unassigned + in-testing by default), fetched live from the TeReGen API.

Usage: updates [OPTIONS]

Options:
  -G, --review-group <GROUP>
          filter by review group, e.g. qam-sle or the '<group>-review' login form; repeatable — updates in any of the groups are listed (one server query)

  -F, --field <FIELD>
          select output fields by osc-qam name (e.g. -F Rating -F 'Assigned Roles'); repeatable, rendered as one block per update; names match case-insensitively, ignoring spaces/hyphens/underscores; Package-Streams/Issues/Comments are read live from OBS per shown row (after --limit/--offset), so narrow large queues with --limit; non-OBS (SLFO) rows render n/a, a row OBS refuses renders unavailable (an unreadable comments document marks Comments alone), comments are sanitised and capped per row; Embargoed is read from the QEM Dashboard's incident list, one read for the whole table

      --json
          print the raw TeReGen rows as a JSON array (each row emitted whole, unlike -F; honours --limit/--offset; not combinable with -F); an empty queue prints []; over-cap stdout is a JSON envelope {"rows": [...], "truncation": {...}} so stdout stays valid JSON

      --status <STATUS>
          filter by status (default: testing); use 'all' for every status; the unassigned default and --assignee/--mine/--all-assignees apply to testing only
          
          [default: testing]

      --embargoed <STATE>
          filter by the QEM Dashboard's embargo flag, read once for the whole queue before --limit/--offset: yes, no, unknown, or all to keep every row; no matches only a row read as not embargoed, unknown every row whose state could not be read; shows the state on each row (with -F, as an added Embargoed field) and, with --json, adds qem_embargoed and qem_embargoed_reason to each row; fails after the listing when the dashboard could not be read
          
          [possible values: yes, no, unknown, all]

      --limit <N>
          cap the number of rows after --offset (0 = all)
          
          [default: 0]

      --offset <N>
          skip the first N rows (0 = from the start); with --limit, page any middle slice
          
          [default: 0]

      --assignee <USER>
          filter to updates assigned to this user (any qam group)

      --mine
          filter to updates assigned to your oscrc login for [obs] api_url and, with a [gitea] token, its Gitea login

      --all-assignees
          show every update regardless of assignee, overriding the unassigned default

      --live
          check each shown row against its live review gate, as review_state reads it, dropping given verdicts from the unassigned and --mine views

  -h, --help
          Print help

review_state

Shows who holds an update’s QA review, whether its verdict is owed and whether its template is current, without loading it.

Usage: review_state [OPTIONS] <RRID|PR-URL>...

Arguments:
  <RRID|PR-URL>...
          an RRID (long or short form) or a Gitea pull request URL; repeatable. An SLFO RRID's pull request is the one its published document names; a pull request URL names no RRID, so its template column is n/a

Options:
      --mine
          add a mine column: whether the owner is your oscrc login for [obs] api_url or, with a [gitea] token, its Gitea login

      --json
          print {"rows": [...], "failed": [...], "notes": [...]} instead of the table; still fails when a lookup failed

  -h, --help
          Print help

The SLFO gate is read from the pull request's reviews. approve, reject and assign count a decision comment as "already decided" only while those reviews do not show the group's review owed again, yet the two can still disagree: a pull request approved with no decision comment is approved here but still open to approve, and assign's review-requested guard reads the requested reviewers. BASE is the pull request's base branch as Gitea names it; mtui does not check it against the RRID.

openqa_overview

Prints an openQA / QAM Dashboard / build-checks overview for the loaded MU.

Usage: openqa_overview [OPTIONS]

Options:
      --no-aggregated
          Skip the Aggregated Updates section

      --days <N>
          How many days to scan back for aggregated builds (1-30, default 5)
          
          [default: 5]

      --aggregated-groups <GROUP>
          Job groups to search in Aggregated Updates (default: core)
          
          [possible values: core, containers, yast, security]

      --url-openqa <URL>
          Override openQA URL (default: config openqa_instance)

      --url-dashboard-qam <URL>
          Override QAM Dashboard base URL (default: derived from config)

      --url-qam <URL>
          Override QAM base URL (default: derived from config reports_url)

      --test-pattern <REGEX>
          Custom regex to extract test results from build-check logs

      --export
          Also author the overview onto the report document (testing.openqa.extra)

      --no-fetch
          (deferred) reuse cached overview; currently fetches anyway

  -h, --help
          Print help

openqa_jobs

Lists the individual openQA jobs for the loaded update’s incident build; red jobs name their failed modules, and –history N shows how each red job’s scenario did on other builds.

Usage: openqa_jobs [OPTIONS]

Options:
      --all
          list every attempt: earlier runs of a retriggered scenario and obsoleted jobs too (default: the newest non-obsoleted job of each scenario)

      --failed
          show only genuinely failed jobs (pending/unfinished excluded)

      --arch <ARCH>
          only jobs for this architecture

      --test <GLOB>
          only jobs whose test name matches this glob (* and ?), e.g. '*incidentinstall*'

      --flavor <FLAVOR>
          only jobs with this FLAVOR setting

      --version <VERSION>
          only jobs with this VERSION setting, e.g. 15-SP6

      --history <N>
          under each listed red job, how its scenario did on the newest N other builds (0-50, default 0: off)
          
          [default: 0]

      --limit <N>
          cap the number of rows after --offset (0 = all)
          
          [default: 0]

      --offset <N>
          skip the first N rows (0 = from the start); with --limit, page any middle slice
          
          [default: 0]

      --url-openqa <URL>
          Override openQA URL (default: config openqa_instance)

      --url-dashboard-qam <URL>
          Override QAM Dashboard base URL (default: derived from config)

  -h, --help
          Print help

openqa_summary

Prints the QEM Dashboard’s openQA results summary for the loaded MU.

Usage: openqa_summary

Options:
  -h, --help
          Print help

reload_openqa

Reloads information from the openQA instances.

Usage: reload_openqa

Options:
  -h, --help
          Print help

set_workflow

Sets the workflow and reloads data from openQA.

Usage: set_workflow <workflow>

Arguments:
  <workflow>
          desired workflow - auto, manual or kernel
          
          [possible values: auto, manual, kernel]

Options:
  -h, --help
          Print help

set_log_level

Changes the current mtui log level. Under mtui-mcp it is the server’s level, shared by every session of an http server, and the log goes to the server’s stderr, not to the client.

Usage: set_log_level <level>

Arguments:
  <level>
          log level for mtui - info, warning, error or debug
          
          [possible values: info, warning, error, debug]

Options:
  -h, --help
          Print help

assign

Assigns a review request to a user or group.

Usage: assign [OPTIONS]

Options:
  -g, --group <GROUP>
          Group to act on (not valid for the Gitea workflow)

  -u, --user <USER>
          User override for the Gitea workflow (Gitea only)
          
          [default: ""]

  -f, --force
          Assign even if another user holds the review. OBS: never one you already hold (unassign first); Gitea: also your own, and without an open group

  -h, --help
          Print help

unassign

Unassigns a review request.

Usage: unassign [OPTIONS]

Options:
  -g, --group <GROUP>
          Group to act on (not valid for the Gitea workflow)

  -u, --user <USER>
          User override for the Gitea workflow (Gitea only)
          
          [default: ""]

  -h, --help
          Print help

reject

Rejects a review request.

Usage: reject [OPTIONS] --reason <reason>

Options:
  -g, --group <GROUP>
          Group to act on (not valid for the Gitea workflow)

  -u, --user <USER>
          User override for the Gitea workflow (Gitea only)
          
          [default: ""]

  -r, --reason <reason>
          Reason to reject the update (required)
          
          [possible values: admin, retracted, build_problem, not_fixed, regression, false_reject, tracking_issue]

  -m, --message [<message>...]
          Rejection message (takes the remainder of the command)

      --reviewer <NAME>
          Name of the reviewer who reviewed this report; recorded on the report document and uploaded, then reject

      --allow-stale
          With --reviewer, upload a template that loaded with a stale Gitea hash (load_template --force-continue); refused otherwise.

  -h, --help
          Print help

comment

Adds a comment to a review request.

Usage: comment [OPTIONS]

Options:
  -m, --message <message>...
          The comment body (required)

  -h, --help
          Print help

approve

Approves the loaded update, dispatching to OSC or Gitea like the other backend-API commands.

Usage: approve [OPTIONS]

Options:
  -g, --group <GROUP>
          Group to approve (not valid for the Gitea workflow)

  -u, --user <USER>
          User override for the Gitea workflow (Gitea only)
          
          [default: ""]

  -r, --reviewer <NAME>
          Record reviewer on the report document, then approve

      --accept-head <SHA>
          Approve only if the PR head is exactly SHA; this is also what lets a head that moved since the report was generated through non-interactively (Gitea only)

  -h, --help
          Print help

regenerate

Regenerates a test-report template via the TeReGen API (a given RRID need not be loaded first).

Usage: regenerate [OPTIONS] [RRID]

Arguments:
  [RRID]
          template to regenerate even if not loaded (default: the loaded template)

Options:
      --force
          overwrite an existing (but unedited) template

      --ignore-inconsistent
          regenerate despite inconsistent metadata (e.g. arch mismatch)

      --no-wait
          enqueue the job and return without waiting or reloading

  -k, --kernel
          load the standalone RRID as a kernel update (default: auto)

      --discard-authored
          override mtui's own guards against regenerating a document that already carries tester content (verdict, testers, issue answers, install/regression results), loaded or on the server, or holds edits that were never committed; without it the REPL asks before discarding such content and MCP refuses; teregen itself still refuses on a verdict, testers or tester-filed issues (new_issues)

  -h, --help
          Print help

request_review

Requests review of the loaded update in Slack.

Usage: request_review [OPTIONS]

Options:
  -c, --channel <CHANNEL>
          Channel to post to, overriding the configured one

  -m, --message <TEXT>
          Extra context appended to the review request

  -w, --watch
          After posting, watch the message for reviewer reactions until a verdict or timeout (Ctrl-C / job_cancel stops it). Over MCP, pair this with background=true so the call does not outlive the client timeout

      --allow-stale
          Request review of a template that loaded with a stale Gitea hash (load_template --force-continue); refused otherwise.

  -h, --help
          Print help

export

Exports the gathered update data onto the report document.

Usage: export [OPTIONS]

Options:
  -t, --target <HOST>
          Host to act on. Can be used multiple times. If omitted all hosts are used

  -f, --force
          force overwrite of existing install logs

      --allow-unverified
          write the unverified scaffold even when no selected host has recorded package versions

      --allow-stale
          Export a template that loaded with a stale Gitea hash (load_template --force-continue); refused otherwise.

  -h, --help
          Print help

list_refhosts

Lists reference hosts from refhosts.yml (offline search, no connect).

Usage: list_refhosts [OPTIONS]

Options:
      --testplatform <QUERY>
          match a SMELT testplatform query

  -n, --name <GLOB>
          hostname glob, e.g. 'whale-*' or '*.qam.suse.cz'

  -a, --arch <ARCH>
          arch filter (repeatable): x86_64 / aarch64 / ppc64le / s390x

  -p, --product <SUBSTR>
          base-product substring, e.g. sles / sled / SLE_HPC

      --version <VERSION>
          product version: 15-SP6 / 15.6 / 15 (SP optional)

      --addon <SUBSTR>
          addon-name substring (repeatable)

      --pool
          group by test-target slot (product+version+arch+addons)

      --summary
          one row per slot instead of per host: its host count, and with --free the free/locked/pool/unreachable counts, the free hosts and a verdict (free/busy/unknown/none); with --testplatform every requested arch gets a row, `none` when no host serves it

      --json
          emit a JSON array of kept rows; over-cap stdout is a JSON envelope {"rows": [...], "truncation": {...}} so stdout stays valid JSON (--free windowing adds a "probe" object); with --summary, a --limit/--offset cut also gives the envelope, with a "window": {"kept", "total"} object

      --limit <N>
          cap the number of rows after --offset (0 = all)
          
          [default: 0]

      --offset <N>
          skip the first N rows (0 = from the start); with --limit, page any middle slice
          
          [default: 0]

      --free
          also probe live operation-lock and pool-claim state (connects to each shown host; --offset/--limit window first)

  -v, --verbose
          include addons in the output

  -h, --help
          Print help

load_template

Loads a maintenance-update template into the session and connects its reference hosts.

Usage: load_template [OPTIONS] <--auto-review-id <RequestReviewID>|--kernel-review-id <RequestReviewID>>

Options:
  -a, --auto-review-id <RequestReviewID>
          OBS request review id, e.g. SUSE:Maintenance:1:1

  -k, --kernel-review-id <RequestReviewID>
          OBS kernel/live-patch request review id, e.g. SUSE:Maintenance:1:1

      --force-continue
          Load a stale checked-out template as-is, instead of aborting, once TeReGen has refused to regenerate it non-interactively.

      --discard-authored
          re-load an already-loaded template even though its report document holds edits that were never committed

  -h, --help
          Print help

help

List commands, or show help for one command.

Usage: help [COMMAND]

Arguments:
  [COMMAND]
          command to show help for; omit to list all commands

Options:
  -h, --help
          Print help

edit

Edit the loaded report document, or a local file in $EDITOR.

Usage: edit [FILENAME]

Arguments:
  [FILENAME]
          File to edit (defaults to the report document)

Options:
  -h, --help
          Print help

teregen_login

Checks the teregen v2 login by forcing a fresh mint.

Usage: teregen_login

Options:
  -h, --help
          Print help

Workflow concepts

The command reference documents each command’s own arguments. This page covers the cross-cutting behaviour that sits behind those commands — how fan-out works, how reference hosts are drawn from the pool, and how locking keeps concurrent testers from colliding. It applies equally to the mtui REPL and the mtui-mcp tools, since both dispatch through the same engine.

Templates and the active template

Loading a testreport with load_template adds it to the session as a template; previously loaded templates stay loaded and the new one becomes active. Each template owns its own reference hosts and its own report. list_templates shows the loaded set (the active one marked *), switch changes the active one, and unload drops one (closing only its host connections).

Session-level commands (load_template, unload, switch, list_templates, list_refhosts, updates, config, whoami, teregen_login, set_log_level, help, quit) take no template flag: each runs exactly once, never fans out, and accepts neither -T nor --all-templates.

Fan-out across templates

When more than one template is loaded, a command has one of three scopes:

  • Fanout — read/annotate commands (list_*, show_*, openqa_*, checkers, checkout, export, set_workflow, comment, …) fan out across every loaded template by default. None of them mutates host state, and re-running one is safe, with one exception: comment posts its comment again. Each template’s output is prefixed with an === <RRID> === banner so results stay attributable.
  • Explicit — host-mutating and remote-write commands (update, prepare, downgrade, install, uninstall, set_repo, run, reboot, lock, unlock, add_host, remove_host, get, put, approve, reject, assign, unassign, request_review, commit) never implicitly fan out: bare, they act on exactly one template — the active one in the REPL, or the sole loaded one — and refuse rather than guess when several are loaded headlessly and none is named.
  • Active — commands that act on the active template in the REPL (list_products, reload_products, set_host_state, set_timeout). A headless caller with several templates loaded and none named fans out instead, because there is no active template to address.

Scope a single call three ways:

  • -T <RRID> / --template <RRID> — act on one loaded template only.
  • --all-templates — force fan-out explicitly, on any scope. Mutually exclusive with -T.
  • --all-templates=false — suppress fan-out on a Fanout command, narrowing it to the same single-template resolution an Explicit command uses by default.

A headless caller (MCP) with several templates loaded and neither flag named, on an Explicit command or under --all-templates=false, gets an AmbiguousTemplate error rather than a silent guess; the error names the loaded RRIDs and how to scope the call (see MCP server).

Failure handling is per-template: if a fanned-out command fails on one template it keeps running on the rest and reports an aggregate failure at the end. When a host-phase command (one that accepts -t) fans out without explicit -t hosts, a loaded template with no connected host is skipped with a warning rather than counted as a failure — so an unscoped lock/run/… still succeeds on the templates that do have hosts. If every template is host-less the command ran nowhere and fails with “No refhosts defined”. With -t <host>, a template that owns none of the named hosts is skipped with a warning; a template that owns at least one of them is dispatched, and fails for any other named host that is not connected in it. If no template owns any named host, the result is again “No refhosts defined”. A -T-scoped call keeps single-template error behaviour.

When a host action completes on some hosts and fails on others, the command prints <verb> completed on <hosts> — naming the hosts it completed on — before it reports the failure. After a failed update, only a check failure or a reboot that did not take effect triggers an automatic rollback; if a peer’s patch never ran, nothing is rolled back and the hosts that completed get the same finishing steps as a successful update. Those steps compare each tracked package’s version before and after the patch with the update’s own; a host where one did not end at the update’s version is still counted as completed, and the package is named as a degradation (see MCP server).

export is the exception: it runs on a host-less template too, since every workflow has openQA data to write. A Manual template with no connected host writes only testing.openqa (install results and overview rows); testing.install and the install logs wait for an export after add_host and update.

regenerate also runs exactly once, on the active template by default; -T names another loaded one.

Over MCP the same model applies through per-call template= / all_templates= parameters — see MCP server.

Reference-host pool selection

When add_host connects hosts from a testplatform (and during the autoconnect that runs when a template loads), mtui connects one reference host per test-target slot — a slot being a unique (product, version, arch, addons) combination — rather than every matching candidate. So a testplatform that resolves to several interchangeable hosts on the same architecture does not fan a command out across all of them.

  • The host drawn for each slot is chosen at random among the free candidates, spreading load across interchangeable refhosts.
  • Slots are matched to hosts so that each gets a host of its own whenever the free candidates allow it. A host can match two slots, as an SLE_HPC host carrying the SLES-LTSS addon matches both an SLE_HPC and a SLES-LTSS slot; it serves only the slot it was drawn for, on later add_host calls too, a candidate no other slot needs is preferred, and a slot left without a host because every candidate already serves another slot is named in add_host’s result.
  • If the chosen host fails to connect, mtui automatically tries another candidate from the same slot; only when every candidate for a slot is unreachable, claimed or locked does add_host name the slot and why in its result and leave that slot unconnected.
  • A host the update workflow cannot drive counts as a failed draw, and the slot moves on to a sibling: one whose key has no command set (no command set for <Product version>, <root mode>, the root mode as detected, such as SLES 15-SP6, transactional), one whose base product mtui does not map (SLE Micro 5.x, Leap, Leap Micro: unrecognised product …), and one whose baseproduct link is missing or dangling (base product unreadable …). The check runs after connecting and before any claim or lock is written. A pool draw needs a loaded update, since its testplatforms come from one. load_template shows no unserved-slot lines; it prints skipped <host>: <reason> for each host refused this way, including a pool host whose slot a sibling then served. A refused host’s refhosts.yml drift is still printed.
  • A pool-drawn host whose live operation lock another owner holds (another mtui process of yours included) is a failed draw as well, checked at the same point, after a stale lock is reaped: its slot moves on to a sibling, and the reason reads operation lock held by <user> since <time>. A named host is attached regardless.
  • Under fan-out, each test-target slot draws a distinct free host from the shared pool, arbitrated in-process so two templates never collide on the same host. When every candidate for a slot is busy, the claim queues on the exhausted pool according to [lock] wait / [lock] wait_poll (see Configuration).
  • Hosts named explicitly (add_host -t) take the same in-process claim and, once connected, the remote pool claim, so a later pool selection treats them as taken. A named host claimed by another template is refused with the holder’s RRID instead of being attached silently. A fresh remote claim blocks -t with no override on that template: have the holding template run unlock --pool --force -t <host>, or wait for the stale reap ([lock] pool_stale_age); a force flag for -t itself does not exist yet. While an update is loaded, a named host the update workflow cannot drive is refused too, with the reason, and there is no override. With nothing loaded it attaches as before, for run, get and put.

To search the inventory without connecting, use list_refhosts — it reads the same source offline (no SSH, no lock, no loaded report). list_refhosts --testplatform '<query>' --summary prints one row per slot that one query requests, keyed as pool selection keys it (so a host serving the product only as an addon counts), and gives an arch no host serves a row with verdict none. Add --free to survey which slots have a free host now (free), have every host taken (busy), or could not be told because a host was unreachable (unknown). Each host of one query has a single arch, so it is counted for at most one of its slots. The verdict is a snapshot of one testplatform, not a reservation: across an update’s testplatforms one host can be the only free candidate for two slots, and add_host then serves one and names the other busy or shared; a host pool-claimed by your own update shows as taken, since the probe knows no RRID; a pool claim that cannot be read counts as no claim. Without --testplatform the rows are keyed by each host’s full (product, version, arch, addons), a stricter key than pool selection’s. A query with no arch=[…] segment, one that does not parse, or an empty arch in it (arch=[], arch=[x86_64,]) is refused, with or without --summary.

Product-drift check on connect

When a host connects, mtui checks that the products actually installed on it (from /etc/products.d) match what refhosts.yml records for that host. Any drift — a wrong or wrong-version base product, a wrong architecture, missing/unexpected addons, or a dangling baseproduct symlink — is logged as a WARNING and the host is kept (the check never aborts a connect). The qa product is ignored, and hosts not listed in refhosts.yml are skipped silently.

Host state

Each connected host has a state, set with set_host_state:

  • enabled — runs all issued commands (the default).
  • disabled — runs nothing and prints nothing.

Commands designed to run in parallel (like run) always fan out concurrently across enabled hosts.

Removal guard

install, uninstall, prepare, downgrade and the two prepares update runs (before the patch, and after it with --newpackage) let the package solver decide what else a transaction takes with it, and -n accepts the result. Before committing, each checked host first resolves the same transaction with a dry run (zypper -x … --dry-run) and reads the packages it would remove. The host is refused — its transaction is not run, it is not rebooted, it gets no history row, and it fails the command by name while the other hosts carry on — when that set holds a protected package the command did not name, or when the dry run fails, times out, or its output cannot be read. Every other removal is allowed and reported as <host>: the transaction also removes ….

A dry run that exits 104 (zypper’s “not found”: a requested package is in no enabled repository, as an update’s new package is during its first prepare) has not failed: zypper commits nothing at 104, so its complete output is judged like any other and, without a summary, removes nothing. The real command then runs and fails as it would without the check; show_log keeps that dry run’s XML, which carries zypper’s “No provider” message.

The check is best-effort. The real command resolves the transaction again, after its own refresh, and PackageKit or another zypper user on the host can change what it resolves to between the dry run and the commit.

A refused host has still been through the steps before the dry run:

  • install, uninstall: the operation lock was taken and is released; nothing else changed.
  • prepare: the update repository was added and refreshed, and stays.
  • downgrade: the update repository was removed and the repositories refreshed; it is not added back.
  • update, first prepare: its repository step has run. The host is then left out of the update: it is not patched, its reason is reported once as <host>: its prepare was refused: … however the update ends, and the update fails naming it while the other hosts are patched. When every host is refused, nothing is patched.
  • update --newpackage, the prepare after the patch: the host keeps its patch and the update stands; the refusal is named in a warning.

In install, uninstall, prepare and update, a cancel (Ctrl-C, MCP job_cancel) that lands while the dry run is running stops the command before the transaction is dispatched on any host; update then adds no repository and takes no lock. A host refused before the cancel is still named as a failure rather than reported as cancelled.

Protected, by exact name: the base system (aaa_base, bash, bash-sh, coreutils, filesystem, glibc, pam, systemd, udev, util-linux), the boot chain (dracut, kmod, shim, and the kernels kernel-default, kernel-default-base, kernel-64kb, kernel-azure, kernel-kvmsmall, kernel-preempt, kernel-rt, kernel-zfcpdump), the package and snapshot stack (libzypp, rpm, rpm-ndb, snapper, transactional-update, tukit, zypper), and what keeps the host reachable (NetworkManager, wicked, openssh, openssh-common, openssh-server, sudo); and grub2 with every grub2-* package. The list is built in; [target] protected_packages (see Configuration) adds more names, matched exactly, and cannot remove any. Known gaps: the libtukit library packages and the products’ *-release packages are not on it, so a transaction that removes them without also removing a listed package is not refused.

Pass --allow-removal (the allow_removal property of the MCP tools) to commit the transaction anyway; it skips the dry run.

Not checked — each such host is named in the command output and the MCP result as <host>: no dry run exists for this host, …, counted as a degradation:

  • Transactional hosts (SL Micro, transactional SLES 16): the transaction runs in a new snapshot whose repositories and trusted keys can differ from the booted root’s, and no dry run on such a host has been verified to resolve the same transaction.
  • SLE 11 hosts: their zypper predates the releases whose dry-run output the check was verified against.
  • YUM hosts: yum/dnf print the transaction only as a human-readable table, and no output of theirs has been captured to verify a parser against.

run is not checked either, nor is the rollback of a failed update: it undoes a half-applied update, so it is never refused.

show_log omits the XML of a zypper dry run that succeeded, whoever ran it (the guard, or a run command with the same zypper -x -n in|rm --dry-run prefix); a failed or unreadable dry run’s XML is shown, as it holds zypper’s reason.

On a non-transactional host downgrade downgrades one package per transaction, but the guard judges one dry run of all the host’s packages together. The single transactions can resolve differently from the combined one, so the guard can refuse a downgrade none of them would make harmful, and can miss a protected package that one of them removes while the combined solve keeps it.

Locking

Two independent locks coordinate concurrent testers on a shared fleet. Both use the same on-host wire format (timestamp:user:pid[:comment]), so concurrent mtui processes — and any other fleet tooling that reads the same files — cooperate rather than clobber one another.

  • Operation / zypper lock (/var/lock/mtui.lock, PID-based) — guards serialized repository transactions (enabling/disabling the test repo, install/update/prepare/downgrade). Set it explicitly with lock; it is applied automatically around the flows that need it. Enabled locks are removed when the session exits, commented or not. To keep the lock between operations, give it a comment (lock -c "<why>"). Such a reservation is never rewritten or released by run, update, install or prepare on the host; unlock or the end of the session removes it. Templates loaded in the same process, and the sessions of one mtui-mcp server, hold the operation lock against each other like separate users: a second template’s run or update waits for (or, at [lock] wait = 0, refuses on) the first one’s hold.
  • Pool-claim lock (/var/lock/mtui-pool.lock, RRID-based) — taken during host-pool selection to reserve a host for a template. List and remove them with the -p/--pool flag on list_locks / unlock.

A reboot wipes /var/lock (tmpfs), so after the host reconnects mtui re-applies the reservation and pool claim this session held — in reboot itself, in the transactional reboot inside update/downgrade/prepare, and in the install/uninstall operation template. Re-taking is idempotent and never overwrites someone else’s lock: a hold another tester claimed in the gap is left in place, not replaced. The reboot command prints one line per lost hold naming the host and the hold; the update/prepare/downgrade flows record the same as a degradation diagnostic, as do install/uninstall. The reboot outcome itself stays a success either way. A hold another owner claimed in the gap also drops its in-memory record, so a later plain unlock reports the session holds nothing instead of trying to release someone else’s lock; a hold the re-take could not reach (transport error, or a corrupt line) keeps its record — dropping a corrupt line would strand it under a later plain unlock’s skip, while the kept record surfaces it on the next release attempt.

Each lock file holds exactly one line, timestamp:user:pid[:comment] (Unix seconds, user name, numeric process id, optional free text that may contain colons). A pool claim’s comment is mtui pool <RRID> [<owner>]. A missing file means the host is free. Anything else that is not such a line — an empty or whitespace-only file, the wrong number of fields, a non-numeric pid, an empty user, bytes that are not UTF-8 — is an invalid lock file. It is never read as free, because it usually marks a claim that died before writing its line. Another tester’s claim also reads empty for an instant between creating the file and writing it, so mtui re-reads a file it cannot prove is older than five seconds for up to five seconds, and only a file still invalid then is reported. list_locks reports it as invalid lock file, and lock and pool claims refuse the host with an error naming it, the file and the way out (unlock -f is only right if no other mtui is claiming the host). unlock -f removes it (unlock -p -f for the pool claim); a plain unlock leaves it alone. It is also reaped like any stale lock once older than [lock] stale_age (pool_stale_age for the pool claim), except that the age is the file’s modification time, since there is no timestamp inside; a file whose modification time is missing or in the future is never reaped.

remove_host, unload, quit, and a load_template (or regenerate) that reloads an already-loaded update never refuse to tear a host down, but they warn about what this session left on it, one warning: <host>: … line per item, in the command’s reply (so an MCP client sees it too):

  • an operation lock or pool claim this session still holds after the close, with why — link down (the release was skipped), release failed, or teardown abandoned (the close ran out of time) — and how it goes away: a reboot clears it, otherwise it stays until it is older than [lock] stale_age (pool_stale_age) or someone runs unlock -f (unlock -f -p). A lock or claim that now belongs to another owner (this session’s hold lapsed, e.g. it was reaped as stale and taken) is named as such: the close did not release it, and there is no unlock -f advice;

  • the test update repositories this session added, from the host’s record of them, which has four states:

    • not added or removed: nothing is said;
    • configured (added by set_repo -A, prepare --update or update, and not removed since, or a removal failed): “the test update repositories are still configured”;
    • unknown (an update script’s output reported nothing about its own cleanup, such as after a timeout or a lost session, or its listing matched none of them; a transactional host whose script removed them, since the staged snapshot its next boot activates may still list them; a checked removal that never answered): “may still be configured (their removal is not confirmed)”.

    The update script removes them itself after the patch and ends its output with mtui: test repository cleanup: removed, failed or unmatched; the record follows that line, and a later checked removal (set_repo --remove, the rollback’s) overrides it. Either warning ends: with the update loaded, reconnect the host and run set_repo --remove;

  • packages this session’s install put there that no later uninstall removed. mtui does not check beforehand which of them were already installed, so the line says some may have been.

The check reads only what the session recorded; it runs nothing on the host.

By default, lock/unlock act on the whole active template’s hosts; pass -t <host> (repeatable) to scope either to a subset. Plain unlock releases only the operation lock this session took: a lock it never took — another user’s, or a live sibling template’s on a refhost shared inside the same process — is left alone and reported skipped. A foreign lock points at list_locks or --force; a sibling’s is named as held by this mtui process and is released from the template that took it. unlock -f force-removes a lock held by another user or session regardless of who took it. mtui also reaps a pre-existing lock older than [lock] stale_age on connect (almost always left over from a crashed session); see Configuration for reap_stale, stale_age, wait, and wait_poll. The one exception is list_refhosts --free: its connect is a read-only survey, so it never reaps. Its lock column reports one of free, locked, pool (free but pool-claimed), locked+pool, unreachable (the host could not be probed), or unknown (the probe never completed for it), followed by who holds it: since <time> by <user> : <comment> for the operation lock and pool <RRID> since <time> by <user> for the pool claim. --json carries the raw probe state in lock (free, locked, unreachable or unknown) and adds a pool key (the claiming RRID, or null when unclaimed), lock_holder (user, since, comment) and pool_holder (user, since); each holder is null when nothing is held or the lock file is invalid. pool and locked+pool are table-only labels.

Product-Increment autolock

When testing a Product Increment (PI) and [lock] pi_autolock is enabled (the default), mtui locks each reference host — with a comment naming the request — as it connects, for the life of the loaded report; the lock is released when the report is unloaded or the session quits, matching how every non-PI report’s pool claims already behave. A host added later with add_host (including a pool-selected host, with no -t) is locked too, since the lock comment is seeded on load and every connect path applies it. Review actions (assign/unassign/approve/reject) do not lock or unlock hosts themselves. A reboot clears /var/lock, so the per-host testing lock is re-applied after the host comes back — through the same re-apply as reservations and pool claims (see above), with the same lost-hold reporting when another tester claimed the host in the gap.

Assignment context on assign

After the assignment succeeds, assign prints best-effort context from the TeReGen report API: the update’s live priority and deadline and, when the report already carries assignment state, who currently holds or has decided each review group (one line per group). This is informational only and never blocks the action — its absence can also mean the lookup simply failed, and the server caches the state for a few minutes, so a line may lag by up to ~5 minutes.

Kernel export file names

A kernel export saves each openQA job’s install log as <host>-zypper-<arch>.log and each LTP result as <host>-<arch>-<test>.json. When several jobs of one export would write the same file, each keeps its own file with the job ID inserted before the extension (<host>-zypper-<arch>-job-<id>.log); a name only one job claims never changes. Files from an earlier export are not deleted, so a plain <host>-zypper-<arch>.log written before this naming existed can remain next to the job-ID files.

MCP server

mtui-mcp is a Model Context Protocol server that exposes mtui’s functionality as tools an LLM client can call. Its tool surface is synthesised from the same command registry the mtui REPL uses: each non-denied command becomes one tool, with a JSON input schema derived from the command’s clap argument spec, dispatched through the same engine as the REPL. Adding, renaming, or removing a command changes the MCP tools automatically. Two commands, get and put, are denied synthesis and re-served under the same names as hand-written tools that carry file content in-band (see File transfer tools) — a path on the server’s filesystem would be meaningless to a remote --transport http client. put can still upload a file that already sits on the server, by source=, on either transport, gated by [mcp] put_dirs. The underlying semantics of each tool are the command semantics in the Command reference.

Building and running

The server lives behind the mcp feature, enabled by default alongside the mtui REPL’s cli feature (see Installation):

cargo run -p suse-mtui --bin mtui-mcp -- --help

Two transports are served:

  • stdio (default) — one process == one client. Use this for a local LLM client that spawns the server as a subprocess.

    mtui-mcp                       # stdio
    
  • streamable HTTP — many clients, with per-client session isolation.

    mtui-mcp --transport http --host 127.0.0.1 --port 8000
    

    --host/--port bind the HTTP listener and are ignored under stdio. The bind address is not restricted, but rmcp’s DNS-rebinding guard checks each request’s Host header, which must be localhost, 127.0.0.1 or ::1; anything else gets a 403. Keep the listener on loopback or behind an authenticated boundary (see Security boundary).

Logs go to stderr; stdout is the transport, so never write to it. set_log_level changes the level of that log, which belongs to the server: under --transport http a call from any client changes it for every session, and none of it reaches the client. A runtime level replaces the whole startup filter, per-target RUST_LOG directives included. The OTLP tracing diagnostics keep the startup level.

Tool profiles

The advertised tool surface can be narrowed with [mcp] profile:

  • full (default) — every synthesised tool.
  • core — a curated everyday subset; the rest are filtered out before they reach the wire.

Fine-tune with [mcp] tools_allow (add specific tools on top of the profile) and [mcp] tools_deny (remove specific tools; deny wins last). See the [mcp] table in Configuration for these and the resource caps (max_output_bytes, max_active_jobs, session budget, …).

Agent clients should prefer core: the full surface (78 tools) is sent on every request, while core (45 tools) covers the everyday flow — load → inspect → run/install → fill the report → approve/reject — without the host bookkeeping and server-tuning tail. If a workflow never lists the queue or polls openQA, deny those on top:

[mcp]
profile = "core"
tools_deny = ["updates", "openqa_overview"]

Security boundary

Profiles are not authentication or authorization. They reduce the advertised tool surface; they do not gate callers. HTTP session isolation is likewise not caller authentication. Keep the HTTP transport on its default loopback interface, or place it behind an authenticated boundary you trust to operate the remaining maintenance tools. Audit records attribute to a session, not a person (see Audit log). The audit trail such a deployment leaves is local-only unless shipped: see Shipping the audit log.

Permanent deny-list

Some commands are never synthesised into MCP tools, under every profile — this cannot be re-enabled with [mcp] tools_allow. The permanent-deny criterion is stated once, beside the list it governs — see the MCP_DENYLIST docs in crates/mtui-core/src/registry.rs — and each entry below names the reason it meets it.

  • The interactive/REPL-only commands, which require a controlling terminal or have no headless meaning: quit, exit, EOF, switch, shell, help, edit.
  • config_set: it writes operator config — endpoints, credentials, identity, timeouts — retargeting the infrastructure the session trusts, with no operator-visible artifact. config_show stays exposed, so a client can still verify the posture it operates under. A config_set call is refused as an unknown tool.
  • The path-based transfer commands get and put, replaced by the hand-written in-band tools of the same names (#434): their synthesized forms exchanged server-local paths a remote client cannot read or create. (Only the synthesized command forms are permanently gone; the replacement hand-written get/put are ordinary tools — present in full, restorable under core via tools_allow, removable via tools_deny.)
  • teregen_login: every call spends one of ~20 challenges/60s for the principal, so a looping client would lock the tester out of commit and approve. REPL-only; the REPL operator runs the check deliberately.

Local process execution and terminal launching are not on this list because they are not in mtui at all. The former lrun (run a command as the local process user) was removed outright — an MCP client already has its own local execution, and a REPL user is already at a shell. The former terms (spawn a terminal emulator per refhost) went the same way: it duplicated shell (#566).

The deny-list is intersected with the live registry and consistency-tested; a renamed or removed command that leaves a stale deny-list entry is warned about at boot, so the boundary cannot drift silently.

config_show filtering

config_show prints less over MCP than at the REPL (#410). The REPL operator owns the machine and can read mtui.toml directly, so it prints every resolved value verbatim (secrets as <set>). A headless client gets only what it needs to operate the session: endpoint URLs with embedded userinfo stripped and the operational tunables/flags. The no-argument bulk dump is refused headlessly — name the attribute(s) explicitly — as are the operator-local values (session_user, template_dir, refhosts_path, and a ssl_verify CA-bundle path; its true/false form is shown). Values config show never lists (the oscrc location, the OBS API URL, lock/history paths) reach neither surface through this tool.

whoami prints the oscrc principal and signing-key fingerprint on both surfaces by design: it is the remote auth identity the server sees (not operator-local paths), and a refused assign or commit is triaged against it. Key/oscrc/store file paths stay REPL-only.

Session state and isolation

Session state is isolated per client. Under stdio one process serves one client, so there is exactly one config / loaded template set / group of connected hosts. Under HTTP each connected client gets its own isolated session (its own config view, loaded templates, and hosts), so concurrent clients never see each other’s state. Clients load their own state at runtime via the load_template and add_host tools — mtui-mcp takes no boot-time update/host flags (see Invocation).

The HTTP registry refuses to create more than [mcp] session_cap concurrent sessions and reaps a session after [mcp] session_idle_timeout seconds of inactivity (disconnecting its hosts, for a client that vanished without ending its session).

A session’s teardown releases its pool claims, removes its operation locks (with or without a lock -c comment) and disconnects its hosts. It runs when the session ends: on stdin EOF, SIGINT, SIGTERM or SIGHUP under stdio; under HTTP when the client ends the session (DELETE), when the transport’s keep-alive gives up on it, at the idle sweep, and for every session at server shutdown on the same signals. A teardown gives up after 45 seconds. Nothing runs on SIGKILL or a crash: those holds stay until a later session reaps them past [lock] stale_age / pool_stale_age (one day by default) or someone runs unlock -f / unlock -p -f. list_refhosts --free names the holder, start time and comment of every lock it finds, without attaching or reaping. list_refhosts with summary: true answers “is there a free host for this product, version and arch” per slot instead of per host: with testplatform and free: true each requested arch gets one row with its free hosts and a free/busy/unknown/none verdict, none naming an arch the inventory has no host for. With json: true each row is

{"slot": {"product": "sles", "version": "15-SP6", "arch": "x86_64", "addons": []},
 "hosts": 2, "free": ["host-a"], "locked": 0, "pool": 1, "unreachable": 0,
 "verdict": "free"}

Every key is always present: without free: true, free, locked, pool and unreachable are null and verdict is "none" or null. The counts never overlap: an operation-locked host counts as locked even when also pool-claimed. The reply is a bare array unless rows were cut; then it is {"rows": [...]} plus "window": {"kept", "total"} for limit/offset, "truncation" for the row budget, and "probe": {"probed", "total"} when free left hosts unprobed. A verdict is a snapshot of one testplatform: it does not reserve the host, a host your own update pool-claimed shows as taken, and one host can be the only free candidate for slots of two testplatforms.

This isolation depends on rmcp’s legacy Mcp-Session-Id session lifecycle, so over HTTP mtui-mcp advertises protocol revisions 2024-11-05 through 2025-11-25 and declines 2026-07-28: that revision removes protocol-level sessions, and rmcp’s transport layer classifies any non-initialize request carrying complete 2026-07-28 metadata as stateless regardless of config, mints a throwaway server for it, and serves it inline — which would tear down and rebuild the per-client McpSession (its SSH connections, pool claims) on every such request. A client asking for it over HTTP falls back to the latest revision mtui-mcp does support.

Over stdio there is one client per process and no per-request session to protect, so that inline lifecycle is harmless: mtui-mcp advertises 2026-07-28 there too, so a client that opens with server/discover at that revision succeeds instead of being refused.

Multiple templates: scoping and fan-out

A session can hold several loaded templates at once (call load_template more than once; loading an already-loaded RRID reloads it). list_templates lists the set, and each template keeps its own test report and SSH host group.

Every command that acts on a loaded template carries the shared -T/--template and --all-templates flags, so its synthesised tool exposes two optional parameters. The session-level tools — load_template, unload, list_templates, list_refhosts, updates, review_state, config_show, whoami, set_log_level — expose neither, and regenerate exposes only template:

  • template="<RRID>" — scope this one call to a single loaded template (the analogue of the REPL -T flag). An unknown RRID returns a clean error.
  • all_templates=true — force fan-out across every loaded template.
  • all_templates=false — suppress fan-out on a tool whose command fans out by default, narrowing it to one template instead.

A client still sending template/all_templates to unload, list_templates, list_refhosts, updates, whoami or set_log_level, or all_templates to regenerate, has the call refused with unknown argument(s): … (they were ignored with a server-log warning in 26.4). load_template never accepted them; config_show never took them.

Omitting both parameters resolves per command: a read/annotate tool (list_* other than the session-level ones above, show_*, openqa_*, checkers, checkout, export, set_workflow, comment, analyze_diff, reload_openqa, reload_products, set_host_state, set_timeout) fans out across every loaded template, prefixing each template’s output with an === <RRID> === banner. A host-mutating or remote-write tool (update, prepare, downgrade, install, uninstall, set_repo, run, reboot, lock, unlock, add_host, remove_host, approve, reject, assign, unassign, request_review, commit, plus the hand-written get/ put transfer tools) never implicitly fans out: with several templates loaded and neither parameter set, the call is refused rather than guessed at — the error names the loaded RRIDs and the template=/all_templates=true escape hatches. This is the same rule the report_* tools use for their own required-with-several-loaded template parameter (below).

A fanned-out call that fails on one template keeps running on the others and reports an aggregate failure at the end.

switch is not an MCP tool (moving the active-template pointer is REPL-only navigation): over MCP you target a template per call with template=. load_template and unload <rrid> are exposed — each names its own RRID. list_templates is available as a read-only listing.

What approve reports on OBS

After an OBS approval (maintenance and PI requests) succeeds, approve reads the request again and, below approved <rrid>, prints one line per review still new that belongs to a QA group (a group whose name starts with qam) or to the acting user: still open: review by group <group>, or still open: review by user <user>. The automation groups qam-auto and qam-openqa are named too, as still open: review by group <group> (automated), because an open automated review also keeps the request from releasing. At most ten are named; a still open: <n> more line counts the rest. Only when none is open does it print no QA review left open on <rrid>. If that read fails, the one line is approved <rrid>; could not re-read its reviews (<cause>), check them: the approval stands and the call succeeds, but never with the all-clear line. A refused or failed approval makes no read. The Gitea path prints only approved <rrid>, since its bot posts the official review asynchronously. The reply is text only: a command tool returns one text block, so there is no structured open_reviews field. The REPL prints the same lines.

Non-interactive prompt behaviour

MCP sessions run with no interactive prompter installed, so a command that would prompt at the REPL never blocks waiting for input:

  • approve refuses non-interactively on a Gitea checkout-hash mismatch (at the REPL it prompts for confirmation, default no) unless accept_head names the PR head as Gitea reports it now — the refusal prints that head. The value is a pin, checked even when the report is not stale, and the LGTM is refused again if the head moves before it is posted. A missing Gitea token or a failed Gitea call refuses on every surface, since the check never produced a verdict to confirm. The reviewer and document checks, the Slack gate and the backend’s own checks (Gitea: hash gate, assignment, already decided; OBS: -g, assignment) all run before reviewer records or uploads anything, so a refusal from them publishes nothing. The verdict check, on OBS and Gitea alike, cannot: it reads TeReGen’s copy of the document after the upload, immediately before posting (approve needs PASSED; reject needs FAILED and a non-blank top comment; an unreadable document refuses), and a Gitea head that moves during the upload is refused at the LGTM with the reviewer already stored. A document changed on TeReGen after that read is not noticed. On Gitea a job_cancel that lands during the read stops the call with nothing posted. Without reviewer, both refuse while the loaded document has uncommitted edits. PI requests skip the verdict check.
  • load_template’s interactive “Force continue loading template ?” fallback — for a stale checkout hash that TeReGen also refuses to regenerate (already hand-edited) — is exposed as the --force-continue argument; without it the load is unconditionally abandoned, since the question’s non-interactive default is “no” (openSUSE/mtui#517). A force-continued load neither repairs nor bypasses the recorded mismatch, so it does not touch approve’s refusal above — and commit, export, reject --reviewer and request_review refuse the same way, unless given their own --allow-stale, so a stale-loaded report cannot be published or overwritten non-interactively either. approve’s check_hash() re-query is live (asks Gitea again, every call) and replaces that load-time verdict for approve -r; the others instead read whether the load itself saw a mismatch, so a report that loaded clean and only goes stale once the session is already open (a maintainer pushes to the PR while mtui-mcp still holds it loaded) passes them silently — commit is the one where that gap is most likely to matter, since it is the publish step.
  • A command timeout aborts immediately instead of offering the REPL’s wait/retry prompt.
  • comment and commit take their text/message as a required argument (no editor/stdin prompt), and regenerate gates overwrite on the --force flag rather than a prompt.
  • On a Gitea pull request, comment refuses text containing @<group>-review: (anywhere in the text, any letter case) before sending it: the review bot (group-review) reads such a line as an approval or, whatever else follows the colon, a decline, and a decision goes through approve / reject and their checks. reject refuses the same in its message, before the reviewer upload.
  • On a Gitea pull request, assign / unassign accept a user override only if it is a Gitea login (letters, digits, -, _, ., starting with a letter or digit), since it is written into the assignment comment.

SSH authentication is public-key only in every surface. A failed key auth reports the host as unreachable; mtui-mcp never falls back to a password prompt.

File transfer tools

The hand-written get and put tools replace the synthesized commands of the same names (#434), carrying content in-band in both directions. The REPL get/put commands work on literal paths instead, with downloads landing in {report_wd}/downloads/{name}.{host}.

With no template loaded, both tools act on the hosts added with add_host, as the REPL put does, so a fleet pass needs no update loaded. A template that is not loaded is still refused. Such a transfer runs on the session itself, so it first waits for every call already running, such as a list_refhosts --free or updates, and holds new calls back until it finishes. A slow reply is that wait, not a lost call; do not send the transfer again.

get (read-only)

Downloads remote (an absolute file path; folders are not supported in-band) from every enabled host and returns, per host, the remote size, a truncated flag, and the content: UTF-8 as content, binary as content_b64 (standard base64). Reads are capped per host at [mcp] max_input_bytes, enforced while reading — a host never buffers more than the cap (0 disables it and reads the whole file) — and each host gets an equal share of the [mcp] max_output_bytes wire budget. With a cap set, size is the file size the server reports when the file is opened, so it can differ from the returned bytes if the file changes during the read; a server that reports no size fails the call, naming the host, rather than being read without a bound. Without a cap, size is the number of bytes read. Truncation never splices a notice into the content: the truncated flag and size are the signal. Pass hosts (a list of connected hostnames) to retry or page a subset when one host’s file was truncated; unknown or disabled names refuse the call. Any host failure fails the whole call with the host named — partial content is never returned as success.

put

Uploads a payload — content (UTF-8), content_b64 or source, exactly one of the three — to <target tempdir>/<filename> on every enabled host, the same destination the REPL put uses. filename must be a bare name (no path separators); with source it defaults to the basename of the path you named. A payload above [mcp] max_input_bytes is refused outright: truncating an upload would corrupt it. Any host failure fails the call with the host named. Pass hosts (a list of connected hostnames) to write to a subset; unknown or disabled names refuse the call before anything is written, and the reply lists only the hosts written.

put neither takes nor checks the operation lock (/var/lock/mtui.lock): it writes to a host even when another owner holds that host’s lock, because an upload is not a zypper transaction. To leave such a host out, name the others in hosts, or disable it with set_host_state first.

source is an absolute path of a file on the machine running mtui-mcp, so the bytes never pass through the model. It works on both transports and is off until the operator lists directories in [mcp] put_dirs; without it the call is refused. The file must be a regular file whose resolved path (symlinks followed) lies strictly inside a listed directory, in any depth; anything else is refused before a lock is taken or a byte is sent, and a path outside every listed directory is refused the same way whether or not it exists. The refusal lists put_dirs. The file is read once, so the bytes that are size-checked, hashed and uploaded are the same buffer. The reply gains source: {path, bytes, sha256} — the resolved path, the byte count and the SHA-256 of what was uploaded.

List only directories whose contents may leave the machine and that only the operator can write. A file that someone else can place or swap in a listed directory (or in one of its parents) is uploaded to every host. Final symlinks are refused at open, but a directory component swapped between the check and the read is not defended against.

The destination path is unchanged, but a file is published atomically (see Uploads): readers of <filename> see the whole old file or the whole new one, an existing symlink or hardlink at that name is replaced rather than written through, and the file ends up mode 0770. A host whose server lacks posix-rename@openssh.com, or whose destination directories other users could swap, is refused by name and nothing is written there.

Command behaviour notes

  • Every tool schema sets additionalProperties: false, so an argument the tool does not declare is refused with unknown argument(s): ….

  • review_state (read-only) takes one or more RRIDs or Gitea pull request URLs in update and needs no loaded template. It only reads: no assign, no lock, no regeneration, no load. Each row names the holder of each QA group’s review (owner), the state of that review (gate), when it got there (since), when the update was created, the pull request head and base branch, and the template (current, stale, generating, missing: <first error line>, or n/a for a bare pull request URL, which names no RRID).

    • SLFO: the gate comes from the group’s latest review on the pull request that carries a verdict and is not dismissed — a later comment or draft does not count: owed (review requested, or the group only commented, which carries no verdict but clears Gitea’s request), approved, changes-requested, …, stale after a push, closed when the pull request was closed with the review owed, - when the group has no review. A review whose state, reviewer, dismissed or stale cannot be read makes the gate ? with the reason; a team review request is not the group’s and is skipped. approve, reject and assign count a decision comment as “already decided” only while these reviews do not show the group’s review owed again, yet the two can still disagree: a pull request approved with no decision comment is approved here but still open to approve, and assign’s review-requested guard reads the requested reviewers.
    • OBS: per qam group new, new (assigned) (an assign accepted the group review and its user review is open) or accepted, or the request’s own state once it left review. Automation groups (qam-auto, qam-openqa) are in --json with "automated": true and left out of the table.
    • An SLFO RRID’s pull request is the one its published document names (its number must be the RRID’s); without that document the row fails and asks for the URL. The base branch is shown as Gitea names it: mtui has no mapping from a codestream to a branch, so it does not judge it.
    • A value that cannot be read is ?, - means nothing (nobody, no review), n/a does not apply. A source that fails is named under the table (gitea, obs, teregen, document) and the call is then a tool error carrying the partial table; a cancel prints the rows already read and fails read N of M updates — unless a lookup had already failed, which the error then names first. An owner the open reviews and the review history disagree on is ? with a note:, and --mine is then ? too.
    • --json prints {"rows", "failed", "notes"}; each row’s values are typed objects ({"status": "known", "value": …}, {"status": "unknown"}, …), so a client never parses ? or approved, stale.
  • coverage (read-only) answers, per declared test-platform slot of each loaded report (a platform in install.test_platforms and one of its archs), whether testing.install.checks holds a check from a host the refhosts inventory resolves for that slot with the testplatform query add_host builds: checked (with the host), no-refhost, owed, not expected (an uncovered slot in the kernel workflow, which records no install check) or unreadable (the platform’s base, addon or archs could not be read back, so nothing is matched against it; a warning line comes first). Unlike add_host, which draws one host for identical queries, every declared platform and arch gets its own row. A check counts for one slot at most; the checks that count for none are listed with the reason: the inventory is unavailable, the host is not in it, the host serves no declared slot, or every slot it serves is counted for another check. It contacts no host and does not judge what a check shows. A report with no declared platforms is an error, never “nothing owed”; when the inventory cannot be read or holds no hosts, the first line says so and no slot is checked or no-refhost. In the auto workflow openQA install jobs are not counted against the slots.

  • list_metadata and updates show the QEM Dashboard’s embargo flag, read from its incident list (/api/incidents): yes, no, or unknown with a reason. no comes only from an incident that was read, paired with the update and carries embargoed: false; no paired incident, a missing or non-boolean flag, a failed read and a cancel are all unknown, never no. An incident is paired by its dashboard number (the review id for SLFO, the maintenance id otherwise), its type, and its project when that can be derived: always for a classic update, and for a git one from a pull request URL that names the update’s own pull number (openqa_jobs and openqa_overview take the project from any pull request URL). Without a project the number and type must match exactly one incident, and since pull request numbers repeat across repositories that incident must also share a source package with the update, or the state is unknown; when the URL names another pull number the reason says so (its pull request URL names another pull request, …). A Product Increment has no incident and is always unknown.

    • list_metadata puts Embargoed first and reads the dashboard once per template; a failed read shows unknown (<reason>) and the call still succeeds. list_metadata --json prints {"rrid", "embargoed", "embargoed_reason", "metadata": [{"label", "value"}]} for one template (it never fans out: pass template with several loaded); embargoed_reason is null unless the state is unknown. A git update without a pull request URL of its own pull number is unknown: with no repository to check, the incident cannot be confirmed as its own.
    • updates reads the dashboard only when asked, with field: ["Embargoed"] or embargoed, and then once for the whole queue, never per row. embargoed (yes, no, unknown, all) filters before limit/offset; no never matches an unknown row, unknown matches every row whose state could not be read, all keeps every row and only adds the state. Every row shows the state: the default layout appends embargoed=<state>, and a field list without Embargoed gets it added last. With json, rows gain qem_embargoed and qem_embargoed_reason whenever the dashboard is read, which with json means embargoed was passed (field cannot be combined with json); a row without them means the dashboard was not asked. A queue row names no workflow, so its RRID kind stands in: a Maintenance id is paired as a classic incident, an SLFO review id as a git pull request number. An SLFO row whose url is a pull request URL of that number on the configured Gitea origin ([gitea] url) is paired within the repository the URL names, as a loaded git update is; a missing url, one that is not such a URL, one on another origin, or one naming another pull number leaves the row unpaired by repository, and then the number must be unique and share a package with the row’s srcrpms. When the dashboard cannot be read (or no HTTP client can be built for it) every state is unknown, the text listing opens with a warning: line, and the call fails after the listing.
  • updates with live: true reads each shown row’s review gate, owner and template as review_state does, after limit/offset. review_group lists a row in any of its groups, so a row is judged on the review_group groups its own review groups also name (all of them when the row names none); without review_group, on the qam groups TeReGen lists it for. Automation groups (qam-auto, qam-openqa) never count, and the call is refused, before any request, when review_group names one. The output starts with the summary (live: read N of M shown rows: …), the dropped N rows whose verdict is no longer owed: … line in the unassigned and mine views, and the line saying the untracked list was not read, so a capped reply keeps them; each row’s live cells are one bounded line. Rows held by someone the view does not admit, rows not concluded (no review of a group, or groups that disagree) and rows whose read failed are listed apart; a failed read makes the call a tool error carrying the listing and naming those rows. With json: true it is one document, {"summary", "rows", "held", "unsettled", "live_failed", "dropped", "untracked", "notes", "truncation"?}; each row’s live object carries standing, owner, gate, since, created and template as the row shows them (unknown is null) and the typed read under review. It fails the same way. Without live the tool’s output and cost are unchanged. The tool is still advertised read_only: false; live adds only reads.

    • Together with embargoed (or field: ["Embargoed"]) the embargo filter runs first, before limit/offset and the row budget, so a row it drops costs no live read. The default layout shows embargoed=<state> before the live cells; a filter that leaves no row gives the empty live document (with json) or its message and the untracked line; a dashboard that cannot be read fails the call after the listing, named ahead of any live failure and outranking a cancel.
  • The openqa_overview and openqa_jobs tools hide their operator override flags (--url-openqa, --url-dashboard-qam, --url-qam, --test-pattern, --no-fetch, #410): a headless client uses the operator’s configured endpoints, and a sent one is refused as an unknown argument. The REPL keeps every flag.

  • openqa_jobs ends each red row with its failed modules from the listing it already reads. Its history (0-50, default 0) costs one or more openQA requests per distinct red scenario among the rows it prints (at most 100 scenarios, up to 51 pages each, four at a time, two minutes in all): a failed or timed-out lookup is named on its row and in a warning: line ahead of the summary, and fails the call after the listing, so a missing history never reads as “fails nowhere else”. A job_cancel keeps the listing printed and marks the unread scenarios not read: cancelled.

  • install, uninstall, prepare and downgrade resolve each checked host’s transaction with a dry run first and fail by name a host where it would remove a protected package the call did not name, or where the dry run fails (a 104 “not found” dry run is not a failure; see Removal guard); other removals come back as <host>: the transaction also removes …. update does the same in both its prepares: a host its first prepare refuses is left out of the patch, its reason comes back once as <host>: its prepare was refused: … however the update ends, and the failed result names the host; a host its --newpackage prepare refuses comes back in a newpackage prepare after update failed (…) warning while the update stands. Transactional, SLE 11 and YUM hosts are not checked, and each comes back once as <host>: no dry run exists for this host, …. allow_removal: true skips the check. run and the rollback of a failed update are not checked.

  • check_hosts runs up to four root commands per host (rpm -q, df -Pk /, systemctl --failed, and a grep of the section headers of /etc/zypp/repos.d/*.repo), so it is not advertised readOnlyHint and writes an audit intent record. It takes neither the operation lock nor a pool claim, writes no history row, keeps its probes out of the host log (show_log and export never see them), changes no package or repository, and runs no zypper: zypper takes the ZYpp lock while it runs, and mtui’s update script does not wait for that lock, so a zypper probe overlapping another tester’s update or prepare would make their zypper exit 7 and fail their run. The probes run in parallel across hosts and one after another on each host, each bounded to 60 s. It fails when any host’s verdict is fail or unknown, after printing every host. After a cancel it still fails, naming the hosts, rather than reporting a cancel, when any host could not be checked (disabled, unconnected, YUM) or any check that ran ended fail or unknown; only the checks the cancel stopped are left out. In text output the first line is the overall verdict, so it survives truncation; --json is one document (summary, the checks it ran, the ones it leaves unchecked: dependencies, patches, reboot), and a truncated JSON reply is not valid JSON — raise mcp_max_output_bytes or narrow with hosts. With json the tool never fans out: it covers the template named, or the only template loaded; with several loaded and no template it is refused as ambiguous rather than reporting on one the client cannot see, and all_templates is refused, so a reply is always one document. failed_units does not apply to SLE 11 and is listed in that host’s not_checked with a reason, without making it unknown; a YUM-family, disabled or unconnected host is unknown with a reason. With a report loaded, its own test repositories are not reported as left over. The probe outputs are verified on SLES 15-SP6, 12-SP5 and 16.0 x86_64 hosts; SLE 11, transactional hosts and other architectures are not yet.

  • The prepare tool fails — instead of reporting success — when the loaded report’s metadata names no package versions, and when no prepare command could be built for a connected host (#396), so automation keying on prepare’s success does not see a false positive on a metadata-empty report.

  • On a report whose metadata carries a binaries block, prepare narrows the package list per host to what that host’s products compose, and fails by name a host whose products compose none of it — rather than sending a list zypper refuses with “capability not found” (104). An architecture a product declares but the metadata never mentions composes nothing, not the full list, so it gets the same named refusal. update excludes such a host from its patch, scopes its own lock/repository/package-check to the hosts that do compose it, and reports a failure naming it, instead of patching a host its own prepare established no baseline on. On every report kind, update also excludes by name, before anything runs on it, a host the update’s repositories do not reach (no repository of this update matches the host's products (…); it was excluded from the update, its products could not be read; … for a host whose system was never read, or this update has no repository to add; … when the update has none): the patch would find nothing to install there and pass. A host either exclusion leaves out is left out of the automatic rollback too: when a patched peer fails its check, the rollback reaches only the hosts the patch was dispatched to. prepare with update set fails such a host by name the same way (…; nothing was installed), before anything runs on it, instead of installing from the repositories it already had; the other hosts are prepared. The refusal is in the tool’s error, once, also when a peer stops the prepare before its verdict: then one prepare failed on <hosts> (…) summary carries both.

  • update’s tool result carries diagnostics for every non-fatal degradation of the run — a composition refusal, a host excluded because its test update repository genuinely failed to register, or because its refresh failed on a read-only root (its partial add is undone and its lock released before the patch reaches its peers; when that undo fails too on a read-only root, the entry ends with what transactional-update -n rollback did: …: staged snapshot dropped, …: nothing was staged, or that it failed and a staged snapshot could remain), a host excluded because the update’s repositories do not reach it, a repository refresh that may have left stale metadata on a read-write host that still gets patched, a prepare host failure it continues past, a failed --newpackage step, a failed update naming the hosts it did not complete on and whether it rolls back or leaves their test repositories configured, a read-only-root host the rollback left out because its refresh failed while its repository removal succeeded, and which the reset put back (<host>: refreshing repos failed: …; no downgrade was run: staged snapshot dropped, or …: nothing was staged), a failed automatic rollback, and the three ways the post-update test-repo cleanup can fail — on both the success and the failure path. The server’s tracing goes to its own stderr, not the tool result, so a tracing::warn! alone would never reach an MCP client.

  • On each host update completed on, it also names every tracked package that did not end at the update’s version, one degradation each, from the version queries made before the patch and after it (on a transactional host, after its reboot). The state after the patch decides the finding: unchanged (including a package already at or above the update’s version before the patch), lower than before, raised but still below the update’s version, raised above it, no longer installed, or a version query before or after the patch that did not answer. Each line names what was observed and all three versions: <host>: pkg was already above the update's version before the patch, which did not change it (before the patch: 2.1-1; after it: 2.1-1; the update's version: 2.0-1). When the update’s version of a package could not be read from its metadata, the package is still judged unchanged, lower or removed (the update's version: could not be read), but not as below or above it. A package with several installed copies (a kernel) is judged on its newest copy. Not judged: a package not installed before the patch (one new to the host) unless the query after the patch did not answer, one the host does not track, one the update does not compose for the host’s products, and disabled, excluded or refused hosts. At most ten packages are listed per host, then <host>: N more tracked packages with a version finding, not listed here (see `list_packages`), which counts as one degradation. These qualify the confirmation like any other degradation; the update still counts as completed on the host.

  • Every workflow fan-out (install, uninstall, prepare, downgrade, update) confirms success as <verb> completed on <hosts>, so a clean run is never an empty tool result. update’s confirmation is printed above its diagnostics — the head of the buffer is what survives max_output_bytes — and is qualified whenever the run recorded a degradation: update completed on h1: the patch passed its checks, with 2 degradations reported below. The count is of degradations only; a check’s own recognised sections (the vendor-support notice, extra rpm output) ride in the same diagnostics and are routine on a healthy update, so they leave the confirmation bare. A partial run — one that failed on some hosts and completed on the rest, with nothing rolled back — still fails, naming the hosts it failed on, but first prints the confirmation for the hosts it completed on, so they need no second run. A host counts as completed only when it passed its check and, if transactional, came back from its reboot with the new snapshot active. An update is partial when it excluded a host (its products compose none of the update’s packages, or its test update repository failed to register), or when a peer’s patch never ran, could not work out what to patch, or did not come back from its reboot. On the last three it first finishes the peers whose patch passed as a successful run would: it reboots the transactional ones, then runs the --newpackage step, records the post-update package versions and removes the test update repositories on every host it completed on. Its degradation names the hosts it did not complete on, and for each says what the host’s record shows about the test update repositories: “still configured on ” (the script stopped before its cleanup, reported a failed removal, or has none, as on yum), “may still be configured on ” (the removal is not confirmed: nothing reported it, or the host is transactional and its staged snapshot may still list them), or nothing when the script reported them removed or this session added none. A rollback leaves out a peer that could not work out what to patch, since no patch ran there, and a peer whose patch never ran to completion, which it may be unable to reach or would hit with a second transaction; the degradation names each with its reason. The hosts the rollback reverts are named, from the same record, in a separate after the rollback, … degradation once it has run. A patch that failed its check rolls back the patched hosts, those two kinds of peer apart, and names no host as completed. So does a reboot that did not take on a reachable host, but only when every reboot that failed is on a reachable host and no peer’s patch never ran: the rollback cannot reach a peer lost to its reboot, and would start a second transaction on a peer whose first was never observed to end. Otherwise nothing is rolled back and the hosts whose reboot failed are named among the failures. A cancelled run names none as completed either. A rollback that fails itself names the hosts it did not restore.

  • add_host without -t follows added <hosts> (or no reference hosts resolved/connected) with one line per test-target slot or testplatform it left without a host and why: no matching refhost, an arch of the testplatform no reference host covers, every candidate claimed by another RRID, every candidate already serving another slot of the update, or a mix of the two, no candidate connected (unreachable, claimed remotely, operation lock held by <user> since <time> for another owner’s live operation lock, or refused because the update workflow cannot drive it: no command set for <Product version>, <root mode> with the root mode as detected, such as transactional or transactional-update.conf but root mode unknown, an unrecognised product, or an unreadable base product), the retry budget spent, or the refhosts inventory unavailable. The call still returns Ok in that case, so these lines are the signal to check.

  • With an update loaded, add_host -t refuses a host the update workflow cannot drive: could not attach any requested host: <host> (<reason>) when none attached. With nothing loaded it attaches such a host for run, get and put. load_template prints no unserved-slot lines, but prints skipped <host>: <reason> for each host it refused this way or skipped for another owner’s operation lock, including a pool host whose slot a sibling then served. add_host prints the same line for a refused host whose reason no unserved-slot line gives.

  • export emits one WARNING: line per host whose install-result block it left unverified in the report: WARNING: no package of this update is tracked for <host>... when the host tracks none (for example, the update ships packages for none of its products), and WARNING: no package version data recorded for <host>... when the host’s tracked packages were never checked (no update ran in this session).

  • export names the testing.install.checks rows it did not rewrite. With -t it rewrites the selected hosts’ rows only and keeps every other row, including that of a host no longer connected: testing.install.checks: kept the rows of the hosts not selected: <hosts>. Without -t it rewrites the checks from the connected hosts: testing.install.checks: dropped the rows of the hosts not connected: <hosts>. The rows are ordered by host.

  • reload_products follows <host>: reloaded products (<base>), for a host whose products changed, with <host>: tracked packages: +crmsh, ~smc-tools (required 1.0-1 -> 1.2-1), -foo (kept for their recorded checks: bar) — unchanged when nothing was gained, lost or required at a new version, and ; no package of this update is tracked there now when the host tracks none — then <host>: N newly tracked packages were never checked; run `update` before `export`. Until update checks them, export leaves that host’s verdict undecided without a warning of its own.

  • run prints its own verdict above its per-host output, for the same head-survives-max_output_bytes reason: run completed on h1 (exit 0), h2 (exit 1) names every host it ran on with its exit code, followed by FAILED on h2 (exit 1) when any host exited non-zero. run returns Ok on a non-zero remote exit — a non-zero exit is often expected — so this verdict, not the tool’s success/failure status, is the signal to check.

  • The run tool’s command is argv tokens, not a shell line: the tokens are re-quoted before dispatch, so ["cat /etc/os-release"] reaches the host as one quoted word (exit 127) and ["zypper","lr","|","grep","x"] passes a literal | as an argument. Split the words yourself (["cat","/etc/os-release"]), and for anything needing a shell — pipes, redirection, ; — ask for one explicitly: ["sh","-c","zypper lr | grep x"].

  • checkers lists the checker runs TeReGen holds for the update, not the report’s build_checks/ logs, which report_files lists. TeReGen serves checker results for SLFO ids only, so for any other id the tool does not ask it and answers No checker results for <id> (TeReGen serves checker results for SLFO ids only). For an SLFO id, No checker results for <id> means TeReGen answered with an empty list. A lookup that failed fails the tool with Checker lookup for <id>: TeReGen …, naming the cause: TeReGen unreachable, a body that is not JSON or carries no checkers array, or an error status with TeReGen’s own reason, as in TeReGen answered 404 Not Found: SMELT does not know update …. A 404 is TeReGen’s “nothing to give”; a 502 or 504 means SMELT failed or timed out, so the results are unknown. TeReGen’s text is stripped of terminal control sequences and cut to 500 characters. rrid="<RRID>" reads the checker runs of an update that is not loaded: it runs once whatever is loaded, loads nothing and touches no host, takes no template lock: like a session-level command it takes the registry gate shared, so a call scoped to one loaded template does not hold it up, but a call that holds the session exclusively, or is queued to — a fan-out update over several loaded templates, load_template, add_host with nothing loaded — delays it. It is audited under the RRID it reads, and refuses template/all_templates alongside it. The id must parse as an RRID whose maintenance component is letters, digits, ., _ and - only.

  • show_update_repos with check: true fetches the repository of each of the report’s install targets (repodata/repomd.xml, then its primary metadata, gzip or zstd) from the server mtui runs on — no refhost is needed — and gives each a status: ok, missing, empty, not published (a 404 on repomd.xml) or no answer (anything else that stopped the metadata being fetched or fully read, with the reason). A repository that could not be read is never reported as empty or missing, and only redirects that stay inside the repository are followed. The tool fails when any repository is not ok, after listing all of them, and when there is nothing to check. A cancel lists only the repositories already checked: the tool then fails with an ordinary error ending “; stopped after K of M” when one of them was not ok, and as cancelled otherwise. With json: true as well the reply’s first content block starts with one JSON object on one line:

    {"source": "install.targets", "total": 2, "checked": 2, "not_ok": 1, "ok": false,
     "repositories": [{"product": "SLES", "version": "15.5", "arch": "x86_64",
       "repository": "https://***@host/path/", "status": "missing", "packages": 12,
       "missing": ["foo"], "reason": "12 packages; not published at …: foo"}]}
    

    source is update_repos when the report has no install targets (each is then checked for being published and non-empty only); checked is below total after a cancel; packages is null when the metadata was not read. On failure the error summary follows the object on the next line. json never fans out: with several templates loaded, pass template; with all_templates: true the call is refused. Repository URLs are masked like every other URL mtui prints, and reasons and names are reduced to one printable line.

  • report_check (read-only) lists what the report document still owes before it can be approved. source is local (default: the loaded document, uncommitted edits included) or server (TeReGen’s stored copy, the one approve reads, fetched without credentials). Errors: unanswered (an owed field that is null, or a string that is empty or only whitespace: verdict; each issue’s reproducer, status and comment unless a tester filed it; with review, its three source questions, the build-log test_suite_present, test_suite_sufficient and both comments, and test_suite_passed only while test_suite_present is true; verdict and comment of testing.install and testing.regression where present), missing-section (testing.install and testing.regression on the manual workflow, testing.regression on the kernel workflow, nothing on auto; and, under any workflow, review on a maintenance or SLFO report, which the schema requires and only a PI report lacks), contradiction (a PASSED report over a FAILED install or regression verdict) and reject-reason (a FAILED report with no comment). Warnings: install-row (a row whose verdict is not PASSED, that lists no package, changes no version or loses a package), export-only (a regression comment holding only the kernel export’s block), openqa-running (one finding for a PASSED report over exported openqa_overview rows still running, naming how many and the first three) and no-install-log (install checks but no install log). The top comment, the reviewer and new_issues are not owed, and nothing judges whether an answer is right.

    The workflow is the loaded template’s, set at load: auto for load_template -a, switched to manual when the QEM Dashboard has no install results (or cannot be read); kernel for -k; set_workflow changes it (it is in the core profile). The document does not store it, so the same copy can owe sections under one workflow and none under another; each testing missing-section message names the workflow it was judged under, and so does approve’s refusal when one of its findings is one, even past the five it lists. A missing review does not depend on the workflow, and commit cannot add it: the refusal says to regenerate the document or report it to TeReGen. An install log is a *.log file other than checkers.log: locally in the install logs directory, read as commit collects it (absent or not a directory holds none); on the server in install_logs/ or uploads/, or, from a server that names no directory, an uploaded one. uploads/ also holds the committed results/ files, so a .log among those counts as well: the warning can miss a report whose only logs are results, never the other way round.

    With json: true the reply is one JSON object, counts first:

    {"ok": false, "errors": 1, "warnings": 0, "id": "SUSE:Maintenance:1:2",
     "source": "server", "workflow": "manual", "verdict": "PASSED",
     "etag": "\"abc\"", "dirty": false, "listed": 1,
     "omitted": {"errors": 0, "warnings": 0},
     "findings": [{"code": "unanswered", "severity": "error",
       "pointer": "/testing/regression/comment", "message": "not answered"}]}
    

    ok is true only when the check ran and found no error. At most 50 findings are listed, every error before any warning; listed says how many and omitted how many of each were left out, and the counts cover all. etag is the server copy’s, or for local the one the loaded copy was read or committed at, and null while the loaded copy has uncommitted edits. A server read that fails (a 404, an error status, a transport error, a body that does not parse, or a failed artifact listing) fails the tool naming the cause; it never answers ok. Without json the reply is the same as text, the summary first, as for show_update_repos. json never fans out, as for show_update_repos. With no document loaded it refuses like the report tools.

Report document tools

Eleven hand-written tools work on the loaded report as a document: nine read and edit it as named sections and issues rather than lines of text, and two list and read its files. Each accepts an optional template="<RRID>" selecting which loaded template to act on; with more than one template loaded an unscoped call is refused — the same “one template, or refuse” rule described under Multiple templates: scoping and fan-out — and with zero or one loaded it may be omitted. All refuse cleanly when no report is loaded.

The sections are verdict, comment, people, update, install, issues, new_issues, testing and review; review is absent from a PI report, and new_issues from a report whose teregen predates it. Reads never change the report.

report_sections (read-only)

  • Parameters: template (optional).
  • Returns { "id", "dirty", "sections": [{"name","size","has_unanswered"}], "complete", "unfilled": [...] }. size is the byte length of the section’s compact JSON (advisory). unfilled holds the RFC 6901 pointer of every null leaf in the whole document, in sorted key order, leaving out tester-filed (new: true) issues, which start out unanswered by design; complete is true when there is none. dirty is true while edits await commit.

report_section_read (read-only)

  • Parameters (required): section. Plus optional template.
  • Returns { "id", "section", "data" }. A section the report lacks refuses.

report_section_write

Replaces one tester section with value.

  • Parameters (required): section (verdict, comment, people, issues, new_issues, testing or review), value (declared as an object, array or string). Plus optional template. A string holding a JSON object or array is decoded for every section except verdict and comment, whose strings are always taken literally. Any other string for those sections is refused without echoing it: one that is not valid JSON names the parse error and its position (trailing characters at line 1 column 572), and one holding a JSON scalar names its kind.
  • No string sets verdict or comment back to unanswered: "null" is not a verdict and is refused, and "null" or "" is stored as the comment’s text. Use report_section_clear for that. A JSON null value is still accepted for these two, but the declared schema has no null arm, so a client that builds its call from the schema cannot send one.
  • update and install are pipeline-owned and refused. A section the report lacks refuses. An issues write must keep exactly the same issue keys; use report_issue_write for one entry. A new_issues write replaces the whole list of tester-filed bugs ([{"id","title","comment"?}]); an id that clashes with a pipeline issue or repeats is refused.
  • The whole candidate document is re-parsed against the typed schema, and a value carrying a key the schema would drop (an unknown key in a closed object, or null on an optional field) is refused. A refusal lists the offending pointers and leaves the report untouched. String patterns and array minimums are not checked locally, so the server can still refuse at commit.
  • A write changes local state only and marks the report dirty; commit uploads it. A later export overwrites the checks in testing.install (with -t, only the selected hosts’ rows), testing.openqa and people.testers.
  • Returns { "id", "section", "dirty": true, "size" }.
  • To set one field without sending the rest of its section back, such as testing.regression.comment next to the check rows export wrote, use report_field_write.

report_section_clear

Sets verdict or comment back to unanswered (null), so report_sections lists it in unfilled again.

  • Parameters (required): section (verdict or comment). Plus optional template. It takes no value.
  • Any other section is refused, as none of them can be unanswered as a whole. A null inside one, such as testing.regression.verdict, is written with report_section_write.
  • Applied to local state like report_section_write: it marks the report dirty, and commit uploads it.
  • Returns { "id", "section", "dirty": true, "size" }.

report_field_write

Sets one field of the report document, addressed by its RFC 6901 pointer as report_sections lists it under unfilled, and keeps the rest of its section as it is. A product increment’s testing.install.checks can run to tens of kilobytes; this tool never sends them.

report_field_write pointer=/testing/regression/comment value="zypper ps clean"
report_field_write pointer=/testing/install/verdict value="PASSED"
report_field_write pointer=/testing/install/checks/1/verdict value="PASSED"
  • Parameters (required): pointer, value (declared as a string or a boolean). Plus optional template. value replaces the field as given: a string is stored literally, so "null" or "{}" is text, and a JSON null clears the field back to unanswered, but the declared schema has no null arm, so a client that builds its call from the schema cannot send one: such a client clears a nested field with report_section_write, where the null travels inside the section’s value, and verdict or comment with report_section_clear. A yes/no field, such as /issues/<key>/reproducer or /review/build_log/test_suite_passed, takes true or false.
  • Only the fields the REPL report editor (edit) lets a tester change are accepted, from one shared list: verdict, comment, people.reviewer.name, an issue’s reproducer/status/comment, a tester-filed bug’s title/comment under new_issues, the verdict and comment of testing.install and testing.regression, a check row’s verdict, and the review answers and comments. Anything else is refused as read-only, notably a check row’s refhost, before and after, and all of testing.openqa: those are export’s. The next export rewrites every covered host’s check row, its verdict included. When the report has a new_issues list, a tester-filed bug is changed there, not under issues. A pointer to an object or list that holds such fields, such as /testing/regression, is refused as not a field.
  • A pointer under an absent testing.regression creates it with its keys null, then sets the field. An absent testing.install cannot be created this way, as its checks come from export.
  • The changed section goes through the same validation as report_section_write, and the write likewise changes local state only and marks the report dirty; commit uploads it.
  • Returns { "id", "pointer", "section", "dirty": true }.

report_issue_read (read-only)

  • Parameters (all optional): issue_id (such as bsc#1234567), template.
  • Without issue_id, returns { "id", "issues": [{"id","title","status", "severity","new"}] }, where new is true for a bug a tester filed and null otherwise; with it, { "id", "issue_id", "issue" }.

report_issue_write

Replaces one existing issue with value; the set of issues cannot grow or shrink. Validated and applied exactly like report_section_write. value is declared as an object; a string holding a JSON object is decoded.

  • Parameters (required): issue_id, value. Plus optional template.
  • Returns { "id", "issue_id", "dirty": true }.

report_new_issue_write

Files a bug found while testing, or updates one already filed. teregen keeps such a bug as an issue with new: true, so it also shows in report_issue_read.

  • Parameters (required): issue_id (bsc#…, bnc#…, boo#…, jsc#… or ijsc#…), title. Optional: comment, template.
  • An existing tester-filed bug gets the new title/comment and keeps its reproducer and status (answer those with report_issue_write); an empty comment clears it. A pipeline issue is refused.
  • Applied to local state like report_issue_write; commit uploads it.
  • Returns { "id", "issue_id", "dirty": true }.

report_new_issue_delete

Removes a bug filed with report_new_issue_write.

  • Parameters (required): issue_id. Plus optional template.
  • A pipeline issue, or an id the report does not have, is refused.
  • Returns { "id", "issue_id", "dirty": true }.

report_files (read-only)

Lists the report directory’s files — build_checks/, the install_logs directory, results/ and checkers.log — matched with the files teregen holds for the report, by name and server directory.

  • Parameters: template (optional).
  • Returns { "id", "files": [{"path","name","size","server"}], "server_only": [{"name","dir","path","origin","size","at"}] }, plus "server_error" when the server listing failed. files are the local regular files, sorted by path (report-directory-relative; subdirectories and symlinks are skipped). server is { "dir", "origin", "size", "at" } for the server copy report_file_read would read for that path (origin is pipeline or uploaded; dir is uploads, install_logs or build_checks, null from a server that does not say), or null when it has none; sizes differ until commit uploads. server_only lists server files with no local copy, one per dir when several directories hold the same name. path is the path report_file_read reads that copy from, or null when no path does: a same-named copy in uploads is read in place of the install_logs one, and a copy whose dir is missing or is not build_checks, install_logs or uploads, or whose name is not a plain file name, cannot be read on its own.
  • A failed server listing (not found, still generating, unreachable) never fails the call: the local list is returned with server_error set.

report_file_read (read-only)

Reads one of those files as text.

  • Parameters (required): path, relative to the report directory — either checkers.log or a file directly inside build_checks/, the install_logs directory or results/. Optional: offset (1-based first line, default 1), limit (maximum lines), template.

  • Returns { "id", "path", "total_lines", "content" }; a windowed read also carries offset and returned_lines. content is bounded by [mcp] max_output_bytes, and the read stops at [mcp] max_input_bytes (0 disables the cap), cutting a line that crosses it. A capped read ends with a notice, and total_lines then counts only the lines read up to the cap; the size of the unread rest is unknown.

  • A file the report directory lacks is read from the server instead, and the result then carries "source": "server" (a local read has no source key). The listing decides where the file is: mtui takes the first of these server directories that lists the file’s name.

    Local pathServer directories, in order
    build_checks/<name>build_checks
    <install_logs>/<name>uploads, then install_logs
    results/<name>uploads
    checkers.loguploads

    The tester’s committed copy in uploads wins over the pipeline’s install_logs file of the same name. With [mcp] max_input_bytes set, mtui sends Range: bytes=0-<cap> and so fetches at most one byte past the cap, which makes the usual capped-read notice appear; with 0 the whole file is fetched. The fetch is anonymous, like the listing.

  • Refuses a path that escapes the report directory (.., an absolute path, a symlink out), one outside the readable set, and a file that is neither local nor listed by the server. A server that lists the file but does not tag it with a directory (a teregen without artifact download) is refused with a message saying so; a report that is still generating is refused with a retry hint.

A result larger than [mcp] max_output_bytes comes back as { "truncated": true, "size", "content" }, where content is the capped JSON text, rather than as clipped (invalid) JSON.

Published report tools

Three hand-written read-only tools read TeReGen’s published copy of a report by rrid, with nothing loaded: a status table over several updates, a second tester reviewing a colleague’s report, a look before picking an update up. They never touch the loaded templates, the active template or a host, and send only anonymous GET requests to [url] teregen_api_v2. An rrid is refused before any request unless it parses and its maintenance component is letters, digits, ., _ and - only; a short spelling (S:M:…) reads the canonical id, which every result carries as rrid.

Every result also carries "source": "published". When this session has the same update loaded with report-document edits not yet uploaded by commit, it adds a note saying the published copy does not include them (or, when the loaded report is busy, that this is unknown); local files not yet uploaded are not tracked. A client cancel stops the call at its next request. Each call briefly locks the session to read its config and that flag, so a call that holds the session exclusively (a fan-out update, load_template, add_host with nothing loaded) delays it until it ends. These tools take no registry gate. Short server strings (id, kind, workflow, generated_at, a file’s name and dir) come back as one printable line, as error text does; section data and file content are returned as stored and may contain control characters, exactly as report_section_read and report_file_read return the loaded copy’s.

published_report (read-only)

  • Parameters: rrid (required), section (optional, one of the section names above).
  • Without section, returns { "rrid", "published": true, "id", "kind", "workflow", "generated_at", "sections": [{"name","size","has_unanswered"}], "complete", "unfilled": [...] }, the fields as report_sections gives them (there is no dirty). With it, { "rrid", "published": true, "id", "section", "data" }; a section the report lacks is refused.
  • TeReGen’s 404 on the document is an answer, not an error: { "rrid", "published": false, "message": "No report is published for <RRID>" }. Every other outcome is an error naming its cause: still generating, committing an earlier upload, stale, the id rejected, a transport failure or other status, a body that is not a report document (or a schema version this mtui does not read), or a document filed under another id.

published_files (read-only)

  • Parameters: rrid (required).
  • Returns { "rrid", "source", "count", "files": [{"name","dir","path","origin","size","at"}] } in the server’s order. path is what published_file_read reads the file from, by the table under report_file_read; it is null when a same-named copy in a preferred directory answers every such path, the dir is missing or not one of build_checks, install_logs and uploads, or the name is not a plain, printable file name. A failed listing is an error, never an empty list; whether a 404 here means no report is published is not established, so it is an error naming the 404.

published_file_read (read-only)

  • Parameters (required): rrid, path (checkers.log, or one plain file name directly under build_checks/, the install_logs directory or results/). Optional: offset, limit, as for report_file_read.
  • Returns { "rrid", "source", "path", "dir", "total_lines", "content" }, plus offset and returned_lines for a window. The path rules, the server directories, the byte caps and the decoding are report_file_read’s: the fetch asks for one byte past [mcp] max_input_bytes and ends a cut read with the same notice, and content is cut so the whole result fits [mcp] max_output_bytes with every other field kept.
  • Only a name the server’s listing holds is fetched; any other path is refused after the listing and before any file request. A path with ., .., an empty or absolute component, or outside the readable set is refused before any request. A file listed without a dir is refused with a message saying so.
  • An empty file has "total_lines": 0, "empty": true and a message saying it is empty. Bytes are decoded as lossy UTF-8, as report_file_read decodes them.

Like the report document tools, a published_report or published_files result larger than [mcp] max_output_bytes comes back as { "truncated": true, "size", "content" }.

Background jobs

Long-running commands run as background jobs so a tool call returns promptly with a job id you can poll. The slow host commands — run, check_hosts, update, downgrade, prepare, install, uninstall, set_repo, reboot, regenerate, add_host, load_template and request_review — accept a background=true parameter. Instead of holding the request open for the minutes the operation takes, the call returns immediately with the job id(s); when the command fans out across several templates it mints one job per template, each independently pollable and cancellable.

add_host and load_template -a connect to a whole batch of reference hosts, and one unreachable candidate among them can hold the call open far past any client’s patience — backgrounding is the only way to keep such a call cancellable via job_cancel.

Four job-control tools manage them:

  • job_list (read-only) — every job in the session and its state.
  • job_status(job_id, wait_seconds=0) (read-only) — one job’s state (running / done / failed / cancelled) and elapsed time; wait_seconds blocks for a terminal state first.
  • job_result(job_id, wait_seconds=0) (read-only) — a finished job’s captured output; it errors while the job is still running (or wait for it with wait_seconds) and surfaces the command’s failure envelope if it failed.
  • job_cancel(job_id) — cancel a running job. (A command already executing on a host may run to completion there even after cancel returns — the same caveat as Ctrl-C on a foreground run.) Two commands treat a cancel as a normal ending rather than a failure: request_review --watch stops watching (the request stays posted) and regenerate stops waiting (the server keeps building). Both return success, so their job ends done, not cancelled, with the reply text saying what was and was not finished. That covers regenerate’s wait only: a cancel while it reloads the finished report ends the job cancelled, as does a cancel while load_template waits for TeReGen.

wait_seconds (0-120, default 0) turns a poll loop into one held request: job_status and job_result park until the job is terminal or the budget lapses, then reply exactly as a plain poll would — the running snapshot, the output, or a “still running” error that now points at wait_seconds. Keep it under the client’s own request timeout; a value above 120 is refused, not clamped. While parked the call emits progress heartbeats if the client supplied a progressToken, and a notifications/cancelled interrupts it. Over HTTP rmcp additionally pings the per-request SSE stream every 15s; a client that silently disconnects instead leaves the wait to run out its budget server-side, holding nothing.

A job blocked mid host-operation cannot stop at a checkpoint, so cancelling it force-aborts the dispatch — which skips the operation’s own unlock(). A forced cancel therefore releases /var/lock/mtui.lock on the job’s behalf and reports the outcome in its reply.

What it releases is deliberately narrow: only the locks the cancelled job’s own host group actually took, and never a comment-marked (exclusive) hold such as a Product Increment assignment lock or an operator’s lock -c <text> reservation. Locks are owned per user + PID on the wire, so a broader sweep would remove a sibling template’s — or another MCP session’s — live hold on a shared refhost and report it as released.

The reply distinguishes: which hosts are now unlocked; which are still locked and by whom (check with list_locks; unlock --force releases the whole group of every loaded template); which release failed (check with list_locks and retry unlock once the host is reachable); and which templates could not be reached inside the release budget, whose lock state is therefore unknown. A cancel with no held lock to act on says nothing extra.

The release covers the templates the job’s dispatch resolved once it held its lock, so a job that ran on one template leaves the others alone; a job cancelled before it got that far uses the scope recorded when it was minted. A dispatch run with nothing loaded releases only the hosts added with add_host, even if a template was loaded since. One that resolved no template at all — a session-level command — falls back to every loaded template and the hosts added with add_host, the conservative reading for a dispatch that may have run across all of them.

Nothing else is done at the hosts. The remote command may still be running there; where it is a package transaction, the package manager’s own system-wide lock keeps serialising it, but a run or reboot has no such second layer and the release is purely mtui-side bookkeeping.

A cooperative cancel — a body that unwound at a checkpoint — is unchanged: it ran its own unlock discipline, and the cancel does not second-guess it.

Jobs are scoped to the session (under HTTP, the caller’s isolated session, so one client never sees another’s jobs). The per-session job budget (max_active_jobs, max_completed_jobs) and the single-result size cap (max_output_bytes) bound resource use so one client cannot exhaust the server or dwarf the client’s context.

Audit log

mtui-mcp executes consequential actions with nobody watching, so a configured server keeps a durable record of what ran. Set [mcp] audit_log to a file path; unset (the default) disables auditing and leaves behaviour byte-identical.

The sink is versioned JSONL, one object per line, opened O_APPEND with mode 0600 and fsynced before the response returns — entries survive a server restart and are never truncated. The open is O_NOFOLLOW and the resulting descriptor is vetted: anything that is not a regular file owned by the serving user is refused, so a planted symlink or FIFO cannot divert the append (or the 0600 tightening) onto another file. O_NOFOLLOW covers the path’s final component only — the sink’s directory must be writable by the serving user alone. A same-user hardlink is allowed on purpose; it crosses no boundary. The record is durable and append-only but not tamper-evident: there is no hash chain and no HMAC, so anyone writing as the owner can rewrite history undetected. Tamper evidence means shipping each record off-host as it lands — see OTLP log export. Every record carries principal: null, reserved for a future authenticated caller identity (#412): under HTTP every client acts with the server’s credentials, so records attribute to a session, never a person, and nothing client-declared (a header, a tool argument, an initialize client name) may ever populate it. An outcome record carries the schema version, the arrival timestamp, the sequence number, the session id, the transport, the reserved principal, the tool name, the (redacted, see below) arguments, the outcome (ok / error / unknown-tool), the duration, and the RRIDs and host names the call resolved to. An intent record carries the same header and the same arguments, and nothing that only exists afterwards. A terminal record carries no arguments at all.

With no template loaded, a call that acts on a report, such as run, lock or put, names the hosts added with add_host, and its rrids stay empty. A call that addresses no template (whoami, the job tools) names no host. The scope is the one the call ran under, so a call that waited for a load_template names the template it then ran on.

Host names on a record are best-effort: they are empty when the session is busy with an exclusive background job (a backgrounded load_template or add_host), because a record write never waits on the work it records; rrids are always recorded.

[mcp] audit_log_max_bytes (default 256 MiB) bounds the sink: the first open that finds the file at or over the cap rotates it to <path>.1, shifting .1….4 down one and discarding what was .5. That is usually an append, but the start-up probe opens the sink the same way, so a server can rotate before it answers anything. Archiving beyond .5 is the operator’s job. 0 disables rotation altogether; any other value below 4096 is raised to it with a warning, because a cap under one record’s worth rotates the trail away.

Rotation is housekeeping and never a gate: it neither blocks the dispatch worker nor refuses a call. Two servers may share one path, so it is serialised by an advisory lock on the file itself — taken without waiting. A writer that finds the lock held, or a filesystem that cannot take it at all (an NFS export without lockd answers ENOLCK), appends past the cap and rotates on a later call. A rename it cannot perform warns and keeps appending too, and that warning is not repeated until a rotation succeeds. Two consequences worth knowing when reading the files back: a writer that opened the sink just under the cap lands its line in <path>.1, so seq is monotonic overall but the order across the boundary file is not; and on NFS, Linux emulates flock with per-process POSIX locks, so two HTTP sessions in one process do not serialise there — at worst a second shift, never a refused call.

A tool that is not advertised readOnlyHint writes an intent record before it runs — schema version, arrival timestamp, sequence number, session, transport, reserved principal: null (see Audit log), event: "intent", tool, (redacted) arguments, and the trace correlation when the client supplied one. The bounded vendor tracestate rides alongside when it validates (1..=512 bytes, key=value members, at most 32; keys at most 256 characters — tenant 241, system 14 — values at most 256); malformed or oversized values are dropped, never stored. Nothing else, because nothing else exists yet. Its outcome record then carries intent: <seq>, and its duration_ms — measured from arrival, like ts — includes the intent record’s own write. Read-only tools skip the intent and write only the outcome record, so a poll loop still costs one record per call.

Both fields are an untrusted correlation key only: whatever the client sent, never an identity or an authorisation, reaching no shell and changing no dispatch or output byte — the same call with and without them answers identically, and the records differ only by those fields.

A backgrounded call therefore writes three records: the intent, a dispatch record naming the started job_ids, and a terminal record when the job reaches done / failed / cancelled, joinable by job id. The terminal record carries no arguments and no intent — it joins its dispatch by job_id, which also matters because a terminal record’s seq is not ordered against the calls around it in either direction: neither against its own dispatch record, since a job that settles at once can be minted first, nor against a job_result(wait_seconds) reply that waited for it. Join by job_id, never by seq. The terminal record also carries no trace context: the job outlives the call whose _meta supplied it.

A configured sink is probed once at start-up, before the OTLP probe: if it cannot be opened the server refuses to start and names the path on stderr, rather than loading quietly and failing on the first tool call.

Afterwards the sink fails in two different ways, on purpose. If the intent write fails the call is refused and nothing ran — the guarantee the sink exists to make. If the outcome write fails the work has already happened, so the executed result is still returned with [audit: outcome record lost (<reason>)] appended — as a trailing text block on a successful reply, or to the message of an error one. Discarding a result to report a logging failure would tell the client a refusal that never happened. The notice is always the last content block, so content[0] stays the verbatim payload a --json caller parses, and it is not counted in the record’s response_bytes. A failed terminal write can only warn — its dispatch already answered.

Reading the log back: an intent that no later record points at means “started, outcome not recorded” — a crash or a kill, or a lost outcome write whose client was told in band (and which the OTLP stream may still hold).

A put that uploaded a source file adds upload: {path, bytes, sha256} to its outcome record (the resolved path and a fingerprint, never the body). The intent record already holds the requested path in args.source; a call that failed on some host has no upload.

No tool argument carrying a credential in bulk lands verbatim. File-body payloads (put content/content_b64, report_section_write/report_issue_write/report_field_write value, report_new_issue_write title/comment) each record {bytes, sha256} over the original string, so a credentials file or SSH key uploaded via put stays correlatable without being persisted. Always fingerprinted, never inline, regardless of size — the same redaction feeds the file body, the OTLP body, and the size accounting, and no payload key is ever an indexed OTLP attribute.

Everything else is masked, not trusted. Every recorded string, at any nesting — run and comment argv included — runs through a token scanner that strips URL userinfo (and only that: every other byte of a URL is kept, since the record is of what ran) and replaces the value of a secret-named flag or key: --password secret, DB_PASSWORD=…, x-api-key: …, Authorization: Bearer …, Authorization: token … and '{"password":"…"}' all record <redacted>, through the quoting a shell line or a JSON payload wraps them in, while token_bucket=50, max_tokens=100, grep token file and ssh -p 22 host are left legible. Bearer, Basic and token keep their place in front of the credential they name — but only after a key that is itself a credential name, so Basic functionality verified stays a sentence.

The scanner keys on the name beside the value, so what it does not catch is worth knowing rather than discovering: a bare secret with no key beside it; a single-letter flag, whose meaning is per-program (sshpass -p secret, curl -u user:pass, psql -U user); a value attached to one (-pSECRET, -U user%pass); and anything passed by environment variable, stdin or a file the tool reads.

All file I/O runs on the blocking pool (spawn_blocking), so a down or slow disk never stalls the dispatch worker or the other calls it is serving — the one call that waits is the one whose own records are being written.

OTLP log export

The same record can also go to an OpenTelemetry collector as OTLP/HTTP LOGS (hand-rolled protobuf over the workspace reqwest/rustls stack — no opentelemetry-* crates): one log record per audit event, body = the verbatim JSONL line (already redacted and fingerprinted as above). Configuration is env-only (headers must never be CLI flags), so there are no new TOML keys:

  • OTEL_EXPORTER_OTLP_ENDPOINT (base URL, gains /v1/logs) or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT (full URL, wins verbatim). Unset-or-empty disables export, as does an invalid endpoint or a non-http/protobuf protocol (validated only when an endpoint exists).
  • OTEL_EXPORTER_OTLP_HEADERS / OTEL_EXPORTER_OTLP_LOGS_HEADERS (key=value,..., values percent-decoded; logs-specific wins).
  • OTEL_EXPORTER_OTLP_PROTOCOL / OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: only http/protobuf or unset.
  • OTEL_SERVICE_NAME (default mtui): resource service.name, the multi-deployment join key.

Sink matrix: file-only (audit_log set, no endpoint), OTLP-only (endpoint set, audit_log unset — the JSONL line is still built in memory and used verbatim), both (file first in seq order, then OTLP), neither (auditing off, dispatch byte-identical).

Each record carries closed mtui.* attributes (tool, event, seq, transport, session.id, plus outcome when there is one, response_bytes when sized, and allowlisted kwarg keys) and the W3C trace ids when the client supplied a strict lowercase 55-byte traceparent via _meta (also echoed as the record’s trace field; session.id stays server-minted). A valid tracestate rides the verbatim JSONL body as the record’s tracestate field but is never an indexed attribute. A startup probe posts one real diagnostics record (~5x500 ms) before serving and latches export health; failed batches merge into a pending audit_gap sent on recovery. Batching: 2048/stream cap, 512/batch, 500 ms interval, 10 s request timeout, 5 s shutdown flush, redirects off, [mtui] ssl_verify TLS posture.

Export never gates a tool call. The health latch decides whether a record is enqueued, nothing more: an unhealthy or full exporter logs a warning, merges the record’s seq into the audit_gap it will report on recovery, and the call still runs and still answers. The file sink stays the durable truth, so OTLP-only mode never refuses anything. Tracing diagnostics ride a separate best-effort queue (drop + counter; exporter/HTTP-stack targets excluded). The endpoint value never appears in logs, records, or errors.

Shipping the audit log

The file sink above is the durable truth, but it is local and — as noted — not tamper-evident. To get records off-host, into a SIEM, a log store, or any OpenTelemetry backend, tail the JSONL file with a collector’s filelog receiver. A minimal OpenTelemetry Collector Contrib setup lives in dist/otel-collector.yaml.example (tested with otelcol-contrib 0.164.0):

  • Receiver: filelog over [mcp] audit_log. include the audit path (plus <path>.1…<path>.5 if the rotated generations should ship too), start_at: end so a first start tails only new lines instead of re-shipping history, storage: file_storage so a restart resumes from its checkpoint (no re-ship, no gap), and a json_parser operator so each JSON line lands as attributes — queryable tool, event, outcome, seq, transport, session, args, … (the record’s own field names; the full line stays in the body too) — not one opaque message blob. Which fields exist depends on the event: intent has no outcome; terminal has no args and carries job_id/job_state instead.
  • Rotation stays mtui’s job. The sink rotates by size-cap shift (<path> → <path>.1, .1….4 down one, what was .5 discarded) under an advisory lock the collector never takes part in; the receiver tracks each file by fingerprint across the rename. Never point a copytruncate-style rotation at the sink — mtui only ever appends and renames, and an operator-side truncate would lose or duplicate lines. Archiving beyond .5 is yours to arrange (ship-then-delete, or move aside before the next shift discards it).
  • Permissions: same-user sidecar. The sink is 0600 owned by the serving user — created that way and re-tightened on every open, so a looser mode never survives the next write and no supplementary-group arrangement sticks. Run the collector as that same user, typically a same-user sidecar. Never o+r, never 0644: the record names consequential actions, and group/other write must stay off regardless, since the sink vetting refuses anything not owned by the serving user and a writable-by-others directory already voids the symlink/FIFO guarantee above.
  • Sensitivity: the file names consequential things. Every call and dispatch record carries the tool name, the outcome, the RRIDs and best-effort host names the call resolved to, and the redacted arguments (secrets masked, file bodies fingerprinted as {bytes, sha256} — see above). An intent record carries the same header and arguments but no outcome; a terminal record carries no arguments, only the tool, session, transport, duration, RRIDs and host names, the job id, its terminal state, and the outcome. Anyone who can read the shipped stream learns which hosts were acted on and how the calls ended. The example’s debug exporter prints each shipped record — redacted arguments and host names included — to the collector’s stdout, so keep that output (journals, container logs) to the same audience. Treat the collector endpoint, its storage, and its headers/tokens with the same care as the hosts themselves.
  • Correlation: the trace field joins caller spans — when populated. A line without trace still ships, so never filter on its presence; records name a session, never a person. See Audit log for the field rules.

Cancelling a foreground call

A client that sends an explicit notifications/cancelled for an in-flight foreground tool call drops the dispatch and releases the CommandLock it was holding — a follow-up call on the same RRID is not left queued behind it. What happens next depends on whether the call could be holding a host operation lock.

A report_* tool, a transfer tool (get/put) or a parked job_status/job_result wait never dispatches through the engine, so it cannot hold /var/lock/mtui.lock: the cancel drops the dispatch immediately and the tool call resolves to an error rather than a fabricated success.

A synthesised command tool (run, update, install, …) can be mid host-operation when the cancel arrives, and dropping it outright would strand that lock exactly as an unhandled job_cancel would. It instead runs the same two-stage sequence job_cancel uses: the dispatch’s own cancellation token is signalled first, giving it a short grace period to unwind at a checkpoint (a body that does — for example one already watching the session’s cancel token — returns its own verdict, success or failure, not a synthetic cancellation error). Only if the grace elapses is the dispatch force-aborted; the abort then best-effort releases /var/lock/mtui.lock on every host the call’s own group actually took (never a comment-marked reservation) and the error text names what it unlocked, what is still locked and by whom, and what could not be reached inside the release budget.

This only helps a client that sends the notification. mtui-mcp’s default transport is stdio, where there is no per-request connection to drop — a client that simply stops waiting (e.g. because it hit its own timeout) sends nothing, and the server has no way to learn the caller gave up. In that case the lock is still released, just on the ordinary schedule: the connect_timeout budget and the shared backup-retry budget bound how long that takes rather than leaving it unbounded. Backgrounding a slow command (background=true, see above) plus job_cancel remains the reliable way to recover a stuck call regardless of transport.

Long-running calls: progress heartbeats

Many commands legitimately take minutes (a run against a slow refhost, an update, a checkout). To keep MCP clients from timing out, mtui-mcp emits notifications/progress while a slow tool runs — for both synthesised command tools and the hand-written tools — provided the client supplied a progressToken on the request. Spec-compliant clients (Claude Desktop, opencode, the MCP Inspector, Cursor, …) reset their read deadline on each frame, so a ten-minute command still returns cleanly. Clients that ignore progress notifications should raise their own per-server read timeout instead. The job-control tools emit them only while parked on wait_seconds.

Connecting a client

mtui-mcp speaks standard MCP framing. A stdio client spawns the binary as a subprocess; an HTTP client connects to http://HOST:PORT/mcp.

Claude Desktop (stdio) — in claude_desktop_config.json:

{
  "mcpServers": {
    "mtui": { "command": "mtui-mcp", "args": ["--transport", "stdio"] }
  }
}

opencode (remote HTTP) — start mtui-mcp --transport http --port 8765, then in opencode.json:

{
  "mcp": {
    "mtui": { "type": "remote", "url": "http://127.0.0.1:8765/mcp", "enabled": true }
  }
}

opencode also accepts "type": "local" with "command": ["mtui-mcp", "--transport", "stdio"] to spawn it per-session instead.

Architecture

This page is a map, not a deep dive: it sketches how mtui is put together so the rest of the book (and the source) is easier to navigate. For the day-to-day contributor workflow — toolchain, quality gates, adding a command, testing — see the Developer guide. For the authoritative contributor spec and definition of done see AGENTS.md, which lives in the repository root.

Workspace layout

mtui is a Cargo workspace of single-purpose crates. Lower crates never depend on higher ones; mtui-core is the composition root that wires everything together.

CrateJob
mtui-typesDomain types + the error hierarchy. Pure, sync, no I/O. Includes the typed report_document model of the JSON-native TeReGen report (schema v1.0).
mtui-configTOML config + XDG path resolution.
mtui-hostsSSH/SFTP (russh), the Target/HostsGroup model, locks, the pool arbiter. Async.
mtui-datasourcesShared HTTP; refhosts resolve/search/verify; the openQA/QEM/Gitea/OBS/oqa-search/TeReGen/Slack clients. Async.
mtui-testreportTestreport lifecycle (TeReGen v2 document ingest/upload) and the update workflow (actions/checks/export).
mtui-coreThe Command trait + registry, Session, the dispatch engine, and the wiring that ties the crates together.
suse-mtui (root)Facade package (binaries mtui and mtui-mcp) owning src/bin/{mtui,mtui-mcp}.rs behind the cli/mcp features; its integration tests are in tests/it.rs.
mtui-tuiThe report-document editor: a walker over the report JSON Schema, the form model built on it, and the ratatui screen. Pure and sync; depends only on mtui-types, so neither the MCP server nor a --no-default-features build compiles ratatui.
mtui-cliThe reedline REPL library, including the terminal handover around the mtui-tui editor.
mtui-mcpThe rmcp server library.
xtaskDeveloper tasks run as cargo xtask: generated docs, completions and man pages, release tarballs, and the TeReGen corpus survey, schema check, login and write probes. Not published.
fuzz/cargo-fuzz harness over the untrusted-input parsers. A detached workspace that needs nightly, so it never affects the MSRV, Cargo.lock or stable CI.

The command registry is the single source of truth

Every command implements one Command trait and is registered into a central registry by an explicit register_all() (no auto-registration magic). Three consumers iterate that one registry:

  • the REPL’s command dispatch and tab-completion;
  • the generated command reference;
  • the mtui-mcp tool synthesiser, which turns each non-denied command’s clap arg spec into a JSON tool schema.

So adding, renaming, or removing a command updates the REPL, the docs, and the MCP tool surface together — they cannot drift. See MCP server for the deny-list that keeps REPL-only commands, config_set and teregen_login off the wire; get and put are re-served as in-band transfer tools.

Session state, not globals

Commands operate on an explicit Session (config, the HostsGroup targets, the loaded templates/metadata, the display) passed into each call — there are no hidden globals.

Trait injection and the no-cycles rule

The update-workflow doer/check registries live in mtui-testreport, but the install/uninstall template that needs them lives in mtui-hosts — the lower crate. mtui-hosts therefore declares a PlanProvider trait in terms of its own types, and mtui-testreport’s WorkflowRegistry implements it. The rule when two crates need to cooperate across that boundary: define a trait in the lower crate and inject an implementation from the higher one — never introduce a crate cycle.

Inject at the point of use. update_flow::perform_install / perform_uninstall install the provider on the HostsGroup immediately before driving the template. OperationGroup::plans has exactly one consumer, so there is exactly one site that cannot forget. Injecting where the group is built looks tidier but is not equivalent: an earlier design that wired one central spot was never called at all, leaving install and uninstall running no command while still reporting success.

Contracts

These data-format and workflow contracts keep mtui interoperable with the SUSE maintenance ecosystem. Each is owed to something live: the RRID grammar to OBS/IBS/QEM, the refhosts.yml schema to the qam-metadata fleet database, the report document schema to TeReGen, the MCP tool surface to downstream LLM clients, and the on-host formats to other mtui processes sharing a fleet — including older releases, which is why they are a wire format and not an implementation detail. The crates/*/tests/ fixtures are the authority.

  • RRID grammar — project:kind:maintenance_id:review_id and its parse errors (see the FAQ).
  • refhosts.yml schema — location-grouped on disk, but rows are merged/flattened/de-duplicated at load; parses identically to the golden fixtures.
  • Report document schema v1 — the JSON schema TeReGen serves (report_document::SCHEMA_JSON); drift from the live schema is checked at load.
  • Remote-lock wire format — one line, timestamp:user:pid[:comment], shared by the operation lock and the pool-claim lock (see Workflow concepts).
  • Remote history format — one timestamp:user:field1[:field2…] line appended to /var/log/mtui.log on each enabled host with sftp_append (append-only, so concurrent testers on one host never clobber one another), and read back by list_history.
  • MCP tool names/schemas — downstream LLM configs depend on them; the synthesised, slimmed schemas are snapshot-tested.
  • openQA BUILD query string — :{type}:{number}:{package} (crates/mtui-datasources/src/openqa/base.rs::OpenQABase::new), owed to openSUSE/qem-bot, which writes it (types/submissions.py:236), not to TeReGen. Each component is qem-bot’s own: type mirrors qem-dashboard’s incidents.type column (git/smelt, mtui_types::UpdateSource); number is the dashboard’s own incident number, which for every SLFO update (all of them Gitea PRs) is the review id, not the maintenance id (crates/mtui-datasources/src/qem_dashboard/incident.rs::QemIncident::incident_number); package is chosen by qem-bot’s sort_packages ordering (demote arch-suffixed/-livepatch- names, then shortest, then alphabetical), not plain shortest-by-length. A Product Increment is connected to neither qem-dashboard nor openQA, so mtui skips the dashboard fetch for PI outright rather than querying a service that was never going to answer.

Deliberate design choices

  • TOML config.
  • Native OBS/IBS API for the QAM review workflow, not an osc subprocess.
  • Two static binaries (mtui, mtui-mcp), no runtime interpreter to install.
  • Async I/O (tokio) with true parallel host fan-out.
  • Git-vs-OBS is decided per update, from the report document, not from the RRID. The RRID’s shape cannot tell an IBS request number from a Gitea PR number. mtui_types::UpdateSource is Git when the report document’s workflow is gitea, Obs otherwise, resolved once at load. Every SLFO update is a Gitea PR, so a kind: slfo document with workflow: obs is refused at load.

Developer guide

This guide covers the day-to-day mtui development workflow: the toolchain, the quality gates, how the command layer is structured, and how to add a command. Architecture has the higher-level crate map and the data-format contracts; AGENTS.md at the repo root is the authoritative contributor spec and definition of done.

Toolchain

mtui uses the standard Rust toolchain — no rustup is assumed (the reference dev box runs a Homebrew rustc). Edition 2024, MSRV 1.96, pinned via rust-version in Cargo.toml.

TaskCommand
Build everythingcargo build --workspace (produces both mtui and mtui-mcp)
Run the REPLcargo run -p suse-mtui -- --help
Run the MCP servercargo run -p suse-mtui --bin mtui-mcp -- --help
Formatcargo fmt --all
Lint (warnings are errors)cargo clippy --workspace --all-targets --all-features -- -D warnings
Docs (broken/private links are errors)RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --document-private-items
Testcargo test --workspace
Coveragecargo llvm-cov --workspace --lcov --output-path lcov.info

Repo automation lives in the xtask crate, invoked through the alias in .cargo/config.toml:

TaskCommandEffect
Regenerate packaging artifactscargo xtask gendist/completions/{bash,zsh,fish}/… + dist/man/*.1
Regenerate generated docscargo xtask gen-docsdocs/src/cli.md + docs/src/invocation.md
Build a release tarballcargo xtask package --version <VER> --target <TRIPLE> [--bin-dir <DIR>] [--out-dir <DIR>]dist/release/…tar.gz (binaries are read from target/<TRIPLE>/release unless --bin-dir is given)
Probe the teregen v1↔v2 corpuscargo xtask corpus-survey [--v1-base <URL>] [--v2-base <URL>]Read-only 200/404/409-stale/503/other split by RRID kind
Check for teregen schema driftcargo xtask schema-check [--url <URL>]Diffs the live /api/v2/schema against the committed copy
Mint/reuse a teregen v2 auth tokencargo xtask teregen-login [--base <URL>] [--user <NAME>] [--namespace <NS>] [--no-store] [--no-probe]Signs teregen’s SSH challenge with your oscrc key, caches the bearer token, and probes GET /schema; never prints the token
Probe the teregen v2 write clientcargo xtask teregen-put --id <RRID> [--base <URL>] [--user <NAME>] [--file <PATH>] [--if-match <ETAG>|--create] [--dry-run]GETs a document and re-PUTs it with the just-received ETag by default; --file/--if-match/--create drive a backfill or a deliberate negative case; --dry-run prints the request instead of sending it

The .deb/.rpm on the release page have no xtask equivalent — they are built only by the package job in .github/workflows/release.yml.

schema-check needs qam.suse.de, unreachable from GitHub-hosted runners, so it stays a manual dev tool: run cargo xtask schema-check when starting or resuming report-document work, and treat drift as blocking.

Quality gates

CI (.github/workflows/) mirrors the local gate, plus jobs the local gate does not run: typos, cargo-deny (cargo deny check runs locally), mdbook, packaging, container, cflite_fuzz/cflite_batch, codeql, dependency-review, scorecard and beta. Run the whole workspace before claiming done:

cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --document-private-items
cargo test --workspace                       # default features only
cargo build --workspace --no-default-features # feature matrix (compile-only)
cargo build --workspace --all-features        # feature matrix (compile-only)

Notes that save time:

  • The cost is compilation, not test execution. A cold cargo build --workspace --tests is ~80 s; the test run is ~20-25 s. Give the first cargo test --workspace of a session a generous timeout (≥5 min) and don’t treat a cold-cache timeout as a failure.
  • Test default features only while iterating. On a 10-core, 32 GiB Mac16,10, cargo test --workspace --all-features took 36 s versus 28 s with default features; it adds only notify-rust and no extra runtime signal beyond the compile-only feature matrix. CI only compiles --all-features; it does not test it.
  • Scope tight during dev: cargo test -p <crate> for the crate you’re touching; reserve cargo test --workspace for the final gate.
  • mtui-cli’s lib suite is the slow one (its edit/shell tests spawn real editor/shell subprocesses) — don’t rerun it when working elsewhere.

New or changed code needs ≥80% patch coverage. For a genuinely un-coverable best-effort network/error path, add a focused test or a justified allow — never leave coverage silently red.

Command architecture

Every interactive command implements one Command trait (crates/mtui-core/src/command.rs) and is registered into a central registry by an explicit register_all() (crates/mtui-core/src/registry.rs). The REPL dispatch, tab-completion, the generated command reference, and the mtui-mcp tool synthesiser all iterate that one registry — so the surfaces can’t drift.

The trait has just two required methods; everything else has a default:

MethodSignatureDefault
namefn name(&self) -> &'static str(required)
callasync fn call(&self, session: &mut Session, args: &ArgMatches) -> CommandResult(required) — the per-template command body
aliasesfn aliases(&self) -> &'static [&'static str]&[]
aboutfn about(&self) -> Option<&'static str>None
scopefn scope(&self) -> ScopeScope::Active
requires_canonical_sessionfn requires_canonical_session(&self, argv: &[String]) -> boolfalse — answered per invocation, not per command
reads_resolved_reportfn reads_resolved_report(&self) -> booltrue — false on a Scope::Single command exempts it from the claim refusal and drops -T
skip_hostless_templatesfn skip_hostless_templates(&self) -> booltrue
includes_detached_hostsfn includes_detached_hosts(&self) -> boolfalse — true counts retained removed-host logs as ownership of a named -t host
repoints_activefn repoints_active(&self) -> boolfalse — true keeps the active-template move the body made
configurefn configure(&self, cmd: clap::Command) -> clap::Commandidentity (no args)
completefn complete(&self, session: &Session, text: &str, line: &str) -> Vec<String>Vec::new()

The command body is call(), not run(). The trait’s provided run() is the fan-out driver that resolves the target template(s) (per Workflow concepts) and invokes call() once per template — commands normally do not override run().

Commands operate on an explicit Session (config, host targets, loaded templates, display) passed into each call. There are no hidden globals.

How to add a command

  1. Implement the trait in crates/mtui-core/src/commands/<name>.rs. A minimal command (model: commands/whoami.rs):

    #![allow(unused)]
    fn main() {
    use async_trait::async_trait;
    use clap::ArgMatches;
    
    use crate::command::Command;
    use crate::error::CommandResult;
    use crate::session::Session;
    
    /// One-line summary shown by `help` and in the generated CLI reference.
    pub struct Foo;
    
    #[async_trait]
    impl Command for Foo {
        fn name(&self) -> &'static str {
            "foo"
        }
    
        fn about(&self) -> Option<&'static str> {
            Some("Does the foo thing.")
        }
    
        async fn call(&self, session: &mut Session, _args: &ArgMatches) -> CommandResult {
            session.display.println("hello, foo");
            Ok(())
        }
    }
    }

    For a command with arguments, override configure to add clap::Args and read them from args in call; for completion, override complete; for a non-default fan-out policy, override scope. commands/switch.rs is a compact model that exercises all three (a required positional, Scope::Single, requires_canonical_session, and a prefix completer).

  2. Re-export the type from commands/mod.rs (the pub use block).

  3. Register it with one line in register_all() (crates/mtui-core/src/registry.rs):

    #![allow(unused)]
    fn main() {
    registry.register(Arc::new(commands::Foo));
    }

    It is now a REPL command and an MCP tool automatically.

  4. Decide MCP exposure. If the command is REPL-only (needs a TTY) or executes locally, add it to MCP_DENYLIST in registry.rs. The deny-list is intersected with the live registry and consistency-tested, so a stale entry is warned about at boot.

  5. Add tests (see below) with ≥80% patch coverage, and snapshot any new text output.

  6. Regenerate the docs: cargo xtask gen-docs picks the new command up into cli.md automatically (the drift-guard test fails until you commit the regenerated file). Add behavioural prose to Workflow concepts only if the command introduces cross-cutting behaviour the per-command help can’t express.

Testing conventions

  • Unit tests are colocated in a #[cfg(test)] mod tests in the same file (see commands/whoami.rs and commands/switch.rs). Cover arg parsing, call against a mock session, the error path, and completion.
  • Shared scaffolding lives in crates/mtui-core/src/commands/mod.rs’s testkit module: empty_session(), session_with_hosts(...), session_with_targets(...), a FakeReport test double, a capturing display Buffer, and matches(command, argv) — the helper that runs a command’s own clap parser exactly as the engine does.
  • Mock, don’t hit the network or real hosts. SSH goes through MockConnection (crates/mtui-hosts/src/connection/mock.rs, implementing the Connection trait); HTTP goes through wiremock; subprocesses are driven through a command-runner trait or a stub on PATH. Real hosts/containers are gated behind #[ignore] + a CI env flag.
  • Real-sshd upload fixture. crates/mtui-hosts/tests/remote_upload_safety.rs runs the upload path against a disposable, unprivileged OpenSSH sshd on loopback (generated keys, a scratch root under the system temp dir, public-key login, killed on drop) so symlink/hardlink/rename behaviour is the operating system’s. It is #[ignore], runs locally only (no workflow sets the flag or passes --ignored) and needs MTUI_TEST_REAL_SFTP=1; if that is set and sshd, sftp-server or ssh-keygen is missing it panics rather than passing: MTUI_TEST_REAL_SFTP=1 cargo test -p mtui-hosts --test it remote_upload_safety -- --ignored --test-threads=1. Optional overrides: MTUI_TEST_REAL_SSHD, MTUI_TEST_REAL_SFTP_SERVER, MTUI_TEST_REAL_SFTP_SCRATCH. It runs as one user, so how a sticky directory treats a different user’s file is not covered.
  • Snapshot text contracts with insta (report document goldens, MCP schemas, the lock wire format, display output). Review new snapshots with cargo insta review.
  • Make sure the test can fail. A green run means something only if red was reachable. Watch for fixtures that quietly disarm the assertion: a MockConnection answering empty stdout builds no downgrade command, so an “assert no --oldpackage” passes vacuously; a with_changing_boot_id() mock passes a skip-the-reboot test even when only the dispatch was skipped. For a test written to pin a bug, revert the fix, watch it go red, then restore. The same applies to the fix itself — when the leaf you are gating has other callers (Target::reboot is reached by close and the reboot command, not just the fan-out), gate on the layer that owns the state and probe the sibling paths.
  • A command whose body repoints the active template must be exercised through run, not call. Command::run is what restores the pre-dispatch pointer after call returns; a call-only test cannot observe that restore, so it cannot see a body-level pointer move get reverted.

The one-it.rs-per-crate rule

To keep test-compile time down, each crate’s integration tests are consolidated into a single binary. A crate using this pattern has, in its Cargo.toml:

autotests = false

[[test]]
name = "it"
path = "tests/it.rs"

and tests/it.rs pulls each test file in as a module:

#![allow(unused)]
fn main() {
#[path = "gitea.rs"]
mod gitea;
}

So add a new integration test as a mod line in tests/it.rs, not as a new top-level tests/*.rs (a new top-level file would be silently ignored under autotests = false). Because all the crate’s integration tests then share one process, anything touching a process-global (env vars, the spinner sink) must be serialised with #[serial(...)], and tests must not assume per-binary isolation. insta prefixes each snapshot file with the test-binary name, which is it for these crates: it__<module>__<name>.snap.

Exceptions. mtui-core, mtui-config (a single tests/load.rs) and xtask do not use the it.rs pattern — their integration tests are per-file, and mtui-core’s snapshots are named <module>__<name>.snap (no it__ prefix). mtui-cli has no tests/ directory. Add an integration test to mtui-core or xtask as a normal top-level tests/*.rs; use the it.rs mod convention in root suse-mtui, mtui-types, mtui-hosts, mtui-datasources, mtui-testreport, mtui-tui, and mtui-mcp.

Debugging the MCP server

The MCP server page is the operator reference; this covers iterating on the server itself (schema synthesis, the deny-list, a new report_* tool).

Start it under HTTP with debug logging:

cargo run -p suse-mtui --bin mtui-mcp -- --transport http --port 8765 --debug

Then drive it with the MCP Inspector without an LLM in the loop:

npx @modelcontextprotocol/inspector

In the UI select Streamable HTTP, set the URL to http://127.0.0.1:8765/mcp, connect, and use the Tools tab to list every synthesised tool and call it with hand-crafted arguments. For a stdio smoke-test, point the Inspector at the binary instead of a URL; it spawns the subprocess and attaches to its stdio streams.

whoami is the cheapest end-to-end check — no loaded report, no hosts — so a successful whoami() confirms schema synthesis, the dispatch wrapper, the session lock, and the response envelope. The report_* tools refuse cleanly with a “no report document loaded” message until a load_template call has run, which is the correct refusal path.

Common issues:

  • A new command is missing from the tool surface — check MCP_DENYLIST; if it isn’t denied, confirm it’s registered in register_all() and re-exported from commands/mod.rs. Run with --debug to see the synthesis loop.
  • Tool calls time out — network-bound commands run for minutes; either raise the client’s read timeout or use background=true (see Background jobs). The server emits progress heartbeats for clients that supply a progressToken.

Fuzzing

fuzz/ holds seven cargo-fuzz targets over the untrusted-input parsers, in fuzz/fuzz_targets/. It is a detached workspace that needs nightly:

cargo +nightly fuzz run <target>

CI runs the targets with ClusterFuzzLite on pull requests (docs-only changes are skipped) and on pushes to main, plus a weekly batch.

Documentation

The book lives under docs/ (mdBook). Two pages are generated — cli.md from the command registry and invocation.md from the binary parsers — via cargo xtask gen-docs; a drift-guard test (cargo test -p xtask) fails if the checked-in copies are stale. The same guard covers dist/completions and dist/man: run cargo xtask gen after a command or flag change. Never hand-edit those two files (or the cli.md preamble, which is emitted by the generator). Every other page is hand-written.

Build the book locally (if mdbook and mdbook-linkcheck2 are installed; CI pins mdbook-linkcheck2 0.13.0):

mdbook build docs

Issue tracking and commits

Work is tracked in the project’s issue tracker.

Commits follow Conventional Commits (feat/fix/docs/refactor/test/ chore/…), explaining why rather than restating the diff. Reference SUSE Bugzilla as bsc#NNNN / boo#NNNN where applicable. Only commit when asked; inspect git status/git diff first and stage only intended files.

FAQ

What is an RRID?

An RRID is the project:kind:maintenance_id:review_id identifier that names a maintenance request across the SUSE ecosystem — for example SUSE:Maintenance:12345:678901. It is parsed by splitting on : (empty tokens dropped, so leading/trailing/doubled colons are ignored) into exactly four positional components; more than four is rejected, and a missing component is a parse error. This grammar and its errors are a stable contract with the rest of the maintenance ecosystem.

Can I set the template directory without passing it every time?

Yes. Set template_dir under [mtui] in your config file, or export $TEMPLATE_DIR (the built-in default reads it). See Configuration.

Can I work on several updates at once?

Yes. Load more than one testreport and each is a template in the session: list_templates shows the loaded set and switch changes the active one. A command that acts on a template takes its scope from the command: read/annotate commands (list_* other than list_products, show_*, openqa_*, export, checkout, comment, …) cover every loaded template, and the rest act on the active one (session-level commands such as list_templates, updates or config take no template flag). Scope a call with -T <RRID>/--template <RRID>, or fan out with --all-templates. Under fan-out each template gets its own === <RRID> === banner. See Workflow concepts.

Can I run mtui without loading a testreport?

Yes, for the commands that do not need one. list_refhosts searches the reference-host inventory without a loaded template (and without SSH, unless you pass --free, which connects to read each host’s lock state). run, reboot, lock/unlock, put/get and reload_products act on hosts you added with add_host. install, uninstall, prepare, update and downgrade refuse without a loaded template.

Does mtui support SSH password authentication?

No — and it never will. mtui is pubkey-only by design: it authenticates from your SSH agent, the IdentityFile entries of ~/.ssh/config or ~/.ssh/id_*.

Can several testers use the same reference hosts at once?

Yes, but the locks are advisory and fail-fast by default. Every mtui on the fleet writes the same timestamp:user:pid[:comment] layout, so sessions see one another’s claims — a pool draw skips a host whose pool claim or live operation lock someone else holds (another mtui process of yours included), and an install/update aborts with “Hosts locked” rather than waiting. Raise [lock] wait (default 0) to poll for a busy host during pool arbitration; install/update still refuse at once on a host someone else already holds. Naming a held host explicitly (add_host -t) is refused with the holder’s RRID instead of attaching it, and a fresh remote claim blocks -t with no override on that template: have the holding template run unlock --pool --force -t <host>, or wait for the stale reap. A named host under another owner’s operation lock still attaches, and its lock-taking calls fail until that lock is released. There are two locks with that layout: the operation lock (/var/lock/mtui.lock, PID-based, guards serialized zypper transactions) and the pool-claim lock (/var/lock/mtui-pool.lock, RRID-based). Stale-lock reaping is configurable under [lock] — see Configuration.

Where does mtui find the reference-host inventory?

From refhosts.yml, resolved by the ordered [refhosts] resolvers list (default https,path): the HTTPS database ([refhosts] https_uri, cached with a https_expiration TTL) and/or a local file ([refhosts] path). The file is grouped by location on disk, but location is a legacy grouping — rows are merged, flattened, and de-duplicated at load.

How do I change the editor used by the edit command?

edit spawns your $EDITOR (vim when unset) on the controlling terminal. Set it in your shell environment. When the loaded report is a JSON document, a bare edit opens the document editor instead (see the next question); edit FILE always uses $EDITOR.

How do I fill in a report document by hand?

With a document loaded, edit opens a full-screen form over it, one tab per section: summary (verdict and comment), people, issues, testing and review, then update and install, which are read-only. Tab/Shift-Tab switch sections, Up/Down move, Enter edits a field or opens a group, Left/Right step an enum or yes/no field, n sets a field to null, Ctrl-S saves and q/Ctrl-C quits (asking first when there are unsaved changes); ? lists the keys. On the issues tab, a (or Enter on the new_issues row) files a bug you found (it asks for the id, the title and an optional comment) and d deletes a bug you filed; pipeline issues cannot be deleted.

Only the tester’s answers are editable: verdicts, comments, issue reproducer/status/comment, the title and comment of a bug you filed, the reviewer name and the review questions. Fields the pipeline or export fills in are shown greyed. Every field is checked against the report schema as you edit it, and Ctrl-S re-checks the whole document; a refusal leaves the editor open on the offending field.

A save marks the document as edited but not uploaded — commit uploads it, and unload/regenerate refuse to drop it without --discard-authored. regenerate also looks at the server’s copy: in the REPL it asks before discarding tester content found there or in the loaded document, and over MCP it refuses. export keeps the verdicts and comments you entered under testing.install and testing.regression; it rewrites only the install checks (with -t, only the selected hosts’ rows) and the kernel results block inside the regression comment. The editor needs a terminal on both stdin and stdout.

How do I export results into the testreport?

export authors the collected update data (and, for the openQA-sourced workflows, openQA data) onto the loaded report document’s testing.* sections and writes the install logs to the report directory. A Manual export also fetches the QEM Dashboard results into testing.openqa. The document stays local until commit uploads it. Re-exporting updates the same sections in place.

A Manual export must run from the session that ran update: the before/after package versions exist only in that process, so from any other session export refuses rather than write a report with no verdict. It also refuses when no package of the update is tracked for any selected host, for example because the update ships packages for none of the products installed there; running update does not change what a host tracks, but once the missing product is registered on the host, reload_products makes the host track its packages. --allow-unverified writes the unverified scaffold anyway.

Where do OBS/Gitea credentials come from?

  • OBS/IBS: from your oscrc, located like osc itself — $OSC_CONFIG, then $XDG_CONFIG_HOME/osc/oscrc, then ~/.oscrc. There is no mtui-side path option; point $OSC_CONFIG at a non-default file. The API to act against is [obs] api_url.
  • Gitea: the [gitea] token config option. It is treated as a secret — masked as <set> in config output and sent only in an Authorization header, never logged.

Do I still need osc installed?

No. The QAM review workflow (assign/unassign/approve/reject/comment) talks to the OBS/IBS API natively — no osc subprocess.

How do I install packages the update newly introduces?

Feature updates often add packages that only exist in the test-update repository, so prepare can’t install them yet. Run update --newpackage to install the new packages right after the update applies.

Why does prepare (or update) refuse to run?

When the loaded report’s metadata names no package versions, prepare and update refuse with an error rather than reporting prepare completed on <hosts> over a no-op that installs nothing (#396). Check list_packages -w and the report metadata; a host the fan-out cannot build a command for (unresolvable release, no matching template) likewise fails the run by name. That includes a SLES 16 host whose root mode could not be determined, reported as missing preparer: <host> (<product version>, transactional-update.conf but root mode unknown).

When a host action completes on some hosts and fails on others, the command prints <verb> completed on <hosts> for the hosts it completed on before it reports the failure.

Why do show_diff and analyze_diff fail on an SLFO update?

On a Gitea-workflow update the only diff mtui fetches is the product pull request’s (cached as source.diff in the report directory). It names no package’s spec, changelog or patches, and mtui does not follow it to the package pull requests, so it is no source review: analyze_diff fails at once naming the source packages whose source was not reviewed, and show_diff shows the product diff under a warning: line saying the same, then fails with that message. Review each package’s own pull request in Gitea. This applies to Gitea-workflow updates only: on an OBS update, analyze_diff on a source.diff without a spec section still prints No spec mentioned in source.diff and succeeds.

How do I control what prepare installs?

prepare has three switches:

  • prepare -f / --force — force installation even on package conflicts.
  • prepare -i / --installed — narrow the package list to what each host already carries (skip pulling in additional patchinfo packages). Each host still installs its own list in a single transaction.
  • prepare -u / --update — enable the test-update repositories and install from there.

Independently of those switches, on a report whose metadata carries a binaries block the list is narrowed per host to what that host’s products actually compose (base product plus addons). A host whose products compose none of the list is failed by name rather than sent a list zypper will refuse with “capability not found” (104); a host no product of which the metadata names keeps the full list and logs a warning. An architecture a product declares but the binaries block never mentions at all composes nothing rather than falling back to the full list — it is treated as known-and-empty, not unknown, so it gets the same named refusal as any other host whose products compose none of the requested packages.

update’s own prepare narrows the same way, and a host it refuses is left out of the patch — no prepare ran on it, so there is no package baseline to patch — and named in the update’s error instead of being patched anyway. update’s own operation lock, repository add/remove and pre/post package version check are scoped to the hosts that actually compose it, so a refused host draws none of them either: it cannot contend the group’s lock, have its repository configuration changed, or block a composing peer’s patch behind its own unresolvable updater.

update also leaves out a host the update’s repositories do not reach, on any report: one whose products match none of them, one whose products could not be read, or every host when the update has none. The prepare of a classic maintenance report narrows nothing, and a host no product of which the metadata names keeps the full list, so neither refuses it, yet the patch would find nothing to install there and pass. Such a host is left out before anything runs on it: no prepare, lock, repository change, patch or package check. The update’s error names it: <host>: no repository of this update matches the host's products (…); it was excluded from the update, <host>: its products could not be read; it was excluded from the update, or <host>: this update has no repository to add; it was excluded from the update.

These exclusions cover the automatic rollback too. When a host that was patched then fails its check, or a reachable host’s reboot does not take effect, the rollback reaches only the hosts the patch was dispatched to, so an excluded host gets no lock, repository change, downgrade, history row or reboot from it. When a peer’s patch never ran, or a host does not reconnect after its reboot, nothing is rolled back: the hosts the update completed on get the same finishing steps as a successful run instead.

prepare -u fails such a host by name too, on any report: no test repository would be added to it, so its install would draw only on the repositories it already had. It is left out before anything runs on it (no preparer lookup, lock, repository change or install), so neither a missing preparer nor another tester’s lock on it can fail its peers’ prepare. The other hosts are prepared, and the prepare’s error names it: <host>: no repository of this update matches the host's products (…); nothing was installed, <host>: its products could not be read; nothing was installed, or <host>: this update has no repository to add; nothing was installed. It is named even when a peer stops the prepare first (a missing preparer, another tester’s lock, a failed repository add), in one prepare failed on <hosts> (…) summary with the error that stopped it.

Can I run a command on only some of the connected hosts?

Yes — temporarily disable the rest with set_host_state, then re-enable:

set_host_state -t hostA -t hostC disabled
run zypper lr            # runs only on the still-enabled hosts
set_host_state enabled   # re-enable all

disabled hosts run nothing (and print nothing).

Can I export the update log from a specific refhost?

Yes: export -t <host>. It rewrites that host’s install check and keeps the rows of every other host already in testing.install.checks, a host no longer connected included, so a host tested after the others were exported can be added on its own; the answer names the hosts whose rows it kept. By default export writes the collected data for every host in the list — including disabled ones — and drops the row of a host no longer connected (the answer names it), so to keep a temporarily-added host out of the report, remove_host -t <host> before exporting.

Why doesn’t put *.rpm upload anything?

Inside the REPL nothing expands the *, so put looks for a file literally named *.rpm and errors with File *.rpm not found. That is deliberate, not a gap (#399): put pushes to every enabled refhost in the group, which is exactly where an over-broad pattern does damage, so mtui refuses to guess how wide a pattern was meant to be. To upload several files, put the directory containing them (it is walked recursively), or expand the glob in your own shell before invoking mtui.

Where are the per-host install logs stored?

Under the loaded report’s directory, in template_dir/<RRID>/install_logs/. The file names depend on the workflow: a Manual export writes <host>.log (one file per refhost), an Auto export <distri>_<version>_<arch>[_<flavor>].log (one per openQA job), and a Kernel export <host>-zypper-<arch>.log, where <host> is the last segment of the openQA instance URL and jobs that would write the same name get -job-<id> inserted before the extension. The install_logs sub-directory name is configurable under [mtui]; see Configuration.

What does Ctrl-C do?

It depends on whether a command is running.

At the prompt, Ctrl-C clears the line you were typing and reprompts. It never exits mtui — use quit, exit, or Ctrl-D for that, so the session’s hosts are unlocked and closed on the way out.

While a command is running, the first Ctrl-C asks it to stop at its next checkpoint. Every path releases the hosts’ operation locks on the way out, so nothing is left behind — but how soon the command stops depends on where its checkpoints are:

  • update checks between its steps, and for the last time just before the point of no return: once the patch command has been dispatched the update runs to its end (rolling back on failure) rather than leaving a half-applied update behind.
  • prepare --installed checks before and after its installed-package probe, and stops without installing anything; downgrade on non-transactional hosts checks between packages. A transactional downgrade (SL Micro, or SLES 16 with a read-only root) applies in one transaction, so it finishes first like the commands below.
  • reload_products checks before each host; a host already reloading finishes or times out first, and the reply names the hosts it reloaded and those it did not reach.
  • A command applying to several loaded templates stops at the next template boundary, and reports how many it got through.
  • load_template stops while it waits for TeReGen: for a report that is still being generated, and for the regeneration of a stale template. Nothing is loaded; a regeneration it had already requested keeps running on the server, and the reply says so.
  • install, uninstall, run, and reboot finish the host operation already under way first, then stop.

A command that did stop at a checkpoint reports error: cancelled, naming what it completed first where it can. A command with no checkpoint left to reach simply finishes and reports normally — the cancel arrived too late to change anything, and saying “cancelled” would be a lie about work that was in fact done. Two long waits are their own case: request_review --watch and regenerate stop watching and tell you so (the review request stays posted, the regeneration keeps running on the server), and both count as success. Once regenerate has seen the regeneration finish, a cancel while it loads the new report is a cancel like any other: error: cancelled, saying the report was regenerated but not reloaded. Either way the session stays usable — the next command starts with a clean slate.

A second Ctrl-C force-quits (exit status 130). This is the escape hatch for a host that has stopped responding, and it comes at a cost: the running command is abandoned where it stands, so the operation locks it holds are left behind. Your command history is still saved. mtui warns when this happens; see the next entry for the cleanup.

Ctrl-C during the teardown behaves the same way but cancels nothing: the teardown is what releases the pool claims and closes the hosts, so it always runs to completion. A press there warns that it is in progress, and a second one force-quits — leaving both the operation locks and the pool claims (unlock --force and unlock --pool). This holds however you asked to leave: Ctrl-D and a typed quit/exit dispatch the same teardown and get the same protection.

Two carve-outs. Ctrl-C during the initial load at startup (-a/-k/--sut, before the first prompt appears) still exits immediately, without teardown. Any locks or pool claims that partial load had already taken need unlock --force/unlock --pool, as after any crash.

And in a non-interactive (piped) session — mtui reading commands from a pipe rather than a terminal — there is no line editor holding the keyboard, so a Ctrl-C arriving between commands is queued and then discarded when the next command starts: it interrupts nothing. Interrupt such a session with a signal to the process (kill -INT) while a command is running, or end it with kill.

SIGHUP (the terminal closed) and SIGTERM (a plain kill) end the session through the same teardown as quit: a running command is cancelled at its next checkpoint first, as on the first Ctrl-C, then the pool claims and operation locks are released and mtui exits with 129 (SIGHUP) or 143 (SIGTERM). A repeated SIGHUP/SIGTERM does not force-quit; a second Ctrl-C still does, and SIGKILL skips the teardown. A host command already under way, such as run, finishes before the teardown starts, so a supervisor that kills after a short grace period (a container stop allows 10 seconds by default) can cut the teardown off and leave the locks behind. Once a signal has arrived, a command-timeout question (“keep waiting?”) is answered no without reading the terminal; one already on screen when it arrives still waits for its answer, or for the terminal to close. If the terminal fails while mtui waits for the next command, the same teardown runs before mtui reports the error. Signals during the initial load (-a/-k/--sut) still end mtui at once, without teardown. Signals that arrive while shell or edit holds the terminal are not acted on until that command returns. An unresponsive host cannot hold the teardown: releasing its pool claim and closing it each give up after 45 seconds, and mtui names the host. The close retries the hung release, so each loaded template can take up to 90 seconds, and templates are torn down one after another. The claims and locks left on the host need unlock --pool and unlock --force once it answers again.

How do I remove a dangling lock left by a crashed session?

list_refhosts --free shows who holds each lock, since when, and its comment, without attaching the host. A session that ends normally — quit, Ctrl-D, SIGHUP or SIGTERM in the REPL, or any end of an mtui-mcp session — removes its own locks, commented or not, so a lock that outlives its session means that session crashed or was killed (SIGKILL, a container stop) before its teardown reached the host.

Reconnect to the same hosts and run unlock -f (force) to remove locks left by another user or session. mtui also reaps locks older than [lock] stale_age automatically on connect (see Configuration); unlock -p removes a pool-claim lock instead of the operation lock.

Which update should I pick up next?

updates lists the queue live from the TeReGen API, sorted by priority. By default it shows the actionable pickup queue — unassigned updates that are in testing. Widen or filter it:

updates --review-group qam-sle --limit 5
updates -G qam-sle -G qam-teradata                           # either group, one query
updates --mine                # assigned to your oscrc or Gitea login
updates --status all          # every status and assignee
updates -F Rating -F 'Assigned Roles' -F 'Unassigned Roles'  # osc-qam field names
updates --json                # the raw TeReGen rows, for scripting
updates --embargoed yes       # only updates the QEM Dashboard marks embargoed
updates --live --limit 10     # the shown rows checked against Gitea and OBS

TeReGen’s record lags the review gate: an update whose verdict was already given can still be listed in testing, and an assignment can be missing or name someone else. --live reads each shown row (after --limit/--offset) the way review_state does — the Gitea or OBS gate plus the template status per row, four rows at a time — and adds its owner, gate, since, created and template:

  • -G lists a row in any of its groups, so with -G a row is judged on the -G groups its own review groups also name (all -G groups when the row names none); without -G, on the qam groups TeReGen lists it for. Automation groups (qam-auto, qam-openqa) never count, and --live refuses a -G that names one, before any request. A pull request is read for each judged group (for qam-sle when there is no -G and the row names no qam group). The row is concluded only when every one of them was read: a group the read does not return fails the row.
  • A row’s verdict is no longer owed when every judged group gave it (approved, changes requested or accepted, a verdict outranking a closed pull request), or when the OBS request left review. In the default unassigned view and with --mine such rows are dropped, and a dropped N rows … line counts them by reason and says how to list them. With --assignee, --all-assignees or another --status every row stays, with its gate.
  • A group with no review (a team request alone included) is not a verdict, and groups that disagree are not one either: such a row is listed under Not concluded, never dropped and never free.
  • In the unassigned view a row whose live read names any holder (an unnamed or disputed one included) is listed apart under Held, though TeReGen lists them unassigned: a row is unassigned only when TeReGen and the live read both say so. With --mine a row the live read does not give to one of your logins is listed apart the same way.
  • A row whose live read fails (any source, the template status included) is listed apart under Live read failed with ? and the reason; the list prints, then the command fails naming those rows. With -F, a row whose OBS fields cannot be read shows them unavailable and fails the command after the listing too. A cancel prints the rows already read and starts no -F read.
  • Pull requests TeReGen has not ingested yet are not listed: mtui cannot list Gitea pull requests, and --live says that the untracked list was not read.
  • With --embargoed (or -F Embargoed) the embargo filter runs first, as in the plain listing: before --limit/--offset and the row budget, so a row it drops costs no live read. The default layout then shows embargoed=<state> before the live cells, a filter that leaves no row prints its message and the untracked line (the empty live document with --json), and a dashboard that cannot be read fails the call after the listing, ahead of any live failure and of a cancel.

--live --json prints one document, {"summary", "rows", "held", "unsettled", "live_failed", "dropped", "untracked", "notes", "truncation"?}. Each row carries a live object: its standing (owed, held, given or unsettled with a reason, failed), the five cells as the row shows them (unknown is null, nothing is "none"), the typed read under review, and its failures.

--mine asks for the logins your review actions are recorded under: the user of the oscrc section for [obs] api_url (read even when the section has no usable sshkey, so a password or keyring oscrc works) and, with [gitea] token set, that token’s Gitea login. It never asks for the local session user ([mtui] user), so a Gitea assignment recorded under that name, which assign falls back to when it cannot resolve the token’s owner, needs --assignee. When one of the two sources fails, a note: line names that source and why, and the other login is listed alone; under --json that fails the call instead, and with neither login there is nothing to list. An empty answer names the logins it asked for.

-F accepts the field names osc qam list -F uses — case-insensitively, with spaces, hyphens and underscores treated as equivalent: ReviewRequestID, Incident Priority, Rating, Category, Status, Kind, Deadline, Assignee, Assigned Roles, Unassigned Roles, Title, URL, Products, SRCRPMs, Bugs, Creator, Package-Streams, Issues, Comments, Embargoed. Embargoed is the QEM Dashboard’s embargo flag, read from its incident list once for the whole table and only when asked for (-F Embargoed or --embargoed): yes, no, or unknown (<reason>) — no paired incident, no boolean flag, or a dashboard that could not be read, in which case the listing opens with a warning and the command fails after it. --embargoed yes|no|unknown|all filters on it before --limit/--offset (no never matches an unknown row) and, with --json, adds qem_embargoed/qem_embargoed_reason to each row. A Maintenance row is paired by its maintenance id, an SLFO row by its review id as a git pull request number within the repository its URL names when that is a pull request URL of the same number on the configured Gitea origin ([gitea] url); otherwise (pull request numbers repeat across repositories) the number must be unique on the dashboard and share a package with the row’s SRCRPMs. A Product Increment is always unknown. list_metadata shows the same flag first for a loaded update. Package-Streams, Issues and Comments are not in the TeReGen queue listing: they are read live from OBS per shown row (after --limit/--offset), so narrow large queues with --limit. SLFO rows render n/a there (their review ids are Gitea PR numbers, not OBS requests); a row OBS refuses renders unavailable in all three, and an unreadable comments document renders unavailable for Comments while the row’s packages and issues still print; comments are terminal-sanitised and capped to the newest five per row with the omitted count marked. Unassigned Roles renders n/a when it cannot be answered honestly: on any row served without review groups or without assignment data, where “every group open” would be indistinguishable from the truth. --json and -F are mutually exclusive, and Assignee/Assigned Roles are refused under any --status other than testing, where TeReGen omits the assignment data they would render.