ADR-089: The Partner Specification — a Partner Crate Implements Contracts the Product Owns, and craig-exchange Names No Partner
Status
Accepted (2026-11-29) with plan the partner specification, #3196. The maintainer ruled the scope that day: generic specifications for how partner crates work, made executable, with Georgia’s partners ported onto them inside CRAIG. Where a jurisdiction’s partner crates then live, and who builds the binary that links them, is #3200 and is not decided here.
It amends one clause each of ADR-032 (what the erased error carries, and who contributes legs), ADR-066 (who holds the typed SSA adapter and the send-authority witness), ADR-072 ("Partner adapters stay source") and ADR-075 (decision 1: who owns the legs). Each of those pages carries a note naming its clause.
Context
Product source names no jurisdiction (ADR-072). Partner adapters are the stated exception: an adapter is code a
configuration file cannot state, so Georgia’s adapters are crates under crates/craig-partner-*, aggregated by
craig-partners-ga and linked into craig-exchange behind the partners-ga feature.
The exception was drawn at the crate boundary, and partner knowledge sits on the product’s side of it:
-
Triggered sends. The thirteen legs are an enum inside craig-exchange (
services/craig-exchange/src/triggers/legs.rs:Family,Leg), with the education agency’s record and acknowledgement rules beside it and its resolve rules intriggers/doe_passes.rs. ADR-075 decision 1 put them there. A jurisdiction’s trigger matrix only selects among them. -
Failures. The erased adapter error boxes the partner’s error type, so craig-exchange downcasts to
CprsErrororDoeSldsErrorto tell a timeout from a refusal. -
SSA screening. The pipeline in
services/craig-exchange/src/ssa_worker.rsbuilds Georgia Gateway’s income inquiry and constructsSsaSolqAdapteritself (ADR-066 §D5).
So craig-exchange depends on three of Georgia’s partner crates unconditionally, and turning partners-ga off does not
take Georgia’s rules out of the build.
Two kinds of leg already have a seam of the right shape. A manual send is ExchangeAdapter with its erased form
(ADR-032 §1.1). A collection is CollectionAdapter with ErasedCollection (#3188): the partner crate implements a
trait over record types the product owns, the jurisdiction’s aggregator registers it, and craig-exchange’s runner is
generic. The conformance checks (crates/craig-partner-test-harness) cover the manual send only.
The maintainer’s direction (2026-11-29) is that no other jurisdiction cares what Georgia uses for its interfaces, and that the first thing needed is a generic specification for how a partner crate works. Moving Georgia’s crates out of the repository was the original request (#3196 as first filed); the groundwork showed that the move cannot be designed until the product has a seam for every kind of leg, and that this work is the same whichever way the crates later travel.
Decision
-
The specification has three parts, and the product owns all three. The contracts are traits and types in
craig-exchange-contracts. The conformance kit iscraig-partner-test-harness, which a partner crate runs against itself. The partner set is the one value a jurisdiction’s aggregator exports. A partner crate depends on the specification’s crates (craig-exchange-contracts,craig-exchange-transport,craig-state-bundle,craig-validation) and on no other part of CRAIG. -
A partner’s failure is read without its type. Every adapter and collection error implements
PartnerFailureView(transport, timeout, malformed, or a refused status with its bounded body), and the erased error keeps that view. The view also says whether a refused body may contribute a digest, because only the partner crate knows whether its bodies can echo an identifier. craig-exchange classifies every partner’s failure with one function and downcasts nothing. -
A triggered-send leg is a
TriggerLeg: aLegSpecand three behaviours. The spec is data: its persisted tokens, the entity its admission keys on, the stage it acts on, its resolve rule, and whether it opens a stage. The behaviours are which principals it admits, how it assembles one record, and what the partner’s acknowledgement meant. A leg sees the specification’s own view of a stage and its people, not craig-cases' wire types, and that view names a person’s identifier generically, with its kind. -
How an event identifies its occurrence is the product’s knowledge. craig-exchange holds one catalogue of the events a leg may be bound to: which entity each names, its subject, its revision and its discriminator. A leg declares what it needs; it does not read a payload.
-
The rules of a per-person listing are leg data. Whether a partner keeps one listing per person, which legs wait for an earlier listing to settle and which are superseded by a re-entry are fields of the spec. The locking, the ordering and the two gates stay craig-exchange’s and read only the spec.
-
An inquiry is an
Inquiryover a question and an answer the product defines. SSA benefit screening stays a product function, with its runs, members, fences and retention in craig-exchange; the source that answers is the partner’s. The send-authority witness (ADR-066, amendment of #1479) stays in the partner crate, unconstructible in a release build: the partner’s inquiry holds it and reports its authority, and a set that holds none pauses every jobcontract-pendingas today. Activation remains a code change. -
A jurisdiction registers one
PartnerSet: its adapters, collections, legs and inquiries. The set validates itself (no duplicate leg, no leg without its adapter, one opening leg per interface and stage kind), boot checks it against the configuration and refuses a mismatch, and its manifest is derived from what is registered rather than written beside it. Consent to send or collect is keyed by interface token, with no field per partner. -
A reference partner that is nobody’s implements one of everything. It is the fixture jurisdiction’s (
testonia_registry), passes the kit, and is a development dependency only. craig-exchange’s unit tests of its generic machinery run on it; a test of one partner’s own rules lives in that partner’s crate. -
craig-exchange names no partner, and gates hold it. It links a partner crate only through a jurisdiction’s aggregator feature, and no code of craig-exchange outside its tests holds a partner kind token.
-
No persisted token changes. Interface, leg, entity, class and transaction-type tokens are stored as text and stay byte-identical, and a ported leg assembles the bytes it assembled before.
The plan names the test that holds each of these.
Consequences
-
A second jurisdiction’s partners are written against one page and the kit, with no change to craig-exchange.
-
A partner crate’s dependencies are the specification’s crates only, which is what makes a decision on #3200 possible in either direction.
-
craig-exchange loses the exhaustive match over an enum of legs: a new leg no longer fails to compile until its rules are written. The set’s validation at boot and the kit’s checks replace it, and the kit refuses a set that registers a leg it was given no fixtures for.
-
The contracts become a compatibility surface the day a partner crate lives outside this repository. While the crates are in the tree they change in one merge request; #3200 has to say how they change afterwards.
-
An inner adapter error of unknown type can no longer be built, so the "unrecognised error" class of failure disappears with its tests.
-
A consent variable for an interface the build has no leg for used to be ignored and now refuses boot.
-
The SSA wiring point moves from craig-exchange (
solq_send_authority) to the partner set. The custody boundary itself, the unconstructible proof, does not move. -
The return leg (a partner calls CRAIG) gets its contract with the listener that #3172 ruled, not here.
Open questions
-
Where a jurisdiction’s partner crates live and who builds the binary: #3200. Decided by ADR-090; see the amendment below.
-
Which identifier craig-cases releases for a send. Its projection serves one fixed kind today, and craig-exchange maps it onto the generic view: #3201, designed with the person-index plan (#3192).
Alternatives considered
-
Move the crates first (the original #3196). Rejected: without a leg seam the move would carry craig-exchange’s own modules with it, and the choice between pulling a jurisdiction’s crates and letting it build its own distribution has no evidence behind it until the port exists.
-
A prose-only specification. Rejected: nothing holds the code to it.
-
Traits alone. Rejected: they fix a shape, not a behaviour. The kit is what says a closed-world simulator answers "not known" and an acknowledgement for another record is a mismatch.
-
A language-neutral component interface (WebAssembly components). Rejected for now: it forces the run-time plugin decision before the seam is proven, and a simulator’s router would stay native either way.
-
A leg takes craig-cases' projection types. Rejected: it ties every partner crate to an internal service wire. The collection seam already keeps the product’s record types in the contracts crate.
-
An owned failure value in place of the boxed error. Rejected: it changes the text a manual send persists as its last error.
-
A hand-written manifest. Rejected: a second copy of what the registered objects state, free to drift.
-
Payload keys in each leg’s spec. Rejected: every partner crate would restate the product’s event shapes.
-
Move the screening pipeline out with its source. Rejected: screening is the product’s; only the source is a jurisdiction’s.
Amendment — #3200 (2026-11-30): a jurisdiction’s partner crates load as modules (ADR-090)
ADR-090 decides the first open question and amends four clauses; it is delivered by its plan’s steps. Until the plan’s switch lands, the tree is as the text above describes it.
-
Decision 1, what a partner crate depends on. The specification’s crates become
craig-exchange-contracts,craig-exchange-transportwithout its socket code,craig-validationand an SDK crate that holds the simulator’s types.craig-state-bundleleaves the list. -
Decision 6, the send-authority witness. It moves with Georgia’s crate to Georgia’s repository. In this repository a shipped host grants a module’s inquiry no authority (ADR-090, decision 4).
-
Decisions 7 and 9, the aggregator. A jurisdiction no longer exports a
PartnerSetfrom an aggregator crate that craig-exchange links behind a feature. Its module exports the set through the component contract, the host builds thePartnerSetfrom it, and craig-exchange links no partner crate at all. -
Alternatives, "A language-neutral component interface … Rejected for now". Adopted. The seam is proven, and a simulator’s router runs inside a module.
The contracts, the conformance kit, the reference partner and the rule that no persisted token changes all stand.