Multi-Jurisdiction Extensibility
- Overview
- Step 1 — Create the configuration layer
- Step 2 — Write the bundle
- Step 3 — Theme (ADR-036)
- Step 4 — Terminology (ADR-034)
- Step 5 — Seed data (rate tables)
- Step 6 — Partner crates (only if the jurisdiction has typed integrations)
- Step 7 — Check the bundle
- Step 8 — Pin the layer in CRAIG and run a deployment on it
- Opening subsidy writes (the #1797 checklist)
- Verification
- Related decisions
CRAIG is jurisdiction-neutral. The product code carries no Georgia (or any other
state’s) assumptions; a jurisdiction is a configuration layer, a signed git
repository that holds its rule sets and a bundle/ directory of reference data.
This guide walks an engineer through adding a brand-new jurisdiction, from an
empty repository to a deployment that boots against it.
Overview
A CRAIG deployment serves exactly one jurisdiction. This is the
one-deployment-one-jurisdiction rule (ADR-032 §2.7), and the jurisdiction is the
one its configuration names: CRAIG_CONFIG_SOURCE lists the configuration
layers, lowest precedence first, and the highest jurisdiction layer’s manifest
(craig-config.toml) names the jurisdiction. No other setting names it, so two
settings cannot disagree.
Three things make up a jurisdiction:
-
Its configuration layer — a repository
craig-config-<jurisdiction>holding the manifest, the rule sets, the policy manifests and abundle/directory (ADR-087, Where rule sets live). -
Its bundle — the files under
bundle/: rates, codes, calendars, the theme, the terminology overlay, the outbound trigger matrix and a few single-value settings. Each service loads them at boot throughcraig_config_bundle::ConfigBundle, which implements theStateBundletrait the services consume (thebundle/file map). A changed value is a commit in the configuration repository and a restart, not a CRAIG release. -
Its partner code — the one part that is code. A jurisdiction with typed partner integrations writes partner crates against the partner specification (Writing a partner crate) and builds them into two WebAssembly modules, which its configuration layer holds under
partners/beside their source (Partner modules, ADR-090);bundle/adapters.tomllists the adapters the jurisdiction runs. craig-exchange and the mock server load the modules at boot and name no partner. A jurisdiction with no typed integrations needs no code at all.
Boot is fail-closed. A service refuses to start when CRAIG_CONFIG_SOURCE is
unset, a layer is missing or not at its pinned commit, or any bundle file is
refused; the error names the layer, the file and the key
(ADR-072 § Amendment — #2956).
The worked examples are the three layers in use: the Georgia layer (full), the
Texas layer (minimal: five bundle files) and the synthetic testonia fixture
kept in source at fixtures/config/testonia/, which carries one bundle file of
every kind and is the reference for each file’s schema.
Step 1 — Create the configuration layer
Create the repository and its manifest at the root:
schema = 1
layer = "jurisdiction"
jurisdiction = "texas"
The jurisdiction name is a lowercase slug. It prefixes the jurisdiction’s rule
set names (texas-ive-eligibility), keys its business clock and stamps seeded
rows. The layer also carries its policy manifests (policy-source.toml,
citations.toml, citation-exceptions.toml) and its rule sets as top-level
*.json files (Rule Set Patterns and Domain Knowledge).
The head commit of the tracked branch must be signed by a key in the trust root
the deployment holds; CRAIG’s own checks and devstack use
ci/config-trust/<name>.openpgp (Deployment Guide
§ The configuration fetcher).
Step 2 — Write the bundle
Add a bundle/ directory. Every file is optional: an absent file means the
product default for that item, which for most items is "no data"
(the bundle/ file map gives each
file’s default). A file name outside the known set is refused, so a misspelt
name never reads as "no data". Every file refuses an unknown key. Enum values
are snake_case.
A minimal jurisdiction declares only what makes it differ from the defaults. The Texas layer’s whole bundle is five files:
business_timezone = "America/Chicago"
subsidy_writes_enabled = false
[federal_mapping]
tanf = "tanf"
medicaid = "medicaid"
[[field_surfaces]]
surface = "foster_home_portal"
[[search_schemes]]
entity = "persons"
column = "ssn_last_four"
scheme = "opaque"
and bundle/theme.toml (Step 3).
settings.toml — the single values
-
business_timezoneis an IANA tzdb name, the zone everycraig_common::BusinessClockbusiness date projects onto. A real jurisdiction declares it: without one its business dates run on UTC and its AFCARS surface answersjurisdiction-unregistered. -
subsidy_writes_enabledopens craig-financial’s subsidy write acts. Absent isfalse: every subsidy write refuses with 400unsupported-jurisdiction, and reads stay open. Declaretrueonly once the jurisdiction meets Opening subsidy writes (the #1797 checklist). -
medicaid_application_identifier_kindnames the identifier kind a child must hold live through commit for a Medicaid application submit. Absent is no gate. The value must be a tokenidentifier_kinds.tomldeclares. -
perdiem_pays_end_daysays whether a placement’s per-diem pays the day the placement ends (#3189). Absent isfalse: the caregiver is paid from the day the child is placed through the day before the child leaves, the rule that the home where the child spends the night is the one paid. Declaretrueonly where the jurisdiction’s policy pays the day of leaving, with its citation. craig-financial reads it when a placement ends (Data Model: Financial & Claims). -
screening_identifier_kindnames the identifier kind an SSA benefit screening sends for each household member. Georgia namesempi, the DHR client number its Gateway income inquiry is keyed by (Gateway Income and Resource Inquiry (IncomeResourceService)). craig-cases binds each screened member to their live identifier of this kind and releases its value to the screening worker; a member without one refuses the request (409screening-identifier-missing). Absent means the jurisdiction screens no one: every screening request answers 409screening-unconfigured. The value must be a tokenidentifier_kinds.tomldeclares, else craig-cases refuses to boot (#3175). -
person_index_identifier_kindnames the identifier kind an id from the jurisdiction’s person index is recorded under (#3192). Georgia’s index gives theempikind. Absent means the jurisdiction asks no index. The value must be a tokenidentifier_kinds.tomldeclares, else the bundle refuses to load.
partner_types.toml — additions to the shared taxonomy
Every jurisdiction has the 14 product partner types
(craig_state_bundle::PRODUCT_PARTNER_TYPES, the taxonomy the
chk_exchange_partners_partner_type CHECK constraint enforces) without writing
a file. partner_types.toml only adds types; naming a product token in it is a
duplicate error.
federal_mapping.toml — the federal seam
Maps a subset of the partner-type tokens to a federal partner category. An
absent token means "no federal report responsibility"; completeness is checked
when a report is emitted, never at boot, so a jurisdiction may map two tokens or
none. The Georgia layer maps five: tanf, medicaid, child_support,
education, child_abuse_registry.
field_surfaces.toml — governed field surfaces
Names the field-ownership surfaces the jurisdiction hosts (ADR-037 §4). The
surface’s field roster is product; the layer’s field_ownership.toml (at the
layer root) classifies each field’s owner, and craig-placement refuses boot
when the two disagree.
The reference vocabularies
uas_codes.toml, fmap_rates.toml, legal_statuses.toml,
identifier_kinds.toml, holidays.toml, subsidy_policy.toml,
rate_class_policy.toml, compositions.toml and outbound_triggers.toml each
fill the same-named item. The loader checks structure only (the parse, enum
membership, duplicates, references between files); the consuming service checks
meaning at its own boot and refuses what it cannot do without data: no FMAP
rates refuses an eligible determination, no holiday calendar refuses a
holiday-skipping window, no legal-status vocabulary refuses any act that needs
a status.
Step 3 — Theme (ADR-036)
bundle/theme.toml gives the jurisdiction’s palette one of two ways, never
both. An absent file is the product default palette.
- A product palette by name
-
The Georgia layer names a palette CRAIG ships and overrides only the branding:
palette = "simple-statehouse" [branding] agency_name = "Georgia DHS" - Explicit values
-
The Texas layer and the testonia fixture give their own token values:
[branding],[color.light]and[color.dark]tables carrying every role of the Token Schema (written without the--), and optional sparse[color.high_contrast.light]/[color.high_contrast.dark]tables merged over the base modes. A high-contrast override of a token its base mode lacks is refused.
craig-web and craig-intake own rendering — the layer author never writes a
route. At boot each validates the palette’s structural completeness (every
required token present; light and dark declare the same roles) and serves the
materialized CSS from GET /assets/theme.css. A structurally incomplete palette
fails boot. The contrast test in craig-state-bundle
(tests/data/contrast-pairs.toml) holds the product palettes, the locked Texas
layer’s explicit palette and the testonia fixture’s to the same WCAG pairs.
Step 4 — Terminology (ADR-034)
Terminology overrides are flat Fluent (.ftl) catalogs under
bundle/terminology/<lang>/, listed in bundle/terminology.toml. Overridable
vocabulary uses the term- message-name prefix and must be *flat messages —
never Fluent -terms.
[[terminology]]
lang = "en"
file = "terminology/en/worker.ftl"
[[terminology]]
lang = "es"
file = "terminology/es/worker.ftl"
term-admin-unit = County
term-role-caseworker = Social Services Case Manager
Each entry must name an existing file under terminology/<lang>/ for its own
language; the order of the entries is kept.
|
A non-empty terminology overlay must cover both |
Offering workers a second language
The worker application offers a language only when its catalog is complete: it must carry every message the
English catalogs do (ADR-044, the #1487 amendment). The
product ships the worker catalogs in English only, so a jurisdiction that wants Spanish for its workers supplies
the rest through this same overlay: list one or more catalogs for es that together define every message id of
services/craig-web/locales/en/web.ftl and common.ftl, alongside the term-* overrides.
Once the es catalogs are complete the language switcher appears in the worker navigation, and a worker’s choice is
kept in a cookie. While any message is missing the worker application stays in English and shows no switcher; its
boot log names the locale and the number of messages it lacks. A release of CRAIG that adds an English message has
that effect until the catalogs catch up, so check them against the CRAIG version the layer pins.
Step 5 — Seed data (rate tables)
bundle/rate_tables.toml is the jurisdiction’s rate schedule, one table per
row, order kept:
[[rate_tables]]
payment_type = "foster_care"
age_min = 0
age_max = 10
daily_rate = "10.00"
age_min and age_max are inclusive years and daily_rate is a fixed-point
decimal string. The Georgia layer carries five rows (three foster-care age
bands plus adoption- and guardianship-assistance bands); the Texas layer has no
file, declaring no rate policy.
craig-seed loads the same layers the services do (CRAIG_CONFIG_SOURCE) and
takes both the jurisdiction and the rate rows from them. There is no
--jurisdiction flag. A jurisdiction whose layers carry no AFCARS crosswalk
(<jurisdiction>-afcars-crosswalk.json) is seeded without AFCARS policy rows,
and the seed logs one line saying so; craig-reporting boots for such a
jurisdiction and its AFCARS generation answers crosswalk-absent.
Step 6 — Partner crates (only if the jurisdiction has typed integrations)
bundle/adapters.toml lists the partner adapters the jurisdiction runs, by
adapter-kind name:
adapters = ["caps", "cprs", "doe_slds"]
An adapter is code, and the code is the jurisdiction’s: each name must be one
the partner modules of its configuration layer provide (ADR-090).
craig-exchange boots on the partner set those modules hold (Georgia’s, in
craig-config-georgia’s `partners/: eleven adapters, thirteen triggered-send
legs, a collection and the SSA benefit inquiry), registers the listed adapters,
and refuses boot on a name the set lacks. The product’s own SHINES adapter is registered by
craig-exchange itself; a list that names shines is refused. No other service
validates adapter names.
bundle/outbound_triggers.toml is the event → partner-leg matrix
craig-exchange stages from. craig-exchange refuses boot on a row it cannot
serve: a leg the layer’s partner modules do not provide, an adapter that is not
listed, or an event the leg cannot key on
(What boot checks). An absent file
means no event-driven outbound automation.
A jurisdiction bringing its own typed integrations adds, under partners/ in
its configuration repository
(Partner modules):
-
in
partners/src, one partner crate per partner system, written against the partner specification and held to it by the conformance kit (Writing a partner crate): its manual-send adapter, and whichever of a triggered-send leg, a collection, an inquiry and a simulator the partner has; -
in the same workspace, one
cdylibcrate that names those crates and exports the partner set, and one that exports their simulators; -
partners/manifest.toml, which says what the modules are and provide; -
the two modules built from that source and committed beside it (
cargo xtask partners build --layer-path <layer> --write).
Nothing in CRAIG changes for a new partner: no leg, record, acknowledgement,
collection or inquiry is written in craig-exchange, and the only partner crate
in this repository is the reference partner, which no shipped dependency names
(no_manifest_links_a_partner_crate).
cargo xtask partners check --layer-path <layer> holds the source to two
rules (parsing a partner’s bytes has a property test; every string a partner
sends has a length cap), then rebuilds the modules and refuses committed bytes
that differ. The jurisdiction’s pipeline runs it, and CRAIG’s battery runs it
over every fetched layer config-sources.lock pins
(cargo xtask partners check --pinned).
Step 7 — Check the bundle
From a CRAIG checkout, validate the layer directory (the one holding
craig-config.toml) with the loader the services boot through:
cargo xtask config check-bundle ../craig-config-texas
It prints every error with its file and key and exits 1 on any, or prints
bundle ok and exits 0 (CLI reference). To
run CRAIG’s lints and tests against the working copy before it merges, publish
it as the layer: cargo xtask config fetch --layer-path texas=../craig-config-texas
(Local development § Configuration layers).
Step 8 — Pin the layer in CRAIG and run a deployment on it
For CRAIG’s own checks and devstack to read the layer:
-
add a
entry toconfig-sources.lock(name, URL, branch and the signed commit’s SHA) and the layer’s public key toci/config-trust/; -
register the jurisdiction in
BLOCKING_JURISDICTIONS(xtask/src/cmd/policy.rs) so the citation audit blocks on it; -
run
cargo xtask config envand commit what it writes underdevstack/config-sources/: the fetcher’sfetch.envgains the layer, and a new<name>.envholds the federal layer, then the new one (#3143).cargo xtask config env --checkfailsvalidateand the car until you do.
A compose service reads the new layer by naming that file in its env_file:,
as craig-intake-tx names devstack/config-sources/texas.env.
A deployment names its layers in CRAIG_CONFIG_SOURCE on every service, runs
craig-config-fetch to verify and publish them, and mounts the published tree
read-only (Configuration Reference
§ Deployment-Global Variables):
CRAIG_CONFIG_SOURCE=federal=git+https://host/craig-config-federal.git#branch=main, texas=git+https://host/craig-config-texas.git#branch=main
CRAIG_CONFIG_ROOT=/config
Boot fails fast, with no fallback jurisdiction:
-
CRAIG_CONFIG_SOURCEunset or blank; -
no layer in the list names a jurisdiction;
-
a layer missing, refused by the fetcher, or not at its pinned commit;
-
a bundle file refused (unknown file, unknown key, unknown enum token, duplicate, a broken reference between files);
-
on craig-exchange, an adapter name the layer’s partner modules do not provide, a trigger row it cannot serve, a partner set that contradicts itself, modules the host refuses, or a consent variable for an interface the set has no leg or collection for.
Opening subsidy writes (the #1797 checklist)
A new jurisdiction leaves subsidy_writes_enabled at its false default. Every craig-financial subsidy write act and the
generation endpoint refuse the jurisdiction, and neither subsidy scheduler runs; subsidy reads stay open. Set
it to true only in a change that shows the jurisdiction meets all six items of the ruled checklist. The checklist is
ADR-053 § Amendment #1797, which states
each item and the check, if any, that enforces part of it:
-
a program ruleset,
<j>-subsidy-eligibility.jsonin layer<j>; -
a vetted authority family,
<j>-administrative-authority.jsonin layer<j>(ADR-074), with its evidence file; -
UAS codes,
bundle/uas_codes.tomlcovering everySubsidyProgramat every date it writes; -
subsidy policy bundle data,
bundle/subsidy_policy.toml; -
citations for every value of items 1–4, with the jurisdiction in the citation audit’s blocking list;
-
scenario rows,
scenarios/subsidy.tomlin layer<j>(a pack is active because its layer carries it).
The bundle loader refuses the declaration when the layer lacks the content of items 1 to 4: bundle/subsidy_policy.toml,
a bundle/uas_codes.toml entry for every subsidy program, an authority family that gives an office for every subsidy
operation, and the eligibility ruleset
(ADR-053 § Amendment, 2026-11-21).
cargo xtask config check-bundle reports each missing item, and a service given such a layer does not start. The
check is of presence and coverage; whether the content is the jurisdiction’s policy, and items 5 and 6, are for the
reviewer of the change. Georgia meets the list; Texas does not. The checklist is to be amended when real Texas subsidy
content arrives.
Verification
Run these to prove a new jurisdiction loads and CRAIG stays neutral:
# 1. The bundle is structurally valid.
cargo xtask config check-bundle ../craig-config-<name>
# 2. CRAIG's lints and tests pass against the layer (published as a working copy).
cargo xtask config fetch --layer-path <name>=../craig-config-<name>
cargo xtask test
# 3. The fixture bundle and the locked layers load, item by item.
cargo nextest run -p craig-config-bundle
# 4. Only with partner code: the layer's modules are what its source builds.
cargo xtask partners check --layer-path ../craig-config-<name>
Tests take a jurisdiction’s bundle from craig_test_lib::config::bundle("<layer>")
(Testing reference § Config bundles in tests).
Related decisions
-
ADR-032: Multi-Jurisdiction Partner Registry and Transport Abstraction — the
StateBundletrait, partner-type taxonomy, and one-deployment-one-jurisdiction rule (§2.7). -
ADR-072: Policy placement doctrine — the tiers; its #2956 amendment makes the bundle configuration data.
-
ADR-087: Configuration as a git source — the layers, the fetcher and the trust root.
-
ADR-034: Per-Jurisdiction Terminology Resolution via Bundle-Overlaid Fluent Catalogs — the terminology overlay axis (Step 4).
-
ADR-036: Token + Theme Export via Bundle-Provided CSS Custom Properties — the theme axis and
GET /assets/theme.cssrendering (Step 3). -
Token Schema — the canonical light/dark token set an explicit palette must satisfy.
-
The Five Engineering Contracts — the design framing of the contribution axes.
-
Plan S — Multi-Jurisdiction Foundation and Plan U — State Bundle Pattern — the plans that introduced the bundle trait, theme and terminology axes.