cargo xtask Subcommand Catalog
On this page
Overview
cargo xtask is canopy’s task runner — all build / test / devstack / migration / policy automation lives here, never in ad-hoc shell. Drive everything through xtask; never call docker compose directly (raw restarts cause partial-JWKS cascades — see Stale JWKS recovery). cargo xtask --help is authoritative; this page is the one-line orientation map.
Catalog
| Subcommand | Purpose | When |
|---|---|---|
|
Initialise a project from the claude-quickstart template |
New project bootstrap only |
|
Manage the Docker devstack (see |
Daily |
|
|
Before committing |
|
Pre-push gate: fmt + clippy + build + nextest + SPDX + signing + visibility + Tier-3 docs + |
Pre-push hook; the trusted gate |
|
Run |
Opt-in; contributors without host PG |
|
Playwright E2E against the devstack; |
After UI / route changes |
|
k6 performance tests against the devstack |
Manual; load testing |
|
Seed databases with deterministic data; |
Fixtures (the role-keyed cast; the dedicated demo profile was retired in #716) |
|
Cross-service referential-integrity auditor over the seeded devstack (see |
After seed/schema changes |
|
Regenerate plain-language API docs / OpenAPI snapshots from utoipa; |
After endpoint changes |
|
Verify Tier-1 docs match the upstream template (SHA-256) |
CI doc-integrity gate |
|
Plan lifecycle tooling (see |
ADR-013 plan hygiene |
|
Policy traceability (see |
ADR-011 citation work |
|
Scenario-inventory gate (ADR-031 §3 / ADR-032): audit schema, bindings, per-corpus coverage |
Scenario / corpus work |
|
JDM ruleset schema gate — compile every |
After ruleset edits |
|
ADR-004 data-tenancy audit + ADR-005 capabilities drift |
Compliance gates |
|
Code-quality debt ratchet (epic &62 M6): count 8 debt metrics against the lock; |
Blocking in |
|
Typed- |
Route work |
|
Route write-authz gate (#1004): every case-mutation route carries its authz extractor |
Route work |
|
ADR-039 single-sourced |
After outbox schema changes |
|
One-shot ADR-038 sweep of pre-saga orphaned finalize graphs (#1055); dry-run by default, |
Operator surgery |
|
Plaintext-secrets gate for |
CI security gate |
|
Lint plan documents for the canonical Status vocabulary (universal engine; the project-level twin of |
Plan hygiene |
|
Advisory hygiene report for the local agent-memory dir (machine-local; report-only, |
Agent hygiene |
|
Advisory function-shape smell radar ( |
Refactor radar |
|
Snapshot / rollback devstack databases ( |
Dev rollback (ADR-016) |
|
SOPS-encrypted dev-secrets workflow (init/edit/decrypt/add-recipient) |
ADR-017 secret management |
|
Generate an ECDSA P-256 key pair for a program service |
New program service (ADR-002) |
|
canopy-identity contract conformance + reference IaC templates (ADR-019) |
Identity / OIDC work |
|
Workspace line-coverage gate via cargo-llvm-cov |
Coverage checks |
|
Re-hash every vendored JS file against |
After touching static vendor assets |
|
CI-config regression gate (ADR-040): assert the build-once / gate-complete promotion invariants of |
CI + pre-push static gate; after editing |
dev — devstack lifecycle
|
Build images, start infrastructure, create per-service DBs, load the Keycloak realm, wait for health |
|
Auto-detect changes by content hash and apply the minimum rebuild/restart |
|
Force a coordinated bounce of all services |
|
Tear down and remove volumes (fresh DBs) |
|
Print the URL table (host-mapped ephemeral ports — see Service Catalog) |
|
Tail service logs |
refresh vs reload is load-bearing (#609). dev refresh may report "up to date" and skip the bounce when its content-hash check misses a change (the #609 SHA-gap). When you specifically need services to restart — e.g. to clear stale JWKS — use dev reload, which always bounces. See Stale JWKS recovery.
seed-verify — cross-service integrity auditor
|
Cross-service ref auditor — walks FK pairs across the seeded service DBs, exits non-zero on any orphan. Skip-tolerant: checks touching a DB whose container is down (e.g. the program DBs on a SnapOnly stack) are skipped, not failed. |
Repurposed from the retired demo tooling in #716: the demo dataset + its
regenerate/check-drift gates were removed in MR4e, and MR4f renamed the
surviving demo verify auditor to seed-verify + made it skip-tolerant.
docs — plan lifecycle (ADR-013)
|
Validate every active plan uses the closed-set Status vocabulary (blocking) |
|
Move fully-Done plans into |
(Distinct from the advisory asciidoctor-lint tool.)
policy — traceability (ADR-011 / ADR-031)
|
Validate citations across both source families (blocking in CI): jurisdiction ( |
|
Detect hardcoded policy values / silent numeric fallbacks outside |
|
Detect jurisdiction values leaking outside the ruleset mechanism (#1226): the Georgia helpline in any code (fixtures use 555 numbers) and quoted |
|
Fail when a canopy-reporting federal universe bypasses the two blessed completeness types (#1249, ADR-001 Amendment 1 §B3): |
|
Clone/pull the PAMMS source repos locally + write the sync manifest (per-repo HEAD, per-cited-file SHA-256) into |
|
Report citations whose pinned source changed since verification (re-syncs first; |
|
Verify the mandated-action catalogue ( |
Related
-
CLI Reference — the
canopyend-user CLI (ADR-007 parity), distinct fromcargo xtask(developer automation). -
Developer Guide — environment setup and common tasks.