sorrel/docs/hub

Sorrel Hub

The collaboration layer: a zero-dependency Node API server that stores project metadata, transports content-addressed objects between machines, and administers Core policy — plus a framework-free browser interface on top.

Three repos, three roles

RepoRole
sorrel-hubThe API server: JSON over HTTP, no UI.
sorrel-hub-webThe web interface: plain HTML/CSS/ES modules calling the Hub API.
sorrel-webThis site — public landing and docs, unrelated to the product UI.

Sync transport

The Hub moves the engine's content-addressed objects with a small negotiated protocol (specified in sorrel-protocol/docs/sync-transport.md):

EndpointPurpose
GET /{repoId}/refsList ref names and snapshot ids.
POST /{repoId}/objects/missingNegotiate: given want/have, which objects are missing.
POST /{repoId}/objectsUpload objects (id-verified; policy-gated by repo.object.write).
GET /{repoId}/objects/{id}Download raw object bytes.
POST /{repoId}/refs/{name}Advance a ref — closure-complete and fast-forward checked, policy-gated by repo.ref.write.
GET /admin/sync-reposList repositories known to the sync store with ref counts.

Every object upload is digest-verified against its BLAKE3 id, and a ref can only advance when the full snapshot closure is present — a half-pushed history is never visible as the current state.

Persistence

Sync objects/refs and product metadata (projects, proposals, workflow runs, ...) persist to disk with the same discipline as the engine: content-addressed fanout layout, atomic temp-file-and-rename writes, digest-verified reads. A Hub restart loses nothing. SORREL_HUB_DATA_DIR selects the location; SORREL_HUB_SYNC_STORE=memory keeps everything ephemeral (the test default).

Policy: Hub administers, Core decides

Mutating sync calls carry an acting principal and grantRefs; the Hub hydrates those against grants it trusts and re-evaluates the Core policy decision before writing. The Hub never invents its own permission language — signature trust, rotation rules, and audit semantics remain Core's job.

The web interface

sorrel-hub-web is deliberately framework-free: static HTML/CSS/ES modules and a small dev server that proxies /api/* to the Hub. It currently ships read-only Projects, Administration, and Sync views (repositories, ref counts, and per-repo refs). Write flows arrive with proposals and reviews.