Add lab preflight and a first-run guide

What this changes

A GitLab team member who arrives with a bare Claude Code harness has no path from nothing to a working just lab up. This MR adds one.

  • just lab preflight checks 14 prerequisites in order and stops at the first missing one. It prints what is missing, why the lab needs it, and the exact next step. It only reads and creates nothing. Exit 0 means up will work. mise installs the tools; there are no hooks or side scripts.
  • skills/gitlab-simulation/first-run.md tells the agent to run preflight, say the next step in plain words, do what it safely can, and loop. It covers the Sandbox Cloud project from the public handbook, the Friday power-down, gcloud auth login, and the license long pole: start the offline request on day one and use the staging online code meanwhile. It links public pages only. SKILL.md gets one routing line.
  • just word-budget counts with one awk counter on every platform (see below).
flowchart TD
  A[just lab preflight] --> B{Next missing prerequisite?}
  B -- none --> C[Exit 0: just lab up will work]
  B -- one found --> D[STOP at step N of 14<br/>names what is missing and the exact next step]
  D --> E{Who can do it?}
  E -- the agent --> F[Agent runs the step<br/>install a tool, set project, enable API, make SSH key]
  E -- the user --> G[User does it<br/>gcloud login, request cloud project, start license request]
  F --> A
  G --> A

The 14 steps, in order: mise, just 1.31 or newer, jq, glab, gcloud, gcloud login, default project, default zone, project reachable, Compute API on, machine type offered, SSH key, quota for the machine type, license. The license step explains the staging online code and SIM_LICENSE_MODE=staging, names the offline file for Duo Agent Platform self-hosted, and --free skips it.

Word ceiling

The new ceiling is 47287: the old 46000, plus 987 words for first-run.md and the routing line, plus a 300-word margin.

The counter fix: wc -w disagreed between platforms. GNU wc skips a token with no ASCII character (a section sign, an arrow); BSD wc counts it. The same tree read 46130 on a laptop and 45997 in CI.

Tree Laptop before CI before Laptop after CI after
Without the guide 46130 45997 45997 45997
With the guide 46984 46984

Proof on a bare machine

A fresh Debian 12 VM with no service account and no credentials, only git. The branch was cloned and each printed next step was run literally:

  1. Step 1 stopped at mise and printed curl https://mise.run | sh.
  2. Step 2 stopped at just and printed mise --cd ~ use --global just@latest.
  3. With just installed but its shims off the PATH, step 2 printed the shims line.
  4. With the shims on the PATH, step 2 stopped again: mise refuses to run a tool in a checkout whose mise.toml is untrusted. Preflight now says so and prints cat mise.toml then mise trust.
  5. Steps 3, 4 and 5 stopped at jq, glab and gcloud in turn, each with its mise --cd ~ use --global line.
  6. Step 6 stopped at the gcloud login and printed gcloud auth login. The VM has no credentials, so the walk ends there. The same stop shows through just lab preflight.

Two defects surfaced only on that machine and are fixed here. From inside a checkout, mise use --global parses the checkout's mise.toml first and fails as untrusted, so the install steps now pass --cd ~. And the shim failure above read as a missing tool before preflight learned to name it.

On the maintainer laptop, just lab preflight passes 14 of 14 and exits 0. Offline, preflight-selftest.sh runs 24 assertions with stubbed tools: one stop per step, --free, an activation code, SIM_ENV_FILE, and no gcloud call that creates or changes anything.

Scan findings

skill-scan raised six findings on the new files. All six are read and accepted in scan-accept.yml with their own reasons: the mise installer one-liner that preflight prints and never runs (three findings), a selftest rm of a symlink in its own temp directory, a prohibition in first-run.md (never ask the user to paste a license, token or key) read as autonomy, and Sandbox Cloud portal steps read as persistence.

Also

  • The lab menu test now expects 59 entries, one more for preflight.
  • docs/getting-started.md and the README point at preflight and first-run.md.
  • just ci passes locally. The commits carry AI-Assisted: yes and a sign-off.
Edited by Andrew Dunn

Merge request reports

Loading
Loading