Configuration Reference

All CRAIG services are configured via environment variables using the pattern CRAIG_<SERVICE><FIELD> (double underscore separator). The shared ServiceSettings loader parses these with try_parsing(true), so numeric and boolean values are converted from strings before serde sees them (its #[serde(flatten)] per-service extensions depend on it). craig-web, craig-portal, craig-intake, craig-intake-keyring and the object-store (CRAIG_STORE) loader keep every value a string and let each typed field parse its own, so a digits-only secret stays byte-exact (#1868, #2265, #2266, #2267). (Exception: craig-seed reads its variables via raw std::env::var with bespoke fail-closed handling — see its section.)

Audited 2026-08-08 (#1050): every row below was verified against the loading code (ServiceSettings, per-service config structs, bootstrap, raw-env sites). Future drift is measured from this date.

Deployment-Global Variables (no service prefix)

Read by multiple services (or the whole fleet) under a bare CRAIG_/standard name — set these once per deployment.

A deployment’s jurisdiction and its reference data come from CRAIG_CONFIG_SOURCE alone: the jurisdiction layer’s manifest names the jurisdiction, and its bundle/ directory carries the reference data (the bundle/ file map). CRAIGACTIVE_STATE_BUNDLES and CRAIG_<SVC>JURISDICTION are not read: one left set in a deployment is ignored. The jurisdiction prefixes rule-set names ({jurisdiction}-{function}) and selects the business calendar: business dates resolve through craig_common::BusinessClock on the zone the bundle’s settings.toml declares (business_timezone), and a jurisdiction that declares none runs on UTC.

Variable Type Default Required Description

CRAIG_PEER_JWKS_JSON / CRAIG_PEER_JWKS_JSON_FILE

String (JSON array)

empty registry

Effectively yes for S2S actor flows

Plan E peer-verifier registry: [{iss, kid, jwk}] public keys for verifying inbound X-Craig-Actor JWTs. Empty ⇒ every inbound actor header fail-closes (401). File form for secret mounts; inline wins when both set

CRAIGREQUEST_CLAIMSWINDOW_DAYS

u32

30

No

ADR-062 §B: request_claims prune horizon, deliberately fleet-wide (no per-service leg). 0 disables the pruner (registered Disabled in /healthz); an UNPARSEABLE value also disables it with an error log — never guesses

CRAIGBACKGROUND_JOBSWINDOW_DAYS

u32

31

No

#1933 (plan background-jobs D1): the background_jobs prune horizon, fleet-wide like the claims knob and read the same way (raw env in craig-api; 0 disables — background-jobs-retention registers Disabled in /healthz; an UNPARSEABLE value disables with an error log). CLAIM-JOINED: the hourly pruner deletes only TERMINAL jobs (succeeded / failed) older than the window whose request_claims row no longer exists, so a replay can never outlive its job; keep it ≥ CRAIGREQUEST_CLAIMSWINDOW_DAYS + 1 (the default is exactly that). Consumed by every service that adopts a job kind (craig-placement at U1 / #1933, craig-security at U2 / #1934, craig-rules at U3 / #1935, craig-financial at U5 / #1937, craig-reporting at U4 / #1936)

CRAIG_IDENTITY_SERVICE_ROLE_PREFIX

String

service:

No

Role prefix marking service-principal callers in claims (service:craig-web etc.; ADR-028). Read per call, works across any OIDC backend emitting a roles-style claim

CRAIG_IDENTITY_ROLES_CLAIM_PATH

String (dot-separated claim names)

realm_access.roles

No

#2684: where tokens carry their roles (Okta/authentik groups, Entra roles, ZITADEL urn:zitadel:iam:org:project:roles); the per-IdP table and the value rules are IdP Integration § The roles claim per IdP. Read at boot by every service, craig-web and craig-portal: set ONE value fleet-wide. A malformed path (empty, an empty segment, /-pointer syntax, a whitespace-padded or control-character segment, a leading $) refuses boot; a path naming the wrong claim yields zero roles. Actor tokens always use the default

CRAIG_FIELD_ENCRYPTION_KEY

String

 — 

cases required mode

32-byte base64 field key shared by craig-cases + craig-seed — see the craig-cases extras row and the craig-seed section for the (deliberately different) failure semantics. Ciphertext envelope format v2 since #1007 (the storage context is bound as AAD): a keyed database seeded under v1 must reseed. Also read by the craig-cases rewrite-scheme process mode (#1399 U2b — the offline field-scheme rewrite, deployment guide § Field-scheme rewrite), which loads it through the SAME loader as serving BEFORE any connection and additionally needs the OWNER DSN under CRAIG_CASESDATABASE_URL (the migrate gate’s deploy-scoped DSN, a direct connection) and CRAIG_CASESENCRYPTION_MODE=required (unset = required; anything else refuses)

CRAIG_REPORTING_FIELD_ENCRYPTION_KEY

String

 — 

reporting required mode

#2138 (plan afcars-records-and-generate U1): 32-byte base64 column key (and, since #2177, the AFCARS export’s whole-file seal key) for craig-reporting ONLY — never the cases key (CRAIG_FIELD_ENCRYPTION_KEY), and never shared with craig-seed. Boot verifies it against craig_reporting’s crypto_key_lineage table (verify-only: boot never writes the row; the first committed afcars_generate (#2143) or the first keyed AFCARS export (#2177), whichever comes first, writes it). See the craig-reporting extras rows for the required / optional semantics; production delivery is the orchestrator secret store (ADR-048 § Amendment — #949), the devstack’s is the sops+age store (ADR-064 § Amendment — #2138)

CRAIG_CONFIG_SOURCE

String (comma-separated name=source list)

 — 

Yes: every service that loads configuration, and craig-seed

ADR-087 (#2952): the configuration layers, lowest precedence first — federal=git+https://host/craig-config-federal.git#tag=federal-2026.11.0, georgia=git+ssh://host/craig-config-georgia.git#branch=ga/production, local=path:/srv/config. A source is git+https://, git+ssh:// (each tracking exactly one #branch= or #tag=, a plain ref name, plus optionally &verify=head, tag or tag-and-head — head the default for a branch, tag for a tag, a tag mode on a branch refused — and &sha=<40-hex commit>, the pin craig-config-fetch resolve writes; #2953) or a local path:; layer names are lowercase slugs, unique. A file resolves to the highest-precedence layer holding it, a directory listing is the union of the layers' files, and nothing is merged. Every layer’s directory must exist: a missing one (or a file in its place) refuses boot naming the layer and the directory. The per-layer manifests every layer carries at its root (craig-config.toml, policy-source.toml, citations.toml, citation-exceptions.toml; craig_config::PER_LAYER_FILES) are disjoint, not overrides, so the highest-layer-wins resolver refuses them and leaves them out of a listing; a reader that needs them takes every layer’s copy, in layer order, from ConfigSnapshot::read_per_layer. A URL carrying userinfo (user@, user:token@, an SSH user included) refuses boot — credentials come from the git credential environment (GIT_ASKPASS, a mounted deploy key, User in ssh config) — and no refusal echoes the URL. Each layer needs a craig-config.toml (schema = 1, layer = "base" | "jurisdiction" | "deployment", jurisdiction = "<j>" on a jurisdiction layer); an unknown schema major refuses boot. The highest jurisdiction layer’s manifest names the deployment’s jurisdiction, the only place it is named; a source list with no jurisdiction layer refuses boot (ConfigError::NoJurisdiction). The jurisdiction layer’s bundle/ directory carries the jurisdiction’s reference data, loaded and validated at boot (ConfigBundle, the bundle/ file map); a refused bundle file refuses boot naming the layer, the file and the key. A git+ source is read from the tree craig-config-fetch published under CRAIG_CONFIG_ROOT (#2955): <root>/<name>/current is resolved once at boot to its commit-named directory and stamped with that SHA; a missing current, a missing status.json, a last sync that failed (ok: false), a current that names no commit, or one at a commit other than the source’s sha= pin refuses boot. Required: craig-rules, craig-cases (its migration gate and its rewrite-scheme mode too), craig-placement, craig-exchange, craig-financial, craig-reporting, craig-security, craig-composition, craig-intake, craig-web and craig-seed each build one snapshot at boot, and unset or blank refuses start (ConfigError::SourceUnset). The stateful services report the snapshot on GET /version. craig-portal, craig-intake-keyring, the craig-security issuer process mode, the other services' migrate gates and the mock server load no configuration. For craig-rules the layers also supply the rule sets unless CRAIG_RULES__RULE_SET_AUTHORITY is api (see the craig-rules rows of § Service-Specific Extras): at boot, before it serves, craig-rules reconciles its rule sets to the layers' top-level *.json (an import then a promote snapshot per changed rule set, a delete snapshot and deactivation for one no layer supplies, each stamped with the layers' SHAs) and answers its write routes with 409 config-managed.

CRAIG_CONFIG_ALLOW_UNVERIFIED

true | false

false

No

ADR-087 (#2952): the working-copy escape hatch. An explicit CRAIG_CONFIG_SOURCE made only of path: sources is refused unless this is true; with any git+ source in the list, true refuses boot (the flag can never weaken verification of a git layer). Any other value refuses boot. Not consulted when CRAIG_CONFIG_SOURCE is unset (the in-repo fallback is unverified by construction). GET /version reports verified: false whenever a path: layer is loaded

CRAIG_CONFIG_ROOT

Path

 — 

With a git+ source

ADR-087 (#2955): where craig-config-fetch published the git+ layers (<root>/<name>/current → <name>/<sha>/, beside <name>/status.json); the service reads it, never writes it. The devstack mounts the fetcher’s craig-config volume read-only at /config and sets /config. Unset with a git+ source in CRAIG_CONFIG_SOURCE refuses boot

RUST_LOG

String

 — 

No

Standard tracing env filter. When set AND parseable it fully OVERRIDES the per-service LOG_LEVEL; also honored by the <binary> migrate gate’s logging-only telemetry

OTEL_EXPORTER_OTLP_ENDPOINT

String

 — 

No

When set enables OTLP trace export + Prometheus metrics with the service name as the OTel resource; unset ⇒ JSON logging only. A credential header (OTEL_EXPORTER_OTLP_HEADERS) needs an https:// endpoint (TLS verified against the OS trust store, #3022) or a trusted local hop such as a sidecar collector: any other scheme sends it in plaintext

OTEL_EXPORTER_OTLP_HEADERS

String (comma-separated key=value, percent-encoded values)

 — 

No

Auth/metadata headers (e.g. Authorization=Bearer%20<token>) attached to every outbound OTLP gRPC call. Handled entirely by the opentelemetry-otlp crate inside SpanExporter::builder().build() — craig_common::telemetry::init does no header handling of its own. OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over this var when both are set. Only takes effect alongside OTEL_EXPORTER_OTLP_ENDPOINT; a malformed entry is silently dropped by the library rather than failing boot

OTEL_RESOURCE_ATTRIBUTES

String (comma-separated key=value)

 — 

No

Extra OTel resource attributes (e.g. deployment.environment=production,team=foo) merged onto every span’s resource. Handled by the opentelemetry_sdk crate’s EnvResourceDetector, which Resource::builder() (telemetry.rs) includes by default — not read or parsed by CRAIG code. craig_common::telemetry::init’s own `.with_service_name(service_name) call runs afterward and only overrides the service.name key (last-write-wins merge), so any other attribute set here (e.g. deployment.environment) passes through untouched. Only takes effect alongside OTEL_EXPORTER_OTLP_ENDPOINT

Shared Configuration (8 Core Services)

Services: craig-rules, craig-cases, craig-placement, craig-exchange, craig-financial, craig-reporting, craig-security, craig-composition.

Prefix: CRAIG_<SERVICE> (e.g., CRAIG_RULESPORT=8001)

Variable Type Default Required Description

PORT

u16

 — 

Yes

Service listening port. The bind address is hardcoded 0.0.0.0 — there is no listen-address knob

DATABASE_URL

String

 — 

Yes

PostgreSQL connection URL. Also read directly by the same-image <binary> migrate gate (ADR-063)

RABBITMQ_URL

String

 — 

Yes

RabbitMQ AMQP connection URL. #1202: each service connects as its OWN least-privilege broker account (craig-<svc>), never a shared identity — provision per the deployment guide’s User Configuration section

OIDC_ISSUER

String

 — 

Yes

Keycloak realm issuer URL (JWT iss claim)

OIDC_INTERNAL_URL

String

 — 

No

Internal Keycloak URL for JWKS discovery (falls back to issuer)

CLIENT_ID

String

 — 

Yes under auto/introspect token validation

OIDC client_credentials service principal for ALL outbound S2S calls (Plan E §4 — the cases auto-link consumer, financial→placement reads, introspection bearer). Under the DEFAULT TOKEN_VALIDATION_MODE=auto, boot hard-fails without the pair (the error names these vars); only a pinned jws mode boots without (warn)

CLIENT_SECRET

String

 — 

paired with CLIENT_ID

Secret for the service principal

SIGNING_JWK / SIGNING_JWK_FILE

String (inline ES256 private JWK / secret-mount path)

 — 

No (as a set)

Plan E actor-identity keypair: with SIGNING_KID it wires the ActorTokenIssuer so outbound S2S calls carry X-Craig-Actor. All-absent ⇒ no issuer (boot warn, actor headers can’t be minted); inline JWK wins when both forms set; empty strings normalize to absent

SIGNING_KID

String

 — 

iff a JWK source is set

kid advertised for the signing key. One half of the pair without the other is a BOOT ERROR

TOKEN_VALIDATION_MODE

jws | introspect | auto

auto

No

ADR-029 token-validation dispatch. auto/introspect require the CLIENT_ID/CLIENT_SECRET pair (introspection authenticates as the service principal)

INTROSPECTION_CACHE_TTL_SECONDS

u64

60

No

Introspection verdict cache TTL

INTROSPECTION_CACHE_MAX_ENTRIES

usize

10000

No

Introspection cache size bound

INTROSPECTION_SERVE_ON_OUTAGE

bool

false

No

Serve cached verdicts during an introspection outage. Default fail-closed

INTROSPECTION_ENDPOINT

String

discovery

No

Explicit introspection endpoint override (discovery wins when unset)

INTROSPECTION_AUTH_METHOD

basic | bearer

basic

No

How the service authenticates to the introspection endpoint

SUBJECT_CLIENTS

String (comma list)

`` (empty)

No

ADR-076 D2: the public OIDC client ids (azp) whose tokens this service accepts as a portal SUBJECT (X-Craig-Subject, relayed by the portal BFF on its service:craig-portal bearer). Empty refuses every subject — the posture of a service with no portal surface. craig-portal-ui on craig-placement since U6 (#1848, the enrollment act) and on craig-financial since U9 (#1852, the portal payments projection). Entries are bare client ids; a malformed entry is a boot error

PORTAL_PATHS

String (comma list)

`` (empty)

No

ADR-076 D3: the /v1/<svc>/portal/ path prefixes a portal subject may reach on this service (/v1/placement/portal/ on craig-placement since U6, /v1/financial/portal/ on craig-financial since U9 — #1852); anything else on the portal channel is 403. Empty answers 403 to every on-channel request. Each entry must start with /v1/ and end with / (a prefix without the trailing slash would also match a sibling staff route); a malformed entry is a boot error

LOG_LEVEL

String

info

No

Logging level (debug, info, warn, error). A set-and-parseable RUST_LOG overrides it entirely

CORS_ORIGINS

String

empty (same-origin only)

No

Comma-separated allowed CORS origins, or for any. Each non- entry is boot-validated as scheme://host — a malformed entry FAILS STARTUP (#816)

BODY_LIMIT

usize

2097152 (2 MiB)

No

Maximum request body size in bytes — the GLOBAL cap on every route (#974: attachment routes carry the separate cap below; nothing raises this one for uploads any more)

ATTACHMENT_BODY_LIMIT

usize

unset → CRAIG_STORE__MAX_UPLOAD_BYTES + 1 MiB (51 MiB under the defaults)

No

#974: whole-request cap for the ATTACHMENT-ACCEPTING routes only — craig-cases (contact / report / court-order attachments), craig-placement (home documents), craig-exchange (ICPC attachments); parsed by every service, consumed by those three. Per-route inner DefaultBodyLimit (craig_api::attachment_body_limit), so uploads work out of the box while every other route keeps BODY_LIMIT. An explicit value MUST exceed the store’s per-file cap — boot refuses otherwise. See the deployment guide § Upload limits

RATE_LIMIT_RPM

u32

600

No

Per-IP request cap per MINUTE; 0 disables. Keys on the client IP from the shared trusted-proxy walk (#766): the SOCKET PEER when TRUSTED_PROXIES is unset, or the Forwarded/X-Forwarded-For-derived client when the peer is a listed proxy

TRUSTED_PROXIES

String

empty (no proxies trusted)

No

#766: comma-separated CIDRs of trusted upstream proxies (LBs, ingress, the BFF) for the rate limiter’s client-IP extraction — the craig-intake Plan C §D5 design, now fleet-wide via craig_common::client_ip. When the immediate TCP peer is inside a listed CIDR, the forwarding chain is walked right-to-left past trusted hops to the real client; untrusted peers' headers are spoofable and ignored. An invalid CIDR FAILS STARTUP. Unset = every request behind a proxy shares that proxy’s one bucket, so list your ingress here in fronted deployments. #1569: craig-web relays the browser client’s IP (Forwarded: for=) on its S2S calls, so listing the BFF’s CIDR here separates per-browser buckets behind the BFF too

DB_MAX_CONNECTIONS

u32

10

No

Database connection pool size. Size against the server’s max_connections per the deployment guide § Database connection budget (#1160) — detached advisory-lease sessions sit outside this pool’s accounting

DB_IDLE_TIMEOUT_SECS

u64

600

No

Database connection idle timeout in seconds

DB_STATEMENT_TIMEOUT_MS

u64

30000

No

F-019: Postgres statement_timeout set on every acquired connection (floor 10,000 ms — ADR-068’s HTTP tx funnels SET LOCAL a 10s budget, which would silently RAISE a tighter session bound, so load refuses below the floor; top clamp 3,600,000 ms). Batch jobs extend per-transaction via SET LOCAL; the pool’s 5 s acquire timeout is a separate FIXED constant, deliberately not a knob (#1160)

ADMIN_UNIT_LABEL

String

 — 

Yes

Display label for the admin-unit concept (County, Region, Chapter, etc.; Plan A §12 removed the silent County default)

CASES_BASE_URL

String

http://localhost:8002

No (but craig-placement is a 503 without it)

#1776: craig-cases base URL — a SHARED-CORE leaf, not an extension field, because exchange (ICPC), placement (the placement-facts read behind every matching search / activating transition) and reporting (the ncands_generate executor, #2118) consume it; CRAIG_EXCHANGECASES_BASE_URL / CRAIG_PLACEMENTCASES_BASE_URL / CRAIG_REPORTING__CASES_BASE_URL all reach settings.cases_base_url. The default is only right outside a container — the devstack compose sets http://craig-cases:8002 on placement and reporting

PLACEMENT_BASE_URL

String

http://localhost:8003

No (but craig-financial’s eligibility and portal reads are 503 without it)

#2118: craig-placement base URL — a SHARED-CORE leaf since #2118 (LIFTED from FinancialSettings, env name unchanged: CRAIG_FINANCIAL__PLACEMENT_BASE_URL reaches settings.placement_base_url). Its readers are craig-financial (see its service row), craig-reporting’s AFCARS export client (#2140, wired by the generate job #2143) and craig-exchange’s collection run (#3188). Default suits local non-container runs; the devstack compose sets http://craig-placement:8003 on financial and reporting

FINANCIAL_BASE_URL

String

http://localhost:8005

No

#2140: craig-financial base URL — a SHARED-CORE leaf (settings.financial_base_url), the reason CASES_BASE_URL is one. Reader: craig-reporting’s AFCARS facts client (CRAIG_REPORTING__FINANCIAL_BASE_URL), wired by the generate job (#2143). Default suits local non-container runs; the devstack compose sets http://craig-financial:8005 on reporting

SECURITY_BASE_URL

String

http://localhost:8007

No (but a ruleset that consults claims.admin_units answers 503 without it)

#1903 / ADR-077 D4: craig-security base URL — a SHARED-CORE leaf since #1903 (LIFTED from PlacementSettings, env names unchanged: CRAIG_<SVC>SECURITY_BASE_URL, CRAIG_PLACEMENTSECURITY_BASE_URL included). Two readers with two postures: the seven HTTP consumers (every engine-bearing service except craig-security, which reads its own table) install the admin-units SNAPSHOT from it on their OWN principal (the admin-units-verifier; a read failure is 503-class — a ruleset that consults claims.admin_units answers the typed ADMIN_UNITS_UNAVAILABLE with the closed reason, never an empty unit list; gauge admin_units_snapshot_verified{jurisdiction} is the rollout gate) and craig-placement ALSO uses it for the #1851 / ADR-076 D7 portal worker display-name read, which still DEGRADES (caseworker_name: null + names_unavailable: true, never a 503). A 403 on either path is logged at error with the missing worker_identity-row remedy (1.3.0 / 1.2.0). Default suits local non-container runs; the devstack compose sets http://craig-security:8007 on the seven

ADMIN_UNITS__MAX_AGE_SECS

u64

300

No

#1903 / ADR-077 D4: how old an installed admin-units snapshot may be before the engine’s units source answers NotReady(stale) — nested as CRAIG_<SVC>ADMIN_UNITSMAX_AGE_SECS; must be >= 1 (boot refuses 0, naming the key). The verifier re-reads every 60 s once verified (2 s doubling to 60 s after a failed pass), so under the default a snapshot goes stale once 300 s pass without an installed or re-confirmed pass (the 2 / 4 / 8 / 16 / 32 / 60 / 60 … s retry ladder runs inside that window)

AUTHZ_REQUIRE_FULL_COVERAGE

bool

false

No

Boot-bail when the jurisdiction×resource-type authz matrix has uncovered tuples

AUTHZ_POLICY_TTL_SECONDS

u64

3600

No

Authz ruleset-cache TTL fallback for missed invalidation events

AUTHZ_EVAL_TIMEOUT_MS

u64

5000

No

Per-authz-decision eval budget; elapsing returns a typed 503 (#1126). Valid 1..=19000 since ADR-068: the typed 503 must fire before the 20s Standard request ceiling

AUTHZ_FUNCTION_TIMEOUT_MS

u64

min(5000, AUTHZ_EVAL_TIMEOUT_MS)

No

JS function-node interrupt bound published into zen’s PROCESS-GLOBAL config at boot (#1328); explicit values must sit in 1..=AUTHZ_EVAL_TIMEOUT_MS. craig-rules validates but never applies it — CRAIG_RULES__FUNCTION_TIMEOUT_MS (#1046) owns that process’s bound

EVENT_OUTBOX_RETENTION_DAYS

u32

30

No

#965/#1129 (ADR-058): event_outbox prune window — PUBLISHED rows only; pending rows are never age-deleted. 0 disables the outbox sweep. Also bounds the admin replay endpoint and the exchange/financial local sweeps. Change fleet-wide only

EVENT_INBOX_RETENTION_DAYS

u32

31

No

#965/#1129 (ADR-058): event_inbox prune window. Load-validated >= outbox + 1 when both non-zero (the dedup-horizon margin) and ⇐ 3650; 0 disables the inbox sweep. Change fleet-wide only

RETENTION_ARCHIVE__ENABLED

bool

false

No

#1129 (ADR-058 D11): consent to archive-then-prune audit-class rows. Consumed by craig-security + craig-rules; gates the scheduled worker AND security’s /archive/run+/archive/purge (typed 403 naming this knob; /archive/run is a 202 background job since #1934 — the 403 stays synchronous at enqueue and the job re-checks this knob at attempt start, failed(refused_at_start) naming it). See the deployment guide’s Retention & Archive runbook before enabling

RETENTION_ARCHIVE__HOT_WINDOW_DAYS

u32

90

No

#1129: archive-eligibility age (1..=3650, load-validated even while disabled). craig-exchange additionally floors it at ≥365 (#1466 B5 — the SSA screening quiescence horizon; the devstack compose sets it). Operational knob, NOT the DFCS records-retention schedule (⁂ #1073)

RETENTION_ARCHIVE__INTERVAL_SECONDS

u64

3600

No

#1129: scheduled archive-pass cadence; 0 = no worker (manual endpoints still work when enabled)

RETENTION_ARCHIVE__BATCH_SIZE

u32

1000

No

#1129: rows per archive batch (1..=10000); one batch = one object + one crash-atomic prune transaction

RETENTION_ARCHIVE__MAX_BATCH_BYTES

usize

33554432 (32 MiB)

No

#1129: byte cap per archive object (>= 4096; boot-validated ⇐ the store’s MAX_UPLOAD_BYTES); a single row exceeding it alone quarantines loudly (D13)

Service-Specific Extras

Since 998 the single-service knobs of the shared ServiceSettings live in per-service extension structs (crates/craig-common/src/settings.rs), flattened into the shared struct with [serde(flatten)] so that every variable name is unchanged (CRAIG_<SVC><FIELD>; nested groups still nest on ). Which struct owns which:

  • CasesSettings (settings.cases) — JWS_REPLAY_TTL_HOURS, JWS_REPLAY_CLEANUP_INTERVAL_SECONDS, EXCHANGE_BASE_URL. ENCRYPTION_MODE is a shared-core leaf since #2138 (settings.encryption_mode, lifted from CasesSettings; env names unchanged): craig-cases and craig-reporting each read it under their own prefix

  • ExchangeSettings (settings.exchange) — ICPC_DEADLINE_DAYS, PARTNER_AUTH_PLAIN_HTTP_HOSTS (#2427), the SSA_SCREENING* group, the TRIGGERS*, COLLECTIONS* (#3188) and PERSON_INDEX* (#3192) consent groups, and the RETURNS* group (#3193), which holds the return listener’s four settings beside its own per-interface consents. Each consent group is a map from interface to its ENABLED knob (TRIGGERS<INTERFACE>ENABLED, #3196): there is no field per partner, an interface with no variable is off, and a variable naming an interface the deployment’s partner set has no leg of that kind for stops craig-exchange at boot. CASES_BASE_URL is NOT an extension field since #1776 — it is a shared-core leaf (settings.cases_base_url): CRAIG_EXCHANGE, CRAIG_PLACEMENT and CRAIG_REPORTINGCASES_BASE_URL all reach it (a per-service twin would be handed to the first flattened struct and silently keep its default). craig-placement REQUIRES it in practice: the default is http://localhost:8002, and with it unset every matching search and every activating transition is a 503 (the placement-facts read behind them fails closed)

  • FinancialSettings (settings.financial) — PAYMENT_PERIOD, SUBSIDY_GENERATOR_INTERVAL_SECONDS, the SUBSIDY_REVIEW_SWEEP* / SUBSIDY_ERR* / SUBSIDY_SG* / SUBSIDY_IMPORT* / SUBSIDY_CAREGIVER_CHECK__* groups. PLACEMENT_BASE_URL is NOT an extension field since #2118 — it is a shared-core leaf (settings.placement_base_url, lifted from FinancialSettings; env name unchanged)

  • SecuritySettings (settings.security) — ADMIN_UNIT_LABEL (still required by every service, as before: the move added no default)

  • PlacementSettings (settings.placement, #1641) — RULES_ENGINE_URL (the eligibility consult’s base URL; the only service whose copy is a settings field), the EXPIRY_SWEEP__* group, ENROLLMENT_RATE_LIMIT_RPM (#1848); RULESETS_DIR (#634) was retired by #2955 — the field-owner map comes from the config layers (CRAIG_CONFIG_SOURCE). SECURITY_BASE_URL is NOT an extension field since #1903 — it is a shared-core leaf (settings.security_base_url, lifted from PlacementSettings; every engine-bearing service reads it for the admin-units snapshot, placement also for the #1851 display-name read; env names unchanged)

The split is a code-ownership boundary, not an environment one: every service still parses all five groups and ignores the ones it does not own, and RETENTION_ARCHIVE__* stays in the shared core above because security, rules AND exchange consume it (likewise CASES_BASE_URL — exchange, placement and reporting, #1776 / #2118 — PLACEMENT_BASE_URL — craig-financial today, craig-reporting’s AFCARS export client, #2140 — FINANCIAL_BASE_URL — craig-reporting, #2140 — and SECURITY_BASE_URL — every engine-bearing service, #1903). Variables in this table that are not ServiceSettings fields (RULES_ENGINE_URL outside craig-placement, EVAL_TIMEOUT_MS, FUNCTION_TIMEOUT_MS, DECISION_REFRESH_SECONDS, CASES_URL, DETECTION_INTERVAL_SECS, AUDIT_BATCH_MAX — #2765) are read by their service directly from the environment. One corner case of the flatten path: a value for one of the moved String leaves that parses as a bare number or boolean (e.g. ADMIN_UNIT_LABEL=123) is refused at boot with a typed error rather than accepted as text; real labels and URLs are unaffected. Relatedly, an unparsable value for a moved leaf (e.g. ICPC_DEADLINE_DAYS=abc) still fails boot with a typed error, but the message names only the offending value and the expected type (invalid type: string "abc", expected i64) — not the key, which the shared-core leaves still report (… for key `icpc_deadline_days in the environment`); match the quoted value against this table to find the variable.

Service Variable Default Description

all except craig-rules

RULES_ENGINE_URL

http://localhost:8001

craig-rules base URL, read per-service (CRAIG_<SVC>__RULES_ENGINE_URL) for the authz RulesetSource; craig-cases additionally uses it for the evaluate relay + §G4 auto-link consumer. craig-rules itself boots authz from its own DB and reads no URL

craig-rules

RULE_SET_AUTHORITY

config

Who owns the deployment’s rule sets (ADR-087 § Amendment — #2956). config: the configuration layers own them; boot reconciles the database to the layers' rule-set files and the write routes (create, update, import, delete, promote, rollback) answer 409 config-managed. api: the write API owns them; boot reconciles nothing and the write routes stay open. Unset or blank is config, so a deployment that says nothing never has an open write API; any other value refuses boot. craig-rules loads CRAIG_CONFIG_SOURCE under both values, for the jurisdiction its manifest names. The devstack sets api: its seed and its tests write rule sets through the API

craig-rules

EVAL_TIMEOUT_MS

5000

Budget for one rules evaluation dispatch (queue wait + evaluation), milliseconds; elapsing returns 503 on POST /v1/rules/evaluate and fails the domain-event handler (#784). Valid 1..=19000 — validated at boot; since ADR-068 the cap is the 20s Standard request ceiling − 1s, so the typed eval 503 always beats the generic ceiling 504. Successful-call latency ≈ budget + audit write (the audit tx runs after the dispatch, bounded by DB_STATEMENT_TIMEOUT_MS).

craig-rules

FUNCTION_TIMEOUT_MS

min(5000, eval budget)

Per-NODE interrupt bound for JDM JS function nodes, milliseconds (#1046 / ADR-006 §Amendment #1046) — published into zen-engine’s process-global config at boot, replacing the silently-inherited upstream 5s default. An explicit value must sit in 1..=EVAL_TIMEOUT_MS (validated at boot): a JS node outliving the dispatch budget turns a clean typed runtime_error audit row into a caller timeout. Per-node, not per-dispatch — a multi-JS-node graph can legitimately sum past it; the eval budget stays the caller ceiling. Process-global: also governs the embedded authz engine’s JS nodes in the craig-rules process (fleet mirror: #1328). v1 (string-content) function nodes carry zen’s hard 500ms bound regardless.

craig-rules

DECISION_REFRESH_SECONDS

300

Decision-cache sweep interval, seconds (#1188 / the ADR-006 #1188 amendment). Valid 10..=86400 — validated at boot. Each instance periodically reconciles its compiled-decision cache against the DB via the identity-aware (id, revision) CAS; bounds staleness after a LOST rules.cache_invalidated event to ≤ ~2×interval + pass duration under a healthy DB (≈10 min at the default). Replicas de-phase via a deterministic per-instance start offset; devstack compose pins 15 so the fault e2e observes convergence.

craig-cases

ENCRYPTION_MODE

required

Field-encryption posture (ADR-020 / ADR-048): required (default — boot fails without a valid key) or optional (keyless ⇒ plaintext; unit-test / non-PII deployments only). Any other value is a hard startup error. The field parses fleet-wide (CRAIG_<SVC>__ENCRYPTION_MODE, the shared-core settings.encryption_mode leaf since #2138); craig-cases and craig-reporting each consult it for their own key. The devstack runs required since epic &66 C7.

craig-cases

CRAIG_FIELD_ENCRYPTION_KEY (no service prefix)

 — 

32-byte base64 field key, shared with craig-seed so seeded rows match service-written ones. In required mode any load failure (absent, malformed, wrong-length) fails boot. In optional mode any load failure — including a set-but-malformed key — silently disables encryption (keyless plaintext); this is deliberately unlike craig-seed’s loader, which is fatal on a malformed key in both modes (ADR-048 C5 amendment). At boot, cases additionally verifies the loaded key against the crypto_key_lineage anchor (KCV + canary, ADR-048 §D3) and refuses startup on key↔data mismatch, naming the remedy — so a wrong-but-well-formed key (or a keyless boot over keyed data) cannot serve requests. Since #1007 the envelope is format v2 (every cell binds its table / column / row id — and a blind-index base its stored sibling — as AAD; the canary is verified under the fixed canary context): a keyed database holding v1 ciphertext refuses boot with SchemeMismatch naming cargo xtask dev reseed — the remedy is the reseed, never a dual-read (ADR-048 § Amendment — #1007). The rewrite-scheme process mode (#1399 U2b) reads this variable too, through the same FieldEncryptor::from_env loader and BEFORE any connection — absent, malformed or wrong-length refuses naming CRAIG_FIELD_ENCRYPTION_KEY; a well-formed WRONG key is refused by the same KCV + canary preflight against crypto_key_lineage before any row is read. The mode additionally requires CRAIG_CASESDATABASE_URL = the migrate gate’s OWNER DSN (a direct connection — session advisory locks), CRAIG_CONFIG_SOURCE (the target registry is resolved from the configuration layers exactly as boot does), and CRAIG_CASESENCRYPTION_MODE=required (unset = required; optional — or any other value — refuses with ModeNotRequired, never a keyless plaintext walk). Key delivery is the serving pod’s secret mount; the sequence is deployment guide § Field-scheme rewrite.

craig-cases

JWS_REPLAY_TTL_HOURS

24

TTL (hours) for jws_seen_jti replay-defense rows (mandated-reporter signing); rows older than this are pruned and their jti becomes acceptable again

craig-cases

JWS_REPLAY_CLEANUP_INTERVAL_SECONDS

3600

Poll interval for the jws_seen_jti cleanup worker

craig-exchange

ICPC_DEADLINE_DAYS

60

ICPC home-study deadline in calendar days, stamped as deadline_at on the received edge (only consumed by the ICPC request update path). The default is the federal window, 42 U.S.C. § 671(a)(26)(A)(i) (#1734; 84 before, a 60-business-day reading with no source basis)

craig-exchange

PARTNER_AUTH_PLAIN_HTTP_HOSTS

empty

#2427 (TP-2 D1): comma-separated exact hosts (trimmed, empties dropped) that a partner whose auth_type is not none may reach over plain http. Empty: every credential-bearing endpoint must be https, and create / update answer 422 partner-auth-requires-https otherwise; the stored-row gate holds or fails such a row auth-misconfigured. Listing a host sends credentials to it in clear — the devstack compose lists mock-server only

craig-exchange

COLLECTIONSDOE_SLDSENABLED

false

#3188: consent to collect the education agency’s weekly student file (POST /v1/exchange/collections/run). Off, the route answers 409 collection-disabled and enqueues nothing, and a job enqueued before it was turned off fails refused_at_start (#3190); nothing is fetched either way. A separate consent from TRIGGERSDOE_SLDSENABLED: what goes out and what comes back are decided apart. An interface with no knob here cannot be collected from. The devstack compose sets it true

craig-exchange

PERSON_INDEX<INTERFACE>ENABLED

false

#3192: consent to ask the deployment’s person index, the partner that answers who a person is across agencies, about a person: to find candidates, to register a person and to tell it the agency holds one (POST /v1/exchange/person-index/matches, /registrations, /participations). Asking releases a person’s names, sex and date of birth to that partner. Off, each route answers 403 feature-disabled naming this variable, and nothing is sent. A separate consent from TRIGGERS* and COLLECTIONS*. The variable must name the interface the partner set’s person index answers for, or craig-exchange refuses to start. The devstack compose sets none: Georgia’s layer provides no person index yet

craig-exchange

RETURNS<INTERFACE>ENABLED

false

#3193 (ADR-091): consent to take the calls of the partner of that interface on the return listener. A separate consent from TRIGGERS__*: agreeing to refer applications to a partner does not agree to take its calls. With no interface consented craig-exchange binds no listener and the four settings below are not read. The variable must name an interface the partner set has a return leg for, or craig-exchange refuses to start. The devstack compose sets none

craig-exchange

RETURNS__PORT

unset

#3193: the port the partner-return listener binds, on every address of the host, apart from the API port. Required once an interface consents to returns: craig-exchange refuses to start without it. The listener serves POST /returns/{interface}/{leg} and nothing else, over mutual TLS. The devstack compose sets 8443

craig-exchange

RETURNSTLS_CERT_FILE, RETURNSTLS_KEY_FILE

unset

#3193: the listener’s own certificate chain and its private key, PEM files. Required once an interface consents; a file that is unset, unreadable, holds no certificate, or a key that is not the certificate’s, refuses the start. Read once at start: a renewed certificate takes effect at the next start

craig-exchange

RETURNS__CLIENT_CA_FILE

unset

#3193: the certificate authorities whose client certificates may complete the listener’s handshake, a PEM bundle. Required once an interface consents; a bundle with no certificate refuses the start. A certificate that chains to one of them still admits nobody until it is registered and approved against a partner in craig-security (craig partner cert register, approve) and that partner is named on the interface’s partner row (caller_partner_id)

craig-exchange

COLLECTION_SCHEDULE__INTERVAL_SECONDS

0

#3190: the least time, in seconds, between two runs of one collection by the collection-schedule worker (604800 for a weekly file). 0, the default, is no schedule: the worker is listed disabled, and a collection runs only when an operator runs it. A collection is due when its newest counted run, an operator’s included, started at least this long ago; a run a shutdown interrupted does not count. The schedule runs only the collections the deployment has consented to (COLLECTIONS<INTERFACE>ENABLED): it decides when, never whether. The devstack sets none

craig-exchange

PLACEMENT_BASE_URL

http://localhost:8003

#3188: the shared-core leaf (settings.placement_base_url), read by craig-exchange for the one call a collection run makes: each admitted partner-reported education record is posted to craig-placement on craig-exchange’s own service token. The devstack compose sets http://craig-placement:8003

craig-financial

CASES_URL

http://localhost:8002

craig-cases URL — placement-activation billing resolves the child’s DOB from cases at event time (#979)

craig-financial

PLACEMENT_BASE_URL

http://localhost:8003

Shared-core leaf since #2118 (settings.placement_base_url). #1069 M2: craig-placement base URL for the S2S subsidy-eligibility read at ERR creation and SG/NRSG activation — since #1851/#1852 ERR create sends ?as_of= (the act’s business date) while activation sends none and takes placement’s default evidence date — the served episode_exit.exit_on (#2022), which IS the transfer date and its caregivers feed the knob-gated caregiver check (SUBSIDY_CAREGIVER_CHECK__ENABLED below). Since #1852 ALSO the base of the portal payments projection’s per-request authority, the service-only GET /v1/placement/internal/caregiver-bindings?sub= on financial’s OWN principal (4 s budget, no projection, no cache). Fail-closed on every leg — placement unreachable ⇒ 503 (typed portal-bindings-unavailable on the portal route), never an unverified enrollment or an unscoped portal read; a placement 403 on the bindings read is the missing {j}-authz-foster_home_caregiver 1.1.0 fixtures ⇒ a named 500 carrying the remedy. Default suits local non-container runs; the devstack compose sets the service host

craig-financial

PAYMENT_PERIOD

calendar_month

Payment-period boundary policy for per-diem billing rollups: calendar_month | fiscal_month | iso_week (Plan A §13)

craig-financial

SUBSIDY_GENERATOR_INTERVAL_SECONDS

0

#1068/ADR-053: monthly subsidy generation scheduler interval. 0 = disabled — enabling automated money generation is explicit deployment consent. Also requires the deployment’s bundle to declare subsidy_writes_enabled (#2207 — the Georgia layer: yes; the Texas layer: no). Devstack/CI set 3600. The first tick runs immediately on boot; the deployment-wide run lease (pg_try_advisory_lock) keeps multi-replica profiles single-writer. Since #1937 the same subsidy-gen lease also arbitrates against a subsidy_generate background job: the tick SKIPS (an info log, no beat) while a job holds it, and a job attempt that meets the tick reads waiting_for_lease (a 5 s re-dispatch, never a failure); the manual trigger (POST /v1/financial/subsidy-payments/generate) is a 202 job regardless of this knob

craig-financial

SUBSIDY_REVIEW_SWEEP__INTERVAL_SECONDS

0

#1096/ADR-054 U4: review-sweep scheduler tick. 0 = no scheduler — sweep enforcement MUTATES agreement status, so the tick is explicit deployment consent (deliberate asymmetry with the always-on devstack generator). Also requires the deployment’s bundle to declare subsidy_writes_enabled (#2207 — the Georgia layer: yes; the Texas layer: no). Interval alone (modes off) is a pure observe cadence: one run row + one completion event per tick, backlog gauges, zero agreement writes. The knob group nests on the separator (CRAIG_FINANCIALSUBSIDY_REVIEW_SWEEP__…); enablement demonstrated by docker-compose.sweep-demo.yml. Since #1939 the tick shares the subsidy-sweep lease with the sweep_execute background job: a job holding it makes the tick SKIP (an info log, no review-sweep heartbeat), and a tick holding it is the job attempt’s waiting_for_lease, never a refusal

craig-financial

SUBSIDY_REVIEW_SWEEP__MATERIALIZE

false

#1096: scheduled sweeps materialize missing first review slots from term anchors

craig-financial

SUBSIDY_REVIEW_SWEEP__AUTO_SUSPEND

false

#1096: enforce leg 1 — suspend agreements whose open review is past due + 30-day grace; recorded approval_level = "system" (the knob IS the authority, ADR-054)

craig-financial

SUBSIDY_REVIEW_SWEEP__AUTO_TERMINATE

false

#1096: enforce leg 2 — terminate agreements suspended three months or more (three_months_suspended)

craig-financial

SUBSIDY_REVIEW_SWEEP__AUTO_PER_DIEM_HANDOFF

false

#1069 M3/ADR-055: enforce leg 3 — terminate an ERR agreement whose caregiver’s foster per diem began on the agreement’s own placement (reason per_diem_begins, truth-dated to the per-diem start). Detection and the backlog counter run every sweep regardless of this knob; it consents ONLY the scheduled termination — the manual preview/execute path always enforces the pinned legs under acknowledged counts

craig-financial

SUBSIDY_ERR__ENABLED

false

#1069 M2 (F4): the one-shot ERR creation gate, nested as CRAIG_FINANCIALSUBSIDY_ERRENABLED. Default OFF — the ⁂ money policies (proration formula, 120-day clock, kinship set, −12 backdating floor) are best readings pending DFCS confirmation; enabling is the operator’s RECORDED consent to run on them — and, since hard-checks U2, to the AGE HARD CHECK: creation fetches the child’s DOB from craig-cases and evaluates the georgia-subsidy-eligibility ruleset at the coverage-start basis date (fail-closed: DOB missing/invalid, an unreachable dependency, or an over-age verdict each refuse typed; the deployment must carry the ruleset). Off ⇒ the create endpoint refuses with a typed 403 naming the knob. Devstack/e2e set true. Since backpay U-LE it is also consent to ACCEPT late enrollments the jurisdiction’s late_enrollment ruleset arm admits (true coverage recorded; pre-floor months payable only via the backpay act, #1115).

craig-financial

SUBSIDY_SG__ENABLED

false

#1070 (U4): the SG/NRSG guardianship ENROLLMENT-consent gate, nested as CRAIG_FINANCIALSUBSIDY_SGENABLED. Default OFF — one knob covers the family; the ⁂ readings (6-month residence floor, strict pre-transfer signing, the payments-begin boundary incl. the TANF shift, approval-anchored review dues, the 1st-of-month gap month) are best readings pending DFCS confirmation; enabling is the operator’s RECORDED consent — and, since hard-checks U2, consent to the AGE HARD CHECK at ACTIVATION (DOB from craig-cases + the georgia-subsidy-eligibility ruleset at the derived transfer date, fail-closed). Gates NEW enrollments (create + activate) ONLY — existing agreements' lifecycle (generator, ALL transitions incl. the corrective guardianship_finalized, reviews, sweep) is deliberately grandfathered, so a knob-off flip never strands owed money. Devstack/e2e set true. Since backpay U-LE it is also consent to ACCEPT a late transfer the jurisdiction’s late_enrollment ruleset arm admits at activation (true coverage recorded; pre-floor months payable only via the backpay act, #1115).

craig-financial

SUBSIDY_IMPORT__ENABLED

false

#1071/ADR-057 (D12): the closed-cohort conversion-import gate, nested as CRAIG_FINANCIALSUBSIDY_IMPORTENABLED. Default OFF — flipped true only for the conversion WINDOW (the deployment guide’s cutover runbook), which is the operator’s recorded consent to stage + finalize SHINES history. Gates every import WRITE (create-batch, stage, abort, and finalize — the money-consent act); GETs stay readable knob-off for post-conversion audit, and the lifecycle of already-MATERIALIZED agreements (generator, transitions, reviews, sweep) never consults the knob — disabling after the window strands nothing. Since #1938 finalize is a 202 background job and the knob is checked TWICE — the synchronous 403 at enqueue, and again at attempt start (failed(refused_at_start) naming it) if it was flipped OFF between the 202 and the attempt

craig-financial

SUBSIDY_BACKPAY__ENABLED

false

#1115 (plan backpay-import-path; G-B ruling 2026-10-08 on #1115): the below-floor backpay consent gate, nested as CRAIG_FINANCIALSUBSIDY_BACKPAYENABLED. Default OFF. Enabling it is the jurisdiction’s recorded decision that months the generator’s reconcile floor (current − 12) makes unreachable may be paid ONLY through the staged-and-finalized backpay act. It is a standing capability: the flip is made through the deployment’s change-controlled configuration, authorized by the office that holds the jurisdiction’s backpay finalize floor, and that change record is the consent’s evidence. Each finalize is the per-batch consent, bound by the configured BackpayFinalize floor (ADR-074), a finalizer who staged none of the batch’s staged or materialized records, and the content_checksum of the prices the finalizer reviewed; the payments it creates are born pending and pass the ordinary approve → issue chain. Gates every backpay WRITE (batch create, stage, supersede, finalize, abort): a typed 403 naming the knob; the GETs stay readable. Read at boot: turning it OFF is a restart, after which queued finalize jobs end lost_proof; running ones interrupted (a graceful restart) or crash (a killed process); the batch stays finalizing (re-enable and re-POST with a fresh id to resume per record); the backpay_finalize attempt re-checks it at start (failed(refused_at_start)). Materialized payments never consult it. Devstack/e2e set true

craig-financial

SUBSIDY_CAREGIVER_CHECK__ENABLED

false

#1852 (plan portals U9, ADR-076 D8 — the #634 named criterion; ADR-055 / ADR-056 amendments of 2026-09-15): the caregiver HARD-CHECK enforcement gate, nested as CRAIG_FINANCIALSUBSIDY_CAREGIVER_CHECKENABLED. Default OFF = REPORT-ONLY, not inert: both signatory boundaries — ERR create-active (every body party, as of the ENROLLMENT date = the act’s business date) and SG/NRSG ACTIVATION (the persisted parties, as of the TRANSFER date) — still evaluate each party against craig-placement’s caregiver ledger as carried on the ONE subsidy-eligibility read the boundary already makes (caregivers, evidence-dated; no extra call), and a party who is not a CURRENT caregiver of the placement’s unit on that date logs caregiver_check_would_refuse + counts subsidy_caregiver_check_total{boundary,outcome="would_refuse"} while the write proceeds unchanged. ON = that party refuses typed 400 subsidy-party-not-caregiver (naming parties[i], the person id and the date; ZERO rows; the F8 canonical hash untouched — a corrected body under the same client_request_id still enrolls) and a read WITHOUT caregivers (a craig-placement that predates #1851) refuses fail-closed 503 portal-bindings-unavailable — roll placement first. Create-pending SG/NRSG is not checked (activation is); the guardianship_finalized witness and every existing-agreement lifecycle path never consult it, so a knob-off flip strands nothing. Flip ON only after craig-manage caregiver-coverage shows the residual gaps are understood (deployment guide § "Caregiver ledger + portal enrollment rollout"). The devstack runs it ON since #1889: the seed binds every family unit’s caregiver (#2060) and the given-builders bind their signatory before enrolling

craig-placement

EXPIRY_SWEEP__INTERVAL_SECONDS

0

#1641: the foster-home expiry notice sweep tick, nested as CRAIG_PLACEMENTEXPIRY_SWEEPINTERVAL_SECONDS. 0 = no scheduler (devstack; /readyz shows expiry-sweep disabled) — the admin run endpoint works regardless: since #1933 POST /v1/placement/expiry-sweep/run takes { client_request_id } and answers 202 + Location: /v1/placement/jobs/{id} (poll it to succeeded; the pass report is the job’s result). Each tick runs one pass on the jurisdiction business date under the deployment-wide placement-expiry-sweep lease; the heartbeat beats only on a failure-free pass; an enqueued job behind a tick’s lease reads waiting_for_lease

craig-placement

EXPIRY_SWEEP__LEAD_DAYS

30

#1641 / #1642: days ahead of a license or training-certificate expiry the expiring notice is raised; 1..=365, validated at boot. WHEN to warn only — gating is the {j}-placement-eligibility ruleset’s arm

craig-placement

ENROLLMENT_RATE_LIMIT_RPM

5

#1848 / ADR-076 D3: the quota on POST /v1/placement/portal/enrollment, requests per minute, applied per client IP AND per relayed subject (CRAIG_PLACEMENT__ENROLLMENT_RATE_LIMIT_RPM). The plan’s invitation-code enumeration bound; 0 disables both axes. The per-IP axis keys on the caregiver’s browser only when the portal BFF’s CIDR is in TRUSTED_PROXIES — otherwise the whole fleet shares the BFF’s one bucket (deployment guide § "Caregiver ledger + portal enrollment rollout"). The devstack raises it to 100000 so the enumeration matrix can run

craig-reporting

CASES_BASE_URL

http://localhost:8002

craig-cases URL — the shared-core settings.cases_base_url leaf (nested as CRAIG_REPORTING__CASES_BASE_URL, renamed from CASES_URL by #2118) — the ncands_generate background job’s executor pages GET /v1/cases/ncands-export from cases at ATTEMPT time (#652 Phase D; paged + backgrounded by #1936 — the client is built before the workers spawn, the request path only enqueues; each page rides the fleet 8 s S2S hop budget, a missed page fails the attempt with zero rows written and the system re-queues it up to 3 attempts)

craig-reporting

PLACEMENT_BASE_URL

http://localhost:8003

#2140 (plan afcars-records-and-generate U3): craig-placement URL — the shared-core settings.placement_base_url leaf (nested as CRAIG_REPORTING__PLACEMENT_BASE_URL). craig-reporting’s AFCARS export client pages GET /v1/placement/afcars-export to next = null on reporting’s OWN principal (its service token); each page rides the fleet 8 s S2S hop budget, and any non-200 page, a timeout or an undecodable page fails the walk — never a default, no retry. The afcars_generate job (#2143) uses the client; nothing enqueues that job until #2144 adds its route. The devstack compose sets it

craig-reporting

FINANCIAL_BASE_URL

http://localhost:8005

#2140 (plan afcars-records-and-generate U3): craig-financial URL — the shared-core settings.financial_base_url leaf (nested as CRAIG_REPORTING__FINANCIAL_BASE_URL). craig-reporting’s AFCARS facts client pages GET /v1/financial/afcars-facts to next = null on reporting’s OWN principal (its service token); each page rides the fleet 8 s S2S hop budget, and any non-200 page, a timeout or an undecodable page fails the walk — never a default, no retry. The afcars_generate job (#2143) uses the client; nothing enqueues that job until #2144 adds its route. The devstack compose sets it

craig-reporting

ENCRYPTION_MODE

required

#2138: the column-key posture for craig-reporting, read as CRAIG_REPORTING__ENCRYPTION_MODE (the same shared-core leaf craig-cases reads under its own prefix). required (default): boot refuses unless CRAIG_REPORTING_FIELD_ENCRYPTION_KEY loads as a valid 32-byte base64 key — the refusal names the variable. optional: a keyless boot is allowed (unit-test / non-PII deployments only); a set-but-malformed key is treated like an absent one, and the lineage check still refuses keyed data without a key. Any other value is a hard startup error. Since #2177 the key, not the mode, decides how an AFCARS export is stored: a loaded key in either mode seals every AFCARS export as a CGAF envelope and the download opens it (an object that does not open is a redacted 500, never served); only a keyless optional boot stores and serves the file as built. NCANDS exports are never sealed. The devstack runs required

craig-reporting

CRAIG_REPORTING_FIELD_ENCRYPTION_KEY (no service prefix)

 — 

#2138: the craig-reporting column key (global row above). In required mode an absent, malformed or wrong-length key fails boot with an error naming CRAIG_REPORTING_FIELD_ENCRYPTION_KEY; a loaded key is then verified against craig_reporting’s crypto_key_lineage anchor and a mismatch refuses boot. The first committed afcars_generate job (#2143) or the first keyed AFCARS export (#2177), whichever comes first, writes the row — the generate in the same transaction as the first ciphertext, the export in its own transaction before it claims (INSERT … ON CONFLICT DO NOTHING, then verify; a mismatched key is refused before anything is claimed); until then the table is empty and a valid key boots, and from then on a boot under another key, or keyless, refuses (rotation is #2149). Never set it to the cases key value

craig-security

DETECTION_INTERVAL_SECS

60

Periodic detection-scan interval, seconds (note the _SECS suffix). 0 = scheduler disabled (the devstack default since #1167 — on-demand POST /v1/security/detection/run still works); unset/unparseable falls back to 60

craig-security

AUDIT_BATCH_MAX

16

2765 (plan audit-batched-claims D10): the fleet-wide audit subscriber’s batch size K, read directly as CRAIG_SECURITY__AUDIT_BATCH_MAX. 1 subscribes through subscribe_idempotent, one transaction and one COMMIT per envelope; 2 to 16 through subscribe_idempotent_batched, where one transaction claims and handles up to K immediately available deliveries and commits once (ADR-062 § #2765). Unset takes 16: measured over 20,000 envelopes through cargo xtask diag inbox-latency on 2026-11-12, K = 16 drained 5.62× faster than K = 1 under sustained WAL load and 2.28× faster at baseline, against a target of 3× and 0.9× (over 2,000 envelopes, a run that mostly ends before the load’s checkpoint starts, 1.84× and 2.28×; figures on #2765). Set 1 to return to the single-envelope path. Validated at boot: an empty or non-integer value, 0 and anything above 16 refuse startup with a typed error, never defaulted. The consumer pool stays at 3 connections (a batch holds one until its COMMIT); no migration or deployment barrier, so replicas may differ during a rollout

craig-intake (port 8008)

Prefix: CRAIG_INTAKE__

The intake service is a stateless edge in both modes (ADR-017): it owns no database and consumes no message queue — partner identity lives in craig-security, reports live in craig-cases, and every submission is forwarded over HTTP. There are therefore no DATABASE_URL/RABBITMQ_URL/DB_* variables for this service (#1211). Intake also requires the deployment-global CRAIG_CONFIG_SOURCE (its jurisdiction and the theme of its embedded public UI come from the configuration layers — boot fails without it). The MODE variable selects how partner credentials are validated:

  • Integrated (default): full CRAIG deployment — partner keys validated via craig-security, submissions forwarded to craig-cases

  • Standalone: air-gapped edge — partner keys read from a local JSON file; forwards to a remote cases service, or with BACKEND_PROFILE=shines drops each conformed SHINES CpsRequest into an S3 bucket (GA SHINES ingests by bucket drop) + verifies signatures against the keyring sidecar (ADR-042 § "Amendment 2026-08-31")

Values reach each field as strings: a digits-only CLIENT_ID, CLIENT_SECRET, IP_HASH_SECRET or BOT_PROTECTION__SECRET is used byte for byte (#2265). Integer and bool fields parse their own string form, so an integer written in float or exponent form (1.1e7, 5.0) refuses boot instead of being rounded, and SELF_SIGNED_TLS must be true/false/1/0/on/off/yes/no (any case).

Variable Type Default Required Description

PORT

u16

 — 

Yes

Service listening port

MODE

IntakeMode

integrated

No

Operating mode: integrated or standalone

BACKEND_PROFILE

BackendProfile

none

No

ADR-042 durable-backend selection: none (forwards to craig-cases) or shines (standalone only; rejected in integrated mode)

OIDC_ISSUER

String

 — 

Yes

OIDC issuer URL (both modes — intake mints client_credentials service tokens for its outbound S2S calls)

OIDC_INTERNAL_URL

String

 — 

No

Internal OIDC URL for split-DNS deployments (falls back to issuer)

CLIENT_ID

String

 — 

Yes

OIDC client_credentials principal (both modes; the S2S bearer for cases-forward + security lookups)

CLIENT_SECRET

String

 — 

Yes

Secret for the service principal

LOG_LEVEL

String

info

No

Logging level

CORS_ORIGINS

String

*

No

Allowed CORS origins (* is by-design for public intake forms; validated at boot)

BODY_LIMIT

usize

11534336 (11 MiB)

No

Max request size (accommodates 10 MiB file upload + overhead)

CASES_URL

String

 — 

Unless SHINES

craig-cases base URL — required in every cases-backed configuration (both modes); only the standalone-SHINES backend omits it

S3_KEY_PREFIX

String

cps-requests

No

Object-key prefix for the standalone-SHINES drop (BACKEND_PROFILE=shines): objects land under {prefix}/{client_request_id}/ (craig_receipt.json first, signed-path attachments/{sha256}, cps_request.json last). Bucket / endpoint / region / credentials come from CRAIG_STORE*; CRAIG_STOREBACKEND=local is refused under shines. Least privilege: s3:GetObject + s3:PutObject on {bucket}/{prefix}/*, plus s3:ListBucket on the bucket conditioned on s3:prefix = {prefix}/* (without List, S3 answers a missing key 403 instead of 404, and the receipt read and the read-back precheck depend on the 404); no s3:DeleteObject. Use a bucket dedicated to the drop and configure bucket default encryption (SSE-S3, or SSE-KMS with kms:GenerateDataKey + kms:Decrypt on the key, because the read-back GET decrypts); do not use a policy that denies a PutObject lacking an SSE header — craig-store sends none. Boot-refuses an empty / absolute / ..-containing prefix

KEYRING_URL

String

 — 

SHINES

craig-intake-keyring sidecar base URL (standalone SHINES only; signer-key lookup + JWS replay dedup, ADR-042 §D8)

SECURITY_URL

String

 — 

Integrated

craig-security base URL (partner verification + signer-key lookup); ignored in standalone

IP_HASH_SECRET

String

 — 

Yes

Per-deployment HMAC secret for received_ip_hash (Plan B F-003) — without it stored hashes are brute-forceable over the IPv4 space

TRUSTED_PROXIES

String (CSV CIDRs)

empty

No

CIDRs whose X-Forwarded-For/Forwarded headers are trusted for client-IP resolution (rate limiting + audit hashing)

BOT_PROTECTION__MODE

String

none

No

ADR-069 seam posture: none (first-class default) or remote_verify

BOT_PROTECTION__VERIFY_URL

String

 — 

remote_verify

Verifier endpoint (HTTPS required; any siteverify-shaped endpoint — hosted vendor or self-hosted)

BOT_PROTECTION__SECRET

String

 — 

remote_verify

Verifier secret (reference the ADR-064 store, never inline)

BOT_PROTECTION__SITEKEY

String

 — 

remote_verify

Public sitekey rendered into the widget container

BOT_PROTECTION__WIDGET_SCRIPT_SRC

String

 — 

remote_verify

Vendor widget script URL (HTTPS; its origin joins script-src)

BOT_PROTECTION__WIDGET_CLASS

String

 — 

remote_verify

Widget container class the vendor JS scans for

BOT_PROTECTION__TOKEN_FIELD

String

 — 

remote_verify

Hidden-input name the vendor JS populates (report-form.js copies it into captcha_token)

BOT_PROTECTION__EXPECTED_HOSTNAME

String

 — 

No

When set, the verifier’s hostname answer must match (token-site binding)

BOT_PROTECTION__CSP_FRAME_SRC

list

empty

No

Extra frame-src hosts the widget needs (explicit, recorded CSP loosening)

BOT_PROTECTION__CSP_CONNECT_SRC

list

empty

No

Extra connect-src hosts the widget needs

PUBLIC_RATE_LIMIT

u32

5

No

Maximum public submissions per IP per hour. 0 refuses the boot (#3088)

SIGNED_RATE_LIMIT

u32

60

No

Requests per IP per hour on the standalone-SHINES signed nest /signed/v1 (machine API; ADR-042 §D9). 0 refuses the boot (#3088)

PARTNER_RATE_LIMIT

u32

36000

No

#3083: requests per IP per hour on the partner API nest /partner/v1, counted BEFORE the API key is checked, so a caller with no valid key cannot guess keys or load the key lookup (in integrated mode a call to craig-security) without limit. The window is an hour, like the two limits above: 36000 an hour is 600 a minute, the same rate as the other services' per-IP RATE_LIMIT_RPM default, and ten partners each at the default per-partner quota of 60 a minute. Partners behind one shared egress address (several systems behind one NAT) share this one budget: raise it where their combined traffic from one address exceeds 600 a minute. Each partner’s own rate_limit_rpm still applies after authentication. Keys on the client address from the trusted-proxy walk (TRUSTED_PROXIES); with no trusted proxy that is the socket peer, and a forwarding header cannot choose the bucket. Per replica, like the other intake limits. 0 refuses the boot (the limit cannot be disabled). At most one minute’s worth (the ceiling / 60, at least 1; 600 at the default) is admitted in a burst (#3097). Over the ceiling: 429, plain text, no Retry-After

SIGNED_MAX_FILE_BYTES

usize

10485760 (10 MiB)

No

Per-file cap for signed-path multipart attachments (ADR-042 §D9)

SIGNED_BODY_LIMIT

usize

31457280 (30 MiB)

No

Whole-request body cap for the signed nest (overrides BODY_LIMIT on those routes)

PUBLIC_MAX_FILE_BYTES

usize

10485760 (10 MiB)

No

#1324: per-file cap for public/partner attachment uploads, enforced AT THE EDGE while buffering — the reporter gets intake’s own 400 naming the limit, never the redacted downstream generic. Boot-validated ≤ CASES_MAX_UPLOAD_BYTES and < BODY_LIMIT (fail-loud)

CASES_MAX_UPLOAD_BYTES

usize

52428800 (50 MiB)

No

#1324: the operator’s DECLARATION of cases' CRAIG_STORE__MAX_UPLOAD_BYTES for the boot-time limit-capability ordering check (the typed contract in craig-cases-contracts::upload_limits). Set it whenever the cases deployment overrides its cap. Ignored under standalone-SHINES (no attachment route)

PARTNER_KEYS_FILE

String

 — 

No

Path to JSON file with partner API keys (standalone; absent ⇒ the partner API rejects all requests, warned at boot)

TLS_CERT_FILE / TLS_KEY_FILE

String

 — 

No

ADR-046 optional in-process TLS — PEM cert/key paths, both-or-neither; default is plain HTTP behind an ingress terminator

SELF_SIGNED_TLS

bool

false

No

ADR-046 dev/test-only ephemeral self-signed cert; requires the self-signed-tls build feature (fail-closed without it). NEVER in production

DEBUG_EMIT_CPS_REQUEST

String

 — 

No

#713 dev/integration only — debug CpsRequest panel gate. Active ONLY when set to the exact value EXPOSE_SSN_PII (a bare true does NOT enable it); requires BACKEND_PROFILE=shines. When active, the submit response echoes the exact conformed SHINES CpsRequest (third-party / minor PII, incl. SSNs) with Cache-Control: no-store. NEVER enable in production.

craig-intake-keyring (port 8010)

Prefix: CRAIG_INTAKE_KEYRING__

The keyring is the standalone-SHINES-only sidecar (ADR-042 §D8): the signer-key registry, JWS replay dedup and signing receipts, in its own Postgres database (craig_intake_keyring, ADR-042 § Amendment 2026-08-26), applied by the craig-intake-keyring-migrate gate. No message queue, no OIDC — it consumes none of the shared variables. Admin lifecycle routes fail closed when ADMIN_TOKEN is unset. It also owns the WebAuthn (passkey) policy, which both SHINES intake instances fetch from GET /webauthn/config at boot and refuse to start without (ADR-082 D2).

Values reach each field as strings: a digits-only ADMIN_TOKEN is the bearer byte for byte, so a 32-zero token authenticates only as those 32 bytes, never as 0 (#2266). Integer and bool fields parse their own string form, so an integer written in float or exponent form (1e4, 86400.0) refuses boot instead of being rounded, and ENABLE_KEY_LIST must be true/false/1/0/on/off/yes/no (any case).

Variable Type Default Required Description

PORT

u16

 — 

Yes

TCP listen port (ADR-042 §D8 convention: 8010); 0 is rejected by boot validation

LOG_LEVEL

String

info

No

Tracing level

DATABASE_URL

String

 — 

Yes

Postgres URL of the craig_intake_keyring database (the app role when serving; the owner role for the migrate gate). Blank is rejected by boot validation

ADMIN_TOKEN

String

 — 

No

Bearer token gating the approve/revoke lifecycle routes. Absent ⇒ those routes fail-closed reject everything (boot warn names this var); set-but-blank is a load error so an empty value can never authorize. Debug-redacted

REPLAY_RETENTION_SECS

u64

86400 (24 h)

No

JWS replay-record retention: records with iat older than this are pruned and their jti becomes acceptable again. Keep well beyond intake’s own JWS freshness window

MAX_KEYS

usize

10000

No

Cap on stored signer keys; register returns 429 at capacity (bounds the unauthenticated-register disk-growth surface)

ENABLE_KEY_LIST

bool

false

No

#714: mounts the metadata-only GET /keys view. Off ⇒ route absent (404). Exposes kid/display name/status/timestamps only — never the JWK or holder identifier

WEBAUTHN_RP_ID

String

 — 

Yes

ADR-082 D2: the WebAuthn relying-party ID passkeys are scoped to — a bare host (intake.example.gov; no scheme, port or path). Changing it orphans every registered passkey

WEBAUTHN_ALLOWED_ORIGINS

String

 — 

Yes

Comma-separated origins a passkey ceremony may come from: :port, or :port for development. Each is validated; an empty entry is rejected

WEBAUTHN_REQUIRE_DEVICE_BOUND

bool

false

No

ADR-082 D7: refuse backup-eligible (syncable) passkeys at registration and at assertion, for deployments that provision hardware keys. Not enforced yet: served from /webauthn/config today; registration (U4, #2195) and assertion (U5, #2196) enforce it

WEBAUTHN_MAX_ACTIVE_PER_IDENTITY

u32

3

No

ADR-082 D5: active passkeys one identity may hold before an added device waits for an admin; at least 1. Not enforced yet: validated today; the self-service add-device operation (U7, #2198) enforces it

craig-security-issuer (port 8011)

Prefix: CRAIG_SECURITY__

The internal token issuer (ADR-085 D2, #2741) is craig-security’s image run as craig-security issuer (the compose service craig-security-issuer). It reads only the variables below, validated at boot (a missing, unparseable or out-of-bounds value refuses startup, never defaulted): none of the shared variables, no RabbitMQ, rules-engine or object-store setting, and never CRAIG_SECURITY__DATABASE_URL (the app login’s). Not yet trusted: no service validates its tokens until the switch (ADR-085 D15).

Variable Type Default Required Description

IDENTITY_PORT

u16

 — 

Yes

TCP listen port for /livez, /readyz and the /identity/* routes (devstack: 8011); 0 is rejected

IDENTITY_DATABASE_URL

String

 — 

Yes

Postgres URL of craig_security as craig_security_issuer, the required issuer login. The boot probe refuses any other login, craig_security_app included, and one holding more than ADR-085 D2’s matrix. Debug-redacted; blank is rejected

IDENTITY_DB_MAX_CONNECTIONS

u32

22

No

The issuer pool’s size, 12–64 (ADR-085 D17: six background connections, the rest for requests). The issuance-log writer holds one more connection of its own

IDENTITY_ISSUER

String

 — 

Yes

The issuer identifier (#2743): every token’s iss and every client assertion’s aud, compared byte for byte; 1–255 visible ASCII characters (devstack: http://craig-security-issuer:8011)

IDENTITY_CLIENT_KEYS_FILE

path

 — 

Yes

The client-key registry (ADR-085 D11, D17), read once at boot: {"clients": [{"client_id", "keys", "rate_limit_rpm"}]}, each a compiled confidential client listed once with one or two strict public P-256 JWKs (no kid: the issuer computes the thumbprint) and a per-client budget a minute (default 6000). Any deviation refuses the boot. craig-manage gen-client-keys writes one (Internal issuer); devstack mounts devstack/identity/client-keys.json

IDENTITY_TOKEN_RATE_LIMIT_RPM

u32

30000

No

The per-IP limit on POST /identity/token, a minute, per replica; at least 1 (ADR-085 D17)

TRUSTED_PROXIES

String

empty

No

Comma-separated CIDRs whose Forwarded / X-Forwarded-For headers name the client IP the per-IP limit keys on (craig-common’s client_ip); empty trusts none and keys on the socket peer. An invalid CIDR refuses the boot

Logging follows RUST_LOG (default info); OTEL_EXPORTER_OTLP_ENDPOINT enables the OTLP exporter as for every service.

craig-web (port 8080)

Prefix: CRAIG_WEB__

The web service is a BFF (Backend-For-Frontend) that proxies requests to backend services and renders HTML via Askama templates. It also requires the deployment-global CRAIG_CONFIG_SOURCE: its theme and terminology come from the jurisdiction layer’s bundle/.

Values reach each field as strings: a digits-only SESSION_SECRET or CLIENT_SECRET is used byte for byte (#1868). Integer and bool fields parse their own string form, so an integer written in float or exponent form (1e7, 1800.0) refuses boot instead of being rounded, and a bool knob must be true/false/1/0/on/off/yes/no (any case).

Variable Type Default Required Description

PORT

u16

 — 

Yes

Web UI listening port

OIDC_ISSUER

String

 — 

Yes

Keycloak issuer URL for JWT validation

OIDC_INTERNAL_URL

String

 — 

No

Internal Keycloak URL for OIDC discovery

KEYCLOAK_CLIENT_ID

String

 — 

Yes

Keycloak client ID for the user-facing code-flow login (e.g., craig-ui)

KEYCLOAK_REDIRECT_URI

String

 — 

Yes

OAuth redirect URI

CLIENT_ID

String

 — 

Yes under auto/introspect token validation

craig-web’s OWN confidential client (Plan E §9 / ADR-028) — distinct from KEYCLOAK_CLIENT_ID: the client_credentials principal for outbound S2S calls, and (#2686) the principal the BFF introspects opaque / JWE login access tokens as. Under the DEFAULT TOKEN_VALIDATION_MODE=auto boot refuses without the pair, naming these vars; under a pinned jws an unset/empty pair warns and falls back to forwarding the worker bearer

CLIENT_SECRET

String

 — 

paired

Secret for CLIENT_ID; both must be non-empty to wire the service-token source and the introspection principal

TOKEN_VALIDATION_MODE

jws | introspect | auto

auto

No

#2686: how the BFF validates the login access token — the services' ADR-029 dispatch (a JWS through JWKS, an opaque / JWE token through RFC 7662 introspection, azp = KEYCLOAK_CLIENT_ID on both). auto/introspect require the CLIENT_ID/CLIENT_SECRET pair. The id_token is always verified as a JWS. See IdP Integration § BFF login

SIGNING_JWK / SIGNING_JWK_FILE / SIGNING_KID

String

 — 

No (as a set)

The BFF’s actor-issuer keypair (CRAIG_WEB__ prefix; same pair semantics as the shared table) — this is what mints the X-Craig-Actor header the fleet evaluates workers by

RULES_URL

String

 — 

Yes

craig-rules service URL

CASES_URL

String

 — 

Yes

craig-cases service URL

PLACEMENT_URL

String

 — 

Yes

craig-placement service URL

EXCHANGE_URL

String

 — 

Yes

craig-exchange service URL

FINANCIAL_URL

String

 — 

Yes

craig-financial service URL

REPORTING_URL

String

 — 

Yes

craig-reporting service URL

SECURITY_URL

String

 — 

Yes

craig-security service URL

COMPOSITION_URL

String

 — 

Yes

craig-composition backend base URL (Plan X / ADR-035 composed surfaces)

SESSION_SECRET

String

 — 

Yes

AES-GCM master key for the stateless session cookie (tower-cookies::Key::from(bytes)). Must be at least 64 bytes — the service fails to start otherwise. Generated via openssl rand -hex 32 (64 hex chars = 64 bytes). See ADR-013.

SESSION_MAX_AGE_SECS

i64

1800

No

Session cookie lifetime in seconds (default: 30 minutes). Increase for longer idle timeouts; decrease for stricter security.

SESSION_SECURE

bool

true

No

Emit the Secure flag on the session cookie. Set to false only for plain-HTTP dev loops.

LOG_LEVEL

String

info

No

Logging level

DEFAULT_LOCALE

String

en

No

Default i18n locale, and the reference a second language is measured against: craig-web offers a locale only when it carries every message this one does (#1487). Only en is supported: craig-web ships en worker catalogs only, so a non-en value renders raw message keys across the worker UI (the service warns at boot)

THEME

String

 — 

Yes

UI theme name (CSS theme identifier; Plan A §12 removed the silent georgia-orchard default)

BRANDING_AGENCY

String

 — 

Yes

Agency name for branding (Plan A §12 removed the silent default)

BRANDING_APP_NAME

String

CRAIG

No

Application name for branding

BRANDING_LOGO_URL

String

 — 

No

Custom logo URL (defaults to theme logo)

PLUGIN_ALLOWED_HOSTS

CSV list

empty (deny ALL plugin fetches)

No

Fail-closed SSRF allow-list for plugin outbound fetches (ADR-033 §6). Entries are trimmed; empty entries are dropped. Never list loopback/metadata hosts

TRUSTED_PROXIES

String

empty (no proxies trusted)

No

#1569: CIDRs of the proxies in FRONT of craig-web (ingress/LB), for deriving the browser client’s IP via the shared #766 walk. The BFF relays the derived IP on every S2S call as an RFC 7239 Forwarded: for= header; pair it by listing craig-web’s CIDR in each backend’s TRUSTED_PROXIES so their per-IP rate buckets key on the browser, not the BFF. Invalid CIDR FAILS STARTUP; empty is correct when browsers reach craig-web directly

UPLOAD_BODY_LIMIT

usize

11534336 (11 MiB)

No

Max multipart request-body size (bytes) for the two BFF upload routes (case-contact attachments, placement home documents). axum’s built-in 2 MiB default otherwise rejects routine multi-MB scans / photos at the edge (#970). Applied per-route — every other BFF route keeps the 2 MiB default. Must be ≤ each storing backend’s ATTACHMENT_BODY_LIMIT (derived 51 MiB by default, #974; see note).

A file upload traverses up to four request-body caps — ingress/reverse-proxy → BFF (CRAIG_WEBUPLOAD_BODY_LIMIT, 11 MiB default) → storing backend (CRAIG_<SVC>ATTACHMENT_BODY_LIMIT on cases / placement / exchange — per-ROUTE since #974, derived CRAIG_STOREMAX_UPLOAD_BYTES + 1 MiB = 51 MiB by default; every other route keeps the 2 MiB BODY_LIMIT) → object store (CRAIG_STOREMAX_UPLOAD_BYTES, 50 MiB default, the per-file cap). The smallest wins, so a large attachment 413s at whichever tier is under-sized — but the shipped defaults already satisfy BFF ≤ backend > per-file, so a fresh deployment uploads without configuration. The public-portal path adds the intake edge tier: intake boot-validates CRAIG_INTAKEPUBLIC_MAX_FILE_BYTES ≤ its declared CRAIG_INTAKECASES_MAX_UPLOAD_BYTES (#1324) and refuses to serve on inversion; the backends boot-validate ATTACHMENT_BODY_LIMIT > the store cap the same way. Defined rejection shapes on the intake attachment route: an over-PUBLIC_MAX_FILE_BYTES file is intake’s own 400 (upload too large: exceeds N byte limit); a whole-body BODY_LIMIT breach is the 413 payload-too-large RFC-9457 document (the public JSON submit’s whole-body 413 stays axum’s plain-text rejection — the recorded #1272 carve-out). The single canonical write-up of the tiers, the ordering invariant, and the rejection shapes is the deployment guide’s § Upload limits.

craig-portal (port 8080; devstack host 8081)

Prefix: CRAIG_PORTAL__

The caregiver self-service portal (plan portals U5, ADR-076 D6): a second BFF on the shared crates/craig-bff substrate. It loads no configuration layers — its theme is the shipped Foundation palette (craig_state_bundle::foundation_palette(), ruling R3; not the product default, which stays Simple Statehouse for craig-web) and its copy ships en + es (portal.ftl). The full variable table lives in the deployment guide § craig-portal; the shape that differs from craig-web:

  • REDIRECT_URI must end with /callback; CLIENT_ID / CLIENT_SECRET are REQUIRED (the SubjectToken channel has no bearer fallback); only PLACEMENT_URL and FINANCIAL_URL exist (never craig-cases).

  • TOKEN_VALIDATION_MODE (jws / introspect / auto, default auto; #2686) selects how the login access token is validated, exactly as craig-web’s: a JWS through JWKS, an opaque / JWE token through RFC 7662 introspection as the CLIENT_ID confidential client, azp = KEYCLOAK_CLIENT_ID on both.

  • LOGIN_RATE_LIMIT_RPM (default 30, 0 disables) fronts /login with the shared per-IP limiter (problem+json).

  • U10 (#1853) adds two HTML-shaped per-client-IP limiters — the same RetainingIpLimiter, but a refusal is a flash + 303 back to the page the caregiver came from, never problem+json: ENROLLMENT_RATE_LIMIT_RPM (default 10, 0 disables) on POST /enrol (the "too many tries, wait one minute" flash — the same one a placement 429 from CRAIG_PLACEMENTENROLLMENT_RATE_LIMIT_RPM, default 5 per IP AND per subject, answers) and UPLOAD_RATE_LIMIT_RPM (default 30, 0 disables) on the certificate upload POST /units/{unit}/documents. Every per-IP axis — the portal’s three limiters AND placement’s enrollment quota — keys on the caregiver’s browser only when each service’s trusted-proxy list names the hop in front of it: the ingress CIDR in CRAIG_PORTALTRUSTED_PROXIES, the portal’s CIDR in CRAIG_PLACEMENT__TRUSTED_PROXIES (the BFF relays the derived IP as Forwarded: for=); otherwise every caregiver shares ONE bucket.

  • U11 (#634) adds a third HTML-shaped per-client-IP limiter of the same shape, PROPOSAL_RATE_LIMIT_RPM (default 30, 0 disables), on POST /units/{unit}/proposals — the "Ask to change" form; a refusal is the same flash + 303 back to the unit page the request came from (the target is derived from the request path, since a unit id cannot be baked at router build). The trusted-proxy rule above applies to it unchanged.

  • UPLOAD_BODY_LIMIT (default 11534336, 11 MiB; the craig-web precedent) is the whole-body cap on the certificate upload route ONLY — the EFFECTIVE cap a caregiver meets, since placement’s per-file 50 MiB sits above it; the form’s helper text names 10 MB. An over-limit body surfaces as the portal’s "too big, or the upload stopped" flash (the limit is enforced lazily inside the multipart stream), never a BFF 413. Every other route keeps axum’s 2 MiB default.

  • Every protected response — and the signed-in /welcome (the connect page) — carries Cache-Control: no-store.

  • Cookies are portal_session / portal_pkce / portal_flash / portal_session-idt / portal_session-rt / portal_locale; any refresh failure ends the session (RefreshFailure::Drop). The session cookie’s Max-Age (SESSION_MAX_AGE_SECS, 1800 s) is the 30-minute idle limit; the realm SSO session outlives it (the committed realm: SSO idle 3600 s against the craig-portal-ui client’s 1800 s), so after 30 idle minutes the next request is routed through /login and is USUALLY a silent SSO re-entry — the sign-in form appears only once the IdP session has lapsed too. A backend 403 (no current binding, or a revoked identity) does NOT end the session: /units renders the not-connected state with the enrol form and every other page redirects there with a neutral flash (ADR-076 U10 note).

  • The env source does NOT coerce digits-only values (a numeric-looking secret stays a string; craig-web’s loader has the same shape since #1868).

Object Store (CRAIG_STORE__)

Prefix: CRAIG_STORE__

Consumed by craig-cases, craig-exchange, craig-placement (home documents), craig-reporting (AFCARS/NCANDS exports), and craig-security — plus craig-rules when RETENTION_ARCHIVE__ENABLED=true, and the craig-manage archive-fetch tooling. The retention D10 boot probe refuses the local backend when archiving is enabled.

Values reach each field as strings: a digits-only BUCKET, S3_ACCESS_KEY or S3_SECRET_KEY is used byte for byte (#2267). The integer knobs (MAX_UPLOAD_BYTES, REQUEST_TIMEOUT_SECS) parse their own string form, so a float or exponent form (5e7, 30.0) refuses boot instead of being rounded.

Variable Type Default Required Description

BACKEND

enum

local

No

Backend type: local (filesystem) or s3 (S3-compatible). Any other value fails deserialization

BUCKET

String

 — 

S3

S3 bucket name (enforced when the S3 client is built, not at config load)

LOCAL_ROOT

String

/tmp/craig-store

No

Root directory for local filesystem backend (created on startup)

S3_ENDPOINT

String

 — 

S3

S3 endpoint URL (e.g., http://garage:3900)

S3_REGION

String

us-east-1

No

S3 region

S3_ACCESS_KEY

String

 — 

S3

S3 access key (Debug-redacted)

S3_SECRET_KEY

String

 — 

S3

S3 secret key (Debug-redacted)

MAX_UPLOAD_BYTES

usize

52428800 (50 MiB)

No

Maximum upload file size. Boot-validated ≥ RETENTION_ARCHIVE__MAX_BATCH_BYTES by the retention engine

Path-style addressing and allow_http are HARDCODED (always path-style, plain HTTP permitted) — there are no TLS/addressing knobs; front the endpoint with TLS at the network layer if required.

craig-seed (fixture generator, tooling)

The craig-seed generator (invoked by cargo xtask dev) is a pure SQL-file generator: no database connection, no HTTP. It reads its variables via raw std::env::var, fail-closed on malformed values, rather than through the config crate. Since C7 activation (#987) the devstack mounts the shared devstack/field-key.env into it and runs it required, so every devstack seed writes genuine ciphertext (verified by cargo xtask verify-seed --expect keyed).

Where the key comes from differs by environment. Locally it is ADOPTED from the repo-committed encrypted store (secrets/dev.yaml, ADR-064) when the developer’s age identity is a store recipient, with a generate-once fallback for identity-less contributors. In CI, cargo xtask secrets write-field-key materializes it by decrypting that same store with the masked+protected CRAIG_CI_AGE_KEY CI/CD project variable inside the pinned devtools container (ADR-048 §D5 as amended by ADR-064 U7, #1385). An unset variable is a hard error, and CRAIG_CI_AGE_KEY is a CI pipeline variable, never a service env var.

Variable Type Default Required Description

CRAIG_CONFIG_SOURCE

String

 — 

Yes

The configuration layers the seed takes its jurisdiction and rate schedule from (the jurisdiction layer’s bundle/rate_tables.toml), the same list the services load (see Deployment-Global Variables). Unset or blank is a hard error. A jurisdiction whose layers carry no AFCARS crosswalk is seeded without AFCARS policy rows, and the seed logs one line naming the jurisdiction

CRAIG_SEED__ENCRYPTION_MODE

String

optional (when unset)

No

Accepts only optional or required — unset is treated as optional, and any other value (typo, empty, non-Unicode) is a hard error (fail-closed, never a silent fallback). required fails if no key is present.

CRAIG_FIELD_ENCRYPTION_KEY

String

 — 

In required mode

32-byte base64 field key, shared with craig-cases so seeded rows match service-written ones. Absent ⇒ plaintext seed (optional mode only); a malformed/wrong-length key is fatal in both modes (never silently seeds plaintext under a broken key). Writes envelope format v2 (#1007): every cell is bound to its (table, column, row id[, sibling]) and the lineage row is stamped envelope_version = 2.

Edit this page · latest