diff --git a/.github/workflows/transport-adapter-schema.yml b/.github/workflows/transport-adapter-schema.yml new file mode 100644 index 0000000000..69b0bf83b2 --- /dev/null +++ b/.github/workflows/transport-adapter-schema.yml @@ -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 diff --git a/config/transport-adapters/registry.json b/config/transport-adapters/registry.json new file mode 100644 index 0000000000..3e8f87e408 --- /dev/null +++ b/config/transport-adapters/registry.json @@ -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"] + } + ] +} diff --git a/config/transport-adapters/schema.json b/config/transport-adapters/schema.json new file mode 100644 index 0000000000..b390511856 --- /dev/null +++ b/config/transport-adapters/schema.json @@ -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 } } } } } + } + ] + } + } +} diff --git a/doc/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1.md b/doc/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1.md new file mode 100644 index 0000000000..1bbdce4389 --- /dev/null +++ b/doc/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1.md @@ -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 +``` + + +```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" + } +} +``` + diff --git a/doc/README.md b/doc/README.md index f88a1651d6..8c721f2c0b 100644 --- a/doc/README.md +++ b/doc/README.md @@ -65,6 +65,7 @@ Folders are named `__`. The kinds in use are `feature` - [CNCF landscape — the slice this estate will actually need](2026-11-23T22-33-41Z_research_cncf-landscape/2026-11-23T22-33-41Z_research_cncf-landscape.md) — research record (2026-11-23): ~150 cloud-native projects across the seven areas this estate will need, each with CNCF status (graduated / incubating / sandbox / not CNCF) and an estate verdict — observability (OpenTelemetry as the contract; Prometheus as the language, VictoriaMetrics as the store; Grafana stays; no open-source Datadog exists), networking (Cilium yes; Gateway API after ingress-nginx's March 2026 retirement; MetalLB is the remembered LAN LoadBalancer; no service mesh yet), platform & GitOps (Flux over Argo CD for us; Cozystack fits with the caveat that it decides storage/tenancy/GitOps for you; Crossplane graduated but not now), data (TiKV no — a storage layer, not a database, and its Jepsen record is honest; CloudNativePG + replicas; NATS yes with a JetStream shape; LINSTOR over Rook), security & identity (Keycloak ≠ OpenBao; cert-manager and Kyverno when Kubernetes lands; SPIRE later, chained under the fleet CA; OPA management-plane only), runtimes (no OCI runtime is "much faster"; KubeVirt graduated and is the VMs-in-Kubernetes answer; Wasm apps designed to the Component Model, not WasmEdge), and registries & builds (GHCR until friction, then Zot; Harbor is a registry and Dragonfly a distribution layer, not alternatives; Nix + Actions already win the build category). Includes the Oct–Nov 2026 status-correction list (Crossplane, KubeVirt, NATS, Dragonfly graduated; CloudNativePG, OpenFGA promoted) and the uncertain-name identifications (Argonize doesn't exist; Trimmer→Tremor; Yuki→youki; Percy→Pixie; Spiffy→SPIFFE). - [RustFS vs SeaweedFS — object storage compared](2026-11-24T01-33-33Z_research_rustfs-vs-seaweedfs/2026-11-24T01-33-33Z_research_rustfs-vs-seaweedfs.md) — research record (2026-11-24): the two S3 stores head to head — the one independent benchmark (SeaweedFS wins small-object PUT throughput and p99 latency, RustFS wins large objects and uses ~4.3× less RAM; zero acknowledged objects lost across kill -9 cycles in either store), features and metadata models side by side, the data-loss record investigated case by case (SeaweedFS losses concentrate in maintenance tooling, single-copy setups and filer-metadata failures, each with a named guardrail; RustFS's short history carries a hardcoded-token CVE and an Object Lock bypass), project health (SeaweedFS's one-maintainer reality verified by commit counts; RustFS's company real but geographically opaque), and the verdict: stay on SeaweedFS inside Cozystack, with RustFS as a watch/pilot candidate for standalone large-object workloads. Benchmark extracts, data-loss case notes, feature notes and raw project-health data ride in the folder as supplements. - [Multi-transport reach — any protocol as a carrier](2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md) — programme direction record (Drew, 2026-11-23) for epic #13926 and head design #13929: the P2P/ID/fleet stack reachable over many alternate transports and proxied systems (Spritely-style relays, Tor, Noise, ActivityPub, ATProto, email, MQTT, HTTP/REST, MCP, IRC, Zulip, Slack, Discord bots, Gopher, Gemini, telnet, physical media), each adapter at a declared level (read / bidirectional / write-capable / sync-equivalent), with asymmetric send/receive paths as a first-class design requirement. +- [Transport adapter contract — S1 declaration and registry](2026-11-24T01-40-00Z_design_transport-adapter-contract-s1/2026-11-24T01-40-00Z_design_transport-adapter-contract-s1.md) — #13929 S1: schema, four-instance registry, trust and delivery declarations. - [Secrets plane — delta refresh, broker peer sync, dual-store puts](2026-11-24T01-23-30Z_design_secrets-plane-sync/2026-11-24T01-23-30Z_design_secrets-plane-sync.md) — design record for #13948 (Drew, 2026-11-23): the secrets broker refresh becomes delta-first (one `bws secret list`, apply only entries whose `revisionDate` moved), brokers sync peer-to-peer behind a keyed set hash (v1 peer payload is the full set; a full upstream refresh is needed only when the laptop is down and the broker restarted with no cache), `fleet secrets` gains `refresh`, `get --upstream/--no-cache`, and a `put` that commits to the primary store then pushes to the peer and the mirror, and the two stores are kept in sync with Bitwarden Secrets recommended as primary and 1Password as mirror on the evidence in the design. Companion to-dos: #13950 (embed both stores in the fleet binary), #13952 (`fleet init` bootstrap command). - [IdP identity-linking policy — pending trust, passkeys, configurable factors, account merge](2026-11-24T01-28-40Z_design_idp-linking-policy/2026-11-24T01-28-40Z_design_idp-linking-policy.md) — design record (Drew, 2026-11-23) for #13415 and workstreams #13972 (HEAD), #13973, #13974, #13975: federation doors link to the same user without auto-trust (a new provider sign-in registers pending until approved from an established session), first sign-in auto-provisions the CA SSO account, passkeys bind to the originating sign-in path by default with a standalone option (unlimited, multi-provider attach), two-factor is user-configured as any two distinct factors, and account merge stays possible (no per-account-unique objects beyond a limited set, primary chosen, no data lost, per-attribute repointing); recovery/deletion policy explicitly undecided. - [Roc ecosystem research](2026-11-23T22-00-25Z_research_roc-ecosystem/2026-11-23T22-00-25Z_research_roc-ecosystem.md) — research record (2026-11-23): the state of the Roc language ecosystem — the new Zig compiler (feature parity July 2026; 0.1.0-RC1 shipped 2026-11-21, promotion to 0.1.0 still open), platforms (basic-cli, basic-webserver, Joy, roc-ray, roc-gui, Cloudflare Workers, native Android), the new-compiler package canon, real projects and production use (Joy/roc-deflate, roc-chat), a 30-day Zulip digest (linear types decided against FBIP; the LLM-generated-code conversation, no policy adopted; tooling and distribution progress), and the talks/releases/showcases worth watching.