Skip to content

Architecture ​

Seeded from a copy of cuora (its ports-and-adapters anatomy and the -cf Worker pattern).

tamias is ports-and-adapters. The engine owns the generic half of distribution; every content meaning is an adapter.

Ports ​

PortRoleImpls
refclaims + parses a ref into an opaque specone per kind (in the source-* crates)
sourceplan(spec) → fetch(plan, into)-fs, -git, -http, -cf
storeput/get/verify an installed package-local, -cf
cachecontent-addressed fetch cache-local, -cf
registryindex + publish-local, -cf (Worker + R2 + D1/KV)
deployservice unit + teardown-local (systemd)
driverhow a content type installs/deploystamias-driver-<type> (subprocess, argv)

Crate map ​

cratelayerpurpose
tamias-coredomainPure domain — package identity (@scope/name@semver), refs, manifests, records, digests (no I/O)
tamias-cacheportcache port — read-through fetched content
tamias-configportConfig port — where tamias.toml-shaped config comes from
tamias-deployportdeploy port — provision a remote registry (Worker + R2 + D1/KV)
tamias-registryportregistry port — index + publish
tamias-sourceportsource port — turn a ref into bytes
tamias-storeportstore port — content-addressed blobs
tamias-cache-cfadapterCloudflare adapter (P6)
tamias-cache-localadapterlocal cache impl — content-addressed fetch cache
tamias-config-tomladapterTOML config impl
tamias-config-ymladapterYAML config impl (the standard) — tamias.yml / tamias.yaml
tamias-deploy-cfadapterCloudflare deploy impl — the registry Worker + wrangler config
tamias-deploy-localadapterlocal deploy impl — manage a per-user service unit (systemd/launchd)
tamias-driveradaptercontent driver host — discovery + dispatch of tamias-driver-<type> (no product knowledge)
tamias-driver-tamiasadaptertamias-driver-tamias — pavo view driver over the tamias install store, fetch cache, registry index, and driver dir (read-only)
tamias-publishadapterauthor side — pack + push
tamias-registry-cfadapterCloudflare registry impl — a Worker + R2 over HTTP
tamias-registry-localadapterdir registry impl — a folder index, servable over HTTP
tamias-serveadapterndjson JSON-RPC over stdio — the embedding surface
tamias-shelladapterRun a command in a working directory via bash -c — the generic shell-out helper
tamias-source-cfadapterCloudflare registry source impl — the cf: ref arm
tamias-source-fsadapterfs source impl — local dirs and tarballs
tamias-source-gitadaptergit source impl — clone URL //subdir #rev
tamias-source-httpadapterhttp source impl — .tgz GET + optional sha256 pin
tamias-store-cfadapterCloudflare adapter (P6)
tamias-store-localadapterlocal store impl — a directory
tamias-telemetryadapterOpt-in OpenTelemetry layer over the tracing stack — OTLP export, W3C context propagation
tamias-testkitadapterFixtures + adapter conformance for every port
tamiasbinarytamias — package & content manager: fetch, store, cache, dispense

The install path ​

ref ─► resolve ─► (cache hit?) ─► fetch ─► overlay (include:) ─► driver install ─► store

resolve pins git refs to a commit sha up front, so the content- addressed cache can be hit before fetching. The fetch→unpack split is what makes repeat installs and air-gapped nodes free.

Stores ​

  • install store — <name>@<version>/ with a record (source ref, resolved sha, payload digest, installed-at).
  • fetch cache — content-addressed; remove never touches it.
  • registry — where published content lives: a directory, or a Cloudflare Worker + R2 + D1/KV.

Provenance ​

verify recomputes the payload digest against the record. Digest-pinned refs (#sha256:…, resolved shas) are the integrity contract — see Security model for the full trust story, including the --allow-drivers consent gate on payload-shipped drivers.

The embedding surface ​

tamias serve (the tamias-serve crate) runs the same install/list/ info/verify/remove verbs as an ndjson JSON-RPC service over stdio — for agents and daemons that want a persistent handle instead of one-shot CLI calls. The protocol is specified in serve reference.

Observability ​

tamias-telemetry is an opt-in OpenTelemetry layer over the tracing stack. Nothing exports unless you set an endpoint:

  • TAMIAS_OTEL_ENDPOINT — OTLP/HTTP base URL (the opt-in switch), or the standard OTEL_EXPORTER_OTLP_ENDPOINT / …_TRACES_ENDPOINT.
  • TAMIAS_OTEL_SERVICE_NAME / OTEL_SERVICE_NAME — service.name.
  • W3C traceparent/tracestate propagation is installed when export is on; RUST_LOG-style filtering still applies.