ADR-088: Operator Tools Live Outside xtask — API Work in craig, Direct Work in craig-manage

Status

Accepted (2026-11-18) with plan operator-tools, #2671. The maintainer ruled option 1 of #2671 and named the direct-work binary craig-manage.

Context

xtask is the developer’s task runner. It needs a checkout and a Rust toolchain, it carries no release version, and it depends on craig-test-lib as a normal dependency, so test fixtures sit in its dependency graph (release-artifact-gate carries two named exceptions for exactly that). The deployment guide and the runbooks under operations/ nonetheless send a production operator to cargo xtask <verb> for work that writes production data: the subsidy history import, backpay, the ruleset first load and promotion, the quarantine drain, the assignment backfill.

The craig CLI already exists for API work, with craig-test-lib only among its development dependencies, but it is not released: it is installed from a checkout.

Decision

  1. A tool an operator runs against a deployment is never an xtask verb. xtask keeps what a developer or CI runs against a checkout or a devstack: the gates, the devstack lifecycle, rehearsals, generators for committed fixtures.

  2. Work that goes through a service API belongs to craig. It authenticates as the operator and is authorized by the service like any other caller.

  3. Work with no API to go through belongs to craig-manage: bootstrapping and repair that act on a database, the broker or the archive directly, run by an operator on a host that holds those credentials. It has no default target: a verb refuses to start unless it is told what to connect to.

  4. Both are released with the services, in one image at the services' version, and neither has craig-test-lib in its normal dependency graph. Both come under the production lint regime.

  5. No alias. A moved verb’s xtask form is removed in the merge request that moves it (pre-1.0).

Held by no_operator_page_sends_an_operator_to_xtask (xtask/src/operator_docs_tests.rs): every cargo xtask verb the deployment guide, the CLI page or a runbook names must be listed as a developer’s, with the reason, or as moving, with the step that moves it.

Consequences

  • An operator needs an image, not a checkout and a toolchain, and runs the tool at the version the deployment runs.

  • Tools that write production data lose the fixture code in their graph.

  • The API tools take craig’s conventions: profiles for service URLs and the identity provider, one credential model, the global --yes. Command lines change; each step’s release note names the new one.

  • xtask’s own uses of three moved modules (the caregiver report and the invariant debris in validate, key generation in perf) call `craig-manage’s library.

  • Whether xtask can drop craig-test-lib as a normal dependency is measured after the last move, not promised.

Alternatives

  • Keep the tools in xtask and record the fixture dependency as an accepted risk (option 2 of #2671). One small change, but operators keep needing a checkout, and production-data tools keep an unversioned, fixture-linked home.

  • One binary for both kinds. Rejected: the API tools need no infrastructure credential and the direct tools need no operator login; keeping them apart keeps each one’s requirements, and its blast radius, plain.

Edit this page · latest