mesh: a grant rides over the OpenAI-compatible HTTP binding, and a receipt can be shown back as a witness #312
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mesh-http-grants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The gap
The grant work (#294, #301, #306) was reachable only through the library:
The fix
Grants over HTTP: a request's body carries its presentation in
jcp_presentation(presentation_in).ServeRequestthe body alone determines (granted_serve_request/granted_serve_request_responses). A caller can compute the id it signs for.metadata.joule_ceiling_uj, since a server default would otherwise enter the id unseen.GET /v1/mesh/stewardreturns the steward'sdid:key, the subject a grant must name.POST /v1/mesh/witness, with thereceiptandenvelope_hexa response'susage.energycarried, answers 200 when the journal holds the receipt and 409 when it does not. A 409 means the journal was cut, and grants are refused from then on.Mesh::witness_wiredoes the check: the envelope must verify under this steward and seal exactly that wire receipt.Statuses (
http_status):Durable journal in the binaries: with
MESH_JOURNALset, the reference server example andserve_openai_falconrecord to that file and replay it before serving, printing any unresolved serve.Body cap: a body declared over 4 MiB is refused with 413 before it is read.
Mesh SPEC §2.3 describes the binding (informative).
Checked
On the build host:
serverfeature: 15 tests pass, including an end-to-end socket test. It learns the steward, grants to it, presents the grant over HTTP, witnesses the receipt, refuses a tampered witness and refuses an oversize body.ggufandopenai/serverfeatures build, everyCargo.lockis current, and clippy is clean.Touches
mesh/mesh-rs/Cargo.lockandmesh/SPEC.mdlike #311, but in different entries and sections, so the two merge in either order.🤖 Generated with Claude Code