feat(model-plane): emit hash-chained InferenceReceipts natively (T7-16) - #124
Merged
Conversation
Agent Machine grants a model-plane capability to an agent pod and authenticates the local inference socket; every completion over that socket must leave a provenance receipt (its InferenceProvider contract declares receiptRequired). This makes Agent Machine emit spec-conformant, hash-chained InferenceReceipts natively into the estate's single ledger (SEAM-011: no local-only ledger). Consume-not-fork: the schema and the hash-chain/canonical-JSON/ledger machinery are vendored VERBATIM from the canonical emitter in prophet-platform apps/receipt-gateway (source commit + sha256 recorded in provenance). The only addition is emit_socket_inference_receipt(), which binds requestingAgentRef + capabilityLeaseRef (what socket auth resolves) into the receipt before chaining. Teeth (scripts/validate-inference-receipt.py, wired into make validate): a produced receipt validates against InferenceReceipt.schema.json and chains (prevHash continuity); a tampered entry and a local-only unchained entry are both rejected; an off-device receipt without lease+escalation is schema-rejected (SEAM-015).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T7-16 — Model plane capability grants + socket auth
Tranche 7 slice T7-16 (epic SourceOS-Linux/sourceos-spec#241). Agent Machine grants a model-plane capability to an agent pod and authenticates the local inference socket; every completion over that socket must leave a provenance receipt — its
InferenceProvidercontract already declarespolicy.receiptRequired: true. This makes Agent Machine emit spec-conformant, hash-chainedInferenceReceipts natively into the estate's single ledger (SEAM-011: a local-only ledger is not permitted).Consume-not-fork
contracts/model-plane/InferenceReceipt.schema.json— canonical schema vendored verbatim fromSocioProphet/prophet-platform apps/receipt-gateway/schemas/model-plane/(canonical ownerSourceOS-Linux/sourceos-spec). Source commit + sha256 pinned in the schema$comment.src/agent_machine/inference_receipt.py— the hash-chain / canonical-JSON / ledger machinery is vendored verbatim fromprophet-platform apps/receipt-gateway/tools/inference_receipt_emitter.py. We consume it; we do not re-implement the chain. The only addition isemit_socket_inference_receipt(), which bindsrequestingAgentRef(AgentPassport URN) +capabilityLeaseRef(AgentCapabilityLease URN) — what socket auth resolves — into the receipt before chaining. Both are required (fail-closed: no grant ⇒ no receipt ⇒ not authorized).Teeth —
scripts/validate-inference-receipt.py, wired intomake validateInferenceReceipt.schema.json.ledgerPrevHashcontinuity; genesis has none).ledgerPrevHash) rejected by both schema and verifier (SEAM-011).Verified locally:
make validate-inference-receiptpasses;make validate-jsonstill green (vendored schema is check-schema'd).Not in this slice (tracked separately)
emit_socket_inference_receipt()on every real completion + persistent ledger service (vs per-call file).contracts/inference-provider.schema.jsonwith the sourceos-spec Model CarryInferenceProviderfamily.