Expand description
Seed licence proxy, member side (ADR-106 phase 1a).
Types, stores and policy for the mesh checkout of Cognitum cogs, as pure in-process code (no network, no transport):
MeshIdandLocalMeshId: the mesh a binding, grant or approval is for.BindingRecord: the operator-signed Seed to mesh binding (v2), with the member verification profile (verify_binding_member). The steward profile (age window, live identity match, fingerprint) is phase 1d and plugs in throughBindingExtraCheck.CheckoutGrant: signed by the Seed’s grant key; highestseqwins.Approval: the operator’s additive, content-addressed hash approval.CheckoutGrantStoreandApprovalStore: persisted, atomic, 0600, size-capped, fail-closed.MeshCheckoutPolicy: the swarm redistribution policy. With no binding it behaves exactly likecrate::mesh_swarm_state::ManifestPolicy.may_run: the run gate (valid grant AND an approval covering the sha256).
Every signature is Ed25519, checked with verify_strict, over
domain tag || "\n" || canonical JSON payload. The signer keys are the
existing crate::workload_pkg::TrustAnchors operator keys; the grant key
is the one the binding names.
Structs§
- Admission
Posture - What the node’s mesh admission looks like when a binding arrives.
- Approval
- An operator’s approval to run these binaries of one cog version.
- Approval
Row - One held approval.
- Approval
Store - Persisted operator hash approvals of one node.
- Binding
Record - The operator-signed Seed to mesh binding.
- Chain
Licence Sink - Appends every
LicenceEventto the chain. - Checkout
Grant - The signed grant payload.
- Checkout
Grant Store - Persisted binding and grant state of one node.
- Checkout
Relay - The relay.
- Checkout
Wire - A request for a cog version, as sent to
weft-licenceand by members to the steward. Every string is a short token;versionmay belatest. - CtxAdmission
- Licensed peers only (ADR-106 phase 1c): verified by admission and of
class
node. Leaves, legacy and unauthenticated peers get no floods and no sync, whether they are admitted or not. - Floor
Preview - The floor now, after a reset, and the grants that would come back.
- Floor
State - Floor state for one grant key.
- Grant
Artifact - One checked-out binary.
- Grant
Cursor - Where the grant page stopped: grants are ordered by
(seq, cog, version). - Grant
Row - One (cog, version) slot of the grant store.
- Grants
Page - One page of
GET /licence/v1/grants?since=<ctr>. - Http
Licence Transport LicenceTransportover HTTP.- Licence
Exchange - Receives, applies, forwards and syncs the licence records of one node.
- Licence
Exchange Config - Timing knobs of the exchange.
- Licence
Exchange Parts - Everything [
LicenceExchange::start] needs. - Licence
Link Config - Where
weft-licenceis and how the link is trusted. - Licence
Ref - The licence the grant rests on: a hash of the reference, no account label.
- Licence
Request - One request in HTTP shape.
- Licence
Response - What
weft-licenceanswered. - Local
Mesh Id - Shared, live handle to this node’s mesh id. A change (new nonce or pin) reaches every store holding a clone, which then report orphaned state.
- Mesh
Checkout Policy - The checkout-aware redistribution policy.
- MeshId
- The identity of one mesh:
sha256("weft-licence-v1/mesh-id\n" || genesis_pin || mesh_nonce). - NoExtra
Checks - The member profile adds nothing.
- NoFlood
- Floods nothing.
- Noop
Sink - Drops every event.
- Peer
Snapshot - The service’s peer view.
- Recording
Sink - Keeps every event (tests, and callers that drain into the chain).
- Relay
Limits - Limits on what members can cost the steward (ADR-106 section 6): a request budget per member, and a bound on checkouts running at once. Over-limit refusals are not chained, so they cannot grow the chain either.
- Renewal
Config - Timing of the pull.
- Renewal
Report - What one pass did.
- Renewer
- The steward’s renewal pull.
- Replay
Guard - Verifier-side replay memory: nonce to its signed timestamp (ms). Entries older than the window are evicted by timestamp; when the memory is full of live entries a new request is refused, never the whole set forgotten.
- Request
Auth - The signature headers of one request.
- Revived
Grant - A grant a reset would make valid again.
- RunPermit
- Evidence for the run, for provenance.
- RunRequest
- What is about to be installed or run.
- Service
Licence Links - The licence exchange’s mesh in service mode.
- Service
Links Counters - Counters, all monotonic.
- Shared
Transport - A shared transport, so one link serves every per-call client.
- Signed
Envelope - A signed payload as it travels: the exact signed JSON, key and signature (hex). One shape for every record kind; the domain tag keeps kinds apart.
- Signed
Licence Client LicenceClientthat signs every request with the steward key.- Steward
Check - Inputs of the steward checks.
- Steward
Licence Client LicenceClientbound to the store’s binding in effect.- Store
RunGate CognitumRunGateover this node’s stores.- Transport
Limits - Timeouts and caps of one link.
- Verified
Checkout Grant - A grant that passed every check and is valid right now. Only the store
makes one;
crate::mesh_artifact::ArtifactExchange::grant_checkouttakes it.
Enums§
- Bind
State - Whether a binding binds or unbinds.
- Checkout
Caller - Who is asking.
- Checkout
Refusal - Why a checkout was refused or failed.
CheckoutRefusal::codeis the stable code a requester sees. - Exchange
Error - Why a record was not accepted.
- Licence
Client Error - Why a licence call failed.
- Licence
Error - Why a licence record or store operation was refused.
- Licence
Event - Something worth chaining. The daemon maps these to chain events; the
stores only report them through a
LicenceEventSink. - Mesh
IdConfig Error - Why the configured pin or nonce gives no mesh id.
- Outcome
- What an accepted record did.
- Receipt
- What an accepted record did here.
- Request
Refused - Why a verifier refused a request. All are refused before any work is done.
- RunDenied
- Why the gate refused.
- RunRefusal
- Why the gate refused.
- RunVerdict
- What the gate decided when it did not refuse.
- Spend
- Whose budget a record’s signature verify is charged to.
- SyncMsg
- A message on
mesh.cog.sync.
Constants§
- APPROVALS_
FILE - File name inside the store directory.
- APPROVAL_
DOMAIN - Domain tag of operator hash approvals.
- ARTIFACT_
PATH - Path prefix of the artifact endpoint (BLAKE3 hex follows).
- BINDING_
DOMAIN - Domain tag of binding records.
- BOUND_
MARKER - The sticky “this node was Seed-bound” marker, beside the store file. It outlives a deleted or replaced store file, so the run gate fails closed instead of treating such a node as never bound.
- CHECKOUT_
PATH - Path of the checkout endpoint.
- CLOCK_
FLOOR_ SECS - The COG-011 bridge’s clock floor (
CLOCK_FLOOR_MS/ 1000), unix seconds (2026-05-28 UTC). A clock below it is not set: nothing is signed or issued. - DEFAULT_
MAX_ ARTIFACT_ BYTES - Default largest artifact accepted (the
weft-licencedefault limit). - EVENT_
KIND_ CHECKOUT_ GRANTED - Chain event: a grant was obtained and seeded.
- EVENT_
KIND_ CHECKOUT_ LAPSED - Chain event: the Seed withdrew a checkout (released, or no longer licensed).
- EVENT_
KIND_ CHECKOUT_ REFUSED - Chain event: a checkout request was refused or failed.
- EVENT_
KIND_ CHECKOUT_ RENEWED - Chain event: a renewed grant was installed and flooded.
- FAR_
FUTURE_ CLAMP_ SECS - The clock high-water mark grows at most this far past the newest accepted
issued_at. - GATE_
ACTION - Gate action asked for every checkout request.
- GRANTS_
FILE - File name inside the store directory.
- GRANTS_
PATH - Path of the renewal listing (
?since=<seq>). - GRANT_
DOMAIN - Domain tag of checkout grants.
- GRANT_
SKEW_ SECS - A grant issued more than this far ahead of the local clock is deferred.
- LICENCE_
EVENT_ PREFIX - Chain event kinds are this prefix plus
LicenceEvent::name, for examplelicence.binding_conflict. - LICENCE_
TOPICS - The licence control topics carried through the service.
- MAX_
APPROVALS - Most approvals held.
- MAX_
ARTIFACT_ BYTES - Largest artifact size a grant may list: 1 GiB.
- MAX_
FLOORS - Most floor entries a store file may hold (one per grant key, in practice one).
- MAX_
GRANT_ SLOTS - Most (cog, version) grant slots held.
- MAX_
GRANT_ TTL_ SECS - Longest grant lifetime (
expires_at - issued_at): 7 days. - MAX_
PAYLOAD_ BYTES - Largest signed payload accepted, in bytes.
- MAX_
REPLY_ SENDS - Reply sends in flight at once; past it a reply is dropped and counted (the peer’s next sync asks again).
- MAX_
REPLY_ SENDS_ PER_ PEER - Reply sends in flight to one peer, inside
MAX_REPLY_SENDS. - MAX_
STORE_ BYTES - Largest persisted store file read back, in bytes.
- MAX_
SYNC_ RETRIES - Unanswered requests re-sent to one peer in a row before giving up until the next periodic or on-connect sync.
- MAX_
UNIX_ TIME - Latest time accepted in any record or floor (2100-01-01), unix seconds.
- MESH_
ID_ DOMAIN - Domain tag of the mesh id hash.
- PEER_
REFRESH - How often the daemon asks the service who is connected.
- RENEW_
PATH - Path of the renewal call (signs a new grant for every active checkout).
- REQUEST_
DOMAIN - Domain tag of steward requests.
- REQUEST_
WINDOW_ MS - Default replay window, each side of the verifier’s clock.
- SYNC_
MAX_ BYTES - Most payload bytes in one sync response.
- SYNC_
MAX_ ENTRIES - Most entries in one sync response.
Traits§
- Binding
Extra Check - Where the STEWARD profile (phase 1d) plugs in: the 600 s age window, the
live
GET /api/v1/identitymatch, the grant key fingerprint the operator confirmed. Runs after the member checks and before the record is stored. - Cognitum
RunGate - The gate a
workload-hostasks before it installs or starts a Cognitum-origin cog. - Grant
Flood - Spreads a new grant to the mesh. Phase 1b replaces the implementation with
the
mesh.cog.grantflood and sync; the relay only calls this. - Licence
Client - What the checkout relay needs from
weft-licence. - Licence
Event Sink - Receives
LicenceEvents. Called after the store’s lock is released, but a sink must still not call back into the store. - Licence
Links - The mesh a
super::LicenceExchangefloods and syncs over. - Licence
Transport - One signed round trip to
weft-licence. - Peer
Admission - Which peers may sync with this node and be sent its licence floods.
- Peer
Directory - Who the machine mesh service says is connected.
Functions§
- check_
run - Decide
req.approvalsisNonewhen this node has no approval store (no mesh): every Cognitum run is then refused forno_approvalonce the grant check passes. - install_
grant - Register
signedinstoreand, when accepted, make the bytes of every currently valid grant for the cog version shareable inexchange. This is the member side of a grant arriving (reply, flood or sync). - is_
licence_ topic - True when
msgis on one ofLICENCE_TOPICS. - key_id
"ed25519:"plus 16 hex chars ofsha256(public key): the grant key id the operator compares atinittime.- may_run
- May
reqbe installed or run? Needs a valid grant and a covering approval, and the binary’sArtifactHashmust not be revoked. - mesh_
id_ from_ config - Derive the local mesh id.
Ok(None)while either value is absent: the licence path then stays inert (the policy equalsManifestPolicy). A malformed value is an error, never a silentNone, so the caller can say why checkout stays off. - sha256_
hex sha256ofbytes, lower-case hex.- sign_
approval - Sign
approvalas the operator. The sha256 list is sorted and de-duplicated first so there is one canonical spelling. - sign_
binding - Sign
recordas the operator. - sign_
grant - Sign
grantwith the grant key.grant_key_id, the artifact order andgrant_idare filled in so the result is canonical. - sign_
request - Sign a request with the steward key.
noncemust satisfyvalid_nonce. - sign_
unbind - Sign the unbind of
prev: same Seed and mesh,state: unbound,seqone higher. Everything else,bound_atincluded, is copied fromprev, so two operators unbinding the same record at once produce byte-identical records (Ed25519 is deterministic) instead of an equal-seqconflict. Any node holding an operator key can do this andLicenceExchange::issue_bindingit. - signing_
string - The bytes the steward key signs.
- system_
clock - The wall clock.
- system_
clock_ ms - The wall clock in milliseconds.
- valid_
nonce - A nonce the server accepts: 16 to 64 ASCII alphanumerics.
- verify_
approval - Verify
signed: pinned operator key, strict signature, canonical payload, well-formed fields, andmesh_idequal tolocal(A2). - verify_
approval_ signature - Signature and shape only, with no mesh check (store load, and the CLI’s check of an orphaned approval before it re-signs it for the new mesh).
- verify_
binding_ member - The MEMBER verification profile: pinned operator signature, strict
signature check, canonical payload,
mesh_idequal tolocal. Members have no Seed link, so there is no age check and no identity match. The stateful rules (seqabove the stored one, equal-seqconflicts) are the store’s (super::CheckoutGrantStore::accept_binding). - verify_
grant - Verify
signedunder the boundgrant_pubkeyand require it is forlocal. The key comparison is the cheap first check. - verify_
request - Verify
reqagainst the bound steward. Cheap checks first; the signature last; only a request whose signature verified is charged a nonce.
Type Aliases§
- Clock
- Source of unix seconds. Injected so tests control the clock.
- ClockMs
- Source of unix milliseconds. Injected so tests control the clock.
- Posture
Fn - The node’s admission state, read each time a binding arrives.
- Signed
Approval - A signed
Approval. - Signed
Binding - A signed
BindingRecord. - Signed
Grant - A signed
CheckoutGrant.