Skip to content

Commit b885e3e

Browse files
committed
feat(adapter): add the Adapter live translation facade
Serve a standard registry API over systems that already hold the data, translating each request and response live, with no record store and no decisions. Adds the registry-adapter, registry-adapter-core and registry-adapterctl crates, packs and offline fixtures, the refusal corpus, and the shared platform support they need (destination policy, OAuth client, resilience, rolling rate window, script additions, config conformance cases). Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
1 parent ae3b1c8 commit b885e3e

768 files changed

Lines changed: 139884 additions & 95 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/ci_changes.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"registry-platform-objectstore",
4040
"registry-platform-oidc",
4141
"registry-platform-ratelimit",
42+
"registry-platform-resilience",
4243
"registry-platform-script",
4344
"registry-platform-sdjwt",
4445
"registry-platform-sqlite",
@@ -96,6 +97,11 @@
9697
"registry-documentsctl",
9798
"registry-documents-client",
9899
),
100+
"adapter": (
101+
"registry-adapter-core",
102+
"registry-adapter",
103+
"registry-adapterctl",
104+
),
99105
"stack-client": ("registry-record", "registry-stack-client"),
100106
"evidence": (
101107
"registry-evidence",
@@ -132,6 +138,7 @@
132138
SCHEDULING_PACKAGES = frozenset(SHARDS["scheduling"])
133139
MESSAGING_PACKAGES = frozenset(SHARDS["messaging"])
134140
DOCUMENTS_PACKAGES = frozenset(SHARDS["documents"])
141+
ADAPTER_PACKAGES = frozenset(SHARDS["adapter"])
135142
# The Document Store PostgreSQL journey drives the real registry-render binary.
136143
DOCUMENTS_POSTGRES_PACKAGES = DOCUMENTS_PACKAGES | {"registry-render"}
137144
# The credential status ledger and the OID4VCI store run their PostgreSQL
@@ -166,6 +173,7 @@
166173
CONFIG_CHECK_PACKAGES = frozenset(
167174
{
168175
"registry-coordinator",
176+
"registry-adapterctl",
169177
"registry-breg-mcp",
170178
"registry-breg-review",
171179
"registry-bregctl",
@@ -1196,6 +1204,8 @@ def classify(
11961204
seeds.update(MESSAGING_PACKAGES)
11971205
elif path.startswith("products/documents/"):
11981206
seeds.update(DOCUMENTS_PACKAGES)
1207+
elif path.startswith("products/adapter/"):
1208+
seeds.update(ADAPTER_PACKAGES)
11991209
elif path.startswith("products/coordinator/"):
12001210
seeds.add("registry-coordinator")
12011211
elif path.startswith("products/identifiers/"):
@@ -1607,6 +1617,7 @@ def classify(
16071617
"messaging_postgres": bool(affected & MESSAGING_PACKAGES),
16081618
"documents_contracts": bool(affected & DOCUMENTS_PACKAGES),
16091619
"documents_postgres": bool(affected & DOCUMENTS_POSTGRES_PACKAGES),
1620+
"adapter_contracts": bool(affected & ADAPTER_PACKAGES),
16101621
"coordinator": "registry-coordinator" in affected,
16111622
"release_tool": release_tool,
16121623
"release_source_proof": release_source_proof,

‎.github/scripts/test_ci_changes.py‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
BREG_PACKAGES,
3333
CASEWORK_PACKAGES,
3434
DOCUMENTS_PACKAGES,
35+
ADAPTER_PACKAGES,
3536
MESSAGING_PACKAGES,
3637
MESSAGING_TUTORIAL_INPUTS,
3738
RENDER_TUTORIAL_INPUTS,
@@ -357,6 +358,9 @@ def test_deferred_ci_work_keeps_its_selector_and_explicit_status_guard(
357358
"documents-postgres": (
358359
"needs.changes.outputs.documents_postgres == 'true'"
359360
),
361+
"adapter-contracts": (
362+
"needs.changes.outputs.adapter_contracts == 'true'"
363+
),
360364
"evidence-postgres": (
361365
"needs.changes.outputs.evidence_postgres == 'true'"
362366
),
@@ -501,6 +505,7 @@ def test_ci_scheduling_graph_retains_every_job_and_aggregate_dependency(
501505
"messaging-smtp",
502506
"documents-contracts",
503507
"documents-postgres",
508+
"adapter-contracts",
504509
"coordinator-postgres",
505510
"release-tool",
506511
"release-tool-required",
@@ -546,6 +551,7 @@ def test_ci_scheduling_graph_retains_every_job_and_aggregate_dependency(
546551
"messaging-smtp",
547552
"documents-contracts",
548553
"documents-postgres",
554+
"adapter-contracts",
549555
"coordinator-postgres",
550556
"config-conformance",
551557
),
@@ -577,6 +583,7 @@ def test_ci_scheduling_graph_retains_every_job_and_aggregate_dependency(
577583
"messaging-smtp",
578584
"documents-contracts",
579585
"documents-postgres",
586+
"adapter-contracts",
580587
"coordinator-postgres",
581588
"config-conformance",
582589
"release-tool",
@@ -641,7 +648,7 @@ def test_final_aggregate_flattens_rust_results_with_equivalent_outcomes(
641648
final_needs,
642649
previous_final_needs.difference({"rust-result"}).union(rust_needs),
643650
)
644-
self.assertEqual(41, len(final_needs))
651+
self.assertEqual(42, len(final_needs))
645652
# Platform line coverage publishes from main and the nightly sweep;
646653
# it does not hold the merge queue.
647654
self.assertNotIn("platform-coverage", final_needs)
@@ -1219,6 +1226,29 @@ def test_document_store_product_and_core_select_its_own_gates(self) -> None:
12191226
self.assertFalse(unrelated["documents_contracts"])
12201227
self.assertFalse(unrelated["documents_postgres"])
12211228

1229+
def test_adapter_crates_and_product_select_its_shard(self) -> None:
1230+
for path in (
1231+
"products/adapter/CONCEPT.md",
1232+
"crates/registry-adapter-core/src/lib.rs",
1233+
"crates/registry-adapter/src/lib.rs",
1234+
"crates/registry-adapterctl/src/main.rs",
1235+
):
1236+
with self.subTest(path=path):
1237+
outputs = classify(self.workspace, (path,))
1238+
self.assertIn(
1239+
"adapter",
1240+
{row["name"] for row in outputs["rust_matrix"]["include"]},
1241+
)
1242+
self.assertTrue(outputs["adapter_contracts"])
1243+
product = classify(self.workspace, ("products/adapter/CONCEPT.md",))
1244+
self.assertLessEqual(set(ADAPTER_PACKAGES), set(product["rust_packages"]))
1245+
unrelated = classify(self.workspace, ("crates/registry-documents/src/lib.rs",))
1246+
self.assertNotIn(
1247+
"adapter",
1248+
{row["name"] for row in unrelated["rust_matrix"]["include"]},
1249+
)
1250+
self.assertFalse(unrelated["adapter_contracts"])
1251+
12221252
def test_evidence_status_store_and_dependencies_select_the_postgres_job(
12231253
self,
12241254
) -> None:
@@ -3702,6 +3732,7 @@ def test_lock_selection_follows_build_and_dev_edges_to_every_consumer(
37023732
change.members,
37033733
frozenset(
37043734
{
3735+
"registry-adapter",
37053736
"registry-breg",
37063737
"registry-coordinator",
37073738
"registry-evidence",

‎.github/scripts/test_nightly_rust_coverage.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_all_live_shards_have_stable_flags_and_owned_packages(self) -> None:
4141
"scheduling": "scheduling",
4242
"messaging": "messaging",
4343
"documents": "documents",
44+
"adapter": "adapter",
4445
"stack-client": "stack-client",
4546
"evidence": "evidence",
4647
"developer-tools": "developer-tools",

‎.github/workflows/ci.yml‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
messaging_postgres: ${{ steps.filter.outputs.messaging_postgres }}
7979
documents_contracts: ${{ steps.filter.outputs.documents_contracts }}
8080
documents_postgres: ${{ steps.filter.outputs.documents_postgres }}
81+
adapter_contracts: ${{ steps.filter.outputs.adapter_contracts }}
8182
coordinator: ${{ steps.filter.outputs.coordinator }}
8283
release_tool: ${{ steps.filter.outputs.release_tool }}
8384
release_source_proof: ${{ steps.filter.outputs.release_source_proof }}
@@ -1308,6 +1309,44 @@ jobs:
13081309
DOCUMENTS_TEST_DATABASE_URL: postgresql://documents:documents_test@localhost:${{ job.services.postgres.ports['5432'] }}/documents
13091310
run: cargo test --locked -p registry-documents --features postgres-test --test postgres_hooks
13101311

1312+
adapter-contracts:
1313+
name: Registry Adapter product contracts
1314+
needs: [changes, rust-policy]
1315+
if: ${{ !cancelled() && needs.changes.result == 'success' && needs.changes.outputs.adapter_contracts == 'true' }}
1316+
runs-on: ubuntu-24.04
1317+
# The script formats, lints, and tests the adapter crates, holds the
1318+
# generated schemas and the configuration conventions against their
1319+
# generators, holds the Camel port table against the code, and checks
1320+
# the example, its fixture replay, the source-shape fixtures, and the
1321+
# bad-authoring corpus against the adapterctl binary it builds. All
1322+
# of it compiles cold: CARGO_TARGET_DIR is set because the script
1323+
# builds its own adapterctl there and refuses to guess a binary
1324+
# without it.
1325+
timeout-minutes: 40
1326+
steps:
1327+
- name: Checkout
1328+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
1329+
with:
1330+
persist-credentials: false
1331+
submodules: false
1332+
1333+
- name: Cache Cargo registry
1334+
uses: Swatinem/rust-cache@c8037a86dde8214a8310e9f54a8fc61ab362aa31 # v2
1335+
with:
1336+
shared-key: workspace-registry
1337+
cache-targets: false
1338+
save-if: ${{ github.ref == 'refs/heads/main' }}
1339+
1340+
- name: Install uv
1341+
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
1342+
with:
1343+
version: "0.11.16"
1344+
1345+
- name: Registry Adapter contract consistency
1346+
env:
1347+
CARGO_TARGET_DIR: ${{ github.workspace }}/target
1348+
run: products/adapter/scripts/check-contracts.sh
1349+
13111350
coordinator-postgres:
13121351
name: Coordinator PostgreSQL runtime
13131352
needs: [changes, rust-policy]
@@ -1886,7 +1925,7 @@ jobs:
18861925
-p registry-bregctl -p registry-caseworkctl -p registry-schedulingctl
18871926
-p registry-coordinator
18881927
-p registry-messagingctl -p registry-discoveryctl -p registry-render
1889-
-p registry-documentsctl
1928+
-p registry-documentsctl -p registry-adapterctl
18901929
-p registry-evidence -p registry-evidencectl -p registry-manifest-cli
18911930
-p registry-breg-mcp -p registry-breg-review -p registry-evidence-oid4vci -p registry-mcp
18921931
@@ -1916,6 +1955,7 @@ jobs:
19161955
- messaging-smtp
19171956
- documents-contracts
19181957
- documents-postgres
1958+
- adapter-contracts
19191959
- coordinator-postgres
19201960
- config-conformance
19211961
runs-on: ubuntu-slim
@@ -3353,6 +3393,7 @@ jobs:
33533393
- messaging-smtp
33543394
- documents-contracts
33553395
- documents-postgres
3396+
- adapter-contracts
33563397
- coordinator-postgres
33573398
- config-conformance
33583399
- release-tool

‎.gitleaks.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,17 @@ regexes = [
3232
'''"eyJhbGciOiJFUzI1NiJ9\.eyJzdWIiOiJzdGFmZi1zdWJqZWN0In0\.c2lnbmF0dXJlLWJ5dGVzLXZhbHVl"''',
3333
'''"eyJhbGciOiJFUzI1NiJ9\.eyJncmFudCI6InRhc2sifQ\.Z3JhbnQtc2lnbmF0dXJl"''',
3434
]
35+
36+
[[allowlists]]
37+
description = "Allow the throwaway ECDSA client key generated for the Adapter mTLS unit tests; it exists only under #[cfg(test)] and no deployment has trusted its self-signed certificate."
38+
condition = "AND"
39+
paths = ["^crates/registry-adapter/src/auth/tls\\.rs$"]
40+
regexTarget = "line"
41+
regexes = ['''const CLIENT_PRIVATE_KEY_PEM: &str = "-----BEGIN PRIVATE KEY-----\\nMIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgcu64hV3YOzpMTbrA''']
42+
43+
[[allowlists]]
44+
description = "Allow the reconstructed GraphQL page-state token in the Adapter GraphQL cursor source-shape fixture; it is a documented synthetic value, not a credential."
45+
condition = "AND"
46+
paths = ["^products/adapter/fixtures/source-shapes/graphql-cursor-source/fixtures/find-first-page\\.yaml$"]
47+
regexTarget = "line"
48+
regexes = ['''^\s*pageStateToken: AQGTVIRecXOAHQpErfOzhEknm-j2T4eSa5osZDxhcPxbjL4ZWsi_fwuEmekmwe3pJzk7HzaQ5NkeOQEeGBtmPJ2tSNzFv1vbYu21rA$''']

‎AGENTS.md‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ an authorized caller, from a reviewed template through an operator-configured
2121
provider), **Registry Coordinator** (finite, reviewed workflows of product
2222
API calls separated by durable waits), **Document Store** (document bytes held
2323
in custody for an owning system, with an exact, verified version released to
24-
the recipient a document grant names; held out of releases), and **Registry
25-
Discovery** (a curated, immutable index over public provider descriptions).
24+
the recipient a document grant names; held out of releases), **Registry
25+
Discovery** (a curated, immutable index over public provider descriptions),
26+
and **Registry Adapter** (a governed facade exposing a standard registry API
27+
over a source an institution already operates, from reviewed, digest-pinned
28+
packs as a bounded port of Apache Camel concepts).
2629
Registry Manifest describes sources portably; `registry-platform-*` crates are
2730
shared primitives. Integration maintainers own `registry-mcp`, a supporting
2831
composition service over explicit product bindings and the Live Adapter HTTP
@@ -45,6 +48,10 @@ remain supporting services beside their product, not products of their own.
4548
| `crates/registry-documentsctl` | Document Store operator tooling and the `documentsctl` binary |
4649
| `crates/registry-documents-client` | Bounded Rust Document Store client over the runtime's HTTP contract |
4750
| `products/documents` | Document Store product contracts, starter example, generated schemas and OpenAPI document, and contributor check scripts |
51+
| `crates/registry-adapter-core` | Source-neutral Adapter model, wire DTOs, `adapter.*` problem codes, and pure authoring checks |
52+
| `crates/registry-adapter` | Adapter runtime: governed facade, call-plan interpreter, security surface, and audit journal |
53+
| `crates/registry-adapterctl` | Adapter authoring and operator tooling and the `adapterctl` binary |
54+
| `products/adapter` | Adapter product contract (`CONCEPT.md`), delivery plan, schemas, profiles, packs, examples, fixtures, and contributor check scripts |
4855
| `crates/registry-discovery` | Immutable Registry Discovery index runtime and the `discovery` binary |
4956
| `crates/registry-discovery-profile` | Closed provider-publication profile implemented by Evidence; published v1alpha1 resources retain their historical broader vocabulary |
5057
| `crates/registry-discovery-client` | Rust relying-party SDK for bounded search, resolution, and inert exact selections |
@@ -126,6 +133,8 @@ Before editing an area, read its owning guide:
126133
- `registry-coordinator*`: `products/coordinator/AGENTS.md`
127134
- `registry-documents*`, `registry-documentsctl`:
128135
`products/documents/AGENTS.md`
136+
- `registry-adapter*`, `registry-adapterctl`:
137+
`products/adapter/AGENTS.md`
129138
- `registry-discovery*`, `registry-discoveryctl`:
130139
`products/discovery/AGENTS.md`
131140
- `registry-manifest-*`: `products/manifest/AGENTS.md`
@@ -290,6 +299,23 @@ source access, trust, or native-client behavior. The clients may search,
290299
resolve, validate, and persist inert exact selections, but never turn catalog
291300
metadata into trust or credentials.
292301

302+
**Registry Adapter** (`registry-adapter-core`, `registry-adapter`,
303+
`registry-adapterctl`) exposes a compiled, standard registry API over a
304+
source an institution already operates, from a reviewed, digest-pinned
305+
pack. The core is the source-neutral model and authoring checks; the
306+
runtime is a bounded port of Apache Camel concepts whose port table is
307+
the contract (`products/adapter/CONCEPT.md` section 8.10); `adapterctl`
308+
is authoring and operator tooling. The adapter inherits no authorization
309+
from any product and grants none to any source: upstream calls run under
310+
the deployment's own credential, or without an application credential for
311+
numeric loopback, HTTPS with mTLS, or a fixed HTTPS source carrying the
312+
operator's explicit `anonymousHttps: operator-approved` acknowledgement.
313+
The caller's token is never forwarded,
314+
and the facade serves trusted machine clients only, because an admitted
315+
client with a matching scope sees every record the deployment's configured
316+
source access reaches (record-level authorization is planned, not built). Its audit
317+
journal records no values.
318+
293319
The adopter demo is maintained separately in
294320
[`registrystack/solmara-lab`](https://github.com/registrystack/solmara-lab).
295321

@@ -324,6 +350,7 @@ Each owning guide lists its own gates. The entry points:
324350
| Coordinator | `products/coordinator/scripts/check_dependency_direction.py`, `check-schemas.sh`, `test-postgres.sh` | `products/coordinator/AGENTS.md` |
325351
| Document Store | `products/documents/scripts/check-checkpoint.sh`, `check-contracts.sh`, the PostgreSQL suites (`postgres_journey` also needs `REGISTRY_RENDER_BIN`) | `products/documents/AGENTS.md`, `products/documents/README.md` |
326352
| Discovery | `products/discovery/scripts/check-contracts.sh`, `test-http.sh` | `products/discovery/AGENTS.md` |
353+
| Adapter | `products/adapter/scripts/check-contracts.sh`, `check-port-table.py`, `test-postgres.sh` | `products/adapter/AGENTS.md` |
327354
| Clients, bindings, unified packages | per-binding `npm test` and `unittest` runs, `release/scripts/sync-registry-client-node.py --check` | `crates/CLIENTS.md` |
328355
| Release | `release/scripts/registry-release validate release/manifests/<current>.yaml`, `check-release-source-model.sh` | `CONTRIBUTING.md`, `release/VERIFY.md` |
329356
| Docs site | `npm test` and `npm run check` in `docs/site/` | `docs/site/AGENTS.md` |

0 commit comments

Comments
 (0)