Plan: Configuration as a git source — a deployment runs from signed config repos, separate from canopy source (#3254)

Status: In progress
Epic: none (the parent issue carries the units, as the merge-trains plan did)
Issues: #3254 (parent) · #3259 U1 (w5) · #3260 U2 (w5) · #3261 U3 (w3) · #3262 U4 (w5) · #3263 U5 (w2) · #3264 U6 (w8) · #3265 U7 (w3); each unit’s MR Closes its issue, U7 closes the parent. Out of scope, filed: #3266 polling and hot reload, #3267 OCI and cosign, #3268 Studio opens an MR, #3269 key-level merge, #3270 Georgia prose
Branches: feat/config-layers, feat/config-fetch, feat/config-stamp, chore/config-repos, feat/config-pin-ci, chore/config-tx, chore/config-in-source-lint

A Design + Scope plan: GitLab owns tracking, the child issues carry the implementer brief, and the plan freezes when U1 starts.

Erratum (2026-11-07): the neutral notice templates are their own base layer, fixtures/config/notices-neutral/, listed below a pack that ships no notices (test-min, test-max, default), not a whole default layer: under file-level layering a default layer would also fill those packs' deliberate JDM gaps. canopy-notices keeps the development-only gate by the layer kind that supplied notices/manifest.toml.

Erratum (2026-11-10): a unit U3a (#3365) precedes U4. Unit tests read real configuration: 98 test files load Georgia's pack and every fixture pack stacked on the real federal layer, so with rulesets/ gone the unit lane would need the network, against this plan's own rule that a fresh checkout needs none. Maintainer decision: unit tests run on fixture packs only, over a synthetic federal fixture layer (fixtures/config/test-federal/), and a test of a real pack's values runs on the car against the real layers. U4 then deletes rulesets/ with no unit test reading it.

Erratum (2026-11-10): U3's cohort pin is canopy-snap's stamp, not canopy-eligibility's own: GET /v1/params/provenance reports it, since the envelope a case returns is signed by canopy-snap. With one snapshot version, the benefit-date provenance pair is required of a SNAP snapshot, not of a version. The two-commit regression test loads two published trees of one git layer on an ephemeral snap schema, because two path: trees are both stamped path. The migration also empties the quarantine and held-resolution tables, whose rows name determinations of record.

Erratum (2026-11-07): GET /version is documented with the other probes, in services.adoc and the deployment guide's health section, not on each api/canopy-*.adoc page, which documents no probe.

Erratum (2026-11-07): U6's unsettled Texas values are not fixture rows: policy audit refuses fixture authority outside the synthetic packs (FixtureAuthorityInJurisdictionRuleset). An unsettled value keeps the federal reading and cites it, and a tunable with no law behind it cites operational with its reason, each with a row in the repository's docs/gaps.adoc.

Erratum (2026-11-07): U4's config repositories use the fast-forward-only merge method, so a branch head is always a commit the trust-root key signed (a GitLab merge commit is authored by the bot and unsigned), and U4's files include crates/canopy-reference/build.rs, which reads rulesets/federal/cross-program-2026.json at compile time (#3301).

Erratum (2026-11-07): U5's config-repository pipeline replays the repository's own ruleset fixtures (fixtures/rulesets/<ruleset-name>.json, the RulesetFixture schema) beside canopy's, because the in-source gate pairs a jurisdiction-prefixed ruleset only with a fixture of that name in canopy's tree.

Erratum (2026-11-09), U2: the fetcher is ported from craig's craig-config-fetch, the same unit of the same plan (both AGPL), onto canopy-config's types, with craig's tests and one canopy adds for the two-syncs-together guarantee, which needed a per-source lock. cargo xtask ci images and its shared set no longer exist (plan ci-runs-the-dev-loop), so the fetcher is one of the binaries the single build compiles (lanes::BINARY_NAMES) and its image copies it, as the token broker's does. resolve's pin is written &sha=<commit> in the source fragment, which the plan's grammar did not name. A sync with no source, or only path: sources, exits 0, so the devstack's one-shot is a no-op on working copies. The release job publishes the fetcher's image beside the service and portal images, with its digest and SBOM, since a deployment on git sources cannot run without it.

Erratum (2026-11-11), U4: the config repositories were seeded by git subtree split, then every commit was rewritten with the maintainer as author and committer and signed with the trust-root key, because the projects' push rules refuse a pushed commit by GitLab's merge bot or a deleted group token; trees, messages and author dates are unchanged. Their own CI is basic lints only (every JSON and TOML file parses); what the configuration means is tested in canopy's car. A config merge request is rebased locally, never with GitLab's Rebase button, whose commits are unsigned. U4 lands in three merge requests: the lock, the trust roots and cargo xtask config fetch; then the checks and the real-pack tests read the fetched tree; then the devstack boots from the pinned repositories and rulesets/ is deleted. The manuals cache moves from rulesets/<jurisdiction>/.policy-cache/ to target/policy-cache/<jurisdiction>/, since a fetched tree may not be written into, and policy sync-cache --pin is refused for a fetched layer: its citations are pinned in its own repository.

Erratum (2026-11-13), U5: config bump takes a branch, rewrites the lock entry and the compose default that a test holds to it, and stops there; the merge request is opened the usual way, because a commit and push made by the command would pass the commit review by. The configuration-repository template is the basic lints the 2026-11-11 erratum set (every JSON and TOML file parses) plus gitleaks over the whole history, not rules check, rules-lint, scenarios or the canopy-tools image; its regression test therefore plants a file that does not parse rather than a JDM file that does not compile, and drives Docker, so it is an opt-in test outside the battery. The fetcher now refuses a pin that is not on its branch, which the contract test needed.

Erratum (2026-11-13), U7: the lint is cargo xtask config-in-source-lint, a verb of its own like every other lint. The census whose tokens follow the lock is policy audit-jurisdiction-literals, as the design section says: its phone numbers, state code and state name are read from each pinned pack's jurisdiction.toml. neutrality-lint's vocabulary list in compliance/neutrality-gate.toml stays curated, since a manual's name or an agency's acronym is not a field any pack declares. The test runner's image copies the fetched layers for the real-pack tests and is exempt by name. U7 landed before U6, so it closes #3265 only; the plan and #3254 stay open until the Texas layer is pinned. The docs are testing.adoc and tooling/xtask-catalog.adoc; there is no quality-gates.adoc.

Context

What exists. One repository holds canopy’s source and its configuration. rulesets/georgia/ (about 85 tracked files: 16 JDM decision models, jurisdiction.toml, citations.toml, idp.toml, theme.toml, composition/, workflows/, scenarios/ and 61 Typst notice files), rulesets/federal/ (24 regulatory JSON tables plus citations.toml and indexing.toml), and three synthetic packs: default (the neutral reference pack, #1856), test-min and test-max. Every service resolves {rulesets_dir}/{jurisdiction}/jurisdiction.toml at boot from ServiceSettings::rulesets_dir and ServiceSettings::jurisdiction (crates/canopy-common/src/settings.rs); canopy-rules scans rulesets/federal/ then rulesets/{jurisdiction}/ into one in-memory corpus (services/canopy-rules/src/engine.rs, NamedFilesystemLoader); canopy-notices loads the pack’s notices/manifest.toml and falls back to rulesets/default/notices (services/canopy-notices/src/main.rs). The program services read federal tables by path at boot (services/canopy-snap/src/main.rs, canopy-tanf, canopy-medicaid, canopy-caps, canopy-wic). Dockerfile and services/canopy-portal/Dockerfile bake rulesets/ into the images; compose mounts it only into canopy-e2e.

Provenance today stops at content. A signed determination carries policy_target: Option<PolicyTarget> (crates/canopy-signing/src/envelope.rs; crates/canopy-common/src/policy_target.rs): the rules corpus_hash (a SHA-256 over the loaded corpus), the SNAP params_digest and its effective_period. The input snapshot records policy_params_version from [meta].version in jurisdiction.toml (ADR-028 §39). None of these names a git commit, so "which revision of which repository decided this" is answered only by someone who can reproduce the hash.

Direction. The maintainer set the model on #3254 (2026-11-06): a deployment points at a configuration git repo and tracks a branch (branches as channels: ga/production, ga/2027-cola) or stays on main and selects by tag; every determination is stamped with the resolved commit SHA. craig approved the same design the same day (plans/config-git-source.adoc and ADR-087 in gadhs/application/ccwis/craig). The two projects share the design and the must-pass refusal test, and own separate implementations (maintainer, 2026-11-06). canopy’s git-sync 4.5.1 spike (recorded on #3254) showed that git-sync publishes an unsigned or untrusted head regardless of any hook and lacks ssh-keygen, which is why each project owns its fetcher.

Governing ADRs. ADR-003 (rulesets are data in git, loaded read-only at boot), ADR-006 (federal floor plus a jurisdiction layer), ADR-002 and ADR-028 (the signed envelope and the snapshot), ADR-012 (service settings). This plan adds ADR-051 and amends ADR-003 and ADR-006 where they say "under rulesets/ in this repository".

Scope

In scope:

  • A canopy-config crate: the source grammar, the layer manifest, the layered resolver and the immutable ConfigSnapshot every service loads at boot.

  • canopy-config-fetch, canopy’s fetcher: resolve a branch or tag to a SHA, fetch, check out into a worktree, verify the signature against a trust root outside the config repo, publish by an atomic SHA-named symlink flip. A refusal keeps the last good tree and fails loudly.

  • Stamping: the layer SHAs on the signed determination envelope and on the determination snapshot; GET /version on every service.

  • Two configuration repositories, canopy-config-georgia and canopy-config-federal, created with history; a third, canopy-config-texas, built by hand from published Texas policy; config-sources.lock pinning them for CI; rulesets/georgia and rulesets/federal leaving source.

  • A lint that refuses configuration in source outside the fixture packs, and the TX repo passing the train as the proof that no Georgia value remains in source.

  • ADR-051, amendments to ADR-003 and ADR-006, and the canonical pages.

Out of scope (issues filed at approval):

  • Periodic polling of a branch channel and in-process hot reload. v1 applies a new configuration by rollout; the fetcher runs once per rollout.

  • OCI artifacts signed with cosign for air-gapped installs; gitsign trust roots.

  • Key-level merging between layers (file-level, first match by path, is the only rule).

  • Studio’s onboarding wizard (services/canopy-web/src/studio/wizard.rs): it emits a downloadable zip of a scaffolded pack (build_bundle) and keeps doing so; the zip is the seed of a new config repo, and teaching the wizard to open an MR on one is its own feature.

  • Rewriting source comments that mention Georgia as a citation. U7 polices data, not prose.

Design

The boundary

Configuration is anything that varies by jurisdiction or deployment and is data: the JDM rulesets and their citations.toml; jurisdiction.toml; idp.toml, theme.toml; composition/.toml; workflows/.toml; scenarios/*.toml; the Typst notice templates, components, fonts and notices/manifest.toml; the federal regulatory tables and their citations. The .policy-cache/ mirror of the cited manuals travels with the pack it cites (it is already gitignored content a pack owner maintains).

Source is the engine, the configuration schema and its validation, the invariants, and every program’s mechanism. Source keeps the three synthetic packs as fixture layers under fixtures/config/{default,test-min,test-max}/, each complete and valid, so unit tests and a fresh checkout need no network. default stays the neutral reference pack a new jurisdiction copies.

Federal law is a base config repo, canopy-config-federal, not source: it changes on its own cadence (COLA, FPL, SMI) and a deployment pins it like any layer. This settles the question #3254 left open, and matches craig.

Secrets are not configuration. A config repo never holds one; its own CI runs gitleaks as source does.

A config repository

A jurisdiction repo’s root is today’s rulesets/<slug>/ tree, byte for byte, plus a manifest canopy-config.toml at the root:

schema = 1                  # the config schema major; a loader refuses one it does not know
layer = "jurisdiction"      # base | jurisdiction | deployment
jurisdiction = "georgia"    # jurisdiction layers only; the deployment's jurisdiction comes from here

The federal repo is today’s rulesets/federal/ with layer = "base". Keeping the tree shape means every reader that joins rulesets_dir and a file name keeps its join; only the root moves.

Three projects under gitlab.com/gadhs/application/eligibility/: canopy-config-federal, canopy-config-georgia, canopy-config-texas. The first two are created in U4 with git filter-repo from their subdirectories so each file keeps its history; the third is authored in U6.

Sources, layers and the published tree

CANOPY_CONFIG_SOURCE is an ordered list, lowest precedence first:

federal=git+https://gitlab.com/gadhs/application/eligibility/canopy-config-federal.git#tag=federal-2026.11.0,
georgia=git+https://gitlab.com/gadhs/application/eligibility/canopy-config-georgia.git#branch=ga/production

A source is git+https://, git+ssh:// or path:<dir>. #branch=<name> tracks a branch head; #tag=<name> a tag; one of the two is required for a git source. A URL carrying userinfo is refused at parse time; credentials come from the standard git credential environment (a deploy token through GIT_ASKPASS, or a mounted deploy key).

The fetcher publishes each source under CANOPY_POLICY_ROOT/<name>/current → <name>/<sha>/. CANOPY_POLICY_ROOT is new and distinct from CANOPY_CONFIG_ROOT: the latter is the root of the per-service YAML (/app/config, holding the ./config/canopy-<svc> bind mounts and the portal’s baked YAML), and the two never share a directory. In compose the fetcher’s named volume mounts at /app/policy, which is CANOPY_POLICY_ROOT's default. A file path resolves to the highest-precedence layer that holds it; listing a directory is the union of the layers' entries, each resolved the same way. Nothing is merged inside a file.

ServiceSettings::rulesets_dir is retired, and with it the per-service mirrors that joined it: RulesConfig::rulesets_dir and federal_rulesets_dir (services/canopy-rules/src/config.rs, MIRRORED_KEYS), NoticesServiceConfig::rulesets_dir, and every other service’s rulesets_dir key in config/<service>/default.yaml. ServiceSettings::jurisdiction is retired too, and validate_jurisdiction_exists with it (crates/canopy-common/src/settings.rs): the jurisdiction is the manifest’s, read from the highest layer whose layer = "jurisdiction"; a source list with no jurisdiction layer, or two naming different slugs, refuses boot with the layers named. canopy-notices' rulesets/default/notices fallback (fallback_notices_root, default_template_fallback_allowed in services/canopy-notices/src/main.rs) becomes a resolution through the layers: a deployment that wants the neutral templates lists default=path:fixtures/config/default (the devstack) or a canopy-config-default layer below its jurisdiction, and the development-only gate stays as it is.

The fetcher: canopy-config-fetch (new, tools/canopy-config-fetch)

One binary, two commands, built as its own image (tools/canopy-config-fetch/Dockerfile, with git, ssh-keygen and gpg), and added to the shared image set of cargo xtask ci images.

  • resolve turns each source’s branch or tag into a commit SHA (git ls-remote) and prints the pinned list. A rollout runs it once and hands every replica the same pinned list, so replicas move together.

  • sync takes a list, pinned or not, and per source: fetch → git worktree add --detach <name>/<sha>.tmp <sha> → verify → rename to <name>/<sha> → write current.tmp as a symlink → rename(2) over current. Each step is idempotent; an existing verified <sha> is reused; --one-shot is the only mode in v1.

Verification runs before the flip, per source, in a mode the source names (#verify=head|tag|tag-and-head, default head for a branch and tag for a tag, after Flux’s modes): git verify-commit --raw <sha> and/or git verify-tag --raw <tag>, then the signer read from the --raw status lines must be on the source’s trust root. A trust root is an SSH allowed_signers file (gpg.format=ssh) or an OpenPGP fingerprint list, at CANOPY_CONFIG_TRUST_DIR/<name>.allowed_signers or <name>.openpgp, mounted by the deployment and never read from the config repo. The check reads the signer from the status lines, never keyring trust levels. An absent or empty trust root refuses every signer and names the file.

path: sources are not verified. They are stamped path and a service refuses one unless CANOPY_CONFIG_ALLOW_UNVERIFIED=true; the flag is read only when every source is path:, and a git+ source with the flag set refuses boot.

Refusal leaves current untouched, writes CANOPY_POLICY_ROOT/<name>/status.json ({ "ok": false, "sha": "…​", "reason": "…​" }), exits non-zero and logs the reason. A success writes { "ok": true, "sha": "…​", "verified": "head|tag|tag-and-head|path" }. A service reads the status at boot and refuses to start on a source whose last sync failed and which has no previous good tree; /readyz reports a source whose status is ok: false as degraded.

In compose, canopy-config-fetch is a one-shot service every other service depends_on with condition: service_completed_successfully, writing a named volume mounted read-only into every service; in Kubernetes the same image is an init container.

Loading and stamping

A new crate crates/canopy-config owns the manifest, the source grammar, the status file, the layered resolver and:

pub struct Layer { pub name: String, pub sha: ConfigSha, pub root: PathBuf, pub kind: LayerKind }
pub struct ConfigSnapshot { layers: Vec<Layer>, jurisdiction: String }
impl ConfigSnapshot {
    pub fn load(root: &Path, sources: &Sources) -> Result<Self, ConfigError>;   // resolves each `current` once
    pub fn resolve(&self, rel: &Path) -> Option<PathBuf>;                         // highest layer holding `rel`
    pub fn list(&self, rel_dir: &Path) -> Result<Vec<PathBuf>, ConfigError>;      // union, each resolved
    pub fn jurisdiction(&self) -> &str;
    pub fn stamp(&self) -> ConfigStamp;                                           // [{name, sha}] in order
}

ConfigSha is a 40-hex newtype (or the literal path), ConfigStamp a Vec<LayerRef { name, sha }> that serialises as a JSON array and implements Display as name@sha,name@sha. load resolves each current symlink once to its <sha> target and reads through that real path for the life of the process, so a flip during a rollout cannot mix two trees. canopy_api::bootstrap_with (crates/canopy-api/src/bootstrap.rs) builds the snapshot right after it loads ServiceSettings and before telemetry::init_for_pack, which today takes the policy root and the slug and will take the snapshot instead; BootstrapResult gains config: Arc<ConfigSnapshot>, and each service’s main hands it to the loaders it builds and to AppState. ServiceSettings gains config_sources: Sources and loses rulesets_dir and jurisdiction.

Every reader that today joins rulesets_dir goes through snapshot.resolve or snapshot.list: LoggingPolicy::load, NoticeConfig::load, EventRoutingTable::load, RenderEngine::new, the five program parameter loaders, CrossProgramParameterTable, the core services' Params::load and canopy-web’s tables, canopy-composition's loader, canopy-portal’s jurisdiction::load_strings, and canopy-rules' NamedFilesystemLoader (which keeps "federal first, jurisdiction overrides on name collision" by scanning snapshot.list(".") for .json).

Stamping. SignableDetermination (crates/canopy-signing/src/envelope.rs) gains config_stamp: ConfigStamp, required, beside policy_target, set by every program service before signing; pre-1.0 there is no tolerance for an envelope without it, so no Option and no skip_serializing_if. DeterminationSnapshot (crates/canopy-contracts-eligibility/src/snapshot.rs) gains config_stamp: ConfigStamp, required, beside policy_params_version, and SCHEMA_VERSION_MAX moves to 12 with SCHEMA_VERSION_MIN moved to 12 as well: a snapshot without the stamp is refused by verify_schema_version, and the devstack re-seeds. canopy-eligibility’s program_determinations gains config_stamp JSONB NOT NULL, written by the determination consumer (services/canopy-eligibility/src/store/mod.rs), and cohort_runs.expected_policy_target (services/canopy-eligibility/src/bulk/store.rs) gains a sibling expected_config_stamp JSONB NOT NULL; both by a forward migration that drops and recreates the rows' tables' dependants as ADR-016 pre-1.0 allows, since no production database exists. The corpus_hash and params_digest stay: they witness content; the stamp witnesses provenance.

GET /version joins /livez and /readyz in ApiServer::router (crates/canopy-api/src/lib.rs), unauthenticated like the probes: { "service": "canopy-snap", "build": "<git describe at build>", "config": [{ "name": "federal", "sha": "…​" }, { "name": "georgia", "sha": "…​" }], "verified": true }. It carries no secret (Kerckhoffs).

CI and the reference config repos

config-sources.lock at the source root pins { name, url, sha } for federal, georgia and texas. cargo xtask config fetch runs canopy-config-fetch sync over it into target/config/, verifying against ci/config-trust/ (public keys and fingerprints, committed). The devstack (cargo xtask dev start) fetches GA the same way, and CANOPY_CONFIG_SOURCE for a developer who edits a pack is path:../canopy-config-georgia with the unverified flag, which local-dev.adoc documents as the pack author’s loop. Bumping a pin is a source MR whose car runs against the new config.

The in-repo policy checks (cargo xtask rules check, rules-lint, scenarios, policy audit|drift, neutrality-lint, processing-days-lint, compliance) run in source over the locked georgia and texas layers plus the fixture packs: they are canopy’s checks on its reference configs. The jurisdiction-literals census takes its tokens from the lock file plus the fixtures. Each config repo gets its own .gitlab-ci.yml that runs cargo xtask rules check and the schema validation from the canopy-tools image at the canopy version it targets. Tests resolve paths through canopy_test_lib::config::layer(name) instead of ../../rulesets/<slug>.

Layering choice

File-level, first match by path, as Salt gitfs does it: a decision’s inputs are whole files from known layers, every layer’s SHA stamped, so "which value applied" is a lookup, not a computation. A key-level merge is not built; if a deployment needs one it is a new decision.

Risks

Risk Class Mitigation and the test that pins it

A failed sync keeps serving the previous current, so a deployment runs stale config without noticing.

fail-open

status.json says ok:false; /readyz reports degraded; the fetcher’s non-zero exit fails the rollout step. Test (U2): a refused head leaves current, writes the status, exits non-zero; a service booted against it reports unready (U3).

A reader opens files while current flips and reads half from the old tree, half from the new.

silent

load resolves current once to its <sha> path and reads through it; the flip is one rename(2). Concurrency test (U1): a reader holding the resolved path keeps reading the old tree while 1,000 flips run and never sees a mixed file.

A trust-root file is empty, missing or unreadable, so verification trivially passes or trivially fails.

fail-closed

An absent or empty trust root refuses every signer and names the file. Test (U2): a good head against an empty allowed_signers is refused.

The path: escape hatch leaks into a real deployment.

fail-open

The flag is read only when every source is path:; a git+ source plus the flag refuses boot; /version reports verified:false. Test (U1).

A force-pushed branch or a moved tag changes what a channel means after a rollout.

silent

The stamp on every determination names the SHA, not the ref; protected branches and tags on the config projects (maintainer precondition). Test (U3): two determinations under two SHAs of one branch carry different stamps.

A program service signs an envelope without the stamp, or canopy-eligibility records one, and the determination loses its provenance silently.

fail-closed

The field is required on SignableDetermination and DeterminationSnapshot, the column is NOT NULL, and the snapshot schema floor moves to 12. Contract test (U3): an envelope and a snapshot without the stamp are each refused by the verifier and verify_schema_version, with the reason naming the field.

A config repo holds a secret, or a trust decision rests on keyring trust levels rather than the allowlist.

fail-open

Each config repo’s pipeline runs gitleaks (U5), and the source lint refuses a secrets/ path or a SOPS header in a fixture pack (U7). The fetcher parses --raw status lines only; test (U2): a key present in the keyring with full trust but absent from the trust root is refused.

Units (weights by complexity) — U1 → U2 → U3 → U4 → U5 → U6 → U7

Weights: 1 trivial · 2 small · 3 medium · 5 large · 8 very large. One unit = one independently shippable MR = one child issue.

U1 (w5) — canopy-config: sources, manifest, resolver, snapshot; every reader goes through it

Files: crates/canopy-config/src/{lib,sources,manifest,snapshot,status}.rs, crates/canopy-common/src/settings.rs (the retired fields and validate_jurisdiction_exists), crates/canopy-api/src/bootstrap.rs (bootstrap_with, BootstrapResult), crates/canopy-api/src/lib.rs (/version beside /livez), services/canopy-rules/src/config.rs and engine.rs, services/canopy-notices/src/main.rs (the fallback), the five program services' main.rs and params.rs, the core services' Params::load, crates/canopy-composition/src/loader.rs, services/canopy-portal/src/jurisdiction.rs, fixtures/config/{default,test-min,test-max}/ (moved from rulesets/), config//default.yaml and dev.yaml, docker-compose.yml (CANOPY_POLICY_ROOT, the path: sources for the devstack), Dockerfile, services/canopy-portal/Dockerfile.

The crate, the path: source kind, the three fixture packs moved with git mv, rulesets_dir and jurisdiction retired, every reader through the snapshot, GET /version on every service. rulesets/georgia and rulesets/federal stay where they are for now and are named as path: sources by the devstack and the tests, so behaviour does not change. Tests: property (proptest), the highest layer wins for every path and listing is the union; contract, an unknown schema major, a userinfo URL, a source list without a jurisdiction layer, two jurisdiction layers with different slugs, and git+ plus the unverified flag are each refused, and /version's shape per service; regression, each service loads the same bytes as before (a golden over the loaded set, per service, computed once on main before the change); concurrency, the reader-during-flip test. Docs: configuration-reference.adoc (CANOPY_CONFIG_SOURCE, CANOPY_POLICY_ROOT, the retired settings), services.adoc and each api/canopy-*.adoc (/version), shared-crates.adoc (the crate), rulesets.adoc (the manifest, the fixture packs' new home).

U2 (w5) — canopy-config-fetch: resolve, sync, verify, refuse

Files: tools/canopy-config-fetch/src/{main,resolve,sync,verify,trust}.rs, tools/canopy-config-fetch/Dockerfile, xtask/src/cmd/ci/images.rs (the shared set), docker-compose.yml (the one-shot service and the volume), crates/canopy-config/src/status.rs (shared with U1).

Must-pass, shared with craig (contract tests): an unsigned head and an untrusted-key head each leave current on the last good SHA, exit non-zero and write status.json; a good head flips; a tag in tag mode and tag-and-head; replaying sync is idempotent; SSH and OpenPGP trust roots each refuse an off-list signer; an empty trust root refuses a good head; a keyring-trusted key absent from the trust root is refused. Concurrency: two sync runs started together on one root publish one tree and one status.json. Real git, real keys, a temp dir; runs in the unit lane, no devstack. Docs: deployment-guide.adoc (the fetcher, trust dirs, the compose one-shot, the Kubernetes init container), security.adoc (trust roots, what a config signer can and cannot do).

U3 (w3) — The stamp on the envelope, the snapshot and the row

Files: crates/canopy-signing/src/envelope.rs, crates/canopy-contracts-eligibility/src/snapshot.rs, each program service’s determine path where policy_target is set, services/canopy-eligibility/migrations/<ts>_program_determinations_config_stamp.sql, services/canopy-eligibility/src/store/mod.rs, the determination consumer.

config_stamp required on SignableDetermination and DeterminationSnapshot (schema 12, floor 12), program_determinations.config_stamp and cohort_runs.expected_config_stamp NOT NULL, written from the snapshot each service loaded. Tests: contract, an envelope without the stamp fails verification and a snapshot at schema 11 or without the stamp fails verify_schema_version, each naming the field; regression (devstack, two path: trees), two determinations under two SHAs of one branch carry different stamps and the row’s column matches the envelope’s; contract, a service booted against ok:false with no good tree refuses, and /readyz degrades on ok:false with a good tree. Docs: data-models/canopy-eligibility.adoc, api/canopy-eligibility.adoc, ADR-002 and ADR-028 amendments (one paragraph each: the stamp beside the policy target).

U4 (w5) — The federal and Georgia config repos; the lock file; rulesets/ leaves source

Files: config-sources.lock, ci/config-trust/, xtask/src/cmd/config.rs (cargo xtask config fetch), crates/canopy-test-lib/src/config.rs (layer(name)), the ~100 test files that read ../../rulesets/…​, xtask/src/devstack_guard.rs (the rulesets.sha256 staleness marker now hashes the fetched tree), the xtask policy checks (their roots), tests/e2e/lib/given/config.ts, .gitlab-ci.yml (one config fetch step in the check and stack jobs), Dockerfile, services/canopy-portal/Dockerfile, tools/canopy-token-broker/Dockerfile (stop copying rulesets/).

canopy-config-federal and canopy-config-georgia created by git filter-repo with history, each with its manifest and a pipeline; the lock pins them; the devstack and CI fetch; rulesets/ is deleted from source. Tests: regression, the full car green against the locked repos (every stack job boots from the fetched tree, GET /version shows the locked SHAs); contract, config fetch refuses a lock entry whose SHA fails verification against ci/config-trust/, and canopy_test_lib::config::layer("georgia") resolves to the fetched tree and refuses an unknown name. Docs: local-dev.adoc (fetching config; the pack author’s path: loop), rulesets.adoc repointed at the repos, jurisdiction-onboarding.adoc (a new jurisdiction is a new repo from fixtures/config/default), CHANGELOG.adoc ops note (the retired settings, the new required CANOPY_CONFIG_SOURCE), ADR-003 and ADR-006 amendments.

U5 (w2) — The pin bump as a car; the config repos' own pipelines

Files: xtask/src/cmd/config.rs (cargo xtask config bump <name> <ref>), .gitlab-ci.yml in each config repo (a template under devstack/config-repo-ci/).

A bump rewrites the lock entry from resolve and opens the MR; each config repo’s pipeline runs cargo xtask rules check, rules-lint, scenarios and the schema validation from the canopy-tools image, and gitleaks. Tests: contract, a lock entry whose SHA is not on the named branch fails config fetch with the reason, and config bump refuses a ref resolve cannot find; regression, the config-repo pipeline template fails on a planted secret and on a JDM file that does not compile. Docs: contributor-workflow.adoc (a policy change is a config-repo MR, then a pin bump).

U6 (w8) — canopy-config-texas

Files: the new repository, authored from fixtures/config/default, with jurisdiction.toml, citations.toml and the JDM rulesets for SNAP, TANF and Medicaid from the Texas Works Handbook and the Texas Medicaid eligibility handbooks, CAPS and WIC from the Texas Workforce Commission and Texas DSHS manuals; config-sources.lock (the third entry); .gitlab-ci.yml (a TX stack job on the car, or a scheduled TX lane if the car’s budget says so, decided by the measured car time at U6).

Best effort with cited sources, per the maintainer’s pre-1.0 direction; a Texas value the manuals do not settle is a fixture-authority row, as default does it. Tests: regression, the train green with the TX layer booted on every service and the TX scenario packs passing; contract, policy audit finds a citation for every non-fixture TX value. Docs: rulesets.adoc (the TX pack’s status and sources).

U7 (w3) — cargo xtask lints config-in-source; closes #3254

Files: xtask/src/cmd/config_in_source_lint.rs (beside the other *_lint.rs commands), xtask/src/cmd/neutrality_lint.rs (tokens from the lock plus fixtures), .gitlab-ci.yml (the lint in the check job).

No config kind outside fixtures/config/; no image copies config; no secrets/ path or SOPS header inside a fixture pack; the census tokens come from the lock. Tests: regression, the lint fails on a planted JDM file, jurisdiction.toml, notice template and SOPS-headed file under services/ and fixtures/config/ (fixtures), and passes on main. Docs: quality-gates.adoc and tooling/xtask-catalog.adoc; the plan’s Status set to Done.

Preconditions the maintainer owns: creating the three GitLab projects with protected main and protected tags (U4, U6), and the signing keys listed in ci/config-trust/ whose commits the reference repos accept.

Every unit also carries its CHANGELOG.adoc == Unreleased entry and regenerates any API page it touches; the plan’s Status moves to In progress when U1 starts.

ADR-051 (written in U1’s MR with the plan’s acceptance; the text the maintainer approves here)

Title: Configuration is a git source: a canopy-owned fetcher publishes a verified commit, services load it at boot and stamp its SHA.

Status: Accepted (date of approval) with this plan, #3254. Amends ADR-003 and ADR-006 (the pack’s home), ADR-002 and ADR-028 (the stamp).

Context: as this plan’s Context, in four sentences.

Decision:

  1. Configuration is ordered git layers. CANOPY_CONFIG_SOURCE lists sources lowest precedence first: a federal base, a jurisdiction, optionally a deployment layer; each is git+https://, git+ssh:// or path:, tracking a branch or a tag. A file resolves to the highest layer holding it; nothing is merged inside a file.

  2. canopy owns the fetcher, canopy-config-fetch. resolve pins refs to SHAs once per rollout so replicas move together; sync fetches, checks out into a worktree, verifies, and publishes by renaming a SHA-named directory and flipping current with rename(2).

  3. Verification gates publication: git verify-commit and/or git verify-tag, and the signer read from the raw status must be on the source’s trust root, which the deployment mounts and the config repo never carries. A refusal leaves current on the last good SHA, exits non-zero and writes a status file; a service with no good tree refuses to start.

  4. Services load at boot and stamp what they loaded: one immutable snapshot per process; every signed determination and its snapshot carry the layer SHAs; every service answers GET /version.

  5. Git is the authority: a policy change is a signed commit on a config repo and a rollout; rollback is moving the branch or tag.

  6. Credentials never ride in the URL.

Alternatives considered: runtime pull in each service; bake at build time; a GitOps operator; git-sync with a verify hook (rejected on the spike’s evidence); OCI artifacts with cosign (kept as a future path); a shared fetcher with craig (ruled out by the maintainer). Each with its one-line reason as recorded on #3254.

Consequences: rulesets/georgia and rulesets/federal leave source and the fixture packs stay; CI fetches pinned GA and TX config so a misplaced item fails the train; a configuration change is a signed commit plus a rollout, with no hot reload in v1; decisions become traceable to a signed commit; canopy maintains a small fetcher and its refusal tests.

Verification

  1. cargo xtask test — the unit lane passes, the fetcher’s must-pass tests included.

  2. After U4: the devstack and every car run only from fetched, verified config; GET /version on every service shows the locked SHAs; a program_determinations row joined to its envelope names the config commit.

  3. After U6: the train is green with the TX layer booted on every service.

  4. The merge train’s pipeline is green (CI is the gate).

Documentation Updates

  • api/canopy-*.adoc (/version), data-models/canopy-eligibility.adoc (the stamp columns), services.adoc

  • CHANGELOG.adoc — one entry per unit under == Unreleased; U4’s is an ops note

  • configuration-reference.adoc, deployment-guide.adoc, local-dev.adoc, rulesets.adoc, jurisdiction-onboarding.adoc, security.adoc, contributor-workflow.adoc, quality-gates.adoc, tooling/xtask-catalog.adoc, shared-crates.adoc

  • ADR-051 new; ADR-002, ADR-003, ADR-006 and ADR-028 amended

Review log

round vendor resolved model verdict

1

Anthropic

claude-fable-5-1

FLAGS: a risk classed compat; tracking pointers unfilled; files named but not supplied; CANOPY_CONFIG_ROOT would collide with the per-service YAML mounts; the per-service rulesets_dir mirrors unnamed; an Option stamp was pre-1.0 scaffolding. All fixed in the draft before approval.

2

Google

gemini-4-argon

FLAGS: the same class and scaffolding points; test categories missing per unit; seams misdescribed (bootstrap_with and init_for_pack, the snapshot’s schema bounds, cohort_runs in bulk/store.rs, the wizard’s zip, the notices fallback); never claims without pinning tests. All fixed in the draft before approval.

Edit this page · default