Skip to content

feat(model-plane): emit hash-chained InferenceReceipts natively (T7-16) - #124

Merged
mdheller merged 1 commit into
mainfrom
feat/t7-16-inference-receipts
Aug 3, 2026
Merged

feat(model-plane): emit hash-chained InferenceReceipts natively (T7-16)#124
mdheller merged 1 commit into
mainfrom
feat/t7-16-inference-receipts

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 InferenceProvider contract already declares policy.receiptRequired: true. This makes Agent Machine emit spec-conformant, hash-chained InferenceReceipts 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 from SocioProphet/prophet-platform apps/receipt-gateway/schemas/model-plane/ (canonical owner SourceOS-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 from prophet-platform apps/receipt-gateway/tools/inference_receipt_emitter.py. We consume it; we do not re-implement the chain. The only addition is emit_socket_inference_receipt(), which binds requestingAgentRef (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 into make validate

  1. Emitted socket-authed receipt validates against InferenceReceipt.schema.json.
  2. Successive receipts chain (ledgerPrevHash continuity; genesis has none).
  3. Tampered entry breaks the chain and is rejected.
  4. Local-only entry (non-genesis, no ledgerPrevHash) rejected by both schema and verifier (SEAM-011).
  5. Off-device receipt without lease + escalation is schema-rejected (SEAM-015).

Verified locally: make validate-inference-receipt passes; make validate-json still green (vendored schema is check-schema'd).

Not in this slice (tracked separately)

  • Live socket-auth daemon calling emit_socket_inference_receipt() on every real completion + persistent ledger service (vs per-call file).
  • Reconciling Agent Machine's own contracts/inference-provider.schema.json with the sourceos-spec Model Carry InferenceProvider family.

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).
@mdheller
mdheller merged commit 9af2ed6 into main Aug 3, 2026
3 checks passed
@mdheller
mdheller deleted the feat/t7-16-inference-receipts branch August 3, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant