mesh: a grant is spent only by its issuer, at the steward it names, and its spend survives a restart #301
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mesh-caller-auth-durable-spend"
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?
What was left open after #294
Mesh decided a grant with JCP's runtime but honoured it as a bearer token: whoever presented it was taken to be its subject. The steward's spend lived in memory. So:
Caller authentication (SPEC §2.1)
A grant is presented as a
Presentation:The steward refuses a presentation:
The steward holds the grant (SPEC §2.1)
The steward decides the chain as its holder, under the identity of its sealing key, so the leaf's subject must be this steward. A grant shown to another steward is refused
NotThisSteward.One budget over several stewards is sharded with
jcp_grant::shard(JCP §4.5): one shard held by each steward, summing to no more than the parent, so the total stays bounded without coordination. Chains are decided withauthorize_chained/charge_chainedfrom #300, which check and debit every link.Durable spend (SPEC §2.2, JCP §4.11)
The steward keeps a decision journal:
Authorisedentry. A decision that cannot be recorded is refused.Debitedentry is recorded.Mesh::with_journalreplays the journal through the gate: each authorisation is verified and decided again at its recorded time, and each debit is applied to its serve.JournalInconsistent: a replay the gate refuses, a debit with no authorisation, or a presentation spent twice.unresolved()with the caller and the backend that held them, and are never retried.FileJournalis append-only JSON lines, synced per append. A torn final line is dropped and cut from the file.API
Mesh::serveand mesh-openai'scomplete_chat/complete_responsesnow takeOption<&Presentation>. The demo and the falcon binary present their grants. The HTTP server presents none, as before. SPEC §2, §2.1, §2.2, §7 and §8 and the README describe all of it.Checked
On the build host:
mesh/1vector is byte-identical.--locked), the gguf and openai server features build, and the demo runs.Not covered
budget_fundsis not enforced on the chained path. Mesh charges no money, so it is unaffected.🤖 Generated with Claude Code
18a3efda3b736548be93736548be93f79fffd9fa