cargo xtask Subcommand Catalog

For a contributor or agent looking up a cargo xtask command: this page lists every subcommand once, with its flags as clap defines them (xtask/src/cmd/mod.rs is the enum; xtask/src/cmd/<cmd>.rs the arguments). cargo xtask --help and cargo xtask <cmd> --help are authoritative. cargo xtask is canopy’s task runner — build, test, devstack, migration and policy automation live here, never in ad-hoc shell — and you drive the devstack through it rather than raw docker compose, since dev start, reload and restart also reserve the ports, decrypt the dev secrets and prepare the identity plane around the up (dev — devstack lifecycle). What each command means is owned elsewhere: the lanes, the push gate and E2E by Testing; first run and the devstack lifecycle by Local Development; every variable by Configuration Reference; migrations by Database Migrations. The canopy end-user CLI (ADR-007 parity) is a different binary — canopy CLI Reference.

Catalog

Purpose text follows the enum’s doc comment. "Gate" names the cargo xtask validate stage or CI job that runs the command, where one does (the stage list).

Subcommand Purpose Gate / when

dev

Manage the Docker devstack (dev — devstack lifecycle)

Daily

test

fmt, clippy and the two nextest lanes (test, e2e, validate, validate-in-network, coverage, mutants — the lanes)

Pre-push step 2 (--unit); before committing

e2e

Playwright E2E against the devstack (test, e2e, validate, validate-in-network, coverage, mutants — the lanes)

The battery; after UI / route changes

validate

The battery (test, e2e, validate, validate-in-network, coverage, mutants — the lanes): an optional, fuller local loop. Nothing requires it: git push runs test --unit, and the merge train's car is the gate (#3245, #3250)

By hand, when you want it

doctor

This machine's checks, not the tree's: the cargo tools and docker daemon (preflight), the repository's visibility against compliance/visibility.toml (visibility, through glab) and the commit-signing config (signing) (test, e2e, validate, validate-in-network, coverage, mutants — the lanes)

New machine; validate's first stages

validate-in-network

validate inside the compose network so PG-touching tests run without host Postgres (#339, ADR-015)

Opt-in; CI manual job — Validate In-Network Runner

perf

k6 performance tests and the chain / replay perf harnesses (perf)

By hand (--profile smoke for a quick check)

seed

Seed the devstack databases with deterministic test data (seed and seed-verify)

Fixtures; run by e2e

api-docs

OpenAPI snapshot drift against the live services (api-docs — OpenAPI snapshots)

validate stage api-docs

coverage

Unit-lane line-coverage gate via cargo-llvm-cov + nextest (#1382); --integration is informational (test, e2e, validate, validate-in-network, coverage, mutants — the lanes)

CI job coverage (merge requests)

mutants

Unit-lane mutation testing via cargo-mutants + nextest (#466): gates missed mutants against mutants-baseline.toml; --smoke = shard 0/20, --iterate resumes, --baseline refreshes (test, e2e, validate, validate-in-network, coverage, mutants — the lanes)

Local and manual only; never validate or CI

target-report

target/ retention diagnostic + explicit subtree prune (#1384) (Operator and maintenance commands)

Disk hygiene

identity

canopy-identity’s deploy gate (check, ADR-049 Amendment 23), the opt-in upstream IdP conformance run (conformance) and every upstream’s suite (matrix, ADR-049 Amendment 26) (Operator and maintenance commands)

Before a canopy-identity deploy; upstream IdP work; the pre-push hook (matrix) and before a release (matrix --all --e2e)

migrate

Snapshot / rollback the devstack databases (migrate — devstack snapshots)

Before a risky migration

secrets

SOPS-encrypted dev-secrets workflow (secrets — SOPS + age (ADR-017))

ADR-017

policy

Policy traceability: audit citations, sync the policy cache, detect drift (policy — traceability (ADR-011 / ADR-031))

validate stages; CI adr-011- / adr-031-

scenarios

Scenario-inventory gate (ADR-031 §3 / ADR-032): schema, bindings, per-corpus coverage (The static gates)

validate stage scenarios-audit; CI adr-031-scenario-coverage

quality-budgets

Code-quality debt ratchet against xtask/quality-budgets.lock; --write-lock re-baselines (The static gates)

validate stage quality-budgets; CI quality-budgets

rules

JDM ruleset gates: compile every layer’s decisions, lint numeric literals, check processing-day parity (The static gates)

validate stages rules, rules-lint-inputs, processing-days-parity; CI rules-check

config fetch

Fetch the configuration repositories config-sources.lock pins into target/config/<layer>/current, each commit verified against the public trust roots in ci/config-trust/ (ADR-051; #3262). It runs the same sync canopy-config-fetch runs in a deployment; a commit that is not on the branch its entry names or is signed by a key outside the trust root is refused, and the last good tree is kept. It warns when a trust root's OpenPGP key is within 90 days of expiring and fails within 30 (#3418; the runbook)

Before working with the real federal or Georgia layer; the car

config bump <name> <branch>

Move one layer's pin to the head of a branch (#3263): resolve the head on the remote, publish it through the same verified sync, then rewrite the entry in config-sources.lock and the default source list in docker-compose.yml together. A branch the remote lacks, a commit the sync refuses or a layer the lock does not pin leaves both files unchanged

After a configuration repository's change lands, to bring it into canopy (A policy change)

compliance

ADR-004 data-tenancy audit; ADR-005 capabilities manifest vs compose (The static gates)

validate stages data-tenancy, capabilities; CI compliance-*

docs

Plan lifecycle tooling (ADR-013) and screenshot capture (docs and plan-lint — plan lifecycle (ADR-013))

validate stage plan-lint; CI adr-013-plan-lint

vendor-check

Re-hash every vendored JS file against vendor.toml, and hold canopy-web's package.json and package-lock.json to it: exactly the packages it pins, at exactly their versions, with no script (#3639). Nothing installs from the two npm files; they are what GitLab's dependency scanning reads

validate stage vendor-check

config-in-source-lint

Configuration stays out of source (ADR-051; #3265), over the tracked files: no pack file, pack table, Typst notice file, notices manifest or JDM decision model outside fixtures/config/; no deployed image copies fetched configuration (target/config, rulesets), which the fetcher publishes at run time (the test runner's Dockerfile.integration may); no secrets/ directory or SOPS-encrypted file in a fixture layer

validate stage; the car's .lints

secrets-yaml-lint

Plaintext-secrets gate for config/*/.yaml (896); an intentional value needs allow-secret: <reason>

validate stage; CI secrets-yaml-lint

migrations-lint

v7-PK regrowth gate, the global-DDL contract and the clock-default gate (#2589) over the migration tree — migrations.adoc#migration-gates

validate stage migrations-lint

test-lanes-lint

Lane-integrity gates: infra_tests classification walk, URL-literal ban, pack-dates and loud-miss checks (--static), lane partition (--verify-partition) (The static gates)

validate stages test-lanes-lint, lane-partition; CI cargo-test

feature-builds

Clippy (test and dev profile) and rustdoc over every supported feature combination no lane builds — a default feature switched off, a devstack-only feature, a default build every lane overrides — as lanes::FEATURE_BUILDS declares them, after a coverage check over every workspace manifest (#2249, #2512) (The static gates)

validate stage feature-builds

ci-config-lint

CI-config regression gate (ADR-040): build-once / gate-complete invariants of .gitlab-ci.yml + the Dockerfiles, the merge-train rules (#3248: cargo xtask or allow-listed script lines, 4xlarge gating jobs with no allow_failure, services: or retry:, merge-request pipelines, the stack jobs' needs, no nextest retries, no cargo or dx in a Dockerfile RUN but Kanidm's and the CI image's, #3273), pinned, sha256-verified tool downloads in the CI file and every tracked Dockerfile (#2621), and no third-party telemetry, update checks or unasked-for downloads where syft, npm, npx, k6 or Grafana run (#2623)

validate stage; CI lint (ci lint)

seed-verify

Cross-service referential-integrity verifier over the seeded devstack (seed-verify)

After seed / schema changes

plan-lint

Lint plan documents for the canonical Status vocabulary; --done is the completion gate (docs and plan-lint — plan lifecycle (ADR-013))

Plan hygiene

spdx-lint

Every .rs file and Dockerfile carries the SPDX licence header (#2629, #2055)

validate stage spdx; the car's lint step

mandatory-docs-lint

The project pages every checkout must carry exist and are filled in (#2990)

validate stage docs; the car's lint step

portability-lint

No unguarded std::os::unix in xtask or a workspace crate it links, so cargo xtask compiles on Windows (#1963, #2493)

validate stage xtask-unix-guard; the car's lint step

mq-topology

Binding-first MQ topology lint: every published routing key needs an in-tree consumer or an allowlist entry (#1089)

validate stage mq-topology

call-graph

Service-to-service call graph (ADR-049): check, the default, fails on any difference between the compiled graph, the census of peer settings and the graph’s table in the authorization inventory, with no allowlist (#2644); doc prints that table; census prints the observed pairs with their settings (#2642) (The static gates)

validate stage call-graph

delegated-routes

canopy-identity’s delegated routes (ADR-049 Amendment 15): check, the default, fails on any difference between canopy_auth::delegated_routes() and its table in the authorization inventory, and on a listed route its service does not register (#2802); doc prints that table (The static gates)

validate stage delegated-routes

board

Deterministic tier-burndown snapshot from the GitLab milestones (#1327) (Operator and maintenance commands)

Tracking snapshot

fn-shape-report

Advisory function-shape smell radar (and names, &mut out-params, tuple returns)

Refactor radar

typed-ids

Typed-Path<*Id> rollout gate (#627): ban raw Path<Uuid> extractors (audit-path-uuid)

validate stage typed-ids-path-uuid; CI typed-id-path-audit

http-clients

Three audits over every production HTTP client site: each client constructor states connect_timeout and the whole-request timeout (#1200, #2536; audit-timeouts), and a redirect policy, with every .redirect(..) call naming Policy::none() (#2534; audit-redirects); and no client is built outside the shared builders of canopy_common::http, canopy-test-lib exempt (#2584; audit-builders). Each holds unless an allowlist entry gives the reason a site cannot

validate stages http-clients-timeouts, http-clients-redirects, http-clients-builders

secret-loads

Key/secret loader gate (#2489): in production code under services/ + crates/, no env::var read of a secret-named variable (or of a runtime name inside a key or secret loader), no swallowed secret provider read, no secret provider read in a function that never tests for a blank value (#2511), no .keys path in a function that never calls is_development(), no DevKeyFiles::development_dir call (Configuration Reference › Secrets); and under tools/ + xtask/ as well, no .basic_auth(…) call — OAuth client credentials go through canopy_auth::ServiceCredentials (#2427) — and no *-not-for-production devstack-secret literal (#2491)

validate stage secret-loads

db-pools

Database pool gate (#2538): in production code under services/, crates/, tools/ and xtask/ outside canopy-db, every pool starts from canopy_db::pool_options() and keeps its release check. Refuses PgPoolOptions::new / ::default, PoolOptions::new / ::default, PgPool::connect… / Pool::connect… and an after_release call, which replaces the check. Also refuses bare-commit (ADR-053): a zero-argument .commit() anywhere in production code, canopy-db included, outside the module that defines canopy_db::commit. canopy-test-lib and test code are exempt from every rule (Shared Crates › canopy-db)

validate stage db-pools

retention-deletes

Retention-delete gate (#2577): in production code under services/, crates/ and tools/, a string literal holding a SQL DELETE FROM that selects rows by age, pins no key and has no LIMIT is refused; a sweep runs in bounded batches through canopy_common::retention::sweep_in_batches (the #2470 shape). canopy-test-lib and test code are exempt; the allowlist is compliance/retention-delete-allowlist.toml (Shared Crates › canopy-common)

validate stage retention-deletes

route-authz

Every canopy-web mutation route carries its write-authz extractor (#1004; audit)

validate stage route-authz; CI route-authz-audit

web-paths

canopy-web builds every upstream request path, every redirect target and every URL query value it formats through typed_path (#2539; audit), unless an allowlist entry gives the reason it cannot (The static gates)

validate stage web-paths

ssn-reads

No new canopy-persons read that opens an SSN (#2983): a GET /v1/persons/{id} caller, or a person_ssn projection, outside canopy-persons needs an allowlist entry giving its reason (The static gates)

validate stage ssn-reads

outbox-migrations

Single-source the per-service event_outbox schema from canopy-mq (ADR-039): --check (default) parity-gates the copies, --write regenerates them

validate stage outbox-migrations

extension-fixtures

The fixture extension modules (ADR-052) are their source's build: builds each fixtures/extension-src/<name> for wasm32-unknown-unknown and wraps it as a component, and fails when the source digest recorded beside fixtures/extensions/<name>/module.wasm (module.source-sha256) is not the source's; --write replaces the component and the digest

validate stage extension-fixtures; the car's lint step

shipped-features

No test-* feature of a workspace crate in a release build's normal-dependency graph (#1604): asks cargo tree what each of the release job's three builds resolves (the services, the operator CLI, the portal's server half), judges each on its own, and fails naming the build, crate and feature. It first proves it can see the devstack's features in a graph built with them, so a change in cargo's output cannot blind it. A machine-enforced absence of such features, not a proof that no test code ships

validate stage shipped-features; the car's lint step

contested-surfaces

The contested-surfaces register against the tree (#1600): compliance/contested-surfaces.toml lists each canopy-mq seam through which a service meets the broker (Subscriber::subscribe*, OutboxDrainer::spawn) with its fault legs, and every consumer with its ordering contract. A seam or consumer missing from the register, a stale entry, a promoted surface without a leg for each fault its class requires, a leg whose test is gone or #[ignore], and a [ratchet] count that differs from the register's own all fail. --bless appends report-only and undeclared stubs only. Sweeps, workers and HTTP clients are not censused; each run says so.

validate stage contested-surfaces

fault-preflight

Prove the devstack's transport fault layer (#1591): each standing Toxiproxy mirror answers, severs and answers again, and carries no fault a test left behind. --up starts the layer; --required fails when it is not running (the fault layer)

Before a test that uses a mirror

neutrality-lint

Jurisdiction-neutrality gate (#2208): eight detectors over the shared tree against compliance/neutrality-gate.toml, an exact-count self-draining allowlist (neutrality-lint — jurisdiction neutrality)

validate stage neutrality

determination-status-lint

Determination-status typing gate (#628): listed verdict fields must be DeterminationStatus (or the type their entry names), listed columns must carry an exact live CHECK, and discovered stringly verdict fields must be listed or exempt, against compliance/determination-status-fields.toml (determination-status-lint — typed determination status (#628))

validate stage determination-status

dev — devstack lifecycle

cargo xtask dev start   [--shared-db] [--profile <p>] [--idp kanidm|keycloak|zitadel]   # reserve ports, decrypt dev secrets, cached compose build + up, write .ports.env + the URL table
cargo xtask dev stop                                    # stop containers, keep volumes
cargo xtask dev reload  [--shared-db] [--profile <p>] [--idp <idp>]   # down + start; data kept — always bounces every service
cargo xtask dev restart [--shared-db] [--profile <p>] [--idp <idp>]   # WIPES data: down -v --rmi local, then start (cached build)
cargo xtask dev clean --confirm                         # down -v across every profile; refuses without --confirm
cargo xtask dev refresh                                 # content-hash source/deps/Dockerfile/config/migrations/seed; minimum rebuild or restart
cargo xtask dev identity                                # provision the devstack's identity plane on the running stack (#2764)
cargo xtask dev status                                  # compose ps, the URL table from .ports.env, staleness report
cargo xtask dev sweep-schemas [--older-than <hours>] [--include-unmarked]   # evidence-gated test-schema removal, dead leases reclaimed (#1379, #2595; default 6 h)
cargo xtask dev logs [<compose-service>] [--tail <n>] [--no-follow]        # e.g. canopy-medicaid; follows by default

--profile accepts snap-only, tanf-only, medicaid-chip, caps-only, wic-only and full (default full; VALID_PROFILES in xtask/src/cmd/dev.rs). --shared-db runs every database on the single shared Postgres instance. --idp chooses the devstack’s upstream, Kanidm by default, recorded in .devstack/upstream for every later bring-up (Local Development › The devstack’s upstream). refresh versus reload is load-bearing (#609): refresh may report "up to date" when its content hash misses a change; when services must restart, use reload. Every bring-up also prepares the devstack’s canopy-identity plane around its up (xtask/src/devstack_identity.rs, devstack_upstream.rs): before it, the upstream’s TLS pair and the issuer’s configuration, then the chosen upstream started (the others removed) and provisioned, and each service’s identity secrets written (canopy-web’s upstream client secret among them); after it, the restarts a new TLS pair needs and the cast’s seed links. dev identity runs that last provisioning step alone (Local Development › The devstack’s upstream). What each subcommand does to data, first run, and the feature-build stickiness of CANOPY_CARGO_FEATURES are in Local Development.

test, e2e, validate, validate-in-network, coverage, mutants — the lanes

Semantics are owned by Testing; synopses only:

cargo xtask test [--unit] [--integration] [--no-refresh] [--host] [--skip-static] [-p <CRATE>]... [--run-ignored]
cargo xtask test --fault [--no-refresh] [--skip-static]
cargo xtask e2e  [--no-refresh] [--devstack-profile snap-only|full] [--seed <u64>] [--households <n>]
                 [--visual] [--capture] [--jurisdiction <slug>] [-- <playwright args>]
cargo xtask validate [--skip-docker] [--timing]
cargo xtask doctor
cargo xtask validate-in-network [--with-devstack] [--no-build] [-- <validate args>]
cargo xtask coverage [--threshold <pct>] [--baseline] [--integration]
cargo xtask mutants  [--smoke | --iterate | --baseline]

Every nextest lane (test, validate, coverage, mutants) arms CANOPY_TEST_INFRA=required, so an infra-dependent test panics rather than skips when the stack is unavailable (testing.adoc#infra-required). test --integration runs in-network by default (ADR-015); -p requires --host. test --fault is the fault lane alone: it starts and proves the transport fault layer, then runs the tests that put faults on it (Testing (Canopy)); it takes no other lane's flag. The bare cargo xtask e2e is the blocking battery and needs the full profile plus the test-clock build (testing.adoc#e2e-battery-journey-gate). Every e2e run names the devstack’s upstream before Playwright starts and with its result (ADR-049 Amendment 26), and after Playwright, passing or failing, lists the run’s five slowest specs from test-results/e2e/results.xml (#3008, testing.adoc#e2e). Every e2e run builds the token broker’s image (in the job’s own daemon on CI), installs its inputs and brings canopy-token-broker up first, since auth-setup and the given helpers sign in through it, and its e2e-only removal takes it down after (ADR-049 Amendment 24; local-dev.adoc#token-broker-service). It also installs the devstack CA into canopy-e2e's canopy_e2e_inputs volume (Node’s NODE_EXTRA_CA_CERTS) and passes the ingress leaf’s SPKI pin as CANOPY_E2E_WEB_SPKI, which every Playwright project’s Chromium takes; the suite reaches canopy-web at its https origins, and no storage state survives a run (testing.adoc#e2e-sign-in). The battery’s stages (STAGES in xtask/src/validate_report.rs) are listed at testing.adoc#validate-stages. Its xtask-unix-guard stage (#1963, #2493) fails on any std::os::unix (or linux, fd, wasi) path without a Unix cfg gate in xtask/src or the src/ of every workspace crate cargo xtask compiles: xtask’s normal- and build-dependency closure, read from cargo metadata --no-deps --offline when the stage runs (xtask/src/cmd/portability_lint.rs), so a newly linked crate is covered without an edit. A failed cargo metadata fails the stage. coverage gates the unit lane against DEFAULT_THRESHOLD in xtask/src/cmd/coverage.rs; --baseline rewrites coverage-baseline.toml (run it in the CI image). mutants runs cargo-mutants over the same unit lane and fails on any missed mutant absent from mutants-baseline.toml. --smoke runs shard 0/20 and --iterate resumes an interrupted full run on an unchanged tree. Every mode runs two passes, the workspace without canopy-portal and the portal alone with its test features (#2230). --baseline rewrites the baseline from both passes' missed.txt after a complete full run. It is local and manual only (Mutation testing).

seed and seed-verify

cargo xtask seed [--seed <u64>] [--households <n>] [--jurisdiction <slug>]
cargo xtask seed --manifest-only   # write tests/e2e/lib/seed.ts if absent: no SQL, secrets or devstack
cargo xtask seed-verify [--verbose]
Flag Default Effect

--seed

random

RNG seed; the resolved value is stamped into test-results/seed/last.txt for replay

--households

50 (DEFAULT_HOUSEHOLDS)

Households to generate — the one default seed and e2e share (#450)

--jurisdiction

georgia

Must name a pack under target/config/ or fixtures/config/; xtask passes canopy-seed that pack’s layer stack as --config-source with --config-allow-unverified (xtask/src/config_layers.rs)

There is no --reset flag: every run wipes and reloads the seeded databases itself (#1142) and truncates canopy-web’s composition-override tables. The replay contract is in Testing › The seed harness.

seed-verify

Walks FK pairs across the seeded service databases and exits non-zero on any orphan; --verbose lists each orphan row. Skip-tolerant: a check touching a database whose container is down (the program DBs on a snap-only stack) is skipped, not failed. Renamed from demo verify in #716.

api-docs — OpenAPI snapshots

cargo xtask api-docs [--update]
cargo xtask api-docs --offline [--update]

Fetches /api-doc/openapi.json from every service in SERVICES (xtask/src/cmd/api_docs.rs) on the host port .ports.env records and diffs it against the committed snapshot docs/modules/ROOT/openapi/<service>.json; drift fails (the api-docs validate stage). --update overwrites the snapshots. An unreachable service whose snapshot exists is fatal, never a skip (#1364).

--offline (#3340) needs no devstack. It runs every service's the_served_openapi_spec_is_the_committed_snapshot unit test, which builds the document the service serves in process (canopy_api::served_openapi(ApiDoc::openapi())) and compares it with the snapshot (canopy_test_lib::openapi); with --update the tests write the snapshots (UPDATE_GOLDEN=1, refused in CI). The unit lane runs those tests too, so a contract change that forgets its snapshot fails before a push. canopy-web's composition API has the same test over canopy_web::openapi::served() and the snapshot web.json (#3671). It is not in SERVICES, so only the offline form and the unit lane check it.

migrate — devstack snapshots

cargo xtask migrate snapshot                                       # pg_dump every Canopy database into .devstack/snapshots/<timestamp>/
cargo xtask migrate list                                           # snapshots in chronological order
cargo xtask migrate rollback [--id <timestamp>] [--db <name>]...   # pg_restore the latest (or named) snapshot; --db restricts to listed databases

rollback restores every database in the snapshot’s manifest unless --db names a subset; a --db value not in the manifest aborts before any restore (#344). The deploy-time migration job and the KEK-rotation rewrap are not xtask verbs: they are canopy-manage migrate apply and canopy-manage rewrap-keks (canopy-manage Reference). The databases a snapshot covers are the DATABASES list in xtask/src/cmd/migrate.rs, documented in Deployment Guide. Dev and CI only — production rollback is PITR (Database Backup & Restore).

secrets — SOPS + age (ADR-017)

cargo xtask secrets init                    # dev age keypair; prints the public key for .sops.yaml
cargo xtask secrets edit                    # open secrets/dev.yaml in $EDITOR via sops
cargo xtask secrets decrypt                 # print secrets/dev.yaml as a flat dotenv stream
cargo xtask secrets add-recipient <age1…>   # append a recipient to .sops.yaml and re-encrypt the data key
cargo xtask secrets remove-recipient <age1…> # drop a recipient from .sops.yaml and re-encrypt the data key without it; unlisted key = no-op, last recipient = refused; then rotate every value
cargo xtask secrets generate-signing-key    # a fresh ECDSA P-256 PEM for a service's signing_key: entry

The workflow and where the age key lives: Configuration Reference.

perf

cargo xtask perf [--profile smoke|load|stress|soak|identity-tokens] [--service <name>] [--save-baseline <name>]   # k6; default smoke
cargo xtask perf chain-drain  [--shard-counts 2,8] [--workers 1,2] [--rates 300,600] [--warmup-secs 30] [--window-secs 120] [--reps 3] [--quick]
cargo xtask perf chain-verify [--rows 2000000] [--shards 2,8] [--families audit,fti] [--skip-seed] [--warmup-secs 30] [--window-secs 60] [--reps 2]
cargo xtask perf ephemeral-schema --service <svc> [--parallel 12] [--reps 3] [--warmup 1] [--reuse on|off] [--quick] [--max-slowdown 20.0] [--expect-no-waiters]
cargo xtask perf identity [--cells idle-probe,design,peak,saturation] [--reps 3] [--warmup-secs 30] [--window-secs 120] [--seed <n>] [--audit-rate <n>] [--replicas 2] [--replica-threads 2] [--db-rtt-ms 1] [--token-rate-limit-rpm 30000] [--db-max-connections 28] [--issuance-gather-ms 2] [--workers 3000] [--requests-per-minute 3] [--fanout 3] [--onward 0.3] [--renew-seconds 300] [--opens 5] [--logouts 2] [--system 1] [--peak 2] [--quick]

Every k6 profile takes its canopy-identity tokens through the devstack token broker (tests/k6/lib/identity.js), which the run brings up and removes after, whatever its outcome. A per-VU cache serves each token until 300 s past its iat or 60 s before its exp, whichever is sooner, and refreshes are counted in identity_token_refreshes. smoke, load, stress and soak call their targets (applications, enrollment, persons, rules) with canopy-eligibility’s system tokens: it holds a System or Both edge to each, and every route they call admits a system token. Their setup() mints each target’s token once, so a broker that cannot mint fails the run before its VUs start. --profile identity-tokens (ADR-049 Amendment 24), unlike the perf identity capacity harness, verifies the broker’s tokens and sends none to a service: over 60 s, 2 VUs verify canopy-eligibility’s system tokens and a delegation, refresh within the window, and refuse tampered, expired and future-dated tokens. The three harnesses are evidence tools run in release (cargo run --release -p xtask — perf <harness>): chain-drain measures chain-v2 sustained ingress (#1207), chain-verify the verifier’s catch-up and read-path independence (#1205), and ephemeral-schema parallel EphemeralSchema replay walls with pg_locks advisory-lock waiters (#1392) — --warmup rounds are discarded, --max-slowdown is the p95/serial ceiling, and --expect-no-waiters fails on any sqlx-key waiter (#1810). --reuse on|off (#1938) runs with or without the schema pool; every row also prints the p95 cleanup wall, the p95 complete round (constructor + cleanup) and the pool hits, the report sums them, and the harness sweeps its own run’s schemas and registry rows when it returns, errors or panics (a signal kill leaves them to the evidence-gated sweep).

perf identity is canopy-identity’s capacity harness (#2755, ADR-049 Amendment 10; the archived capacity-harness plan). The driver creates an ephemeral schema on the devstack security database, a disposable login holding exactly canopy_identity_issuer's privileges on it, a mock upstream, fresh client keys, and a run directory test-results/perf/identity/<UTC>/ holding the client registry and upstream profile. It then starts --replicas replicas, each this binary re-executed as the hidden perf identity-replica on a --replica-threads-worker runtime: the token routes, the JWKS and a harness-only GET /perf/report inside canopy-api’s outer stack, the issuer pool reached through its own DelayRelay adding --db-rtt-ms (0 to 10; ADR-049 Amendment 12: a timer thread releases each chunk, not tokio’s 1 ms-tick timer, which had tripled a stated 1 ms, and both sockets set TCP_NODELAY; the relay counts each chunk’s hold, read to write start, in 25 µs buckets to 7 ms per direction), its stderr in replica-<n>.log (as a tool, xtask installs no log subscriber, ADR-041 A, so canopy-security’s own log lines are not written). Each prints READY <addr> once its first key signs (about a minute: the key’s 60 s publish lead); the driver reads each report (Amendment 12: the settings the replica resolved, the issuer pool sampled once a second and every 10 ms with each sampler’s samples counted by connections in use, and every histogram and counter canopy-security recorded), closes each replica’s stdin, waits for it to drain, and drops the login and the schema whenever the run returns, error included (a panic or a signal kill leaves them behind).

Each repetition starts a fresh substrate and fleet, opens --workers sessions at 50 a second through the federation grant against the mock upstream, mints the onward subject tokens, and then drives the load model’s six streams open loop (#2756, ADR-049 Amendment 10): Poisson arrivals at each stream’s rate, seeded by --seed (printed when random), latency measured from each request’s scheduled start, at most 10 000 in flight. The senders are canopy-web’s three pods (127.0.1.1–3: session-form delegations through DelegationTokenSource, federation opens and renewals, revocations), canopy-eligibility’s two (127.0.2.1–2: onward delegations to canopy-applications) and canopy-portal’s two (127.0.3.1–2: client credentials), each bound to its address with IdentityHttpClient::bound_to, alternating between the replicas. A --warmup-secs warmup is sent but not counted; the --window-secs window is read at both edges: per stream the offered and achieved rates, p50, p95, p99 and max, and the status mix; per replica its CPU seconds per request (/proc/<pid>/stat) and its peak RSS (1 Hz); the generator’s lag and the host’s CPU; from the reports, per replica each sampler’s issuer-pool maximum, mean and samples at the ceiling in the window (G6 reads the 1 s samples), and across replicas the issuance-log writer’s commit, batch-rows and queue-wait buckets with their mean, p50 and p99, and its failures by cause; the security database’s commits, the cluster’s WAL bytes and checkpoints, and the issuance log’s bytes per row; and the expired jti rows. In idle-probe and design each replica also runs the audit probe (#2757, Amendment 10): its share of --audit-rate appends a second (default --workers / 60, one audited write per signed-in worker a minute), Poisson, through canopy-security’s store::insert_audit_event as the schema owner on a 10-connection pool, each timed from its schedule (0.1 ms buckets below 50 ms); G4 holds when the design’s append p99 stays within max(1.2 × the idle-probe’s, the idle-probe’s + 2 ms) and 99.5 % of its appends commit. idle-probe sends no token load and opens no sessions. idle-probe, design and peak run --reps repetitions on --replicas replicas; saturation runs one replica from 300 requests a second, 150 more a step, with the peak (the design rate × --peak) a step of its own among them, each a 60 s window, until session-form delegations' p99 passes 250 ms, errors pass 0.1 % or under 95 % is answered, and reports the knee, the CPU per request there, the bottleneck (replica CPU, the writer’s queue-wait p99 past 50 ms, the pool at its ceiling, or the commit p99 past 50 ms, the first that applies) and whether the peak’s step held with no 429. The gate table (G1–G6, each on the median of the repetitions; a cell is INVALID when any repetition breaks G7, which since Amendment 12 also requires each replica’s relay, over the window, to hold each direction’s median at least half --db-rtt-ms and its p95 at most half plus 0.25 ms, and since Amendment 13 its p99 at most half plus 1 ms, a relay under 100 chunks exempt; Amendment 13 also bounds the host’s IO pressure, /proc/pressure/io's full total grown by at most 2.25 % of the window (twice the largest healthy window’s share in the calibration runs, 1.127 %, rounded down; it started at 1 %, which the peak cell’s own load exceeded), not judged when unreadable. One predicate judges every repetition and every saturation step by all of G7’s conditions, and the row names each broken one; a saturation step failing any is INVALID and ends the cell. The record keeps each relay direction’s p99 and its holds at or past the 7 ms bucket limit (over_limit), and the window’s IO some and full shares) prints last, and test-results/perf/identity-<UTC>.json keeps the host, the commit, the seed, the flags, the settings (replicas, threads and db_rtt_ms, and as the replicas report them db_max_connections, token_rate_limit_rpm, issuance_gather_ms, writers and acquire_test; --db-max-connections, --token-rate-limit-rpm and --issuance-gather-ms default to the product’s defaults), every measurement and the table; a failed or invalid gate exits non-zero. Record on a host running nothing else: G7 reads the host’s CPU, not its disk, so a concurrent build’s disk contention shows only as the record’s writer commit p99. --quick runs one design repetition at a tenth of the rates, 100 workers, a 5 s warmup and a 15 s window, with no verdicts.

docs and plan-lint — plan lifecycle (ADR-013)

cargo xtask docs plan-lint                   # blocking: every non-archived plan uses the closed Status vocabulary
cargo xtask docs plan-archive [--dry-run]    # move fully-Done plans into plans/archive/
cargo xtask docs screenshots                 # Playwright capture into docs/modules/ROOT/assets/images/screenshots/ (#421)
cargo xtask plan-lint [--strict] [--done <PLAN>] [--allow-open <N>]...

plan-lint is the universal engine’s twin of docs plan-lint; --done <plan> runs the completion gate — referenced issues closed, cited paths exist (a short relative cite such as given/medicaid.ts passes when exactly one tracked file ends in it; several matches block and name the count and up to three of them — write the cite repo-relative; a cite that matches nothing and starts outside every tracked top-level entry, or that git ignores, names a runtime artifact or third-party source such as test-results/validate-report.json and is not judged, #2625), no TBD or "this MR", nav entry under Archive, size and review-log caps — with exit 0 / 3 (advisory) / 1 (blocking); --allow-open N names a standing tracker the plan may still reference; --strict makes advisory findings block. Run docs screenshots after cargo xtask dev start && cargo xtask seed. (Distinct from the advisory asciidoctor-lint tool.)

policy — traceability (ADR-011 / ADR-031)

cargo xtask policy audit [--jurisdiction <slug>] [--max-staleness-days 365] [--source all|jurisdiction|federal]
cargo xtask policy audit-literals [--explain] | audit-unwraps | audit-jurisdiction-literals | audit-completeness-reads
cargo xtask policy sync-cache [--jurisdiction georgia] [--pin]
cargo xtask policy drift [--jurisdiction georgia] [--no-sync]
cargo xtask policy action-coverage [--check-issues]
cargo xtask policy input-coverage
  • audit — citations.toml ↔ jurisdiction.toml per pack under target/config/ or fixtures/config/ (ADR-011) and the federal layer’s citations.toml ↔ the federal layer’s *.json (ADR-031 §1); --source selects the family. Blocking policy-audit / policy-audit-federal stages; CI adr-011-policy-audit, adr-031-federal-audit.

  • audit-literals / audit-unwraps — hardcoded policy values and silent numeric fallbacks outside params.rs; --explain prints each allowlist entry with its match count (#1769). audit-jurisdiction-literals — jurisdiction values outside the ruleset mechanism (#1226; allowlist compliance/jurisdiction-literal-allowlist.toml), among them a pack-qualified ruleset name, a quoted "<slug>-<program>-<name>" in production code, for every pack slug among the configuration layers and every program any pack’s [jurisdiction].enabled_programs lists (#3135). The phone numbers, state postal code and state name it searches for are read from the jurisdiction.toml of each pack config-sources.lock pins (#3265), so a newly pinned jurisdiction is covered with no code change. audit-completeness-reads — a canopy-reporting federal universe must go through CompletenessRead / UniversePager (#1249, ADR-001 Amendment 1 §B3).

  • sync-cache — clone or pull the PAMMS source repos into .policy-cache/ and write the sync manifest; --pin back-fills source_sha256 pins. drift — citations whose pinned source changed since verification (re-syncs first; --no-sync for offline; exit 1 on drift, never edits values). Blocking policy-drift stage (georgia); the CI job adr-031-policy-drift stays advisory.

  • action-coverage — the mandated-action catalogue (compliance/action-catalogue/*.toml) against the committed OpenAPI snapshots, offline; un-allowlisted gaps exit 1. Blocking in validate (action-coverage) and in CI (adr-031-action-coverage); --check-issues also queries GitLab for closed allowlist issues (off by default, #1375). input-coverage — the per-program determine-input requirements manifests are satisfiable and match the OpenAPI snapshots (ADR-034 §6); blocking input-coverage stage, CI adr-031-input-coverage advisory.

The static gates

cargo xtask rules check | lint-inputs | processing-days
cargo xtask compliance audit-data-tenancy | capabilities
cargo xtask scenarios audit [--online]
cargo xtask quality-budgets [--write-lock] [--workspace <path>]
cargo xtask test-lanes-lint [--static] [--verify-partition [--prove-equivalence]]
cargo xtask feature-builds
cargo xtask outbox-migrations [--check] [--write]
cargo xtask migrations-lint
cargo xtask typed-ids audit-path-uuid  |  cargo xtask http-clients audit-timeouts | audit-redirects | audit-builders  |  cargo xtask route-authz audit
cargo xtask web-paths audit
cargo xtask ssn-reads
cargo xtask secret-loads  |  cargo xtask db-pools  |  cargo xtask retention-deletes
cargo xtask mq-topology [--verbose]
cargo xtask call-graph [check | doc | census]
cargo xtask delegated-routes [check | doc]
cargo xtask vendor-check  |  cargo xtask secrets-yaml-lint  |  cargo xtask ci-config-lint  |  cargo xtask fn-shape-report
  • rules check compiles, via zen-engine, the JDM files of the federal layer and of every pack it finds under the layer roots (each directory with a jurisdiction.toml; any other directory fails the run), refuses a decision whose name is not its file stem (#3369), prints each override a layer’s manifest declares (#3372), holds each pack's Medicaid class codes to its [[medicaid.classes]] rows (#3420), then replays each fixture against every layer’s file of its ruleset’s name, or only the layers the fixture’s packs lists (#3134), and fails on a fixture whose expect block it cannot read: one that is not an object, one with a member other than output_fields and exact, or one with a member of the wrong type (#3601); lint-inputs flags, in the .json files of the same directories (#3136), numeric literals in JDM expressions that belong in context.thresholds. / input. (ADR-011); processing-days checks each jurisdiction’s [snap.issuance] and [shared.application_processing] clocks agree, per ruleset and per resolved ADR-012 YAML tier (#1759).

  • compliance audit-data-tenancy scans the workspace against compliance/data-tenancy-authorisation.toml (ADR-004); capabilities checks compliance/deployment-profile-capabilities.toml against the live compose service set (#418).

  • scenarios audit validates the scenario inventory’s schema and bindings and reports per-corpus coverage; every blocked_by entry must be a #NNN issue ref (#1667); --online also fails on a closed or unknown fenced issue (STALE-FENCE) via an authenticated glab.

  • quality-budgets counts the ten debt metrics against xtask/quality-budgets.lock; the flagless run is the gate (any OVER row fails, #1617) and --write-lock is the only sanctioned OVER path, justified in the MR (Coding Conventions (Canopy)).

  • test-lanes-lint bare or --static runs the filesystem checks (the URL-literal ban, #1381; the infra_tests classification walk; and the pack-dates check, #2523: no UTC date (Utc::now().date_naive(), the clock::today path) and no literal timezone (chrono_tz::America::New_York, Tz::UTC, chrono_tz::UTC, America::New_York, "America/New_York") and no fixed UTC time or offset (and_utc, Utc.from_utc_datetime / from_local_datetime / with_ymd_and_hms, and_local_timezone(Utc), from_naive_utc_and_offset(…, Utc), FixedOffset::west_opt / east_opt; a fixed instant written as a string or built from epoch seconds is not refused) in services/*/tests/ or crates/canopy-test-lib/src/, matched on tokens so comments never count; a genuine use takes an entry in compliance/test-utc-today-allowlist.toml with a reason and the exact count of sites it covers, and an entry covering more or fewer fails the check; and the loud-miss check, #2533: no token mint, database or broker connect or seed write in a live-test source whose miss is swallowed instead of failing the test or being reported through skip_or_panic, testing); --verify-partition needs built test binaries and set-verifies the lane partition (#1377) — validate runs it as its own lane-partition stage after nextest-build. Its listings read the built binaries through nextest’s reuse-build metadata (--cargo-metadata + --binaries-metadata, captured once per invocation into a temp dir that is removed on exit) rather than through cargo’s build phase, so they never wait on the build-directory lock (#1936); --prove-equivalence also runs every listing the plain way and fails unless each (binary, test) set is identical.

  • feature-builds has no flags. Every lane builds the whole workspace with default features plus lanes::BATTERY_FEATURES, and cargo unifies a package’s features within one invocation, so a crate with a default feature switched off, or with only its defaults when a lane feature or another member’s dependency declaration switches more on, is never compiled there (#2249, #2512). It first reads every workspace manifest and fails on a feature that no lane, dependency declaration or lanes::FEATURE_BUILDS entry switches on (a feature that only forwards to built ones, and that its own package never gates code on, counts as built), on a package with default features that no entry builds switched off, on a package whose default build every lane overrides and no entry compiles, and on a stale entry. What an entry compiles a package with is worked out the way cargo unifies it, dependency declarations of everything the invocation compiles included, so an entry that a dev-dependency quietly undoes is caught. Then, per entry, it runs clippy with -D warnings over all targets in the test and the dev profile, or, for an entry whose own dev-dependencies would switch the combination back, over the libraries and binaries in the dev profile; and cargo doc --no-deps with broken intra-doc links denied. An entry may name a target triple and dependency features that target needs (target, target_features); its invocations then carry --target and those features, and coverage never counts it redundant with a lane (#2527). The builds today: canopy-common without otel; canopy-mq without otel (library only: its dev-dependency on canopy-test-lib restores the defaults); canopy-common and canopy-api with test-clock and test-fault (the devstack build); canopy-verification without noop-adapters (its real-adapter production build); and the default builds lanes override: canopy-api without rate-limit-redis and canopy-chain without vector-gen (library only), canopy-store without test-fixtures, canopy-signing without test-helpers, and canopy-portal’s default build, the wasm32 client, for wasm32-unknown-unknown with dioxus/web (binary only: its dev-dependencies are native-only; #2527). A combination deliberately left unbuilt is a lanes::UNSUPPORTED_FEATURE_BUILDS entry, a tracked deferral whose reason must cite the #N issue that owns the work: canopy-enrollment without noop-adapters, which stops at a compile_error! until the real EBT adapter ships (#1553).

  • outbox-migrations checks parity by default (--check is accepted for self-documenting scripts); --write regenerates each service’s family migrations from the canonical sources (ADR-039). migrations-lint has no flags; its three checks are the contract in migrations.adoc#migration-gates.

  • typed-ids, http-clients and route-authz expose the audit subcommands named above over services/ + crates/. The three http-clients audits also scan tools/ and xtask/, and read the token stream, so a site in a macro body counts and one in a comment or a string does not. A builder (Client::builder(), ClientBuilder::new(), ClientBuilder::default()) is judged by the .method(..) calls straight after it, up to .build(): a setting made by a helper, a later statement or a request is not seen. audit-timeouts (#2536) requires connect_timeout and timeout; read_timeout bounds each read and resets after every successful one, so a client stating it without timeout (a streamed body, where a total would cut the stream) needs an allowlist entry giving that reason; audit-redirects (#2534) requires a .redirect(..), and every .redirect(..) call, wherever it sits, to name Policy::none(). Client::new(), Client::default() and the free helpers reqwest::get / reqwest::blocking::get (a call, a plain or braced import, or a call through an imported blocking module) state nothing and fail both. A site that cannot comply takes an entry in compliance/client-timeout-allowlist.toml or compliance/client-redirect-allowlist.toml with a written reason and a count, the exact number of sites it covers (1 when omitted); a blank context fails the load, and an entry covering more or fewer sites than its count fails the audit. audit-builders (#2584) reports every client constructor outside crates/canopy-common/src/http.rs and canopy-test-lib: a client comes from data_path_client(), build_data_path_client(connect, total), data_path_client_builder(connect, total) or blocking_data_path_client_builder(connect, total), and one those cannot make takes an entry in compliance/client-builder-allowlist.toml, with the same fields. secret-loads has no flags; a genuinely acceptable site takes an entry with a written reason in compliance/secret-loads-allowlist.toml. db-pools has no flags and no allowlist: a pool that must differ from canopy_db::pool_options() gets its own builder in canopy-db. retention-deletes has no flags; a delete that may stay one statement takes an entry in compliance/retention-delete-allowlist.toml naming a substring of its statement, with a written reason and a count. mq-topology --verbose prints the full publisher / subscriber map per routing key; the allowlist is xtask/mq-topology-allow.toml.

  • call-graph check (#2644), the bare command, fails on an observed pair the compiled graph (canopy_auth::identity_policy::edges()) lacks, an observed sender that is no compiled client, a compiled pair no peer setting names, and any drift, kinds included, between the compiled graph and the "Compiled call graph" table in authorization-inventory.adoc. call-graph doc prints that table for pasting; call-graph census (#2642) prints the observed pairs, each with its settings, under the naming convention in Coding Conventions.

  • delegated-routes check (#2802), the bare command, fails on any difference between the compiled delegated-route rows (canopy_auth::delegated_routes(), the constants in crates/canopy-auth/src/delegated.rs) and the "Delegated routes (canopy-identity)" table in authorization-inventory.adoc, and on a listed route its service does not register; it lists, never failing, each registration whose path it could not resolve. delegated-routes doc prints that table for pasting.

  • web-paths audit (#2539) holds what canopy-web’s types cannot. Its clients take only an UpstreamPath, so a formatted String never compiles as an upstream path; Redirect::to takes any &str, and a raw HTTP client any URL. Over canopy-web’s production code (services/canopy-web/src, test code skipped by the shared resolver, typed_path.rs exempt), reading the token stream, it fails: a Redirect::{to,see_other,temporary,permanent} whose argument is not one string literal; a LOCATION constant or a Location / HX-Redirect / HX-Location / HX-Push-Url / HX-Replace-Url literal set with a value; a format!-family macro holding /v1/ or /v1?, or formatting a …paths:: constant; a .replace("{…}", ..) placeholder fill; a format! / write! literal formatting a query value (?key={…} / &key={…}), an href or hx-get URL as much as an upstream one; a .leak() (a runtime String passed off as the &'static str source text the typed paths trust); a direct call of the macros' UpstreamPath::format / LocalTarget::format targets; a Text(..) whose argument calls .to_string() or format! or names a posted form field (form.…); and an upstream_path! or template .bind("…", ..) value calling .into_inner(), .as_uuid() or Uuid::from(..) or taking a tuple field .0 (#2543: a typed id turned back into free text or a raw Uuid, around a typed segment and around the bound_resource::Bound ids). These two read only the expression inside the path or the Text: a value built in an earlier statement, or an untyped String path parameter, passes. A site that cannot comply takes an entry in compliance/web-paths-allowlist.toml with a written reason and a count, on the same rules as the http-clients allowlists. A path segment formatted into an href (/cases/{household_id}) is not flagged: case-detail renderers carry the boundary-parsed household as its canonical &str, which the token stream cannot tell from raw text.

  • ssn-reads (#2983) refuses a new canopy-persons read that opens an SSN. canopy-persons opens the sealed SSN, and stages a Pub-1075 ssn.accessed, on GET /v1/persons/{id} and on a projection naming person_ssn (#2705, #2986). Over production code under services/, crates/ and tools/ (test code skipped by the shared resolver; canopy-persons and canopy-contracts-persons, the reads' homes, exempt), reading the token stream with doc attributes skipped, it flags: a get_person / get_person_info call; GET_PERSON outside its definition; a string literal naming exactly /v1/persons/{…} (a sub-resource such as /core or /income is not one); BatchGetField::PersonSsn; and a literal holding the word person_ssn. A path assembled from pieces is not seen, and the steward export, which no code calls, is not looked for. A site that shows or matches the SSN, a client method’s own request (each call to it is flagged on its own), a site that is no read at all (the PUT and DELETE share the path), and canopy-test-lib take an entry in compliance/ssn-reads-allowlist.toml with a written reason and a count, under the same counted-allowlist rules as web-paths (xtask/src/counted_allowlist.rs).

neutrality-lint — jurisdiction neutrality

cargo xtask neutrality-lint                    # the gate: non-zero on any un-allowlisted finding, regression, ratchet or stale entry
cargo xtask neutrality-lint --explain          # per-entry hit tally (the audit-literals --explain shape)
cargo xtask neutrality-lint --print-baseline   # [[allow]] skeleton for the UNABSORBED findings, instead of failing

The rule, stated once: packs declare vocabularies and values; shared Rust validates against the pack; a CHECK never pins a pack vocabulary; a template never names a state.

The blocking neutrality stage runs it in-process immediately after jurisdiction-literals (#2208), pure over the tree plus compliance/neutrality-gate.toml — no network, no database, no git. A walk or read error, an unparsable Rust file, an unsupported CHECK over a declared pack-vocabulary column or an ALTER TABLE … RENAME TO with live tracked constraints fails the run rather than shrinking it. The georgia layer is never scanned, nor are xtask, tools, design and the rest of target (the fetched federal layer under target/config/ is); a path under [scope].exclude_globs is removed from every detector. Each finding prints as ✗ path:line [detector] — excerpt; a clean run ends ✓ No un-allowlisted findings (A allowlisted across E entries).

Identity matching is one shared rule for every detector: the [tokens].prose regexes (PAMMS, Chart [0-9], the lettered \bChart [A-Z][0-9]*\b that takes Chart B2 but not Chart Data, \bDFCS\b, \bOSAH\b, Senior SNAP, …) over the non-comment text, plus the identifier rule over every [A-Za-z0-9_]+ run — split on _ and on a lower-case-or-digit → upper-case boundary, a run hits when any lower-cased segment equals a stem (georgia, dfcs, pathways, p4hb, tfsp, …) or the lower-cased whole run contains a compound stem (peachcare, pamms, seniorsnap, …). tfsp_signature, GrgPayment, P4hbFp and "georgia-snap-…" hit; msp_eligible (Medicare Savings Program), crispness and snapshot do not.

The eight detectors

Comments never produce a finding in any language, with one deliberate exception: rust-vocab reads the doc attributes on a vocabulary declaration, because that citation is what marks the vocabulary as policy. test-canon is the one detector that reads test code; every other detector skips it.

Detector Scans A finding is Deliberately excluded

rust-identity

Non-test Rust under services//src and crates//src: comments masked, string and char literal interiors kept

Any line with an identity hit — an identifier or a rendered string

Comments; crates/canopy-test-lib; test-only code, as the shared resolver (xtask/src/test_scope.rs, #2474) answers it for every gate: a file a test-only declaration loads ([cfg(test)] mod x;, or any mod in a test-only file) or that an inner test-only ![cfg(…)] gates, and in a production file every item under a #[test]-pathed attribute or a test-only cfg. A cfg is test-only when no non-test build satisfies it — test, all(test, …), an any(…) whose every arm is — so any(test, feature = "x") code is production. Inside src/ the declaration decides, never the name: a production mod wire_tests; or mod tests; directory is scanned

rust-vocab

The same non-test Rust, parsed with syn: every enum, and every const / static typed as an array or slice of &str

The declaration line when its doc attributes match a [tokens].manual_citation regex, or any variant ident, variant doc or element literal has an identity hit; the excerpt is enum Name members=N digest=… (or const NAME …)

The same test exclusions, every test-only item included; a CFR-only doc comment is not a finding; a parse failure fails the run naming the path

sql-check

Every .sql under services//migrations and services//outbox-migrations, per service in version order, comments masked, read as a constraint lifecycle keyed (table, name)

A CHECK (col IN (…)), col = ANY (ARRAY[…]) or, on an array column, col <@ ARRAY[…] constraint still live at the end of the sequence when (a) two or more of its quoted tokens sit in the pack token universe — every string-array element and array-of-tables code across every pack’s jurisdiction.toml, minus the Program slugs — or (b) any token has an identity hit, or (c) its (table, column) is declared in [[pack_vocabulary_columns]]; reported at the defining file:line with the excerpt t.c CHECK tokens=N digest=…

SQL comments; numeric IN (1, 2) lists; program IN ('snap', 'tanf'); a constraint retired by a later DROP CONSTRAINT, DROP TABLE or DROP COLUMN (the ADR-016 forward-only drain path)

copy-identity

Every .html under services/canopy-web/templates, every .ftl under a crate’s locales/ (the Fluent bundles an image ships) and every .js / .css under a crate’s static/ or assets/ (#2622)

Any remaining line with an identity hit; string contents are kept. Georgia is also a typeface, so a stylesheet’s font-family: Georgia is a finding too: it names a font, not a jurisdiction, and goes to the allowlist with that reason

{# … } and <!-- … -→ regions; a Fluent comment line (, , in the first column — an indented line continues a message and is copy); JS // and /* … / and CSS / … */ outside strings (CSS has no // comment); every vendor/ directory (third-party code pinned by digest in vendor.toml, not copy canopy writes)

pack-identity

Every .toml, .json, .typ and .txt under every configuration layer but Georgia’s: the fetched federal layer and every layer under fixtures/config/ (default, test-min, test-max, test-federal, notices-neutral)

Content: any line with an identity hit after per-language comment masking. Structure: a citations.toml table carrying state_citation or an authority outside canopy_policy::citation::DEFAULT_RULESET_AUTHORITIES (fixture is in that list); under fixtures/config/default, a .json whose top-level "name" starts georgia-

The georgia layer; .policy-cache/; TOML # outside single-, double- and triple-quoted strings and Typst // / /* … */ outside strings (.json and .txt have no comment syntax); the value of a notes / note key, its multi-line continuation included

test-canon

Test code only: the test-only files and regions above plus every .rs under the package-level services//tests and crates//tests

(a) An assert! / assert_eq! / assert_ne! closing on its line whose subject contains .contains(" followed by PAMMS, Georgia, PeachCare or Pathways, with positive polarity (assert!(x), assert_eq!(x, true), assert_ne!(x, false)); (b) in crates/canopy-contracts-* and crates/canopy-reference tests only, a string literal containing rulesets/georgia/ or a line with both join( and "georgia"

Negative polarity (assert!(!x), assert_eq!(x, false), assert_ne!(x, true)) and any other second argument; an assertion that does not close on its line; for (b), canopy-policy and canopy-composition (they load every pack by design) and services/** tests

metadata-identity

Build-time metadata, whose values a build bakes into a shipped artifact (#2622): every Dioxus.toml (dx’s release index.html <title>), Cargo.toml, Dockerfile / Dockerfile. and package.json at the top level of the workspace root and of each services/ and crates/* directory, the root .cargo/config.toml, and every Plugin.toml under a crate’s src/ (the ADR-021 manifests #[canopy_plugin] compiles in, display names included)

Any line with an identity hit after comment masking

TOML outside strings; a Dockerfile line whose first non-blank character is (package.json has no comment syntax); nested copies outside src/, so a test-fixture Plugin.toml; crates/canopy-test-lib

config-jurisdiction

Every file under config/ in a format the ADR-012 loader reads (.yaml, .yml, .toml, .json, .json5, .ini, .ron), parsed with the loader’s own config crate (#2627)

A top-level config_source key, or the retired jurisdiction, whatever its value: a shipped tier that names a configuration source boots a deployment that sets none on that jurisdiction (Configuration Reference); reported at the key’s line. A file that does not parse fails the run

The development overlay (dev.<ext>), which is read only for a development CANOPY_ENV and names the devstack’s configuration source; a nested config_source or jurisdiction key; a comment

The config file: compliance/neutrality-gate.toml

[scope]
exclude_globs = []            # per-jurisdiction extension crates (#2216), e.g. "crates/canopy-ext-*/**"

[tokens]                      # identity and citation patterns: prose regexes, identifier stems, manual citations
prose = [...]
stems = [...]
compound_stems = [...]
manual_citation = [...]

[[pack_vocabulary_columns]]   # a live CHECK list on this column is always a finding
table = "snap_certifications"
column = "certification_type"
pack_key = "snap.certification.categories"   # documentary: the loader never resolves it
issue = "#2209"

[[allow]]
detector = "rust-vocab"       # rust-identity | rust-vocab | sql-check | copy-identity | pack-identity | test-canon
file = "crates/canopy-contracts-renewals/src/certifications.rs"
line_contains = "digest=3f9a1c0b7e2d" # optional, non-empty; rust-vocab and sql-check entries pin the digest
count = 1                     # exact number of findings this entry absorbs
issue = "#2209"               # tracked form; OR kind = "by-design" + adr = "ADR-NNN" (page must exist)
reason = "closed CertificationType enum (Chart 3105.1); #2209 makes the vocabulary pack data"

A file that breaks any of these is a config error, never a pass:

  • every [tokens] regex compiles; detector is one of the six names;

  • count ≥ 1; line_contains, when present, is non-empty; reason is non-empty;

  • a tracked entry carries issue = "#N" and no adr; a by-design entry carries kind = "by-design" and an adr whose ADR page exists, and no issue;

  • a (detector, file) pair carries either exactly one entry without line_contains or one or more entries with distinct line_contains — never both;

  • file is repo-relative with forward slashes;

  • every [[pack_vocabulary_columns]] row carries table, column and issue (pack_key is optional and documentary).

Federal reference tables that define Georgia (the canopy-reference FIPS state rows and the counties keyed by FIPS) and a CHECK on a federal enum that still flags take the by-design form with adr = "ADR-006"; every other entry names the family issue that will drain it.

The exact count rule

An entry matches a finding when detector and file are equal and either the entry has no line_contains or line_contains is a substring of the finding’s excerpt; a finding is absorbed by at most one entry, a pair’s entries tried in file order. Every entry must absorb exactly count findings, and every declaration must still describe a live constraint:

  • more findings than count → regression (N found, count = M);

  • fewer but non-zero → ratchet: lower count to N;

  • zero → stale allowlist entry — the site is fixed; delete the entry;

  • a [[pack_vocabulary_columns]] row matching no live constraint → stale pack-vocabulary declaration.

The file therefore neither grows nor drains silently: a family fix that removes a site also removes or lowers its entry, and a new site in an allowlisted file is a regression, not an absorbed one. The gate exits non-zero on any unabsorbed finding, regression, ratchet, stale entry, stale declaration, unsupported CHECK or config error.

Digests. A rust-vocab excerpt carries digest= — the first 12 hex of SHA-256 over the declaration’s sorted member idents (or element literals); a sql-check excerpt carries the same over the constraint’s sorted token list. An entry for either pins line_contains = "digest=…", so adding a variant or a token changes the digest, leaves the old entry stale and surfaces the new digest un-allowlisted.

--print-baseline. Instead of failing, prints a TOML skeleton of [[allow]] entries for the UNABSORBED findings only, grouped by (detector, file) with the exact count, a line_contains = "digest=…" per rust-vocab / sql-check finding and empty issue and reason — the implementer fills them in; the loader rejects empties, so the skeleton cannot be committed as-is.

What the gate does not promise. Its promise is no new line, declaration member, constraint token or pack file. Growth inside an already-flagged line — a second identity token on a line an entry already absorbs — is invisible to it, and numeric policy values stay with the ADR-011 sweeps (policy audit-literals, audit-unwraps, rules lint-inputs). The helpline detector of policy audit-jurisdiction-literals (#1226) spans test code and stays a separate gate.

Extension crates. The gate is scoped to the shared tree; a per-jurisdiction extension crate may name its state (#2216). [scope].exclude_globs — repo-relative globs supporting , ? and * — removes a path from every detector; it ships empty.

determination-status-lint — typed determination status (#628)

cargo xtask determination-status-lint                   # the gate: non-zero on any violation below
cargo xtask determination-status-lint --print-baseline  # [[exempt]] skeleton for the UNLISTED discovered fields, instead of failing

A determination’s status is the producing program’s signed verdict, canopy_reference::DeterminationStatus. The blocking determination-status stage runs the gate in-process right after neutrality, pure over the tree plus compliance/determination-status-fields.toml (no network, database or git). It scans non-test Rust under services//src, crates//src and tools/*/src with syn (test-only code, as the shared resolver xtask/src/test_scope.rs names it — test-only files, and test-only items, fields and fns; any(test, feature = "x") code is production — is skipped), and replays each service’s migrations with the constraint lifecycle neutrality-lint uses (xtask/src/cmd/migration_checks.rs). The config has three tables:

  • [[field]] — file, item (a struct or Enum::Variant), field, optional type (default DeterminationStatus; another type names itself: the approved/denied projections SuccessorDecision and RecertVerdict, or ProgramOutcome, the in-flight outcome superset — the verdicts plus pending_verification / input_unsatisfiable). After peeling &, Option<…> and Vec<…>, the field’s type must be a path ending in type. An entry whose file, item or field no longer resolves is stale.

  • [[column]] — service (its services/ directory), table, column, tokens: "all" (the DeterminationStatus wire set, read from canopy-reference) or an explicit subset of it. The replay must leave exactly one live, non-NOT IN CHECK list on the column, over exactly that set; a CHECK over a listed column in a form the replay cannot read fails the run.

  • [[exempt]] — file, item, field of a discovered field that is not a verdict store, with the neutrality-lint owner rule (issue = "#N", or kind = "by-design" + an adr whose page exists), a non-empty reason and the exact count of fields it absorbs.

Discovery. A named field of a struct or enum variant whose name matches (^|_)(status|verdict|decision)$, whose type is stringly (String, &str, Cow<str>, or an Option / Vec of one) and which sits beside determination_id, benefit_amount, *_amount or *_benefit_cents must be a [[field]] (which fails until the field is typed) or an [[exempt]]. The inventory, not the heuristic, is authoritative: a verdict field without such a sibling (the T-MSIS eligibility_status fields, for one) is listed explicitly.

Each violation prints as ✗ location [check] — message, the check one of field-type, stale-field, column, unlisted or exempt (regression, ratchet or stale, as in neutrality-lint's exact count rule).

Operator and maintenance commands

cargo xtask fault-preflight [--up] [--required]
cargo xtask identity conformance --idp kanidm|keycloak|zitadel [--keep] [--cargo-profile <PROFILE>]
cargo xtask identity matrix [--all] [--e2e] [--cargo-profile <PROFILE>]
cargo xtask board [--json] [--set-baseline]
cargo xtask target-report [--prune <SUBTREE>]...
  • identity conformance --idp <idp> stands up that upstream’s opt-in conformance graph (profile idp-kanidm, idp-keycloak or idp-zitadel) from nothing (fresh TLS, empty tmpfs database), provisions its seeded persons, writes their credentials to .devstack/idp/<idp>-conformance.json (mode 0600) without printing a secret, runs that upstream’s conformance suite (JUnit in test-results/integration/idp-conformance.xml), and removes the graph, pass or fail, unless --keep. It never touches the devstack’s own upstream. With CANOPY_PREBUILT_KANIDM_IMAGE set (CI), Kanidm’s run pulls that image instead of building it. Under CANOPY_CI=true it joins the job container to the compose network and reaches the upstream by service name. With --cargo-profile <p> the suite runs from that profile's build of the battery (--workspace with BATTERY_FEATURES) and is not linted again, so it compiles nothing after a build in that profile; the car passes car (#3358). The steps: Local Development › The conformance server and Keycloak’s and ZITADEL’s graphs.

  • identity matrix runs the three suites, each from a fresh graph, when the push spec on stdin changes an identity path (git's pre-push form, piped in by hand); --all runs them whatever the push (the car's last line on a pipeline with no merge request), and --e2e adds Playwright's identity-plane project on a devstack brought up on each upstream in turn. Every suite runs, pass or fail; each one’s JUnit is kept as idp-conformance-<idp>.xml (Local Development › the identity matrix).

  • canopy-identity’s deploy gate is not an xtask verb: it is canopy-manage identity check (canopy-manage Reference).

  • board reads the GitLab milestones for the public project (--set-baseline stores the counts in .devstack/board-baseline.json for the burn delta); target-report reports target/ subtree sizes and prunes the named ones.

  • Developer Guide — tech stack, repository map, the commit and push gates, common tasks.

  • Testing — the lanes, CANOPY_TEST_INFRA, what git push runs, E2E.

  • Local Development — first run and the devstack lifecycle.

Edit this page · default