Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/transport-adapter-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: transport adapter declarations

on:
pull_request:
paths:
- 'config/transport-adapters/**'
- '.github/workflows/transport-adapter-schema.yml'
push:
branches: [main]
paths:
- 'config/transport-adapters/**'
- '.github/workflows/transport-adapter-schema.yml'

permissions:
contents: read

jobs:
validate:
name: validate adapter registry schema
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23
- name: Validate registry against JSON Schema 2020-12
run: nix shell nixpkgs#check-jsonschema -c check-jsonschema --schemafile config/transport-adapters/schema.json config/transport-adapters/registry.json
54 changes: 54 additions & 0 deletions config/transport-adapters/registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"schema_version": 1,
"adapters": [
{
"name": "bridge-http",
"version": 1,
"shape": "transport",
"addressing": { "carrier_address": "Bridge agent/group address", "identity_mapping": "Bridge agent name maps to the registered Fleet agent; payload identity must be independently authenticated." },
"levels": { "send": "bidirectional", "receive": "bidirectional" },
"delivery": { "guarantee": "at-least-once", "ordering": "Mailbox order by bridge message id; consumers deduplicate by id.", "causal_metadata": "Bridge message id and reply-to id; no general causal clock.", "latency": "Online request/response; may wait for bridge availability.", "size_limit": "Bridge API-enforced request limit; declaration does not assert a larger bound.", "offline_behavior": "Queued in the bridge mailbox until read or expired by bridge policy." },
"identity_binding": "mapped",
"capability_gating": { "send": "Agent fleet token authorizes agent mailbox operations; owner token is required to issue commands.", "receive": "Mailbox is addressed by agent identity; message content is not an identity proof.", "revocation": "Bridge token revocation disables access; queued messages remain subject to mailbox policy." },
"metering": { "counted": ["messages"], "counter_location": "Bridge service message records." },
"evidence": ["#13895", "doc/2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md"]
},
{
"name": "mcpx-door",
"version": 1,
"shape": "proxy",
"addressing": { "carrier_address": "Configured MCP server and tool name", "identity_mapping": "mcpx server configuration maps the local principal to the upstream server identity; upstream identity is not an end-to-end Fleet identity." },
"levels": { "send": "write-capable", "receive": "bidirectional" },
"delivery": { "guarantee": "best-effort", "ordering": "Per-request/response; no cross-request ordering promise.", "causal_metadata": "Request/response correlation only.", "latency": "Interactive request/response.", "size_limit": "Transport and server-specific limits; not globally uniform.", "offline_behavior": "Calls fail when the configured server is unavailable; no durable queue." },
"identity_binding": "mapped",
"capability_gating": { "send": "Configured mcpx authorization and the selected tool's policy gate; write actions require explicit tool authority.", "receive": "The configured server boundary and mcpx caller authorization.", "revocation": "Revoke local authorization or disable the server/tool configuration; upstream credentials remain controlled by their holder." },
"metering": { "counted": ["messages", "actions"], "counter_location": "mcpx request/operation telemetry where enabled." },
"custody": { "credential_holder": "The operator/configuration that owns the upstream MCP credentials.", "translation_boundary": "mcpx maps MCP tool calls/results to its local API; the upstream server executes tools.", "trust_statement": "The upstream server sees calls and arguments, may retain them, and returns untrusted results.", "authority_ceiling": "Only tools enabled and authorized in the local mcpx configuration." },
"evidence": ["#13657", "doc/2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md"]
},
{
"name": "email-bootstrap",
"version": 1,
"shape": "transport",
"addressing": { "carrier_address": "Email address", "identity_mapping": "Signed bootstrap ticket binds the email introduction to a stack identity; email headers alone are not identity claims." },
"levels": { "send": "bidirectional", "receive": "bidirectional" },
"delivery": { "guarantee": "best-effort", "ordering": "No ordering guarantee across mailboxes or providers.", "causal_metadata": "Signed ticket identifier; no general causal metadata.", "latency": "Store-and-forward; provider-dependent.", "size_limit": "Provider and MIME limits apply.", "offline_behavior": "Mail may be delayed, filtered, altered, or unavailable; bootstrap ticket signature is checked on receipt." },
"identity_binding": "cryptographic",
"capability_gating": { "send": "Bootstrap-ticket scope only; does not grant general message or write authority.", "receive": "Validate ticket signature, audience, and expiry; do not trust sender headers.", "revocation": "Verify current ticket validity at receipt; delayed mail may carry an expired or revoked ticket." },
"metering": { "counted": ["messages", "bytes"], "counter_location": "Mail provider and local bootstrap records; no unified counter." },
"evidence": ["#13752", "#13752 issue comment 7118605020", "doc/2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md"]
},
{
"name": "sneakernet-bundle",
"version": 1,
"shape": "transport",
"addressing": { "carrier_address": "Bundle recipient and destination identity", "identity_mapping": "Bundle signatures and grants bind the bundle to the recipient identity; physical labels are hints only." },
"levels": { "send": "sync-equivalent", "receive": "sync-equivalent" },
"delivery": { "guarantee": "at-least-once", "ordering": "Bundles may arrive in any order; replay and deduplication are checked by signed bundle identity.", "causal_metadata": "Sync data preserves causal metadata as specified by the bundle format.", "latency": "Human-carried; unbounded and unpredictable.", "size_limit": "Bounded by media capacity and bundle policy.", "offline_behavior": "Store-and-forward on physical media; verify the bundle and grants before merge." },
"identity_binding": "cryptographic",
"capability_gating": { "send": "Bundle grant scopes what the recipient may import or perform.", "receive": "Verify signatures, recipient, grant scope, and replay policy before merge.", "revocation": "Check current grant/revocation state at import; offline media cannot learn revocations until connected." },
"metering": { "counted": ["bytes", "actions"], "counter_location": "Bundle manifest and importing replica records." },
"evidence": ["#13889", "doc/2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md"]
}
]
}
106 changes: 106 additions & 0 deletions config/transport-adapters/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://developing-today.github.io/code/schemas/transport-adapters-v1.json",
"title": "Transport adapter registry",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "adapters"],
"properties": {
"schema_version": { "const": 1 },
"adapters": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/adapter" },
"uniqueItems": true
}
},
"$defs": {
"level": {
"enum": ["none", "read", "bidirectional", "write-capable", "sync-equivalent"]
},
"adapter": {
"type": "object",
"additionalProperties": false,
"required": [
"name", "version", "shape", "addressing", "levels", "delivery",
"identity_binding", "capability_gating", "metering"
],
"properties": {
"name": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"version": { "type": "integer", "minimum": 1 },
"shape": { "enum": ["transport", "proxy"] },
"addressing": {
"type": "object",
"additionalProperties": false,
"required": ["carrier_address", "identity_mapping"],
"properties": {
"carrier_address": { "type": "string", "minLength": 1 },
"identity_mapping": { "type": "string", "minLength": 1 }
}
},
"levels": {
"type": "object",
"additionalProperties": false,
"required": ["send", "receive"],
"properties": { "send": { "$ref": "#/$defs/level" }, "receive": { "$ref": "#/$defs/level" } }
},
"delivery": {
"type": "object",
"additionalProperties": false,
"required": ["guarantee", "ordering", "causal_metadata", "latency", "size_limit", "offline_behavior"],
"properties": {
"guarantee": { "enum": ["at-most-once", "at-least-once", "best-effort", "not-applicable"] },
"ordering": { "type": "string", "minLength": 1 },
"causal_metadata": { "type": "string", "minLength": 1 },
"latency": { "type": "string", "minLength": 1 },
"size_limit": { "type": "string", "minLength": 1 },
"offline_behavior": { "type": "string", "minLength": 1 }
}
},
"identity_binding": { "enum": ["cryptographic", "mapped", "none"] },
"capability_gating": {
"type": "object",
"additionalProperties": false,
"required": ["send", "receive", "revocation"],
"properties": {
"send": { "type": "string", "minLength": 1 },
"receive": { "type": "string", "minLength": 1 },
"revocation": { "type": "string", "minLength": 1 }
}
},
"metering": {
"type": "object",
"additionalProperties": false,
"required": ["counted", "counter_location"],
"properties": {
"counted": { "type": "array", "items": { "enum": ["messages", "bytes", "actions"] }, "uniqueItems": true },
"counter_location": { "type": "string", "minLength": 1 }
}
},
"custody": {
"type": "object",
"additionalProperties": false,
"required": ["credential_holder", "translation_boundary", "trust_statement", "authority_ceiling"],
"properties": {
"credential_holder": { "type": "string", "minLength": 1 },
"translation_boundary": { "type": "string", "minLength": 1 },
"trust_statement": { "type": "string", "minLength": 1 },
"authority_ceiling": { "type": "string", "minLength": 1 }
}
},
"evidence": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 }
},
"allOf": [
{
"if": { "properties": { "shape": { "const": "proxy" } }, "required": ["shape"] },
"then": { "required": ["custody"] },
"else": { "not": { "required": ["custody"] } }
},
{
"if": { "properties": { "levels": { "properties": { "send": { "const": "write-capable" } }, "required": ["send"] } }, "required": ["levels"] },
"then": { "properties": { "capability_gating": { "properties": { "send": { "minLength": 1 } } } } }
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Transport adapter contract — S1 declaration and registry

**Status:** implementation record for #13929 S1; based on the head design's §4.
**Scope:** normalize the contract into a machine-readable schema and initial registry. This record preserves the contract as adopted for the first four existing instances; it does not claim that their behavior has been changed or live-conformance-tested.

## Contract

Each adapter has one versioned declaration with the same fields, regardless of protocol:

- **Identity and shape:** `name`, integer `version`, and `shape` (`transport` or `proxy`). A transport carries stack messages end-to-end; a proxy terminates at an external system and must declare credential custody, translation boundary, platform trust, and its authority ceiling.
- **Addressing:** carrier-native address and the explicit mapping to fleet-CA / ID identity. Carrier metadata is not an identity proof.
- **Independent levels:** `levels.send` and `levels.receive` each use `none`, `read`, `bidirectional`, `write-capable`, or `sync-equivalent`. These are per-direction capability ceilings, not a claim that both directions use one connection. `write-capable` is reserved for state-changing actions and therefore requires an explicit send gate.
- **Delivery:** guarantee (`at-most-once`, `at-least-once`, `best-effort`, or `not-applicable`), ordering, causal-metadata preservation, latency, size limit, and offline behavior. The declaration records limits; it does not make a carrier more reliable.
- **Identity, authorization, and metering:** identity binding (`cryptographic`, `mapped`, `none`), send/receive capability gates and revocation path, plus counted units and counter location.
- **Evidence:** each registry entry cites the issue/design source for the recorded facts. Unknown or provider-specific limits are stated as such instead of inventing a universal guarantee.

Routes remain separate from adapter declarations: a route composes one send adapter, one receive adapter, and an address mapping. Envelopes carry an explicit reply route; a failed send does not imply a failed receive. This slice establishes the declaration contract only, not routing-core behavior.

## Initial registry

`config/transport-adapters/registry.json` applies the exact schema to the bridge, mcpx door, email bootstrap, and sneakernet bundle. No per-adapter schema exceptions are used. The existing evidence describes configuration/capability boundaries, not new runtime integrations. In particular, `best-effort` email and `sync-equivalent` sneakernet are declared with their store-and-forward, revocation, and replay limitations visible.

The JSON Schema is Draft 2020-12. CI validates the complete registry on pull requests touching the schema/registry and on pushes to `main`. The validator is deliberately external to the application runtime; this slice does not introduce a transport library dependency.

## Security and compatibility

Declarations are descriptive and do not grant authority. Consumers must enforce their declared levels and gates. Proxy custody fields are mandatory only for `shape: proxy`; transport declarations may not claim them. Identity claims must be authenticated independently of carrier address. Revocation for offline paths is checked at receipt/import time and may be delayed until the path reconnects. The registry is additive and does not change any bridge, mcpx, email, or bundle behavior.

## Deferred to later slices

S2 owns route composition, reply-route envelopes, direction-specific level enforcement, and downgrade tests. S3–S8 own behavior-preserving formalization and live conformance proofs for the existing and new adapters. Open questions Q1–Q5 remain with the deciders named in #13929 §9; this schema does not settle them.

## Verification

The CI oracle is the JSON Schema 2020-12 validator checking `registry.json` against `schema.json`; the expected count is four adapter entries, with zero schema errors. The workflow runs this same command on PRs and `main`:

```sh
nix shell nixpkgs#check-jsonschema -c check-jsonschema --schemafile config/transport-adapters/schema.json config/transport-adapters/registry.json
```

<!-- pm-metadata:start -->
```json
{
"pm_meta": 1,
"provenance": {
"queue_id": 21620,
"lane": "oc-code-05",
"worktree": "oc-code-05-13929-20261124T013820Z-4afdc35e",
"created_at": "2026-11-24T01:40:00Z"
}
}
```
<!-- pm-metadata:end -->
Loading