Documentation
¶
Overview ¶
Package wiresurface computes the canonical Harbor Protocol wire-surface digest: a coarse, opaque, stable name-level fingerprint of the surface a Protocol client binds to.
What the digest covers ¶
The digest is a sha256 over a deterministic, format-versioned encoding of the Protocol's NAME-LEVEL surface:
- the pinned Protocol version,
- every canonical method name,
- every canonical error code,
- every canonical capability string (the canonical capability UNIVERSE, not a per-instance advertised subset),
- every canonical wire-type name.
It deliberately covers the SHAPE OF NAMES, not field shapes and not event-type names. A field-type swap on a same-named wire struct does NOT move the digest — field-level drift stays a build-time concern (the Console's manifest field guard catches it for any client that vendors the manifest), and exposing field shapes over the wire is a non-goal. Event types are excluded because enumerating them at runtime would require seating driver registries; the digest is scoped to the request/response/capability contract.
Why a name-level digest ¶
The runtime returns the digest on its attach-time posture call, and the committed wire manifest is stamped with the same digest, so a connected Protocol client compares the digest it vendored at build time against the live runtime's reported digest and surfaces a loud drift signal at connect-time instead of discovering wire drift field-by-field at runtime.
Purity and concurrency ¶
Digest is a pure function of the build's canonical Go sources, memoised once per process and safe for concurrent use. The package imports only the light canonical Protocol packages (methods, errors, types, singlesource) — no driver registries, no orchestration packages — so it can be shared by the runtime and the manifest build tool without an import cycle or a dependency-set balloon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Digest ¶
func Digest() string
Digest returns the canonical Harbor Protocol wire-surface digest:
"sha256:" + lowercase-hex(sha256(canonical-serialization))
over a deterministic, format-versioned encoding of the Protocol version, method names, error codes, capability strings (the canonical capability universe), and canonical wire-type names. It is a coarse name-level fingerprint — it covers the shape of names, not field shapes and not event-type names. It is a pure function of the build's canonical Go sources, memoised once per process; safe for concurrent use.
Types ¶
This section is empty.