Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

receipt source realm

Package receipt is an append-only log of agent execution receipts.

Overview

Package receipt is an append-only log of agent execution receipts.

The thesis: provenance is not correctness. A chain can prove *who* committed to an output, *when*, that the bytes have not changed since, and *what* was staked or attested — but it cannot, by itself, prove the output was any good. Correctness comes from an external validation mechanism.

So a receipt stores commitments (hashes) to the task, inputs, outputs, tool calls and runtime, never the raw data — that lives off-chain. The realm then lets independent validators attach attestations: "I re-ran this and it reproduced", "the tests pass", "the output matches the commitment", or "rejected". The receipt's trust level is exactly the sum of the attestations it has collected, and nothing more.

Constants 1

const VerdictReproduced, VerdictTestsPass, VerdictOutputMatch, VerdictPolicyOK, VerdictRejected

1const (
2	VerdictReproduced  = "reproduced"   // re-ran and got the same output commitment
3	VerdictTestsPass   = "tests-pass"   // the referenced test suite passed
4	VerdictOutputMatch = "output-match" // output matches its commitment
5	VerdictPolicyOK    = "policy-ok"    // no forbidden tool / policy respected
6	VerdictRejected    = "rejected"     // the work is wrong or invalid
7)
source

Verdicts a validator can record against a receipt.

Functions 6

func Attest

crossing Action
1func Attest(cur realm, seq uint64, verdict, note string)
source

Attest attaches an independent validator's verdict to a receipt. The same validator cannot attest twice; the author of a receipt cannot attest to their own work (self-attestation proves nothing).

func Confirmations

Action
1func Confirmations(seq uint64) (positive, rejections int)
source

Confirmations returns (positive, rejections) attestation counts. It is a count of independent verdicts, deliberately NOT a truth value: a caller decides what threshold it trusts.

func Record

crossing Action
1func Record(
2	cur realm,
3	agent, taskHash, inputCommitment, outputCommitment,
4	runtimeID, policyVersion, toolCallsRoot string,
5	humanIntervened bool,
6) uint64
source

Record appends a new execution receipt and returns its sequence number. The caller commits to opaque hashes; the realm never sees raw payloads.

func Render

1func Render(path string) string
source

Render shows the receipt log, or a single receipt at :<seq>.

func Get

Action
1func Get(seq uint64) Receipt
source

Get returns a copy of a receipt by sequence number.

Types 2

type Attestation

struct
1type Attestation struct {
2	Validator address
3	Verdict   string
4	Note      string
5	Height    int64
6}
source

Attestation is an independent validator's verdict on a receipt.

type Receipt

struct
 1type Receipt struct {
 2	Seq              uint64
 3	Agent            string // agent id (e.g. a gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/passport id)
 4	TaskHash         string // commitment to the task spec
 5	InputCommitment  string
 6	OutputCommitment string
 7	RuntimeID        string // which runtime/model produced it
 8	PolicyVersion    string // policy in force at execution time
 9	ToolCallsRoot    string // root hash over the tool-call trace
10	HumanIntervened  bool
11	Author           address
12	Height           int64
13	Attestations     []Attestation
14}
source

Receipt commits to one agent action. Every field except Attestations is immutable once recorded.

Imports 4

Source Files 2