BURROW // chapter 13
Chapter 13 Part 03 / Operator Experience

Local tools and automation

For confirmed SSH connection creation and selected live-tunnel HTTP consumption, see SSH and tunnel chains.

--local runs a tool on the daemon host with an explicitly selected live SSH connection's non-secret context. It uses the same retained run lifecycle, output viewer, cancellation and evidence collection as remote commands. The initial supported daemon is local to Burrow, so the tool runs on your machine.

Run a local tool

run now gateway --local -- /usr/bin/printf 'local output\n'
run prepare gateway --local -- /usr/bin/python3 /absolute/path/report.py

The first command opens a review, then launches, waits and collects when approved. The second prepares without executing; use its returned ID with run launch ID. The tool path must be absolute. Paths and arguments for an existing tool are reviewed references, not immutable snapshots of that tool's executable or files. Run scripts you trust; a same-user local process is not sandboxed.

For a reviewed source snapshot, put this shell script in the workspace upload root as connection-report.sh. Use local to find the configured root:

printf 'Selected connection: %s\n' "$BURROW_CONNECTION"
/usr/bin/ssh -F "$BURROW_SSH_CONFIG" -S "$BURROW_SOCKET" \
  -o ControlMaster=no -o ProxyCommand=/usr/bin/false -o BatchMode=yes \
  -T "$BURROW_SSH_HOST" 'uname -s'
ssh_status=$?
printf 'Local SSH client exit: %s\n' "$ssh_status" >&2
exit "$ssh_status"
run now gateway --local --script connection-report.sh --mode stream --interpreter /bin/sh --

The script prints the selected connection name and asks that master for the remote operating-system name. The explicit SSH options refuse a fresh connection when the master is absent. Burrow validates the selected connection during preparation and launch; raw socket use after that belongs to the tool. A disappearing socket must not cause your tool to authenticate again. The generated config alone is not a no-reconnect guarantee.

Local scripts support stream/inline snapshots, binary stdin, timeout and output budgets. Remote stage mode and --keep do not apply. See script modes for their limits.

Selected environment

The review shows execution location, working directory and the exact environment. The working directory is the explicitly selected workspace. Only these environment entries are supplied; tools do not inherit a frontend shell's directory, environment or identity, SSH agents, authentication secrets or Hovel launch keys.

VariableValue
BURROW_WORKSPACECanonical absolute workspace path.
BURROW_CONNECTIONExplicitly selected connection name.
BURROW_SOCKETThat live connection's master socket path.
BURROW_SSH_CONFIGThat connection's generated SSH config path; contains settings and references, not authentication secrets.
BURROW_SSH_HOSTburrow-hop-0, the target alias in that config.
PATH, LANG/usr/bin:/bin and C.UTF-8.

Supply an absolute interpreter when a tool lives outside this PATH. Keep passwords and passphrases out of commands, arguments, chain files, logs and output. A tool can print sensitive data itself; retained stdout/stderr are evidence, not a redaction service. There is no plugin discovery system or compatibility promise for LazySSH environment variables.

Results and cancellation

Exit status

Inspect, output reads and collected JSON distinguish execution: local, localExit and localSignal from remoteExit. A local run always leaves remoteExit null. A local SSH client exiting 255 is a real localExit: 255; it does not establish a remote exit or completion. The live viewer labels local exits, and collected output labels the local tool outcome. Stdout/stderr remain separate and byte-exact even for non-JSON errors.

Cancellation

run cancel ID and the optional timeout stop the ordinary local process group: TERM first, then KILL for remaining members, with a bounded Linux /proc observation. Ordinary background children keep the run active after its main process exits; that process's known local exit remains visible.

The result reports whether local group cleanup was observed; remote termination remains unconfirmed. Escaped descendants, process identity races and recovery after owner loss are outside that guarantee. A failed cleanup remains visible and does not claim success. Stopping a foreground wait or closing a viewer never cancels a retained run.

Cancellation leaves the connection and sibling runs available. Collect completed or partial output explicitly, then close the run; registered evidence remains. Uncollected output can be lost on module/daemon failure. Confirmation covers the outer tool operation. Every raw same-user socket command the tool issues does not automatically receive its own Hovel confirmation, complete audit or remote cancellation guarantee.

Automate with a saved Hovel chain

Start or verify your Burrow workspace with burrow --workspace /absolute/workspace status and explicitly connect gateway first. Use Burrow’s pinned Hovel executable at ${XDG_CACHE_HOME:-$HOME/.cache}/burrow/hovel/0.4.4/hovel. Save this as local-report.chain.json, replacing the workspace path with the same canonical path:

{
  "apiVersion": "hovel.dev/v1alpha1",
  "kind": "Chain",
  "metadata": {"name": "local-report"},
  "spec": {
    "mode": "configured",
    "steps": [{"id": "report", "uses": "module:burrow@0.1.0"}],
    "targets": [{"id": "local://selected"}],
    "config": {
      "workspace": "/absolute/workspace",
      "command": "run now gateway --local --script connection-report.sh --mode stream --interpreter /bin/sh --yes --"
    }
  }
}

The outer Hovel target is a label; the Burrow command selects the live connection. This example explicitly authorizes the inner launch/collection with --yes. For Burrow's two-step review instead, omit that flag, inspect the returned summary's review and use its exact confirm command in a subsequent saved-chain throw. Do not repeat run now to approve an existing ID: it prepares another run.

HOVEL="${XDG_CACHE_HOME:-$HOME/.cache}/burrow/hovel/0.4.4/hovel"
WORKSPACE=/absolute/workspace
"$HOVEL" throw ./local-report.chain.json --workspace "$WORKSPACE" \
  --daemon-endpoint "$WORKSPACE/hoveld.sock" \
  --allow-dangerous --now --json >throw.json 2>throw.err
status=$?
if [ "$status" -ne 0 ]; then
  cat throw.err >&2
  exit "$status"
fi
python3 - <<'PY'
import json
with open("throw.json") as source:
    throw = json.load(source)
step = throw["results"][0]
if step["state"] != "succeeded":
    raise SystemExit("Hovel operation failed; inspect the throw result")
run = json.loads(step["summary"])
print("Run:", run["id"], "local exit:", run["localExit"], "collection:", run.get("collection"))
if run["localExit"] != 0 or not run["outputComplete"] or run.get("collection") != "succeeded":
    raise SystemExit("Tool execution or capture needs inspection")
PY

Provide the explicit --daemon-endpoint shown above to address the selected existing Burrow daemon. Hovel launch-key policy counts matching active approvers; with no matching connected entities it requires no additional approvals, even in quorum mode.

Here --now is an explicit operator choice recorded by Hovel as now_bypass. It does not bypass dangerous-module permission or launch-key policy. Alternatively use an existing matching-plan preconfirmation through Hovel. Changed plan inputs require a matching confirmation. No wrapper silently adds these flags. Launch-key policy may require other active approvers; satisfy it through Hovel rather than changing policy to make automation pass.

Read the result

Preserve Hovel's stdout, stderr and process status before parsing. Successful JSON-mode execution returns a throw result, but a successfully recorded local-tool failure can still give Hovel process status 0. Read localExit separately. Execution errors can be plain stderr with status 1; command parsing errors generally use status 2. Without a matching preconfirmation or explicit --now, even JSON mode can print an interactive review prompt on stdout and fail at EOF. API failures are not universally JSON either.

Use public daemon operations

For supported operations outside saved-chain execution, address the explicitly selected workspace's existing Unix socket. Verify identity before proceeding; do not rely on another frontend's active workspace:

WORKSPACE=/absolute/workspace
curl --fail-with-body --silent --show-error \
  --unix-socket "$WORKSPACE/hoveld.sock" \
  -H 'Content-Type: application/json' -d '{}' \
  http://localhost/hovel.daemon.v1.DaemonService/GetDaemonInfo

Check the response's workspacePath matches the intended canonical path. ListSessions discovers retained runs on this same public surface. Collected output remains available in Burrow’s Ctrl+L view and Hovel’s artifact inventory. Use saved throws for confirmed execution and collection. Privileged ExecuteModule or raw session controls do not establish the surrounding planning/confirmation contract. The product automation contract is saved-chain hovel throw and documented public daemon operations, not compatibility/developer hovel run, command or internal registry roots. No separate Burrow scripting runtime is required.

See the run API and Hovel integration contract.