Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkgs/fleet/book/concepts/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ the same `agent` capability.

Source: https://github.com/developing-today/code/blob/main/pkgs/fleet/crates/fleet-agent/src/lib.rs

As with the bridge, every per-verb `--help` prints the same shared usage
text; there is no per-verb help in source. This chapter is the per-verb
reference.
As with the bridge, every verb has its own `--help`: the verb's
synopsis and description over the shared output/exit-code footer.
This chapter is the per-verb reference.

## Kinds and seat shapes: 16 × 3

Expand Down
4 changes: 2 additions & 2 deletions pkgs/fleet/book/concepts/gh.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ no daemon answered.
**`fleet gh tiers`** probes _every_ rotation source and prints its core and
GraphQL rate-limit headroom — labels and numbers only; token values never
leave the provider. Exit 0 when every source answers, **3 when any source
is down**. Source behaviour: `tiers` takes no `--help` — `fleet gh tiers
--help` errors with "unexpected argument '--help'".
is down**. Source behaviour: `fleet gh tiers --help` prints the verb's own
usage and exits 0; any other argument errors.

**`fleet gh closures [<item>]`** reads back the closure log. The policy
layer behind it: `issue|pr close|reopen` through the rotation must carry a
Expand Down
4 changes: 2 additions & 2 deletions pkgs/fleet/book/concepts/placement.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,5 @@ Actions/Blacksmith surface's host repo. Session state mapping from GitHub:
`queued|waiting|pending|requested` → `queued`; `in_progress` → `running`;
completed with conclusion `success|skipped|neutral` → `succeeded`,
`cancelled` → `cancelled`, anything else → `failed`. Note that
`session status --help` does not print help — `--help` is taken as the
handle and errors; only bare `session --help` prints the usage.
a help flag after the subcommand prints the session usage —
`session status --help` is a help request, never a handle lookup.
2 changes: 1 addition & 1 deletion pkgs/fleet/book/reference/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Every verb prints **one JSON object**. Exit codes for the domain: `0` ok · `2`

See also [Agents: enrolment, doctor and the intake ladder](../concepts/agents.md) and [fleet bridge](bridge.md).

Known discrepancy: every per-verb help invocation returns **one shared USAGE text** for the whole domain — there is no per-verb help in source. The per-verb sections below are written from source semantics.
Help: `fleet agent <verb> --help` prints that verb's own usage — its synopsis, a short description, and the shared output/exit-code footer. An unknown verb (or no verb) falls back to the shared domain USAGE. The per-verb sections below are written from source semantics.

## fleet agent kinds

Expand Down
2 changes: 1 addition & 1 deletion pkgs/fleet/book/reference/builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `fleet` binary has five root built-in commands that belong to no domain: `in

Two rules govern all five, without exception:

- **Built-ins take no arguments.** A trailing argument is a usage error naming it, exit 2 — never silently discarded. That rule includes `--help`: `fleet version --help` and `fleet capabilities --help` are errors, not help, and `fleet help --help` answers `error: no domain named '--help'`. This is the opposite of the leaf-verb convention elsewhere in the binary, where `<verb> --help` prints that verb's usage and exits 0.
- **Built-ins take no arguments.** A trailing argument is a usage error naming it, exit 2 — never silently discarded. The one exception is a lone help flag: `fleet version --help`, `fleet capabilities --help`, and `fleet help --help` each print that built-in's own short usage and exit 0 (#13175) — the same leaf-verb convention as elsewhere in the binary. A help flag followed by anything else is still a usage error.
- **Bare `fleet` is an error.** With no subcommand at all, the binary prints a missing-subcommand message and the full help to stderr and exits 2. `fleet --help`, `fleet -h`, and `fleet help` (exactly one word) print the registry help and exit 0. `fleet --version` and `fleet -V` print the short version form (see `version` below).

A domain an invocation cannot use answers with a stub on stderr and exit 69 (`EX_UNAVAILABLE`). There are four stub wordings, one per reason class: the domain is not in this build, the invocation name (`fleet-serve` / `fleet-connect`) narrowed the surface away, the `[domains]` table in fleet config disabled the domain on this host, or the domain is included but not yet implemented. Every stub's second line is `Enabled capabilities: <comma list>` (`none` when empty). Help marks unavailable domains inline — `[not in this build]`, `[narrowed out by this name]`, `[disabled by config]` — but prints the full registry on every variant: every build knows every domain.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/fleet/book/reference/gh.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fleet gh tiers

Probes _every_ rotation source and prints its core and GraphQL rate-limit headroom — labels and numbers only; token values never leave the provider.

Known discrepancy: `tiers` takes no `--help`: `fleet gh tiers --help` errors with `error: unexpected argument '--help' for 'fleet gh tiers'`. This verb is documented only in source.
Help: `fleet gh tiers --help` prints the verb's own usage and exits 0; any other argument is a usage error naming it.

### Exit codes

Expand Down Expand Up @@ -169,7 +169,7 @@ fleet gh closures [<item>]

Reads back the closure log. The policy layer behind it: `issue|pr close|reopen` through the rotation must carry a `--reason` from the taxonomy — `implemented`, `superseded`, `cancelled`, `started-incorrectly` — enforced with the policy error "Please give a reason. This is required by policy." The reason is written into the close comment, and every successful close or reopen appends one `fleet-closure/v1` JSON-line record to `closure-records.jsonl` in the fleet state directory (backed up with it); `closures` prints the log, optionally filtered to one item.

Known discrepancy: this verb has **no help output at all** — its help-dump file is empty because the `--help` invocation produced nothing. Its behaviour is documented only in source (this section).
Help: `fleet gh closures --help` prints the verb's own usage and exits 0.

### Exit codes

Expand Down
2 changes: 1 addition & 1 deletion pkgs/fleet/book/reference/laptop-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

See also [fleet proxy](proxy.md) and [fleet shell](shell.md).

Known discrepancy: there is **no `--help` handling anywhere in this domain**. The shared USAGE text is printed only as part of error messages, and a `--help` argument is treated as data — `laptop-agent jobs --help` errors `unknown command "jobs"` (because `jobs` accepts no trailing arguments), `poll --help` actually polls a job named `--help` and prints its real `HTTP 404: no such job`, and `kill --help` prints nothing. This chapter is written from source.
Help: a help token anywhere before the `--` separator — and not swallowed as an option's value — prints the domain's shared USAGE and exits 0, before any transport is touched: `poll --help` asks for help; it does not poll a job named `--help` (#13175).

## Shared behaviour (all verbs)

Expand Down
2 changes: 1 addition & 1 deletion pkgs/fleet/book/reference/queue-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ usage: repo-queue release <task-id> [--worker <id>] [--lane <id>] [--reason <tex

**Behaviour.** Returns the task to `queued`, immediately claimable; the reason is recorded on a `released` event. Used by dispatch for an item whose sub-task failed to launch/bind — back to the pool in the same touch instead of sitting claimed until lease expiry. Release also closes the session binding window on the timeline (`session_unbound`, trigger `release`). On success it prints the broker's returned task row as JSON and exits 0. When no matching claimed row exists, it dies exit 5 with `release: no matching claimed row (task not claimed by this worker, or already terminal)`.

Known discrepancy: help brackets `--reason` as optional (`[--reason <text>]`); source makes it **required and non-empty** — missing → exit 2 `release requires --reason "<why this task goes back to the pool>" (#8217)`. This chapter documents the source behaviour. (The top-level usage line additionally omits `[--lane <id>]`, which the per-verb usage, the help dump, and the implementation all have.)
Help: the usage writes `--reason` bare — it is **required and non-empty** — missing → exit 2 `release requires --reason "<why this task goes back to the pool>" (#8217)`. The top-level usage line lists the same flags as the per-verb usage, `[--lane <id>]` included; a parity test cross-checks the two so they cannot drift apart again.

Exit codes: 0 released · 2 usage / missing or empty `--reason` · 3 transport · 4 broker store failure · 5 no matching claimed row.

Expand Down
6 changes: 3 additions & 3 deletions pkgs/fleet/book/reference/queue-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ usage: repo-queue session <status|result|list> [HANDLE|OWNER/REPO#RUN_ID] [--min

**Behaviour.** Session records are a labeled **STOPGAP**: a local JSON store at `~/.local/state/fleet-place/sessions.json` (same path/shape as the reference implementation, so records migrate when the designed placement-sessions table lands). The store is lock-guarded on write. `session status <handle>` refreshes the record from GitHub and prints `<handle>: state=<state> surface=<id> run=<url>` (or the record as JSON with `--json`).

Known discrepancy: `--help` is **not** treated as help here. The token after the subcommand is taken as the HANDLE, so `session status --help` looks up a session literally named `--help` and fails with `repo-queue: no session with handle --help in …/sessions.json`. Only a bare `session --help` (no subcommand) prints usage. The flags documented here come from source. This chapter documents the source behaviour.
Help: a help flag after the subcommand prints the session usage and exits 0 — `session status --help` asks for help; it does not look up a session named `--help` (#13175). The flags documented here come from source.

Exit codes: 0 ok · 2 usage / no such handle / missing handle (`session status needs a HANDLE`).

Expand All @@ -85,7 +85,7 @@ usage: repo-queue session <status|result|list> [HANDLE|OWNER/REPO#RUN_ID] [--min

**Behaviour.** Same refresh as `status`; the output adds `terminal: bool` (`succeeded|failed|cancelled` are terminal) and, when not terminal, the note `not terminal yet — reconnect with the same handle`. Text form: `<handle>: <state> (terminal=<bool>) run=<url>`.

Known discrepancy: as with `status`, `--help` after the subcommand is treated as a handle, not as help (see `session status`). Flags are documented from source.
Help: as with `status`, a help flag after the subcommand prints the session usage (see `session status`). Flags are documented from source.

Exit codes: 0 ok · 2 usage / no such handle / missing handle.

Expand Down Expand Up @@ -126,7 +126,7 @@ usage: repo-queue surfaces [--registry PATH]
| ------------ | --------- | -------------------------------- | ----------------------- |
| `--registry` | file path | resolution order (see Behaviour) | Registry file to print. |

**Behaviour.** Prints the resolved placement registry verbatim as pretty JSON, exit 0. (The help-dump `queue_surfaces.txt` is exactly this output, not help text.) Registry resolution order: `--registry <path>` or env `FLEET_PLACE_REGISTRY` → a home copy → the source-tree relative path → the registry **embedded in the binary**. Registry shape (version 2): `{comment, version, laptop: {busy, busy_source, note}, owners: {<owner>: {concurrent_jobs_cap, concurrent_macos_cap, plan, private_minutes_monthly}}, surfaces: […]}`.
**Behaviour.** Prints the resolved placement registry verbatim as pretty JSON, exit 0. `surfaces --help` prints a short usage instead of the registry. Registry resolution order: `--registry <path>` or env `FLEET_PLACE_REGISTRY` → a home copy → the source-tree relative path → the registry **embedded in the binary**. Registry shape (version 2): `{comment, version, laptop: {busy, busy_source, note}, owners: {<owner>: {concurrent_jobs_cap, concurrent_macos_cap, plan, private_minutes_monthly}}, surfaces: […]}`.

The shipped surfaces: `fleet-personal` (github-actions, dezren39/fleet, App installation, active), `fleet-org` (github-actions, developing-today/fleet, user-token dispatch, active; also the Blacksmith host), `fleet-forks` (github-actions, developing-today-forks/fleet, **public targets only**, active), `org-run` (standby, retained for manual use; placement prefers fleet-org), `fleet-org-blacksmith` (kind `blacksmith`, Linux-only fallback; budget 3000 free min/mo, paid cap 0 — paid overage disabled unless a dispatch explicitly supplies `--allow-paid-blacksmith`), `codespace-overflow` (kind `codespace`, status `pending-scope`, max 3 live, 180 core-hours/mo budget; uses existing codespaces only, never creates them), `laptop` (kind `laptop`, `handoff-only` — a placement record only; this adapter never runs shell commands on the laptop). Targets accept exact `owner/repo`, `owner/*`, or `*`. `sticky_queue_threshold: 2` and `selection_priority` (10 for the active runners, 20 for org-run) drive the cascade.

Expand Down
2 changes: 1 addition & 1 deletion pkgs/fleet/book/reference/queue-fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ usage: repo-queue fallback scan [--repo <repo>] [--limit <1..100>] [--lease-min

**Behaviour.** Sweeps the fallback repos' labelled issues (`queue/queued`, `queue/claimed`, `queue/blocked`) and folds each issue's claim state. Output JSON: `{"mode":"fallback", "generated_at", "lease_seconds", "items": [{"repo","number","title","url","labels","blocked","claim": <state JSON>}], "summary": {"total", "claimable"}, "notes": […]}`. Items are ranked claimable first (free/released/stale), then live, then contested/blocked; a blocked item never ranks claimable even if its marker fold reads free — the label is the block. Per-issue comment-read failures land in `notes` and the issue is folded with no markers rather than failing the sweep.

Known discrepancy: the group usage line in `queue_fallback.txt` (and source `GROUP_USAGE`) summarizes `scan <repo> <issue-number>`, but `fallback scan` takes **no positionals at all** (they are a usage error) — its repo filter is the `--repo` flag. The same top-level usage additionally **omits `complete`** from the fallback subcommand list while the fallback group usage and the implementation both include it. This chapter documents the implementation behaviour.
Help: the group usage line lists `scan [--repo <repo>] [--limit <1..100>] [--lease-min <minutes>]` — `fallback scan` takes **no positionals at all** (they are a usage error); its repo filter is the `--repo` flag. The top-level usage lists the full fallback subcommand set, `complete` included. This chapter documents the implementation behaviour.

Exit codes: 0 ok · 2 usage (including positionals, out-of-range `--limit`) · 3 GitHub transport failed.

Expand Down
8 changes: 4 additions & 4 deletions pkgs/fleet/book/reference/queue-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ usage: repo-queue checkpoint <task-id> [--worker <id>] [--lane <id>] [--stage <s

**Behaviour.** Records progress + stage without touching the lease. The broker (`/checkpoint`) merges the progress (default `{}`) into the task row with `progress.last_checkpoint = {stage, at}` stamped in; upserts the per-worker KV row `checkpoints(worker_id, 'task:<id>') = {stage, progress, at}`; writes a `checkpoint` event. Fallback-switch path, like heartbeat: a primary-store failure switches, exit 6. Prints row + `mode_line`.

Known discrepancy: help brackets `--stage` as optional (`[--stage <s>]`); source makes it **required** — missing → exit 2 `checkpoint: --stage is required`. This chapter documents the source behaviour.
Help: the usage writes `--stage` bare — it is **required** — missing → exit 2 `checkpoint: --stage is required`.

Exit codes: 0 ok · 2 usage / missing `--stage` / both progress flags · 3 transport · 4 broker store failure · 5 no matching claimed row · 6 fallback switch.

Expand Down Expand Up @@ -296,7 +296,7 @@ usage: repo-queue cancel <task-id> [--worker <id>] [--reason <text>]

**Behaviour.** For a task that will never be worked (issue closed, self-assigned elsewhere, superseded). Sets status `cancelled`, clears worker/lease, deletes the lease row, records `result.reason_class = "cancelled"` + `result.cancel_reason`, writes a `cancelled` event. The original function only accepted `queued` or `parked` rows. Output: the row; cancel closes the timeline binding window.

Known discrepancy: help brackets `--reason` as optional (`[--reason <text>]`); source makes it **required** (exit 2 without it). Source-only fact: cancel's `--worker` default is `fleet-monitor`, not `repo-worker-code`. This chapter documents the source behaviour.
Help: the usage writes `--reason` bare — it is **required** (exit 2 without it) — and its description names cancel's `--worker` default: `fleet-monitor`, not `repo-worker-code`.

Exit codes: 0 cancelled · 2 usage / missing `--reason` · 3 transport · 4 broker store failure · 5 no matching row.

Expand Down Expand Up @@ -344,7 +344,7 @@ usage: repo-queue fail <task-id> [--worker <id>] [--lane <id>] [--error <text>]

**Behaviour.** Terminal `failed`. Broker route `/fail`. Output: row or `{task, lane_ledger}`; fail closes the timeline binding window.

Known discrepancy: help brackets `--error` as optional; source makes it **required** (exit 2 without it), and `--reason-class` is a closed enum (default `transient`) that help never mentions. This chapter documents the source behaviour.
Help: the usage writes `--error` bare — it is **required** (exit 2 without it) — and its description names the `--reason-class` closed enum: `transient` (the default), `deterministic`, `blocked`.

Exit codes: 0 failed · 2 usage / missing `--error` / invalid `--reason-class` · 3 transport · 4 broker store failure · 5 no matching claimed row.

Expand Down Expand Up @@ -385,7 +385,7 @@ Client-side completion dressing (all fail-soft, explicit caller values win):

The gate is pure (no network): it parses the record, checks freshness (≤ **1800 s** old by default; >300 s in the future is unreadable clock skew), checks it describes the task's issue, checks the verdict against the readback, checks every PR the completion result links (`pr`/`pr_url`/`merged_pr` fields) appears in the readback, and checks any follow-up. **Every rejection leaves the task claimed** and names the defect ("…; the task remains claimed"). The five verdicts and their per-verdict rules are specified under `verify-disposition` below.

Known discrepancy: `--queue` is present in help and in the client's flag list, but the source **never reads it** — it reaches no request body field. A dead flag. This chapter documents the source behaviour.
Help: `complete` takes no `--queue` flag — an earlier dead `--queue` (parsed but never read by the source) was removed from the parser and the usage (#13174).

Exit codes: 0 completed · 1 disposition gate rejection (task remains claimed) · 2 usage / non-object result / unknown telemetry field · 3 transport · 4 broker store failure · 5 no matching claimed row · 6 fallback switch.

Expand Down
Loading