Hanzo
Architecture

The Platform Algebra

The whole cloud is a small set of primitives — Principal, Tenant, Resource, Policy, Ledger, Meter, Schedule, Bus, Gateway, Store, Money — and every product is a composition of them. Declare a schema, attach a policy, and persistence, tenancy, audit, and metering come free.

The Platform Algebra

The platform is an algebra. The eight movements list 67 capabilities, but they are not 67 unrelated services stacked side by side. They are compositions of a small set of primitives — a fixed vocabulary of generators — and almost everything a product does is one of those primitives applied to its own data.

This is the structural companion to the Engineering Philosophy. Philosophy is the why — one contract, decomplect, the wire not FFI. This page is the what: the primitives everything decomposes into, and the way a product is assembled from them.

A product is a composition of primitives, not a new stack. It declares its own resources and rules; persistence, tenancy, audit, and metering are inherited from the platform, not rewritten each time.

The primitives

Eleven primitives generate the platform. Each is one idea, named for what it is. Each is composed by many products; no product owns one outright.

PrimitiveWhat it isComposed by
PrincipalAn authenticated identity — a person, an org member, a service, or an agent.IAM, Identity, API Keys
TenantThe organization boundary every record is scoped to.Organizations — and every capability, "tenant-scoped by org"
ResourceA typed record with a declared schema; CRUD, validation, and serialization fall out of the shape.ORM (Model[T]), Base, SQL, DocDB
PolicyA rule deciding who may do what to which resource.Authz, Guard, Zero-Trust
LedgerAn append-only record of facts — what happened, immutable.Traces, Logs, O11y
MeterA count of usage, for limits and billing.Usage, Analytics, Billing
ScheduleDeferred and recurring execution — run this later, or on a cadence.Tasks, Pipelines
BusAsynchronous delivery between components.PubSub, Stream, MQ
GatewayThe one front door; every capability is reached at /v1/<name>.Gateway, Ingress
StoreDurable bytes and blobs.Storage, KV, Vector, Datastore
MoneyValue movement — charges, payouts, balances, rewards.Commerce, Billing, Referrals, Marketplace

How a product is assembled

A product is not a fresh vertical slice of infrastructure. It makes four moves against the primitives, and inherits the rest.

The moveYou writeYou inherit
Declare a Resourcethe schema — your Model[T]persistence + validation (ORM), and tenancy: every row scoped to its Tenant
Attach a Policywho may touch itauthorization at the boundary (Authz)
Write Ledger factswhat happenedaudit + observability (O11y)
Count with a Meterthe unit that mattersmetering + billing (Billing)
Expose a Gateway surfacethe handlerrouting, auth, and generated SDKs at /v1/<name>

Persistence, tenancy, audit, and metering are therefore not per-product code — they are what you get for standing on the primitives. And the primitives themselves stand on exactly two things: one ORM and one wire — every product is a set of Model[T] resources served over ZAP. One ORM, one wire, one contract: the philosophy's "one and one way" expressed as structure.

The proof: a Principal on ORM + ZAP. Hanzo IAM is being rebuilt exactly this way — a clean-room identity service where a Principal is a Model[T] on the shared ORM, served over ZAP, with no bespoke persistence, tenancy, or audit layer of its own. It is the first product to drop an inherited third-party stack and stand entirely on the primitives — the demonstration that the algebra composes a real service, not just a diagram.

Two things named "agent"

The naming law behind the algebra: say what it is. No compound words; an academic noun for a primitive, a concrete noun for a product. Because the vocabulary is small, the names have to be exact — and the clearest test is the pair that is deliberately not merged:

Same word, two referents, kept apart: the Engine is the runtime that runs an agent; Agents is the open-source set you compose. Collapsing them would fuse a place (the runtime) with a value (the set) — the exact braid the platform decomplects.

Read on

How is this guide?

Last updated on

On this page