ADR 0002: Ports and adapters

Status: accepted, 2026-10-06

Context

Keep Shipping talks to many vendors: OCI registries, BuildKit or Docker, sigstore, OpenTofu and Terraform, Kubernetes, SSH hosts, serverless platforms, CI systems, chat tools, TypeSafe's Jev. "Local = CI" means the same step code has to run against a laptop's Docker socket and against a CI runner's OIDC credentials, and the difference between the two is not something a step should be able to see.

The Cratefield harness — whose dependency this repository already carries for the hosted venture, ADR 0200 — solves exactly this shape of problem with ports, object-safe Send + Sync traits in core, and adapters, one crate per vendor, holding the only vendor-aware code. Its rule is "modules only see ports". Keep Shipping's rule is the same word for word, with steps where Cratefield has modules.

Decision

Consequences