Lu

Job queue and dispatcher for coding-agent work

View the Project on GitHub ddproxy/tuishou-lu

Operations

This is the operator runbook for a packaged controller: node onboarding, upgrades, backup and restore, restart behaviour, node drains, and how to read node state. Installation and the systemd units are in install.md; the agent’s isolation model is in security.md.

Topic Read it on
Service layout, installation and units install.md
Token generation and rotation, TLS setup tokens-and-tls.md
Metrics series, scrape and alerts, lu status monitoring.md
Job states, transitions and failure classes lifecycle.md
Symptom-first checks and error codes troubleshooting.md
Dependency stacking and the job graph dependencies.md
Node workspace retention and disk pressure workspaces.md
Provider and label dispatch dispatch.md
MCP tools cli.md
HTTP routes and limits api.md
Node self-service commands cli.md
Configuration keys config.md

Upgrade

Upgrade the controller before replacing agent binaries; see compatibility for the wire rules. For the agent-host half, see Updating a node: the node drains itself with ting drain, waits with ting wait-idle, is updated and health-checked, then undrains with ting undrain. That needs only the node’s own token.

  1. Read CHANGELOG.md and back up the database and artifacts (below).
  2. Stop the controller: systemctl stop lu-controller.service.
  3. Replace /usr/local/bin/lu and any changed unit files, then systemctl daemon-reload.
  4. Run lu check --config /etc/lu/lu.toml to validate config values and database health, then start the controller.
  5. Check /v1/health, journalctl -u lu-controller, lu ls and lu nodes. Full config and secret-file validation happens when the controller starts.

There is no general online config reload. SIGHUP is not handled; restart the controller after changing config, TLS files or token hashes. The exception is POST /v1/schedule/reload, which an operator with schedule = true can use to swap in the schedule from the controller config file without a restart; see Time-aware scheduling. For the HOME and PATH settings needed by the contributed unit, see Running the controller under systemd.

Node onboarding

Each node has a unique name and its own agent token; an agent token is bound to that name and a valid token used for another node gets 403. To add a node:

  1. Generate a token for the node and add its hash to the controller’s [[controller.agents]] table, using the node name the agent will report. Keep the plaintext file on the node with private permissions and out of version control; see Tokens and TLS.
  2. Restart the controller, since token hashes are read at startup.
  3. Write the node’s [agent] config with name, controller_url, work_dir and token_file. The built-in opencode profile needs no agent-side entry; add [agent.harness_profiles.*] only for overrides or extra profiles, then add labels, taints or provider models as needed and check the config with lu check --config <path>.
  4. Start ting with that config. It heartbeats and polls the controller.
  5. Verify with lu nodes that the node is online with the expected version and labels, then submit a small test job. An unmatched label or provider leaves the job queued until a matching node reports in; see Dispatch.

Keep agent binaries at a version compatible with the controller; see compatibility. A node can take itself out of service for maintenance with ting drain and ting wait-idle; see Updating a node and the ting reference.

Harness profiles at run time

Each job carries a harness name (--harness on lu submit, default opencode). The agent resolves that name against its loaded profiles: the built-in opencode profile is always present, and a [agent.harness_profiles.opencode] table overrides individual fields. An unknown name fails the job as execution with unsupported harness profile "<name>". A command that cannot be compiled, including a failed secret_env read, also fails as execution; the error never contains secret content. Profiles are loaded when ting starts, so a profile change needs an agent restart. No wire or store-schema field changes with this contract.

The configured argv is expanded and run directly, with an optional wrapper prepended, in the staged tree. There is no shell. The child starts with PATH, HOME, LANG, selected env values and secret_env values only; stdin is closed unless the profile selects the staged task file, capped at 256 KiB. Run, idle and output limits are unchanged. Key defaults and every validation rule are in Harness profiles.

When a profile sets result_file, the agent reads it only after the harness exits 0. The path is relative to the staged tree; its text is appended to the job summary as result: <text>, after any log tail, and is truncated to 16 KiB. A missing, unreadable, non-UTF-8 or oversize file fails the job as execution with a summary that names the relative path. A non-file at that path is reported as too large.

Provider markers come from the selected profile and are matched case-insensitively in harness output; the built-in opencode list keeps the earlier provider-unavailable strings. They still drive the two-reading provider failure described below. needs_input_markers are also case-insensitive and only annotate a stuck summary: when a marker appears in the output tail, the summary is stuck for <n>s, stopped; harness appears to need input. Stuck policy, failure class and metrics are unchanged.

Backup and restore

The database uses SQLite WAL mode. A plain copy of lu.db while the controller is running can miss committed transactions held in lu.db-wal.

Take an online snapshot without stopping the controller:

install -d -m 0700 /var/backups/lu
lu backup --config /etc/lu/lu.toml --out "/var/backups/lu/lu-$(date +%F).db"

lu backup uses SQLite’s VACUUM INTO, writes the copy with mode 0600, runs PRAGMA integrity_check, and prints the size, schema version and job count. It refuses to replace an existing file unless --force is given. lu backup and lu restore read only [controller] db; lu check validates config values, uses that key for its database checks and lists the checks it ran. None of these commands opens TLS keys or token files, so they also run as root against a service account’s secrets.

For a daily snapshot, install a small wrapper, a service and a timer as root:

# /usr/local/bin/lu-backup
#!/bin/sh
set -eu
/usr/local/bin/lu backup --config /etc/lu/lu.toml \
    --out "/var/backups/lu/lu-$(date +%F).db" --force
find /var/backups/lu -name 'lu-*.db' -mtime +30 -delete
chmod 0755 /usr/local/bin/lu-backup
# /etc/systemd/system/lu-backup.service
[Unit]
Description=Lu database backup
After=lu-controller.service

[Service]
Type=oneshot
User=lu
Group=lu
ExecStart=/usr/local/bin/lu-backup
ReadWritePaths=/var/backups/lu
# /etc/systemd/system/lu-backup.timer
[Unit]
Description=Daily Lu database backup

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target
install -d -m 0700 -o lu -g lu /var/backups/lu
systemctl daemon-reload
systemctl enable --now lu-backup.timer

Keep the backup directory private because the database holds job tasks and summaries.

Artifacts are ordinary files under /var/lib/lu/artifacts/<job id>/. Back them up with modes preserved:

tar -C /var/lib/lu -czf "/var/backups/lu/artifacts-$(date +%F).tar.gz" artifacts

The database and artifacts are not updated in one transaction. For a consistent pair, stop the controller before taking both; otherwise accept that a job may reference an artifact that is missing from, or newer than, the snapshot. Backups contain job tasks, diffs, reports and logs, which may include source code and secrets that were present in a checked-out repository: store them with the same care as the live artifact directory.

Restore the database:

systemctl stop lu-controller.service
lu restore --config /etc/lu/lu.toml /var/backups/lu/lu-YYYY-MM-DD.db
systemctl start lu-controller.service

lu restore verifies the snapshot, refuses a file that is not a Lu database (an empty or foreign SQLite file would replace your data with nothing), requires exactly the current schema version (8) and every table that version creates, and refuses when the database is still in use, so stop the controller first. Only one restore runs at a time. It stages the copy beside the database with the old file’s owner and mode 0600, moves the current database and every -wal, -shm and -journal file to <db>.pre-restore-<unix seconds> names, then renames the staged copy into place. Run it as root or as the controller’s own account; either way the installed file keeps the old owner. Boot recovery then applies to jobs that were leased or running in the snapshot.

An older backup is refused by lu restore. Point [controller] db at a copy of it, start the controller once so startup migrates it in place, stop the controller, and take a fresh lu backup before restoring that snapshot.

If a restore is interrupted, the previous database is still under its pre-restore name: mv <db>.pre-restore-<seconds> <db>, and the same for each -wal or -shm file, puts it back. A failed install does this itself and says so. lu backup refuses an output path that is the database or one of its files, or a symlink, and removes a partial file if it fails.

Artifacts are not part of the database snapshot. Restore them separately:

rm -rf /var/lib/lu/artifacts
tar -C /var/lib/lu -xzf /var/backups/lu/artifacts-YYYY-MM-DD.tar.gz
chown -R lu:lu /var/lib/lu/artifacts
chmod 0700 /var/lib/lu/artifacts

Conditional writes and request keys

Operator writes accept the optional If-Match and Idempotency-Key headers and the ?dry_run=1 query parameter described in api.md. A 412 precondition_failed means the job changed after the ETag was read; re-read the job and retry with the new ETag. An idempotent key is scoped to the authenticated principal and expires after 24 hours; the request_keys rows are removed opportunistically when that key is used again. Every applied, replayed, dry-run and precondition-failed mutation writes an audit record carrying the principal and role, so a replay is distinguishable from a fresh mutation. The older idempotency table maps job spec keys to jobs and is unchanged.

What a controller restart does

Legal state transitions and the recovery state machine are in lifecycle.md; this section covers the procedure around a restart. On startup the controller runs boot recovery before binding its listener. If recovery fails, startup fails and no traffic is served, so stale leases can never be dispatched against a fresh monotonic clock:

An excluded node is skipped for that job until an operator retries it; see Node exclusions. The listener stops accepting new connections on SIGTERM or Ctrl-C and drains in-flight connections for up to 10 seconds. The contributed unit allows 40 seconds before systemd sends SIGKILL.

If the controller is down for longer than a lease, agents cannot renew. When it returns, the same recovery path applies; a job can therefore consume a retry even though the harness itself did nothing wrong.

Dependency chains and blocked dependents

A failed or cancelled predecessor leaves its blocked dependents blocked rather than failing them immediately. lu ls --state blocked and lu show <dependent> show blocked_reason: "predecessor failed" plus a blocked_until deadline; [controller] blocked_dependent_ttl (default 24h) sets how long they wait before failing with failure_class: "dependency". lu top and the lu_blocked_dependents_total metric show the waiting count. See dependencies.md.

lu ls --state blocked
lu show 01ARZ3NDEKTSV4RRFFQ69G5FAV     # inspect the predecessor and the deadline
lu retry 01ARZ3NDEKTSV4RRFFQ69G5FAV     # requeue in place and restore waiting dependents
lu retry 01ARZ3NDEKTSV4RRFFQ69G5FAV --chain  # restore blocked dependents transitively
lu cancel 01ARZ3NDEKTSV4RRFFQ69G5FAV --keep-dependents

Chains use one base: a dependent without a pinned source.base inherits its predecessor’s recorded staged_commit, and its exported patch is relative to that base. If several dependencies disagree, the agent stages their newest common ancestor; if any patch then fails to apply, the job fails with class conflict and the summary names every contested commit. After the chain finishes, merge the final patch onto the moved branch yourself — Lu does not rebase it onto a later tip. Conflict resolution for known-safe paths is opt-in through the agent’s [stack] union_paths and base_paths (config.md); per-job stack_union_paths/stack_base_paths can only narrow those lists, and uncovered paths fail closed. See dependencies.md and dependencies.md.

Provider failure detection

Failure classes, retry budgets and cancellation are in lifecycle.md; provider choice and fallbacks are in dispatch.md. Two agent-side detections matter when reading a stalled job.

When a job resolves to a provider (the assigned choice, or the primary when the job names one), the agent checks it against its node’s provider gateway health feed every five seconds, but acts only on a new reading. The feed itself refreshes every ten seconds. The gateway is the authority on keys, so this works for any harness: when two fresh readings in a row show the provider cooling or disabled (no usable key), the agent stops the job like a cancel and completes it as Failed(Provider), with a summary that names the provider and the soonest return time the gateway reported. The completion carries that time plus a 60-second buffer as retry_after_secs; see Dispatch for the resulting cordon.

As a fallback for a job with no provider, or a node without a provider gateway feed, the agent watches a running harness’s output. If the newest line matches a provider_markers substring from the selected profile (the built-in opencode list covers the message about every key in the stream’s chain, a quota message, a 429, and a rate limit) and the harness then produces no output for 120 seconds, the agent stops it the same way and completes the job as Failed(Provider), with a summary naming the marker. Any other output after the marker disarms the watch.

Stuck jobs

A job is stuck when the running harness has written no output and its process tree has used no CPU for more than 300 seconds — the same observation lu node reports as stuck yes. When a job has a stuck policy, the agent counts how long that observation has been continuous; any output or CPU activity resets the timer. Once it reaches stuck_after_secs (60 to 86400 seconds, default 1800), the agent stops the harness process group through the cancel stop path, uploads the log, diff and report, and completes the job. The summary is stuck for <n>s, stopped, where <n> is the continuous stuck time. A selected profile’s needs_input_markers add ; harness appears to need input when one matches the output tail, as described in Harness profiles at run time.

on_stuck is none (default), cancel or retry. cancel completes as failed with failure_class: "execution"; retry completes with failure_class: "node", so the controller requeues while the attempt budget allows; none leaves the job running. A job field that is absent uses the agent’s [agent] on_stuck and stuck_after_secs defaults; an explicit on_stuck = "none" disables the policy. See config.md and lifecycle.md.

The controller counts successful stuck completions in lu_jobs_stuck_stopped_total{mode="cancel"|"retry"}, reset on restart. See monitoring.md.

Node drains

A drain stops a node taking any new job. It is set by POST /v1/nodes/{name}/drain or `lu drain

` and cleared by `/undrain` or `lu undrain `; the flag is stored with the node and survives a controller restart. A node must have sent a heartbeat at least once to exist; draining an unknown node returns `404 not_found`. An operator drain is operator-owned: the agent's `POST /v1/agent/undrain` refuses it with `409 conflict` and the node view reports `drain_origin: "operator"`. A node can instead drain itself with `ting drain` and clear that drain with `ting undrain`, reported as `drain_origin: "agent"`. See [Updating a node](../README.md#updating-a-node) for the self-service update sequence and the [`ting` reference](/tuishou-lu/docs/cli.html#ting-reference) for the CLI. Provider cordons are a separate dispatch hint; see [Dispatch](/tuishou-lu/docs/dispatch.html#cordons). ## Reading `lu nodes` For the one-shot controller summary, see [`lu status` on the monitoring page](/tuishou-lu/docs/monitoring.html#lu-status). Human output for `lu nodes` has seven columns: ```text NAME VERSION HARNESS LABELS CORDONS LAST_SEEN DRAINED node-a 0.4.0 idle !lab,gpu,php8.3,region=eu - 2026-11-21 09:12:00Z no ``` - `NAME` is the node name bound to the agent token. - `VERSION` is the agent version from its latest heartbeat, or `-` for an older agent. - `HARNESS` is the last reported harness state (`idle`, `busy`, or `-` if unknown). - `LABELS` is the comma-separated label list from the latest heartbeat, with each taint shown first with a `!` prefix, or `-` for none. A label published by a probe is followed by ` (probed)`. A long list is cut to fit the column and ends with `+N` for the hidden entries. - `CORDONS` is the comma-separated list of cordoned providers, each with a `!` prefix, or `-` for none. See [Dispatch](/tuishou-lu/docs/dispatch.html#cordons) for the cordon rules. - `LAST_SEEN` is the last heartbeat time in UTC. - `DRAINED` shows the drain flag from the controller's node view. There is no `ONLINE` column in the table. Use `lu nodes --json` to see the full controller view: `online` (seen within two lease periods; nodes are offline after a controller restart until their next heartbeat), `draining`, `drain_origin` (`"operator"` or `"agent"` while drained, absent otherwise), `providers`, `provider_models`, `labels`, `label_sources`, `taints`, `current_job`, `cordon_details`, `version` and the opaque provider-health document. `label_sources` maps a probed label to `probed`; other labels have no entry. A node with no current job and `harness: idle` can take work. A node that is `busy`, draining, has a held job or is missing from the list will not be assigned one. Label, taint and provider rules are in [Dispatch](/tuishou-lu/docs/dispatch.html). `current_job` stays set while the job is `recovering`, so a node that lost a lease is still shown as holding that job and cannot take another. ## Reading `lu node` `lu node ` prints the latest host and job stats the node reported. The controller keeps only the most recent heartbeat's stats in memory, so they survive neither a controller restart nor an agent restart until the next heartbeat. ```text node node-a labels gpu php8.3 (probed) load1 0.50 load5 0.25 load15 0.12 mem_total_kb 8192 mem_available_kb 4096 swap_used_kb 12 disk_free_bytes 10737418240 disk_total_bytes 53687091200 disk_free_percent 20 uptime_secs 600 workspace_bytes 3221225472 workspace_count 7 workspace_reclaimed_bytes_total 10737418240 workspace_evictions_total 3 workspace_delete_errors_total 0 gc_removed_total 2 gc_bytes_freed_total 1073741824 job 01J... pgid 4242 output_idle 400s cpu_idle 350s stuck yes PID PPID STATE CPU_S RSS_KB AGE_S FILES COMMAND 4242 1 S 7 1024 90 3 opencode run ``` - `labels` lists the node's current labels; a probed one is followed by ` (probed)`. `lu node --json` includes `labels` and `label_sources` in the stats body. - Load, memory and uptime come from the agent's `/proc` sample. `disk_free_bytes`, `disk_total_bytes` and `disk_free_percent` describe the filesystem holding the agent's `work_dir`; each is `-` when the agent cannot read it. - The five `workspace_*` rows are the node's latest workspace counters. They describe agent-local workspaces under `work_dir`, not controller artifacts; see [workspaces.md](/tuishou-lu/docs/workspaces.html). `gc_removed_total` and `gc_bytes_freed_total` count scratch directories and bytes removed by housekeeping since the agent started. - Each job is a running job owned by that node. `pgid` is the harness process group, and the process table is capped at the 64 busiest members. `COMMAND` is the first 80 characters of the command line with control characters replaced. - `output_idle` is seconds since the harness last wrote output; `cpu_idle` is seconds since any process in the job tree last used CPU. `stuck yes` means both are above 300 seconds while the job is still running. - A node that has not sent stats prints `host -` and `jobs -`. An unknown node is a 404 and exits `1`. - `lu node --json` prints the exact `GET /v1/nodes/{name}/stats` body, including an empty `{}` for a known node with no stats. - `lu node --workspaces` prints the agent's oldest-first `JOB`, `STATE`, `BYTES`, `AGE` and `POLICY` listing. It uses the node view, so it also comes from the last heartbeat. Stats are sampled on the agent at heartbeat time, which may be slower than `lu top`'s two-second refresh. They describe the agent's view, not live controller state. ### Workspace lifecycle The agent owns job workspaces under `[agent] work_dir`. Policies, TTLs and disk pressure settings are in [workspaces.md](/tuishou-lu/docs/workspaces.html); `[workspace]` is a top-level config table and unknown keys remain errors. Ephemeral workspaces wait for the controller to confirm that the final patch and report are stored and that no active dependant needs the tree; `keep_on_failure` and `keep` use their TTLs. Eviction is oldest first, never touches a running workspace, and retries failed deletions with backoff. Inspect and clean from an operator host: ```sh lu node node-a --workspaces lu node node-a clean --all lu node node-a clean --job build-api ``` `--job` accepts a job id or idempotency key. `clean` queues a `clean_workspaces` event for the next agent poll; it returns `queued: 1` for the request, and the agent logs how many workspaces it actually queued, refused as running, or could not find. Watch `workspace_delete_errors_total` and the agent log after a clean; a non-zero error counter means deletions are still being retried. ### Probe labels An operator can declare `[[agent.detect]]` entries so a node advertises a label only while a command succeeds. The agent runs each probe at start and then every `every_secs`, off the heartbeat path; heartbeat reads the last result. Exit 0 publishes the label, and any other result, a timeout or a spawn failure removes it with one log line on change. A probe runs as the agent account with only `PATH`, `HOME` and `LANG`, null stdin, discarded output capped at 4 KiB and its own process group, killed on timeout. It never overlaps itself. ```toml [[agent.detect]] # Rust label = "rust/cargo" command = ["cargo", "--version"] [[agent.detect]] # Go label = "go/toolchain" command = ["go", "version"] [[agent.detect]] # PHP label = "php/cli" command = ["php", "-v"] ``` `lu nodes` and `lu node ` mark these labels with ` (probed)`; the JSON views carry the same information in `label_sources` as `{ "rust/cargo": "probed" }`. Probe labels are merged with static and file labels under the 32-label cap, and are dropped last when the cap is full. ## Disk housekeeping Long-running harness builds can leave gigabytes behind in directories outside the agent's `work_dir`. An optional `[agent.housekeeping]` table removes those directories between jobs. Workspaces inside `work_dir` are handled by the separate [workspace lifecycle](#workspace-lifecycle): ```toml [agent.housekeeping] scratch_globs = ["/srv/work/target-*"] extra_roots = ["/srv/work/harness-scratch"] min_age_hours = 6 min_free_percent = 15 max_remove_per_pass = 10 ``` A pass runs at agent start and after each finished job, never while a job is running, and at most once every 10 minutes. It acts only when the filesystem holding a pattern's parent is below `min_free_percent`, and stops when free space is back above `min_free_percent + 5` or `max_remove_per_pass` directories have been removed. `min_free_percent = 0` always acts on entries old enough by `min_age_hours`. Safety rules: - Candidates are directories matching the final path component of a `scratch_globs` pattern, plus `target*` children of each `extra_roots` parent. Only `*` and `?` are supported in patterns, and only in the final component. - An entry is removed only if it is a direct child of the pattern's canonical parent and its whole tree's newest modification time is at least `min_age_hours` old. - Symlinks are never followed or removed, files are never removed, and the pattern's parent is never removed. A root of `/`, `/home`, `/var`, `/tmp` or `/srv` is refused. - A directory containing `.git` or `Cargo.toml` is kept unless the matching rule names build output (`target`, `target-*` or an `extra_roots` child). - The agent's `work_dir`, every registered job workspace and every workspace queued for deletion are never removed, including when a workspace sits inside a candidate. - Removal is oldest first. Each removal logs the path, a size estimate and the age at info; the pass logs a summary. Cumulative removals are reported as `gc_removed_total` and `gc_bytes_freed_total` in heartbeats, `lu node` and `/metrics`. - `CARGO_TARGET_DIR` must stay below a configured root. For harness containers, expose the scratch tree at a host path named by `extra_roots`; Lu does not run commands in containers or read overlay storage. - Every error is logged or ignored. Housekeeping never fails a job or stops the agent. ## Display `lu top` shows the controller and agent versions in its title (`lu top · controller `). The node table includes `VERSION`, `LOAD` (`load1`, one decimal or `-`), `MEM` (used percent of total, or `-`), `WORKSPACES` (`count/bytes`) and `WS TOTALS` (`reclaimed/evictions/errors`). Memory is green below 80%, orange at 80%, and red at 95%. A node with `stuck > 0` shows a red `stuck` marker after its state, and a node whose version differs from the controller's is coloured orange. The Jobs table puts `PRI` (dispatch priority 0–9, higher dispatches first) immediately after `STATE`, then `REPO` after `NODE` and shows only `owner/name`: schemes, credentials, hosts, query strings and fragments are dropped, and unusable values become `-`. The selected job's graph detail line shows the normalised repo and its full ref. `JOB`, `STATE`, `PRI`, `NODE`, `REPO`, `TRY` and `AGE` keep their minimum widths; `NOTE` shrinks first, then `TITLE`, then `REPO`, and clipped text ends in `…`. The shared table widget caps each cell at 40 columns, so the `NOTE` budget stops there too. Both tables are sortable on every visible column. `s` selects the next sortable column, `S` or `Shift+s` the previous one, and `r` reverses the direction; clicking a header cycles that column through ascending, descending and unsorted. Numbers, durations and `STATE` badges use semantic comparators, slash-delimited workspace totals compare their parts numerically, and text uses natural ordering. The active header carries `▲`/`▼` (`^`/`v` without colours). Sorting is stable and never changes which job or node is selected: rows are keyed by job id or node name, so the selection follows the same row through refreshes and reorders. When the terminal is too narrow for all columns, trailing lower-priority columns are hidden rather than clipping the state or identity cells. Node `STATE` badges use amber for busy, green for idle, blue for drained and red for offline or stuck. Job `STATE` badges use green for running, yellow for queued, red for failed, dim green for done and grey for cancelled. Badge colours are named tokens with contrasting foregrounds for light and dark terminals; selection is a bold underline, so it stays visible over a badge. With `NO_COLOR` set, colours are dropped and filled badges fall back to bold reverse; without 24-bit colour, named ANSI colours plus bold reverse are used. On terminals at least 12 rows tall, a one-row strip replaces the tall gauge panels: `RUN`, `QUE`, `BUSY` and `PROV` show the latest value and a trend (`↑`, `↓`, `→`, or `·` with one sample), separated by `│`. When the job list is short, a dim summary line fills the space below it with totals by state and busy nodes over the total. With the job list focused and a running job selected, `x` opens a process pane under the lists. It shows the selected job's three liveness counters (output idle, CPU idle, uploader behind) and its process tree (`PID`, `STATE`, `CPU_S`, `RSS`, `AGE`, `COMMAND`) from `GET /v1/nodes/{name}/stats`, refreshed every two seconds while open. States `D` and `Z` are red; both idle counters above 120 seconds are orange, and a stuck job is red. The pane also draws load and memory-used sparklines for that node from the dashboard's recent samples. `Esc` or `x` closes the pane. `--once` prints the same node columns as plain text. `lu top` also reports the number of dependents waiting on a failed or cancelled predecessor: when the count is non-zero, the title adds `· waiting ` after the controller version, matching the `lu_blocked_dependents_total` metric. See [Dependency chains and blocked dependents](#dependency-chains-and-blocked-dependents). `lu top` draws the dependency graph in a bordered `Graph` panel below the job list when the terminal is at least 24 rows tall and a component has an unfinished job. Press `g` to hide or show it. A component is a set of jobs linked by `after`, including finished jobs that connect unfinished ones; a component whose jobs are all terminal is left out. The panel gets at most a third of the terminal height and at least three content rows; it clips long graphs instead of pushing the other panes. Each chain is one row, prerequisites first, for example `○ build ──▶ ○ test ──▶ ◔ ship`. Nodes show a state glyph and the last five id characters; an edge takes the prerequisite's colour. Only a real fan-out or fan-in adds rows: children stack to the right of their parent with `├─▶`/`└─▶` branches and `┐`/`┘` joins. An `after` id that is not in the fetched jobs is a dim stub `#id…` at the left of its chain. Unrelated single-job components share a row when they fit. The dashboard omits task titles from nodes; the graph panel's bottom border shows the selected job's full id, state and clipped title instead. `Tab` cycles focus through Nodes → Jobs → Graph and `Shift+Tab` moves back; the focused pane's border is highlighted. The Jobs table and the graph share one selected job, so highlighting a job in either pane highlights it in the other (a job outside the visible graph window has no graph highlight). With Graph focused, `Left`/`h` and `Right`/`l` move to the first parent or child, `Up`/`k` and `Down`/`j` move to the previous or next sibling at the same depth and then to an adjacent component, and `Home`/`End` jump to the first or last drawn node; movement stops at an edge. `Enter` opens the selected job's log from either Jobs or Graph. `d` still drains only in Nodes focus. The footer lists the keys for the current focus. Mouse capture is enabled only while `lu top` runs and is released on exit, errors and panics, leaving terminal copy and paste outside the TUI untouched. A left click on a graph node selects it and focuses Graph; a left click on a Jobs row selects that job and focuses Jobs; a left click on a Nodes row selects that node. Clicks on a table row follow the sorted display order. A double click on a node or job opens its log. A left click on a header cycles that column's sort. The wheel over a table moves its selection by three rows in display order, or scrolls the graph window by three graph rows when the pointer is over the graph. | State | Glyph | Colour | | --- | --- | --- | | `done` | `✓` | dim green | | `running`, `leased` | `▶` | bright green | | `blocked` | `◌` | orange | | `queued`, `recovering`, `needs_input` | `○` | yellow | | `failed` | `✗` | red | | `cancelled` | `–` | grey | The job list uses the same colours. The graph shows at most 6 components and 40 jobs; the panel title adds counts such as `+3 jobs, 1 component` when any were left out, and `+N rows` when a tall graph is clipped. `lu graph [JOB]` prints the same horizontal graph without the panel, keeping task titles clipped to 30 characters and using up to 200 jobs from the controller. `JOB` selects the component containing that job, even if every job in it is finished. Output is coloured only when stdout is a terminal and `NO_COLOR` is unset. `lu graph --json` prints `{"nodes":[{"id","state","title","after"}]}` for the shown jobs, without stubs or the summary line. ## Repository mirrors Mirror configuration, sync rules and the `lu repos` / `lu sync` commands are in [config.md](/tuishou-lu/docs/config.html) and the [client guide](/tuishou-lu/docs/cli.html#command-map); route details are in [api.md](/tuishou-lu/docs/api.html). ## Troubleshooting For symptom-first checks, log and artifact problems, and HTTP error codes, see [troubleshooting.md](/tuishou-lu/docs/troubleshooting.html). Limits and route details are in [api.md](/tuishou-lu/docs/api.html), config keys and validation rules in [config.md](/tuishou-lu/docs/config.html), and the threat model in [security.md](/tuishou-lu/docs/security.html).