docs/computer-use-tests.md

Computer-use checks

Use this guide when a manual or agent-driven terminal check is requested, or when a changed interaction needs visual verification. Select the affected case. These checks are not a coding completion gate and do not require replaying the whole Hub journey. Automated package and process tests remain separate.

Choose the interaction

Changed areaCheck through the shipped UI
Direct Hub pairingTwo administrators enter independently obtained identity checks, transfer a card through hidden input, approve both sides, and observe the pairing view reach Completion.
Client admission or Add agentEnter the correct role's identity checks, complete admission and endpoint approval, then open the intended remote application. Unapproved endpoints must remain behind Add agent.
Saved reconnect or remote CWDReconnect to the exact saved Hub/endpoint and verify the intended remote CWD and leaf. Don't substitute a new application for a recovery check.
/hub and terminal handoffOpen the client-local dashboard, return to the same TUI, then verify keyboard input and terminal restoration after quit/cancel.
Recovery feedbackWith the application ready, stop only the selected test relay and observe recovering/recovered or terminal failure for that case. Verify the same application where continuity is the assertion.
Authority decision UIInspect exact old/new identities, review without mutation, confirm once, and check the resulting approval or refusal.

A direct line is enough for a direct-only change. Add one/two relays or a separate diamond only when the requested behavior needs them. Host-specific systemd, firewall or container checks need their intended host, not a claimed pass from local tmux.

Preparation and safety

Use current build/ binaries. Reuse the integration owner's build when its inputs are unchanged. Never use the running orchestrator's $AGENTCLI as the test client, or invoke it with --stop.

Prefer the isolated process fixtures for setup and shutdown. For manual launches, create a short private run directory and separate config, state and runtime homes for every Hub, client and application daemon. For example, in Bash:

sh
1umask 077
2RUN=$(mktemp -d /tmp/ez-cu.XXXXXX)
3BIN=$PWD/build
4for owner in inviting joining client daemon; do
5 mkdir -p "$RUN/$owner/config" "$RUN/$owner/state" "$RUN/$owner/run"
6done
7h() {
8 local owner=$1; shift
9 env XDG_CONFIG_HOME="$RUN/$owner/config" \
10 XDG_STATE_HOME="$RUN/$owner/state" \
11 XDG_RUNTIME_DIR="$RUN/$owner/run" "$@"
12}

Resolve the exact registered AF_UNIX socket under the application daemon's homes. A Hub with different homes must not assume register local refers to that daemon. Use loopback listeners and unused ports for local checks.

Retain the exact PIDs of all launched services. Wait for typed service readiness, not just a socket file. Before a loss/recovery check, wait for its exact published, available endpoint and application-ready observation. Use observation barriers rather than a fixed setup sleep.

Never inspect auth files, copy real credentials, use broad kill commands, or run fault/pressure tests against the live orchestrator. Read-only checks against a live service require an explicit requested scope; do not send model prompts or mutate roots, sessions, configuration or authorization as an incidental probe.

Manual or agent-driven tmux

Use a dedicated test session and only its owned panes. Don't overwrite an existing orchestrator terminal. If the agent's computer-use tooling requires its agent session, reserve the test pane explicitly before sending input. Each new pane needs the explicit isolated environment; it does not inherit the shell function above.

For two-administrator pairing:

  1. Bootstrap two empty isolated Hubs and start their listeners. Open each built ez-agent-hub --config dashboard in its own terminal.
  2. Obtain each authority fingerprint independently from its local dashboard.
  3. On the inviting Hub, use invite pairing direct <joining-check>. On the joining Hub, use add hub direct <inviting-address> <inviting-check> and enter the card through hidden input.
  4. Confirm the displayed independent checks and make joining/inviting approvals using the commands displayed by fresh dashboard state. Keep the joining pairing view open until Completion.
  5. Check the requested restart, cancel, removal or refusal interaction only if it is part of this case. Pair eligibility alone is not proof of a live normal-peer link; use authenticated peer diagnostics for a link assertion.

For routed pairing, prepare the requested authenticated topology first, use invite pairing routed / add hub routed, and check address-free bilateral eligibility. The restricted carrier must not be mistaken for a new direct link. For application checks, use the actual CLI/TUI and independently verified admission/endpoint identities. Consult the Hub command guide and client guide for current commands.

Pause captures during invitation display and transfer. Never retain JOIN words, proofs, private state dumps or credential-bearing terminal transcripts. Clear secret-bearing scrollback before capturing. Keep any redacted screenshots and logs in an external directory selected for this check, not in the repository.

Optional scripted status captures

The shipped pairing process test can mirror redacted dashboard status into tmux. This is automated process evidence, not a substitute for driving the actual interactive dashboards above. Use an explicitly owned session with windows 1 and 2 and a private external evidence directory:

sh
1AGENTHUB_TMUX_ACCEPTANCE=1 \
2AGENTHUB_TMUX_SESSION="$CU_SESSION" \
3AGENTHUB_TMUX_EVIDENCE="$EVIDENCE" \
4 python3 -m pytest -q -s tests/suites/test_agenthub_process.py \
5 -k two_hub --tb=no

The process fixture creates its own isolated homes and owns child shutdown. Its terminal mirrors are selected by AGENTHUB_TMUX_SESSION; they never default to the orchestrator's agent panes. The test submits decisions itself, so report its result as scripted rather than manual operator acceptance.

Finish the selected check

Stop and reap only the exact test processes. Use the built client under the application daemon's isolated homes for --stop; signal an exact test Hub PID for Hub shutdown. Remove stale sockets only after their owner has joined. Close only the owned test panes/session and remove the private run state after cleanup.

Report the interaction tested, source/binaries, topology if relevant, outcome, and any skipped part of the request. A successful screenshot is not evidence of an unobserved protocol boundary or maximum-capacity behavior.